FILTER PRE-PRUNING FOR IMPROVED FINE-TUNING OF QUANTIZED DEEP NEURAL NETWORKS

Abstract

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 hyperparameters. 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.

1. INTRODUCTION

DNNs (Deep Neural Networks) greatly contribute to performance improvement in various tasks and their implementation in edge devices is required. On the other hand, a typical DNN (He et al., 2015; Simonyan & Zisserman, 2015) has the problem that the implementation cost is very large, and it is difficult to operate it on an edge device with limited resources. One approach to this problem is to reduce the implementation cost by quantizing the activations and weights in the DNN. Quantizing a DNN using extremely low bits, such as 1 or 2 bits has been studied by Courbariaux et al. (2015) and Gu et al. (2019) . However, it is known that while such a bit reduction has been performed for a large model such as ResNet (He et al., 2015) , it has not yet been performed for a small model such as MobileNet (Howard et al., 2017; Sandler et al., 2018; Howard et al., 2019) , and is very difficult to apply to this case. For models that are difficult to quantize, special processing for the DNN is required before quantization. On the other hand, although fine-tuning is essential for quantization with extremely low bit representation, few studies have been conducted on pre-processing for easy fine-tuning of quantized DNNs. In particular, it has been experimentally shown from previous works (Lan et al., 2019; Frankle & Carbin, 2018) that, regardless of quantization, some weights are unnecessary for learning or in fact disturb the learning process. Therefore, we focused on the possibility of the existence of weights that specially disturb the finetuning quantized DNN and to improve the performance of the quantized DNN after fine-tuning by removing those weights. Figure 1 : This is a diagram of the proposed pruning method PfQ. As mentioned in subsection 3.1, the filters with a very small running variance can approximate its output by β i . At this time, by pruning the filters and correcting the bias of the next convolution using β i as described above, the DNN can be pruned without affecting the output as far as possible.

2.1. CONVENTIONAL QUANTIZATION WORKS

In order to reduce the implementation cost of DNN in hardware, many methods of reduction by pruning (Molchanov et al., 2019; You et al., 2019; He et al., 2019) and quantization (Gu et al., 2019; Gong et al., 2020; Fan et al., 2020; Uhlich et al., 2019; Sheng et al., 2018; Nagel et al., 2019) have been studied. Research is also underway in network architectures such as depthwise convolution and pointwise convolution (Howard et al., 2017) , which are arithmetic modules that maintain high performance even when both the number of operations and the model capacity are kept small (Howard et al., 2017; Sandler et al., 2018; Howard et al., 2019) . Knowledge Transfer (Hinton et al., 2015; Zagoruyko & Komodakis, 2016; Radosavovic et al., 2018; Chen et al., 2019) is also being studied as a special learning method for achieving high performance in these compression technologies and compressed architectures. There have been various approaches to studies in DNN compression using quantization. DNN quantization is usually done for activations and weights in DNN. As a basic approach to quantization, there are some methods for a pre-trained model of which one uses only quantization (Sheng et al., 2018; Nagel et al., 2019) and another uses fine-tuning (Gong et al., 2019; Gu et al., 2019; Jung et al., 2019; Uhlich et al., 2019; Gong et al., 2020; Fan et al., 2020) . Cardinaux et al. (2020) and Han et al. (2015) propose a method for expressing values that are as precise as possible. However, the simplest expression method is easier to calculate and implement in hardware, so expressions to divide the range of quantized values by a linear value (Jacob et al., 2018; Sheng et al., 2018; Nagel et al., 2019; Gu et al., 2019; Gong et al., 2019; 2020; Jung et al., 2019) or a power of 2 value (Lee et al., 2017; Li et al., 2019) are widely used at present in quantization research. It is known that fine-tuning is essential to quantize DNN with low bits in order not to decrease accuracy as much as possible. Jacob et al. (2018) shows that an accuracy improvement can be expected by fine-tuning with quantization. Since the quantization function is usually non-differentiable, the gradient in the quantization function is often approximated by STE (Bengio et al., 2013) . However, in the case of quantization with low bits, the error is very large in the approximation by STE, and it is known that it is difficult to accurately propagate the gradient backward from the output side to the input side, making learning difficult. In order to solve this problem, Gong et al. ( 2019 



), Fan et al. (2020) and Darabi et al. (2018) proposed the backward quantization function so that the gradient can be propagated to the input side as accurately as possible. Gu et al. (2019) and Banner et al. (2018) considered activations and weights in DNN as random variables, and proposed an approach to optimize the stochastic model behind DNN so that activations and weights in DNN become vectors which are easy to quantize. Jung et al. (2019) and Uhlich et al. (2019) considered that it is important

