HashReID: Dynamic Network With Binary Codes for Efficient Person Re-Identification

Kshitij Nikhal, Yujunrong Ma, Shuvra S. Bhattacharyya, Benjamin S. RigganWACV 2024

TL;DR

This paper introduces HashReID, a novel person re-identification (ReID) system that combines dynamic network inference with binary hash codes. By adaptively exiting computation early for simpler cases and using compact binary representations, HashReID significantly speeds up matching while maintaining high accuracy, making it more practical for real-world, resource-constrained applications.

What Problem Does This Paper Address?

Person re-identification (ReID) is crucial for applications like surveillance and security, where the goal is to match a person's image across different cameras or time points. However, existing ReID methods often demand substantial computational resources and time, hindering their deployment in real-time scenarios or on devices with limited power. While some approaches use binary hash codes for faster matching, they can lose discriminative power. Others employ dynamic networks that adjust computation based on input difficulty, but these often don't leverage efficient binary representations. This paper addresses the need for a ReID system that is both computationally efficient and highly accurate, bridging the gap between fast binary matching and adaptive inference.

Methods

HashReID introduces several key innovations:

  • Dynamic Network with Early Exits: The network is designed with multiple "Hash-Exit" (HE) blocks placed at different stages. An "Exit using Training Statistics" (ETS) policy, powered by a Gated Recurrent Unit (GRU), analyzes query and gallery sample complexity to decide when to exit computation early. This saves significant computational cost for easier cases.
  • Binary Hash Code Generation: Instead of relying solely on high-dimensional continuous features, HashReID generates compact binary hash codes. This drastically accelerates the matching process, as comparing binary codes (e.g., using Hamming distance) is much faster than comparing continuous vectors.
  • Part-Based Local Pooling: To preserve fine-grained spatial information often lost in global pooling, the authors employ part-based local pooling on early-stage features. This captures more discriminative details from different body parts.
  • Ranking Regularizer: To bridge the gap between continuous and binary features and ensure similarity preservation, a novel ranking regularizer is introduced. This regularizer encourages the binary hash codes to maintain the relative ordering of distances found in the continuous feature space.
  • Soft Sign Activation: For training the hash generation, a smooth "soft sign" activation is used instead of a hard sign function. This makes the process more differentiable and aids convergence.

Datasets

The authors evaluate HashReID on three standard ReID datasets:

  • Market1501: A widely used dataset known for its challenging scenarios due to improper crops introduced by its annotation process.
  • MSMT17 (Multi-Scene Multi-Time 17): A large-scale dataset captured across various times and camera setups, offering diverse conditions.
  • BGC1 (BRIAR Government Collection 1): A newer dataset featuring unconstrained images and videos captured at different distances, providing a realistic testbed.

Key Insights and Ideas

  • The Synergy of Dynamic Inference and Binary Hashing: The core insight is that combining these two approaches yields a powerful system. Dynamic inference handles varying input complexity, while binary hashing provides inherent speedups for the matching stage.
  • Early Layers Hold Crucial Spatial Information: The paper highlights that global pooling in early layers can discard valuable spatial details. Their part-based pooling strategy effectively mitigates this, leading to better representations for early exits.
  • Bridging the Continuous-Binary Gap is Key: Simply generating binary codes isn't enough. The ranking regularizer is crucial for ensuring that the binary representations retain the discriminative power of their continuous counterparts, leading to improved accuracy.
  • Predicting Exit Difficulty is More Robust than Heuristics: The ETS policy, using a GRU, learns to predict sample difficulty based on query and gallery context, offering a more adaptive and robust approach than fixed thresholds or simple heuristics.

Key Results

  • Significant Speedup: HashReID achieves substantial computational savings. For instance, on Market1501, over 70% of samples exit early at stage 1, saving 80% of the network's computational cost. Query search time is reduced to 1.1 × 10⁻¹ seconds for 2048-dimensional hash codes, a 60% improvement over using only continuous features.
  • Competitive Accuracy: Despite the efficiency gains, HashReID maintains competitive accuracy. On Market1501, it achieves 94.18% rank-1 accuracy and 84.85% mAP, outperforming other hash-based methods by 60% and showing comparable performance to state-of-the-art ReID methods.
  • Improved Performance Across Stages: The dynamic network aspect shows consistent improvements in accuracy across different exit stages, outperforming other dynamic networks by significant margins (e.g., 8.82% to 5.05% improvement in rank-1 accuracy across stages on Market1501).
  • Effectiveness of ETS Policy: The proposed ETS policy, especially when combined with gallery separability heuristics, demonstrates superior performance in correctly identifying samples that can exit early, outperforming random exiting and simpler heuristic-based approaches.

Limitations and Future Work

  • Limitations: The paper acknowledges that while the soft sign activation aids convergence, the sign function itself is not differentiable, which is a general challenge in learning binary codes. The performance of the ETS policy is also dependent on the quality of the initial representations.
  • Future Work: The authors suggest that their approach can be adapted to various backbone architectures, implying potential for further optimization. Exploring more sophisticated dynamic routing mechanisms or more advanced binary hashing techniques could be future directions. The work also lays a foundation for applying these principles to other biometric applications beyond person re-identification.

Summary updated

BibTeX
@inproceedings{nikhal2024hashreid,
  author = {Kshitij Nikhal and Yujunrong Ma and Shuvra S. Bhattacharyya and Benjamin S. Riggan},
  title = {{HashReID: Dynamic Network With Binary Codes for Efficient Person Re-Identification}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
}
Figure