Improving Adversarial Robustness in Weight-quantized Neural Networks

Chang Song, Elias Fallon, Hai Helen LiarXiv 2020

Introduction

Deploying deep learning models on edge devices—such as smartphones and autonomous vehicles—requires significant optimization to meet power and memory constraints. Quantization, which reduces 32-bit floating-point weights to low-bit integers (e.g., 3-bit), is a standard technique for achieving this efficiency. However, these compressed models are often highly vulnerable to adversarial attacks.

While Adversarial Training (AT) is the standard defense against such attacks, it surprisingly degrades the performance of quantized models. This paper investigates this "AT-Quantization Paradox" and proposes a dual-defense strategy: Feedback Learning (F.L.) and a nonlinear $μ$-law weight mapping.

The AT-Quantization Paradox

The authors discover that standard adversarially trained models are actually less tolerant to quantization than vanilla models. By analyzing the Lipschitz constant—a mathematical measure of how much a function amplifies input perturbations—they found that AT models exhibit significantly higher constants in their final layers. This means that small errors introduced by quantization are amplified into large classification errors.

Lipschitz constants across layers for MNIST, showing how standard adversarial training (Adv.) increases sensitivity in later layers compared to the original (Orig.) and proposed Feedback Learning (F.L.) methods.

As shown in the figure above, the Lipschitz constant for the "Adv." model spikes in the later layers, explaining why these models collapse when quantized.

Proposed Methodology

To address these vulnerabilities, the researchers developed two primary techniques:

  1. Feedback Learning (F.L.): Instead of simply training on adversarial noise, F.L. uses a boundary-based retraining approach. It calculates the distance between data samples and decision boundaries, then generates training examples designed to expand these margins. This makes the model inherently more robust to the "boundary shifting" caused by quantization.
  2. Nonlinear μ-law Mapping: Borrowing from telecommunications, the authors apply a μ-law algorithm to the weights of the final layers. This nonlinear mapping increases the model's overall nonlinearity, effectively "masking" gradients. This makes it much harder for attackers to compute the precise gradients needed for white-box adversarial attacks.

Experimental Results

The proposed methods were evaluated on MNIST and CIFAR-10 benchmarks. The results demonstrate that the combination of Feedback Learning and μ-law mapping provides superior robustness at low bitwidths.

Accuracy vs. Quantization Bit for MNIST (left) and CIFAR-10 (right). The proposed Feedback Learning (F.L.) maintains high accuracy even as bitwidth decreases to 3 bits, significantly outperforming standard adversarial training (Adv.).

As illustrated in the performance plots, while standard quantized models (Orig.) and adversarially trained models (Adv.) see sharp drops in accuracy at 3 bits, the F.L. approach remains stable. Specifically, on CIFAR-10 under PGD attacks, the proposed method achieved 86.90% accuracy for a 3-bit model, compared to just ~11% for a vanilla quantized model.

Conclusion

This work highlights a critical conflict between hardware efficiency and security in deep learning. By identifying the amplification of quantization errors in adversarially trained models, the authors were able to design a more compatible defense. Their dual-pronged approach of boundary-based retraining and nonlinear weight mapping successfully bridges the gap, enabling robust, high-performance neural networks on resource-constrained hardware.

Summary updated

BibTeX
@misc{song2020improving,
  author = {Chang Song and Elias Fallon and Hai Helen Li},
  title = {{Improving Adversarial Robustness in Weight-quantized Neural Networks}},
  year = {2020},
  eprint = {2012.14965},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.14965},
}
Figure