计算机工程与应用 ›› 2021, Vol. 57 ›› Issue (6): 131-137.DOI: 10.3778/j.issn.1002-8331.1912-0302

• 模式识别与人工智能 • 上一篇    下一篇

基于YOLOv3的卷积层结构化剪枝

张良,张增,舒伟华,梅魁志   

  1. 1.武汉数字工程研究所,武汉 430074
    2.西安交通大学 电子与信息工程学部,西安 710049
    3.中国航发南方工业有限公司,湖南 株洲 412002
  • 出版日期:2021-03-15 发布日期:2021-03-12

Convolutional Layered Pruning Based on YOLOv3

ZHANG Liang, ZHANG Zeng, SHU Weihua, MEI Kuizhi   

  1. 1.Wuhan Digital and Engineering Institute, Wuhan 430074, China
    2.Faculty of Electronic and Information Engineering, Xi’an Jiaotong University, Xi’an 710049, China
    3.AECC South Industry Company Limited, Zhuzhou, Hunan 412002, China
  • Online:2021-03-15 Published:2021-03-12

摘要:

针对YOLOv3等卷积神经网络使用更多的卷积层结构且卷积核尺寸大小统一的特点,提出一种卷积层结构化剪枝计算的参数压缩方法。基于卷积层权值参数,设计度量卷积层重要性公式,评估卷积层相对整个网络重要性,计算卷积层重要度并对得分进行排序,制定稀疏值分配策略,再训练模型操作保证模型性能不降低,并得到各个卷积层分配的稀疏值以及卷积过滤器,完成模型的结构化剪枝计算。在Darknet上实现YOLOv3卷积层结构化剪枝的参数压缩方法,不仅将YOLOv3参数压缩1.5倍,且计算量减少了1.6倍。

关键词: 深度学习, 剪枝, 卷积神经网络

Abstract:

Aiming at the characteristics of convolutional neural networks such as YOLOv3 using more convolutional layer structure and uniform size of convolution kernel, a parameter compression method for convolutional layer pruning calculation is proposed. Based on the convolutional layer weight parameter, a formula for measuring the importance of the convolutional layer is designed. The importance of the convolutional layer relative to the whole network is evaluated. The importance of the convolutional layer is calculated and the scores are sorted. The sparse value assignment strategy is formulated. The retraining operation is performed to ensure that the performance of the model is not degraded, and the sparse value of each convolution layer and the convolution filter are obtained, and the structured pruning calculation of the model is completed. The parameter compression method of structured pruning of the YOLOv3 convolutional layer is implemented on Darknet, which not only compresses the YOLOv3 parameter by 1.5 times, but also reduces the calculation by 1.6 times.

Key words: deep learning, pruning, convolutional neural network