All Projects → WangWenhao0716 → Attentive-WaveBlock

WangWenhao0716 / Attentive-WaveBlock

Licence: MIT license
[TIP 2022] Pytorch implementation of "Attentive WaveBlock: Complementarity-enhanced Mutual Networks for Unsupervised Domain Adaptation in Person Re-identification and Beyond"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Attentive-WaveBlock

publications-arruda-ijcnn-2019
Cross-Domain Car Detection Using Unsupervised Image-to-Image Translation: From Day to Night
Stars: ✭ 59 (+247.06%)
Mutual labels:  unsupervised-domain-adaptation
centernet-uda
This repository holds a small framework to evaluate unsupervised domain adaptation methods in combination with a CenterNet object detection network.
Stars: ✭ 20 (+17.65%)
Mutual labels:  unsupervised-domain-adaptation
Person reid baseline pytorch
Pytorch ReID: A tiny, friendly, strong pytorch implement of object re-identification baseline. Tutorial 👉https://github.com/layumi/Person_reID_baseline_pytorch/tree/master/tutorial
Stars: ✭ 2,963 (+17329.41%)
Mutual labels:  person-reid
Fast Reid
SOTA Re-identification Methods and Toolbox
Stars: ✭ 2,287 (+13352.94%)
Mutual labels:  person-reid
Gluon Cv
Gluon CV Toolkit
Stars: ✭ 5,001 (+29317.65%)
Mutual labels:  person-reid
HiCMD
[CVPR2020] Hi-CMD: Hierarchical Cross-Modality Disentanglement for Visible-Infrared Person Re-Identification
Stars: ✭ 64 (+276.47%)
Mutual labels:  person-reid
AOS4ReID
Adversarially Occluded Samples for Person Re-identification, CVPR 2018
Stars: ✭ 32 (+88.24%)
Mutual labels:  person-reid
Cloth Change Person reID Paper List
Paper collection for cloth variation based person re-identification
Stars: ✭ 77 (+352.94%)
Mutual labels:  person-reid
Ranked Person ReID
Person reID
Stars: ✭ 91 (+435.29%)
Mutual labels:  person-reid
MetaBIN
[CVPR2021] Meta Batch-Instance Normalization for Generalizable Person Re-Identification
Stars: ✭ 58 (+241.18%)
Mutual labels:  person-reid
SphereReID
My implementation of paper: SphereReID: Deep Hypersphere Manifold Embedding for Person Re-Identification
Stars: ✭ 39 (+129.41%)
Mutual labels:  person-reid
domain-adaptation-capls
Unsupervised Domain Adaptation via Structured Prediction Based Selective Pseudo-Labeling
Stars: ✭ 43 (+152.94%)
Mutual labels:  unsupervised-domain-adaptation
CADA
Attending to Discriminative Certainty for Domain Adaptation
Stars: ✭ 17 (+0%)
Mutual labels:  unsupervised-domain-adaptation
DA-RetinaNet
Official Detectron2 implementation of DA-RetinaNet of our Image and Vision Computing 2021 work 'An unsupervised domain adaptation scheme for single-stage artwork recognition in cultural sites'
Stars: ✭ 31 (+82.35%)
Mutual labels:  unsupervised-domain-adaptation
ACAN
Code for NAACL 2019 paper: Adversarial Category Alignment Network for Cross-domain Sentiment Classification
Stars: ✭ 23 (+35.29%)
Mutual labels:  unsupervised-domain-adaptation

[TIP 2022] Attentive WaveBlock (AWB)

The official implementation for the "Attentive WaveBlock: Complementarity-enhanced Mutual Networks for Unsupervised Domain Adaptation in Person Re-identification and Beyond". Many thanks for the framework offered by MMT.

image

Performance

image

Requirement

  • Python 3.6
  • Pytorch 1.1.0
  • sklearn 0.21.3
  • PIL 4.0.0
  • Numpy 1.16.0
  • Torchvision 0.2.0

Reproduction Environment

  • Test our models: 1 GTX 1080Ti GPU.
  • Train new models: 4 GTX 1080Ti GPUs.

Installation

You can directly get the codes by:

  git clone https://github.com/WangWenhao0716/Attentive-WaveBlock.git

Note

In the following codes and statements, for simplicity, Pre-A denotes Pre-A (CBAM) and Post-A denotes Post-A (Non-local). You can find the details in our paper.

Preparation

  1. Dataset

We evaluate our algorithm on DukeMTMC-reID, Market-1501 and MSMT17. For convenience, we have prepared data for you. You should download them and prepare the directory structure like this:

*DATA_PATH
      *data
         *dukemtmc
             *DukeMTMC-reID
                 *bounding_box_test
                 ...
          
         *market1501
             *Market-1501-v15.09.15
                 *bounding_box_test
                 ...
         *msmt17
             *MSMT17_V1
                 *test
                 *train
                 ...
  1. Pretrained Models

We use ResNet-50 as backbone, and the pretrained models will be downloaded automatically.

  1. Our Trained Models

We provide our trained Pre-A and Post-A models on Duke-to-Market, Market-to-Duke, Duke-to-MSMT, Market-to-MSMT, MSMT-to-Duke, and MSMT-to-Market domain adaptation tasks.

