Similarity of Neural Architectures using Adversarial Attack Transferability

Jaehui Hwang, Dongyoon Han, Byeongho Heo, Song Park, Sanghyuk Chun, Jong-Seok Lee

TL;DR

The paper introduces Similarity by Attack Transferability (SAT), a novel metric that quantifies the behavioral similarity between neural architectures based on how easily adversarial attacks transfer between them. By analyzing 69 state-of-the-art models, the authors demonstrate that macroscopic design choices—like the choice between CNNs and Transformers—are the primary drivers of model diversity, which directly impacts the effectiveness of model ensembles and knowledge distillation.

What Problem Does This Paper Address?

Deep learning has seen an explosion of diverse architectures, from classic ResNets to Vision Transformers (ViTs) and MLP-Mixers. While we can easily compare their accuracy, we lack a scalable, quantitative way to measure their behavioral similarity. Are two models with 80% accuracy making the same mistakes? Do they "see" the world in the same way?

Understanding this similarity is crucial for practical applications. For instance, an ensemble of three identical models is no better than one, but an ensemble of three diverse models can significantly boost performance. Existing similarity measures often rely on qualitative visualizations (like loss surfaces) or are computationally prohibitive for large-scale comparisons across different architecture families.

Methods

The authors propose Similarity by Attack Transferability (SAT). The intuition is that if an adversarial attack designed to fool Model A also fools Model B, the two models likely share similar vulnerabilities, input gradients, and decision boundaries.

Fig. 2: How SAT works? Conceptual figure to understand SAT by the lens of the decision boundary. Each line denotes the decision boundary of a binary classification model, and each dot denotes individual prediction for given inputs.

Key methodological steps include:

  • SAT Calculation: For two models A and B, SAT measures the accuracy of A on adversarial samples generated for B (and vice versa). A higher transfer success rate translates to a higher similarity score.
  • Large-Scale Analysis: The researchers applied SAT to 69 different ImageNet-trained models, all with top-1 accuracies between 79% and 83% to ensure behavioral differences weren't simply due to accuracy gaps.
  • Spectral Clustering: Using SAT as a distance metric, they clustered these 69 models into 10 distinct groups to identify "families" of architectures.
  • Feature Importance Analysis: They used a gradient boosting regressor to determine which specific architectural components (e.g., activation functions, normalization, stem layers) contribute most to the similarity between models.

Datasets

  • ImageNet: The primary dataset used for the large-scale analysis of 69 classifiers.
  • Flowers-102: Used to demonstrate that SAT scores measured on one dataset generalize to others, supporting cross-domain applicability.
  • CIFAR-10: Used for auxiliary experiments, such as studying the impact of adversarial training and training dynamics.

Key Insights and Ideas

  • Macroscopic vs. Microscopic Design: The most significant factor in model diversity is the "base architecture" (e.g., CNN vs. Transformer vs. MLP-Mixer). "Microscopic" changes, like swapping ReLU for GeLU or using depth-wise convolutions, have a negligible impact on overall model similarity.
  • The Stem Layer Matters: Surprisingly, the design of the very first layers (the "stem") is as important for model similarity as the choice of normalization or activation functions.
  • Ensemble Synergy: There is a strong negative correlation between SAT and ensemble performance. To get the best results from an ensemble, you should pick models from different SAT clusters rather than just picking the highest-accuracy models.
  • Distillation Nuance: The common wisdom is that a teacher should be similar to the student. The authors find this is true within an architecture family (e.g., ViT teacher to ViT student). However, when distilling across families (e.g., CNN teacher to ViT student), a dissimilar teacher can act as a powerful regularizer, leading to better student performance.

Key Results

  • Clustering: The 69 models were successfully grouped into 10 clusters, clearly separating non-hierarchical Transformers, hierarchical networks with "patchify" stems, and standard CNNs. t-SNE plot showing 10 clusters of 69 neural networks using SAT.

  • Feature Importance: "Base architecture" was found to be the most important feature for similarity, followed by the "Stem layer" and "Input resolution." Importance of architectural components to network similarity.

  • Ensemble Performance: Ensembling models from different clusters consistently outperformed random ensembles. The correlation between pairwise SAT and ensemble error reduction was -0.32.

  • Robustness: SAT was shown to be highly robust to the specific type of adversarial attack used (e.g., PGD vs. AutoAttack), making it a reliable metric for general use.
Fig. 1: t-SNE plot showing 10 clus- ters of 69 neural networks using our similarity function, SAT.
Fig. 3: Importance of architectural compo- nents to network similarity. 13 components are sorted by the contribution to the similarities. The larger feature importance means the component con- tributes more to the network similarity.

Limitations and Future Work

  • Accuracy Sensitivity: SAT works best when comparing models with similar clean accuracies. If one model is significantly better than the other, the transferability might be biased by the performance gap rather than architectural similarity.
  • Computational Cost: While more efficient than some alternatives, SAT still requires generating adversarial samples for every pair of models, which can be expensive for very large model zoos.
  • Beyond Classification: The current work focuses exclusively on image classification. Future research could investigate if SAT-like metrics are applicable to other domains like object detection or natural language processing.

Summary updated

Abstract

In recent years, many deep neural architectures have been developed for image classification. Whether they are similar or dissimilar and what factors contribute to their (dis)similarities remains curious. To address this question, we aim to design a quantitative and scalable similarity measure between neural architectures. We propose Similarity by Attack Transferability (SAT) from the observation that adversarial attack transferability contains information related to input gradients and decision boundaries widely used to understand model behaviors. We conduct a large-scale analysis on 69 state-of-the-art ImageNet classifiers using our proposed similarity function to answer the question. Moreover, we observe neural architecture-related phenomena using model similarity that model diversity can lead to better performance on model ensembles and knowledge distillation under specific conditions. Our results provide insights into why developing diverse neural architectures with distinct components is necessary.
BibTeX
@inproceedings{hwang2024similarity,
  author = {Jaehui Hwang and Dongyoon Han and Byeongho Heo and Song Park and Sanghyuk Chun and Jong-Seok Lee},
  title = {{Similarity of Neural Architectures using Adversarial Attack Transferability}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=757eURYlAS},
}
Figure