For this project, we used python 3.8.5. We recommend setting up a new virtual environment:
python -m venv ~/venv/mic-cls
source ~/venv/mic-cls/bin/activate
In that environment, the requirements can be installed with:
pip install -r requirements.txt
We use Weights and Biases (wandb) to track our experiments and results.
For that purpose, please create a new project MIC
with your account.
The datasets used in the repository can be downloaded from the following links:
- Office-Home
- VisDA-2017 (under classification track)
The datasets are automatically downloaded to the examples/data/
folder if it is not available.
For experiments in our paper, we use a script to automatically generate the different configurations and train them:
python run_experiments.py --exp <ID>
More information about the available experiments and their assigned IDs, can be found in experiments.py.
The experiment progress is logged on Weights&Biases.
For VisDA-2017, the mean over the class accuracies is reported. This value is denoted as 'mean correct' in the logs as explained in val-iisc/SDAT#1.
The most relevant files for MIC are:
- experiment.py: Definition of the experiment configurations in our paper.
- examples/cdan_mcc_sdat_masking.py: Training script for UDA with MIC(SDAT).
- dalib/modules/masking.py: Implementation of MIC.
- dalib/modules/teacher.py: Implementation of the EMA teacher.
MIC for classification is based on the following open-source projects. We thank their authors for making the source code publicly available.