Test-time Detection and Repair of Adversarial Samples via Masked Autoencoder
Not on the map. Why?
Abstract (arXiv)
Training-time defenses, known as adversarial training, incur high training costs and do not generalize to unseen attacks. Test-time defenses solve these issues but most existing test-time defenses require adapting the model weights, therefore they do not work on frozen models and complicate model memory management. The only test-time defense that does not adapt model weights aims to adapt the input with self-supervision tasks. However, we empirically found these self-supervision tasks are not sensitive enough to detect adversarial attacks accurately. In this paper, we propose DRAM, a novel defense method to detect and repair adversarial samples at test time via Masked autoencoder (MAE). We demonstrate how to use MAE losses to build a Kolmogorov-Smirnov test to detect adversarial samples. Moreover, we use the MAE losses to calculate input reversal vectors that repair adversarial samples resulting from previously unseen attacks. Results on large-scale ImageNet dataset show that, compared to all detection baselines evaluated, DRAM achieves the best detection rate (82% on average) on all eight adversarial attacks evaluated. For attack repair, DRAM improves the robust accuracy by 6% ~ 41% for standard ResNet50 and 3% ~ 8% for robust ResNet50 compared with the baselines that use contrastive learning and rotation prediction.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 37 of its 46 references that are in the map. First posted on arXiv 22 Mar 2023.
Builds on
37 of 46 references.
References · 37
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
- 2020Unsupervised Learning of Visual Features by Contrasting Cluster Assignmentscited by 2,845
- 2020Improved Baselines with Momentum Contrastive Learningcited by 2,282
- 2018Unsupervised Representation Learning by Predicting Image Rotationscited by 1,586
- 2019Theoretically Principled Trade-off between Robustness and Accuracycited by 1,510
25 more
- 2016Unsupervised Learning of Visual Representations by Solving Jigsaw Puzzlescited by 1,379
- 2020Big Self-Supervised Models are Strong Semi-Supervised Learnerscited by 1,375
- 2021SimMIM: A Simple Framework for Masked Image Modelingcited by 1,147
- 2015Unsupervised Visual Representation Learning by Context Predictioncited by 1,062
- 2016Adversarial Machine Learning at Scalecited by 934
- 2017Learning to Generalize: Meta-Learning for Domain Generalizationcited by 762
- 2017ZOO: Zeroth Order Optimization based Black-box Attacks to Deep Neural Networks without Training Substitute Modelscited by 656
- 2020Contrastive Learning for Unpaired Image-to-Image Translationcited by 637
- 2021Domain Generalization with MixStylecited by 563
- 2019Using Self-Supervised Learning Can Improve Model Robustness and Uncertaintycited by 511
- 2017Feature Squeezing: Detecting Adversarial Examples in Deep Neural Networkscited by 484
- 2018Invariant Information Clustering for Unsupervised Image Classification and Segmentationcited by 454
- 2019Domain Generalization via Model-Agnostic Learning of Semantic Featurescited by 405
- 2021MEMO: Test Time Robustness via Adaptation and Augmentationcited by 376
- 2021SSD: A Unified Framework for Self-Supervised Outlier Detectioncited by 264
- 2016Learning Representations for Automatic Colorizationcited by 251
- 2020Deep Domain-Adversarial Image Generation for Domain Generalisationcited by 231
- 2022Test-Time Training with Masked Autoencoderscited by 208
- 2021TSDAE: Using Transformer-based Sequential Denoising Auto-Encoder for Unsupervised Sentence Embedding Learningcited by 116
- 2019Metric Learning for Adversarial Robustnesscited by 77
- 2022Evaluating the Adversarial Robustness of Adaptive Test-time Defensescited by 64
- 2019A New Defense Against Adversarial Images: Turning a Weakness into a Strengthcited by 49
- 2021Adversarial Attacks are Reversible with Natural Supervisioncited by 47
- 2021Enhancing Adversarial Robustness via Test-time Transformation Ensemblingcited by 27
- 2022Reverse Engineering of Imperceptible Adversarial Image Perturbationscited by 17
Built on by
Citing papers per year: 2023: 1; 2024: 0; 2025: 3.
4 papers.
- 2023Robust Feature Inference: A Test-time Defense Strategy using Spectral Projectionscited by 3
- 2025Test-Time Defense Against Adversarial Attacks via Stochastic Resonance of Latent Ensemblescited by 2
- 2025Diffusion or Non-Diffusion Adversarial Defenses: Rethinking the Relation between Classifier and Adversarial Purifiercited by 0
- 2025MedFedPure: A Medical Federated Framework with MAE-based Detection and Diffusion Purification for Inference-Time Attackscited by 0
- 2025MedFedPure: A Medical Federated Framework with MAE-based Detection and Diffusion Purification for Inference-Time Attacks7 Nov 2025
- 2025Test-Time Defense Against Adversarial Attacks via Stochastic Resonance of Latent Ensembles3 Oct 2025
- 2025Diffusion or Non-Diffusion Adversarial Defenses: Rethinking the Relation between Classifier and Adversarial Purifier28 Jan 2025
- 2023Robust Feature Inference: A Test-time Defense Strategy using Spectral Projections21 Jul 2023