/WGAN-ADDA

Multi-Source-Domain-Adaptation

Primary LanguagePython

Domain Adaptation on Medical Images

This repository implements the WGAN Domain Adaptation model for single source and target in pytorch framework

The overall model architecture is as shown in the figure:

WGAN Model

The code in this repository implements the following features:

  • Discriminative domain adaptation (Gradient Reversal Layer)
  • Adversarial Domain Adapatation
  • WGAN loss + Lipschtiz penalty "On Regularization of WGANs"
  • Adversairal Example Agumentation
  • CLAHE: Contrast based augmentations
  • WGAN Regularization
  • Learning Rate Scheduler

Postprocessing methods

  • Contour Detection ( OpenCV)
  • Ellipsoidal Fitting
  • Area Computation

Software Requirements

One can install the above packages using the requirements file.

pip install -r requirements.txt

Usage

Step 1: Preprocessing:

python datasets/create_dataset.py -o output_folder

Step 2: Train and Evaluate the model:

python train_gen.py --epochs 100 --batch-size 4 --lr 1e-3
python train_adv.py --epochs 100 --resume 'pretrained_model' --batch-size 4 --lr 1e-4  --gamma
python train_adv_wgan.py --epochs 100 --resume 'pretrained_model' --batch-size 4 --lr 1e-4  --gamma

Dataset

Dataset Statistics included in data directory are:

Dataset Train Set Dev Set Test Set
REFUGE 300 50 50
DRISHTI 50 25 25
ORIGA 650 50 50

Experiments

All the experiments were performed on a modern GE-Force 1080
Metrics

  • IOU for Cup and Disc
  • CDR -> Cup to Disc Ratio
  • AUROC Plot for Glaucoma and Non Glaucoma Detection

RESULTS [ Will be published soon]

Acknowledgements

  • Some parts of the code were borrowed from Deeplab V3+ Repo, AdaptSegNet Repo