NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

End-to-End Comparative Attention Networks for Person Re-identification

Hao Liu, Jiashi Feng, Meibin Qi, Jianguo Jiang, Shuicheng Yan · DOI

Abstract

Person re-identification across disjoint camera views is a critical yet challenging task in video surveillance. The primary difficulties stem from significant variations in lighting, viewing angles, body poses, and occlusions. While existing deep learning methods often rely on global feature extraction from a single glimpse, they frequently fail to distinguish fine-grained local details. We propose the Comparative Attention Network (CAN), an end-to-end framework specifically designed to selectively focus on discriminative parts of person image pairs through multiple glimpses. By adaptively comparing local regions, CAN simulates the human perception process to determine identity matches. Extensive evaluations on CUHK01, CUHK03, and Market-1501 datasets demonstrate that CAN significantly outperforms established baselines and achieves state-of-the-art performance.

Introduction: The Challenge of Global Features

Person re-identification (re-id) involves matching the same individual across non-overlapping camera views. Traditional deep learning approaches typically extract features from an entire frame in one pass. However, this "global" approach often misses subtle but vital cues—such as a specific logo on a backpack or a unique shoe pattern—that are essential for distinguishing individuals under varying conditions.

Humans naturally identify people by scanning and comparing specific body regions over time. To bridge this gap, we developed the Comparative Attention Network (CAN), which learns where to look and how to compare those regions dynamically.

Conceptual overview of the CAN model's multiple glimpses and comparative attention mechanism.

Methodology

The CAN architecture integrates Convolutional Neural Networks (CNNs) with Recurrent Neural Networks (RNNs) to facilitate a multi-stage perception process:

  1. Global Feature Learning: A base CNN (such as VGG-16) processes raw images to generate high-level feature maps.
  2. Comparative Attention Generation: An LSTM-based recurrent component takes these feature maps and, over several time steps (glimpses), produces attention maps. These maps act as masks, focusing the model on specific discriminative regions like the head, torso, or legs.

Training and Multi-Task Loss

To ensure the features are both discriminative and robust, the model is trained end-to-end using a multi-task loss function:

  • Triplet Loss: This pulls images of the same identity closer in the feature space while pushing different identities apart.
  • Identification Loss: A standard classification loss that encourages the model to recognize specific individuals.
The architecture of the CAN model during training (triplet learning) and testing (ranking).

Key Insights

  • Comparative vs. Independent Attention: Unlike standard attention models that process images in isolation, CAN’s attention is inherently comparative. It identifies which parts are most useful for discerning differences between two specific images.
  • Temporal Integration: The model does not rely solely on the final glimpse. Instead, it concatenates hidden states from multiple time steps (e.g., the 2nd, 4th, and 8th glimpses). This allows the model to integrate information from various body parts into a single, holistic signature.
  • End-to-End Optimization: By training the CNN and the attention mechanism together, the feature extraction process is specifically optimized for the comparative task, allowing the "eyes" (attention) and "brain" (CNN) to co-evolve.

Experimental Results

CAN was evaluated on several major benchmarks, consistently achieving superior results:

  • CUHK03: Reached a 77.6% Rank-1 accuracy, a significant improvement over previous methods.
  • CUHK01: Achieved 87.2% Rank-1 accuracy (100-test-ID setting).
  • Market-1501: Recorded 60.3% Rank-1 accuracy and 35.9% mAP, demonstrating robustness in realistic, crowded environments.

Qualitative analysis of the attention maps confirmed that the model successfully tracks specific items, such as backpacks or distinct clothing colors, to make its final verification decisions.

Conclusion and Future Work

The Comparative Attention Network offers a powerful, human-like approach to person re-identification. While highly effective, the model faces challenges in extremely small datasets (where overfitting is a risk) and in scenes with severe occlusions. Future research will explore more complex attention mechanisms and methods to improve performance in "open-world" scenarios where the model must handle identities not seen during the training phase.

Summary updated

Abstract

Person re-identification across disjoint camera views has been widely applied in video surveillance yet it is still a challenging problem. One of the major challenges lies in the lack of spatial and temporal cues, which makes it difficult to deal with large variations of lighting conditions, viewing angles, body poses and occlusions. Recently, several deep learning based person re-identification approaches have been proposed and achieved remarkable performance. However, most of those approaches extract discriminative features from the whole frame at one glimpse without differentiating various parts of the persons to identify. It is essentially important to examine multiple highly discriminative local regions of the person images in details through multiple glimpses for dealing with the large appearance variance. In this paper, we propose a new soft attention based model, i.e., the end to-end Comparative Attention Network (CAN), specifically tailored for the task of person re-identification. The end-to-end CAN learns to selectively focus on parts of pairs of person images after taking a few glimpses of them and adaptively comparing their appearance. The CAN model is able to learn which parts of images are relevant for discerning persons and automatically integrates information from different parts to determine whether a pair of images belongs to the same person. In other words, our proposed CAN model simulates the human perception process to verify whether two images are from the same person. Extensive experiments on three benchmark person re-identification datasets, including CUHK01, CHUHK03 and Market-1501, clearly demonstrate that our proposed end-to-end CAN for person re-identification outperforms well established baselines significantly and offer new state-of-the-art performance.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CUHK01end-to-end CAN (VGG-16)Rank187.2Person Re Identification · split: test · backbone=VGG-16 · test-ids=100
Source quote
L258: end-to-end CAN (VGG-16) │ 87.2 │ 98.2 │ 99.8 │ 100.0
CUHK03end-to-end CAN (VGG-16)Rank177.6Person Re Identification · setting=labeled · backbone=VGG-16
Source quote
L320: end-to-end CAN(VGG-16) │ 77.6 │ 95.2 │ 99.3 │ 100.0
CUHK03end-to-end CAN (VGG-16)Rank169.2Person Re Identification · setting=detected · backbone=VGG-16
Source quote
L343: end-to-end CAN(VGG-16) │ 69.2 │ 88.5 │ 94.1 │ 97.8
Market-1501end-to-end CAN (VGG-16)mAP35.9Person Re Identification · backbone=VGG-16 · query-setting=single-query
Source quote
L367: end-to-end CAN(VGG-16) │ {60.3} │ 35.9 │ 72.1 │ 47.9
Market-1501end-to-end CAN (VGG-16)mAP47.9Person Re Identification · backbone=VGG-16 · query-setting=multiple-query
Source quote
L367: end-to-end CAN(VGG-16) │ {60.3} │ 35.9 │ 72.1 │ 47.9
VIPeRCAN(VGG-16)+LOMORank154.1Person Re Identification · fine-tuned · backbone=VGG-16 · features=CAN + LOMO · training=data augmentation and fine-tuning
Source quote
L404: CAN(VGG-16)+LOMO │ 54.1 │ 83.1 │ 91.8 │ 96.4
BibTeX
@article{liu2017end,
  author = {Hao Liu and Jiashi Feng and Meibin Qi and Jianguo Jiang and Shuicheng YAN},
  title = {{End-to-End Comparative Attention Networks for Person Re-identification}},
  journal = {IEEE Trans. Image Process.},
  year = {2017},
  url = {https://openreview.net/forum?id=zNziN7DKimn},
}

Loading related content...

Figure