[Paper Review] Graph Sampling Based Deep Metric Learning for Generalizable Person Re-Identification
This paper proposes Graph Sampling (GS), a novel mini-batch sampling method for deep metric learning in person re-identification that constructs a nearest-neighbor graph over classes at the start of each epoch to select informative, hard, and similar classes for training. By sampling a class and its top-k nearest neighbors, GS improves model generalization and reduces training time significantly, achieving a 25.1% Rank-1 gain on MSMT17 when trained on RandPerson and a 6.8% gain on CUHK03-NP when trained on MSMT17, with training time reduced from 25.4 to 2 hours.
Recent studies show that, both explicit deep feature matching as well as large-scale and diverse training data can significantly improve the generalization of person re-identification. However, the efficiency of learning deep matchers on large-scale data has not yet been adequately studied. Though learning with classification parameters or class memory is a popular way, it incurs large memory and computational costs. In contrast, pairwise deep metric learning within mini batches would be a better choice. However, the most popular random sampling method, the well-known PK sampler, is not informative and efficient for deep metric learning. Though online hard example mining has improved the learning efficiency to some extent, the mining in mini batches after random sampling is still limited. This inspires us to explore the use of hard example mining earlier, in the data sampling stage. To do so, in this paper, we propose an efficient mini-batch sampling method, called graph sampling (GS), for large-scale deep metric learning. The basic idea is to build a nearest neighbor relationship graph for all classes at the beginning of each epoch. Then, each mini batch is composed of a randomly selected class and its nearest neighboring classes so as to provide informative and challenging examples for learning. Together with an adapted competitive baseline, we improve the state of the art in generalizable person re-identification significantly, by 25.1% in Rank-1 on MSMT17 when trained on RandPerson. Besides, the proposed method also outperforms the competitive baseline, by 6.8% in Rank-1 on CUHK03-NP when trained on MSMT17. Meanwhile, the training time is significantly reduced, from 25.4 hours to 2 hours when trained on RandPerson with 8,000 identities. Code is available at https://github.com/ShengcaiLiao/QAConv.
Motivation & Objective
- To address the inefficiency of random sampling in large-scale deep metric learning for person re-identification.
- To improve model generalization by incorporating hard, semantically similar examples earlier in the training pipeline.
- To reduce training time and computational cost compared to existing methods that rely on full feature memory or random sampling.
- To enable scalable and efficient training on large-scale datasets like RandPerson (8,000 identities) without excessive memory overhead.
Proposed method
- Construct a nearest-neighbor graph over all classes at the beginning of each training epoch using feature embeddings.
- For each mini-batch, randomly select one anchor class and sample its top-k nearest neighboring classes based on the graph.
- Form mini-batches by sampling K images per selected class, ensuring high intra-batch similarity and challenge.
- Use the resulting batches for pairwise metric learning with a hard triplet loss, focusing on boundary examples.
- Limit graph construction cost by using only one sample per class for distance computation, reducing computational overhead.
- Integrate GS with a competitive baseline model (e.g., QAConv) to evaluate performance and efficiency.
Experimental results
Research questions
- RQ1Can early hard example mining through structured sampling improve generalization in person re-identification?
- RQ2How does graph-based sampling compare to random sampling (e.g., PK sampler) in terms of training efficiency and model accuracy?
- RQ3Can graph sampling reduce training time while maintaining or improving performance on large-scale datasets?
- RQ4Does sampling semantically similar classes lead to better feature discrimination and robustness to domain shifts?
Key findings
- The proposed Graph Sampling (GS) method reduces training time from 25.4 hours to 2 hours when training on RandPerson with 8,000 identities.
- GS achieves a 25.1% improvement in Rank-1 accuracy on MSMT17 when trained on RandPerson, setting a new state of the art.
- On CUHK03-NP, GS improves Rank-1 accuracy by 6.8% when trained on MSMT17, outperforming the competitive baseline.
- Visualization shows that GS effectively identifies hard, visually similar classes (e.g., similar clothing, colors, accessories), which enhance model discrimination.
- The model trained with GS learns to ignore background distractions over time, focusing on identity-relevant features like clothing style and color.
- Despite higher initial sampling cost, GS reduces the required number of training epochs (often <20) compared to 60+ for baseline methods, justifying the overhead.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.