Quantization Networks

Jiwei Yang, Xu Shen, Jun Xing, Xinmei Tian, Houqiang Li, Bing Deng, Jianqiang Huang, Xiansheng Hua · DOI

Abstract

Quantization is a critical technique for deploying deep neural networks (DNNs) on resource-constrained edge devices. However, traditional quantization methods often suffer from "gradient mismatch" due to the non-differentiable nature of discrete step functions. This paper introduces Quantization Networks, a framework that reformulates low-bit quantization as a learnable, differentiable non-linear activation function. By approximating discrete levels with a sum of Sigmoid functions and employing a temperature annealing strategy, the proposed method enables end-to-end training. Experimental results on ImageNet and Pascal VOC demonstrate that Quantization Networks achieve state-of-the-art performance, often matching or exceeding full-precision baselines at ultra-low bitwidths.

Introduction

Deep Neural Networks (DNNs) have achieved remarkable success across various domains but remain computationally expensive and memory-intensive. Quantization—reducing the precision of weights and activations from 32-bit floating point to low-bit integers (e.g., 1, 2, or 4 bits)—is a primary strategy to mitigate these costs.

Standard quantization typically employs hard staircase functions. Mathematically, these functions have a derivative of zero almost everywhere, which prevents effective backpropagation. While techniques like the Straight-Through Estimator (STE) provide a workaround, they introduce a significant gradient mismatch: the network is optimized using a continuous approximation but performs inference using discrete steps. This discrepancy leads to training instability and accuracy degradation, particularly as bitwidths decrease.

Methodology

Quantization as a Learnable Activation

The core innovation of this work is the conceptual shift of treating quantization as a learnable non-linear mapping, similar to standard activations like ReLU or Sigmoid. Instead of a hard step function, the authors construct a "soft" quantization function using a linear combination of Sigmoid functions.

Comparison of standard activation functions with the proposed learnable quantization function.

Because these Sigmoids are differentiable, the network can use standard gradient descent to learn optimal scales and biases for the quantization levels. This approach allows the quantization parameters to be optimized specifically for each layer's weight and activation distribution.

Temperature Annealing Strategy

To bridge the gap between the smooth training function and the discrete inference function, the authors introduce a temperature parameter ($T$). During the initial phases of training, $T$ is kept low to ensure the function is smooth and easy to optimize. As training progresses, $T$ is gradually increased, causing the Sigmoids to sharpen into step functions.

The evolution of the quantization function from a smooth approximation to a discrete step function via temperature annealing.

By the end of the training process, the function effectively becomes a discrete staircase, ensuring that the model used for inference perfectly matches the model learned during the final stages of training.

Initialization and Non-Uniformity

Recognizing that weight distributions in DNNs are typically Gaussian rather than uniform, the framework utilizes K-means clustering on pre-trained weights to initialize quantization levels. This enables non-uniform quantization, where more steps are allocated to regions with higher data density (e.g., near zero), preserving more information than standard linear spacing.

Experimental Results

Performance on ImageNet

The researchers evaluated Quantization Networks on the ImageNet (ILSVRC 2012) benchmark across several architectures:

  • ResNet-18: A 3-bit quantized model achieved 70.4% Top-1 accuracy, slightly surpassing the 32-bit full-precision baseline of 70.3%. This suggests that the learned quantization may provide a beneficial regularizing effect.
  • AlexNet: In a 2-bit weight/activation configuration, the method achieved 60.9% accuracy, outperforming other state-of-the-art methods like LQ-Net (60.5%).

Efficiency and Generalization

Hardware evaluation on a VU9P FPGA demonstrated that a 1-bit (binary) version of the network provides a 45x speedup and a 32x reduction in memory footprint. Furthermore, the method generalized well to object detection tasks; quantizing the backbone of an SSD detector on Pascal VOC resulted in minimal loss to mean Average Precision (mAP).

Conclusion

Quantization Networks resolve the long-standing gradient mismatch problem by treating quantization as a differentiable activation function. By combining soft Sigmoid approximations with temperature annealing and non-uniform initialization, the framework provides a robust path toward deploying high-performance, low-bit neural networks on edge hardware. Future work may involve reducing the dependency on pre-trained models and simplifying the multi-phase training process.

Summary updated

BibTeX
@inproceedings{yang2019quantization,
  author = {Jiwei Yang and Xu Shen and Jun Xing and Xinmei Tian and Houqiang Li and Bing Deng and Jianqiang Huang and Xiansheng Hua},
  title = {{Quantization Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00748},
}
Figure