Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021)

Related tags

Deep Learning TSA
Overview

Transferable Semantic Augmentation for Domain Adaptation

Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021)

Paper

Transferable Semantic Augmentation for Domain Adaptation (CVPR 2021)

We propose a Transferable Semantic Augmentation (TSA) approach to enhance the classifier adaptation ability through implicitly generating source features towards target semantics.

Prerequisites

The code is implemented with CUDA 10.0.130, Python 3.7 and Pytorch 1.7.0.

To install the required python packages, run

pip install -r requirements.txt

Datasets

Office-31

Office-31 dataset can be found here.

Office-Home

Office-Home dataset can be found here.

VisDA 2017

VisDA 2017 dataset can be found here.

Running the code

Office-31

python3 train_TSA.py --gpu_id 4 --arch resnet50 --seed 1 --dset office --output_dir log/office31 --s_dset_path data/list/office/webcam_31.txt --t_dset_path data/list/office/amazon_31.txt --epochs 40 --iters-per-epoch 500 --lambda0 0.25 --MI 0.1

Office-Home

python3 train_TSA.py --gpu_id 4 --arch resnet50 --seed 0 --dset office-home --output_dir log/office-home --s_dset_path data/list/home/Art_65.txt --t_dset_path data/list/home/Product_65.txt --epochs 40 --iters-per-epoch 500 --lambda0 0.25 --MI 0.1

VisDA 2017

python3 train_TSA.py --gpu_id 4 --arch resnet101 --seed 2 --dset visda --output_dir log/visda --s_dset_path data/list/visda2017/synthetic_12.txt --t_dset_path data/list/visda2017/real_12.txt --epochs 30 --iters-per-epoch 1000 --lambda0 0.25 --MI 0.1

Citation

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

@inproceedings{Li2021TSA,
    title = {Transferable Semantic Augmentation for Domain Adaptation},
    author = {Li, Shuang and Xie, Mixue and Gong, Kaixiong and Liu, Chi Harold and Wang, Yulin and Li, Wei},
    booktitle = {CVPR},   
    year = {2021}
}

Acknowledgements

Some codes are adapted from ISDA and Transfer-Learning-Library. We thank them for their excellent projects.

Contact

If you have any problem about our code, feel free to contact

or describe your problem in Issues.

Comments
  • Killed due to memory issue

    Killed due to memory issue

    Thanks a lot for releasing the code. Your work is fabulous!

    While I tried to reproduce the results, I noticed that the program would occupy more and more memory (~3G/epoch, with num_worker adjusted to 1) and got killed by the machine later. I am running Office31 experiments and I believe this memory issue is rooted in the code maybe.

    My environment is almost the same as required except that my torchvision is 0.5.0.

    Could you please give me some clue to tackle this? Thanks in advance!

    opened by MoriZSJ 4
  • CUDA out of memory when training in large dataset

    CUDA out of memory when training in large dataset

    Thanks a lot for releasing the code! When using TSA for domain adaptation in much larger dataset(like Imagenet-1k(source domain),other dataset(target domain)), I found that the GPU memory is not enougn to deal with the Memory Module(memory_target_features etc. in your code):RuntimeError: CUDA out of memory. It troubles me. Do you have any good solution for this problem? Regards。

    opened by zou-yiqi 0
  • Can not reproduce the result in visda2017

    Can not reproduce the result in visda2017

    Hi, I use this repository can only achieve ~74% on visda2017, which is much worse than the reported results. Could you help me find the reason? I also can not get a response when I sent emails to the authors.

    Regards,

    opened by xxxzhi 0
  • how to reproduce office-31's W->A result in paper

    how to reproduce office-31's W->A result in paper

    I've tried to reproduce the result of office-31, but there's no good. I only got 74.6 in W->A, which is far away from 76.8 as claimed in the paper. Could you please kindly help me to see if there's any trick I've missed.

    opened by sunbaigui 3
  • the formules of Sigma2 in ISDA and TSA seem to be same,but code looks like different.

    the formules of Sigma2 in ISDA and TSA seem to be same,but code looks like different.

    Hello,I read your paper,this is a impressive work! I notice that the caculate of sigma2 is different between TSA and ISDA. ISDA: sigma2 = (weight_m - NxW_kj).pow(2).mul(CV_temp.view(N, 1, A).expand(N, C, A)).sum(2) TSA:sigma2 = torch.bmm(torch.bmm(NxW_ij - NxW_kj, t_CV_temp), (NxW_ij - NxW_kj).permute(0, 2, 1))

    ISDA use dot mul while your work use bmm , i want to know if there any meaningful difference between this two implementation? ignore【Lambda * datW_x_detaMean_NxC】,the formules in ISDA and TSA seem to be same,but code looks like different.

    THANKS!

    opened by ShiyeLi 2
  • Could you share the code for the visualization of augmentation?

    Could you share the code for the visualization of augmentation?

    I found your work is impressive. Just want to know whether it is possible to share the code for visualization as it is nontrivial to implement it.

    Thanks!

    opened by changliu816 0
Owner
null
Code release for Universal Domain Adaptation(CVPR 2019)

