Rethinking Model Ensemble in Transfer-based Adversarial Attacks

Huanran Chen, Yichi Zhang, Yinpeng Dong, Xiao Yang, Hang Su, Jun Zhu

TL;DR

This paper identifies two fundamental geometric properties that govern the transferability of adversarial attacks: the flatness of the loss landscape and the closeness to the local optima of surrogate models. By optimizing for these properties, the authors introduce the Common Weakness Attack (CWA), which significantly boosts the success rate of black-box attacks against diverse architectures, state-of-the-art defenses, and even commercial vision-language models like Google’s Bard.

What Problem Does This Paper Address?

Deep learning models are notoriously vulnerable to adversarial examples—inputs specifically crafted to trigger misclassification. A particularly dangerous property of these examples is transferability: an attack generated for one model (the surrogate) often works against another (the victim), even if the attacker knows nothing about the victim's architecture or parameters.

While attacking an ensemble of surrogate models is a known strategy to improve transferability, most existing methods simply average the outputs or losses of different models. This "naive ensemble" approach lacks a deep understanding of why ensembles help. As defenses become more sophisticated (e.g., adversarial training, input purification) and architectures more diverse (e.g., Vision Transformers vs. CNNs), standard ensemble attacks are starting to fail. This paper seeks to define and exploit the "common weakness" of model ensembles to break through these modern defenses.

Methods

The authors use a second-order Taylor expansion to analyze the attack objective. They discover that transferability is theoretically linked to two terms: the Hessian matrix (representing landscape sharpness) and the distance to local optima.

To exploit this, they propose the Common Weakness Attack (CWA), which consists of two main components:

  1. Sharpness Aware Minimization (SAM): Adapted from model training, this component encourages the adversarial example to converge to a "flat" region of the loss landscape. In flat regions, small changes in the model's parameters or architecture (like moving from a surrogate to a victim) are less likely to drastically change the loss value, making the attack more robust.
  2. Cosine Similarity Encourager (CSE): This novel component aims to find a point that is close to the local optima of all models in the ensemble. The authors prove that maximizing the cosine similarity between the gradients of different surrogate models effectively minimizes the distance to their respective local optima.

CWA is designed to be a "plug-and-play" module. It can be integrated with existing popular attacks like Momentum Iterative (MI), Variance-tuning (VMI), and Spectrum Saliency Attack (SSA).

Figure 1: Illustration of Common Weakness. The generalization error is strongly correlated with the flatness of loss landscape and the distance between the solution and the closest local optimum of each model. We define the common weakness of model ensemble as the solution that is at the flat landscape and close to local optima of training models, as shown in (d).

Datasets

The researchers evaluated their methods across several domains:

  • Image Classification: Used the NIPS2017 adversarial competition dataset (1,000 images). They tested against a massive suite of 31 victim models, including standard CNNs, Transformers (ViT, Swin), and advanced defenses like DiffPure and RobustBench models.
  • Object Detection: Used the INRIA dataset to generate universal adversarial patches.
  • Vision-Language Models: Conducted black-box testing against Google’s Bard using images from the NIPS2017 set.

Key Insights and Ideas

  • The Geometry of Transferability: Transferability is essentially a generalization problem. Just as a model generalizes better if it finds a flat minimum during training, an adversarial attack generalizes (transfers) better if it finds a flat maximum in the loss landscape.
  • Defining "Common Weakness": The paper formalizes "common weakness" as the intersection of flatness and proximity to shared optima.
  • Gradient Alignment: Simply averaging gradients can lead to "gradient interference" where models disagree on the direction. CSE forces the attack to find directions where the models agree, effectively finding the path of least resistance across the entire ensemble.
  • Visualizing the "Aha!" Moment: The authors provide landscape visualizations showing that CWA-generated examples sit in significantly broader, flatter peaks compared to standard momentum attacks, which explains their superior performance.
Figure 2: Illustration of MI, SAM, and MI-SAM. The symbols are introduced in Eq. (4)-(6)

Key Results

  • Superior Transferability: In image classification, MI-CWA outperformed standard ensemble MI by 30% when attacking state-of-the-art defense models.
  • Breaking Defenses: When combined with SSA, the method achieved near 100% success rates against several randomized defenses and 97.5% against the highly resilient DiffPure.
  • Universal Patches: For object detection, CWA generated universal patches that reduced the mean Average Precision (mAP) of 8 modern detectors to just 9.85%, a significant improvement over previous state-of-the-art universal attacks.
  • Attacking Bard: The attack successfully fooled Google's Bard, causing it to either misdescribe images, claim it was "blind" (refusing to see the image), or refuse to answer entirely due to perceived safety triggers. SSA-CWA increased misdescription rates by 8% over the baseline SSA.

Limitations and Future Work

  • Computational Cost: CWA is more computationally expensive than simple averaging. Specifically, it requires roughly double the number of function evaluations (NFEs) per iteration because of the inner optimization steps for SAM and CSE.
  • Hyperparameter Sensitivity: The method introduces new hyperparameters (like the inner step sizes $r$ and $\beta$), though the authors provide ablation studies showing the method is relatively resilient to variations in these values.
  • Ethical Concerns: As with all attack research, there is a risk that these methods could be used maliciously against commercial AI systems. The authors emphasize that their work is intended to help researchers build more robust models by identifying these critical vulnerabilities.

Summary updated

BibTeX
@inproceedings{chen2024rethinking,
  author = {Huanran Chen and Yichi Zhang and Yinpeng Dong and Xiao Yang and Hang Su and Jun Zhu},
  title = {{Rethinking Model Ensemble in Transfer-based Adversarial Attacks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=AcJrSoArlh},
}
Figure