Diffusion-Based Adversarial Sample Generation for Improved Stealthiness and Controllability
Haotian Xue, Alexandre Araujo, Bin Hu, Yongxin Chen
TL;DR
Diff-PGD introduces a diffusion-model-guided PGD framework that keeps adversarial examples within the natural image distribution by optimizing against a purified input $x_0$ produced via diffusion editing. By decoupling adversarial loss from realism constraints, it supports digital, region-based, style-guided, and physical-world attacks with improved stealthiness, transferability, and anti-purification properties. The approach leverages DDIM-based speedups and SDEdit to bridge between input and real data distributions, and it extends to practical variants like Diff-rPGD, Diff-PGD with style prompts, and Diff-Phys for robust physical patches. An acceleration variant reduces computational burden with a gradient-approximation, enabling feasible adversarial generation on large-scale data. Overall, Diff-PGD advances the realism and controllability of adversarial samples, informing both attack and defense research toward robust AI systems.
Abstract
Neural networks are known to be susceptible to adversarial samples: small variations of natural examples crafted to deliberately mislead the models. While they can be easily generated using gradient-based techniques in digital and physical scenarios, they often differ greatly from the actual data distribution of natural images, resulting in a trade-off between strength and stealthiness. In this paper, we propose a novel framework dubbed Diffusion-Based Projected Gradient Descent (Diff-PGD) for generating realistic adversarial samples. By exploiting a gradient guided by a diffusion model, Diff-PGD ensures that adversarial samples remain close to the original data distribution while maintaining their effectiveness. Moreover, our framework can be easily customized for specific tasks such as digital attacks, physical-world attacks, and style-based attacks. Compared with existing methods for generating natural-style adversarial samples, our framework enables the separation of optimizing adversarial loss from other surrogate losses (e.g., content/smoothness/style loss), making it more stable and controllable. Finally, we demonstrate that the samples generated using Diff-PGD have better transferability and anti-purification power than traditional gradient-based methods. Code will be released in https://github.com/xavihart/Diff-PGD
