Giter Site home page Giter Site logo

evgeneus / graph-domain-adaptaion Goto Github PK

View Code? Open in Web Editor NEW
97.0 3.0 18.0 3.15 MB

PyTorch code for the paper "Curriculum Graph Co-Teaching for Multi-target Domain Adaptation" (CVPR2021)

Python 100.00%
domain-adaptation mtdap graph-neural-networks graph-convolutional-networks graph-domain-adaptation pytorch domainnet office pacs cdan

graph-domain-adaptaion's Introduction

PyTorch code for the paper "Curriculum Graph Co-Teaching for Multi-target Domain Adaptation" (CVPR2021)

This repo presents PyTorch implementation of Multi-targe Graph Domain Adaptation framework from "Curriculum Graph Co-Teaching for Multi-target Domain Adaptation" CVPR 2021. The framework is pivoted around two key concepts: graph feature aggregation and curriculum learning (see pipeline below or project web-page).

Results

Environment

Python >= 3.6
PyTorch >= 1.8.1

To install dependencies run (line 1 for pip or line 2 for conda env):

pip install -r requirements.txt
conda install --file requirements.txt

Disclaimer. This code has been tested with cuda toolkit 10.2. Please install PyTorch as supported by your machine.

Datasets

Four datasets are supported:

To run this code, one must check if the txt file names in data/<dataset_name> are matching with the downloaded domain folders. For e.g., to run OfficeHome, the domain sub-folders should be art/, clipart/, product/ and real/ corresponding to art.txt, clipart.txt, product.txt and real.txt that can be found in the data/office-home/.

Methods

  • CDAN
  • CDAN+E

Commands

Office-31

Run D-CGCT:

python src/main_dcgct.py \
        --method 'CDAN' \
        --encoder 'ResNet50' \
 	--dataset 'office31' \
 	--data_root [your office31 folder] \
 	--source 'webcam' \
 	--target 'dslr' 'amazon' \
 	--source_iters 200 \
 	--adapt_iters 3000 \
 	--finetune_iters 15000 \
 	--lambda_node 0.3 \
 	--output_dir 'office31-dcgct/webcam_rest/CDAN'

Run CGCT:

python src/main_cgct.py \
        --method 'CDAN' \
        --encoder 'ResNet50' \
 	--dataset 'office31' \
 	--data_root [your office31 folder] \
 	--source 'webcam' \
 	--target 'dslr' 'amazon' \
 	--source_iters 100 \
 	--adapt_iters 3000 \
 	--finetune_iters 15000 \
 	--lambda_node 0.1 \
 	--output_dir 'office31-cgct/webcam_rest/CDAN'

Office-Home

python src/main_dcgct.py \
	--method 'CDAN' \
	--encoder 'ResNet50' \
	--dataset 'office-home' \
	--data_root [your OfficeHome folder] \
	--source 'art' \
	--target 'clipart' 'product' 'real' \
	--source_iters 500 \
	--adapt_iters 10000 \
	--finetune_iters 15000 \
	--lambda_node 0.3 \
	--output_dir 'officeHome-dcgct/art_rest/CDAN' 
python src/main_cgct.py \
	--method 'CDAN' \
	--encoder 'ResNet50' \
	--dataset 'office-home' \
	--data_root [your OfficeHome folder] \
	--source 'art' \
	--target 'clipart' 'product' 'real' \
	--source_iters 500 \
	--adapt_iters 5000 \
	--finetune_iters 15000 \
	--lambda_node 0.1 \
	--output_dir 'officeHome-cgct/art_rest/CDAN' 

PACS

python src/main_dcgct.py \
	--method 'CDAN' \
	--encoder 'ResNet50' \
	--dataset 'pacs' \
	--data_root [your PACS folder] \
	--source 'photo' \
	--target 'cartoon' 'art_painting' 'sketch' \
	--source_iters 200 \
	--adapt_iters 3000 \
	--finetune_iters 15000  \
	--lambda_node 0.1 \
	--output_dir 'pacs-dcgct/photo_rest/CDAN'  
python src/main_cgct.py \
	--method 'CDAN' \
	--encoder 'ResNet50' \
	--dataset 'pacs' \
	--data_root [your PACS folder] \
	--source 'photo' \
	--target 'cartoon' 'art_painting' 'sketch' \
	--source_iters 200 \
	--adapt_iters 3000 \
	--finetune_iters 15000  \
	--lambda_node 0.1 \
	--output_dir 'pacs-cgct/photo_rest/CDAN'  

DomainNet

python src/main_dcgct.py \
	--method 'CDAN' \
	--encoder 'ResNet101' \
	--dataset 'domain-net' \
	--data_root [your DomainNet folder] \
	--source 'sketch' \
	--target 'clipart' 'infograph' 'painting' 'real' 'quickdraw' \
	--source_iters 5000 \
	--adapt_iters 50000 \
	--finetune_iters 15000  \
	--lambda_node 0.3 \
	--output_dir 'domainNet-dcgct/sketch_rest/CDAN'
python src/main_cgct.py \
	--method 'CDAN' \
	--encoder 'ResNet101' \
	--dataset 'domain-net' \
	--data_root [your DomainNet folder] \
	--source 'sketch' \
	--target 'clipart' 'infograph' 'painting' 'real' 'quickdraw' \
	--source_iters 5000 \
	--adapt_iters 50000 \
	--finetune_iters 15000  \
	--lambda_node 0.3 \
	--output_dir 'domainNet-cgct/sketch_rest/CDAN'

Citation

If you find our paper and code useful for your research, please consider citing our paper.

@inproceedings{roy2021curriculum,
  title={Curriculum Graph Co-Teaching for Multi-target Domain Adaptation},
  author={Roy, Subhankar and Krivosheev, Evgeny and Zhong, Zhun and Sebe, Nicu and Ricci, Elisa},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2021}
}

graph-domain-adaptaion's People

Contributors

evgeneus avatar roysubhankar avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

graph-domain-adaptaion's Issues

About "upgrade_source_domain"

Hi, thanks for your inspiring work! I have read the code and have some doubt about it. During the curriculum learning, why not remove the pseudo labelled target samples from the target domain after they are added to the source domain?
Expect your reply. Thanks.

How to run CGCT instead of D-CGCT?

From my understanding this code by default runs the D-CGCT variant of your method. However I am interested in comparing its performances with a MTDA method I am working on, which does not use domain labels for target samples. What should I do to run D-CGCT? Should I simply put all target data in a single txt file and use it as if it was a single target?

Thanks in advance

Multi-target settings

Thank you for the fantastic work! I realized that the "ndomain" parameter in config is always set to 2, which should be the target-combined setting in your paper.

May I know how did you train the other methods in the multi-target setting? For example, in the case of CDAN with k target domains, did you simply set the output dimension of domain classifier to be k+1?

source pretrained models

Hi,
Thank you for the awesome work! Can you provide the source pretrained model or any command to reproduce your result in Table 4 row 1 (w/o target source train) result?

DomainNet: Accuracy Information

Wanted to know that whether the accuracy reported in the paper is achieved through test split or train split.

Train clipart_train.txt infograph_train.txt painting_train.txt quickdraw_train.txt real_train.txt sketch_train.txt
Test clipart_test.txt infograph_test.txt painting_test.txt quickdraw_test.txt real_test.txt sketch_test.txt

Thanks.

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.