Robust Continual Test-time Adaptation: Instance-aware BN and Prediction-balanced Memory

Taesik Gong, Jongheon Jeong, Taewon Kim, Yewon Kim, Jinwoo Shin, Sung-Ju Lee

Abstract

Test-time adaptation (TTA) is an emerging paradigm that addresses distributional shifts between training and testing phases without additional data acquisition or labeling cost; only unlabeled test data streams are used for continual model adaptation. Previous TTA schemes assume that the test samples are independent and identically distributed (i.i.d.), even though they are often temporally correlated (non-i.i.d.) in application scenarios, e.g., autonomous driving. We discover that most existing TTA methods fail dramatically under such scenarios. Motivated by this, we present a new test-time adaptation scheme that is robust against non-i.i.d. test data streams. Our novelty is mainly two-fold: (a) Instance-Aware Batch Normalization (IABN) that corrects normalization for out-of-distribution samples, and (b) Prediction-balanced Reservoir Sampling (PBRS) that simulates i.i.d. data stream from non-i.i.d. stream in a class-balanced manner. Our evaluation with various datasets, including real-world non-i.i.d. streams, demonstrates that the proposed robust TTA not only outperforms state-of-the-art TTA algorithms in the non-i.i.d. setting, but also achieves comparable performance to those algorithms under the i.i.d. assumption.

Introduction

Deep learning models frequently encounter performance degradation when deployed in environments that differ from their training distribution. Test-time adaptation (TTA) offers a solution by allowing models to update themselves using unlabeled data seen during deployment. However, a significant gap exists between research assumptions and real-world application: while most TTA methods assume test samples are independent and identically distributed (i.i.d.), real-world data—such as video streams from autonomous vehicles—is often highly temporally correlated (non-i.i.d.).

In these non-i.i.d. scenarios, models may encounter long "bursts" of a single class or environment. Existing TTA methods, which rely heavily on batch statistics, often fail in these settings. They may "over-whiten" data, treating essential object features as noise, or bias model weights toward the most frequently appearing class in a given temporal window.

The NOTE Framework

To address these challenges, we propose NOTE (NOn-i.i.d. TEst-time adaptation), a framework designed for robustness against temporally correlated data streams. NOTE introduces two primary technical innovations:

1. Instance-Aware Batch Normalization (IABN)

Standard Batch Normalization (BN) uses batch-wide mean and variance, which becomes biased when a batch contains highly correlated samples (e.g., only cars). IABN addresses this by treating samples individually, similar to Instance Normalization, but anchoring them to the model's learned global statistics. By applying a soft-shrinkage function, IABN detects and corrects only those statistics that significantly deviate from the expected distribution. This allows the model to adapt to environmental "styles" (like weather changes) without losing the "content" of the object features.

2. Prediction-balanced Reservoir Sampling (PBRS)

To prevent model bias during temporal bursts, NOTE maintains a small internal memory bank managed by PBRS. This component uses two strategies:

  • Time-uniform sampling: Reservoir sampling ensures the memory represents the entire history of the stream.
  • Prediction-uniform sampling: The model's own predictions are used to keep the memory balanced across classes, even if the current input stream is dominated by a single category.
The NOTE framework consists of (1) IABN for normalization correction and (2) PBRS for managing a class-balanced memory to simulate i.i.d. updates.

Experimental Results

We evaluated NOTE across synthetic corruptions (CIFAR-C, ImageNet-C) and real-world correlated datasets, including KITTI (autonomous driving) and HARTH (human activity recognition).

Our results highlight a critical failure in existing TTA methods: while they perform well under i.i.d. assumptions, their error rates skyrocket in non-i.i.d. settings. For instance, on CIFAR10-C, standard methods like TENT collapsed to a 76.4% error rate under temporal correlation. In contrast, NOTE maintained a robust 21.1% error rate.

Performance overview comparing NOTE against state-of-the-art TTA methods. While others fail in non-i.i.d. settings, NOTE remains robust.

On the real-world KITTI-Rain dataset, NOTE reduced classification error to 10.9%, outperforming the source model (12.3%) and significantly besting other TTA methods, which often increased error to over 30% due to correlation-induced bias. Importantly, NOTE remains competitive in standard i.i.d. settings, proving that robustness does not require sacrificing general performance.

Conclusion

NOTE provides a robust framework for test-time adaptation in realistic, temporally correlated environments. By combining instance-aware normalization with prediction-balanced memory sampling, it overcomes the "over-whitening" and class-bias traps that plague existing methods. Future work will explore extending these principles to non-BN architectures, such as Vision Transformers, and addressing potential feedback loops caused by initial prediction errors.

Summary updated

BibTeX
@inproceedings{gong2022robust,
  author = {Taesik Gong and Jongheon Jeong and Taewon Kim and Yewon Kim and Jinwoo Shin and Sung-Ju Lee},
  title = {{Robust Continual Test-time Adaptation: Instance-aware BN and Prediction-balanced Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=yRlbrkuXfpa},
}
Figure