Home

Awesome

Paper - SS-SFDA: Semi Supervised Source Free Domain Adaptation for Road Segmentation for Road Segmentation in Hazardous Environments

Project Page - https://gamma.umd.edu/researchdirections/autonomousdriving/weathersafe/

videofog

<!--![video](https://user-images.githubusercontent.com/18447610/114397934-d6830600-9bbc-11eb-9d96-570819c4b827.gif)-->

Watch the entire video here

Please cite our paper if you find it useful.

@article{kothandaraman2020ss,
  title={SS-SFDA: Self-Supervised Source-Free Domain Adaptation for Road Segmentation in Hazardous Environments},
  author={Kothandaraman, Divya and Chandra, Rohan and Manocha, Dinesh},
  journal={arXiv preprint arXiv:2012.08939},
  year={2020}
}
<p align="center"> <img src="cover_pic.png" width="360"> </p>

Table of Contents

Repo Details and Contents

Python version: 3.7

Code structure

Dataloaders <br>

DatasetDataloaderList of images
Clear weather CityScapesdataset/cityscapes.pydataset/cityscapes_list (train_images, val_images, train_labels, val_images)
Synthetic Fogdataset/cityscapes_fog.pydataset/cityscapes_list (train_rain_fog, val_rain_fog)
Synthetic Raindataset/cityscapes_rain.pydataset/cityscapes_list (train_rain_fog, val_rain_fog)
Synthetic Raindataset/cityscapes_rain.pydataset/cityscapes_list (train_rain_fog, val_rain_fog)
Real Fog - Foggy Zurichdataset/foggy_zurich/train(test).pydataset/foggy_zurich/lists_file_names
Real, Night Driving - Dark Zurichdataset/dark_zurich/train(test).pydataset/dark_zurich/lists_file_names
Heterogeneous Real, Rain + Night - Raincouverdataset/raincouver/raincouver.pydataset/raincouver (train_rain_fog, val_rain_fog)
Heterogeneous Real, Berkeley Deep Drivedataset/bdd/bdd_{train,val}.pydataset/bdd/bdd_list

Models

model/drnd38.py - DRN-D-38 model <br> model/drnd38_attention.py - DRN-D-38 model with self-attention

Pretrained models

The pretrained models can be found here. Use eval.py to test them.

Our network

<p align="center"> <img src="main_architecture.png"> </p>

Training your own model

Stage 1: The network is pre-trained on a clear weather dataset such as CityScapes. <br>

python train_stage1.py

Stage 2: SS-SFDA

I. Arrange the images in the increasing order of intensity (of rain/fog/snow/light), and divide into minibatches - provided by the dataset in most cases.
II. For each minibatch:
a. Initialize the network with weights from the minibatch (For the first minibatch, initialize from Stage 1)
b. python train_stage2step1.py 
c. python train_stage2step3.py. 

Stage 3: Further finetuning for heterogeneous real datasets.

I. Pick a small subset (random) of images (of the order of 5-10).
II. Initialize the network with Stage 2 weights.
III. Finetune the network with knowledge distillation
python train_stage3.py.

Evaluation:

python eval.py

Make sure to set appropriate paths to the folders containing the datasets, and the models in the training and evaluation files.

Datasets

Dependencies

PyTorch <br> NumPy <br> SciPy <br> Matplotlib <br>

Acknowledgements

This code is heavily borrowed from AdaptSegNet, and SAGAN