Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2019, Vol. 53 Issue (10): 1994-2002    DOI: 10.3785/j.issn.1008-973X.2019.10.017
Automation Technology, Computer Technology     
Convolutional neural network acceleration algorithm based on filters pruning
Hao LI(),Wen-jie ZHAO*(),Bo HAN
College of Aeronautics and Astronautics, Zhejiang University, Hangzhou 310027, China
Download: HTML     PDF(2004KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

A new model acceleration algorithm of convolutional neural network (CNN) was proposed based on filters pruning in order to promote the compression and acceleration of the CNN model. The computational cost could be effectively reduced by calculating the standard deviation of filters in the convolutional layer to measure its importance and pruning filters with less influence on the accuracy of the neural network and its corresponding feature map. The algorithm did not cause the network to be sparsely connected unlike the method of pruning weight value, so there was no need of the support of special sparse convolution libraries. The experimental results based on the CIFAR-10 dataset show that the filters pruning algorithm can accelerate the VGG-16 and ResNet-110 models by more than 30%. Results can be close to or reach the accuracy of the original model by fine-tuning the inherited pre-training parameters.



Key wordsdeep learning      convolutional neural network (CNN)      model compress      filter      feature map     
Received: 05 December 2018      Published: 30 September 2019
CLC:  TP 183  
Corresponding Authors: Wen-jie ZHAO     E-mail: lhmzl2012@163.com;zhaowenjie8@zju.edu.cn
Cite this article:

Hao LI,Wen-jie ZHAO,Bo HAN. Convolutional neural network acceleration algorithm based on filters pruning. Journal of ZheJiang University (Engineering Science), 2019, 53(10): 1994-2002.

URL:

http://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2019.10.017     OR     http://www.zjujournals.com/eng/Y2019/V53/I10/1994


基于滤波器裁剪的卷积神经网络加速算法

针对卷积神经网络(CNN)模型的压缩和加速问题,提出基于滤波器裁剪的新型卷积神经网络模型加速算法. 通过计算卷积层中滤波器的标准差值衡量该滤波器的重要程度,裁剪对神经网络准确率影响较小的滤波器及对应的特征图,可以有效地降低计算成本. 与裁剪权重不同,该算法不会导致网络稀疏连接,不需要应用特殊的稀疏矩阵计算库. 基于CIFAR-10数据集的实验结果表明,该滤波器裁剪算法能够对VGG-16和ResNet-110模型加速30%以上,通过微调继承的预训练参数可以使结果接近或达到原始模型的精度.


关键词: 深度学习,  卷积神经网络(CNN),  模型压缩,  滤波器,  特征图 
Fig.1 Pruning filters results in removal of their corresponding feature maps and related kernels in next layer
Fig.2 Pruning of ResNet model
Fig.3 Extraction of image features using traditional methods
Fig.4 Visualization feature maps of convolutional layer of pre-training model VGG-16 on ImageNet dataset
Fig.5 Pruning of pre-training model VGG-16 on CIFAR-10 dataset
卷积层 Fb/106 Fa/106 ΔF/%
conv 1_1 1.8 0.9 50
conv 1_2 38 19 50
conv 2_1 19 14.25 25
conv 2_2 38 28.5 25
conv 3_1 19 14.25 25
conv 3_2 38 28.5 25
conv 3_3 38 38 0
conv 4_1 19 9.5 50
conv 4_2 38 9.5 75
conv 4_3 38 9.5 75
conv 5_1 9.4 2.35 75
conv 5_2 9.4 2.35 75
conv 5_3 9.4 2.35 75
FC6 0.26 0.13 50
FC7 5.1×10?3 5.1×10?3 0
总量 315 179 43.2
Tab.1 Pruning of pre-training model VGG-16 on CIFAR-10 dataset
模型 y/% Fw/106 ΔF/% M/106 ΔM/%
VGG-16 93.33 313 ? 15 ?
VGG-16-A 93.47 179 43.2 5.4 64
ResNet-56 93.11 127 ? 0.85 ?
ResNet-
56-A
93.07 112 11.8 0.77 9.4
ResNet-
56-B
93.03 92.3 27.3 0.72 15.3
ResNet-110 93.62 256 ? 1.73 ?
ResNet-110-A 93.67 213 16.8 1.68 2.9
ResNet-110-B 93.48 155 39.5 1.14 34.1
ResNet-34 73.29 3 640 ? 21.6 ?
ResNet-
34-A
72.61 3 080 15.5 19.9 7.9
ResNet-
34-B
72.31 2 760 24.2 19.3 10.6
Tab.2 Results of pruning and retraining models
Fig.6 Pruning sensitivity of each convolution layer of ResNet-56/110 model
Fig.7 Pruning sensitivity of each convolution layer of ResNet-34 model
%
裁剪算法 微调 随机初值训练 多次迭代训练
m=20 m=40 m=60 m=20 m=40 m=60 m=20 m=40 m=60
标准差 72.37 64.85 53.36 72.41 64.93 53.31 72.65 65.16 54.45
APoZ 71.14 62.82 52.63 71.11 63.12 52.67 71.39 63.31 53.44
L1范数 72.28 64.77 53.35 72.33 64.76 53.39 72.47 64.81 53.56
Random 71.45 63.34 51.92 71.49 63.40 52.01 71.67 63.82 52.76
Mean Activation 71.62 63.42 51.39 71.61 63.59 51.41 71.83 63.71 52.13
Tab.3 Accuracy comparison of different pruning methods
[1]   KRIZHEVSKY A, SUTSKEVER I, HINTON G E. ImageNet classification with deep convolutional neural networks [C] // International Conference on Neural Information Processing Systems. Lake Tahoe: Curran Associates Inc., 2012.
[2]   GRAVES A, SCHMIDHUBER J Framewise phoneme classification with bidirectional LSTM and other neural network architectures[J]. Neural Netw, 2005, 18 (5): 602- 610
[3]   SZEGEDY C, VANHOUCKE V, IOFFE S, et al. Rethinking the inception architecture for computer vision [C] // International Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 2818-2826.
[4]   DENIL M, SHAKIBI B, DINH L, et al. Predicting parameters in deep learning [C] // Advances in Neural Information Processing Systems. Lake Tahoe: MIT, 2013: 2148-2156.
[5]   SRINIVAS S, BABU R V. Data-free parameter pruning for deep neural networks [EB/OL]. [2018-09-06]. http://arxiv.org/abs/1507.06149.
[6]   HAN S, POOL J, TRAN J, et al. Learning both weights and connections for efficient neural network [C] // Advances in Neural Information Processing Systems. Montreal: MIT, 2015: 1135-1143.
[7]   MARIET Z, SRA S. Diversity networks: neural network compression using determinantal point processes [EB/OL]. [2018-05-13]. http://arxiv.org/abs/1511.05077.
[8]   HAN S, MAO H, DALLY W J. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding [EB/OL]. [2018-08-09]. http://arxiv.org/abs/1510.00149.
[9]   SIMONYAN K, ZISSERMAN A. Very deep convolutional networks for large-scale image recognition [EB/OL]. [2018-07-22]. http://arxiv.org/abs/1409.1556.
[10]   IANDOLA F N, HAN S, MOSKEWICZ M W, et al. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and < 0.5 mb model size [EB/OL]. [2018-07-14]. http://arxiv.org/abs/1602.07360.
[11]   HAN S, LIU X, MAO H, et al EIE: efficient inference engine on compressed deep neural network[J]. ACM Sigarch Computer Architecture News, 2016, 44 (3): 243- 254
doi: 10.1145/3007787.3001163
[12]   MATHIEU M, HENAFF M, LECUN Y. Fast training of convolutional networks through FFTs [EB/OL]. [2018-09-03]. http://arxiv.org/abs/1312.5851.
[13]   RASTEGARI M, ORDONEZ V, REDMON J, et al. XNOR-Net: ImageNet classification using binary convolutional neural networks [C] // European Conference on Computer Vision. Cham: Springer, 2016: 525-542.
[14]   WEN W, WU C, WANG Y, et al. Learning structured sparsity in deep neural networks [C] // Advances in Neural Information Processing Systems. Barcelona: MIT, 2016: 2074-2082.
[15]   LI H, KADAV A, DURDANOVIC I, et al. Pruning filters for efficient convents [EB/OL]. [2018-09-11]. http://arxiv.org/abs/1608.08710.
[16]   MITTAL D, BHARDWAJ S, KHAPRA M M, et al. Recovering from random pruning: on the plasticity of deep convolutional neural networks [EB/OL]. [2018-09-12]. http://arxiv.org/abs/1801.10447.
[17]   ZHU M, GUPTA S. To prune, or not to prune: exploring the efficacy of pruning for model compression [EB/OL]. [2018-06-23]. http://arxiv.org/abs/1710.01878.
[18]   HE K, ZHANG X, REN S, et al. Deep residual learning for image recognition [C] // Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 770-778.
[19]   ZAGORUYKO S. 92.45% on CIFAR-10 in Torch[EB/OL].[2018-07-30]. http://torch.ch/blog/2015/07/30/cifar.html.
[20]   IOFFE S, SZEGEDY C. Batch normalization: accelerating deep network training by reducing internal covariate shift [EB/OL]. [2018-07-16]. http://arxiv.org/abs/1502.03167.
[21]   HU H, PENG R, TAI Y W, et al. Network trimming: a data-driven neuron pruning approach towards efficient deep architectures [EB/OL]. [2018-07-19]. http://arxiv.org/abs/1607.03250.
[1] Jia-hui XU,Jing-chang WANG,Ling CHEN,Yong WU. Surface water quality prediction model based on graph neural network[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(4): 601-607.
[2] Hong-li WANG,Bin GUO,Si-cong LIU,Jia-qi LIU,Yun-gang WU,Zhi-wen YU. End context-adaptative deep sensing model with edge-end collaboration[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(4): 626-638.
[3] Teng ZHANG,Xin-long JIANG,Yi-qiang CHEN,Qian CHEN,Tao-mian MI,Piu CHAN. Wrist attitude-based Parkinson's disease ON/OFF state assessment after medication[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(4): 639-647.
[4] Hong-hui WANG,Xin FANG,De-jiang LI,Gui-jie LIU. Fatigue crack growth prediction method under variable amplitude load based on dynamic Bayesian network[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(2): 280-288.
[5] Li-feng XU,Hai-fan HUANG,Wei-long DING,Yu-lei FAN. Detection of small fruit target based on improved DenseNet[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(2): 377-385.
[6] Hao-can XU,Ji-tuo LI,Guo-dong LU. Reconstruction of three-dimensional human bodies from single image by LeNet-5[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(1): 153-161.
[7] Yi-peng HUANG,Ji-su HU,Xu-sheng QIAN,Zhi-yong ZHOU,Wen-lu ZHAO,Qi MA,Jun-kang SHEN,Ya-kang DAI. SE-Mask-RCNN: segmentation method for prostate cancer on multi-parametric MRI[J]. Journal of ZheJiang University (Engineering Science), 2021, 55(1): 203-212.
[8] Jing-jing LIU,Tie-lin CHEN,Mao-hong YAO,Yu-xin WEI,Zi-jian ZHOU. Experimental and numerical study on slurry fracturing of shield tunnels in sandy stratum[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(9): 1715-1726.
[9] Qiao-hong CHEN,YI CHEN,Wen-shu Li,Yu-bo JIA. Clothing image classification based on multi-scale SE-Xception[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(9): 1727-1735.
[10] Pu ZHENG,Hong-yang BAI,Wei LI,Hong-wei GUO. Small target detection algorithm in complex background[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(9): 1777-1784.
[11] Deng-wen ZHOU,Jin-yue TIAN,Lu-yao MA,Xiu-xiu SUN. Lightweight image semantic segmentation based on multi-level feature cascaded network[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(8): 1516-1524.
[12] Tao MING,Dan WANG,Ji-chang GUO,Qiang LI. Breast cancer histopathological image classification using multi-scale channel squeeze-and-excitation model[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(7): 1289-1297.
[13] Xu YAN,Xiao-liang FAN,Chuan-pan ZHENG,Yu ZANG,Cheng WANG,Ming CHENG,Long-biao CHEN. Urban traffic flow prediction algorithm based on graph convolutional neural networks[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(6): 1147-1155.
[14] Ping YANG,Dan WANG,Zi-jian KAGN,Tong LI,Li-hua FU,Yue-ren YU. Prediction model of paroxysmal atrial fibrillation based on pattern recognition and ensemble CNN-LSTM[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(5): 1039-1048.
[15] Zhou-fei WANG,Wei-na YUAN. Channel estimation and detection method for multicarrier system based on deep learning[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(4): 732-738.