Generalizable Person Re-identification via Self-Supervised Batch Norm Test-Time Adaption

Ke Han, Chenyang Si, Yan Huang, Liang Wang, Tieniu Tan

Abstract

Person re-identification (re-ID) models frequently suffer from performance degradation when deployed in unseen environments due to domain shift. This paper introduces Batch Norm Test-time Adaption (BNTA), a framework designed to improve model generalization by updating Batch Normalization (BN) layers at inference time. By leveraging self-supervised learning (SSL) tasks on unlabeled target data, BNTA allows a model to adapt its internal feature distributions to new visual contexts in seconds. Experimental results on benchmark datasets like VIPeR, GRID, and iLIDS demonstrate that BNTA achieves state-of-the-art performance in cross-domain scenarios.

Introduction

The goal of person re-identification (re-ID) is to associate images of the same individual across non-overlapping camera views. While deep learning has significantly advanced re-ID performance, these models often lack robustness. A model trained on a specific source domain—such as a well-lit university campus—frequently fails when deployed in a target domain with different lighting, camera angles, or clothing styles. This phenomenon, known as domain shift, remains a primary obstacle to the real-world deployment of re-ID systems.

Traditional approaches to this problem involve Domain Generalization (DG) or Unsupervised Domain Adaptation (UDA). However, DG methods often fail to capture the specific nuances of a new environment, and UDA requires access to target data during the training phase, which is not always feasible. This paper proposes a third path: Test-Time Adaption (TTA), where the model adapts to the target domain on the fly using only unlabeled images from the deployment environment.

The Bottleneck: Batch Normalization

The authors identify Batch Normalization (BN) as a critical factor in domain sensitivity. BN layers are designed to stabilize training by normalizing activations using the mean and variance of the training data. These layers also include learnable affine parameters (scale $\gamma$ and shift $\beta$).

When a model is moved to a new domain, the "frozen" statistics and affine parameters from the source training set become a liability. They force the target data into a distribution that does not match its actual characteristics, leading to less discriminative features. While some methods attempt to use Instance Normalization (IN) to mitigate this, the authors show that specifically updating BN parameters at test time is a more effective strategy for maintaining identity-aware feature representations.

The BNTA Framework

BNTA operates in two distinct phases: a multi-task training phase on source data and a rapid adaptation phase on target data.

1. Multi-Task Training

During the initial training on source data, the model is optimized using a standard identity loss (Fully Supervised Learning) alongside two auxiliary self-supervised learning (SSL) heads. This prepares the model to perform the SSL tasks that will later be used for adaptation.

2. Test-Time Adaption (TTA)

When the model encounters a new target domain, it performs a brief adaptation step before inference. Crucially, the convolutional weights of the backbone remain frozen to preserve the fundamental feature extraction capabilities. Only the BN parameters (both the running statistics and the affine $\gamma$ and $\beta$ parameters) are updated. This update is driven by two novel SSL tasks that require no human labels:

  • Part Positioning: The model divides a person's image into horizontal segments (e.g., head, torso, legs) and learns to predict their correct vertical order. This task forces the model to recognize and align human body structures, which are consistent across domains even if lighting or resolution change.
  • Part Nearest Neighbor Matching: The model identifies the most similar body parts across different images in the target gallery. By treating these highly similar local patches as "positive pairs," the model can refine its internal distribution to better distinguish between individuals within the specific visual context of the target domain.

Experimental Results

The authors evaluated BNTA by training on a massive combined source dataset (including CUHK02, CUHK03, Market-1501, DukeMTMC-reID, and CUHK-SYSU) and testing on three unseen target datasets: VIPeR, GRID, and iLIDS.

Performance Gains

BNTA achieved significant improvements over baseline models and established new state-of-the-art (SOTA) results for generalizable re-ID:

  • VIPeR: Rank-1 accuracy improved from a 50.9% baseline to 57.4%.
  • GRID: Rank-1 accuracy saw a massive jump from 38.5% to 51.1%.
  • iLIDS: Rank-1 accuracy reached 80.6%, up from 76.1%.

Efficiency and Ablation

A key advantage of BNTA is its efficiency. The adaptation process takes approximately 6.8 seconds on a single GPU for the GRID dataset, making it practical for real-world deployment. Ablation studies confirmed that updating both the statistics and the affine parameters is necessary for peak performance, and that the combination of both SSL tasks (Positioning and Matching) provides the most robust generalization.

Conclusion and Future Work

BNTA demonstrates that Batch Normalization is not just a training tool but a powerful lever for domain adaptation. By updating only BN parameters through self-supervised tasks at test time, models can overcome significant domain shifts without the need for target-domain labels or expensive retraining.

However, the method currently relies on having a "batch" or gallery of images available for the nearest neighbor matching task, which may limit its use in strictly sequential streaming applications. Future research may explore how to adapt other layer types or optimize the framework for single-image streaming scenarios.

Summary updated

BibTeX
@inproceedings{han2022generalizable,
  author = {Ke Han and Chenyang Si and Yan Huang and Liang Wang and Tieniu Tan},
  title = {{Generalizable Person Re-identification via Self-Supervised Batch Norm Test-Time Adaption}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i1.19963},
}
Figure