This is a PyTorch implementation of the paper Adversarial Teacher-Student Representation Learning for Domain Generalization
See the requirements.txt
for environment configuration.
pip install -r requirements.txt
- PACS: I prepared a version of the PACS dataset (ACS-P) here, where A, C, and S domains are used as the source domains and P is set as the target domain. You also can change to your own dataset, but keep the following structure:
ACS-P/
├── ACS
│ ├── 1
│ │ ├── 0
│ │ ├── 1
│ │ ├── 2
│ │ ├── 3
│ │ ├── 4
│ │ ├── 5
│ │ └── 6
│ ├── 2
│ │ ├── 0
│ │ ├── 1
│ │ ├── 2
│ │ ├── 3
│ │ ├── 4
│ │ ├── 5
│ │ └── 6
│ └── 3
│ ├── 0
│ ├── 1
│ ├── 2
│ ├── 3
│ ├── 4
│ ├── 5
│ └── 6
└── P
└── 0
├── 0
├── 1
├── 2
├── 3
├── 4
├── 5
└── 6
cd warmup/main/
python train.py
cd main/main/
python train.py
The reproduced result is a little bit lower than the reported result in the paper. Hope that someone could help me fill the gap.
Target | ResNet-18 | ResNet-50 | ||
---|---|---|---|---|
Reproduced Accuracy | Reported Accuracy | Reproduced Accuracy | Reported Accuracy | |
Photo | 94.4 | 97.3 | 97.7 | 98.9 |
You can use the file samples.ipynb
to view images generated from the Augmentor. For examples: