Test-Time Adaptation on Noisy Data via Model-Pruning-Based Filtering and Flatness-Aware Entropy Minimization

Xingzhi Zhou, Zhiliang Tian, Boyang Zhang, Yibo Zhang, Ka Chun Cheung, Simon See, Hao Yang, Yun Zhou, Nevin L. ZhangAAAI 2025

Presented at AAAI-25, this research introduces MoTTA, a framework designed to enhance the robustness of machine learning models when they encounter "noisy" or out-of-distribution (OOD) data during inference. While Test-Time Adaptation (TTA) is a powerful tool for adjusting models to new environments, it is notoriously sensitive to data contamination. MoTTA addresses this by combining a novel pruning-based filtering mechanism with a geometry-aware optimization strategy.

The Challenge of Noisy Test-Time Adaptation

In real-world deployments, models often face domain shifts—such as a vision system trained on clear roads operating in heavy snow. TTA allows these models to update themselves "on the fly" using unlabeled data from the target environment. However, if the data stream contains "noisy" samples (objects from categories the model was never trained to recognize), standard TTA methods often attempt to learn from them. This leads to "model drift," where the model's performance collapses as it incorporates irrelevant or confusing information.

Existing solutions typically filter noise based on prediction confidence. However, under significant domain shift, a model's confidence scores become unreliable. Furthermore, standard optimization techniques often fail to find stable regions in the loss landscape, making the model prone to erratic updates when exposed to even small amounts of noise.

The MoTTA Framework

MoTTA introduces two primary innovations to overcome these hurdles: ODP-based filtering and Flatness-Aware Entropy Minimization (FlatEM).

The MoTTA framework pipeline: Noisy data streams are filtered using ODP-based selection before entering a buffer for flatness-aware parameter learning.

1. ODP-Based Filtering

Instead of relying on raw confidence, MoTTA utilizes Output Difference under model Pruning (ODP). By applying structured pruning (removing entire channels with low-magnitude weights), the framework measures how much the model's output changes for a given sample. The core insight is that "clean" samples—even those affected by domain shift—tend to produce stable outputs under pruning. In contrast, noisy OOD samples cause the model's output to fluctuate wildly. This allows MoTTA to effectively isolate target samples even when the model's initial prediction is incorrect.

2. Flatness-Aware Entropy Minimization (FlatEM)

Once the noise is filtered, the model must adapt. While standard methods minimize entropy to increase prediction certainty, MoTTA adds a "flatness" constraint. It seeks a region in the loss landscape where the loss is not only low but also stable across small perturbations.

  • Zeroth-order flatness: Ensures the loss does not spike in a small neighborhood around the current weights.
  • First-order flatness: Minimizes the rate of change (gradient) of the loss.
Conceptual illustration of zeroth-order and first-order flatness constraints used to find stable regions in the loss landscape.

To maintain computational efficiency during real-time adaptation, the authors utilize Taylor expansion to approximate these complex optimization problems, avoiding the heavy overhead typically associated with flatness-aware training.

Experimental Results

The researchers evaluated MoTTA on major TTA benchmarks (ImageNet-C, ImageNet-R, and ImageNet-Sketch) contaminated with OOD noise from the SSB-hard and NINCO datasets. MoTTA consistently outperformed state-of-the-art baselines:

  • ImageNet-C: On data contaminated with SSB-hard noise, MoTTA reduced the average classification error to 53.4%, significantly better than the previous best of 56.6%.
  • ImageNet-R/Sketch: MoTTA achieved the lowest error rates (e.g., 56.1% on ImageNet-R), proving its versatility across visual corruptions and stylistic shifts.
  • Ablation Studies: Removing either the ODP filter or the flatness constraints led to immediate performance degradation, confirming that both components are vital for robust adaptation.

Conclusion

MoTTA represents a significant step forward for reliable Test-Time Adaptation. By prioritizing stability over simple accuracy—both in how it selects samples via pruning and how it navigates the loss landscape via FlatEM—it provides a robust defense against the unpredictable nature of real-world data streams. Future work may explore lighter-weight approximations and the impact of different pruning strategies on macro-architectural sensitivity.

Summary updated

BibTeX
@inproceedings{zhou2025test,
  author = {Xingzhi Zhou and Zhiliang Tian and Boyang Zhang and Yibo Zhang and Ka Chun Cheung and Simon See and Hao Yang and Yun Zhou and Nevin L. Zhang},
  title = {{Test-Time Adaptation on Noisy Data via Model-Pruning-Based Filtering and Flatness-Aware Entropy Minimization}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=2gOcK9rIxs},
}
Figure