The official codes of "Semi-supervised Models are Strong Unsupervised Domain Adaptation Learners".

Overview

SSL models are Strong UDA learners

highlights

Introduction

This is the official code of paper "Semi-supervised Models are Strong Unsupervised Domain Adaptation Learners". It is based on pure PyTorch and presents the high effectiveness of SSL methods on UDA tasks. You can easily develop new algorithms, or readily apply existing algorithms. Codes for UDA methods and "UDA + SSL" are given in another project.

The currently supported algorithms include:

Semi-supervised learning for unsupervised domain adatation.
  • Semi-supervised learning by entropy minimization (Entropy Minimization, NIPS 2004)
  • Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks (Self-training, ICMLW 2013)
  • Temporal ensembling for semi-supervised learning (Pi-model, ICML 2017)
  • Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results (Mean-teacher, NIPS 2017)
  • Virtual adversarial training: a regularization method for supervised and semi-supervised learning (VAT, TPAMI 2018)
  • Mixmatch: A holistic approach to semi-supervised learning (MixMatch, NIPS 2019)
  • Unsupervised data augmentation for consistency training (UDA, NIPS 2020)
  • Fixmatch: Simplifying semi-supervised learning with consistency and confidence (FixMatch, NIPS 2020)

highlights

Installation

This implementation is based on the Transfer Learning Library. Please refer to 'requirements' for installation. Note that only "DistributedDataParallel" training is supported in the current branch.

Usage

We have examples in the directory examples. A typical usage is

# Train a FixMatch on Office-31 Amazon -> Webcam task using ResNet 50.
# Assume you have put the datasets under the path `args.datapath/office-31`, 
# or you are glad to download the datasets automatically from the Internet to this path. Please go to the dictionary ./examples, and run:
CUDA_VISIBLE_DEVICES=0,1,2,3 python ../main.py --use_ema --dist_url tcp://127.0.0.1:10013 --multiprocessing_distributed --regular_only_feature --p_cutoff 0.95 --seed 1  --epochs 30  --batchsize 32 --mu 7 --iters_per_epoch 250  --source A --target W  --method Fixmatch --save_dir ../log/Office31 --dataset Office31

In the directory examples, you can find all the necessary running scripts to reproduce the benchmarks with specified hyper-parameters. We don't provide the checkpoints since the training of each model is quick and there are too many tasks.

Contributing

Any pull requests or issues are welcome. Models of other SSL methods on UDA tasks are highly expected.

Citation

If you use this toolbox or benchmark in your research, please cite this project.

@inproceedings{SSL2UDA,
  author = {xxx},
  title = {Semi-supervised Models are Strong Unsupervised Domain Adaptation Learners},
  year = {2021},
  publisher = {xxx},
  journal = {xxx},
}

Acknowledgment

We would like to thank Transfer Learning Library for their excellent contribution.

License

MIT License, the same to Transfer Learning Library.

You might also like...
Python codes for Lite Audio-Visual Speech Enhancement.

