Skip to content

AbdullahUppal/Skin-Tissue-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skin Tissue Segmentation

Overview

This project performs grayscale skin tissue image segmentation using value-set based masking logic derived from training masks.

For each test scan, the model segments pixels into the following classes:

  • Dermal-epidermal junction
  • Dermis
  • Epidermis
  • Keratin / stratum corneum
  • Background

Problem Statement

The full problem statement is available here:

Dataset

Download the dataset from:

Project Structure

  • main.py: Entry point for running segmentation on test scans
  • vset.py: Builds class-specific value sets and applies segmentation
  • calc.py: Pixel-wise segmentation helper functions
  • constant.py: Loads dataset paths from environment variables
  • .env.example: Template for local environment configuration

Requirements

This project uses Python 3.10+ and the dependencies listed in requirements.txt:

  • opencv-python
  • scikit-learn
  • numpy
  • python-dotenv
  • torch
  • torchvision

Install dependencies:

pip install -r requirements.txt

Configuration

Create a local .env file in the project root (you can copy .env.example) and set these values:

TRAIN_FILES_PATH=
TRAIN_MASKS_PATH=
TEST_FILES_PATH=
TEST_MASKS_PATH=

Path tips:

  • Use absolute paths or carefully validated relative paths.
  • Ensure each path points to the correct folder that contains the images.
  • On Windows, both forward slashes and escaped backslashes are acceptable.

How To Run

From the project root folder:

python main.py

The script will:

  1. Detect whether CUDA is available.
  2. Build value sets from training images and masks.
  3. Segment all test scans from TEST_FILES_PATH.
  4. Save generated segmentation results to the output folder.

Output

Segmented files are written to a results folder path used by the runtime.

Current code target:

  • ./results/

If you want a folder named Result instead, update the output path in main.py accordingly.

Notes

  • Ensure training images and masks are correctly paired.
  • Keep file naming consistent between image and mask directories.
  • Verify read/write permissions for input and output folders.

Author

Abdullah Uppal

About

This project performs grayscale skin tissue image segmentation using value-set based masking logic derived from training masks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages