Mask-Guided Contrastive Attention Model for Person Re-Identification

Chunfeng Song, Yan Huang, Wanli Ouyang, Liang Wang

Introduction

Person Re-identification (ReID) involves identifying the same individual across non-overlapping camera views. This task is significantly hindered by "background clutter," where environmental noise (e.g., busy streets, varying wall colors) is inadvertently learned by deep models as part of a person's identity. While previous attempts to mitigate this have used complex body part detection or pose estimation, the Mask-guided Contrastive Attention Model (MGCAM) proposes a more efficient solution using simple binary segmentation masks to isolate human body features from the background.

The MGCAM Framework

The MGCAM architecture introduces three primary innovations to improve feature extraction and identity matching:

  1. Synthetic RGB-Mask Inputs: The model utilizes a 4-channel input (RGB + Binary Mask), allowing the convolutional neural network (CNN) to simultaneously learn appearance and body shape (gait) features. This silhouette information is robust to changes in lighting and clothing color.
  2. Contrastive Attention Sub-net: The architecture splits into three streams: full-image, body, and background. A dedicated sub-network generates inverse attention maps for the body and background, guided by the binary mask via a Mean Squared Error (MSE) loss.
  3. Region-level Triplet Loss: This novel loss function operates on features extracted from the same image. It treats the full-image feature as the "anchor," the body-region feature as the "positive," and the background-region feature as the "negative." This forces the model to ensure the final identity feature is dominated by the body and invariant to background noise.
Overview of the MGCAM approach. (a) Input images, binary masks, and extracted body regions. (b) The region-level triplet loss mechanism in feature space, pulling full-image features toward body features and pushing them away from background features.

Key Insights

A critical finding of the research is that "soft" attention is superior to "hard" masking. Simply blacking out the background (hard masking) creates artificial edges that disrupt image smoothness and degrade performance. In contrast, MGCAM’s soft attention allows the network to learn which specific body parts—such as the torso or head—are most discriminative for identification. By using the region-level triplet loss to "clean" the feature vector in high-dimensional space, the resulting full-image vector becomes a much more reliable descriptor for matching.

Experimental Results

The model was evaluated on three major benchmarks: MARS, Market-1501, and CUHK03. The MGCAM-Siamese variant achieved state-of-the-art performance:

  • MARS: Achieved 77.17% Rank-1 accuracy and 71.17% mAP, significantly outperforming the baseline Multi-Scale Context-Aware Network (MSCAN).
  • Market-1501: Reached 83.79% Rank-1 accuracy, a notable improvement over previous benchmarks.
  • CUHK03: Improved Rank-1 accuracy by at least 10% compared to standard ResNet-50 baselines.

Qualitative visualizations confirm that the attention maps successfully focus on the person's torso and head while assigning near-zero weight to the surrounding pavement or walls.

Conclusion and Future Work

MGCAM demonstrates that binary masks can effectively guide attention to suppress background noise in ReID tasks. While the current model relies on an external segmentation tool (like FCN), future work aims to integrate the segmentation process directly into the ReID pipeline. This would create an end-to-end system capable of learning to segment and identify simultaneously, further increasing robustness to noisy input data.

Summary updated

BibTeX
@inproceedings{song2018mask,
  author = {Chunfeng Song and Yan Huang and Wanli Ouyang and Liang Wang},
  title = {{Mask-Guided Contrastive Attention Model for Person Re-Identification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00129},
}
Figure