高效的纯整数运算卷积神经网络
Efficient Integer-Arithmetic-Only Convolutional Neural Networks
摘要:
仅整数算术网络已被证明可以有效降低计算成本并确保跨平台一致性。然而,以前的作品通常报告的推理精度下降时,转换训练良好的浮点数(FPN)网络到整数网络。我们分析了这一现象,发现下降是由于激活量子化。具体来说,当我们用Bounded ReLU替换传统ReLU时,如何为每个神经元设置边界是一个关键问题。考虑到激活量化误差和网络学习能力之间的权衡,我们设置了一个经验规则来调整每个Bounded ReLU的边界。我们还设计了一个机制来处理的情况下,功能地图添加和功能地图连接。基于所提出的方法,我们训练的8位整数ResNet在图像识别方面优于Google的TensorFlow和NVIDIA的TensorRT的8位网络。我们还在VDSR上进行了图像超分辨率的实验,在VRCNN上进行了压缩伪影减少的实验,这两种方法都适用于本来就需要高推理精度的回归任务。我们的整数网络实现了与相应的FPN网络相当的性能,但只有1/4的内存成本,并且在现代GPU上运行速度快2倍。我们的代码和模型可以在github.com/HengRuiZ/brelu上找到。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。