PatchGuard: Adversarially Robust Anomaly Detection and Localization through Vision Transformers and Pseudo Anomalies
Not on the map. Why?
Abstract (arXiv)
Anomaly Detection (AD) and Anomaly Localization (AL) are crucial in fields that demand high reliability, such as medical imaging and industrial monitoring. However, current AD and AL approaches are often susceptible to adversarial attacks due to limitations in training data, which typically include only normal, unlabeled samples. This study introduces PatchGuard, an adversarially robust AD and AL method that incorporates pseudo anomalies with localization masks within a Vision Transformer (ViT)-based architecture to address these vulnerabilities. We begin by examining the essential properties of pseudo anomalies, and follow it by providing theoretical insights into the attention mechanisms required to enhance the adversarial robustness of AD and AL systems. We then present our approach, which leverages Foreground-Aware Pseudo-Anomalies to overcome the deficiencies of previous anomaly-aware methods. Our method incorporates these crafted pseudo-anomaly samples into a ViT-based framework, with adversarial training guided by a novel loss function designed to improve model robustness, as supported by our theoretical analysis. Experimental results on well-established industrial and medical datasets demonstrate that PatchGuard significantly outperforms previous methods in adversarial settings, achieving performance gains of 53.2% in AD and 68.5% in AL, while also maintaining competitive accuracy in non-adversarial settings. The code repository is available at https://github.com/rohban-lab/PatchGuard .
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 78 of its 99 references that are in the map. First posted on arXiv 10 Jun 2025.
Builds on
78 of 99 references.
References · 78
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2015U-Net: Convolutional Networks for Biomedical Image Segmentationcited by 19,604
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2016Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localizationcited by 6,690
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2013Intriguing properties of neural networkscited by 5,114
- 2020Bootstrap your own latent: A new approach to self-supervised Learningcited by 4,712
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2020Exploring Simple Siamese Representation Learningcited by 2,853
38 more
- 2020Unsupervised Learning of Visual Features by Contrasting Cluster Assignmentscited by 2,845
- 2017Improved Regularization of Convolutional Neural Networks with Cutoutcited by 1,623
- 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
- 2018Deep Anomaly Detection with Outlier Exposurecited by 939
- 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
- 2021Towards Total Recall in Industrial Anomaly Detectioncited by 772
- 2020Simple Copy-Paste is a Strong Data Augmentation Method for Instance Segmentationcited by 595
- 2021CutPaste: Self-Supervised Learning for Anomaly Detection and Localizationcited by 529
- 2021DRAEM -- A discriminatively trained reconstruction embedding for surface anomaly detectioncited by 510
- 2021The RSNA-ASNR-MICCAI BraTS 2021 Benchmark on Brain Tumor Segmentation and Radiogenomic Classificationcited by 507
- 2018Threat of Adversarial Attacks on Deep Learning in Computer Vision: A Surveycited by 459
- 2020CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instancescited by 441
- 2020Hard Negative Mixing for Contrastive Learningcited by 399
- 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
- 2022A Unified Model for Multi-class Anomaly Detectioncited by 267
- 2023SimpleNet: A Simple Network for Image Anomaly Detection and Localizationcited by 256
- 2019Simple Black-box Adversarial Attackscited by 249
- 2017Detecting Adversarial Samples from Artifactscited by 244
- 2019Adversarial Attacks and Defenses in Images, Graphs and Text: A Reviewcited by 234
- 2014Towards Open World Recognitioncited by 226
- 2021VT-ADL: A Vision Transformer Network for Image Anomaly Detection and Localizationcited by 222
- 2021A Unified Survey on Anomaly, Novelty, Open-Set, and Out-of-Distribution Detection: Solutions and Future Challengescited by 154
- 2023Deep Industrial Image Anomaly Detection: A Surveycited by 147
- 2020Learning and Evaluating Representations for Deep One-class Classificationcited by 133
- 2020Deep Learning for Medical Anomaly Detection -- A Surveycited by 127
- 2020ATOM: Robustifying Out-of-distribution Detection Using Outlier Miningcited by 116
- 2021Natural Synthetic Anomalies for Self-Supervised Anomaly Detection and Localizationcited by 116
- 2022DSR -- A dual subspace re-projection network for surface anomaly detectioncited by 89
- 2023Dream the Impossible: Outlier Imagination with Diffusion Modelscited by 77
- 2022SegPGD: An Effective and Efficient Adversarial Attack for Evaluating and Boosting Segmentation Robustnesscited by 74
- 2024A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localizationcited by 74
- 2016Semantic Segmentation using Adversarial Networkscited by 73
- 2023ReContrast: Domain-Specific Anomaly Detection via Contrastive Reconstructioncited by 62
- 2021A Survey On Universal Adversarial Attackcited by 59
- 2020Robust Out-of-distribution Detection for Neural Networkscited by 57
- 2023Anomaly Detection with Conditioned Denoising Diffusion Modelscited by 56
50 most cited of 78 All 78 (JSON)
Built on by
Citing papers per year: 2025: 3; 2026: 5.
8 papers.
- 2025FrameShield: Adversarially Robust Video Anomaly Detectioncited by 2
- 2026RAID: Retrieval-Augmented Anomaly Detectioncited by 2
- 2025DISTIL: Data-Free Inversion of Suspicious Trojan Inputs via Latent Diffusioncited by 1
- 2025Adversarially Robust Few-Shot Anomaly Detection with Vision Foundation Modelscited by 0
- 2026HAViT: Historical Attention Vision Transformercited by 0
- 2026Semantic Iterative Reconstruction: One-Shot Universal Anomaly Detectioncited by 0
- 2026PADFormer: Pose-agnostic Anomaly Detection from Sparse View Imagescited by 0
- 2026GeoMAD: Geometry-Aware Multi-View Anomaly Detection via Deformable Fusion and Distributional Alignmentcited by 0
- 2026GeoMAD: Geometry-Aware Multi-View Anomaly Detection via Deformable Fusion and Distributional Alignment27 Aug 2026
- 2026PADFormer: Pose-agnostic Anomaly Detection from Sparse View Images4 Aug 2026
- 2026Semantic Iterative Reconstruction: One-Shot Universal Anomaly Detection24 Mar 2026
- 2026HAViT: Historical Attention Vision Transformer19 Mar 2026
- 2026RAID: Retrieval-Augmented Anomaly Detection23 Feb 2026
- 2025FrameShield: Adversarially Robust Video Anomaly Detection24 Oct 2025
- 2025Adversarially Robust Few-Shot Anomaly Detection with Vision Foundation Models15 Oct 2025
- 2025DISTIL: Data-Free Inversion of Suspicious Trojan Inputs via Latent Diffusion30 Jul 2025