MedBN: Robust Test-Time Adaptation against Malicious Test Samples
Hyejin Park, Jeongyeon Hwang, Sunung Mun, Sangdon Park, Jungseul Ok
Abstract
Test-time adaptation (TTA) has emerged as a promising solution to address performance decay due to unforeseen distribution shifts between training and test data. While recent TTA methods excel in adapting to test data variations, such adaptability exposes a model to vulnerability against malicious examples. Indeed, previous studies have uncovered security vulnerabilities within TTA even when a small proportion of the test batch is maliciously manipulated. In response to the emerging threat, we propose median batch normalization (MedBN), leveraging the robustness of the median for statistics estimation within the batch normalization layer during test-time inference. Our method is algorithm-agnostic, thus allowing seamless integration with existing TTA frameworks. Our experimental results on benchmark datasets, including CIFAR10-C, CIFAR100-C, and ImageNet-C, consistently demonstrate that MedBN outperforms existing approaches in maintaining robust performance across different attack scenarios, encompassing both instant and cumulative attacks. Through extensive experiments, we show that our approach sustains the performance even in the absence of attacks, achieving a practical balance between robustness and performance. Our code is available at https://github.com/mlpostech/MedBN-robust-test-time-adaptation . Output Conv. Layer Batch Norm. Act. Function … … Input (batch size !) … Conv. Layer Act. Function Batch Norm.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 52f81a2d-79a7-4ece-8fb7-151ad9850980Cited by top-tier papers7
- Gradient Alignment Improves Test-Time Adaptation for Medical Image SegmentationZiyang Chen, Yiwen Ye, Yongsheng Pan, Yong XiaAAAI 2025 · 12 citations
- Monitoring Risks in Test-Time AdaptationMona Schirmer, Metod Jazbec, Christian Andersson Naesseth, Eric T. NalisnickNeurIPS 2025 · 10 citations
- TopoTTA: Topology-Enhanced Test-Time Adaptation for Tubular Structure SegmentationJiale Zhou, Wenhan Wang, Shikun Li, Xiaolei Qu et al.ICCV 2025 · 2 citations
- Mixture of Prototypes for Test-time Adaptive SegmentationGuangrui Li, Zhengyu Zhu, Yongxin GeCVPR 2026 · 1 citation
- Smoothing the Shift: Towards Stable Test-Time Adaptation under Complex Multimodal NoisesZirun Guo, Tao JinICLR 2025
Builds on30
- Sharpness-aware Minimization for Efficiently Improving GeneralizationPierre Foret, Ariel Kleiner, Hossein Mobahi, Behnam NeyshaburICLR 2021 · 1,861 citations
- WILDS: A Benchmark of in-the-Wild Distribution ShiftsPang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie et al.ICML 2021 · 1,773 citations
- Tent: Fully Test-Time Adaptation by Entropy MinimizationDequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno A. Olshausen et al.ICLR 2021 · 1,731 citations
- AugMix: A Simple Data Processing Method to Improve Robustness and UncertaintyDan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph et al.ICLR 2020 · 1,572 citations
- Test-Time Training with Self-Supervision for Generalization under Distribution ShiftsYu Sun, Xiaolong Wang, Zhuang Liu, John Miller et al.ICML 2020 · 1,220 citations
Related papers
- TTN: A Domain-Shift Aware Batch Normalization in Test-Time AdaptationHyesu Lim, Byeonggeun Kim, Jaegul Choo, Sungha ChoiICLR 2023 · 21 citations
- On the Adversarial Vulnerability of Label-Free Test-Time AdaptationShahriar Rifat, Jonathan D. Ashdown, Michael J. De Lucia, Ananthram Swami et al.ICLR 2025
- Uncovering Adversarial Risks of Test-Time AdaptationTong Wu, Feiran Jia, Xiangyu Qi, Jiachen T. Wang et al.ICML 2023 · 12 citations
- Buffer layers for Test-Time AdaptationHyeongyu Kim, Geonhui Han, Dosik HwangNeurIPS 2025 · 6 citations
- Un-Mixing Test-Time Normalization Statistics: Combatting Label Temporal CorrelationDevavrat Tomar, Guillaume Vray, Jean-Philippe Thiran, Behzad BozorgtabarICLR 2024 · 9 citations
