BenchmarkPDA is a Pytorch framework to benchmark Partial Domain Adaptation methods with different model selection strategies.
- pytorch==1.8.0
- torchvision==0.9.
- torchaudio==0.8.0
- cudatoolkit=11.1
- pyyaml
- scikit-learn
- jupyterlab
- prettytable
- ipywidgets
- tqdm
- pandas
- opencv
- pot
- cvxpy
The currently supports the following datasets:
- Office-Home (Venkateswara et al., 2017)
- VisDA (Peng et al., 2017)
Place them in the folder datasets
. Make sure to place the image path lists in the image_list
in the respective dataset folder.
The currently available methods are:
- Source Only
- PADA (Cao et al., 2018a)
- SAFN (Xu et al., 2019)
- BA3US (Jian et al., 2020)
- AR (Gu et al., 2021)
- JUMBOT (Fatras et al., 2021)
- MPOT (Nguyen et al., 2022).
To run the hyper-parameter search for the Office-Home dataset use
python hp_search_train_val.py --method METHOD --dset office-home --source_domain Art --target_domain Clipart
where METHOD should be one of the following: source_only_plus
, pada
, ba3us
, ar
, jumbot
, mpot
.
To run the hyper-parameter search for the VisDA dataset use
python hp_search_train_val.py --method METHOD --dset visda --source_domain train --target_domain validation
where METHOD should be one of the following: source_only_plus
, pada
, ba3us
, ar
, jumbot
, mpot
. The train domain are the synthetic images, while the validation domain corresponds to the real images.
We select the best hyper-parameters using the Jupyter Notebook Step 2 - Select Hyper-Parameter Grid Search.ipynb
. It includes code to recreate Tables 4 and 10.
To train the models with the different hyper-parameters chosen use
python train_hp_chosen.py --dset DATASET
where DATASET should be office-home
or visda
.
We gather all the results using the Jupyter Notebook Step 4 - Collect Results.ipynb
. It includes code to generate Tables 1, 5, 6, 7 and 12.
This source code is released under the MIT license, included here.