Triplet Contrastive Learning for Unsupervised Vehicle Re-identification

Fei Shen, Xiaoyu Du, Liyan Zhang, Jinhui Tang

Abstract

Unsupervised vehicle re-identification (re-ID) is a critical yet challenging task due to high intra-class variance and low inter-class variance in vehicle appearances. Existing methods often struggle with "gradient collapse" when integrating fine-grained part features with global features without supervision. This paper presents the Triplet Contrastive Representation Learning (TCRL) framework. TCRL introduces three distinct memory banks—Part, Cluster, and Global—and utilizes a Proxy Contrastive Loss (PCL) to stabilize the learning process. By treating cluster features as a proxy, TCRL effectively bridges the gap between local and global representations. Experimental results on VeRi776, VehicleID, and VERI-Wild datasets demonstrate that TCRL significantly outperforms current state-of-the-art unsupervised methods.

Introduction

Vehicle re-identification involves identifying a specific vehicle across multiple non-overlapping camera views. While supervised learning has seen success, the cost of labeling large-scale datasets is prohibitive. Unsupervised learning offers a scalable alternative but faces the "fine-grained" challenge: vehicles of the same make and color often appear identical globally, requiring the extraction of subtle part-level features such as unique stickers or scratches.

However, directly optimizing both global and part features in an unsupervised setting frequently leads to gradient collapse, where the model converges to trivial constant solutions. Furthermore, the reliance on pseudo-labels generated by clustering algorithms introduces noise, which can degrade the quality of learned representations.

The TCRL Framework

The proposed Triplet Contrastive Representation Learning (TCRL) framework addresses these issues through a multi-bank architecture and specialized loss functions.

The TCRL framework architecture featuring triple memory banks and the proxy contrastive learning flow.

Triple Memory Banks

Unlike traditional methods that use one or two memory banks, TCRL maintains three:

  1. Part Memory Bank ($M^P$): Stores fine-grained local features extracted from masked images.
  2. Cluster Memory Bank ($M^C$): Stores cluster-level representations that serve as proxies.
  3. Global Memory Bank ($M^G$): Stores high-level global features from original images.

Key Contrastive Losses

  • Proxy Contrastive Loss (PCL): This is the core innovation. Instead of a direct, unstable comparison between part and global features, PCL uses the cluster memory bank as an intermediate bridge. It models the relationship as a transition (Part $\leftrightarrow$ Cluster $\leftrightarrow$ Global), which stabilizes gradients and prevents collapse.
  • Hybrid Contrastive Loss (HCL): While standard cluster contrastive learning compares queries to cluster centroids, HCL compares queries to all individual negative instances in the memory bank. This preserves rich discriminative information that is often lost during averaging.
  • Weighted Regularization Cluster Contrastive Loss (WRCCL): To mitigate the impact of noisy pseudo-labels, WRCCL assigns similarity weights to images within a cluster. Outliers that do not align well with the cluster's main features are penalized, ensuring the integrity of the cluster representation.

Comparative Analysis

The evolution of contrastive learning frameworks highlights the necessity of the TCRL approach in bridging feature scales.

Comparison of contrastive learning frameworks: (a) Instance-based, (b) Cluster-based, (c) Instance-cluster, and (d) the proposed TCRL.

As shown in the figure above, instance-based methods (a) focus on individual samples, while cluster-based methods (b) focus on group centroids. Hybrid instance-cluster approaches (c) combine these but still lack the fine-grained part integration that TCRL (d) achieves through its triple-bank proxy strategy.

Experimental Results

TCRL was evaluated on three major benchmarks, consistently setting new state-of-the-art (SOTA) records:

  • VeRi776: TCRL achieved 42.68% mAP and 87.26% Rank-1 accuracy, a significant jump over previous methods like CACL.
  • VehicleID: On the largest test set (Test2400), it reached 61.08% mAP, demonstrating robustness at scale.
  • VERI-Wild: In challenging "in-the-wild" scenarios, TCRL reached 26.60% mAP on the most difficult subset (Test10000), outperforming competitors by a wide margin.

Conclusion

The TCRL framework demonstrates that cluster features can serve as an effective proxy to bridge the gap between fine-grained and global features in unsupervised vehicle re-ID. By stabilizing the learning process and accounting for pseudo-label noise, TCRL avoids gradient collapse and achieves superior performance. Future work will explore automated part detection and more advanced noise-handling techniques to further refine unsupervised representations.

Summary updated

Abstract

Part feature learning is critical for fine-grained semantic understanding in vehicle re-identification. However, existing approaches directly model part features and global features, which can easily lead to serious gradient vanishing issues due to their unequal feature information and unreliable pseudo-labels for unsupervised vehicle re-identification. To address this problem, in this paper, we propose a simple Triplet Contrastive Representation Learning (TCRL) framework which leverages cluster features to bridge the part features and global features for unsupervised vehicle re-identification. Specifically, TCRL devises three memory banks to store the instance/cluster features and proposes a Proxy Contrastive Loss (PCL) to make contrastive learning between adjacent memory banks, thus presenting the associations between the part and global features as a transition of the part-cluster and cluster-global associations. Since the cluster memory bank copes with all the vehicle features, it can summarize them into a discriminative feature representation. To deeply exploit the instance/cluster information, TCRL proposes two additional loss functions. For the instance-level feature, a Hybrid Contrastive Loss (HCL) re-defines the sample correlations by approaching the positive instance features and pushing the all negative instance features away. For the cluster-level feature, a Weighted Regularization Cluster Contrastive Loss (WRCCL) refines the pseudo labels by penalizing the mislabeled images according to the instance similarity. Extensive experiments show that TCRL outperforms many state-of-the-art unsupervised vehicle re-identification approaches.
BibTeX
@article{shen2025triplet,
  author = {Fei Shen and Xiaoyu Du and Liyan Zhang and Jinhui Tang},
  title = {{Triplet Contrastive Learning for Unsupervised Vehicle Re-identification}},
  journal = {ACM Trans. Multim. Comput. Commun. Appl.},
  year = {2025},
  doi = {10.1145/3695255},
}
Figure