mlsanityData to 7 Oct 2026

Adversarially Robust Few-Shot Anomaly Detection with Vision Foundation Models

arXiv 2510.13643 ↗First posted 15 Oct 2025cs.CVcited by 0

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

  1. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  2. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,764
  5. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
  6. 2014Explaining and Harnessing Adversarial Examplescited by 7,287
  7. 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
  8. 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
  9. 2016Wide Residual Networkscited by 3,057
  10. 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
  11. 2018Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examplescited by 1,259
  12. 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
36 more
  1. 2021Towards Total Recall in Industrial Anomaly Detectioncited by 772
  2. 2020PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localizationcited by 591
  3. 2020On Adaptive Attacks to Adversarial Example Defensescited by 547
  4. 2021CutPaste: Self-Supervised Learning for Anomaly Detection and Localizationcited by 529
  5. 2018Threat of Adversarial Attacks on Deep Learning in Computer Vision: A Surveycited by 459
  6. 2020A Unifying Review of Deep and Shallow Anomaly Detectioncited by 423
  7. 2022Anomaly Detection via Reverse Distillation from One-Class Embeddingcited by 419
  8. 2022SPot-the-Difference Self-Supervised Pre-training for Anomaly Detection and Segmentationcited by 397
  9. 2017Adversarial Examples: Attacks and Defenses for Deep Learningcited by 350
  10. 2023WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentationcited by 311
  11. 2020Sub-Image Anomaly Detection with Deep Pyramid Correspondencescited by 297
  12. 2021Exploring the Limits of Out-of-Distribution Detectioncited by 283
  13. 2023AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detectioncited by 270
  14. 2019Adversarial Attacks and Defenses in Images, Graphs and Text: A Reviewcited by 234
  15. 2020Patch SVDD: Patch-level SVDD for Anomaly Detection and Segmentationcited by 212
  16. 2023EfficientAD: Accurate Visual Anomaly Detection at Millisecond-Level Latenciescited by 157
  17. 2023Deep Industrial Image Anomaly Detection: A Surveycited by 147
  18. 2022Registration based Few-Shot Anomaly Detectioncited by 133
  19. 2020Deep Learning for Medical Anomaly Detection -- A Surveycited by 127
  20. 2024AdaCLIP: Adapting CLIP with Hybrid Learnable Prompts for Zero-Shot Anomaly Detectioncited by 126
  21. 2020Deep Nearest Neighbor Anomaly Detectioncited by 103
  22. 2024Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Promptscited by 88
  23. 2023Pushing the Limits of Fewshot Anomaly Detection in Industry Vision: Graphcorecited by 75
  24. 2023Anomaly Detection with Conditioned Denoising Diffusion Modelscited by 56
  25. 2024AnomalyDINO: Boosting Patch-based Few-shot Anomaly Detection with DINOv2cited by 53
  26. 2024MuSc: Zero-Shot Industrial Anomaly Classification and Segmentation with Mutual Scoring of the Unlabeled Imagescited by 52
  27. 2021Are Vision Transformers Robust to Patch Perturbations?cited by 39
  28. 2023ReConPatch : Contrastive Patch Representation Learning for Industrial Anomaly Detectioncited by 30
  29. 2024UniVAD: A Training-free Unified Model for Few-shot Visual Anomaly Detectioncited by 28
  30. 2021Self-supervised Pseudo Multi-class Pre-training for Unsupervised Anomaly Detection and Segmentation in Medical Imagescited by 23
  31. 2025PatchGuard: Adversarially Robust Anomaly Detection and Localization through Vision Transformers and Pseudo Anomaliescited by 8
  32. 2025Foundation Models and Transformers for Anomaly Detection: A Surveycited by 8
  33. 2023On Pixel-level Performance Assessment in Anomaly Detectioncited by 6
  34. 2024Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddingscited by 6
  35. 2024Adversarially Robust Industrial Anomaly Detection Through Diffusion Modelcited by 3
  36. 2025Foundation Models for Anomaly Detection: Vision and Challengescited by 3

Built on by

Not cited yet.