Adversarially Robust Few-Shot Anomaly Detection with Vision Foundation Models
Not on the map. Why?
Abstract (arXiv)
Vision foundation models such as DINOv2 enable strong few-shot anomaly detection (FSAD) through simple non-parametric k-nearest-neighbor (k-NN) scoring over frozen patch features. Existing robust anomaly detection methods assume large normal-class training sets and adversarial training of the feature extractor. The few-shot regime, where the detector consists of a frozen backbone and a non-parametric scorer, has remained unaddressed despite its widespread deployment. We develop a white-box attack framework adapted to k-NN memory-bank detectors and introduce an adversarially robust FSAD method which is training-free with respect to the backbone. We introduce the DistanceProbe (DP), a lightweight MLP trained by regression to predict per-patch k-NN distance directly from frozen features, providing the differentiable proxy required for gradient-based attacks against non-parametric scorers. We further propose a two-level combined defense that operates using only the normal reference support set images. At the input level, PatchShift (PS) applies random pixel shifts to exploit the misalignment of adversarial perturbations with the encoder's patch grid, aggregating scores across multiple shifted views via element-wise median pooling. At the feature level we employ the FeaturePurifier (FP), a lightweight residual MLP trained on clean and adversarially augmented support features to project perturbed representations back toward the clean feature manifold. Through comprehensive experiments under various adversarial settings, we show that our method exhibits robust detection and localization with performance gains of ~27% image-level AUROC and ~51% pixel-level PRO over the undefended attacked baseline across MVTec-AD, VisA, and MPDD at k=4 shots, while preserving clean accuracy within 3%, matching full-shot adversarially-trained baselines on pixel-level AUROC, and holding under adaptive attack.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 48 of its 59 references that are in the map. First posted on arXiv 15 Oct 2025.
Builds on
48 of 59 references.
References · 48
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,764
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2016Wide Residual Networkscited by 3,057
- 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
- 2018Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examplescited by 1,259
- 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
36 more
- 2021Towards Total Recall in Industrial Anomaly Detectioncited by 772
- 2020PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localizationcited by 591
- 2020On Adaptive Attacks to Adversarial Example Defensescited by 547
- 2021CutPaste: Self-Supervised Learning for Anomaly Detection and Localizationcited by 529
- 2018Threat of Adversarial Attacks on Deep Learning in Computer Vision: A Surveycited by 459
- 2020A Unifying Review of Deep and Shallow Anomaly Detectioncited by 423
- 2022Anomaly Detection via Reverse Distillation from One-Class Embeddingcited by 419
- 2022SPot-the-Difference Self-Supervised Pre-training for Anomaly Detection and Segmentationcited by 397
- 2017Adversarial Examples: Attacks and Defenses for Deep Learningcited by 350
- 2023WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentationcited by 311
- 2020Sub-Image Anomaly Detection with Deep Pyramid Correspondencescited by 297
- 2021Exploring the Limits of Out-of-Distribution Detectioncited by 283
- 2023AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detectioncited by 270
- 2019Adversarial Attacks and Defenses in Images, Graphs and Text: A Reviewcited by 234
- 2020Patch SVDD: Patch-level SVDD for Anomaly Detection and Segmentationcited by 212
- 2023EfficientAD: Accurate Visual Anomaly Detection at Millisecond-Level Latenciescited by 157
- 2023Deep Industrial Image Anomaly Detection: A Surveycited by 147
- 2022Registration based Few-Shot Anomaly Detectioncited by 133
- 2020Deep Learning for Medical Anomaly Detection -- A Surveycited by 127
- 2024AdaCLIP: Adapting CLIP with Hybrid Learnable Prompts for Zero-Shot Anomaly Detectioncited by 126
- 2020Deep Nearest Neighbor Anomaly Detectioncited by 103
- 2024Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Promptscited by 88
- 2023Pushing the Limits of Fewshot Anomaly Detection in Industry Vision: Graphcorecited by 75
- 2023Anomaly Detection with Conditioned Denoising Diffusion Modelscited by 56
- 2024AnomalyDINO: Boosting Patch-based Few-shot Anomaly Detection with DINOv2cited by 53
- 2024MuSc: Zero-Shot Industrial Anomaly Classification and Segmentation with Mutual Scoring of the Unlabeled Imagescited by 52
- 2021Are Vision Transformers Robust to Patch Perturbations?cited by 39
- 2023ReConPatch : Contrastive Patch Representation Learning for Industrial Anomaly Detectioncited by 30
- 2024UniVAD: A Training-free Unified Model for Few-shot Visual Anomaly Detectioncited by 28
- 2021Self-supervised Pseudo Multi-class Pre-training for Unsupervised Anomaly Detection and Segmentation in Medical Imagescited by 23
- 2025PatchGuard: Adversarially Robust Anomaly Detection and Localization through Vision Transformers and Pseudo Anomaliescited by 8
- 2025Foundation Models and Transformers for Anomaly Detection: A Surveycited by 8
- 2023On Pixel-level Performance Assessment in Anomaly Detectioncited by 6
- 2024Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddingscited by 6
- 2024Adversarially Robust Industrial Anomaly Detection Through Diffusion Modelcited by 3
- 2025Foundation Models for Anomaly Detection: Vision and Challengescited by 3
Built on by
Not cited yet.