This repository contains the codes for one of my projects on Domain Adaptation at Image Analysis and Computer Vision Lab.
In this repository, I have codes to run experiments on standard Semi-Supervised Domain Adaptation (SSDA) benchmarks such as DomainNet, Office-31 and Office-Home Datasets. There are also additional experiments for artificially imbalanced step and exponential imbalanced datasets.
- This repository is built on top of SSDA_MME [1].
- Download (one of) the datasets using
bash download_data.sh
. Modify this file appropriately to download the desired dataset. - To run the entropy maximization setting for Domain Adaptation, run:
python main.py
--method MME # options: {ENT, S+T}
--dataset multi # options: {office, office_home}
--source real # source domain
--target sketch # target domain
--net resnet34 # network architecture
--attribute glove_50 # semantic initialization of prototypes
--dim 50 # dimensions of semantics
--loss CBFL # options: {CE, CBFL, FL}
--alpha 1 # CBFL parameter
--beta 0.999 # another cbfl parameter
--deep 1 # option to set classifier type
--patience 10 # early stopping patience
--mode train # train or inference mode
--save_check # save checkpoint
- For a more detailed description of each of the parameters please see
./main.py
To run the second stage of training i.e., target reweighting, please run python main_stagetwo.py --pretrained /path/to/model_ckpt
, by passing the saved checkpoint from stage 1 as the parameter.
To plot t-SNE plots of the feature representations please navigate to the ./tsne
folder.
- Semi-Supervised Domain Adaptation vie Minimax Entropy. Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, Kate Saenko. ICCV 2019.