Feature-Based Instance Neighbor Discovery: Advanced Stable Test-Time Adaptation in Dynamic World

Qinting Jiang, Chuyang Ye, Dongyan Wei, Bingli Wang, Yuan Xue, Jingyan Jiang, Zhi Wang

Abstract

Test-Time Adaptation (TTA) has emerged as a vital technique for mitigating performance degradation caused by domain shift. However, traditional TTA methods often assume a static environment where data distributions change slowly. In real-world "dynamic" scenarios, data streams frequently contain mixed distributions within a single batch, leading to noisy normalization statistics and performance collapse. This paper introduces FIND (Feature-based Instance Neighbor Discovery), a novel framework that utilizes layer-wise feature disentanglement and adaptive normalization to stabilize TTA in non-stationary environments. FIND achieves significant accuracy improvements—up to 30% over existing methods—while maintaining high inference efficiency.

Introduction

Deep learning models are notoriously sensitive to domain shifts, where the test data distribution differs from the training data. Test-Time Adaptation (TTA) addresses this by allowing models to adapt to new environments on the fly without access to the original training set. While effective in static settings, most TTA approaches struggle in dynamic, real-world scenarios. For instance, a single batch of images from an autonomous vehicle's camera might simultaneously contain samples affected by motion blur, snow, and low resolution.

Existing TTA methods typically rely on "global normalization," calculating a single set of statistics for an entire batch. When a batch is heterogeneous, these statistics become corrupted, leading to a failure in feature alignment. The authors of FIND identify this improper normalization as the primary bottleneck for TTA in dynamic settings and propose a "divide and conquer" strategy to restore stability.

Methodology: The FIND Framework

FIND addresses the challenges of dynamic TTA through three core components designed to handle feature-level distribution shifts.

1. Layer-wise Feature Disentanglement (LFD)

Rather than treating a mixed batch as a single entity, LFD employs a graph-based clustering approach inspired by the FINCH algorithm. At every layer of the network, LFD calculates the similarity between features of different images. By grouping features that share similar distribution characteristics, the model effectively partitions a mixed batch into homogeneous subsets, ensuring that normalization statistics are derived from similar data points.

2. Feature Aware Batch Normalization (FABN)

Once features are grouped via LFD, FABN performs the actual normalization. To prevent the model from over-fitting to small or biased subsets within a test batch, FABN blends the newly calculated subset statistics with the original Source Batch Normalization (SBN) statistics from the training phase. This stabilization mechanism ensures that the model retains its foundational knowledge while adapting to local variations.

3. Selective FABN (S-FABN)

Recognizing that not all neural network layers are equally sensitive to domain shifts, the authors introduced S-FABN. This component uses a "cold-start" phase to measure the KL divergence at each layer, identifying which layers are most affected by the shift. By applying the complex partitioning and normalization only to these sensitive layers, FIND significantly boosts inference speed and reduces computational overhead.

Experimental Evaluation

The researchers evaluated FIND using standard benchmarks (CIFAR10-C, CIFAR100-C, and ImageNet-C) under several newly defined dynamic scenarios:

  • CrossMix: Each batch contains samples from 15 different corruption domains.
  • Shuffle: Batches alternate between single-domain and multi-domain compositions.
  • Random: The number of domains per batch is stochastic.
  • Wild Scenario: Introduces "label shift" (imbalanced classes) alongside distribution shifts.

Key Results

In the rigorous ImageNet-C "CrossMix" scenario, FIND achieved an accuracy of 47.19%, a substantial leap from the source model's 37.25% and the previous state-of-the-art (DeYO) at 39.47%. Furthermore, FIND (the selective version) demonstrated remarkable efficiency, operating 30x faster* than competing methods like ViDA. Notably, FIND maintains stable performance even with a batch size of one, a scenario where most TTA methods typically fail.

Discussion and Insights

The success of FIND provides several key insights into the nature of model robustness:

  • Normalization as a Bottleneck: In dynamic environments, adjusting model weights can often be counterproductive. The primary gains in FIND come from correcting internal feature normalization.
  • Natural Clustering: Features from the same domain naturally cluster in high-dimensional space, even when mixed in a single batch, validating the use of LFD.
  • Architecture Agnostic: FIND is the first BN-based TTA method successfully applied to Vision Transformer (ViT) architectures, such as EfficientViT, proving its versatility beyond convolutional networks.

Conclusion

FIND represents a significant step forward in making Test-Time Adaptation viable for the unpredictable nature of the real world. By moving away from global normalization and toward instance-neighbor discovery, the framework provides a robust, efficient, and stable solution for dynamic domain shifts. Future work will explore automating the tuning of the fusion parameters and integrating FIND with online weight update strategies for even more complex data streams.

Summary updated

BibTeX
@inproceedings{jiang2025feature,
  author = {Qinting Jiang and Chuyang Ye and Dongyan Wei and Bingli Wang and Yuan Xue and Jingyan Jiang and Zhi Wang},
  title = {{Feature-Based Instance Neighbor Discovery: Advanced Stable Test-Time Adaptation in Dynamic World}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=bLXfEMe1Dk},
}
Figure