σ-zero: Gradient-based Optimization of 𝓁0-norm Adversarial Examples

Antonio Emanuele Cinà, Francesco Villani, Maura Pintor, Lea Schönherr, Battista Biggio, Marcello Pelillo · DOI

Abstract

Evaluating the adversarial robustness of deep networks to gradient-based attacks is challenging. While most attacks consider $\ell_2$- and $\ell_\infty$-norm constraints to craft input perturbations, only a few investigate sparse $\ell_1$- and $\ell_0$-norm attacks. In particular, $\ell_0$-norm attacks remain the least studied due to the inherent complexity of optimizing over a non-convex and non-differentiable constraint. However, evaluating adversarial robustness under these attacks could reveal weaknesses otherwise left untested with more conventional $\ell_2$- and $\ell_\infty$-norm attacks. In this work, we propose a novel $\ell_0$-norm attack, called $\sigma$-zero, which leverages a differentiable approximation of the $\ell_0$ norm to facilitate gradient-based optimization, and an adaptive projection operator to dynamically adjust the trade-off between loss minimization and perturbation sparsity. Extensive evaluations using MNIST, CIFAR10, and ImageNet datasets, involving robust and non-robust models, show that $\sigma$-zero finds minimum $\ell_0$-norm adversarial examples without requiring any time-consuming hyperparameter tuning, and that it outperforms all competing sparse attacks in terms of success rate, perturbation size, and efficiency.

Introduction

Adversarial attacks typically focus on $\ell_2$ or $\ell_\infty$ norms, where perturbations are small in magnitude but can affect every pixel in an image. In contrast, sparse attacks ($\ell_0$-norm) aim to change as few pixels as possible, regardless of the magnitude of those changes. This is a critical threat model for security-sensitive applications, as it identifies the most sensitive features a model relies on for its decisions.

However, optimizing for the $\ell_0$ norm is notoriously difficult. Because the $\ell_0$ "norm" (which simply counts non-zero elements) is non-convex and non-differentiable, finding the absolute minimum perturbation is an NP-hard problem. Existing attacks are often a compromise: they are either fast but find "dense" (suboptimal) solutions, or they are accurate but painfully slow and require complex initialization or extensive hyperparameter tuning.

Methodology

The authors introduce $\sigma$-zero, a white-box attack that brings the efficiency of gradient descent to the discrete world of sparsity. It relies on two main technical innovations:

  1. Differentiable $\ell_0$ Approximation: Instead of the non-differentiable step function of the true $\ell_0$ norm, the authors use a smooth approximation: $\hat{\ell}_0(x, \sigma) = \sum \frac{x_i^2}{x_i^2 + \sigma}$. As the smoothing parameter $\sigma$ approaches zero, this function behaves like the true $\ell_0$ norm but remains differentiable, allowing the use of standard backpropagation.
  2. Adaptive Projection Operator ($\Pi_\tau$): To ensure the final solution is truly sparse, the algorithm uses a projection step that zeros out components below a threshold $\tau$. Crucially, this threshold is adaptive: it increases to force more sparsity if the current image is already adversarial, and decreases to prioritize finding a successful attack if it isn't.
2D visualization of the $\sigma$-zero optimization path, demonstrating how it navigates the decision boundary to find sparse solutions.

The algorithm also incorporates standard optimization "best practices" like gradient normalization and cosine annealing of the step size to stabilize and speed up convergence.

Experimental Results

The researchers evaluated $\sigma$-zero across three standard computer vision benchmarks: MNIST, CIFAR-10, and ImageNet. They tested the attack against 22 different models, including standard non-robust networks and state-of-the-art robust models sourced from the RobustBench repository.

$\sigma$-zero was compared against over 10 competing attacks in nearly 450 different scenarios. Key findings include:

  • Sparsity: On CIFAR-10, it reduced the median number of perturbed features by an average of 49% across all models compared to the next best fast competitor (FMN). On ImageNet, this reduction reached up to 58%.
  • Speed: On ImageNet, $\sigma$-zero proved to be 10x to 100x faster than the accurate-but-slow BBadv attack.
  • Reliability: Unlike many sparse attacks that frequently fail to find any adversarial example, $\sigma$-zero consistently reaches a 100% success rate given a sufficient perturbation budget.
Visual evolution of the $\sigma$-zero attack on a frog image, showing the reduction in perturbed pixels while maintaining adversarial success.

Qualitatively, the perturbations found by $\sigma$-zero are often concentrated on semantically important regions of the image, yet they remain nearly invisible to the human eye because so few pixels are changed.

Conclusion

$\sigma$-zero represents a significant step forward in evaluating adversarial robustness. By combining a smooth, differentiable approximation of the $\ell_0$ norm with a dynamic projection strategy, it consistently finds smaller, sparser perturbations faster than existing state-of-the-art methods without requiring tedious hyperparameter tuning. The study shows that models robust to $\ell_\infty$ or $\ell_2$ attacks can still be highly vulnerable to sparse $\ell_0$ attacks, highlighting the need for diverse robustness evaluations.

Summary updated

BibTeX
@inproceedings{cina2025zero,
  author = {Antonio Emanuele Cinà and Francesco Villani and Maura Pintor and Lea Schönherr and Battista Biggio and Marcello Pelillo},
  title = {{σ-zero: Gradient-based Optimization of 𝓁0-norm Adversarial Examples}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=4jVgBkQvWW},
}
Figure