On the Role of Generalization in Transferability of Adversarial Examples

Yilin Wang, Farzan Farnia

Abstract

Black-box adversarial attacks designing adversarial examples for unseen deep neural networks (DNNs) have received great attention over the past years. However, the underlying factors driving the transferability of black-box adversarial examples still lack a thorough understanding. In this paper, we aim to demonstrate the role of the generalization behavior of the substitute classifier used for generating adversarial examples in the transferability of the attack scheme to unobserved DNN classifiers. To do this, we apply the max-min adversarial example game framework and show the importance of the generalization properties of the substitute DNN from training to test data in the success of the black-box attack scheme in application to different DNN classifiers. We prove theoretical generalization bounds on the difference between the attack transferability rates on training and test samples. Our bounds suggest that operator norm-based regularization methods could improve the transferability of the designed adversarial examples. We support our theoretical results by performing several numerical experiments showing the role of the substitute network's generalization in generating transferable adversarial examples. Our empirical results indicate the power of Lipschitz regularization and early stopping methods in improving the transferability of designed adversarial examples.

Introduction

Adversarial examples—small, intentional perturbations that cause Deep Neural Networks (DNNs) to misclassify inputs—exhibit a property known as transferability. An attack designed to fool a specific "substitute" model often successfully fools a different "target" model, even without access to the target's architecture or weights. This phenomenon is the foundation of black-box attacks.

While transferability is well-documented, its underlying drivers remain elusive. This research establishes a formal link between a model's generalization (its performance on unseen data) and the transferability of the attacks it generates. We demonstrate that techniques improving a substitute model's generalization—such as spectral normalization and early stopping—directly enhance the effectiveness of its adversarial examples against unseen target models.

Methodology: The Adversarial Example Game

We analyze transferability through the Adversarial Example Game (AEG), a max-min framework where an adversary seeks the most transferable attack strategy while a classifier seeks robustness.

Theoretical Generalization Bounds

We introduce a formal definition for the "generalization error of an attack scheme," which measures the discrepancy in transferability rates between training and test samples. Our theoretical analysis proves that for multi-layer DNNs, this transferability gap is tied to the spectral norms (a measure of the Lipschitz constant or "smoothness") of the substitute network's weight matrices. Essentially, "smoother" functions produce more stable adversarial examples that are more likely to fool diverse architectures.

Regularization Strategies

Based on these theoretical bounds, we evaluate two forms of regularization to boost transferability:

  1. Explicit Regularization: Spectral Normalization, which constrains the spectral norm ($\beta$) of the network's weights.
  2. Implicit Regularization: Early Stopping (ES), which halts training before the model overfits to the training distribution.

Empirical Results

We validated our framework using CIFAR-10, CIFAR-100, and SVHN datasets. AlexNet and Inception-Net served as substitute models, while ResNet-18 and VGG-16 were used as target models.

The Impact of Spectral Normalization

Our experiments confirm that reducing the spectral norm ($\beta$) of the substitute model consistently increases transferability. As shown in the figures below, lower values of $\beta$ (representing stronger regularization) correlate with higher transferability scores across different target architectures.

Adversarial Generalization Error and Transferability Scores vs. Spectral Norm Constraint (beta).

The Efficacy of Early Stopping

Early stopping proved to be a highly effective strategy for enhancing transferability. By preventing the substitute model from memorizing training-specific noise, the generated perturbations focus on more general features of the data distribution.

Comparison of Generalization Error and Transferability Rates with and without Early Stopping (ES).

As detailed in the table above, models utilizing early stopping (e.g., PGD-ES) show a dramatic reduction in generalization error and a significant boost in transferability rates compared to their fully-trained counterparts. For instance, on CIFAR-100 with an AlexNet substitute, the transferability rate to a VGG-16 target rose from 25.2% to 29.4% when early stopping was applied.

Conclusion

Our findings suggest that transferability is not a random quirk of DNNs but is mathematically linked to the substitute model's ability to capture general features. Overfitting produces "brittle" adversarial perturbations that exploit specific weaknesses of the training set rather than the underlying data distribution. By employing Lipschitz regularization and early stopping, practitioners can generate significantly more robust and transferable black-box attacks. Future work will explore the interplay of other regularizers, such as Batch Normalization and Dropout, on the trajectory of transferable feature generation.

Summary updated

Abstract

Black-box adversarial attacks designing adversarial examples for unseen deep neural networks (DNNs) have received great attention over the past years. However, the underlying factors driving the transferability of black-box adversarial examples still lack a thorough understanding. In this paper, we aim to demonstrate the role of the generalization behavior of the substitute classifier used for generating adversarial examples in the transferability of the attack scheme to unobserved DNN classifiers. To do this, we apply the max-min adversarial example game framework and show the importance of the generalization properties of the substitute DNN from training to test data in the success of the black-box attack scheme in application to different DNN classifiers. We prove theoretical generalization bounds on the difference between the attack transferability rates on training and test samples. Our bounds suggest that operator norm-based regularization methods could improve the transferability of the designed adversarial examples. We support our theoretical results by performing several numerical experiments showing the role of the substitute network's generalization in generating transferable adversarial examples. Our empirical results indicate the power of Lipschitz regularization and early stopping methods in improving the transferability of designed adversarial examples.
BibTeX
@inproceedings{wang2023role,
  author = {Yilin Wang and Farzan Farnia},
  title = {{On the Role of Generalization in Transferability of Adversarial Examples}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=g6zcauIP17r},
}
Figure