Code for paper "DecoupleNet: Decoupled Network for Domain Adaptive Semantic Segmentation"

Code for paper "DecoupleNet: Decoupled Network for Domain Adaptive Semantic Segmentation"
Abstract: Unsupervised domain adaptation in semantic segmentation has been raised to alleviate the reliance on expensive pixel-wise annotations. It leverages a labeled source domain dataset as well as unlabeled target domain images to learn a segmentation network. In this paper, we observe two main issues of the existing domain-invariant learning framework. (1) Being distracted by the feature distribution alignment, the network cannot focus on the segmentation task. (2) Fitting source domain data well would compromise the target domain performance. To address these issues, we propose DecoupleNet that alleviates source domain overfitting and enables the final model to focus more on the segmentation task. Furthermore, we put forward Self-Discrimination (SD) and introduce an auxiliary classifier to learn more discriminative target domain features with pseudo labels. Finally, we propose Online Enhanced Self-Training (OEST) to contextually enhance the quality of pseudo labels in an online manner. Experiments show our method outperforms existing state-of-the-art methods, and extensive ablation studies verify the effectiveness of each component. Code is available at this https URL.

DecoupleNet

Official implementation for our ECCV 2022 paper "DecoupleNet: Decoupled Network for Domain Adaptive Semantic Segmentation" [arXiv]

Get Started

Datasets Preparation

GTA5

Cityscapes

Training

GTA5 -> Cityspcaes

First, download the pretrained ResNet101 (PyTorch) and sourceonly model from here, and put them into the directory ./pretrained.

mkdir pretrained && cd pretrained
wget https://download.pytorch.org/models/resnet101-5d3b4d8f.pth
# Also put the sourceonly.pth into ./pretrained/

First-phase training:

python3 train_phase1.py --snapshot-dir ./snapshots/phase1 --batch-size 8 --gpus 0,1,2,3 --dist --tensorboard --batch_size_val 4 --src_rootpath [YOUR_SOURCE_DATA_ROOT] --tgt_rootpath [YOUR_TARGET_DATA_ROOT]

Second-phase training: Comming soon

Acknowledgement

This repository borrows codes from the following repos. Many thanks to the authors for their great work.

ProDA: https://github.com/microsoft/ProDA

FADA: https://github.com/JDAI-CV/FADA

semseg: https://github.com/hszhao/semseg

Citation

If you find this project useful, please consider citing:

@inproceedings{lai2022decouplenet,
  title     = {DecoupleNet: Decoupled Network for Domain Adaptive Semantic Segmentation},
  author    = {Xin Lai, Zhuotao Tian, Xiaogang Xu, Yingcong Chen, Shu Liu, Hengshuang Zhao, Liwei Wang, Jiaya Jia},
  booktitle = {ECCV},
  year      = {2022}
}

Download Source Code

Download ZIP

Paper Preview

Jul 27, 2022