All Projects → tim-learn → Shot

tim-learn / Shot

Licence: mit
code released for our ICML 2020 paper "Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Shot

cmd
Central Moment Discrepancy for Domain-Invariant Representation Learning (ICLR 2017, keras)
Stars: ✭ 53 (-60.45%)
Mutual labels:  transfer-learning, domain-adaptation
Multitask Learning
Awesome Multitask Learning Resources
Stars: ✭ 361 (+169.4%)
Mutual labels:  transfer-learning, domain-adaptation
KD3A
Here is the official implementation of the model KD3A in paper "KD3A: Unsupervised Multi-Source Decentralized Domain Adaptation via Knowledge Distillation".
Stars: ✭ 63 (-52.99%)
Mutual labels:  transfer-learning, domain-adaptation
Convolutional Handwriting Gan
ScrabbleGAN: Semi-Supervised Varying Length Handwritten Text Generation (CVPR20)
Stars: ✭ 107 (-20.15%)
Mutual labels:  transfer-learning, domain-adaptation
Deep Transfer Learning
Deep Transfer Learning Papers
Stars: ✭ 68 (-49.25%)
Mutual labels:  transfer-learning, domain-adaptation
meta-learning-progress
Repository to track the progress in Meta-Learning (MtL), including the datasets and the current state-of-the-art for the most common MtL problems.
Stars: ✭ 26 (-80.6%)
Mutual labels:  transfer-learning, domain-adaptation
adapt
Awesome Domain Adaptation Python Toolbox
Stars: ✭ 46 (-65.67%)
Mutual labels:  transfer-learning, domain-adaptation
pykale
Knowledge-Aware machine LEarning (KALE): accessible machine learning from multiple sources for interdisciplinary research, part of the 🔥PyTorch ecosystem
Stars: ✭ 381 (+184.33%)
Mutual labels:  transfer-learning, domain-adaptation
Cross Domain ner
Cross-domain NER using cross-domain language modeling, code for ACL 2019 paper
Stars: ✭ 67 (-50%)
Mutual labels:  transfer-learning, domain-adaptation
Transferlearning
Transfer learning / domain adaptation / domain generalization / multi-task learning etc. Papers, codes, datasets, applications, tutorials.-迁移学习
Stars: ✭ 8,481 (+6229.1%)
Mutual labels:  transfer-learning, domain-adaptation
Transformers-Domain-Adaptation
Adapt Transformer-based language models to new text domains
Stars: ✭ 67 (-50%)
Mutual labels:  transfer-learning, domain-adaptation
Ddc Transfer Learning
A simple implementation of Deep Domain Confusion: Maximizing for Domain Invariance
Stars: ✭ 83 (-38.06%)
Mutual labels:  transfer-learning, domain-adaptation
BA3US
code for our ECCV 2020 paper "A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation"
Stars: ✭ 31 (-76.87%)
Mutual labels:  transfer-learning, domain-adaptation
transfer-learning-algorithms
Implementation of many transfer learning algorithms in Python with Jupyter notebooks
Stars: ✭ 42 (-68.66%)
Mutual labels:  transfer-learning, domain-adaptation
Transfer-learning-materials
resource collection for transfer learning!
Stars: ✭ 213 (+58.96%)
Mutual labels:  transfer-learning, domain-adaptation
SHOT-plus
code for our TPAMI 2021 paper "Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer"
Stars: ✭ 46 (-65.67%)
Mutual labels:  transfer-learning, domain-adaptation
TA3N
[ICCV 2019 Oral] TA3N: https://github.com/cmhungsteve/TA3N (Most updated repo)
Stars: ✭ 45 (-66.42%)
Mutual labels:  transfer-learning, domain-adaptation
transfertools
Python toolbox for transfer learning.
Stars: ✭ 22 (-83.58%)
Mutual labels:  transfer-learning, domain-adaptation
Transfer Learning Library
Transfer-Learning-Library
Stars: ✭ 678 (+405.97%)
Mutual labels:  transfer-learning, domain-adaptation
Libtlda
Library of transfer learners and domain-adaptive classifiers.
Stars: ✭ 71 (-47.01%)
Mutual labels:  transfer-learning, domain-adaptation

Official implementation for SHOT

[ICML-2020] Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation

