Combating Adversarial Attacks Using Sparse Representations

Soorya Gopalakrishnan, Zhinus Marzi, Upamanyu Madhow, Ramtin Pedarsani

Introduction

Deep neural networks are notoriously fragile: adding a tiny, imperceptible amount of carefully crafted noise (an adversarial perturbation) to an image can trick a world-class model into misclassifying it.

The authors of this paper argue that this vulnerability stems fundamentally from the "curse of dimensionality." In high-dimensional spaces, an attacker can add a minuscule bit of noise to every single pixel. While each individual change is invisible to the human eye, they all accumulate in the direction of the model's decision boundary, creating a massive "distortion" in the model's output. To address this, the paper proposes a theoretically grounded defense mechanism called a "sparsifying front end." By forcing input data into a sparse representation, the authors demonstrate that the impact of adversarial noise is mathematically muffled, significantly boosting the robustness of both linear classifiers and Deep Neural Networks (DNNs).

The Sparsifying Front End Defense

The core proposal is a preprocessing step that filters out adversarial noise before it ever reaches the classifier.

Block diagram of the sparsifying front end defense pipeline

The process works through three main steps:

  1. Transform: The input data $x$ (e.g., an image) is transformed into a different domain using an orthonormal basis $\Psi$. In their experiments, the authors utilize the Cohen-Debauchies-Feauveau 9/7 wavelet.
  2. Threshold: A non-linear thresholding function $\mathcal{H}_K(\cdot)$ retains only the $K$ largest coefficients in this new domain, zeroing out the rest.
  3. Reconstruct: The sparsified coefficients are transformed back into the original image space to create a sanitized input $\hat{x}$ for the classifier.

For Linear Classifiers, the authors provide a mathematical proof that this technique reduces the distortion caused by an $l_\infty$-bounded attack by a factor of roughly $K/N$ (where $N$ is the total number of pixels and $K$ is the number of kept coefficients).

For Neural Networks, the authors leverage a "Locally Linear" model. Because DNNs (especially those using ReLU activations) behave like linear functions for a specific input, the authors treat the entire network as a massive linear equation. This allows them to adapt their sparsity defense to deep learning and to craft more effective "white-box" attacks for rigorous testing.

Key Insights

  • Sparsity as a Filter: Most natural data, like images, is "sparse" in the right basis—meaning a few important features carry most of the true information. Adversarial noise, however, is usually spread out across all dimensions. By discarding the "small" coefficients, the defense throws away a huge chunk of the adversary's attack surface without losing the core image signal.
  • The "Too Linear" Hypothesis: The paper reinforces the idea that DNNs aren't vulnerable because they are too complex, but rather because they are "too linear." This linearity is exactly what allows tiny adversarial perturbations to add up constructively across high dimensions.
  • Localization Matters: For the defense to work against "white-box" attackers (who are fully aware of the defense mechanism), the basis functions must be "localized" (having a small $l_1$ norm). This explains why wavelets are a significantly better choice for the transform step than a standard pixel basis.
  • Theoretical Grounding: Unlike many heuristic defenses that are quickly broken by adaptive attackers, this paper provides a provable reduction in distortion for linear models, offering a more solid mathematical foundation for robustness.

Experimental Results

The researchers evaluated their approach using the MNIST dataset of handwritten digits, performing binary classification (distinguishing '3' vs. '7' using a Linear SVM) and multi-class classification (10-class digit recognition using a four-layer CNN).

Accuracy results of models with and without the sparsifying front end

The results demonstrate that the sparsifying front end is remarkably effective at rescuing models under attack. In the most extreme case—the Linear SVM under a white-box attack—the adversary completely broke the undefended model, dropping its accuracy to 0%. However, with the sparsifying front end in place, the model recovered to an impressive 94.62% accuracy. Similarly, the CNN's accuracy under a white-box attack jumped from a dismal 8.87% to 84.04%.

Limitations and Future Work

While the theoretical foundation is strong, the authors note a few limitations. First, the experiments were limited to the relatively simple MNIST dataset. Real-world images (like those in ImageNet) are much more complex, making the discovery of a "perfect" sparse basis more challenging. Second, to achieve optimal results, the networks had to be retrained on the sparsified images rather than just applying the defense at inference time.

For future work, the authors suggest exploring more sophisticated "sparse generative models" and investigating "weight sparsity" (making the network's internal weights sparse) as complementary strategies for building robust AI systems.

Summary updated

BibTeX
@inproceedings{gopalakrishnan2018combating,
  author = {Soorya Gopalakrishnan and Zhinus Marzi and Upamanyu Madhow and Ramtin Pedarsani},
  title = {{Combating Adversarial Attacks Using Sparse Representations}},
  booktitle = {Workshops @ ICLR},
  year = {2018},
}
Figure