Abstract
Empirical robustness evaluation (RE) of deep learning models against adversarial perturbations entails solving nontrivial constrained optimization problems. Existing numerical algorithms that are commonly used to solve them in practice predominantly rely on projected gradient, and mostly handle perturbations modeled by the $\ell_1$, $\ell_2$ and $\ell_\infty$ distances. In this paper, we introduce a novel algorithmic framework that blends a general-purpose constrained-optimization solver PyGRANSO with Constraint Folding (PWCF), which can add more reliability and generality to the state-of-the-art RE packages, e.g., AutoAttack. Regarding reliability, PWCF provides solutions with stationarity measures and feasibility tests to assess the solution quality. For generality, PWCF can handle perturbation models that are typically inaccessible to the existing projected gradient methods; the main requirement is the distance metric to be almost everywhere differentiable. Taking advantage of PWCF and other existing numerical algorithms, we further explore the distinct patterns in the solutions found for solving these optimization problems using various combinations of losses, perturbation models, and optimization algorithms. We then discuss the implications of these patterns on the current robustness evaluation and adversarial training.
Introduction
The security of deep neural networks (DNNs) hinges on their "robustness"—their ability to resist adversarial attacks. An adversarial attack is essentially an optimization problem: finding the smallest possible perturbation to an input that flips the model's prediction. Despite the proliferation of attack methods, current evaluation frameworks face two critical bottlenecks: reliability and generality.
Most popular solvers, such as Projected Gradient Descent (PGD) or those within the AutoAttack suite, operate on a fixed-iteration budget. They lack internal mechanisms to verify if a found solution is a true local optimum or merely a point where the algorithm stopped. This can lead to "gradient masking" or overoptimistic robustness estimates. Furthermore, these tools are often specialized for standard $\ell_p$ norms ($\ell_1, \ell_2, \ell_\infty$). As researchers move toward more complex "perceptual" distance metrics that better align with human vision, existing projected gradient methods often become inapplicable or highly inefficient.
PWCF: A General-Purpose Robustness Framework
To address these gaps, we introduce PWCF (PyGRANSO with Constraint-Folding). Built upon PyGRANSO—a solver for non-smooth, non-convex constrained optimization—PWCF offers a more principled approach to robustness evaluation.
Constraint-Folding for Efficiency
A major challenge in image-based optimization is the sheer number of constraints. For an image with $n$ pixels, ensuring each pixel stays within the $[0, 1]$ range introduces $2n$ box constraints. For high-resolution images, this overhead cripples general-purpose solvers.
PWCF employs a "Constraint-Folding" technique, where these thousands of individual constraints are mathematically "folded" into a single, albeit non-smooth, constraint function. This drastically reduces the computational complexity per iteration, making general-purpose solvers practical for high-dimensional image data.
Reliability and Refinement
Unlike "black-box" or heuristic attacks, PWCF provides a stationarity measure based on the Karush-Kuhn-Tucker (KKT) conditions. This serves as a rigorous "quality check," allowing researchers to determine if the optimizer has converged to a meaningful solution. Additionally, the framework utilizes a loss clipping technique to prevent the classification objective from overwhelming the image constraints. A two-stage optimization process—using multiple random restarts followed by high-precision refinement—helps the framework avoid poor local minima.
Experimental Evaluation
We evaluated PWCF on two standard benchmarks: CIFAR-10 (32x32 images) and ImageNet-100 (a 100-class subset of ImageNet). These datasets represent different scales of dimensionality and complexity.
Our results show that PWCF is not only more general but also highly efficient in terms of convergence. While standard solvers often run for their full allotted iterations, PWCF frequently identifies successful adversarial examples in significantly fewer steps, as evidenced by the distribution of iterations required to reach a solution.
Insights into Adversarial Patterns
One of the most striking findings of our study is the diversity of "sparsity patterns" in adversarial perturbations. Different combinations of loss functions (e.g., Cross-Entropy vs. Margin loss) and optimizers produce perturbations that look fundamentally different.
For instance, a model trained to be robust against "dense" $\ell_\infty$ noise might remain completely vulnerable to "sparse" attacks found by a different solver. This diversity explains why adversarial training often fails to generalize across different attack types. It also highlights why "Robust Accuracy" (accuracy under a fixed $\epsilon$ budget) is a flawed metric. We advocate for the minimal robustness radius—the exact distance to the nearest decision boundary—as a more objective measure of a model's intrinsic robustness.
Results and Conclusion
PWCF demonstrates competitive performance on standard $\ell_p$ metrics compared to state-of-the-art packages like AutoAttack. Its true strength, however, lies in its generality. In tests against complex Perceptual Distance (PD) metrics, PWCF achieved a 100% attack success rate on ImageNet-100, whereas specialized methods like PPGD or Fast-LPA often failed to satisfy image constraints.
While PWCF is currently slower than simple gradient-based methods (roughly 10x), its reliability makes it an ideal tool for rigorous robustness evaluation. Future work will focus on narrowing this speed gap to potentially enable the use of PWCF within the adversarial training loop itself, leading to models with more "universal" robustness.
Summary updated