Attention: A stronger extension (https://arxiv.org/pdf/2012.07297.pdf) of SHOT will be released in a new repository (https://github.com/tim-learn/SHOT-plus).

Results:

Note that we update the code and further consider the standard learning rate scheduler like DANN and report new results in the final camera ready version. Please refer results.md for the detailed results on various datasets.

We have updated the results for Digits. Now the results of SHOT-IM for Digits are stable and promising. (Thanks to wengzejia1 for pointing the bugs in uda_digit.py).

Framework:

Prerequisites:

  • python == 3.6.8
  • pytorch ==1.1.0
  • torchvision == 0.3.0
  • numpy, scipy, sklearn, PIL, argparse, tqdm

Dataset:

  • Please manually download the datasets Office, Office-Home, VisDA-C, Office-Caltech from the official websites, and modify the path of images in each '.txt' under the folder './object/data/'.

  • Concerning the Digits dsatasets, the code will automatically download three digit datasets (i.e., MNIST, USPS, and SVHN) in './digit/data/'.

Training:

  1. Unsupervised Closed-set Domain Adaptation (UDA) on the Digits dataset
    • MNIST -> USPS (m2u) SHOT (cls_par = 0.1) and SHOT-IM (cls_par = 0.0)
     cd digit/
     python uda_digit.py --dset m2u --gpu_id 0 --output ckps_digits --cls_par 0.0
     python uda_digit.py --dset m2u --gpu_id 0 --output ckps_digits --cls_par 0.1
    
  2. Unsupervised Closed-set Domain Adaptation (UDA) on the Office/ Office-Home dataset
    • Train model on the source domain A (s = 0)
    cd object/
    python image_source.py --trte val --da uda --output ckps/source/ --gpu_id 0 --dset office --max_epoch 100 --s 0
    
    • Adaptation to other target domains D and W, respectively
    python image_target.py --cls_par 0.3 --da uda --output_src ckps/source/ --output ckps/target/ --gpu_id 0 --dset office --s 0  
    
  3. Unsupervised Closed-set Domain Adaptation (UDA) on the VisDA-C dataset
    • Synthetic-to-real
    cd object/
     python image_source.py --trte val --output ckps/source/ --da uda --gpu_id 0 --dset VISDA-C --net resnet101 --lr 1e-3 --max_epoch 10 --s 0
     python image_target.py --cls_par 0.3 --da uda --dset VISDA-C --gpu_id 0 --s 0 --output_src ckps/source/ --output ckps/target/ --net resnet101 --lr 1e-3
    
  4. Unsupervised Partial-set Domain Adaptation (PDA) on the Office-Home dataset
    • Train model on the source domain A (s = 0)
     cd object/
     python image_source.py --trte val --da pda --output ckps/source/ --gpu_id 0 --dset office-home --max_epoch 50 --s 0
    
    • Adaptation to other target domains C and P and R, respectively
     python image_target.py --cls_par 0.3 --threshold 10 --da pda --dset office-home --gpu_id 0 --s 0 --output_src ckps/source/ --output ckps/target/
    
  5. Unsupervised Open-set Domain Adaptation (ODA) on the Office-Home dataset
    • Train model on the source domain A (s = 0)
     cd object/
     python image_source.py --trte val --da oda --output ckps/source/ --gpu_id 0 --dset office-home --max_epoch 50 --s 0
    
    • Adaptation to other target domains C and P and R, respectively
     python image_target_oda.py --cls_par 0.3 --da oda --dset office-home --gpu_id 0 --s 0 --output_src ckps/source/ --output ckps/target/
    
  6. Unsupervised Multi-source Domain Adaptation (MSDA) on the Office-Caltech dataset
    • Train model on the source domains A (s = 0), C (s = 1), D (s = 2), respectively
     cd object/
     python image_source.py --trte val --da uda --output ckps/source/ --gpu_id 0 --dset office-caltech --max_epoch 100 --s 0
     python image_source.py --trte val --da uda --output ckps/source/ --gpu_id 0 --dset office-caltech --max_epoch 100 --s 1
     python image_source.py --trte val --da uda --output ckps/source/ --gpu_id 0 --dset office-caltech --max_epoch 100 --s 2
    
    • Adaptation to the target domain W (t = 3)
     python image_target.py --cls_par 0.3 --da uda --output_src ckps/source/ --output ckps/target/ --gpu_id 0 --dset office --s 0
     python image_target.py --cls_par 0.3 --da uda --output_src ckps/source/ --output ckps/target/ --gpu_id 0 --dset office --s 1
     python image_target.py --cls_par 0.3 --da uda --output_src ckps/source/ --output ckps/target/ --gpu_id 0 --dset office --s 0
     python image_multisource.py --cls_par 0.0 --da uda --dset office-caltech --gpu_id 0 --t 3 --output_src ckps/source/ --output ckps/target/
    
  7. Unsupervised Multi-target Domain Adaptation (MTDA) on the Office-Caltech dataset
    • Train model on the source domain A (s = 0)
     cd object/
     python image_source.py --trte val --da uda --output ckps/source/ --gpu_id 0 --dset office-caltech --max_epoch 100 --s 0
    
    • Adaptation to multiple target domains C and P and R at the same time
     python image_multitarget.py --cls_par 0.3 --da uda --dset office-caltech --gpu_id 0 --s 0 --output_src ckps/source/ --output ckps/target/
    
  8. Unsupervised Partial Domain Adaptation (PDA) on the ImageNet-Caltech dataset without source training by ourselves (using the downloaded Pytorch ResNet50 model directly)
    • ImageNet -> Caltech (84 classes) [following the protocol in PADA]
     cd object/
     python image_pretrained.py --gpu_id 0 --output ckps/target/ --cls_par 0.3
    

Please refer run.sh for all the settings for different methods and scenarios.

Citation

If you find this code useful for your research, please cite our paper

@inproceedings{liang2020shot,
    title={Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation},
    author={Liang, Jian and Hu, Dapeng and Feng, Jiashi},
    booktitle={International Conference on Machine Learning (ICML)},
    pages={6028--6039},
    month = {July 13--18},
    year={2020}
}

Contact

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].