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 Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Monitoring Risks in Test-Time Adaptation cites Tent: Fully Test-Time Adaptation by Entropy Minimization
- Monitoring Risks in Test-Time Adaptation cites WILDS: A Benchmark of in-the-Wild Distribution Shifts
- Smoothing the Shift: Towards Stable Test-Time Adaptation under Complex Multimodal Noises cites Tent: Fully Test-Time Adaptation by Entropy Minimization
- Smoothing the Shift: Towards Stable Test-Time Adaptation under Complex Multimodal Noises cites Test-Time Training with Self-Supervision for Generalization under Distribution Shifts
- Mixture of Prototypes for Test-time Adaptive Segmentation cites Tent: Fully Test-Time Adaptation by Entropy Minimization
- TopoTTA: Topology-Enhanced Test-Time Adaptation for Tubular Structure Segmentation cites Tent: Fully Test-Time Adaptation by Entropy Minimization
- Tent: Fully Test-Time Adaptation by Entropy Minimization cites AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty
- WILDS: A Benchmark of in-the-Wild Distribution Shifts cites Test-Time Training with Self-Supervision for Generalization under Distribution Shifts
- Gradient Alignment Improves Test-Time Adaptation for Medical Image Segmentation cites Tent: Fully Test-Time Adaptation by Entropy Minimization
- Gradient Alignment Improves Test-Time Adaptation for Medical Image Segmentation cites Test-Time Training with Self-Supervision for Generalization under Distribution Shifts
Cited 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
