Towards Anytime Retrieval: A Benchmark for Anytime Person Re-Identification

Xulin Li, Yan Lu, Bin Liu, Jiaze Li, Qinhong Yang, Tao Gong, Qi Chu, Mang Ye, Nenghai Yu

TL;DR

Real-world person re-identification (ReID) requires retrieving individuals across different times of day (modality changes) and long time spans (clothing changes). This paper introduces Anytime Person Re-identification (AT-ReID) along with AT-USTC, the first large-scale dataset covering all six day/night and short/long-term scenarios. They also propose Uni-AT, a unified multi-scenario model that leverages a novel Mixture-of-Attribute-Experts and a hierarchical dynamic loss weighting strategy to achieve state-of-the-art performance across all conditions.

What Problem Does This Paper Address?

Traditional person re-identification (ReID) systems are typically evaluated under narrow, siloed conditions. For instance, standard ReID assumes short time intervals with no clothing changes; Cross-Modality ReID (CM-ReID) handles day-to-night (RGB to Infrared) transitions but assumes the same clothes; Cloth-Changing ReID (CC-ReID) handles long-term appearance changes but stays within the RGB domain.

In reality, a robust surveillance system must operate anytime—meaning it needs to handle both illumination/modality shifts and clothing changes simultaneously. The authors identify a significant research gap: no existing dataset or model addresses all six combinations of time-of-day (Daytime, Nighttime, All-day) and time-interval (Short-term, Long-term) variations.

The six non-overlapping scenarios based on variations in time and clothing.

Methods

To solve the multi-scenario challenge without suffering from inter-scenario interference (e.g., color cues help in daytime short-term but hurt in cross-modality or long-term settings), the authors propose Uni-AT, which consists of three key components:

  1. Multi-Scenario ReID (MS-ReID) Framework: Built on a Vision Transformer (ViT) backbone, it uses 6 distinct classification (CLS) tokens—one dedicated to each scenario—to act as specialized information gatherers. It employs a scenario-aware identity loss with distinct negative category sets (e.g., treating different clothes as different categories for short-term tasks, but grouping them by person ID for long-term tasks).
  2. Mixture-of-Attribute-Experts (MoAE): Instead of standard coarse parameter sharing, MoAE inserts scenario-specific expert networks parallel to the ViT's feed-forward networks (FFN). Crucially, these experts are built by combining shared "attribute layers" corresponding to Time-Moment (Daytime, Nighttime, All-day) and Time-Interval (Short-term, Long-term). This allows fine-grained, flexible knowledge transfer across related scenarios.
  3. Hierarchical Dynamic Weighting (HDW): Treats multi-scenario learning as a multi-task optimization problem. It dynamically adjusts loss weights based on prediction confidence, grouping tasks hierarchically by their shared attributes to ensure that harder scenarios are not dominated by easier ones during training.

Datasets

  • AT-USTC (New): The first dedicated benchmark for AT-ReID. It contains 403,599 images (199,803 RGB and 203,796 IR) of 270 identities across 710 clothing sets, captured by 16 cameras over a span of 21 months. On average, each person is captured 29.1 times across different seasons and lighting conditions, offering unprecedented intra-identity diversity.
  • Evaluation Datasets (Cross-Domain Generalization): Market1501, CUHK03, SYSU-MM01, PRCC, and LTCC were used to evaluate how well models trained on AT-USTC generalize to existing specialized benchmarks.
Figure 5. Each person in AT-USTC has been photographed 29.1 times on average, resulting in higher intra-identity diversity. Im- ages of each dataset all belong to the same individual.

Key Insights and Ideas

  • Siloed Models Fail Globally: Methods optimized for specific sub-tasks (like clothing changes) generalize poorly to others (like day-night modality shifts) because their optimization objectives conflict (e.g., relying on RGB color cues vs. structural invariant cues).
  • Attribute-Level Sharing Beats Coarse MoE: Standard Mixture-of-Experts (MoE) models either share everything or isolate tasks completely. By breaking experts down into sub-components (Time-Moment and Time-Interval attribute layers), Uni-AT allows positive knowledge transfer (e.g., Daytime Short-term and Daytime Long-term share the "Daytime" attribute layer) while mitigating gradient conflicts.
  • Intra-Identity Diversity Drives Generalization: A fascinating finding is that training on a dataset with high intra-identity variation (many outfits, seasons, and lighting conditions per person) yields vastly superior cross-domain generalization compared to training on datasets with more unique identities but less variation per identity.

Key Results

  • State-of-the-Art Performance: Uni-AT achieves an overall Any-Time Rank-1 accuracy of 55.80% and 41.38% mAP on the AT-USTC dataset, significantly outperforming standard ReID baselines (50.90% Rank-1) and specialized models like CLIP-ReID.
  • MoE Superiority: The proposed MoAE module outperforms competitive multi-task architectures like MMoE and PLE in both accuracy and computational efficiency, requiring only 1.2× the inference time of a non-expert model while using 12 experts.
  • Cross-Dataset Generalization: A standard ResNet50 model trained on AT-USTC outperformed models trained on MSMT17, DeepChange, and LLCM by an average of 10.90% to 14.36% Rank-1 accuracy when tested across five external datasets, proving the robustness and scalability of the AT-USTC dataset.

Limitations and Future Work

  • Scenario Determinability: The scenario-aware framework works exceptionally well when the scenario is known or easily determinable (e.g., via camera timestamps and metadata). However, handling completely uncertain or unlabelled scenarios relies on falling back to a default "all-day/long-term" setting, which is sub-optimal.
  • Future Directions: The authors suggest that future work could explore automated scenario discovery or continuous test-time adaptation to seamlessly transition between scenarios without relying on explicit metadata.

Summary updated

BibTeX
@inproceedings{li2025towards,
  author = {Xulin Li and Yan Lu and Bin Liu and Jiaze Li and Qinhong Yang and Tao Gong and Qi Chu and Mang Ye and Nenghai Yu},
  title = {{Towards Anytime Retrieval: A Benchmark for Anytime Person Re-Identification}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/164},
}
Figure