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

Instruct2Attack: Language-Guided Semantic Adversarial Attacks

Jiang Liu, Chen Wei, Yuxiang Guo, Heng Yu, Alan L. Yuille, Soheil Feizi, Chun Pong Lau, Rama ChellappaarXiv 2023 · DOI

TL;DR

This paper introduces Instruct2Attack (I2A), a novel method for generating semantically meaningful adversarial attacks on image classifiers. By leveraging latent diffusion models and free-form text instructions, I2A creates realistic adversarial examples that can fool even robustly trained models, offering better control and interpretability than traditional noise-based attacks.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are highly susceptible to adversarial attacks, where small, imperceptible perturbations to input images can cause misclassifications. While early attacks focused on adding noise, these perturbations often lack semantic meaning and are not representative of real-world scenarios. Semantic attacks aim to address this by making changes that are understandable to humans, but crafting these attacks with fine-grained control and naturalness has been a significant challenge. This paper tackles the problem of generating semantically meaningful adversarial examples that are not only effective at fooling DNNs but are also controllable, interpretable, and realistic, mimicking how humans might subtly alter an image.

Methods

The core of Instruct2Attack (I2A) lies in its use of latent diffusion models (LDMs), specifically a conditional LDM. The process starts with a random latent code and iteratively refines it through a reverse diffusion process. This refinement is guided by two conditions: the original input image and a free-form text instruction describing the desired semantic edit.

What's novel is the adversarial diffusion guidance. Instead of simply following the image and text guidance, I2A introduces learnable adversarial guidance factors ($\alpha$ and $\beta$) that modulate these conditions. These factors are optimized to steer the diffusion process towards an adversarial latent code ($Z_{adv}$) that, when decoded, produces an image that fools the target classifier.

To ensure the adversarial images remain visually similar to the original, I2A incorporates a perceptual constraint using the LPIPS (Learned Perceptual Image Patch Similarity) metric. This constraint is integrated into the optimization objective via a Lagrangian relaxation, allowing for a trade-off between attack strength and image quality.

Finally, to automate the generation of diverse and image-specific instructions, I2A leverages GPT-4. It first uses BLIP-2 to generate image captions, which are then fed to GPT-4 along with carefully crafted prompts to produce natural language editing instructions.

Datasets

  • ImageNet: Used for evaluating the attack's effectiveness on various victim models, including both standard and adversarially trained architectures. A subset of 5,000 images from the ImageNet validation set was used.
  • Places365: Used to demonstrate the generalizability of I2A to different data domains, specifically scene recognition. A subset of 3,650 images was selected.

Key Insights and Ideas

  • Language as a powerful attack vector: By using natural language instructions, I2A demonstrates that subtle, human-understandable edits can be highly effective at fooling DNNs, highlighting a different facet of model vulnerability than noise-based attacks.
  • Diffusion models are ripe for adversarial manipulation: The paper shows that the generative capabilities of LDMs can be "hijacked" to create adversarial examples, suggesting that the robustness of generative models themselves might be a concern.
  • Semantic attacks can be more transferable: I2A's adversarial examples, being semantically meaningful and on the natural image manifold, exhibit strong transferability across different model architectures, even those not directly attacked.
  • Automated instruction generation unlocks scalability: The integration of GPT-4 for generating editing instructions significantly enhances the practicality and diversity of semantic attacks, moving beyond manually crafted prompts.
  • Perceptual similarity is crucial for realistic attacks: Bounding adversarial perturbations with LPIPS ensures that the generated images are visually plausible, making the attacks more convincing and harder to detect.

Key Results

  • High attack success rates: I2A consistently achieves significantly lower classification accuracies than baseline attacks, even against strong adversarial defenses like DiffPure. For instance, it reduced the robust accuracy of Swin-L on ImageNet from 59.56% to 4.98%.
  • Effective against defenses: I2A demonstrates strong performance against adversarially trained models and preprocessing-based defenses like DiffPure, outperforming other semantic attacks.
  • Strong transferability: Adversarial examples generated by I2A transfer well to various target models, including those with different architectures and defense mechanisms.
  • Natural and interpretable perturbations: Qualitative results show that I2A generates visually appealing and semantically coherent edits that align with the given instructions.
  • Automated instruction generation is effective: GPT-4-generated prompts lead to competitive attack performance, demonstrating the viability of automated attack creation.

Limitations and Future Work

  • Computational cost: While effective, the diffusion process can be computationally intensive, especially for adaptive attacks against defenses.
  • Perceptual constraint trade-off: The paper notes that increasing the perceptual budget ($\gamma$) leads to stronger attacks but can degrade image quality (higher FID). Finding the optimal balance remains an area of interest.
  • Future work: The authors suggest that I2A can be used for data augmentation to improve model robustness, and that its ability to generate natural and interpretable perturbations can aid in diagnosing model failure modes. Further exploration of more complex semantic manipulations and diverse data domains is also a promising direction.

Summary updated

BibTeX
@misc{liu2023instruct,
  author = {Jiang Liu and Chen Wei and Yuxiang Guo and Heng Yu and Alan L. Yuille and Soheil Feizi and Chun Pong Lau and Rama Chellappa},
  title = {{Instruct2Attack: Language-Guided Semantic Adversarial Attacks}},
  year = {2023},
  eprint = {2311.15551},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.15551},
}
Figure