CLIP-Based Camera-Agnostic Feature Learning for Intra-Camera Supervised Person Re-Identification

Xuan Tan, Xun Gong, Yang Xiang

TL;DR

This paper introduces CCAFL, a novel framework that leverages CLIP's vision-language capabilities to tackle the challenging problem of Intra-camera Supervised Person Re-Identification (ICS ReID). By integrating text-based prompts and novel discriminative and adversarial learning modules, CCAFL learns camera-agnostic features, significantly improving person re-identification accuracy in scenarios where identity labels are only available within individual cameras.

What Problem Does This Paper Address?

Person re-identification (ReID) aims to identify the same individual across different camera views, a crucial task for security and surveillance. Traditional ReID methods often rely on fully supervised learning, requiring extensive manual annotation of identities across all cameras. This becomes prohibitively expensive in real-world scenarios with numerous cameras and individuals.

Intra-camera Supervised (ICS) ReID offers a more practical solution by only requiring independent identity labeling within each camera, drastically reducing annotation costs. However, this setup presents a significant challenge: the lack of explicit cross-camera identity links makes it difficult for models to learn robust, camera-invariant features. Existing ICS ReID methods struggle with limited intra-camera samples and the inherent variations in appearance across different camera views, leading to suboptimal performance. This paper addresses this gap by proposing a method that effectively utilizes intra-camera supervision while learning features that generalize across cameras.

Methods

The proposed framework, CLIP-based Camera-Agnostic Feature Learning (CCAFL), employs a three-stage learning process:

  1. Intra-camera Pred-defined Labels Prompt Learning: This initial stage leverages the pre-trained CLIP model. Learnable text tokens are trained to generate descriptive textual prompts for pedestrian images within each camera. These prompts provide semantic supervision signals, bridging the gap between visual and textual information and aiding subsequent learning stages.
  2. Intra-camera Discriminative Learning (ICDL): This stage focuses on enhancing feature discriminability within each camera. It involves:
  3. Hybrid Memory Banks: Each camera maintains a memory bank storing centroid and instance features for each ID.
  4. Intra-camera Centroid Contrastive Loss (Lintra1): This loss pulls sample features closer to their corresponding ID's centroid while pushing them away from other centroids within the same camera.
  5. Intra-camera Instance Contrastive Loss (Lintra2): This loss further refines features by considering hard positive and hard negative samples, improving intra-class compactness and inter-class separability.
  6. Intra-camera Image-Text Alignment Loss (L2tce): This loss aligns image features with their corresponding text descriptions generated in the first stage.
  7. Inter-camera Learning: This stage aims to learn camera-invariant features and establish cross-camera associations. It includes:
  8. Inter-camera Association: A graph-based approach is used to identify connected components and assign pseudo-labels to IDs across cameras.
  9. Inter-camera Memory Banks Initialization: Mean features of associated IDs are used to initialize a memory bank for contrastive learning.
  10. Inter-camera Prototypical Contrastive Loss (LIPCL): This loss learns prototype features of IDs across different cameras.
  11. Inter-camera Image-Text Alignment Loss (Linter_i2tce): Similar to the intra-camera stage, this loss aligns image features with text descriptions to improve correlation accuracy.
  12. Inter-camera Adversarial Learning (ICAL): A novel adversarial loss is introduced. A global ID classifier is trained to predict camera-specific features, and the ReID backbone is trained to fool this classifier, forcing it to learn camera-agnostic features. This penalizes the model's ability to predict the camera of origin for a given pedestrian.

Datasets

The proposed method is evaluated on three widely used person ReID datasets:

  • Market-1501
  • DukeMTMC-REID
  • MSMT17

These datasets are re-annotated under the Intra-camera Supervised (ICS) setting, meaning identity labels are only available within each camera view, and accumulated identity numbers for the ICS setting are provided.

