Bag of Tricks to Boost Adversarial Transferability

Zeliang Zhang, Rongyi Zhu, Wei Yao, Xiaosen Wang, Chenliang Xu · Submission to ICLR 2024 · Rejected

TL;DR

Standard transfer-based adversarial attacks often rely on default, arbitrary optimization hyperparameters (e.g., 10 iterations, constant step sizes) that leave substantial attack success on the table. This paper systematically investigates these overlooked factors and introduces a modular "bag of tricks"—spanning momentum initialization, step size scheduling, dual examples, spectral transformations, and ensemble enhancements—that collectively boost black-box transferability across vision models, robust defenses, and commercial APIs like Google Cloud Vision.

What Problem Does This Paper Address?

In black-box adversarial attacks, an adversary crafts adversarial examples on a local "surrogate" model hoping they will fool an unknown "victim" model—a property termed adversarial transferability. While many specialized techniques exist (gradient stabilization, input transformations, and model ensembles), standard practice rigidly fixes basic optimization settings: typically 10 iterations, a fixed step size of $\epsilon/T$, and a momentum decay of 1.0.

The authors demonstrate that these default recipes severely hinder attack performance. For example, simply tweaking hyperparameters on common attacks against Google's Vision API yields an immediate 11.6% jump in average attack success rate. This raises a fundamental challenge: How much transferability is lost to suboptimal optimization routines, and how can we systematically design general, orthogonal tricks to maximize transferability?

Methods

The authors categorize their proposed tricks across the three dominant transfer attack paradigms:

      ┌────────────────────────────────────────────────────────┐
      │                     Bag of Tricks                      │
      └───────────────────────────┬────────────────────────────┘
                                  │
         ┌────────────────────────┼────────────────────────┐
         ▼                        ▼                        ▼
  Gradient Optimization     Input Transformation     Ensemble Strategies
  • Random Global Mom.     • High-Freq Focus       • Gradient Alignment
    Init (RGI)               (SSA-H)                 (GA via Gram-Schmidt)
  • Scheduled Step Sizes   • Spectral Domain       • Asynchronous Input
    (log, exp, p-value)      Augmentation (SSA+)     Transforms (AIT)
  • Dual Examples                                  • Model Shuffle (MS)
  1. Gradient-Based Optimization:
  2. Random Global Momentum Initialization (RGI): Instead of starting momentum from zero or single-path pre-runs, RGI samples $N$ random points in the $\epsilon$-neighborhood of the input, runs a short MI-FGSM trajectory on each, and averages their accumulated momentum as the starting momentum vector.
  3. Scheduled Step Size: Decaying step schedules (logarithmic, linear, exponential, or $p$-value decay) prioritize gradients calculated near benign samples, mitigating overfitting to surrogate decision boundaries in later iterations.
  4. Dual Example Strategy: An auxiliary perturbation is updated via I-FGSM using an increasing step schedule while the primary attack perturbation updates via MI-FGSM using gradients evaluated at this dual point, striking a balance between local gradient exploration and perturbation optimization.
  5. Spectral-Based Input Transformations:
  6. SSA-H & SSA+: Deep networks rely heavily on low-frequency structural shapes. Rather than transforming the entire frequency spectrum, SSA-H restricts perturbations to the top 20% high-frequency components. SSA+ extends this by applying classical augmentations (scaling, dropout, noise injection) directly in the spectral domain.
  7. Ensemble Attack Strategies:
  8. Gradient Alignment (GA): When backpropagating across multiple surrogate models, conflicting gradients cancel out. If the cosine similarity between a model's gradient and the ensemble mean is negative, GA applies Gram-Schmidt orthogonalization to project away conflicting components.
  9. Asynchronous Input Transformation (AIT): Instead of applying identical data transforms across all ensemble models simultaneously, distinct random augmentations are applied per model to enrich gradient diversity.
  10. Model Shuffle (MS): For sequential (longitudinal) ensembles, randomly permuting the order of models per iteration avoids overfitting to any single architecture.

