Giter VIP home page Giter VIP logo

pcs-fuda's Introduction

Prototypical Cross-domain Self-supervised Learning for Few-shot Unsupervised Domain Adaptation (PCS)

Pytorch implementation of PCS (Prototypical Cross-domain Self-supervised network) [Homepage] [PDF]

Overview

Architecture of Network

Architecture of Network

Compared with state-of-the-art methods, PCS improves the mean classification accuracy over different domain pairs on FUDA by 10.5%, 4.3%, 9.0%, and 13.2% on Office, Office-Home, VisDA-2017, and DomainNet, respectively. q

Requirements

conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2 -c pytorch
pip install -r requirements.txt
pip install -e .

Training

  • Download or soft-link your dataset under data folder (Split files are provided in data/splits, supported datasets are Office, Office-Home, VisDA-2017, and DomainNet)
  • To train the model, run following commands:
CUDA_VISIBLE_DEVICES=0 python pcs/run.py --config config/${DATASET}/${DOMAIN-PAIR}.json
CUDA_VISIBLE_DEVICES=0,1 python pcs/run.py --config config/office/D-A-1.json

[2021.06.24] We released all configs for office dataset.

Citation

@InProceedings{Yue_2021_Prototypical,
author = {Yue, Xiangyu and Zheng, Zangwei and Zhang, Shanghang and Gao, Yang and Darrell, Trevor and Keutzer, Kurt and Sangiovanni-Vincentelli, Alberto},
title = {Prototypical Cross-domain Self-supervised Learning for Few-shot Unsupervised Domain Adaptation},
booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021}
}

Acknowlegdement

This code is built on [MME]. We thank the authors for sharing their codes.

pcs-fuda's People

Contributors

zhengzangw 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  avatar

pcs-fuda's Issues

{k_m}=n_c

I am very honored to learn a lot from your article. However, I have a question. Can you explain specifically why setting {k_m}=n_c?I would be very grateful to receive your reply.

About the loss weight in config files.

In loss_params domain of configs:

"loss_params": {
"thres_src": 0.99,
"thres_tgt": 0.99,
"temp": 0.1,
"loss": [
"cls-so",
"proto-each",
"I2C-cross",
"semi-condentmax",
"semi-entmin",
"tgt-condentmax",
"tgt-entmin"
],
"weight": [1, 1, 1, 0.05, 0.05, 0.05, 0.05],
"clus": {
"kmeans_freq": 1,
"type": ["each"],
"n_k": 15,
"k": [31, 62]
}
}

Would you please clarify the meanings for the statements in loss domain, such as semi-condentmax? Thanks!

Getting different no for source only experiments

For experiments on the source-only value: I omit all the losses apart from the 'cls-so' for Product->Real experiment but I am getting usually high test accuracy of ~55% while the paper reported only 42%.
Should I do anything else apart from the above to get numbers for Source only experiments?

The GPU usage is 0% but the memory usage is 1000MiB

When I configured my environment according to requirement.txt and downloaded the officehome dataset, I got stuck at kmeans when I ran run.py. My cuda is 11.8.
The last result I wrote in log is below:
屏幕截图 2024-06-08 192616
And the running process does not end automatically and consumes memory. I wonder what the cause is, a memory leak?

Comparison with other SSL baseline

Thanks for your great job. I wonder have you compared with SSL baseline, e.g., moco, simclr? I try moco and simclr with the model initialized by ImageNet pre-trained. After training several epochs, it seems the kNN accuracy of the trained model is even worse than the pre-trained model. Do you have any insight into this situation? Thanks a lot.

About the training at visda17 and domainnet

Dear Zhengzang,
Thankes for your work.I want to ask you some questions about training at visda17datasets.In the beginning phase, the training automatically stops when the features of the source domain are calculated to be around 40%,I wonder if it accounts for the configuration file or visda is more large comparing office and office_home, or the memory of gpu is lacking(we have four gpus and each size is 12GB), since I modified configuration file based on the office and office_home file

Questions about MIM and K list value

Thank you so much for sharing this terrific project.

I was confused about Mutual Information Maximization(MIM) for a long time. I guess the MIM in your paper is just like maximizing the mutual information between input and output? And in your code, there is a function called MomentumSoftmax. I am not sure why use this function to achieve MIM. I also monitor the condentmax and entmin loss. It seems just slightly change during the training stage.

And I am not sure how to set the K list value for clustering? Is this value depend on the category’s number of classifications?

Thank you so much

apply this method to data limited field.

Dear Zhengzang,

Thanks a lot. I tried to apply this method in a data-limited field. Last time, as you suggested, I employed the Cross-Entropy loss as a pretrain result. Then using this method. But the odd thing is the performance is even worse than before.

Do you know how to solve it? Thanks a lot!

Best regards,
Lu

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.