Efficient Integer-Arithmetic-Only Convolutional Neural Networks

Hengrui Zhao, Dong Liu, Houqiang LiarXiv 2020 · arXiv

Abstract

Deploying deep learning models on resource-constrained edge devices requires balancing performance with computational efficiency. This paper introduces a framework for converting standard floating-point convolutional neural networks (CNNs) into integer-arithmetic-only versions without significant accuracy loss. By replacing standard ReLU with a tunable Bounded ReLU (BReLU) and implementing a "Ratio Synchronization" mechanism, the authors achieve 8-bit models that run 2x faster and use 1/4 the memory of their floating-point counterparts while maintaining near-identical performance across classification and regression tasks.

Introduction

While deep learning has revolutionized computer vision, deploying these models on edge devices like smartphones and IoT sensors remains challenging. Floating-point (FPN) arithmetic is power-hungry and lacks a universal standard, leading to inconsistent results across different hardware architectures. Integer-only networks offer a solution by being faster, smaller, and cross-platform consistent. However, traditional quantization—moving from 32-bit floats to 8-bit integers—often incurs a significant "accuracy tax." The authors identify activation quantization, specifically the unbounded nature of the standard ReLU function, as the primary source of this performance degradation.

Methods

The proposed framework bridges the gap between floating-point and integer-only networks through three main innovations:

Bounded ReLU (BReLU)

Unlike a standard ReLU, which is unbounded ($[0, \infty)$), BReLU introduces an upper bound ($h$). This restricts the dynamic range of activations, making it significantly easier to map them to a finite set of integers (e.g., 0-255 for 8-bit) without losing precision.

Adaptive Bound Selection

Setting the optimal upper bound $h$ is critical. The authors propose two strategies:

  1. $n-\sigma$ Rule: For deep networks, the bound is set based on the mean ($\mu$) and standard deviation ($\sigma$) of activations during training to clip extreme outliers.
  2. Geometric Progression: For shallow networks, bounds are set across layers using a mathematical progression to simplify training.

Ratio Synchronization

In complex architectures like ResNet, skip connections require adding tensors from different paths. If these paths have different quantization scales, direct integer addition is impossible. Ratio Synchronization rescales these paths using only integer shifts and multiplications, ensuring architectural compatibility.

Mapping between floating-point and integer-arithmetic-only convolutional layers.

Key Results

The researchers evaluated their method on ImageNet classification and high-precision regression tasks like image super-resolution.

Accuracy Parity

On ImageNet, the 8-bit ResNet152 achieved 78.01% Top-1 accuracy, nearly matching the 78.31% of the original floating-point model. As shown in the table below, this method significantly outperforms existing solutions like NVIDIA’s TensorRT and other state-of-the-art quantization techniques.

Comparison of accuracy across different quantization methods on ImageNet.

Efficiency and Regression

The integer models required only 1/4 of the memory footprint and ran 2x faster on modern GPUs. Furthermore, the framework proved effective for regression tasks; for super-resolution (VDSR), the integer model maintained a PSNR within 0.02 dB of the floating-point version, demonstrating that integer-only networks can handle tasks sensitive to quantization noise.

Conclusion

This work demonstrates that integer-arithmetic-only CNNs can achieve accuracy parity with floating-point models while providing substantial gains in speed and memory efficiency. By addressing the activation bottleneck through BReLU and Ratio Synchronization, the proposed method enables the deployment of high-performance deep learning models on a wider range of edge hardware. Future work will explore adapting these techniques for non-ReLU activation functions and layer-specific clipping strategies.

Summary updated

Abstract

Integer-arithmetic-only networks have been demonstrated effective to reduce computational cost and to ensure cross-platform consistency. However, previous works usually report a decline in the inference accuracy when converting well-trained floating-point-number (FPN) networks into integer networks. We analyze this phonomenon and find that the decline is due to activation quantization. Specifically, when we replace conventional ReLU with Bounded ReLU, how to set the bound for each neuron is a key problem. Considering the tradeoff between activation quantization error and network learning ability, we set an empirical rule to tune the bound of each Bounded ReLU. We also design a mechanism to handle the cases of feature map addition and feature map concatenation. Based on the proposed method, our trained 8-bit integer ResNet outperforms the 8-bit networks of Google's TensorFlow and NVIDIA's TensorRT for image recognition. We also experiment on VDSR for image super-resolution and on VRCNN for compression artifact reduction, both of which serve for regression tasks that natively require high inference accuracy. Our integer networks achieve equivalent performance as the corresponding FPN networks, but have only 1/4 memory cost and run 2x faster on modern GPUs. Our code and models can be found at github.com/HengRuiZ/brelu.
BibTeX
@misc{zhao2020efficient,
  author = {Hengrui Zhao and Dong Liu and Houqiang Li},
  title = {{Efficient Integer-Arithmetic-Only Convolutional Neural Networks}},
  year = {2020},
  eprint = {2006.11735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.11735},
}
Figure