Giter Site home page Giter Site logo

tntek / n2dcx Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 0.0 3.21 MB

Official implementation for [N2DCX] Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation

License: MIT License

Python 97.74% Shell 2.26%
transfer-learning domain-adaptation deep-clustering nearest-neighbor

n2dcx's Introduction

Code (pytorch) for ['Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation']([2107.12585] Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation (arxiv.org)) on Office-31, Office-Home, VisDA-C. This article is under review.

Framework

Datasets and Prerequisites

You need to download the Office-31, Office-Home, VisDA-C dataset, modify the path of images in each '.txt' under the folder './data/'.

The experiments are conducted on one GPU (NVIDIA RTX TITAN).

  • python == 3.7.3
  • pytorch ==1.6.0
  • torchvision == 0.7.0

Training and evaluation

  1. First training model on the source data, VisDA-C dataset is shown here.
cd ./object
~/anaconda3/bin/python N2DC_source.py --trte val --output ckps2020r0/source/ --da uda --gpu_id 0 --dset VISDA-C --net resnet101 --lr 1e-3 --max_epoch 10 --s 0
  1. Then adapting source model to target domain, with only the unlabeled target data.
# train the target domain by N2DC
~/anaconda3/bin/python N2DC_target.py --cls_par 0.2 --da uda --dset VISDA-C --gpu_id 0 --s 0 --t 1 --output_src ckps2020r0/source/ --output ckps2020r0/target_n2dc/ --net resnet101 --lr 1e-3 --seed 2020

# train the target domain by N2DC-EX
~/anaconda3/bin/python N2DCEX_target.py --cls_par 0.2 --da uda --dset VISDA-C --gpu_id 0 --s 0 --t 1 --output_src ckps2020r0/source/ --output ckps2020r0/target_n2dcex/ --net resnet101 --lr 1e-3 --seed 2020

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

Results

The results of N2DCX is display under the folder './object/results/'.

Citation

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

@article{tang2021n2dcx, title={Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation}, author={Song Tang, Yan Yang, Zhiyuan Ma, Norman Hendrich, Fanyu Zeng, Shuzhi Sam Ge, Changshui Zhang, Jianwei Zhang}, year={2021}, journal={arXiv:2107.12585}, url= {https://arxiv.org/abs/2107.12585} }

Acknowledgement

DeepCluster(ECCV 2018)'s work.

SHOT (ICML 2020, also source-free)'s work.

Contact

n2dcx's People

Contributors

tntek avatar

Stargazers

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

Watchers

 avatar

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.