Coder Social home page Coder Social logo

covi's Introduction

CoVi: Contrastive Vicinal Space for Unsupervised Domain Adaptation

PWC PWC

Contrastive Vicinal Space for Unsupervised Domain Adaptation
Jaemin Na, Dongyoon Han, Hyung Jin Chang, Wonjun Hwang
In ECCV 2022.


Abstract: Recent unsupervised domain adaptation methods have utilized vicinal space between the source and target domains. However, the equilibrium collapse of labels, a problem where the source labels are dom- inant over the target labels in the predictions of vicinal instances, has never been addressed. In this paper, we propose an instance-wise minimax strategy that minimizes the entropy of high uncertainty instances in the vicinal space to tackle the stated problem. We divide the vicinal space into two subspaces through the solution of the minimax prob- lem: contrastive space and consensus space. In the contrastive space, inter-domain discrepancy is mitigated by constraining instances to have contrastive views and labels, and the consensus space reduces the confusion between intra domain categories. The effectiveness of our method is demonstrated on public benchmarks, including Office-31, Office-Home, and VisDA-C, achieving state-of-the-art performances. We further show that our method outperforms the current state-of-the-art methods on PACS, which indicates that our instance-wise approach works well for multi-source domain adaptation as well.

Introduction

Video: Click the figure to watch the explanation video.

YouTube

Requirements

  • Linux
  • Python >= 3.7
  • PyTorch == 1.7.1
  • CUDA (must be a version supported by the pytorch version)

Getting Started

Training process.

Below we provide an example for training a CoVi on Office-31.

python main.py \
-gpu 0
-source amazon \
-target dslr \
-db_path $DATASET_PATH \
-baseline_path $BASELINE_PATH
  • $DATASET_PATH denotes the location where datasets are installed.
  • $BASELINE_PATH requires the path where pretrained models (DANN, MSTN, etc.) are stored.
  • For DANN, the following code may be used: pytorch-DANN

Contact

For questions, please contact: [email protected]

Citation

If you use this code in your research, please cite:

@article{na2021contrastive,
  title={Contrastive Vicinal Space for Unsupervised Domain Adaptation},
  author={Na, Jaemin and Han, Dongyoon and Chang, Hyung Jin and Hwang, Wonjun},
  journal={arXiv preprint arXiv:2111.13353},
  year={2021}
}

covi's People

Contributors

najaemin92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

covi's Issues

What is the `network` version?

Traceback (most recent call last):
File "main.py", line 9, in
import utils
File "/home/zhouwenshuo/workspace/domain_shift/nature/CoVi-master/utils.py", line 7, in
from network import models
ImportError: cannot import name 'models' from 'network' (/home/zhouwenshuo/anaconda3/envs/p38t/lib/python3.8/site-packages/network.py)`

Pre-training models

What datasets are used to train the pre-training models of DANN and MSTN? Can you provide a pre-trained model or code? Thank you very much!

code problem

        swap_src_labels = src_labels[mask_idx]
        pure_tgt_top1 = top1_label[mask_idx]
        swap_ul_loss, swap_lu_loss = 0, 0
        for i in range(num_of_mask):
            swap_ul_loss += sample_wise_loss(upper_out[i], swap_src_labels[i], top1_lower[i], upper_ratio[i])
            swap_lu_loss += sample_wise_loss(lower_out[i], pure_tgt_top1[i], top1_upper[i].cuda(), lower_ratio[i])

Is the swap_src_labels equal to the top1_lower? As the paper saying that there should be the top2 and top1 labels here, is the code correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.