高级检索

留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

面向钻蛀振动实时侦听的深度学习模型压缩

张海燕 袁明帅 蒋琦 孙钰 崔剑 任利利 骆有庆

张海燕, 袁明帅, 蒋琦, 孙钰, 崔剑, 任利利, 骆有庆. 面向钻蛀振动实时侦听的深度学习模型压缩[J]. 北京林业大学学报, 2021, 43(6): 92-100. doi: 10.12171/j.1000-1522.20200100
引用本文: 张海燕, 袁明帅, 蒋琦, 孙钰, 崔剑, 任利利, 骆有庆. 面向钻蛀振动实时侦听的深度学习模型压缩[J]. 北京林业大学学报, 2021, 43(6): 92-100. doi: 10.12171/j.1000-1522.20200100
Zhang Haiyan, Yuan Mingshuai, Jiang Qi, Sun Yu, Cui Jian, Ren Lili, Luo Youqing. Deep learning model compression for real-time listening of boring vibration[J]. Journal of Beijing Forestry University, 2021, 43(6): 92-100. doi: 10.12171/j.1000-1522.20200100
Citation: Zhang Haiyan, Yuan Mingshuai, Jiang Qi, Sun Yu, Cui Jian, Ren Lili, Luo Youqing. Deep learning model compression for real-time listening of boring vibration[J]. Journal of Beijing Forestry University, 2021, 43(6): 92-100. doi: 10.12171/j.1000-1522.20200100

面向钻蛀振动实时侦听的深度学习模型压缩

doi: 10.12171/j.1000-1522.20200100
基金项目: 北京市科技计划“北京生态公益林重大有害生物防控关键技术”(Z191100008519004)
详细信息
    作者简介:

    张海燕,博士,副教授。主要研究方向:人工智能。Email:zhyzml@bjfu.edu.cn 地址:100083 北京市海淀区清华东路35号北京林业大学信息学院

    责任作者:

    孙钰,博士,副教授。主要研究方向:人工智能。Email:sunyv@buaa.edu.cn 地址:100191北京市海淀区学院路37号北京航空航天大学网络空间安全学院

  • 中图分类号: S763.7;TP391.4

