• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pytorch Code release for our NeurIPS paper "Multi-source Domain Adaptation for Semantic Segmentation"

MADAN

A Pytorch Code for Multi-source Domain Adaptation for Semantic Segmentation

If you use this code in your research please consider citing:

@InProceedings{zhao2019madan,
   title = {Multi-source Domain Adaptation for Semantic Segmentation},
   author = {Zhao, Sicheng and Li, Bo and Yue, Xiangyu and Gu, Yang and Xu, Pengfei and Tan, Hu, Runbo and Chai, Hua and   Keutzer, Kurt},
   booktitle = {Advances in Neural Information Processing Systems},
   year = {2019}
}

Quick Look

Our multi-source domain adaptation builds on the work CyCADA and CycleGAN. Since we focus on Semantic Segmentation task, we remove Digit Classfication part in CyCADA.

We add following modules and achieve startling improvements.

  1. Dynamic Semantic Consistency Module
  2. Adversarial Aggregation Module
    1. Sub-domain Aggregation Discriminator
    2. Cross-domain Cycle Discriminator

While we implements MDAN for Semantic Segmentation task in Pytorch as our baseline comparasion.

Overall Structure

image-20190608104531451

Setup

Check out this repo:

git clone https://github.com/pikachusocute/MADAN.git

Install Python3 requirements

pip3 install -r requirements.txt

Dynamic Adversarial Image Generation

We follow the way in CyCADA, in the first step, we need to train Image Adaptation module to transfer source image(GTA, Synthia or Multi-source) to "source as target".

image-20190608111738818

We refer Image Adaptation module from GTA to Cityscapes as GTA->Cityscapes in the following.

GTA->Cityscapes

cd scripts/CycleGAN
bash cyclegan_gta2cityscapes.sh

In the training process, snapshot files will be stored in cyclegan/checkpoints/[EXP_NAME].

Usually, afer we run for 20 epochs, there'll be a file 20_net_G_A.pth in previous folder path.

Then we run the test process.

bash scripts/CycleGAN/test_templates.sh [EXP_NAME] 20 cycle_gan_semantic_fcn gta5_cityscapes

In multi-source case, there are both 20_net_G_A_1.pth and 20_net_G_A_2.pth exist. We use another script to run test process.

image

bash scripts/CycleGAN/test_templates_cycle.sh [EXP_NAME] 20 test synthia_cityscapes gta5_cityscapes

New dataset will be generated at ~/cyclegan/results/[EXP_NAME]/train_20.

After we obtain a new source stylized dataset, we then train segmenter on the new dataset.

Pixel Level Adaptation

In this part, we train our new segmenter on new dataset.

ln -s ~/cyclegan/results/[EXP_NAME]/train_20 ~/data/cyclegta5/[EXP_NAME]_TRAIN_60

Then we set dataflag = [EXP_NAME]_TRAIN_60 to find datasets' paths, and follow instructions to train segmenter to perform pixel level adaptation.

bash scripts/FCN/train_fcn8s_cyclesgta5_DSC.sh

Feature Level Adaptation

For adaptation, we use

bash scripts/ADDA/adda_cyclegta2cs_score.sh

Make sure you choose the desired src and tgt and datadir before. In this process, you should load your base_model trained on synthetic dataset and perform adaptation in feature level to real scene dataset.

Our Model

We release our adaptation model in the ./models, you can use scripts/eval_templates.sh to evaluate its validity.

  1. CycleGTA5_Dynamic_Semantic_Consistency
  2. CycleSYNTHIA_Dynamic_Semantic_Consistency
  3. Multi_Source_SAD_CCD

Transfered Dataset

We will release our transfer dataset soon, where our CycleGTA5_Dynamic_Semantic_Consistency model is trained to perform pixel level adaptation.

More Repositories

1

Otter

🦦 Otter, a multi-modal model based on OpenFlamingo (open-sourced version of DeepMind's Flamingo), trained on MIMIC-IT and showcasing improved instruction-following and in-context learning ability.
Python
3,560
star
2

RelateAnything

Relate Anything Model is capable of taking an image as input and utilizing SAM to identify the corresponding mask within the image.
Python
441
star
3

Generalizable-Mixture-of-Experts

GMoE could be the next backbone model for many kinds of generalization task.
Python
290
star
4

Learning-Invariant-Representations-and-Risks

Pytorch code release of CVPR 21 Paper: Learning Invariant Representations and Risks
Python
32
star
5

Mapillary2COCO

Transfer Mapillary Vistas Dataset to Coco format
Python
28
star
6

GenBench

Benchmarking and Analyzing Generative Data for Visual Recognition
Python
26
star
7

Time-Series-Analysis

2017-Summer-Term-Study
23
star
8

IIB

Python
16
star
9

Data-Structure

Data structure and Algorithm
C++
8
star
10

Higher-Cloud-Computing-Project

We are devoting to building a cloud computing platform that leverages idle resources based on mobile or local networks
Java
5
star
11

Shared-Route

New way to explore your campus life.
Java
4
star
12

VisualizeUrText

Lab1-Pair_Programming
Java
3
star
13

HCCP-Patronus

This is an explosive start-up idea bounced out of my mind I was doing my course project. I am not sure when I can achieve them, but he will be sticked there to remind me his existence.
Java
3
star
14

HighPrecisionDetection

Do some experiments
Python
1
star
15

learn_to_crawl

HTML
1
star
16

Codeforces

C++
1
star
17

luodian-LAB-4

Just for SE assignment
Java
1
star
18

Network_Alignment

Task from a UCI professor
C++
1
star
19

Pytorch_Quick_Practices

Practices to quick get into pytorch
Python
1
star
20

GO_Kitti

Currently doing KITTI challenge.
Python
1
star
21

LeetCode

Record my way to improve my coding ability towards algorithms and data structures. Helping me build a solid foundation on the road of scientific research.
C++
1
star
22

Code-contest

C++
1
star
23

Unet-TGS-Salt-Challenge

TGS Salt Identification Challenge
Python
1
star
24

Analysis-WindMachine-Data

Python
1
star
25

I-Love-Study

This is an android app made by WD.Hao and L.Bo
Java
1
star
26

HCCP-Distributed-Download

第一款HCCP上的应用
Java
1
star
27

Patricia

wdh && lb
C++
1
star
28

HIT-OS

实验代码大部分借鉴前人火炬,但是ppt做的很详细,可以一看
C
1
star
29

Machine-Learning-Ng

Ng's public courses in cousera
1
star
30

What-Do-You-Like

First web app
JavaScript
1
star