Skip to content

Guru-Deep-Singh/Group-31-W-Net-A-Deep-Model-for-Fully-Unsupervised-Image-Segmentation

Repository files navigation

Group-31-W-Net-A-Deep-Model-for-Fully-Unsupervised-Image-Segmentation

Author 1 - Guru Deep Singh ([email protected])
Author 2 - Nadine Duursman ([email protected])

Inroduction

In this repository we will describe our implementation to reproduce the deep learning model: “W-Net: A Deep Model for Fully Unsupervised Image Segmentation” [1] in Pytorch. We are doing this for a student assignment for the course Deep Learning 2020 – 2021 at Delft University of Technology. W-Net is a deep learning model that is used for unsupervised image segmentation. This is becoming increasingly important because image labelling is time consuming and it is difficult to obtain in novel domains. The W-Net architecture consists of an encoder that outputs the image segmentations, and a decoder that reconstructs the images from these segmentations. We have modified and concatenated three existing Github repositories to do so.

BSDS300

alt text alt text alt text

BSD500

alt text alt text alt text

Adapted Repositories

Repository Contents

This repository is self-contained.

Python Scripts
  • Train a W-net model with parameters mentioned in another config file. [Train] [Config]
  • Plot the graph for reconstruction and N-cut loss. [Plot-Graph]
  • Create Segmentations for the test data. [Test]
  • Calculate SC, PRI and VI for the segmentation. [Metric] Some other python scripts to make the approach more modular.
Datasets

The Repository also provides a pre-trained model which we trained ourselves from scratch and created segmentations of BSDS300 and segmentations of BSDS500.

How to use this repository

  • Clone the Repository
Training
Generating the Segmentations
  • In test.py select the type of dataset you want to create segmentations for "500" or "300". All the images are already placed in their respective paths. So you do not need to worry about that.

datasets/BSDS500Val/test/images_300 datasets/BSDS500Val/test/images_500

  • Run the script.
  • Generated Segmentations will be in the following depending on the type you chose

datasets/BSDS500val/test/segmentations_pred_300 datasets/BSDS500val/test/segmentations_pred_500

Calculating Metrics

Note- If you want to visualize the predicted segmentation against ground truth. Open the test_bench.py and set "vis" variable as True.

Results

BSDS300

alt text

BSDS500

alt text

Reconstruction Loss

alt text

N-Cut Loss

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages