用于提升量化深度神经网络微调性能的滤波器预剪枝
Filter Pre-Pruning for Improved Fine-tuning of Quantized Deep Neural Networks
Filter Pre-Pruning for Improved Fine-tuning of Quantized Deep Neural Networks
@misc{nishikawa2020filter,
title = {Filter Pre-Pruning for Improved Fine-tuning of Quantized Deep Neural Networks},
author = {Jun Nishikawa and Ryoji Ikegaya},
year = {2020},
eprint = {2011.06751},
archivePrefix = {arXiv},
primaryClass = {cs.CV},
url = {https://arxiv.org/abs/2011.06751}
}
Nishikawa, J., & Ikegaya, R. (2020). Filter Pre-Pruning for Improved Fine-tuning of Quantized Deep Neural Networks [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2011.06751
NISHIKAWA J, IKEGAYA R. Filter Pre-Pruning for Improved Fine-tuning of Quantized Deep Neural Networks[EB/OL]. (2020-11-13)[2026-11-29]. https://arxiv.org/abs/2011.06751.
摘要
深度神经网络(DNN)包含大量参数和激活数据,其实现成本高昂。一种减小 DNN 规模的方法是通过对预训练模型进行量化,使用低比特表示权重和激活值,并通过微调恢复精度损失。然而,训练使用低比特表示的神经网络通常十分困难。其中一个原因是,DNN 中间层的权重具有较宽的动态范围,当将宽动态范围量化为少数比特时,步长变大,导致较大的量化误差,进而引起精度显著下降。为了解决这一问题,本文在不使用任何额外学习参数或超参数的情况下,提出了以下三项贡献:首先,我们分析了批归一化(batch normalization)如何干扰量化 DNN 的微调过程,从而引发上述问题。其次,基于这些分析,我们提出了一种名为量化剪枝(Pruning for Quantization, PfQ)的新剪枝方法,该方法在尽可能不影响推理结果的前提下,移除干扰 DNN 微调的滤波器。第三,我们提出了一种基于所提剪枝方法(PfQ)的量化 DNN 微调工作流程。在知名模型和数据集上的实验表明,与包括微调在内的传统量化方法相比,所提方法在相似模型规模下实现了更高的性能。
Deep Neural Networks(DNNs) have many parameters and activation data, and these both are expensive to implement. One method to reduce the size of the DNN is to quantize the pre-trained model by using a low-bit expression for weights and activations, using fine-tuning to recover the drop in accuracy. However, it is generally difficult to train neural networks which use low-bit expressions. One reason is that the weights in the middle layer of the DNN have a wide dynamic range and so when quantizing the wide dynamic range into a few bits, the step size becomes large, which leads to a large quantization error and finally a large degradation in accuracy. To solve this problem, this paper makes the following three contributions without using any additional learning parameters and hyper-parameters. First, we analyze how batch normalization, which causes the aforementioned problem, disturbs the fine-tuning of the quantized DNN. Second, based on these results, we propose a new pruning method called Pruning for Quantization (PfQ) which removes the filters that disturb the fine-tuning of the DNN while not affecting the inferred result as far as possible. Third, we propose a workflow of fine-tuning for quantized DNNs using the proposed pruning method(PfQ). Experiments using well-known models and datasets confirmed that the proposed method achieves higher performance with a similar model size than conventional quantization methods including fine-tuning.