Adversarial Metric Attack for Person Re-identification

Song Bai, Yingwei Li, Yuyin Zhou, Qizhu Li, Philip H. S. Torr

Abstract

Person re-identification (re-ID) has attracted much attention recently due to its great importance in video surveillance. In general, distance metrics used to identify two person images are expected to be robust under various appearance changes. However, our work observes the extreme vulnerability of existing distance metrics to adversarial examples, generated by simply adding human-imperceptible perturbations to person images. Hence, the security danger is dramatically increased when deploying commercial re-ID systems in video surveillance. Although adversarial examples have been extensively applied for classification analysis, it is rarely studied in metric analysis like person re-identification. The most likely reason is the natural gap between the training and testing of re-ID networks, that is, the predictions of a re-ID network cannot be directly used during testing without an effective metric. In this work, we bridge the gap by proposing Adversarial Metric Attack, a parallel methodology to adversarial classification attacks. Comprehensive experiments clearly reveal the adversarial effects in re-ID systems. Meanwhile, we also present an early attempt of training a metric-preserving network, thereby defending the metric against adversarial attacks. At last, by benchmarking various adversarial settings, we expect that our work can facilitate the development of adversarial attack and defense in metric-based applications.

Introduction

Person re-identification (re-ID) is the task of matching a "probe" image of a person across a "gallery" of images captured by different cameras. Unlike standard image classification, where a model assigns an image to a fixed category, re-ID is a metric learning task. It relies on calculating the distance or similarity between feature vectors of two images to determine if they belong to the same individual. While re-ID models have achieved high performance, this work exposes a critical security flaw: their extreme vulnerability to "Adversarial Metric Attacks."

The Metric Gap

A significant challenge in re-ID research is the "natural gap" between model training and testing. Re-ID networks are often trained using classification losses, but at test time, they rely on distance metrics for retrieval. Previous adversarial research has focused almost exclusively on classification attacks—pushing an image across a decision boundary. However, as illustrated below, an image can cross a decision boundary while still maintaining high similarity to its true match in the feature space. This paper introduces a methodology to attack the distance metric itself, which is far more disruptive to real-world retrieval systems.

Conceptual difference between classification attacks (a) and metric attacks (b).

Adversarial Metric Attack Methodology

We propose Adversarial Metric Attack by adapting gradient-based adversarial methods—such as FGSM (Fast Gradient Sign Method), I-FGSM (Iterative FGSM), and MI-FGSM (Momentum Iterative FGSM)—to target distance functions (e.g., Euclidean or Mahalanobis distance) rather than classification labels.

We define two primary types of attacks:

  • Non-targeted Attack: Aims to maximize the distance between a probe and its true match, effectively making the person "disappear" from the system's correct rankings.
  • Targeted Attack: Aims to minimize the distance between a probe and a specific incorrect identity, potentially allowing an attacker to "frame" another individual.
Illustration of non-targeted (top) and targeted (bottom) adversarial metric attacks showing how noise alters similarity scores.

Experimental Results and Defense

Comprehensive testing on the Market-1501 and DukeMTMC-reID benchmarks reveals the shocking fragility of state-of-the-art systems. In white-box scenarios, a standard ResNet-50 model saw its Mean Average Precision (mAP) plummet from 77.52% to a mere 0.367% under an I-FGSM metric attack. Furthermore, these attacks exhibit high transferability; adversarial examples generated for one model architecture often successfully fool others (e.g., DenseNet), indicating structural vulnerabilities in how these models learn features.

To address this, we propose a Metric-Preserving Network defense. This involves adversarial training where the model is trained on a mixture of clean and adversarial examples specifically generated by metric attacks. This defense showed significant efficacy, restoring mAP from 24.72% to 70.46% in certain transfer attack scenarios.

Conclusion

This work demonstrates that re-ID systems are highly vulnerable to adversarial noise that targets distance metrics. By bridging the gap between classification and metric attacks, we provide a framework for evaluating and improving the robustness of retrieval-based systems. While our metric-preserving defense is a promising early step, future work is needed to address the computational costs of adversarial training and the potential for physical-world adversarial attacks.

Summary updated

BibTeX
@article{bai2024adversarial,
  author = {Song Bai and Yingwei Li and Yuyin Zhou and Qizhu Li and Philip H. S. Torr},
  title = {{Adversarial Metric Attack for Person Re-identification}},
  journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=4xoT0CZTVb},
}
Figure