TransReID: Transformer-based Object Re-Identification

Shuting He, Hao Luo, Pichao Wang, Fan Wang, Hao Li, Wei Jiang

Introduction

Object Re-Identification (ReID) is the task of matching a specific person or vehicle across non-overlapping camera views. For years, Convolutional Neural Networks (CNNs) have been the gold standard for this task. However, CNNs suffer from two inherent weaknesses: local receptive fields that often miss global structural patterns and information loss due to downsampling operations (like pooling) that discard fine-grained details—such as specific textures or small logos—crucial for distinguishing similar objects.

Methodology: The TransReID Framework

TransReID is the first pure transformer-based framework designed for object ReID. It adapts the Vision Transformer (ViT) architecture with three key innovations tailored for the challenges of re-identification:

  1. Overlapping Patches: Unlike standard ViT, which splits images into non-overlapping squares, TransReID uses a sliding window to create overlapping patches. This preserves local spatial continuity that is often lost at patch boundaries.
  2. Jigsaw Patch Module (JPM): To improve robustness against occlusions and misalignments, the JPM shuffles patch embeddings through "shift" and "shuffle" operations before the final layer. This forces the model to learn diversified, discriminative features from various parts of the object rather than relying on a single dominant region.
  3. Side Information Embeddings (SIE): ReID data is often biased by specific camera IDs or viewpoints. SIE incorporates these non-visual clues as learnable embeddings added directly to the patch embeddings, helping the model neutralize camera-specific bias.
TransReID captures fine-grained details like backpack straps that are often lost in traditional CNN architectures due to downsampling.

Key Insights and Visualizations

A core advantage of the transformer architecture is its global attention mechanism. Visualization via Grad-CAM reveals a stark difference in how models "see" objects. While CNNs typically focus on small, continuous blobs, TransReID naturally attends to multiple, disjointed discriminative parts—such as the head, bag, and shoes—simultaneously.

Grad-CAM visualizations comparing (b) CNN-based methods with (c, d) Transformer-based approaches, showing the latter's ability to attend to multiple disjoint discriminative parts.

Experimental Results

TransReID set new performance records across major person and vehicle ReID benchmarks:

  • Person ReID: On MSMT17, it achieved 64.9% mAP, a significant jump over previous CNN-based SOTA methods. On the Occluded-Duke dataset, it reached 58.1% mAP, outperforming specialized occlusion-handling models without needing external pose estimation tools.
  • Vehicle ReID: It achieved 82.3% mAP on VeRi-776, surpassing the previous best by 2.0%.
  • Efficiency: Despite the complexity of Transformers, the TransReID* variant is 4.8% faster in inference than the popular CNN-based MGN model on the same hardware.

Conclusion

By leveraging global context and maintaining high-resolution features, TransReID demonstrates that Transformers are a powerful alternative to the long-dominant CNN paradigm in object re-identification. Future work will likely focus on reducing the memory footprint of these models and exploring effective training strategies for smaller, ReID-specific datasets.

Summary updated

BibTeX
@inproceedings{he2021transreid,
  author = {Shuting He and Hao Luo and Pichao Wang and Fan Wang and Hao Li and Wei Jiang},
  title = {{TransReID: Transformer-based Object Re-Identification}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01474},
}
Figure