Defensive Dropout for Hardening Deep Neural Networks under Adversarial Attacks

Siyue Wang, Xiao Wang, Pu Zhao, Wujie Wen, David R. Kaeli, Peter Chin, Xue Lin

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).

Standard vs. Stochastic Dropout Mechanisms

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.

Structural Comparison of Standard and Dropout-Applied Networks

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

Abstract

Deep neural networks (DNNs) are known vulnerable to adversarial attacks. That is, adversarial examples, obtained by adding delicately crafted distortions onto original legal inputs, can mislead a DNN to classify them as any target labels. This work provides a solution to hardening DNNs under adversarial attacks through defensive dropout. Besides using dropout during training for the best test accuracy, we propose to use dropout also at test time to achieve strong defense effects. We consider the problem of building robust DNNs as an attacker-defender two-player game, where the attacker and the defender know each others' strategies and try to optimize their own strategies towards an equilibrium. Based on the observations of the effect of test dropout rate on test accuracy and attack success rate, we propose a defensive dropout algorithm to determine an optimal test dropout rate given the neural network model and the attacker's strategy for generating adversarial examples.We also investigate the mechanism behind the outstanding defense effects achieved by the proposed defensive dropout. Comparing with stochastic activation pruning (SAP), another defense method through introducing randomness into the DNN model, we find that our defensive dropout achieves much larger variances of the gradients, which is the key for the improved defense effects (much lower attack success rate). For example, our defensive dropout can reduce the attack success rate from 100% to 13.89% under the currently strongest attack i.e., C&W attack on MNIST dataset.
BibTeX
@inproceedings{wang2018defensive,
  author = {Siyue Wang and Xiao Wang and Pu Zhao and Wujie Wen and David R. Kaeli and Peter Chin and Xue Lin},
  title = {{Defensive Dropout for Hardening Deep Neural Networks under Adversarial Attacks}},
  booktitle = {ICCAD},
  year = {2018},
  url = {https://openreview.net/forum?id=DEBrO2xVN1},
}
Figure