Datasets

  • ImageNet-1K Benchmark: 10,000 images (10 images sampled per class) evaluated against 7 distinct surrogate/victim architectures, including CNNs (VGG-16, ResNet-18, ResNet-101, DenseNet-121, MobileNet) and Vision Transformers (ViT, Swin).
  • Defended Models: Adversarial Training (AT), Fast Adversarial Training (FAT), High-level Representation Guided Denoiser (HGD), Certified Random Smoothing (RS), and Neural Representation Purifier (NRP).
  • Real-World Black-Box API: Google Cloud Vision API.
  • Audio-Visual Benchmark: An event classification task with 200 samples evaluated across multi-modal audio-visual architectures (ResNet-18, ResNet-34, VGG-16).

Key Insights and Ideas

  • Gradients close to benign data matter most: Vanilla I-FGSM exhibits worse transferability as iterations increase because it overfits to local optima far from the original image. Decaying step schedules exploit the fact that surrogate gradients calculated nearest the original benign image transfer significantly better across target models.
  • Sequential ensembles beat parallel ensembles: Comparing lateral ensembles (fusing predictions, logits, or losses) to longitudinal ensembles (attacking models sequentially) reveals that greedy sequential optimization covers broader salient regions of interest and produces stronger transfer gradients.
  • High-frequency spectral perturbation reduces semantic disruption: Augmenting features in the high-frequency spectrum introduces effective diversity without altering the core semantic structures that surrogate models share with target models.
  • Orthogonality of tricks: The tricks operate at distinct stages (initialization, data transform, optimization, and multi-model aggregation). Ablation tests confirm their benefits are largely additive.

Key Results

  • Commercial API Attack: Applying the combined bag of tricks to standard gradient attacks boosted the average success rate against Google's Vision API from 23.6% (vanilla) to 46.0%, with advanced base attacks (e.g., TGR, MI-CWA) reaching a 100.0% attack success rate.
  • Beating State-of-the-Art Defenses: When integrated into SOTA attack frameworks (Table 5):
  • MI-CWA + Tricks improved attack success on certified Random Smoothing (RS) from 39.2% to 59.1% (+19.9%).
  • Success against standard Adversarial Training (AT) rose to 99.1%, and against HGD reached 100.0%.
  • Individual Component Gains:
  • RGI: Improved transfer attack success across baselines by 4% to 9% over zero/standard initialization (e.g., VMI-FGSM jumped from 69.5% to 78.1%).
  • Dual Example: Boosted vanilla I-FGSM transferability by +26.8% and MI-FGSM by +12.4%.
  • SSA+: Surpassed the prior frequency-domain state-of-the-art (SSA) by 5.36%.

Limitations and Future Work

  • Computational Overhead: Techniques like Random Global Momentum Initialization (RGI) and ensemble dual examples require extra gradient evaluations per step (increasing initialization time by ~50%), presenting a trade-off between compute budget and transferability.
  • Architecture-Specific Hyperparameter Sensitivity: The optimal step-size decay schedule and iteration count vary depending on whether the surrogate is a CNN or a Vision Transformer, requiring empirical tuning.
  • Theoretical Foundations: While the empirical link between larger early step sizes, flatter loss optima, and generalization is noted, formal theoretical bounds connecting optimization schedules to adversarial transferability remain an open direction for future exploration.

Summary updated

Abstract

Deep neural networks are widely known to be vulnerable to adversarial examples. However, vanilla adversarial examples generated under the white-box setting often exhibit low transferability across different models. Since adversarial transferability poses more severe threats to practical applications, various approaches have been proposed for better transferability, including gradient-based, input transformation-based, and model-related attacks. In this work, we find that several tiny changes in the existing adversarial attacks can significantly affect the attack performance, e.g., the number of iterations and step size. Based on careful studies of existing adversarial attacks, we propose a bag of tricks to enhance adversarial transferability, including momentum initialization, scheduled step size, dual example, spectral-based input transformation, and several ensemble strategies. Extensive experiments on the ImageNet dataset validate the high effectiveness of our proposed tricks and show that combining them can further boost adversarial transferability. Our work provides practical insights and techniques to enhance adversarial transferability and offers guidance to improve the attack performance on real-world applications through simple adjustments.
BibTeX
@misc{zhang2024bag,
  author = {Zeliang Zhang and Rongyi Zhu and Wei Yao and Xiaosen Wang and Chenliang Xu},
  title = {{Bag of Tricks to Boost Adversarial Transferability}},
  year = {2024},
  eprint = {2401.08734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.08734},
}

Loading related content...

Figure