Key Insights and Ideas

  • CLIP for Semantic Supervision in ICS ReID: The paper demonstrates that CLIP's ability to generate textual descriptions can be effectively leveraged to provide crucial semantic supervision in ICS ReID, a setting where traditional text-based enhancements are limited due to the lack of cross-camera associations.
  • Two-Pronged Intra-camera Learning: The ICDL module, by explicitly considering hard positive/negative samples and centroid features, significantly improves the model's ability to learn fine-grained, discriminative features within a single camera, even with limited data.
  • Adversarial Learning for Camera Invariance: The ICAL module is a key innovation, using an adversarial approach to explicitly penalize the model for learning camera-specific features. This forces the network to learn representations that are robust to viewpoint and camera variations.
  • Bridging the Gap Between Intra- and Inter-camera Learning: The framework seamlessly integrates intra-camera learning (focusing on within-camera discriminability) with inter-camera learning (focusing on cross-camera generalization), creating a synergistic effect.

Key Results

  • On the challenging MSMT17 dataset, the proposed CCAFL method achieves 58.9% mAP, outperforming state-of-the-art methods by 7.6%.
  • CCAFL also demonstrates superior performance on Market-1501 and DukeMTMC-REID datasets, surpassing existing ICS ReID methods.
  • The method achieves performance comparable to or even exceeding some fully supervised methods, despite significantly lower annotation costs.
  • Ablation studies confirm the effectiveness of each proposed module (ICDL, ICAL, and image-text alignment), with ICAL providing a substantial improvement of 5.9% mAP on MSMT17.

Limitations and Future Work

  • Hyperparameter Sensitivity: The paper acknowledges the need for careful tuning of hyperparameters like the balance weight ($\lambda$), the adversarial learning start epoch, and the distance threshold ($T$) for optimal performance.
  • Computational Cost: While effective, the multi-stage training process and the use of CLIP might introduce higher computational demands compared to simpler ReID models.
  • Future Work: The authors suggest exploring more advanced prompt learning strategies and investigating the application of their framework to other semi-supervised learning tasks. The effectiveness of the learned camera-invariant features for downstream tasks like cross-camera tracking could also be further explored.

Summary updated

Abstract

Contrastive Language-Image Pre-Training (CLIP) model excels in traditional person re-identification (ReID) tasks due to its inherent advantage in generating textual descriptions for pedestrian images. However, applying CLIP directly to intra-camera supervised person re-identification (ICS ReID) presents challenges. ICS ReID requires independent identity labeling within each camera, without associations across cameras. This limits the effectiveness of text-based enhancements. To address this, we propose a novel framework called CLIP-based Camera-Agnostic Feature Learning (CCAFL) for ICS ReID. Accordingly, two custom modules are designed to guide the model to actively learn camera-agnostic pedestrian features: Intra-Camera Discriminative Learning (ICDL) and Inter-Camera Adversarial Learning (ICAL). Specifically, we first establish learnable textual prompts for intra-camera pedestrian images to obtain crucial semantic supervision signals for subsequent intra- and inter-camera learning. Then, we design ICDL to increase inter-class variation by considering the hard positive and hard negative samples within each camera, thereby learning intra-camera finer-grained pedestrian features. Additionally, we propose ICAL to reduce inter-camera pedestrian feature discrepancies by penalizing the model’s ability to predict the camera from which a pedestrian image originates, thus enhancing the model’s capability to recognize pedestrians from different viewpoints. Extensive experiments on popular ReID datasets demonstrate the effectiveness of our approach. Especially, on the challenging MSMT17 dataset, we arrive at 58.9% in terms of mAP accuracy, surpassing state-of-the-art methods by 7.6%. Code is available at <uri xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">https://gitee.com/swjtugx/classmate/tree/master/OurGroup/CCAFL</uri>.
BibTeX
@article{tan2025clip,
  author = {Xuan Tan and Xun Gong and Yang Xiang},
  title = {{CLIP-Based Camera-Agnostic Feature Learning for Intra-Camera Supervised Person Re-Identification}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2025},
  doi = {10.1109/tcsvt.2024.3522178},
}

Loading related content...

Figure