Abstract
Deep neural networks (DNNs) are notoriously vulnerable to adversarial attacks, where small, calculated perturbations to input data can lead to incorrect classifications. This paper proposes Defensive Dropout, a novel approach to hardening DNNs by maintaining dropout stochasticity during the inference phase. By modeling the interaction between attackers and defenders as a two-player game, the authors identify an optimal test-time dropout rate that balances classification accuracy with robustness. Experimental results on MNIST and CIFAR-10 datasets demonstrate that Defensive Dropout significantly reduces the success rate of potent attacks, such as the Carlini & Wagner (C&W) attack, by increasing gradient variance and creating a "noise barrier" that hinders adversarial optimization.
Introduction
While DNNs have achieved remarkable success in various domains, their susceptibility to adversarial examples remains a critical security concern. In a white-box setting, an attacker with full knowledge of the model can exploit its deterministic nature to find perturbations that mislead the network. Existing defenses, including adversarial training and defensive distillation, often fail against sophisticated optimization-based attacks like C&W. The core issue is that these models remain static at test time, allowing attackers to precisely calculate the gradients needed to craft adversarial inputs.
Methodology: Stochasticity as a Defense
The primary contribution of this work is the extension of dropout—a common regularization technique—into the testing phase.
Test-Time Randomness
In standard implementations, dropout is used during training to prevent overfitting by randomly omitting neurons. At test time, the network typically becomes deterministic, using all neurons with weights scaled by the dropout probability $p$ (Figure 5b). Defensive Dropout rejects this deterministic averaging. Instead, it continues to randomly drop neurons for every inference pass (Figure 5a).
This approach ensures that the attacker is not targeting a single, static model but rather one of an exponential number of possible sub-networks (Figure 4b). Even if the attacker knows the defense strategy, the specific "mask" of active neurons changes with each input, making the gradient information highly unstable.
The Attacker-Defender Game
The authors formalize this defense as a two-player game. The defender chooses a test-time dropout rate $r'$ to maximize robustness, while the attacker attempts to find the best adversarial perturbation given that rate. To find the optimal $r'$, the researchers developed an algorithm that maximizes the dropout rate until the accuracy on clean images hits a predefined minimum threshold, ensuring the defense does not overly compromise utility.
Experimental Evaluation
The effectiveness of Defensive Dropout was tested on the MNIST and CIFAR-10 benchmarks against the C&W attack, widely considered one of the strongest adversarial threats.
- MNIST Robustness: The defense reduced the C&W attack success rate from a perfect 100% to just 13.89%. This was achieved with a minimal accuracy loss of approximately 0.8% on clean data.
- CIFAR-10 Robustness: Against the same attack, Defensive Dropout limited the success rate to 43.33%, a significant improvement over other stochastic methods like Stochastic Activation Pruning (SAP), which allowed a 77.78% success rate.
Mechanism Analysis: The Power of Variance
The paper investigates the underlying reason for this defense's success by analyzing gradient distributions. Compared to SAP, Defensive Dropout produces gradients with much higher variance. These "shorter and fatter" probability density functions of gradients act as a noise barrier. Because the gradients fluctuate significantly between different dropout masks, gradient-based optimization algorithms used by attackers struggle to converge on a successful adversarial perturbation.
Conclusion
Defensive Dropout provides a robust and computationally efficient method for hardening DNNs. By transforming the network into a stochastic ensemble of sub-networks at test time, it leverages high gradient variance to thwart adversarial optimization. While there is an inherent trade-off between the dropout rate and baseline accuracy, the proposed optimal dropout algorithm allows practitioners to tune this balance effectively, providing a strong defense even against state-of-the-art white-box attacks.
Summary updated