Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021)
Transferable Semantic Augmentation for Domain Adaptation (CVPR 2021)
We propose a Transferable Semantic Augmentation (TSA) approach to enhance the classifier adaptation ability through implicitly generating source features towards target semantics.
The code is implemented with CUDA 10.0.130, Python 3.7 and Pytorch 1.7.0.
To install the required python packages, run
pip install -r requirements.txt
Office-31 dataset can be found here.
Office-Home dataset can be found here.
VisDA 2017 dataset can be found here.
Office-31
python3 train_TSA.py --gpu_id 4 --arch resnet50 --seed 1 --dset office --output_dir log/office31 --s_dset_path data/list/office/webcam_31.txt --t_dset_path data/list/office/amazon_31.txt --epochs 40 --iters-per-epoch 500 --lambda0 0.25 --MI 0.1
Office-Home
python3 train_TSA.py --gpu_id 4 --arch resnet50 --seed 0 --dset office-home --output_dir log/office-home --s_dset_path data/list/home/Art_65.txt --t_dset_path data/list/home/Product_65.txt --epochs 40 --iters-per-epoch 500 --lambda0 0.25 --MI 0.1
VisDA 2017
python3 train_TSA.py --gpu_id 4 --arch resnet101 --seed 2 --dset visda --output_dir log/visda --s_dset_path data/list/visda2017/synthetic_12.txt --t_dset_path data/list/visda2017/real_12.txt --epochs 30 --iters-per-epoch 1000 --lambda0 0.25 --MI 0.1
If you find this code useful for your research, please cite our paper:
@inproceedings{Li2021TSA,
title = {Transferable Semantic Augmentation for Domain Adaptation},
author = {Li, Shuang and Xie, Mixue and Gong, Kaixiong and Liu, Chi Harold and Wang, Yulin and Li, Wei},
booktitle = {CVPR},
year = {2021}
}
Some codes are adapted from ISDA and Transfer-Learning-Library. We thank them for their excellent projects.
If you have any problem about our code, feel free to contact
or describe your problem in Issues.