SparseFool: A Few Pixels Make a Big Difference.

Apostolos Modas, Seyed-Mohsen Moosavi-Dezfooli, Pascal Frossard

Abstract

Deep Neural Networks have achieved extraordinary results on image classification tasks, but have been shown to be vulnerable to attacks with carefully crafted perturbations of the input data. Although most attacks usually change values of many image's pixels, it has been shown that deep networks are also vulnerable to sparse alterations of the input. However, no computationally efficient method has been proposed to compute sparse perturbations. In this paper, we exploit the low mean curvature of the decision boundary, and propose SparseFool, a geometry inspired sparse attack that controls the sparsity of the perturbations. Extensive evaluations show that our approach computes sparse perturbations very fast, and scales efficiently to high dimensional data. We further analyze the transferability and the visual effects of the perturbations, and show the existence of shared semantic information across the images and the networks. Finally, we show that adversarial training can only slightly improve the robustness against sparse additive perturbations computed with SparseFool.

Introduction

Adversarial attacks—the art of tricking a neural network with subtle input changes—usually involve "dense" noise, where every pixel in an image is tweaked slightly. However, sparse attacks ($\ell_0$ norm), where only a few pixels are modified, are arguably more representative of real-world failures, such as a few raindrops on a stop sign or a small piece of tape on a sensor.

The challenge lies in the fact that finding the minimum number of pixels to flip a classification label is an NP-hard problem. Existing sparse attacks, like JSMA (Jacobian-based Saliency Map Attack) or the "one-pixel attack," are computationally expensive and struggle to scale to high-resolution images like those in ImageNet. Furthermore, sparse attacks often produce pixel values that fall outside the valid range, and simple clipping often breaks the attack's effectiveness. SparseFool addresses these issues by providing a geometry-inspired algorithm that finds sparse vulnerabilities with unprecedented speed and scalability.

Methodology

SparseFool builds on the logic of DeepFool, a popular geometry-based dense attack. The key technical innovations include:

  1. Boundary Linearization: The authors exploit the observation that the decision boundaries of deep networks have low mean curvature (they are relatively "flat"). This allows the algorithm to approximate the boundary as a simple hyperplane.
  2. Iterative $\ell_1$ Projection: To achieve sparsity, SparseFool relaxes the $\ell_0$ problem into an $\ell_1$ minimization problem. In each iteration, it identifies the single most influential coordinate (pixel) to change based on the gradient of the decision boundary.
  3. Box-Constraint Handling: Unlike previous methods, SparseFool explicitly incorporates the valid dynamic range of an image into its iterative solver, ensuring perturbed pixels stay within valid bounds (e.g., $[0, 1]$).
  4. The $\lambda$ Parameter: To speed up convergence, the algorithm uses a parameter $\lambda$ to "overshoot" the decision boundary, ensuring the perturbed image crosses the classification threshold.

Experimental Setup

The authors evaluated SparseFool across three major benchmarks: MNIST, CIFAR-10, and ImageNet (ILSVRC2012). They tested these against various architectures, including LeNet, VGG-16/19, ResNet-18/101, DenseNet-161, and Inception-v3.

Results and Discussion

SparseFool demonstrates significant improvements in efficiency and scalability. On MNIST, SparseFool is 4.7x faster than JSMA, and on CIFAR-10, it is 15.5x faster. Crucially, SparseFool successfully attacked ImageNet models in roughly 5–10 seconds per image, a task for which previous sparse attacks were computationally infeasible.

Examples of SparseFool attacks on ImageNet. Despite minimal pixel changes, the network misclassifies the images into unrelated categories such as 'cockroach' for a sewing task or 'sandal' for a baby bottle.

On ImageNet, SparseFool achieved a 100% fooling rate by perturbing only 0.14% to 0.29% of the total pixels. While the perturbations are sparse, they are often more visible than dense attacks because the few pixels that do change must change significantly to flip the label. Interestingly, the attack often targets semantically important regions—like the eyes or head of an animal—suggesting that these models rely heavily on specific localized features.

Conclusion

SparseFool highlights a critical vulnerability in deep networks: extreme sensitivity to a tiny fraction of input data. The paper concludes that current defenses, such as adversarial training using $\ell_\infty$ perturbations, only marginally improve robustness against sparse attacks. This gap suggests a need for future research into training regimes that specifically harden the local sensitivity of neural networks.

Summary updated

BibTeX
@inproceedings{modas2019sparsefool,
  author = {Apostolos Modas and Seyed-Mohsen Moosavi-Dezfooli and Pascal Frossard},
  title = {{SparseFool: A Few Pixels Make a Big Difference.}},
  booktitle = {CVPR},
  year = {2019},
  url = {https://openreview.net/forum?id=rXEWDXmlOar},
}
Figure