Home

Awesome

UDAStrongBaseline

Open-source stronger baseline for unsupervised or domain adaptive object re-ID. We will udpate the strong baseline and group-aware label transfer method in domain adaptive person re-identifacation.

Introduction

*Our method only adopts the clustering algorithm and ReID baseline model with the moving average model.

UDAStrongBaseline is a transitional code based pyTorch framework for both unsupervised learning (USL) and unsupervised domain adaptation (UDA) in the context of object re-ID tasks. It provides stronger baselines on these tasks. It needs the enviorment: Python >=3.6 and PyTorch >=1.1. We will transfer all the codes to the fastreid in the future (ongoing).

Unsupervised domain adaptation (UDA) on Person re-ID

DukeMTMC-reID -> Market-1501

MethodBackbonePre-trainedmAP(%)top-1(%)top-5(%)top-10(%)Train time
Direct inferResNet50DukeMTMC32.264.978.783.4~1h
UDA_TP PR'2020ResNet50DukeMTMC52.376.087.891.9~2h
MMT ICLR'2020ResNet50imagenet80.992.297.698.4~6h
SpCL NIPS'2020 submissionResNet50imagenet78.290.596.697.8~3h
strong_baselineResNet50imagenet75.690.996.697.8~3h
Our stronger_baselineResNet50DukeMTMC77.491.096.497.7~3h
Our stronger_baseline + GLT (Kmeans)ResNet50DukeMTMC79.592.796.998.0~35h
Our stronger_baseline + uncertainty (DBSCAN)ResNet50DukeMTMC82.093.097.398.2~5h

Market-1501 -> DukeMTMC-reID

MethodBackbonePre-trainedmAP(%)top-1(%)top-5(%)top-10(%)Train time
Direct inferResNet50Market150134.151.365.371.7~1h
UDA_TP PR'2020ResNet50Market150145.765.578.081.7~2h
MMT ICLR'2020ResNet50imagenet67.780.389.992.9~6h
SpCL NIPS'2020 submissionResNet50imagenet70.483.891.293.4~3h
strong_baselineResNet50imagenet60.475.986.289.8~3h
Our stronger_baselineResNet50Market150166.780.089.292.2~3h
Our stronger_baseline + uncertainty (DBSCAN)ResNet50Market150171.884.091.793.8~5h

Requirements

Installation

git https://github.com/zkcys001/UDAStrongBaseline/
cd UDAStrongBaseline
pip install -r requirements
pip install faiss-gpu==1.6.3

Prepare Datasets

Download the person datasets DukeMTMC-reID, Market-1501, MSMT17, Then unzip them under the directory like

./data
├── dukemtmc
│  └── DukeMTMC-reID
├── market1501
│  └── Market-1501-v15.09.15
├── msmt17
   └── MSMT17_V1

You can create the soft link to the dataset:

ln -s /path-to-data ./data

ImageNet-pretrained models for ResNet-50 will be automatically downloaded in the python script.

Training

We utilize 4 GPUs for training. Note that

1. Stronger Baseline:

Stage I: Pretrain Model on Source Domain

Training the baseline in the source domain, run this command:

sh scripts/pretrain_market1501.sh

Stage II: End-to-end training with clustering

Utilizing the baseline based on DBSCAN clustering algorithm:

sh scripts/dbscan_baseline_market2duke.sh

2. Uncertainty(AAAI 2021):

Stage I: Pretrain Model on Source Domain

Training the uncertainty model in the source domain, run this command:

sh scripts/pretrain_uncertainty_dukemtmc.sh

Stage II: End-to-end training with clustering

Utilizing the uncertainty model based on DBSCAN clustering algorithm:

sh scripts/dbscan_uncertainty_duke2market.sh

3. GLT (group-aware label transfer, CVPR 2021):

Stage I: Pretrain Model on Source Domain

Training the GLT model in the source domain, run this command:

sh scripts/pretrain_dukemtmc.sh

Stage II: End-to-end training with clustering

Utilizing the GLT model based on K-means clustering algorithm:

sh scripts/GLT_kmeans_duke2market.sh

Acknowledgement

Some parts of UDAstrongbaseline are from MMT and fastreid. We would like to thank for these projects, and we will update our method .

Citation

If you find this code useful for your research, please use the following BibTeX entry.

@inproceedings{zheng2021exploiting,
  title={Exploiting Sample Uncertainty for Domain Adaptive Person Re-Identification},
  author={Zheng, Kecheng and Lan, Cuiling and Zeng, Wenjun and Zhang, Zhizheng and Zha, Zheng-Jun},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={35},
  number={4},
  pages={3538--3546},
  year={2021}
}

@inproceedings{zheng2021group,
  title={Group-aware label transfer for domain adaptive person re-identification},
  author={Zheng, Kecheng and Liu, Wu and He, Lingxiao and Mei, Tao and Luo, Jiebo and Zha, Zheng-Jun},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={5310--5319},
  year={2021}
}