SPIQ: Data-Free Per-Channel Static Input Quantization

Edouard Yvinec, Arnaud Dapogny, Matthieu Cord, Kevin Bailly · DOI

Introduction

Deep Neural Networks (DNNs) are increasingly deployed on edge devices with limited computational resources. Quantization, the process of mapping high-precision floating-point values to lower-precision integers (e.g., 8-bit or 4-bit), is essential for reducing model size and latency. However, two significant challenges persist: the need for original training data for calibration (often restricted by privacy) and the trade-off between speed and accuracy.

Static quantization is computationally efficient but often inaccurate for compact models like MobileNet, as it uses a single scaling factor for entire tensors. Dynamic quantization offers higher accuracy by calculating scales on-the-fly but introduces significant inference-time overhead. SPIQ (Static Per-channel Input Quantization) addresses these issues by achieving dynamic-level accuracy at static speeds without requiring training data.

Methodology: Per-Channel Static Input Quantization

The core innovation of SPIQ is the use of per-channel scaling factors for inputs, which are then "folded" into the network's weights. This approach captures the diverse distributions of different input channels without adding runtime complexity.

  1. Range Estimation: In the absence of training data, SPIQ utilizes pre-trained Batch Normalization (BN) parameters (mean and variance) to estimate the range of each input channel.
  2. Scale Folding: To avoid the dimensional mismatch that typically prevents per-channel input scaling in standard matrix multiplications, SPIQ pre-multiplies the weights ($W$) by the inverse of the input channel scales.
  3. Inference Efficiency: The input is scaled per-channel prior to quantization, and the corresponding "un-scaling" is implicitly handled during weight multiplication. This allows for a granular quantization grid with zero additional inference operations.

Experimental Setup

SPIQ was evaluated across ImageNet classification, Pascal VOC 2012 object detection, and CityScapes semantic segmentation. The study included diverse architectures: heavy models like ResNet-50 and DenseNet-121, and efficient models like MobileNet V2 and EfficientNet B0.

Results and Analysis

SPIQ consistently outperforms existing data-free quantization methods, particularly at lower bit-widths where standard static methods often fail.

Comparison of SPIQ vs. DFQ across various models and bit-widths.

As shown in the figure above, SPIQ maintains high accuracy even at 4-bit and 6-bit quantization, where the DFQ baseline shows significant degradation. Specifically, for ResNet-50 at 4-bit, SPIQ achieves 69.70% top-1 accuracy, while DFQ collapses to near zero.

Accuracy vs. input/activation quantization bit-width for different architectures.

The performance of SPIQ closely tracks or even exceeds that of dynamic quantization across all tested models. Furthermore, SPIQ is 13.6% to 20.2% faster than dynamic methods due to its static nature. A key insight is that input quantization is the primary bottleneck for compact models; by addressing this with per-channel scaling, SPIQ preserves critical spatial details that are often lost in "blunter" quantization schemes.

Conclusion and Future Work

SPIQ bridges the gap between static and dynamic quantization in a data-free setting. While highly effective at 4-bit and 8-bit, ultra-low bit-widths (1-bit or 2-bit) remain a challenge. Future research may explore combining SPIQ with synthetic data generation to further refine scale estimation for complex layers.

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