SPIQ: Data-Free Per-Channel Static Input Quantization

Edouard Yvinec, Arnaud Dapogny, Matthieu Cord, Kevin Bailly

Abstract

Deep Neural Networks (DNNs) are computationally heavy, making them difficult to run on "edge" devices like smartphones or IoT sensors. Quantization—converting 32-bit floating-point numbers into lower-precision integers—is a standard solution to reduce memory and speed up inference. SPIQ (Static Per-channel Input Quantization) is a novel data-free quantization method that achieves the high accuracy of dynamic quantization with the blazing speed of static quantization. By leveraging Batch Normalization statistics to estimate per-channel input ranges and "folding" these scales into the weights, SPIQ significantly outperforms existing state-of-the-art methods on compact architectures like MobileNet and EfficientNet.

Introduction: The Quantization Trade-off

The primary challenge in quantization lies in estimating the range of activation values flowing through a network. Traditionally, practitioners must choose between two suboptimal paths:

  1. Static Quantization: Estimates a single scaling factor for an entire layer once. While fast, it is often inaccurate because it is too "coarse."
  2. Dynamic Quantization: Re-calculates scaling factors for every input at runtime. This is more accurate but introduces significant computational overhead, slowing down the model.

Furthermore, many industries require data-free quantization (Post-Training Quantization), where the original training data is unavailable due to privacy or security concerns. SPIQ addresses the need for a method that provides the accuracy of dynamic quantization without the speed penalty, all while using zero training data.

Methodology: Static Per-channel Input Quantization

SPIQ introduces a two-step process to bridge the gap between static and dynamic methods:

  1. Per-Channel Estimation: Instead of one scale for the whole layer, SPIQ calculates a unique scale for every input channel. It achieves this "data-free" by utilizing the mean and variance statistics already stored in the model's Batch Normalization (BN) layers.
  2. Weight Folding: Per-channel input quantization is typically mathematically impractical because it disrupts the efficiency of matrix multiplication. SPIQ solves this by "folding" the input scaling factors into the weights themselves. By pre-adjusting the weights to account for the input channel scales, inference can proceed using standard, high-speed integer operations.
Comparison of SPIQ with static and dynamic quantization on ResNet 50 across different bit-widths.

This approach allows the model to maintain a "tighter" fit to the data distribution—similar to dynamic methods—while remaining a purely static process during inference.

Evaluation and Results

The researchers evaluated SPIQ across three major computer vision benchmarks: ImageNet (classification), Pascal VOC 2012 (object detection), and CityScapes (semantic segmentation).

Key Performance Metrics

SPIQ consistently outperformed state-of-the-art data-free methods like DFQ and SQuant:

  • Inference Speed: SPIQ is significantly faster than dynamic methods, providing an inference speed boost of 13.6% to 20.2% depending on the architecture.
  • Classification Accuracy: On MobileNet V2 (6-bit), SPIQ achieved 63.24% accuracy, compared to just 45.84% for the standard DFQ method.
  • Segmentation and Detection: On CityScapes (4-bit), SPIQ improved the Mean Intersection over Union (mIoU) by 29.63% over baseline static methods. On Pascal VOC, it reached 37.88 mAP in 4-bit mode, nearly tripling the performance of standard static quantization (14.98 mAP).
SPIQ improvement over DFQ (static) across various architectures and bit-widths.

Discussion and Insights

A significant finding is that SPIQ sometimes outperforms dynamic quantization. This occurs because dynamic methods only observe one sample at a time, whereas SPIQ utilizes BN statistics that represent the entire training distribution, leading to a more robust model.

Compact models like MobileNet and EfficientNet, which are notoriously difficult to quantize due to their lean architecture, benefit most from SPIQ. This suggests that fine-grained, per-channel control is essential for quantizing efficient architectures without sacrificing performance.

Limitations and Future Work

Despite its success, SPIQ faces challenges at ultra-low bit-widths (e.g., 2-bit), where significant accuracy drops still occur. Future research may explore combining SPIQ with synthetic data generation techniques to refine scaling factors when BN statistics are missing. Additionally, incorporating a short fine-tuning phase with generated data could potentially close the remaining gap to full 32-bit floating-point accuracy.

Summary updated

BibTeX
@inproceedings{yvinec2023spiq,
  author = {Edouard Yvinec and Arnaud Dapogny and Matthieu Cord and Kevin Bailly},
  title = {{SPIQ: Data-Free Per-Channel Static Input Quantization}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  doi = {10.1109/wacv56688.2023.00386},
}
Figure