Lite Audio-Visual Speech Enhancement (Interspeech 2020) Introduction This is the PyTorch implementation of Lite Audio-Visual Speech Enhancement (LAVSE

Codes for our IJCAI21 paper: Dialogue Discourse-Aware Graph Model and Data Augmentation for Meeting Summarization
Codes for our IJCAI21 paper: Dialogue Discourse-Aware Graph Model and Data Augmentation for Meeting Summarization

DDAMS This is the pytorch code for our IJCAI 2021 paper Dialogue Discourse-Aware Graph Model and Data Augmentation for Meeting Summarization [Arxiv Pr

Pytorch codes for
Pytorch codes for "Self-supervised Multi-view Stereo via Effective Co-Segmentation and Data-Augmentation"

Self-Supervised-MVS This repository is the official PyTorch implementation of our AAAI 2021 paper: "Self-supervised Multi-view Stereo via Effective Co

Codes for ACL-IJCNLP 2021 Paper
Codes for ACL-IJCNLP 2021 Paper "Zero-shot Fact Verification by Claim Generation"

Zero-shot-Fact-Verification-by-Claim-Generation This repository contains code and models for the paper: Zero-shot Fact Verification by Claim Generatio

Source codes of CenterTrack++ in 2021 ICME Workshop on Big Surveillance Data Processing and Analysis
Source codes of CenterTrack++ in 2021 ICME Workshop on Big Surveillance Data Processing and Analysis

MOT Tracked object bounding box association (CenterTrack++) New association method based on CenterTrack. Two new branches (Tracked Size and IOU) are a

The codes and models in 'Gaze Estimation using Transformer'.
The codes and models in 'Gaze Estimation using Transformer'.

GazeTR We provide the code of GazeTR-Hybrid in "Gaze Estimation using Transformer". We recommend you to use data processing codes provided in GazeHub.

codes for paper Combining Dynamic Local Context Focus and Dependency Cluster Attention for Aspect-level sentiment classification
codes for paper Combining Dynamic Local Context Focus and Dependency Cluster Attention for Aspect-level sentiment classification

DLCF-DCA codes for paper Combining Dynamic Local Context Focus and Dependency Cluster Attention for Aspect-level sentiment classification. submitted t

The codes for the work "Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation"

Swin-Unet The codes for the work "Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation"(https://arxiv.org/abs/2105.05537). A validatio

The source codes for ACL 2021 paper 'BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data'
The source codes for ACL 2021 paper 'BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data'

BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data This repository provides the implementation details for

Comments
  • Command to run the FixMatch

    Command to run the FixMatch

    Hi, Thanks a lot for your work.

    Can you give me the simple command to run the FixMatch on DomainNet/Office dataset without disturl? I have two GPUs

    Or If I want to use FixMatch in the original Repo on One GPU, what changes shall I need to do in the original Transfer Learning Library Repo?

    opened by shreejalt 1
Owner
Yabin Zhang
Yabin Zhang
Official codes: Self-Supervised Learning by Estimating Twin Class Distribution

TWIST: Self-Supervised Learning by Estimating Twin Class Distributions Codes and pretrained models for TWIST: @article{wang2021self, title={Self-Sup

Bytedance Inc. 85 Dec 15, 2022
The official codes of our CVPR2022 paper: A Differentiable Two-stage Alignment Scheme for Burst Image Reconstruction with Large Shift

TwoStageAlign The official codes of our CVPR2022 paper: A Differentiable Two-stage Alignment Scheme for Burst Image Reconstruction with Large Shift Pa

Shi Guo 32 Dec 15, 2022
A novel method to tune language models. Codes and datasets for paper ``GPT understands, too''.

P-tuning A novel method to tune language models. Codes and datasets for paper ``GPT understands, too''. How to use our code We have released the code

THUDM 562 Dec 27, 2022
Codes for NAACL 2021 Paper "Unsupervised Multi-hop Question Answering by Question Generation"

Unsupervised-Multi-hop-QA This repository contains code and models for the paper: Unsupervised Multi-hop Question Answering by Question Generation (NA

Liangming Pan 70 Nov 27, 2022
This is my codes that can visualize the psnr image in testing videos.

CVPR2018-Baseline-PSNRplot This is my codes that can visualize the psnr image in testing videos. Future Frame Prediction for Anomaly Detection – A New

Wenhao Yang 12 May 29, 2021
codes for Image Inpainting with External-internal Learning and Monochromic Bottleneck

Image Inpainting with External-internal Learning and Monochromic Bottleneck This repository is for the CVPR 2021 paper: 'Image Inpainting with Externa

null 97 Nov 29, 2022
Source codes for "Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs"

Structure-Aware-BART This repo contains codes for the following paper: Jiaao Chen, Diyi Yang:Structure-Aware Abstractive Conversation Summarization vi

GT-SALT 56 Dec 8, 2022
Codes for our paper "SentiLARE: Sentiment-Aware Language Representation Learning with Linguistic Knowledge" (EMNLP 2020)

SentiLARE: Sentiment-Aware Language Representation Learning with Linguistic Knowledge Introduction SentiLARE is a sentiment-aware pre-trained language

null 74 Dec 30, 2022
Source codes for the paper "Local Additivity Based Data Augmentation for Semi-supervised NER"

LADA This repo contains codes for the following paper: Jiaao Chen*, Zhenghui Wang*, Ran Tian, Zichao Yang, Diyi Yang: Local Additivity Based Data Augm

GT-SALT 36 Dec 2, 2022