You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is the PyTorch
implementation for ECCV 2022 Paper
"Class Is Invariant to Context and Vice Versa: On Learning Invariance for Out-Of-Distribution Generalization",
For the detailed theories,
please refer to our paper. If you have any questions or suggestions,
please email me, (I do not usually browse my
Github, so the reply to issues may be not on time).
Note that this repository is based on the LfF and DomainBed. (Note, the data processing in Lff should be checked when you use their code, the input range seems abnormal.)
If you find this work is useful in your research, please kindly consider citing:
@inproceedings{qi2022class,
title={Class Is Invariant to Context and Vice Versa: On Learning Invariance for Out-Of-Distribution Generalization},
author={Qi, Jiaxin and Tang, Kaihua and Sun, Qianru and Hua, Xian-Sheng and Zhang, Hanwang},
booktitle={ECCV},
year={2022}
}
Dependencies
python 3.9.4, pytorch 1.7.1, torchvision 0.8.2
Preparing
Download biased data from here and unzip it under the path ./Biased_dataset/data (Note the result should be ""./Biased_dataset/data/cmnist/...")
Training (examples)
1.Biased dataset, Check your download data path and the set data path in the code.
2.Training for PACS (codebase is from DomainBed, find the full version from here)
(The differences are in dataset (we need augmented images), dataloader, and settings (like no pretraining), we need 16G card)
2.1.download data(PACS) from DomainBed and put into ./data