Skip to content

Astaxanthin/AdaSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Sparse Pairwise Loss for Object Re-Identification (CVPR 2023)

Paper

Introduction

Object re-identification (ReID) aims to find instances with the same identity as the given probe from a large gallery. Pairwise losses play an important role in training a strong ReID network. Existing pairwise losses densely exploit each instance as an anchor and sample its triplets in a mini-batch. This dense sampling mechanism inevitably introduces positive pairs that share few visual similarities, which can be harmful to the training. To address this problem, we propose a novel loss paradigm termed Sparse Pairwise (SP) loss that only leverages few appropriate pairs for each class in a mini-batch, and empirically demonstrate that it is sufficient for the ReID tasks. Based on the proposed loss framework, we propose an adaptive positive mining strategy that can dynamically adapt to diverse intra-class variations. Extensive experiments show that SP loss and its adaptive variant AdaSP loss outperform other pairwise losses, and achieve state-of-the-art performance across several ReID benchmarks.

Method overview

Large vs. Small intra-class variations

method overview

Prerequisites

Train

# assume that you are under the root directory of this project,
# and you have activated your virtual environment if needed.
# and with all ReID datasets you need in './datasets/'.

# For example, ReID tasks using ID loss (cross entropy) and metric loss (AdaSP) on the DukeMTMC dataset
python tools/train_net.py --config-file configs/DukeMTMC/mgn_CE_adasp.yml MODEL.DEVICE "cuda:0" 

# For example, ReID tasks using only metric loss (AdaSP) on the DukeMTMC dataset
python tools/train_net.py --config-file configs/DukeMTMC/mgn_single_adasp.yml MODEL.DEVICE "cuda:0" 

Results & Configs

Loss MSMT17 (mAP) Market-1501 (mAP) DukeMTMC (mAP) Veri-776 (mAP) VehicleID-small (R1) VehicleID-median (R1)
SP-H 61.0 config 80.5 config 87.5 config 75.3 config 85.6 config 80.0
SP-LH 58.4 config 77.0 config 83.8 config 77.2 config 87.0 config 81.9
AdaSP 60.7 config 80.1 config 86.8 config 77.6 config 86.4 config 81.8

Acknowledgement

Thanks fastreid team for the wonderful open source project!

Citation

If you find AdaSP useful in your research, please consider citing:

@inproceedings{zhou2023adaptive,
  title={Adaptive Sparse Pairwise Loss for Object Re-Identification},
  author={Zhou, Xiao and Zhong, Yujie and Cheng, Zhen and Liang, Fan and Ma, Lin},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={19691--19701},
  year={2023}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published