Duke-to-Market: Pre-A(78.8% mAP) Post-A(81.0% mAP)

Market-to-Duke: Pre-A(70.0% mAP) Post-A(70.9% mAP)

Duke-to-MSMT: Pre-A(29.5% mAP) Post-A(29.0% mAP)

Market-to-MSMT: Pre-A(27.3% mAP) Post-A(29.0% mAP)

MSMT-to-Duke: Pre-A(68.6% mAP) Post-A(69.6% mAP)

MSMT-to-Market: Pre-A(77.1% mAP) Post-A(79.4% mAP)

For example, to test our trained model on Duke-to-Market, you should save the models in ./logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s2 and ./logs/dukemtmcTOmarket1501/resnet50-train-post-a-s2, respectively.

Train

We use Duke-to-Market as an example, other UDA tasks will follow similar pipelines.

Step 1: Pre-train models on source domain

First Network:

CUDA_VISIBLE_DEVICES=0,1,2,3 python source_pretrain.py -ds dukemtmc -dt market1501 -a resnet50 --seed 1 --margin 0.0 --num-instances 4 -b 64 -j 4 --warmup-step 10 --lr 0.00035 --milestones 40 70 --iters 200 --epochs 80 --eval-step 40 --logs-dir logs/dukemtmcTOmarket1501/resnet50-pretrain-1

Second Network:

CUDA_VISIBLE_DEVICES=0,1,2,3 python source_pretrain.py -ds dukemtmc -dt market1501 -a resnet50 --seed 2 --margin 0.0 --num-instances 4 -b 64 -j 4 --warmup-step 10 --lr 0.00035 --milestones 40 70 --iters 200 --epochs 80 --eval-step 40 --logs-dir logs/dukemtmcTOmarket1501/resnet50-pretrain-2

Step 2: Train our attention model on target domain (Stage 1)

Pre-A

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_pre_a_s1.py -dt market1501 -a resnet50 --num-clusters 500 --num-instances 4 --lr 0.00035 --iters 800 -b 64 --epochs 10 --soft-ce-weight 0.5 --soft-tri-weight 0.8 --dropout 0 --init-1 logs/dukemtmcTOmarket1501/resnet50-pretrain-1/model_best.pth.tar --init-2 logs/dukemtmcTOmarket1501/resnet50-pretrain-2/model_best.pth.tar --logs-dir logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s1

Post-A

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_post_a_s1.py -dt market1501 -a resnet50 --num-clusters 500 --num-instances 4 --lr 0.00035 --iters 800 -b 64 --epochs 10 --soft-ce-weight 0.5 --soft-tri-weight 0.8 --dropout 0 --init-1 logs/dukemtmcTOmarket1501/resnet50-pretrain-1/model_best.pth.tar --init-2 logs/dukemtmcTOmarket1501/resnet50-pretrain-2/model_best.pth.tar --logs-dir logs/dukemtmcTOmarket1501/resnet50-train-post-a-s1

Step 3: Train on target domain (Stage 2)

Pre-A

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_pre_a_s2.py -dt market1501 -a resnet50 --num-clusters 500 --num-instances 4 --lr 0.00035 --iters 800 -b 64 --epochs 80 --soft-ce-weight 0.5 --soft-tri-weight 0.8 --dropout 0 --init-1 logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s1/model1_checkpoint.pth.tar --init-2 logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s1/model2_checkpoint.pth.tar --logs-dir logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s2

Post-A

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_post_a_s2.py -dt market1501 -a resnet50 --num-clusters 500 --num-instances 4 --lr 0.00035 --iters 800 -b 64 --epochs 80 --soft-ce-weight 0.5 --soft-tri-weight 0.8 --dropout 0 --init-1 logs/dukemtmcTOmarket1501/resnet50-train-post-a-s1/model1_checkpoint.pth.tar --init-2 logs/dukemtmcTOmarket1501/resnet50-train-post-a-s1/model2_checkpoint.pth.tar --logs-dir logs/dukemtmcTOmarket1501/resnet50-train-post-a-s2

Test

We use Duke-to-Market as an example, other UDA tasks follow similar pipelines.

Pre-A

CUDA_VISIBLE_DEVICES=0 python test_pre_a.py -b 256 -j 8 --dataset-target market1501 -a resnet50 --resume logs/dukemtmcTOmarket1501/resnet50-train-pre-a-s2/model_best.pth.tar

Post-A

CUDA_VISIBLE_DEVICES=0 python test_post_a.py -b 256 -j 8 --dataset-target market1501 -a resnet50 --resume logs/dukemtmcTOmarket1501/resnet50-train-post-a-s2/model_best.pth.tar

Citation

If you think our work is useful in your research, please consider citing:

@article{wang2022attentive,
  title={Attentive WaveBlock: Complementarity-enhanced Mutual Networks for Unsupervised Domain Adaptation in Person Re-identification and Beyond},
  author={Wang, Wenhao and Zhao, Fang and Liao, Shengcai and Shao, Ling},
  journal={IEEE Transactions on Image Processing},
  year={2022},
  publisher={IEEE}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].