Training Quantized Neural Networks With a Full-Precision Auxiliary Module

Bohan Zhuang, Lingqiao Liu, Mingkui Tan, Chunhua Shen, Ian D. Reid

Abstract

Quantization is a critical technique for deploying deep neural networks on resource-constrained edge devices. However, training low-precision networks is challenging due to the non-differentiable nature of quantization functions, which hinders gradient-based optimization. We propose a training framework that incorporates a full-precision auxiliary module to serve as a "gradient bridge." By sharing weights with the quantized main network, the auxiliary module provides stable, high-quality gradient information during training. This auxiliary component is discarded at inference, ensuring no additional computational cost. Our method demonstrates significant accuracy gains across various architectures and quantization schemes on ImageNet and COCO datasets.

Introduction

Deep learning models often require significant computational resources, making deployment on edge devices like smartphones and IoT sensors difficult. Quantization—representing weights and activations with low-bitwidth integers (e.g., 2-bit or 4-bit)—is a primary solution to reduce memory footprint and latency. Despite its benefits, training quantized neural networks (QNNs) remains a major hurdle. The quantization function is a step function with zero derivatives almost everywhere, causing standard backpropagation to fail. While the Straight-Through Estimator (STE) provides a heuristic approximation, it often results in a substantial accuracy gap compared to full-precision counterparts.

Methodology

The proposed framework introduces a training-only architecture consisting of a Main Network ($F$) and an Auxiliary Module ($H$). The Main Network is the target low-precision model, while the Auxiliary Module is a full-precision sub-network that interfaces with intermediate layers of $F$.

Overview of the training stage (a) and inference stage (b).

The key mechanism is weight sharing: parameters of the low-precision blocks in $F$ are shared with the corresponding blocks in $H$. This dual-path architecture allows gradients to flow through both a "noisy" quantized route and a "clean" full-precision route. The shared weights are updated based on the combined gradient information, effectively stabilizing the learning process. To handle the distribution mismatch between quantized and full-precision features, $1 \times 1$ convolutional "Adaptors" are used to transform features before they enter the auxiliary module. After training, the auxiliary module is removed, leaving a high-performance quantized model for inference.

Experiments and Results

The effectiveness of the auxiliary module was validated on ImageNet (classification) and COCO (object detection).

Comparison of Top-1 and Top-5 accuracy for various ResNet models and quantization methods.

As shown in the results table, the auxiliary module consistently improves performance across different quantization methods, including uniform (DoReFa-Net), non-uniform (LQ-Net), and binary (BiReal-Net) schemes. Notably, for a 2-bit ResNet-101, the method achieved a Top-1 accuracy of 74.6%, a 3.8% improvement over the baseline. In object detection, a 4-bit RetinaNet achieved 36.1 AP on COCO, nearly matching the 36.5 AP of the full-precision model. The authors also observed that for complex tasks like detection, "un-sharing" prediction heads across different feature scales further enhanced accuracy, as quantized features at different scales are too distinct to be handled by a single shared head.

Conclusion

This work presents a simple yet effective strategy for training high-performance quantized neural networks. By leveraging a full-precision auxiliary module during training, the framework overcomes the optimization challenges inherent in low-precision networks. The approach is memory-efficient, facilitates faster convergence, and provides a "free" accuracy boost at runtime. Future work will focus on narrowing the performance gap for architectures without residual connections and optimizing parameter counts for detection models.

Summary updated

BibTeX
@inproceedings{zhuang2020training,
  author = {Bohan Zhuang and Lingqiao Liu and Mingkui Tan and Chunhua Shen and Ian D. Reid},
  title = {{Training Quantized Neural Networks With a Full-Precision Auxiliary Module}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00156},
}
Figure