Abstract
Test-time adaptation (TTA) is essential for maintaining model performance under domain shift. However, standard Batch Normalization (BN) techniques often fail when data arrives in non-random, temporally correlated streams—a common occurrence in real-world applications like autonomous driving. This paper introduces Un-Mixing Test-Time Normalization Statistics (UnMix-TNS), a novel approach that decomposes BN statistics into $K$ distinct components. By updating these components online, UnMix-TNS effectively mitigates label temporal correlation bias, remains robust to small batch sizes, and preserves data privacy by avoiding the use of memory banks.
Introduction
Deep learning models frequently encounter "test-time" data that differs significantly from their training distribution. While Test-Time Adaptation (TTA) aims to rectify this by updating model parameters—specifically Batch Normalization (BN) layers—on the fly, it relies heavily on the assumption that test batches are independently and identically distributed (i.e., i.i.d.).
In practical scenarios such as video surveillance or robotics, this assumption is often violated. Data arrives in "clumpy" streams where labels are temporally correlated; for instance, a camera might capture a long sequence of vehicles before seeing a pedestrian. This lack of diversity in a single batch skews BN statistics, causing a phenomenon known as label temporal correlation bias, which leads to a precipitous drop in model accuracy.
The UnMix-TNS Framework
To address the limitations of standard BN in non-i.i.d. settings, we propose Un-Mixing Test-Time Normalization Statistics (UnMix-TNS). Rather than maintaining a single global set of mean and variance statistics for the entire test stream, UnMix-TNS models the feature distribution as a mixture of $K$ distinct Gaussian components.
The method operates through five key stages:
- Initialization: The pre-trained source BN statistics are "unmixed" into $K$ initial Gaussian components.
- Online Unmixing: As each new test batch arrives, the system calculates instance-wise statistics (mean and variance) for every individual image.
- Similarity Assignment: Using cosine similarity, the method determines which of the $K$ stored components most closely aligns with the current instance's statistics.
- Refined Normalization: The instance-level statistics are "re-mixed" with the most relevant $K$ components to generate a refined, unbiased set of statistics for feature normalization.
- Dynamic Updates: The $K$ components are updated via a momentum-based approach. This allows the model to learn the characteristics of the new domain incrementally without requiring a memory bank to store past images or features.
Experimental Results
We evaluated UnMix-TNS across a variety of rigorous benchmarks, including standard corruption datasets (CIFAR10/100-C, ImageNet-C) and natural domain shifts (DomainNet-126). Additionally, we introduced two new video benchmarks, ImageNet-VID-C and LaSOT-C, specifically designed to evaluate performance under temporal correlation.
Key Performance Metrics
- Accuracy Improvements: On CIFAR100-C, UnMix-TNS reduced the classification error rate by approximately 11% compared to existing normalization baselines like $\alpha$-BN or IABN.
- Video Resilience: On the ImageNet-VID-C dataset, UnMix-TNS achieved a 23% accuracy improvement over standard test-time BN, demonstrating its efficacy in processing real-world streaming data.
- Synergy with TTA Methods: When integrated with the ROID adaptation framework, UnMix-TNS contributed to a 48.3% error reduction on corruption benchmarks.
Discussion and Advantages
UnMix-TNS offers several distinct advantages over traditional TTA methods:
- Batch Size Independence: Standard BN fails with small batch sizes. UnMix-TNS remains robust even when the batch size is reduced to one, making it ideal for real-time edge applications.
- Privacy Preservation: Unlike memory-bank-based methods (e.g., NOTE or RoTTA), UnMix-TNS does not store raw data or features from previous time steps, reducing privacy risks and computational overhead.
- Plug-and-Play Integration: UnMix-TNS is designed as a layer replacement. It can be seamlessly integrated into existing TTA frameworks such as TENT or CoTTA to enhance their resilience to correlated data streams.
Limitations and Future Work
While UnMix-TNS represents a significant step forward, it is not without limitations. The number of components ($K$) is a hyperparameter that currently requires manual tuning; complex scenarios may require $K$ values as high as 256. Future research will focus on automated methods for determining the optimal $K$ and extending the framework to other computer vision tasks, such as semantic segmentation, where BN stability is equally critical.
Conclusion
UnMix-TNS provides a mathematically grounded solution to the problem of label temporal correlation in test-time adaptation. By unmixing and dynamically updating distribution components, the method allows models to maintain high performance in the face of non-i.i.d. data streams, offering a more robust and privacy-conscious alternative for real-world deployment.
Summary updated