Boosting Imperceptibility of Stable Diffusion-based Adversarial Examples Generation with Momentum

Nashrah Haque, Xiang Li, Zhehui Chen, Yanzhao Wu, Lei Yu, Arun Iyengar, Wenqi Wei

TL;DR

Researchers have developed SD-MIAE, a framework that uses Stable Diffusion and momentum-based optimization to create adversarial images that are both highly effective at fooling AI classifiers and virtually indistinguishable from normal photos to the human eye. By stabilizing the optimization process with momentum, the method achieves a 79% misclassification rate, outperforming previous state-of-the-art generative attacks by 35% while better preserving the original image's meaning.

What Problem Does This Paper Address?

Adversarial attacks—inputs designed to trick machine learning models into making mistakes—usually fall into two categories. Traditional attacks add "pixel noise" that looks like static to humans but breaks the model. Newer "generative" attacks use models like Stable Diffusion to create realistic-looking adversarial images.

However, generative attacks face a major hurdle: the imperceptibility-effectiveness trade-off. To successfully fool a classifier, these models often have to perturb the image so much that it starts looking "weird" (unnatural artifacts) or changes the subject entirely (e.g., a "hamster" starts looking like a "snake"). This makes the attack easy for a human observer to spot. The authors sought a way to keep the attack powerful while ensuring the resulting image remains semantically "anchored" to its original label.

Methods

The authors introduce Stable Diffusion-based Momentum Integrated Adversarial Examples (SD-MIAE). Their approach moves away from pixel-level manipulation and instead operates in the latent space of Stable Diffusion.

The process happens in two distinct phases:

  1. Initial Adversarial Optimization: The system starts with a text prompt (e.g., "A photo of a hamster"). It iteratively modifies the token embeddings (the mathematical representation of the words) to find a version that causes a target classifier (like ResNet-50) to misclassify the resulting image. To keep the image looking like a hamster, they use a Cosine Similarity Regularization term that prevents the embeddings from drifting too far from the original concept.
  2. Momentum-Based Refinement: This is the "secret sauce." Standard optimization can be jittery, leading to "noisy" images. By integrating a momentum term ($m_t$), the algorithm accumulates gradients from previous iterations. This smooths out the perturbations, helping the optimization escape local minima and produce more stable, natural-looking images that are still adversarial.

Datasets

The study utilized ImageNet-100, a subset of the famous ImageNet dataset. To ensure a rigorous test, the researchers specifically selected 10 classes (including castle, flamingo, hamster, and zebra) where the target model, ResNet-50, originally had an accuracy of at least 90%. This ensured they were attacking "strong" classifications rather than borderline cases.

Key Insights and Ideas

  • Semantic Anchoring: Unlike previous methods (like SD-NAE) where a "hamster" might morph into a "matchstick" as the attack progresses, SD-MIAE keeps the hamster looking like a hamster. This is crucial for "stealth" attacks.
  • Momentum as a Stabilizer: The researchers found that momentum doesn't just make the attack faster; it makes it subtler. By smoothing the optimization path, it prevents the "unnatural artifacts" that typically tip off human observers.
  • Latent vs. Pixel Space: By attacking the prompt embeddings rather than the pixels, the attack exploits how the generative model understands concepts, leading to more "natural" errors in the final output.

Key Results

  • Higher Success Rate: SD-MIAE achieved a 79% misclassification rate, a massive jump from the 44% achieved by the previous state-of-the-art (SD-NAE).
  • Confidence in Error: When SD-MIAE fools a model, it does so convincingly. 50% of its misclassifications had a prediction confidence of over 90%, compared to only 33% for the baseline.
  • Better Visual Fidelity: Using Mean Squared Error (MSE) as a proxy for visual change, SD-MIAE consistently produced images closer to the "clean" versions than the baseline did. Qualitative results (shown in the paper's figures) show that while the baseline images become blurry or distorted, SD-MIAE images remain crisp and recognizable.

Limitations and Future Work

Despite the success, the authors note several hurdles:

  • Targeted Attacks are Hard: While it's easy to make a model guess wrong (untargeted), it's much harder to make it guess a specific wrong label (targeted). SD-MIAE only achieved a 7% success rate in targeted scenarios.
  • Computational Cost: Generating these images is slow. It takes about 37 seconds and 22 GB of GPU memory to create one adversarial example, making it difficult to scale without high-end hardware.
  • Generalizability: The current study focused on ResNet-50 and Stable Diffusion 2.1. Future work is needed to see if these specific "momentum-tuned" prompts work across different model architectures (black-box transferability).

Overall, this paper demonstrates that as generative AI becomes more sophisticated, our methods for auditing their security must also evolve, moving from simple noise-injection to sophisticated semantic manipulation.

Summary updated

BibTeX
@inproceedings{haque2024boosting,
  author = {Nashrah Haque and Xiang Li and Zhehui Chen and Yanzhao Wu and Lei Yu and Arun Iyengar and Wenqi Wei},
  title = {{Boosting Imperceptibility of Stable Diffusion-based Adversarial Examples Generation with Momentum}},
  booktitle = {TPS-ISA},
  year = {2024},
  url = {https://openreview.net/forum?id=FQSbUmxBG6},
}

Loading related content...

Figure