[Paper Review] Attacking Binarized Neural Networks
This paper investigates the adversarial robustness of binarized neural networks (BNNs), demonstrating that stochastic quantization of weights in a single layer significantly improves resistance to iterative adversarial attacks. It shows that BNNs exhibit gradient masking effects that hinder attack success, and that stochastically quantized BNNs achieve 71±2% adversarial accuracy on MNIST under the strongest white-box attack (CWL2), outperforming full-precision models by over 70x.
Neural networks with low-precision weights and activations offer compelling efficiency advantages over their full-precision equivalents. The two most frequently discussed benefits of quantization are reduced memory consumption, and a faster forward pass when implemented with efficient bitwise operations. We propose a third benefit of very low-precision neural networks: improved robustness against some adversarial attacks, and in the worst case, performance that is on par with full-precision models. We focus on the very low-precision case where weights and activations are both quantized to $\pm$1, and note that stochastically quantizing weights in just one layer can sharply reduce the impact of iterative attacks. We observe that non-scaled binary neural networks exhibit a similar effect to the original defensive distillation procedure that led to gradient masking, and a false notion of security. We address this by conducting both black-box and white-box experiments with binary models that do not artificially mask gradients.
Motivation & Objective
- To evaluate the robustness of binarized neural networks (BNNs) against adversarial attacks on MNIST and CIFAR-10 datasets.
- To investigate whether low-precision models, particularly BNNs, offer inherent robustness due to gradient masking or regularization effects.
- To compare BNNs with full-precision models in both white-box and black-box threat models.
- To propose and validate a defense strategy combining stochastic quantization and architectural regularization for improved adversarial robustness.
Proposed method
- The authors train binary neural networks (BNNs) with weights and activations quantized to ±1, using stochastic quantization in a single convolutional layer to disrupt iterative attack gradients.
- They conduct white-box and black-box adversarial attacks using FGSM, JSMA, and CWL2 on MNIST and CIFAR-10, comparing BNNs with full-precision models.
- The study analyzes gradient behavior and activation statistics, observing that BNNs exhibit large logit variance and non-smooth gradients, leading to gradient masking.
- Stochastic quantization introduces model variability at each attack step, effectively turning iterative attacks into ensemble-like searches with no consistent direction.
- The authors use a pseudo-random number generator to implement stochastic quantization efficiently, suitable for microcontroller deployment.
- They compare performance across different architectures and quantization strategies, including scaled and unscaled BNNs, to isolate robustness mechanisms.
Experimental results
Research questions
- RQ1Does binarization of weights and activations in neural networks improve robustness against adversarial attacks?
- RQ2To what extent do gradient masking effects in BNNs hinder the success of iterative adversarial attacks?
- RQ3Can stochastic quantization of weights in a single layer significantly reduce the effectiveness of strong white-box attacks?
- RQ4How does the robustness of BNNs compare to full-precision models under both black-box and white-box threat models?
- RQ5What role does regularization from binary units play in reducing susceptibility to adversarial examples?
Key findings
- Stochastic quantization of weights in a single convolutional layer reduces the success rate of iterative attacks by introducing model variability at each step, effectively turning the attack into a search over an ensemble of models.
- On MNIST, the stochastically quantized BNN (S64+) achieved 71±2% adversarial accuracy under the CWL2 white-box attack, compared to only 1.8±0.9% for the best full-precision model.
- BNNs exhibit two forms of gradient masking: one due to large logit variance and saturation of the softmax function, and another due to discontinuous, non-smooth gradients from binary operations.
- The plain BNN without stochastic quantization shows robustness to targeted attacks, particularly JSMA, due to suboptimal attack behavior on discrete, high-variance gradients.
- On CIFAR-10, BNNs showed slightly better robustness than full-precision models in black-box settings, attributed to improved regularization from binary units.
- The study confirms that BNNs are not inherently more robust to single-step attacks like FGSM, but stochastic quantization significantly improves resilience to stronger iterative attacks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.