Skip to content

This is the DL repository for Semantic Segmentation using U-Net model in pytorch library.

License

Notifications You must be signed in to change notification settings

UsamaI000/CamVid-Segmentation-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Semantic Segmentation Pytorch

Semantic Segmentation

Basically, segmentation is a process that partitions an image into regions. It is an image processing approach that allows us to separate objects and textures in images. Segmentation is especially preferred in applications such as remote sensing or tumor detection in biomedicine. The goal of semantic image segmentation is to label each pixel of an image with a corresponding class of what is being represented. Because we’re predicting for every pixel in the image, this task is commonly referred to as dense prediction. Note that unlike the classifcation tasks, the expected output in semantic segmentation are not just labels and bounding box parameters. The output itself is a high resolution image (typically of the same size as input image) in which each pixel is classified to a particular class. Thus it is a pixel level image classification.

Guide to use

  • Download the files
  • Open Config.py and adjust it according to your setup and adjust related file paths in it.
  • To modify training loss and optimizer open train.py and edit it.
  • To start training run train.py
  • To test your model or get predictions of unseen data run test.py and predict.py

Dataset

The data used for semantic Segmentation is CamVid Dataset. The dataset has 367 Training images, 101 Validation images and 232 Test images

Link: https://www.kaggle.com/carlolepelaars/camvid

Training

We Trained the U-Net model on the dataset


Training Setup

Following configurations were used for final model training.

  • Batch Size: 8
  • Learning rate: 0.0005
  • Optimizer: SGD
  • Loss: Focal Loss
  • Metric: IoU

Training Results

The plot for Training of model is shown below.

The Loss Curve during Training

The Original Images were

The Original Masks were

The Predicted Masks were

Test Results

The plot for Test predictions of model are shown below.

The Original Images were

The Original Masks were

The Predicted Masks were

Improvements

  • mAP is to be implemented.
  • Some other loss function like "Dice Loss" to be implemented.

About

This is the DL repository for Semantic Segmentation using U-Net model in pytorch library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published