A Randomized Gradient-Free Attack on ReLU Networks

Francesco Croce, Matthias Hein

TL;DR

Researchers have developed rLR-QP, a new adversarial attack that exploits the geometric structure of ReLU-based neural networks. By treating the network as a collection of linear regions and using randomized quadratic programming, this "gradient-free" approach consistently finds smaller, more effective adversarial perturbations than the current gold-standard, the Carlini-Wagner attack.

What Problem Does This Paper Address?

Deep neural networks are notoriously fragile. Tiny, invisible changes to an input—known as adversarial perturbations—can trick a state-of-the-art classifier into making confident, wildly incorrect predictions.

Finding the absolute smallest change required to flip a classification is an NP-hard problem. While researchers have developed "exact" methods using mixed-integer programming (MIP) to find these optimal points, they don't scale to large networks. Consequently, the field relies on heuristics like the Carlini-Wagner (CW) attack. However, most of these heuristics rely on gradients. If a defense "hides" or "shatters" gradients, these attacks fail, creating a false sense of security.

The authors of this paper sought an attack that doesn't rely on gradients but instead exploits the fundamental geometric architecture of ReLU (Rectified Linear Unit) networks.

Methods

The core insight is that any neural network using ReLU activations is actually a continuous piecewise affine function.

Imagine the input space as a massive quilt. Inside each "patch" (a polytope or linear region), the neural network behaves like a simple linear function ($f(x) = Vx + a$).

  1. Local Optimization: Within any single patch, finding the closest point that changes the classification is a straightforward Quadratic Program (QP) for the $l_2$ norm. This can be solved efficiently and exactly.
  2. The Challenge: A deep network has an exponential number of these patches, making it impossible to check them all.
  3. The Solution (rLR-QP): The authors propose a randomized strategy called rLR-QP (randomized Linear Region Quadratic Programming). It alternates between two phases:
  4. Exploration: Randomly sampling points in a wide radius to "jump" into different linear regions.
  5. Local Search: Searching more intensely in the immediate vicinity of the current best adversarial point.

By solving QPs on a smart selection of these regions, the algorithm "crawls" along the decision boundary to find the path of least resistance.

Datasets

The authors evaluated their method on three standard image classification benchmarks:

  • MNIST: Handwritten digits.
  • GTS (German Traffic Sign): Real-world traffic sign recognition.
  • CIFAR-10: General object categories (birds, planes, cars, etc.).

They tested both "plain" models and models hardened with adversarial training, which are typically much harder to attack.

Key Insights and Ideas

  • Geometry Over Gradients: Because the attack looks at the boundaries of the linear regions rather than the slope of the loss surface, it is less susceptible to "gradient masking"—a common phenomenon where defenses make gradients useless without actually making the model more robust.
  • Provable Optimality on Small Scales: In tests on small networks where the "true" optimal perturbation could be calculated (via MIP), rLR-QP found the exact global optimum 100% of the time, whereas CW and DeepFool often settled for larger, sub-optimal perturbations.
  • The Power of Warm Starts: The algorithm performs significantly better when initialized with a quick-and-dirty attack like DeepFool. It then uses its geometric search to "polish" that initial guess into a much smaller perturbation.
  • Volume Bias: By sampling points randomly, the algorithm is naturally biased toward visiting linear regions with higher volume, which are more likely to contain the paths that lead to the decision boundary.

Key Results

  • Beating the Gold Standard: In 17 out of 18 experimental configurations, rLR-QP outperformed the Carlini-Wagner attack, reducing the size of the required perturbation by up to 9%.
  • Reliability: On certain models (like adversarially trained MNIST), the CW attack occasionally failed to find any adversarial example. rLR-QP maintained a 100% success rate across all test instances.
  • Efficiency: While more complex than a simple gradient step, the attack is relatively fast. On medium-sized networks, it takes between 0.5 and 2 seconds per image on a standard CPU.

Limitations and Future Work

  • Computational Scaling: The current implementation relies on the Gurobi optimizer and runs on CPUs. To scale to massive "ImageNet-scale" models, the authors note that a GPU-accelerated version of the solver would be necessary.
  • Architecture Specifics: The paper focuses on fully connected ReLU networks. While the math extends to Convolutional Neural Networks (CNNs) and Max-Pooling layers (which are also piecewise affine), the authors left the full implementation for CNNs as future work.
  • Hyperparameter Tuning: The algorithm's success depends on the number of regions explored ($n_1$ through $n_4$). Finding the right balance between search time and perturbation quality remains an engineering challenge.

Summary updated

BibTeX
@inproceedings{croce2018randomized,
  author = {Francesco Croce and Matthias Hein},
  title = {{A Randomized Gradient-Free Attack on ReLU Networks}},
  booktitle = {GCPR},
  year = {2018},
  url = {https://openreview.net/forum?id=JglYVG0jHV},
}

Loading related content...

Figure