Skip to content

fuxianghuang1/GH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[IEEE TPAMI 2024] GH/GH++: Gradient Harmonization in Unsupervised Domain Adaptation

The paper "Gradient Harmonization in Unsupervised Domain Adaptation" has been published in IEEE TPAMI 2024.

Contents

If you find this repository useful, please consider citing our paper:

@article{huang2024gh,
  title={Gradient Harmonization in Unsupervised Domain Adaptation},
  author={Huang, Fuxiang and Song, Suqi and Zhang, Lei},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2024},
  publisher={IEEE}
}

Prerequisites

To run the code, please ensure you have the following dependencies installed:

  • Python: ==3.8
  • PyTorch: ==1.8.1
  • CUDA Toolkit: ==11.1

Data Preparation

Download the datasets and extract them to ./data:

Training UDA model

Training

Example: Training Baseline with Gradient Harmonization (GH)

CDAN

python cdan/train_image.py CDAN+E --gpu_id 0 --num_iterations 8004 --dset office --s_dset_path data/office31/amazon.txt --t_dset_path data/office31/webcam.txt --test_interval 500 --output_dir cdan/logs/cdan_gh/office31_a2w --GH True

MCD

python mcd/mcd.py data/office31 -d Office31 -s A -t W -a resnet50 --epochs 20 --seed 0 -i 500 --trade-off 10.0 --log mcd/logs/mcd_gh/office31_a2w --GH True

DWL

python dwl/main.py data/office31 -d Office31 -s A -t W -a resnet50 --GH True

GVB

python gvb/train_image.py --gpu_id 0 --GVBG 1 --GVBD 1 --num_iterations 8004 --dset office --s_dset_path data/office31/amazon.txt --t_dset_path data/office31/webcam.txt --test_interval 500 --output_dir gvb/logs/gvb_gh/office31_a2w --GH True

SSRT

python ssrt/main_SSRT_GH.office31.py

Example: Training Baseline with Enhanced Gradient Harmonization (GH++)

CDAN

python cdan/train_image.py CDAN+E --gpu_id 0 --num_iterations 8004 --dset office --s_dset_path data/office31/amazon.txt --t_dset_path data/office31/webcam.txt --test_interval 500 --output_dir cdan/logs/cdan_gh/office31_a2w --GH_new True

MCD

python mcd/mcd.py data/office31 -d Office31 -s A -t W -a resnet50 --epochs 20 --seed 0 -i 500 --trade-off 10.0 --log mcd/logs/mcd_gh/office31_a2w --GH_new True

DWL

python dwl/main.py data/office31 -d Office31 -s A -t W -a resnet50 --GH_new True

GVB

python gvb/train_image.py --gpu_id 0 --GVBG 1 --GVBD 1 --num_iterations 8004 --dset office --s_dset_path data/office31/amazon.txt --t_dset_path data/office31/webcam.txt --test_interval 500 --output_dir gvb/logs/gvb_gh/office31_a2w --GH_new True

SSRT

python ssrt/main_SSRT_GH++.office31.py

Training Retrieval model

Example: Training Baseline with Enhanced Gradient Harmonization (GH++)

python Retrieval/maincss_convharmonic.py --GH_new True

Training Detection model

Example: Training Baseline with Enhanced Gradient Harmonization (GH++)

python Detection/train.py

Acknowledgements

We would like to acknowledge the following repositories that contributed to our work:

[NOTE] If you have any questions, please don't hesitate to contact Fuxiang Huang, Suqi Song and Lei Zhang.

About

IEEE TPAMI 2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages