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

Constructing Semantics-Aware Adversarial Examples with a Probabilistic Perspective

Andi Zhang, Mingtian Zhang, Damon Wischik

TL;DR

This paper introduces a novel probabilistic framework for generating "unrestricted" adversarial examples. By replacing rigid geometric constraints (like $L_p$ norms) with learned generative models (such as Diffusion Models or Energy-Based Models), the authors create semantic-aware attacks that heavily modify pixels while preserving the image's natural appearance. These attacks easily bypass modern adversarial defenses and transfer well across models, all while remaining highly stealthy to human observers.

What Problem Does This Paper Address?

Traditionally, adversarial attacks fool image classifiers by adding imperceptible, pixel-level noise. To ensure the image still looks normal to humans, these attacks strictly limit the geometric distance ($L_p$ norm) between the original and manipulated image.

However, this approach has hit a wall. Modern adversarial defenses are highly effective at blocking these tiny geometric perturbations, and these attacks often fail to transfer to unseen "black-box" models. As a result, researchers have started exploring "unrestricted" attacks—modifications that change the image more naturally (e.g., shifting colors, altering textures, or spatial warping) without strict $L_p$ bounds. The problem? Existing unrestricted attacks are often ad-hoc and lack a principled mathematical foundation. This paper bridges that gap by providing a unified probabilistic perspective that naturally transitions from geometric to semantic constraints.

Methods

The authors reframe adversarial example generation as sampling from a joint probability distribution: $p_{adv} \propto p_{vic} \times p_{dis}$.

  • $p_{vic}$ (Victim Distribution): Represents the classifier's pull. It assigns high probability to images that the victim classifier will confidently misclassify as the target class.
  • $p_{dis}$ (Distance Distribution): Represents the constraint keeping the image looking like the original.

The Core Novelty: The authors prove that traditional $L_2$ norm attacks are mathematically equivalent to using a simple Gaussian distribution for $p_{dis}$. To make the attack semantic rather than geometric, they replace this Gaussian with a Probabilistic Generative Model (PGM) fitted to the original image.

They propose two concrete implementations:

  1. Energy-Based Models (EBMs): Used for simpler data. An EBM is trained on a set of semantic-preserving transformations (like rotations, scaling, and Thin Plate Spline spatial distortions) of the original image. Sampling is done via Langevin Monte Carlo.
  2. Diffusion Models: Used for complex, high-resolution data. A pre-trained diffusion model is fine-tuned on the single original image. The attack is generated by modifying the standard diffusion denoising process (using Tweedie's formula) to inject gradients from the victim classifier.

Key Insights and Ideas

  • Geometric constraints are just basic probability: Realizing that an $L_2$ constraint is implicitly just a Gaussian distribution is a powerful "aha" moment. It opens the door to swapping out the Gaussian for any data-driven distribution.
  • Data-driven semantics: By fine-tuning a diffusion model on a single image, the model learns a localized "semantic manifold" of that specific image. This allows the attack algorithm to make massive pixel changes (like changing the lighting or background) as long as the changes stay on that semantic manifold.
  • Robust classifiers are secretly generative: The authors note that adversarially trained classifiers rely heavily on robust semantic features. When you attack them, their gradients actively try to draw the image into the visual shape of the target class. A strong, semantic $p_{dis}$ is required to counter this and prevent the adversarial image from morphing into an unnatural hybrid of the source and target classes.

Key Results

ImageNet adversarial example showing a hamster misclassified as a Cairn Terrier
  • High Success & Transferability: On ImageNet, the diffusion-based attack achieved high transferability to black-box models (e.g., ~80% success against VGG19) and successfully bypassed robust defenses (e.g., ~51% success against an adversarially trained Inception V3).
  • Human Stealth: The attacks are incredibly difficult for humans to spot. In ImageNet human trials, annotators were fooled into thinking the manipulated image was the unedited original up to 31.2% of the time. For context, a competing baseline method (NCF) only fooled humans 2.6% of the time.
MNIST targeted adversarial examples generated using the EBM method
  • MNIST White-box: The EBM method achieved a 100% white-box success rate against a robust MadryNet classifier, while human evaluators still correctly identified the original digit 92.6% of the time.

Limitations and Future Work

  • Computational Cost: The biggest limitation is speed. Training an EBM or fine-tuning a diffusion model for every single image you want to attack is highly time-consuming and computationally expensive.
  • Future Work (Efficiency): The authors suggest integrating recent parameter-efficient fine-tuning methods (like LoRA or DiffFit) to drastically speed up the generation process.
  • Future Work (Defense): This paper introduces a new threat vector. The authors suggest that defenders will need to explore "generalized" adversarial training—incorporating these semantic, unrestricted attacks into their training loops—though this risks degrading the model's accuracy on clean data.

Summary updated

BibTeX
@inproceedings{zhang2024constructing,
  author = {Andi Zhang and Mingtian Zhang and Damon Wischik},
  title = {{Constructing Semantics-Aware Adversarial Examples with a Probabilistic Perspective}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wbE0QCBWji},
}
Figure