Skip to content

MetaVisionLab/SSDG

Repository files navigation

Semi-Supervised Domain Generalization with Evolving Intermediate Domain

paper

Requirements

  • numpy==1.19.2
  • Pillow==9.1.1
  • PyYAML==6.0
  • scikit_learn==1.1.1
  • six==1.15.0
  • torch==1.7.1
  • torchvision==0.8.2

Installation

git clone https://github.com/MetaVisionLab/SSDG.git
cd SSDG
pip install -r requirements.txt

Data Preparation

You can download the dataset to the folder SSDG/data,which include three folders representing three datasets in our paper

PACS

Download the dataset PACS to data/pacs and unzip it(this dataset link directly provides images and splits)

File structure:

pacs/
|–– images/
|–– splits/

Digits-DG

Since we provide the dataset splits in this repo,you just need to download the dataset Digits-DG to data/digits_dg/images and unzip it

File structure:

digits_dg/
|–– images/
|–– splits/

Office-Home-DG

Since we provide the dataset splits in this repo,you just need to download the dataset Office-Home-DG to data/office_home_dg/images and unzip it

File structure:

office_home_dg/
|–– images/
|–– splits/

Training

sh pacs.sh       #train pacs
sh digits.sh     #train digits_dg
sh officeHome.sh   #train office_home_dg

Validation

We evaluate our method on all the SSDG tasks for each dataset and report the average accuracy.For each task(for example A2C),we report its average accuracy on last 5 epoch.

cd tools/
python parse_test_res_single.py log/UDAG_A2C.log --test-log

Citation

Please cite our paper:

@article{lin2021ssdg,
  title={Semi-Supervised Domain Generalization with Evolving Intermediate Domain},
  author={Lin, Luojun and Xie, Han and Sun, Zhishu and Chen, Weijie and Liu, Wenxi and Yu, Yuanlong and Zhang, Lei},
  journal={arXiv preprint arXiv:2111.10221},
  year={2021}
}

Contact us

For any questions, please feel free to contact Han Xie or Dr. Luojun Lin.

Copyright

This code is free to the academic community for research purpose only. For commercial purpose usage, please contact Dr. Luojun Lin.