arXiv(opens in a new tab)Computer ScienceJul 2017Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:1707.06168

Channel Pruning for Accelerating Very Deep Neural Networks

Yihui He, Xiangyu Zhang, Jian Sun

Abstract

In this paper, we introduce a new channel pruning method to accelerate very deep convolutional neural networks. Given a trained CNN model, we propose an iterative two-step algorithm to effectively prune each layer, by a LASSO regression based channel selection and least square reconstruction. We further generalize this algorithm to multi-layer and multi-branch cases. Our method reduces the accumulated error and enhance the compatibility with various architectures. Our pruned VGG-16 achieves the state-of-the-art results by 5×5\times speed-up along with only 0.3% increase of error. More importantly, our method is able to accelerate modern networks like ResNet, Xception and suffers only 1.4%, 1.0% accuracy loss under 2×2\times speed-up respectively, which is significant. Code has been made publicly available.

1 Introduction

Recent CNN acceleration works fall into three categories: optimized implementation (e.g., FFT [48]), quantization (e.g., BinaryNet [8]), and structured simplification that convert a CNN into compact one [22]. This work focuses on the last one.

Figure 1: Structured simplification methods that accelerate CNNs: (a) a network with 3 conv layers. (b) sparse connection deactivates some connections between channels. (c) tensor factorization factorizes a convolutional layer into several pieces. (d) channel pruning reduces number of channels in each layer (focus of this paper).

Structured simplification mainly involves: tensor factorization [22], sparse connection [17], and channel pruning [49]. Tensor factorization factorizes a convolutional layer into several efficient ones (Fig. 1(c)). However, feature map width (number of channels) could not be reduced, which makes it difficult to decompose 1×11\times 1 convolutional layer favored by modern networks (e.g., GoogleNet [46], ResNet [18], Xception [7]). This type of method also introduces extra computation overhead. Sparse connection deactivates connections between neurons or channels (Fig. 1(b)). Though it is able to achieves high theoretical , the sparse convolutional layers have an ”irregular” shape which is not implementation friendly. In contrast, channel pruning directly reduces feature map width, which shrinks a network into thinner one, as shown in Fig. 1(d). It is efficient on both CPU and GPU because no special implementation is required.

Pruning channels is simple but challenging because removing channels in one layer might dramatically change the input of the following layer. Recently, training-based channel pruning works [1, 49] have focused on imposing sparse constrain on weights during training, which could adaptively determine hyper-parameters. However, training from scratch is very costly and results for very deep CNNs on ImageNet have been rarely reported. Inference-time attempts [31, 3] have focused on analysis of the importance of individual weight. The reported is very limited.

Figure 2: Channel pruning for accelerating a convolutional layer. We aim to reduce the number of channels of feature map B, while minimizing the reconstruction error on feature map C. Our optimization algorithm (Sec. 3.1) performs within the dotted box, which does not involve nonlinearity. This figure illustrates the situation that two channels are pruned for feature map B. Thus corresponding channels of filters W\mathrm{W} can be removed. Furthermore, even though not directly optimized by our algorithm, the corresponding filters in the previous layer can also be removed (marked by dotted filters). c,nc,n: number of channels for feature maps B and C, kh×kwk_{h}\times k_{w}: kernel size.

In this paper, we propose a new inference-time approach for channel pruning, utilizing redundancy inter channels. Inspired by tensor factorization improvement by feature maps reconstruction [53], instead of analyzing filter weights [22, 31], we fully exploits redundancy inter feature maps. Specifically, given a trained CNN model, pruning each layer is achieved by minimizing reconstruction error on its output feature maps, as showned in Fig. 2. We solve this minimization problem by two alternative steps: channels selection and feature map reconstruction. In one step, we figure out the most representative channels, and prune redundant ones, based on LASSO regression. In the other step, we reconstruct the outputs with remaining channels with linear least squares. We alternatively take two steps. Further, we approximate the network layer-by-layer, with accumulated error accounted. We also discuss methodologies to prune multi-branch networks (e.g., ResNet [18], Xception [7]).

For VGG-16, we achieve 4×4\times acceleration, with only 1.0% increase of top-5 error. Combined with tensor factorization, we reach 5×5\times acceleration but merely suffer 0.3% increase of error, which outperforms previous state-of-the-arts. We further speed up ResNet-50 and Xception-50 by 2×2\times with only 1.4%, 1.0% accuracy loss respectively.

References (50)