Universal Domain Adaptation Code release for Universal Domain Adaptation(CVPR 2019) Requirements python 3.6+ PyTorch 1.0 pip install -r requirements.t

THUML @ Tsinghua University 229 Dec 23, 2022
git git《Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking》(CVPR 2021) GitHub:git2] 《Masksembles for Uncertainty Estimation》(CVPR 2021) GitHub:git3]

Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking Ning Wang, Wengang Zhou, Jie Wang, and Houqiang Li Accepted by CVPR

NingWang 236 Dec 22, 2022
Code release for "Self-Tuning for Data-Efficient Deep Learning" (ICML 2021)

Self-Tuning for Data-Efficient Deep Learning This repository contains the implementation code for paper: Self-Tuning for Data-Efficient Deep Learning

THUML @ Tsinghua University 101 Dec 11, 2022
Code Release for ICCV 2021 (oral), "AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds"

AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds (ICCV 2021 oral) **Project Page | Arxiv ** Runsong Zhu¹, Yuan Liu², Zhen Dong¹, Te

null 40 Dec 30, 2022
Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation".

PixelTransformer Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation". Project Page Installation Please insta

Shubham Tulsiani 24 Dec 17, 2022
Code release for ICCV 2021 paper "Anticipative Video Transformer"

Anticipative Video Transformer Ranked first in the Action Anticipation task of the CVPR 2021 EPIC-Kitchens Challenge! (entry: AVT-FB-UT) [project page

Facebook Research 123 Dec 13, 2022
Official code release for ICCV 2021 paper SNARF: Differentiable Forward Skinning for Animating Non-rigid Neural Implicit Shapes.

Official code release for ICCV 2021 paper SNARF: Differentiable Forward Skinning for Animating Non-rigid Neural Implicit Shapes.

null 235 Dec 26, 2022
Official code release for "Learned Spatial Representations for Few-shot Talking-Head Synthesis" ICCV 2021

Official code release for "Learned Spatial Representations for Few-shot Talking-Head Synthesis" ICCV 2021

Moustafa Meshry 16 Oct 5, 2022
This repo is the code release of EMNLP 2021 conference paper "Connect-the-Dots: Bridging Semantics between Words and Definitions via Aligning Word Sense Inventories".

Connect-the-Dots: Bridging Semantics between Words and Definitions via Aligning Word Sense Inventories This repo is the code release of EMNLP 2021 con

null 12 Nov 22, 2022
[CVPR 21] Vectorization and Rasterization: Self-Supervised Learning for Sketch and Handwriting, IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2021.

Vectorization and Rasterization: Self-Supervised Learning for Sketch and Handwriting, CVPR 2021. Ayan Kumar Bhunia, Pinaki nath Chowdhury, Yongxin Yan

Ayan Kumar Bhunia 44 Dec 12, 2022
[CVPR 2022] CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation

CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation Prerequisite Please create and activate the following conda envrionment. To r

Qin Wang 87 Jan 8, 2023
Code release for NeX: Real-time View Synthesis with Neural Basis Expansion

NeX: Real-time View Synthesis with Neural Basis Expansion Project Page | Video | Paper | COLAB | Shiny Dataset We present NeX, a new approach to novel

null 536 Dec 20, 2022
The code release of paper 'Domain Generalization for Medical Imaging Classification with Linear-Dependency Regularization' NIPS 2020.

Domain Generalization for Medical Imaging Classification with Linear Dependency Regularization The code release of paper 'Domain Generalization for Me

Yufei Wang 56 Dec 28, 2022
This is the official code release for the paper Shape and Material Capture at Home

This is the official code release for the paper Shape and Material Capture at Home. The code enables you to reconstruct a 3D mesh and Cook-Torrance BRDF from one or more images captured with a flashlight or camera with flash.

null 89 Dec 10, 2022
Code release for "COTR: Correspondence Transformer for Matching Across Images"

COTR: Correspondence Transformer for Matching Across Images This repository contains the inference code for COTR. We plan to release the training code

UBC Computer Vision Group 360 Jan 6, 2023
Code release for paper: The Boombox: Visual Reconstruction from Acoustic Vibrations

The Boombox: Visual Reconstruction from Acoustic Vibrations Boyuan Chen, Mia Chiquier, Hod Lipson, Carl Vondrick Columbia University Project Website |

Boyuan Chen 12 Nov 30, 2022
We will release the code of "ConTNet: Why not use convolution and transformer at the same time?" in this repo

ConTNet Introduction ConTNet (Convlution-Tranformer Network) is proposed mainly in response to the following two issues: (1) ConvNets lack a large rec

null 93 Nov 8, 2022
Code release to accompany paper "Geometry-Aware Gradient Algorithms for Neural Architecture Search."

Geometry-Aware Gradient Algorithms for Neural Architecture Search This repository contains the code required to run the experiments for the DARTS sear

null 18 May 27, 2022
This is the dataset and code release of the OpenRooms Dataset.

This is the dataset and code release of the OpenRooms Dataset.

Visual Intelligence Lab of UCSD 95 Jan 8, 2023