Ask, Attend, Attack: An Effective Decision-Based Black-Box Targeted Attack for Image-to-Text Models

Qingyuan Zeng, Zhenzhong Wang, Yiu-ming Cheung, Min Jiang

TL;DR

Researchers have developed AAA (Ask, Attend, Attack), a novel framework for performing targeted adversarial attacks on image-to-text models (like those used for captioning) in a strict black-box setting. By combining semantic dictionary generation, surrogate-based attention heatmaps, and evolutionary algorithms, AAA achieves high-success targeted attacks without the "semantic loss" common in previous methods.

What Problem Does This Paper Address?

Image-to-text models—which generate captions or answer questions about images—are increasingly used in real-world applications. However, they are vulnerable to adversarial attacks: tiny, imperceptible pixel changes that trick the model into outputting specific, often harmful, text.

Most existing attacks are either white-box (requiring full access to the model's internal code and gradients) or gray-box (requiring access to the image encoder). These aren't very practical for attacking a deployed API where you only see the final text output. Furthermore, existing "targeted" attacks often suffer from semantic loss—the model might output the wrong words, or the generated text might completely mismatch the visual content of the image, making the attack obvious or ineffective.

Comparison of existing targeted attacks and the proposed AAA framework

The authors tackle the hardest version of this: a decision-based black-box targeted attack, where the attacker only sees the final output string and wants to force the model to say something specific without causing a semantic mismatch.

Methods

The authors propose a three-stage framework called AAA to coordinate with a large-scale optimization solver:

The Ask, Attend, Attack (AAA) pipeline
  1. Ask: To avoid semantic loss, the attacker needs a target text that "fits" the image's feature space. In this stage, the system uses an evolutionary process to probe the model and build a target semantic dictionary. It identifies words that the model is already "inclined" to see in that image's context, allowing the attacker to craft a target sentence that is semantically consistent yet serves their malicious goal.
  2. Attend: Optimizing every pixel in a high-resolution image is a "curse of dimensionality" nightmare for black-box attacks. AAA uses a surrogate model (like a standard ResNet trained on ImageNet) to generate a Grad-CAM attention heatmap. This identifies the "crucial regions" of the image most likely to influence the text output, drastically narrowing the search space for perturbations.
  3. Attack: Finally, the framework uses a specialized Differential Evolution (DE) algorithm. Unlike gradient-based methods, DE doesn't need internal model access; it "evolves" a population of perturbed images over many iterations, selecting for those that move the model's output closer to the target text.

Datasets

The researchers evaluated their framework using:

  • Flickr30k: Used as the primary dataset for testing the attacks, consisting of over 31,000 images with descriptive captions.
  • MSCOCO-2014: Used for training the "Show-Attend-Tell" model.
  • ImageNet-21k: Used for pre-training the "ViT-GPT2" model.

The study focused on attacking two popular architectures: the transformer-based ViT-GPT2 and the CNN+RNN-based Show-Attend-Tell.

Key Insights and Ideas

  • The Surrogate Success: One of the most interesting findings is that attention heatmaps from a surrogate model (like ResNet) are effective even when attacking a completely different architecture (like a Transformer). Models tend to focus on the same physical objects in an image to generate descriptions, regardless of their internal math.
  • Semantic Consistency is King: Previous attacks often forced models to output gibberish or unrelated text. By building a semantic dictionary first (Ask), AAA ensures the attack is "stealthy" not just to the eye (imperceptible pixels) but also to logic (the caption makes sense for the image).
  • Search Space Reduction: By using the Attend stage to focus only on high-impact pixels, the authors turned a massive optimization problem into a manageable one, significantly boosting the efficiency of the evolutionary algorithm.

Key Results

The AAA framework demonstrated significant improvements over existing methods:

  • Superior Performance: In black-box settings, AAA outperformed adapted versions of state-of-the-art gray-box attacks. For example, on the ViT-GPT2 model with a perturbation limit, AAA achieved high METEOR scores and CLIP similarities, indicating the output text was nearly identical to the target.
  • No Semantic Loss: Qualitative results showed that while older methods often resulted in "mismatched" captions, AAA maintained high semantic relevance between the image and the forced output.
  • Transferability: The attack proved effective across different model architectures, confirming that the "Ask" and "Attend" stages capture fundamental vulnerabilities in how vision-language models process information.

Limitations and Future Work

Despite its effectiveness, the authors acknowledge two main hurdles:

  1. Optimization Efficiency: Because evolutionary algorithms don't use gradients, they are inherently slower than white-box attacks.
  2. High Query Count: The process requires many interactions with the target model. A simple defense for model providers would be to set a limit on the number of accesses per user.

Future Work: The authors plan to explore combining AAA with more advanced evolutionary algorithms to further increase convergence speed and reduce the number of queries needed to successfully land an attack.

Summary updated

BibTeX
@inproceedings{zeng2024ask,
  author = {Qingyuan Zeng and Zhenzhong Wang and Yiu-ming Cheung and Min Jiang},
  title = {{Ask, Attend, Attack: An Effective Decision-Based Black-Box Targeted Attack for Image-to-Text Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=9uMJeCUeKk},
}
Figure