Deep learning model compression for real-time listening of boring vibration

  • 摘要:   目的   基于深度学习的钻蛀振动识别模型结合边缘计算可实现林业蛀干害虫钻蛀振动长期监测和实时预警,但要求大幅压缩智能识别模型的参数量和运算量。本研究采用深度学习模型压缩算法,在不损失精度的前提下,对已有的钻蛀振动识别模型进行压缩,减小模型的体积并提升模型在嵌入式平台的识别速度。   方法   首先采集双条杉天牛钻蛀振动和背景噪声两类信号训练人工设计的5层卷积神经网络BoringNet,得到钻蛀振动识别模型;然后分别使用不同裁剪率的滤波器裁剪、模型量化、多目标知识蒸馏对钻蛀振动识别模型进行压缩;最后设计上述压缩算法的组合策略,联合使用3种算法对蛀振动识别模型进行压缩,探究多种组合的模型压缩效果。   结果   3种模型压缩算法组合,裁剪率为60%时模型达到最优,此时模型计算量和参数量分别从原模型的18.06 ×106次和0.54 ×106个降低为3.01 ×106次和0.09 × 106个,模型体积从2 200 kB压缩至134.9 kB,树莓派3B+上的识别时间由原模型的9.04 ms降低至1.65 ms,而模型精度仍能达到99.29%,提升了0.5%。   结论   本研究的深度学习模型压缩方法,可以针对钻蛀振动侦听场景大幅压缩模型参数量和运算量,在保证准确率的前提下实现嵌入式平台的实时识别,促进钻蛀振动识别模型从工作站试验到野外实地部署的转变,为钻蛀振动识别的边缘计算奠定基础。

     

  • 图  1  实验室初期采集设备

    Figure  1.  Initial collection equipments in laboratory

    图  2  野外实时侦听装置图

    Figure  2.  Field real-time interception device diagram

    图  3  梅尔频率倒谱系数(MFCC)信号特征提取

    Figure  3.  Mel-frequency cepstrum (MFCC) signal feature extraction

    图  4  BoringNet和ResNet50网络结构

    方框内列出模块信息,对于卷积,1 × 1 128 s2代表本层有128个长宽均为1的滤波器,步长为2(堆叠模块中仅第一个模块步长为2,步长为1未标注);对于最大池化,2 × 2 s2代表池化范围为2 × 2,步长为2。The information of the module is listed in the box. For the convolution, 1 × 1 128 s2 means that there are 128 convolution filters in the layer with length and width of 1 and stride of 2 (only the first module’s stride in the stack module is 2, stride of 1 is not marked); for the max pooling, 2 × 2 s2 means that the pooling range is 2 × 2 and stride is 2.

    Figure  4.  Network architecture of BoringNet and ResNet50

    图  5  量化感知训练的实现

    Figure  5.  Implementation of quantization aware training

    图  6  滤波器裁剪原理示意图

    卷积层中立方体水平方向的宽度代表输入通道数,立方体个数表滤波器个数,即输出通道数;深色部分为裁剪掉的滤波器或输入通道或被抹去的某一通道的输出特征。Horizontal width of cube in the convolution layers represents the number of input channels, and the number of cubes represents the number of convolution filters, i.e. the number of output channels; the dark parts are the convolution filters or input channels pruned off, or channel that is erased in the feature map.

    Figure  6.  Schematic diagram of convolution filter pruning

    图  7  BoringNet多目标知识蒸馏

    Figure  7.  Multiple target knowledge distillation of BoringNet

    图  8  不同裁剪率下各压缩算法组合模型精度(a)和体积(b)的变化

    Figure  8.  Accuracy (a) and volume (b) change of each compression algorithm combination model under different pruning ratios

    图  9  不同裁剪率下各压缩算法组合识别时间变化

    Figure  9.  Recognition time change of each compression algorithm combination model under different pruning ratios

    表  1  数据采集参数

    Table  1.   Data collection parameters

    信号类型
    Signal type
    采集设备
    Collection equipment
    采集环境
    Collection environment
    采样率
    Sample rate/kHz
    采样深度
    Sample depth/bit
    片段数量
    Number of segment
    双条杉天牛 Semanotus bifasciatus旧设备 Old equipment安静环境 Quiet environment16.016189
    背景噪声 Background noise新设备 New equipment若干嘈杂环境 Noise environment44.1166
    下载: 导出CSV

    表  2  基于钻蛀振动信号数据的 BoringNet和ResNet50原模型

    Table  2.   Original model of BoringNet and ResNet50 based on boring vibration signal data

    模型
    Model
    精度
    Accuracy/%
    计算量/次
    Computation/time
    参数量
    Parameter quantity
    模型体积
    Model size/MB
    时间 Time/ms
    单线程 Single thread4线程 Four threads
    BoringNet 98.79 18.06×106 0.54×106 2.2 9.04 5.38
    ResNet50 99.42 132.34×106 23.48×106 94.6 129.81 81.63
    下载: 导出CSV

    表  3  BoringNet 8 bit定点量化结果

    Table  3.   Results under 8 bit quantization of BoringNet

    量化形式 Quantization type精度 Accuracy/%体积 Size/kB时间 Time/ms
    单线程 Single thread4线程 Four threads
    量化感知训练 Quantization aware training 98.99 586.3 7.71 2.41
    训练后量化 Post training quantization 98.93
    下载: 导出CSV

    表  4  BoringNet滤波器裁剪结果

    Table  4.   Results under filter pruning of BoringNet

    裁剪率
    Pruning ratio/%
    计算量/次
    Computation/time
    参数量
    Parameter quantity
    10 14.74 ×106 0.43 ×106
    33 8.16 ×106 0.24 ×106
    50 4.61 ×106 0.13 ×106
    60 3.01 ×106 0.09 ×106
    70 1.70 ×106 0.05 ×106
    下载: 导出CSV

    表  5  BoringNet使用ResNet50知识蒸馏结果

    Table  5.   Results of knowledge distillation of BoringNet using ResNet50

    额外优化目标
    Extra optimization target
    精度
    Accuracy/%
    量化精度
    Quantization accuracy/%
    软目标 Soft target 99.49 99.56
    L2目标 L2 target 99.57 99.54
    组合目标 Composed target 99.39 99.43
    下载: 导出CSV
  • [1] 黄志平, 庞正轰, 张少军, 等. 广西桉树蛀干害虫的风险分析及管理对策研究[J]. 中国森林病虫, 2013, 32(3):16−21, 23. doi: 10.3969/j.issn.1671-0886.2013.03.004

    Huang Z P, Pang Z H, Zhang S J, et al. Risk analysis and management countermeasures of eucalyptus trunk borers in Guangxi[J]. Forest Pest and Disease, 2013, 32(3): 16−21, 23. doi: 10.3969/j.issn.1671-0886.2013.03.004
    [2] 李娟, 常国彬, 曲涛, 等. 我国林业有害生物危害性评价[J]. 中国森林病虫, 2019, 38(4):11−17, 21. doi: 10.3969/j.issn.1671-0886.2019.04.003

    Li J, Chang G B, Qu T, et al. Hazard assessment of forest pests in China[J]. Forest Pest and Disease, 2019, 38(4): 11−17, 21. doi: 10.3969/j.issn.1671-0886.2019.04.003
    [3] 韦雪青, 温俊宝, 赵源吉, 等. 害虫声音监测技术研究进展[J]. 林业科学, 2010, 46(5):147−154. doi: 10.11707/j.1001-7488.20100524

    Wei X Q, Wen J B, Zhao Y J, et al. Review on monitoring technology of the insect acoustic[J]. Scientia Silvae Sinicae, 2010, 46(5): 147−154. doi: 10.11707/j.1001-7488.20100524
    [4] 潘杰, 安榆林, 刘翔, 等. 害虫声音探测技术在原木检疫中的应用展望[J]. 植物检疫, 2013, 27(5):17−20. doi: 10.3969/j.issn.1005-2755.2013.05.005

    Pan J, An Y L, Liu X, et al. The application and prospect of sound monitoring in log quarantine[J]. Plant Quarantine, 2013, 27(5): 17−20. doi: 10.3969/j.issn.1005-2755.2013.05.005
    [5] Mankin R W, Hagstrum D W, Smith M T, et al. Perspective and promise: a century of insect acoustic detection and monitoring[J]. American Entomologist, 2011, 57(1): 30−44. doi: 10.1093/ae/57.1.30
    [6] Herrick N J, Mankin R W. Acoustical detection of early instar Rhynchophorus ferrugineus (Coleoptera: Curculionidae) in Canary Island date palm, Phoenix canariensis (Arecales: Arecaceae)[J]. Florida Entomologist, 2012, 95(4): 983−990. doi: 10.1653/024.095.0425
    [7] Dosunmu O G, Herrick N J, Haseeb M, et al. Acoustic detectability of Rhynchophorus cruentatus (Coleoptera: Dryophthoridae)[J]. Florida Entomologist, 2014, 97(2): 431−438. doi: 10.1653/024.097.0213
    [8] Mankin R W, Al-Ayedh H Y, Aldryhim Y, et al. Acoustic detection of Rhynchophorus ferrugineus (Coleoptera: Dryophthoridae) and Oryctes elegans (Coleoptera: Scarabaeidae) in Phoenix dactylifera (Arecales: Arecacae) trees and offshoots in Saudi Arabian orchards[J]. Journal of Economic Entomology, 2016, 109(2): 622−628. doi: 10.1093/jee/tov398
    [9] Hetzroni A, Soroker V, Cohen Y. Toward practical acoustic red palm weevil detection[J]. Computers and Electronics in Agriculture, 2016, 124: 100−106. doi: 10.1016/j.compag.2016.03.018
    [10] Mankin R W, Burman H, Menocal O, et al. Acoustic detection of Mallodon dasystomus (Coleoptera: Cerambycidae) in Persea americana (Laurales: Lauraceae) branch stumps[J]. Florida Entomologist, 2018, 101(2): 321−324. doi: 10.1653/024.101.0226
    [11] 许小芳, 周红生, 娄定风, 等. 木材钻蛀性害虫活动声信号的采集与分析[J]. 声学技术, 2011, 30(5):8−11.

    Xu X F, Zhou H S, Lou D F, et al. Acquisition and power spectrum analysis of wood borer insects’ activity sound[J]. Technical Acoustic, 2011, 30(5): 8−11.
    [12] 娄定风, 许小芳, 李嘉, 等. 6种木材钻蛀性昆虫的声学特征与比较[J]. 植物检疫, 2013, 27(1):6−10.

    Lou D F, Xu X F, Li J, et al. Acoustic characteristics and their comparison of six species of wood borers[J]. Plant Quarantine, 2013, 27(1): 6−10.
    [13] 赵源吉, 韦雪青, 温俊宝, 等. 双条杉天牛(Semanotus bifasciatus)幼虫声音探测技术初报[J]. 生态科学, 2009, 28(3):242−246. doi: 10.3969/j.issn.1008-8873.2009.03.011

    Zhao Y J, Wei X Q, Wen J B, et al. Preliminary study on the acoustic detection of larvae Semanotus bifasciatus (Motschulsky)[J]. Ecological Science, 2009, 28(3): 242−246. doi: 10.3969/j.issn.1008-8873.2009.03.011
    [14] 祁骁杰, 卜宇飞, 许志春, 等. 杨树木段内光肩星天牛幼虫数量的声学检测[J]. 环境昆虫学报, 2016, 38(3):529−534.

    Qi X J, Bu Y F, Xu Z C, et al. Using acoustic technology detect the different numbers of Anoplophora glabripennis larvae in poplar[J]. Journal of Environmental Entomology, 2016, 38(3): 529−534.
    [15] 卜宇飞, 祁骁杰, 温俊宝, 等. 7种林木蛀干害虫的声音特征分析[J]. 南京林业大学学报(自然科学版), 2016, 40(2):179−184.

    Bu Y F, Qi X J, Wen J B, et al. Acoustic characteristics analysis of seven species of tree trunk borers[J]. Journal of Nanjing Forestry University (Natural Sciences Edition), 2016, 40(2): 179−184.
    [16] 卜宇飞, 祁骁杰, 温俊宝, 等. 2种天牛幼虫的4类声行为特征[J]. 浙江农林大学学报, 2017, 34(1):50−55. doi: 10.11833/j.issn.2095-0756.2017.01.008

    Bu Y F, Qi X J, Wen J B, et al. Acoustic behaviors for two species of cerambycid larvae[J]. Journal of Zhejiang A&F University, 2017, 34(1): 50−55. doi: 10.11833/j.issn.2095-0756.2017.01.008
    [17] 竺乐庆, 王鸿斌, 张真. 基于Mel倒谱系数和矢量量化的昆虫声音自动鉴别[J]. 昆虫学报, 2010, 53(8):901−907.

    Zhu L Q, Wang H B, Zhang Z. Automatic acoustical identification of insects based on MFCC and VQ[J]. Acta Entomologica Sinica, 2010, 53(8): 901−907.
    [18] 竺乐庆, 张真. 基于MFCC和GMM的昆虫声音自动识别[J]. 昆虫学报, 2012, 55(4):466−471.

    Zhu L Q, Zhang Z. Automatic recognition of insect sounds using MFCC and GMM[J]. Acta Entomologica Sinica, 2012, 55(4): 466−471.
    [19] 孙钰, 脱小倩, 蒋琦, 等. 基于轻量级神经网络的两种害虫钻蛀振动识别方法研究[J]. 林业科学, 2020, 56(3):100−108. doi: 10.11707/j.1001-7488.20200311

    Sun Y, Tuo X Q, Jiang Q, et al. Boring vibration recognition technique study of two insects based on lightweight neural networks[J]. Scientia Silvae Sinicae, 2020, 56(3): 100−108. doi: 10.11707/j.1001-7488.20200311
    [20] Courbariaux M, Bengio Y, David J P. Binaryconnect: training deep neural networks with binary weights during propagations[C]//Cortes C, Lawrence N, Lee D, et al. Advances in the neural information processing systems (NIPS). New York: Curran Associates, Inc., 2015: 3123−3131.
    [21] Rastegari M, Ordonez V, Redmon J, et al. Xnor-net: imagenet classification using binary convolutional neural networks[C]//Leibe B, Matas J, Sebe N, et al. Proceedings of the european conference on computer vision (ECCV). Berlin: Springer International Publishing, 2016: 525−542.
    [22] Hubara I, Courbariaux M, Soudry D, et al. Quantized neural networks: training neural networks with low precision weights and activations[J]. Journal of Machine Learning Research, 2017, 18(1): 6869−6898.
    [23] Krishnamoorthi R. Quantizing deep convolutional networks for efficient inference: a whitepaper[J/OL]. arXiv, 2018 [2020−03−06]. https://arxiv.org/abs/1806.08342.
    [24] Han S, Pool J, Tran J, et al. Learning both weights and connections for efficient neural network[C]//Corte C, Lawrence N, Lee D, et al. Advances in the neural information processing systems (NIPS). New York: Curran Associates, Inc., 2015: 1135−1143.
    [25] 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
    [26] Li H, Kadav A, Durdanovic I, et al. Pruning filters for efficient convnets[C]//Bengio Y. Proceedings of International Conference on Learning Representations (ICLR). Toulon: [s.n.], 2017.
    [27] Hinton G, Oriol V, Jeff D. Distilling the knowledge in a neural network[J/OL]. arXiv, 2015 [2020−03−06]. https://arxiv.org/abs/1503.02531.
    [28] Romero A, Ballas N, Kahou S E, et al. Fitnets: hints for thin deep nets[C]//Bengio Y. Proceedings of International Conference on Learning Representations (ICLR). San Diego:[s.n.], 2015.
    [29] Zagoruyko S, Komodakis N. Paying more attention to attention: improving the performance of convolutional neural networks via attention transfer[C]//Bengio Y. Proceedings of International Conference on Learning Representations (ICLR). Toulon: [s.n.], 2017.
    [30] Yim J, Joo D, Bae J, et al. A gift from knowledge distillation: fast optimization, network minimization and transfer learning[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Washington: IEEE Computer Society Press, 2017: 7130−7138.
    [31] Shi W, Cao J, Zhang Q, et al. Edge computing: vision and challenges[J]. IEEE Internet of Things Journal, 2016, 3(5): 637−646. doi: 10.1109/JIOT.2016.2579198
    [32] 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 (CVPR). Washington: IEEE Computer Society Press, 2016: 770−778.
    [33] Jacob B, Kligys S, Chen B, et al. Quantization and training of neural networks for efficient integer-arithmetic-only inference [C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Washington: IEEE Computer Society Press, 2018: 2704−2713.
    [34] Rubinstein R Y. Optimization of computer simulation models with rare events[J]. European Journal of Operational Research, 1997, 99(1): 89−112. doi: 10.1016/S0377-2217(96)00385-2
    [35] Zoph B, Le Q V. Neural architecture search with reinforcement learning[C]//Bengio Y. International Conference on Learning Representations (ICLR). Toulon: [s.n.], 2017.
  • 加载中
图(9) / 表(5)
计量
  • 文章访问数:  280
  • HTML全文浏览量:  106
  • PDF下载量:  34
  • 被引次数: 0
出版历程
  • 收稿日期:  2020-04-06
  • 修回日期:  2020-12-11
  • 网络出版日期:  2021-06-05
  • 刊出日期:  2021-06-30

目录

    /

    返回文章
    返回