PyTorch code for the paper "Curriculum Graph Co-Teaching for Multi-target Domain Adaptation" (CVPR2021)
This repo presents PyTorch implementation of Multi-targe Graph Domain Adaptation framework from "Curriculum Graph Co-Teaching for Multi-target Domain Adaptation" CVPR 2021. The framework is pivoted around two key concepts: graph feature aggregation and curriculum learning (see pipeline below or project web-page).
Results
Environment
Python >= 3.6
PyTorch >= 1.8.1
To install dependencies run (line 1 for pip or line 2 for conda env):
pip install -r requirements.txt
conda install --file requirements.txt
Disclaimer. This code has been tested with cuda toolkit 10.2. Please install PyTorch as supported by your machine.
Datasets
Four datasets are supported:
- Office-31 (Kate Saenko et al., 2010)
- Office-Home (Venkateswara et al., 2017)
- PACS (Li et al., 2017)
- DomainNet (Peng et al., 2019)
To run this code, one must check if the txt file names in data/
Methods
- CDAN
- CDAN+E
Commands
Office-31
Run D-CGCT:
python src/main_dcgct.py \
--method 'CDAN' \
--encoder 'ResNet50' \
--dataset 'office31' \
--data_root [your office31 folder] \
--source 'webcam' \
--target 'dslr' 'amazon' \
--source_iters 200 \
--adapt_iters 3000 \
--finetune_iters 15000 \
--lambda_node 0.3 \
--output_dir 'office31-dcgct/webcam_rest/CDAN'