NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PatchGuard++: Efficient Provable Attack Detection against Adversarial Patches

Chong Xiang, Prateek MittalarXiv 2021

Abstract

PatchGuard++ addresses the significant gap between clean accuracy and provable robustness in computer vision by shifting the defense objective from robust prediction to robust detection of adversarial patches. By performing masking in the feature space rather than the pixel space, PatchGuard++ achieves state-of-the-art provable defense performance on high-resolution datasets like ImageNet. Crucially, it does so with significantly lower computational overhead than previous detection-based methods, making provable security feasible for real-world applications.

Introduction

Adversarial patches represent a uniquely dangerous threat to computer vision systems because they are "physically realizable." Unlike subtle $L_p$ perturbations that affect every pixel, a patch is a localized, high-intensity sticker that an attacker can place on a real-world object—such as a stop sign—to deceive a model.

Existing "provably robust" defenses aim to guarantee a correct prediction regardless of the patch content. However, these methods often suffer from a massive "robustness-accuracy gap," where clean performance on un-attacked images is significantly degraded. PatchGuard++ addresses this by relaxing the requirement: instead of always needing to be correct under attack, the model must either provide a correct prediction or detect that it is being attacked. This detection-based approach is highly practical for safety-critical systems like autonomous vehicles, where an alert can trigger a fallback to a human operator or a safe-stop procedure.

Methodology

PatchGuard++ builds upon the original PatchGuard framework but introduces a more efficient detection mechanism through three primary stages:

  1. Small Receptive Fields: The system utilizes a CNN architecture (specifically BagNet-33) where each feature in the final layer only "sees" a small, local region of the input image. This ensures that a localized adversarial patch can only corrupt a bounded number of features in the resulting feature map.
  2. Feature-Space Masking: This is the core innovation of PatchGuard++. Previous detection methods, such as "Minority Report" (MR), applied masks in the pixel space, requiring the entire model to be re-run for every possible mask position—a process that is computationally prohibitive for high-resolution images. PatchGuard++ extracts a feature map once and applies masks directly to that feature map.
  3. Consensus and Disagreement: The system evaluates predictions across all possible masked versions of the feature map. On clean images, predictions typically show invariance; masking a small portion rarely changes the classification. On attacked images, masking the corrupted features likely restores the correct class, while masking elsewhere leaves the model fooled. If there is significant disagreement (inconsistency) between these masked predictions, the system issues an "attack alert."

Experimental Results

The authors evaluated PatchGuard++ on three standard benchmarks: ImageNet (high-resolution), ImageNette (a 10-class subset), and CIFAR-10 (rescaled to 192x192).

Comparison of PatchGuard++ against state-of-the-art defenses on ImageNette, ImageNet, and CIFAR-10.

As shown in the results above, PatchGuard++ significantly outperforms previous provably robust defenses. On ImageNette, it achieved up to 95.3% clean accuracy and 92.9% provable robust accuracy against a 2% square patch. On the full ImageNet dataset, it delivered a 13% improvement in provable robust accuracy over the original PatchGuard while maintaining higher clean accuracy. Notably, while the pixel-masking "Minority Report" defense is computationally infeasible for ImageNet, PatchGuard++ remains highly efficient.

Discussion and Insights

Efficiency through Feature-Space Operations

By moving masking operations from input pixels to intermediate feature maps, PatchGuard++ drastically reduces the number of expensive forward passes. This makes provable detection feasible for 224x224 ImageNet images, where previous methods were roughly 100x slower.

The Threshold Trade-off

The confidence threshold $\tau$ acts as a tunable parameter. Lowering $\tau$ makes the defense more "suspicious," which increases provable robust accuracy (detecting more attacks) but at the cost of slightly lower clean accuracy due to increased false alerts or abstentions.

Limitations and Future Work

While PatchGuard++ represents a major step forward, some limitations remain. The model "fails" to provide a class prediction when an attack is detected (abstention), which may not be sufficient in high-stakes real-time scenarios requiring recovery. Furthermore, the defense relies on models with small receptive fields (like BagNets), which currently trail slightly behind the clean performance of large-receptive-field models like Vision Transformers (ViTs). Future work may explore how natural occlusions trigger the detection mechanism and how to integrate these techniques with broader model architectures.

Summary updated

BibTeX
@misc{xiang2021patchguard,
  author = {Chong Xiang and Prateek Mittal},
  title = {{PatchGuard++: Efficient Provable Attack Detection against Adversarial Patches}},
  year = {2021},
  eprint = {2104.12609},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.12609},
}
Figure