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

DiffPAD: Denoising Diffusion-Based Adversarial Patch Decontamination

Jia Fu, Xiao Zhang, Sepideh Pashami, Fatemeh Rahimian, Anders Holst

Abstract

Adversarial patches represent a significant threat to Deep Neural Networks (DNNs), utilizing localized, high-intensity perturbations to induce misclassification. This paper introduces DiffPAD, a novel defense framework that leverages pre-trained diffusion models to decontaminate images targeted by such attacks. By framing the defense as a two-step process of patch localization via super-resolution and patch removal via inpainting, DiffPAD achieves state-of-the-art robustness without the need for expensive model fine-tuning or manual text prompts.

Introduction

Deep Neural Networks are notoriously vulnerable to adversarial patches—maliciously crafted localized perturbations, such as a sticker on a stop sign, designed to fool classifiers. While defenses for global adversarial attacks (where perturbations are spread across the entire image) are well-studied, localized patch attacks present unique challenges. Specifically, existing defenses often struggle with precise localization—finding the patch without masking critical image features—and restoration—filling the masked area with naturalistic content that preserves the classifier's accuracy.

Current diffusion-based defenses typically treat noise as a global phenomenon, which is inefficient for localized patches. Furthermore, many specialized defenses remain vulnerable to "adaptive attacks," where an adversary aware of the defense mechanism attempts to bypass it.

Methodology: The DiffPAD Pipeline

DiffPAD treats adversarial defense as an image restoration problem, utilizing a three-phase pipeline powered by a Denoising Diffusion Restoration Model (DDRM).

  1. Resolution-Based Localization: Adversarial patches are highly sensitive to changes in resolution. DiffPAD downsamples the input image and then uses a DDRM to perform super-resolution restoration. Because the patch's adversarial properties are disrupted by downsampling, the diffusion model produces a high restoration error specifically in the patch region, effectively acting as an anomaly detector.
  2. Dynamic Thresholding & Sliding Window: To convert the error map into a precise mask, the framework employs a mathematically derived linear correlation between patch size and restoration error to set a dynamic binarization threshold. A sliding window then pinpoints the exact square region of the patch.
  3. Inpainting Decontamination: Once localized and masked, the framework uses the same pre-trained diffusion model to perform inpainting. It fills the "hole" left by the removed patch using surrounding clean pixels as context.
The DiffPAD pipeline: Localization via super-resolution and decontamination via inpainting.

Crucially, DiffPAD utilizes closed-form solutions for super-resolution and inpainting within the diffusion process, removing the need for text guidance or task-specific fine-tuning.

Experimental Evaluation

The authors evaluated DiffPAD on two primary tasks: general image classification using ImageNet (with ConvNeXt and Swin-V2 architectures) and facial recognition using the VGG Face dataset. The defense was tested against major patch attacks, including AdvP, LaVAN, and GDPA, as well as white-box adaptive attacks (BPDA).

Key Results

DiffPAD demonstrates superior robustness compared to existing specialized defenses like SAC and Jedi. On ImageNet using the ConvNeXt architecture, an undefended model's accuracy plummeted from 83.9% to 3.9% under a LaVAN attack. DiffPAD successfully restored this accuracy to 82.2%.

Quantitative comparison of DiffPAD against other defense methods on ImageNet (ConvNeXt).

Beyond accuracy, DiffPAD maintains high visual fidelity (PSNR > 26 dB), effectively removing patch remnants that often plague other methods. In white-box scenarios, DiffPAD maintained 90.0% accuracy against AdvP attacks, outperforming the previous state-of-the-art DIFFender (88.3%).

Discussion and Conclusion

The core innovation of DiffPAD lies in its exploitation of the sensitivity of adversarial patches to scale. By using super-resolution as an anomaly detector, the system can automatically estimate patch size and location. As a "plug-and-play" defense, it transforms generic generative models into powerful security tools without requiring adversarial training.

However, limitations remain. Diffusion models are computationally intensive; despite optimizations reducing the process to two generation rounds, latency remains higher than simple digital filters. Additionally, the current localization method assumes square patches, which may be less effective against irregular shapes. Future work will focus on improving inference speed for real-time applications and expanding the localization logic to handle diverse patch geometries.

Summary updated

BibTeX
@inproceedings{fu2025diffpad,
  author = {Jia Fu and Xiao Zhang and Sepideh Pashami and Fatemeh Rahimian and Anders Holst},
  title = {{DiffPAD: Denoising Diffusion-Based Adversarial Patch Decontamination}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00643},
}
Figure