TL;DR
Randomized neural networks often fail against adaptive attacks because their internal gradients are too similar, allowing attackers to use a "proxy" average gradient to break the defense. This paper introduces GradDiv, a regularization technique that forces these internal gradients to scatter, effectively "confusing" the attacker and significantly boosting adversarial robustness across multiple benchmarks.
What Problem Does This Paper Address?
Deep learning models are notoriously fragile: a tiny, invisible-to-humans change to an image (an adversarial perturbation) can cause a state-of-the-art network to misclassify a "stop sign" as a "speed limit sign."
One popular defense is to use Randomized Neural Networks (RNNs). Instead of one fixed model, an RNN effectively uses a slightly different network for every single prediction. The idea is that if an attacker doesn't know exactly which "version" of the network will be used, they can't calculate the precise gradient needed to create a successful attack.
However, attackers found a workaround called Expectation over Transformation (EOT). By averaging the gradients of many possible versions of the randomized network, they create a "proxy gradient" that is often "good enough" to fool the system. The authors of this paper identified the root cause: in standard RNNs, the gradients of different randomized samples are still highly aligned. If all the "versions" of your network want to move in the same direction to increase error, the average direction is a perfect roadmap for an attacker.
Methods
The authors propose Gradient Diversity (GradDiv) regularization to solve this alignment problem. The goal is to make the gradients of different randomized samples as diverse (scattered) as possible.
They introduced three specific mathematical ways to enforce this diversity during training:
- $R_\kappa$ (vMF Concentration): They model the gradient directions using a von Mises-Fisher distribution and penalize the concentration parameter ($\kappa$). Lower concentration means more spread-out directions.
- $R_{mean}$ (Cosine Similarity): A straightforward approach that penalizes the average cosine similarity between pairs of gradient samples.
- $R_{DPP}$ (Determinantal Point Process): A more sophisticated method that treats gradients as points in a subset and uses DPPs to encourage diversity, effectively trying to make the gradient vectors orthogonal to one another.
By adding these terms to the standard training loss, the network learns to maintain high accuracy while ensuring its internal "opinions" on how to handle an input are as varied as possible.
Datasets
The researchers evaluated GradDiv on three standard computer vision benchmarks:
- MNIST: Handwritten digits (the "Hello World" of computer vision).
- CIFAR10: 60,000 small color images in 10 classes (e.g., airplanes, dogs, trucks).
- STL10: A dataset designed for developing unsupervised feature learning, featuring higher-resolution images than CIFAR10.
Key Insights and Ideas
- The MRL Bound: The authors mathematically proved that the potential damage an attacker can do using a proxy gradient is upper-bounded by the Mean Resultant Length (MRL) of the gradients. By minimizing MRL, you are literally shrinking the maximum possible "loss increase" an attacker can achieve.
- Alignment is the Enemy: As shown in Figure 2, as the angle ($\theta$) between the attacker's proxy gradient and the true gradient increases, the attack's effectiveness plummets. GradDiv is designed to maximize this angle for as many samples as possible.
- Diverse Decision Boundaries: Beyond just gradients, GradDiv forces the different randomized versions of the network to have different "decision boundaries." This means an adversarial example that fools one version is much less likely to fool another.
Key Results
GradDiv consistently outperformed baseline randomized defenses (like Adv-BNN) across various attack types (FGSM, PGD, EOT-PGD, etc.):
- Robustness Boost: On CIFAR10, GradDiv improved overall robust accuracy from 42.95% to 45.77% against a suite of combined attacks.
- Resistance to EOT: On MNIST, GradDiv maintained high accuracy (~92%) even at high perturbation levels ($\epsilon=0.4$) where the baseline Adv-BNN dropped significantly (~85%).
- Reduced Transferability: The "transferability" (how well an attack on one sample model works on another) dropped dramatically. In one test, the accuracy of a transfer attack went from 24% (very successful attack) to 75% (mostly failed attack) after applying GradDiv.
- No Obfuscation: The authors verified that their defense doesn't rely on "obfuscated gradients" (a common flaw in many defenses that gives a false sense of security), passing the standard checklist for robust evaluation.
Limitations and Future Work
- Computational Cost: Calculating multiple gradients for every training step (to compute the diversity loss) increases the time and memory required for training.
- Empirical Nature: Like all adversarial defense research, these results are empirical. While GradDiv stands up to current state-of-the-art attacks, the "arms race" continues, and future adaptive attacks might find new ways to circumvent gradient diversity.
- Generalization: The paper primarily tests GradDiv on top of Bayesian Neural Networks (Adv-BNN). Exploring how it interacts with other types of randomization (like input transformations) remains an open area for research.
Summary updated