[论文解读] Fighting Quantization Bias With Bias
本文将低精度量化中轻量级DNN(如MobileNet)性能下降的主要原因归因于均值激活偏移(MAS),尤其在参数较少的小层结构中,由于量化误差分布不均所致。本文提出两种高效的推理后方法——迭代偏差校正(IBC)与偏差微调(BFT),通过调整通道级偏差项来补偿MAS,实现接近量化感知训练的精度,且仅需极少数据与计算资源,在MobileNet-v1/v2上实现1%的性能下降,成本仅为现有SOTA方法的一小部分。
Low-precision representation of deep neural networks (DNNs) is critical for efficient deployment of deep learning application on embedded platforms, however, converting the network to low precision degrades its performance. Crucially, networks that are designed for embedded applications usually suffer from increased degradation since they have less redundancy. This is most evident for the ubiquitous MobileNet architecture which requires a costly quantization-aware training cycle to achieve acceptable performance when quantized to 8-bits. In this paper, we trace the source of the degradation in MobileNets to a shift in the mean activation value. This shift is caused by an inherent bias in the quantization process which builds up across layers, shifting all network statistics away from the learned distribution. We show that this phenomenon happens in other architectures as well. We propose a simple remedy - compensating for the quantization induced shift by adding a constant to the additive bias term of each channel. We develop two simple methods for estimating the correction constants - one using iterative evaluation of the quantized network and one where the constants are set using a short training phase. Both methods are fast and require only a small amount of unlabeled data, making them appealing for rapid deployment of neural networks. Using the above methods we are able to match the performance of training-based quantization of MobileNets at a fraction of the cost.
研究动机与目标
- 识别轻量级DNN(尤其是MobileNet)在低精度量化中性能下降的根本原因。
- 探究为何具有小层结构(如深度可分离卷积)的网络架构会遭受更严重的量化误差。
- 开发一种无需完整微调或原始数据集访问的推理后方法,以校正均值激活偏移(MAS)。
- 评估通过调整偏差项来补偿MAS在多种架构中减少量化导致性能下降的有效性。
- 为边缘部署提供一种快速、数据高效、替代量化感知训练的方法。
提出的方法
- 本文识别出均值激活偏移(MAS)是由于非均匀、不平衡的量化舍入误差所致,尤其在参数较少的层(如深度可分离卷积)中更为显著。
- 通过在每个通道的加法偏差项中添加一个常数校正项来补偿MAS,利用偏差项的可加性,将激活分布重新拉回学习到的统计特性。
- 提出两种方法:迭代偏差校正(IBC),通过在少量未标注测试图像上进行推理来估计校正常数;偏差微调(BFT),对仅偏差参数进行短时梯度微调。
- IBC通过比较全精度网络与量化网络在后激活层的均值来计算校正值,而BFT则使用标准优化器并配合学习率调度,在1K张未标注图像上进行微调。
- 两种方法均在标准8位整数量化方案下应用,且融合批归一化,确保硬件兼容性。
- 该方法在ImageNet预训练模型(包括MobileNet-v1、MobileNet-v2和Inception-v1)上进行评估,采用与先前SOTA工作一致的8位量化设置。
实验结果
研究问题
- RQ1轻量级DNN(如MobileNet)在低精度量化中为何出现显著性能下降?
- RQ2为何具有小层组件(如深度可分离卷积)的架构比其他结构更容易遭受量化误差?
- RQ3均值激活偏移(MAS)是否可归因于不平衡的量化舍入误差?它是否是低精度推理中主要的误差来源?
- RQ4仅通过修改网络层的偏差项,能否有效补偿MAS?
- RQ5推理后偏差校正方法是否能在极低数据与计算量下实现与量化感知训练相当的性能?
主要发现
- 本文识别出均值激活偏移(MAS)是8位量化MobileNet-v1与v2性能下降的主要原因,源于小层组件中非均匀的量化误差。
- 迭代偏差校正(IBC)在MobileNet-v1上将性能下降降至1.0%,在MobileNet-v2上为1.1%,与完整量化感知训练性能相当。
- 偏差微调(BFT)在MobileNet-v1上实现1.0%的性能下降,在MobileNet-v2上为1.2%,与现有SOTA全量化感知训练结果相当。
- 将BFT与通道均衡化(ChannelEqualization)结合后,MobileNet-v2的准确率分别提升至71.1%(v2-1.0)和74.3%(v2-1.4),达到当前量化模型的SOTA性能。
- IBC仅需8张未标注图像,耗时2–3分钟;BFT使用1K张图像,单张GPU上耗时约20分钟,两者均远快于完整的量化感知训练,且资源消耗极低。
- 该方法在多种架构上均表现稳健,在Inception-v1上也展现出相似的性能提升,证实MAS是一种普遍现象,不仅限于MobileNet。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。