Revisiting DeepFool: generalization and improvement

Alireza Abdollahpourrostam, Mahed Abroshan, Seyed-Mohsen Moosavi-DezfooliarXiv 2023

Abstract

Deep neural networks have been known to be vulnerable to adversarial examples, which are inputs that are modified slightly to fool the network into making incorrect predictions. This has led to a significant amount of research on evaluating the robustness of these networks against such perturbations. One particularly important robustness metric is the robustness to minimal $\ell_2$ adversarial perturbations. However, existing methods for evaluating this robustness metric are either computationally expensive or not very accurate. In this paper, we introduce a new family of adversarial attacks that strike a balance between effectiveness and computational efficiency. Our proposed attacks are generalizations of the well-known DeepFool (DF) attack, while they remain simple to understand and implement. We demonstrate that our attacks outperform existing methods in terms of both effectiveness and computational efficiency. Our proposed attacks are also suitable for evaluating the robustness of large models and can be used to perform adversarial training (AT) to achieve state-of-the-art robustness to minimal $\ell_2$ adversarial perturbations.

Introduction

In the field of AI security, adversarial examples serve as a critical stress test for neural networks. To rigorously measure a model's robustness, researchers focus on finding the minimal perturbation: the smallest possible change (often measured by the $\ell_2$ norm) required to flip a model's prediction.

Historically, evaluating this metric involved a significant trade-off between speed and accuracy. The classic DeepFool (DF) attack is computationally efficient but often "over-shoots," finding perturbations that are larger than necessary because it stops immediately upon crossing the decision boundary. Conversely, state-of-the-art optimization-based attacks like C&W, ALMA, or DDN are highly precise but require hundreds or thousands of gradient computations, making them impractical for large-scale evaluations or adversarial training.

We introduce SuperDeepFool (SDF), a family of attacks that bridges this gap. By exploiting the geometric properties of decision boundaries, SDF achieves the precision of optimization attacks with the speed of DeepFool, occupying a "Goldilocks" zone of efficiency.

Comparison of adversarial attacks in terms of perturbation norm and computational cost.

Methodology: The SuperDeepFool Algorithm

The core innovation of SuperDeepFool is the addition of a geometric projection step to the standard DeepFool iteration.

Geometric Intuition

A truly minimal perturbation must be orthogonal to the decision boundary at the point of crossing. Standard DeepFool moves the input toward the boundary through iterative linearization but does not guarantee this orthogonality. SDF addresses this by alternating between two types of steps:

  1. DF Steps: Move the point closer to the decision boundary to achieve a label flip.
  2. Projection Steps: "Steer" the perturbation vector to increase its orthogonality to the boundary.
Geometric intuition behind the SuperDeepFool projection step.

The family of attacks is denoted as SDF($m, n$), where $m$ is the number of DF steps followed by $n$ projection steps. A particularly effective variant is SDF($\infty, 1$), which runs DeepFool until a label flip occurs and then applies a single projection to refine the result. Notably, SDF is parameter-free, requiring no tuning of learning rates or weighting constants.

Experimental Results

We evaluated SDF across standard benchmarks including MNIST, CIFAR-10, and ImageNet using various architectures like ResNets and Vision Transformers (ViTs).

Efficiency and Performance

On ImageNet (ResNet-50), SDF found perturbations with a median $\ell_2$ norm of 0.09 using only 37 gradient computations. In contrast, the ALMA attack required 100 computations to reach a similar norm. On CIFAR-10, SDF($\infty, 1$) reduced the median perturbation size by 33% compared to standard DeepFool, with only a marginal increase in computational cost (32 vs. 14 gradient calls).

Adversarial Training

SDF is efficient enough to be used in the inner loop of adversarial training. Models trained with SDF perturbations achieved superior robustness compared to those trained with the popular DDN attack. For instance, an SDF-trained model reached 90.8% natural accuracy on CIFAR-10 while maintaining high robust accuracy across various perturbation levels.

Key Insights

  • Orthogonality is Essential: Analysis shows that DeepFool's sub-optimality is directly linked to the angle of its attack vector. SDF's projection step successfully "rotates" the vector to be more efficient.
  • Decision Boundary Curvature: Adversarial training with SDF leads to models with lower input curvature, suggesting that robust models possess simpler geometric landscapes.
  • Accelerating Robustness Evaluation: The industry-standard "Auto-Attack" (AA) is often slowed down by its APGD-T component. Replacing or supplementing this with SDF (creating AutoAttack++) can speed up evaluation by up to 3x without sacrificing accuracy.
  • ViTs vs. CNNs: Rigorous evaluation with SDF reveals that Vision Transformers (ViTs) do not exhibit significantly higher $\ell_2$ robustness than CNNs, contrary to some previous findings.

Conclusion

SuperDeepFool represents a significant advancement in adversarial robustness evaluation. By providing a fast, accurate, and parameter-free method for finding minimal perturbations, it offers a new baseline for the community. Future work will explore extending the method to more complex targeted attacks and providing global convergence proofs for the alternating algorithm.

Summary updated

BibTeX
@misc{abdollahpourrostam2023revisiting,
  author = {Alireza Abdollahpourrostam and Mahed Abroshan and Seyed-Mohsen Moosavi-Dezfooli},
  title = {{Revisiting DeepFool: generalization and improvement}},
  year = {2023},
  eprint = {2303.12481},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.12481},
}
Figure