RobustMQ: benchmarking robustness of quantized models

Yisong Xiao, Aishan Liu, Tianyuan Zhang, Haotong Qin, Jinyang Guo, Xianglong Liu

Abstract

Quantization is a critical technique for deploying Deep Neural Networks (DNNs) on resource-constrained edge devices. However, the impact of reducing bit-width on model robustness remains poorly understood. This paper introduces RobustMQ, a comprehensive benchmark designed to evaluate the robustness of quantized models across three dimensions: adversarial attacks, natural corruptions, and systematic noise. Our findings reveal a significant trade-off: while low-bit quantization can enhance adversarial robustness, it simultaneously increases vulnerability to real-world environmental noise and software-level systematic errors.

Introduction

The deployment of Deep Neural Networks (DNNs) on smartphones and embedded devices necessitates significant reductions in memory and computational requirements. Quantization—the process of mapping high-precision 32-bit floating-point values to low-bit integers—is a primary strategy for achieving this. Despite its widespread use, the robustness of quantized models is often overlooked. Previous research has provided inconsistent results, often focusing on limited architectures or specific types of noise. RobustMQ addresses this gap by providing a standardized, large-scale evaluation framework to understand how quantization affects a model's ability to handle "messy" real-world data and deliberate attacks.

Methods

The RobustMQ benchmark evaluates models across four diverse architectures: ResNet18, ResNet50, RegNetX600M, and MobileNetV2. It incorporates three prominent Quantization-Aware Training (QAT) methods: DoReFa, PACT, and LSQ.

Overview of the RobustMQ benchmark, illustrating the evaluation approaches (adversarial, natural, systematic) and the evaluation objects (datasets, architectures, quantization methods).

The benchmark assesses robustness using three distinct categories of perturbations:

  1. Adversarial Attacks: Mathematical perturbations including FGSM, PGD, and AutoAttack.
  2. Natural Corruption: Environmental factors such as snow, fog, and blur, utilizing the ImageNet-C and ImageNet-P datasets.
  3. Systematic Noise: Subtle discrepancies introduced by software and hardware, such as variations in image decoding (Pillow vs. OpenCV) and resizing algorithms (Bilinear vs. Nearest Neighbor), categorized under ImageNet-S.

Results

Our evaluation reveals several key insights into the behavior of quantized models.

The Adversarial "Silver Lining"

A counter-intuitive finding is that quantized models often demonstrate higher adversarial robustness than their full-precision counterparts. For instance, a 2-bit DoReFa-quantized ResNet18 achieved a Worst-Case Adversarial Robustness (WCAR) 4.25% higher than the 32-bit version. This suggests that the discrete nature of quantized weights may provide a regularizing effect, hindering gradient-based adversarial attacks.

The Bit-Width Trade-off

There is a clear inverse relationship between adversarial robustness and other forms of robustness as bit-width decreases.

Adversarial Robustness (AR) of DoReFa models across different bit-widths, showing a general trend of increased robustness at lower bit-widths for certain attack scenarios.

As models move from 32-bit to 2-bit:

  • Adversarial robustness generally increases.
  • Natural and systematic robustness decreases.

Vulnerability to Systematic and Natural Noise

Quantized models are significantly more sensitive to "systematic noise." They are approximately 3.43 times more likely to fail due to changes in software pre-processing libraries compared to floating-point models. In terms of natural corruptions, impulse noise and glass blur were identified as particularly detrimental to quantized model performance, whereas brightness changes had minimal impact.

Discussion and Conclusion

RobustMQ highlights that quantization is not a "free lunch" regarding model reliability. While it offers a surprising boost against adversarial threats, it makes models more brittle in the face of common environmental and systematic variations.

Future work should extend this benchmarking to Post-Training Quantization (PTQ) and explore the underlying reasons for the extreme fragility of lightweight architectures like MobileNetV2 when quantized. Expanding the scope to Natural Language Processing and Speech Recognition will also be vital for a holistic understanding of quantization robustness across AI domains.

Summary updated

BibTeX
@article{xiao2023robustmq,
  author = {Yisong Xiao and Aishan Liu and Tianyuan Zhang and Haotong Qin and Jinyang Guo and Xianglong Liu},
  title = {{RobustMQ: benchmarking robustness of quantized models}},
  journal = {Vis. Intell.},
  year = {2023},
  doi = {10.1007/s44267-023-00031-w},
}
Figure