浙江农业学报 ›› 2023, Vol. 35 ›› Issue (6): 1462-1472.DOI: 10.3969/j.issn.1004-1524.2023.06.23
收稿日期:
2022-07-04
出版日期:
2023-06-25
发布日期:
2023-07-04
通讯作者:
*冯全,E-mail:fquan@sina.com
作者简介:
朱冬琴(1995—),女,甘肃定西人,硕士研究生,主要从事模型压缩研究。E-mail:2339488750@qq.com
基金资助:
ZHU Dongqin1(), FENG Quan1,*(
), ZHANG Jianhua2
Received:
2022-07-04
Online:
2023-06-25
Published:
2023-07-04
摘要:
为实时自动检测植物病害,需要将病害识别模型部署在边缘/移动设备上,但是,目前在病害识别领域具有优越性能的深度卷积神经网络因受模型体积和计算资源的限制,无法直接进行部署。为解决这个问题,提出基于剪枝的病害识别方法,该方法利用BN层中的γ系数进行通道剪枝,实现对Vgg16、ResNet164和DenseNet40网络的压缩。以PlantVillage植物病害数据集为研究对象,对3种网络进行模型压缩。结果表明,压缩后的Vgg16-80%、ResNet164-80%和DenseNet40-80%的平均准确率分别为97.46%、99.12%和99.68%,DenseNet40-80%准确率最高,且模型的参数量最少,仅为0.27×106;Vgg16-80%的压缩效果最明显,剪掉了97.83%的参数量和96.77%的计算量,且剪枝后的计算量最小,仅有0.01×109;Vgg16-80%和DenseNet40-80%剪枝后的精度高于原始模型。因此,本研究方法能够解决大型神经网络的过参数化问题,降低计算成本,可为现有大网络在小型设备上部署提供思路。
中图分类号:
朱冬琴, 冯全, 张建华. 基于剪枝的植物病害识别方法[J]. 浙江农业学报, 2023, 35(6): 1462-1472.
ZHU Dongqin, FENG Quan, ZHANG Jianhua. Plant disease identification based on pruning[J]. Acta Agriculturae Zhejiangensis, 2023, 35(6): 1462-1472.
模型 Model | 准确率 Accuracy/% | 参数量 Parameter/106 | 删减比例 Pruned/% | 浮点运算数 FLOPs/109 | 删减比例 Pruned/% | 模型尺寸 Model size/MB | 删减比例 Pruned/% |
---|---|---|---|---|---|---|---|
Vgg16(Normal) | 96.76 | 14.74 | — | 0.31 | — | 118 | — |
Vgg16(Sparse) | 96.60 | 14.74 | — | 0.31 | — | 118 | — |
Vgg16-70% | 98.19 | 0.90 | 93.89 | 0.03 | 90.32 | 7.3 | 93.81 |
Vgg16-80% | 97.46 | 0.32 | 97.83 | 0.01 | 96.77 | 2.6 | 97.80 |
ResNet164(Normal) | 99.55 | 1.72 | — | 0.26 | — | 14.1 | — |
ResNet164(Sparse) | 98.84 | 1.72 | — | 0.26 | — | 14.1 | — |
ResNet164-70% | 99.28 | 0.51 | 70.35 | 0.07 | 73.08 | 4.4 | 68.79 |
ResNet164-80% | 99.12 | 0.37 | 78.49 | 0.05 | 80.77 | 3.3 | 76.60 |
DenseNet40(Normal) | 99.62 | 1.08 | — | 0.29 | — | 8.8 | — |
DenseNet40(Sparse) | 99.66 | 1.08 | — | 0.29 | — | 8.8 | — |
DenseNet40-70% | 99.64 | 0.37 | 65.74 | 0.13 | 55.17 | 3.1 | 64.77 |
DenseNet40-80% | 99.68 | 0.27 | 75.00 | 0.10 | 65.52 | 2.3 | 73.86 |
DenseNet40-90% | 99.51 | 0.16 | 85.19 | 0.06 | 79.31 | 1.4 | 84.09 |
表1 病害识别模型压缩前后的参数对比
Table 1 Comparison of parameters before and after compression of disease identification model
模型 Model | 准确率 Accuracy/% | 参数量 Parameter/106 | 删减比例 Pruned/% | 浮点运算数 FLOPs/109 | 删减比例 Pruned/% | 模型尺寸 Model size/MB | 删减比例 Pruned/% |
---|---|---|---|---|---|---|---|
Vgg16(Normal) | 96.76 | 14.74 | — | 0.31 | — | 118 | — |
Vgg16(Sparse) | 96.60 | 14.74 | — | 0.31 | — | 118 | — |
Vgg16-70% | 98.19 | 0.90 | 93.89 | 0.03 | 90.32 | 7.3 | 93.81 |
Vgg16-80% | 97.46 | 0.32 | 97.83 | 0.01 | 96.77 | 2.6 | 97.80 |
ResNet164(Normal) | 99.55 | 1.72 | — | 0.26 | — | 14.1 | — |
ResNet164(Sparse) | 98.84 | 1.72 | — | 0.26 | — | 14.1 | — |
ResNet164-70% | 99.28 | 0.51 | 70.35 | 0.07 | 73.08 | 4.4 | 68.79 |
ResNet164-80% | 99.12 | 0.37 | 78.49 | 0.05 | 80.77 | 3.3 | 76.60 |
DenseNet40(Normal) | 99.62 | 1.08 | — | 0.29 | — | 8.8 | — |
DenseNet40(Sparse) | 99.66 | 1.08 | — | 0.29 | — | 8.8 | — |
DenseNet40-70% | 99.64 | 0.37 | 65.74 | 0.13 | 55.17 | 3.1 | 64.77 |
DenseNet40-80% | 99.68 | 0.27 | 75.00 | 0.10 | 65.52 | 2.3 | 73.86 |
DenseNet40-90% | 99.51 | 0.16 | 85.19 | 0.06 | 79.31 | 1.4 | 84.09 |
模型 Model | 准确率 Accuracy/ % | 参数量 Parameter/ 106 | 浮点运算数 FLOPs/109 | 模型尺寸 Model size/MB |
---|---|---|---|---|
Vgg16-80% | 97.46 | 0.32 | 0.010 | 2.6 |
ResNet164-80% | 99.12 | 0.37 | 0.050 | 3.3 |
DenseNet40-80% | 99.68 | 0.27 | 0.100 | 2.3 |
MobileNetV2 | 97.40 | 2.27 | 0.006 | 18.4 |
EfficientnetV2-S | 97.12 | 20.22 | 0.060 | 162.7 |
ShuffleNetV2 | 97.98 | 1.29 | 0.003 | 10.5 |
表2 不同模型在PlantVillage数据集上的性能测试
Table 2 Performance test of different models on PlantVillage dataset
模型 Model | 准确率 Accuracy/ % | 参数量 Parameter/ 106 | 浮点运算数 FLOPs/109 | 模型尺寸 Model size/MB |
---|---|---|---|---|
Vgg16-80% | 97.46 | 0.32 | 0.010 | 2.6 |
ResNet164-80% | 99.12 | 0.37 | 0.050 | 3.3 |
DenseNet40-80% | 99.68 | 0.27 | 0.100 | 2.3 |
MobileNetV2 | 97.40 | 2.27 | 0.006 | 18.4 |
EfficientnetV2-S | 97.12 | 20.22 | 0.060 | 162.7 |
ShuffleNetV2 | 97.98 | 1.29 | 0.003 | 10.5 |
基础模型 Basic model | 分类数量 Category number | 存储空间 Storage space/MB | 平均准确率 Average accuracy/% |
---|---|---|---|
AlexNet[ | 38 | 2.60 | 99.56 |
MobileNet V1[ | 38 | 17.1 | 95.02 |
Inception V3[ | 38 | 87.5 | 95.62 |
SqueezeNet[ | 38 | 0.62 | 98.13 |
DenseNet40-90% | 38 | 0.64 | 99.51 |
表3 不同方法下的模型性能比较
Table 3 Comparison of model performance under different methods
基础模型 Basic model | 分类数量 Category number | 存储空间 Storage space/MB | 平均准确率 Average accuracy/% |
---|---|---|---|
AlexNet[ | 38 | 2.60 | 99.56 |
MobileNet V1[ | 38 | 17.1 | 95.02 |
Inception V3[ | 38 | 87.5 | 95.62 |
SqueezeNet[ | 38 | 0.62 | 98.13 |
DenseNet40-90% | 38 | 0.64 | 99.51 |
[1] | 周长建, 宋佳, 向文胜. 基于人工智能的作物病害识别研究进展[J]. 植物保护学报, 2022, 49(1): 316-324. |
ZHOU C J, SONG J, XIANG W S. Research progresses in artificial intelligence-based crop disease identification[J]. Journal of Plant Protection, 2022, 49(1): 316-324. (in Chinese with English abstract) | |
[2] | MOHANTY S P, HUGHES D P, SALATHÉ M. Using deep learning for image-based plant disease detection[J]. Frontiers in Plant Science, 2016, 7: 14-19. |
[3] | 孙俊, 谭文军, 毛罕平, 等. 基于改进卷积神经网络的多种植物叶片病害识别[J]. 农业工程学报, 2017, 33(19): 209-215. |
SUN J, TAN W J, MAO H P, et al. Recognition of multiple plant leaf diseases based on improved convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering, 2017, 33(19): 209-215. (in Chinese with English abstract) | |
[4] | TOO E C, LI Y J, NJUKI S, et al. A comparative study of fine-tuning deep learning models for plant disease identification[J]. Computers and Electronics in Agriculture, 2019, 161: 272-279. |
[5] | 何欣, 李书琴, 刘斌. 基于多尺度残差神经网络的葡萄叶片病害识别[J]. 计算机工程, 2021, 47(5): 285-291. |
HE X, LI S Q, LIU B. Identification of grape leaf diseases based on multi-scale residual neural network[J]. Computer Engineering, 2021, 47(5): 285-291. (in Chinese with English abstract) | |
[6] | 许景辉, 邵明烨, 王一琛, 等. 基于迁移学习的卷积神经网络玉米病害图像识别[J]. 农业机械学报, 2020, 51(2): 230-236. |
XU J H, SHAO M Y, WANG Y C, et al. Recognition of corn leaf spot and rust based on transfer learning with convolutional neural network[J]. Transactions of the Chinese Society for Agricultural Machinery, 2020, 51(2): 230-236. (in Chinese with English abstract) | |
[7] | 王林柏, 张博, 姚竟发, 等. 基于卷积神经网络马铃薯叶片病害识别和病斑检测[J]. 中国农机化学报, 2021, 42(11): 122-129. |
WANG L B, ZHANG B, YAO J F, et al. Potato leaf disease recognition and potato leaf disease spot detection based on Convolutional Neural Network[J]. Journal of Chinese Agricultural Mechanization, 2021, 42(11): 122-129. (in Chinese with English abstract) | |
[8] | 马宇, 单玉刚, 袁杰. 基于三通道注意力网络的番茄叶部病害识别[J]. 科学技术与工程, 2021, 21(25): 10789-10795. |
MA Y, SHAN Y G, YUAN J. Tomato leaf disease recognition based on three-channel attention network[J]. Science Technology and Engineering, 2021, 21(25): 10789-10795. (in Chinese with English abstract) | |
[9] | 刘洋, 冯全, 王书志. 基于轻量级CNN的植物病害识别方法及移动端应用[J]. 农业工程学报, 2019, 35(17): 194-204. |
LIU Y, FENG Q, WANG S Z. Plant disease identification method based on lightweight CNN and mobile application[J]. Transactions of the Chinese Society of Agricultural Engineering, 2019, 35(17): 194-204. (in Chinese with English abstract) | |
[10] | 刘阳, 高国琴. 采用改进的SqueezeNet模型识别多类叶片病害[J]. 农业工程学报, 2021, 37(2): 187-195. |
LIU Y, GAO G Q. Identification of multiple leaf diseases using improved SqueezeNet model[J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(2): 187-195. (in Chinese with English abstract) | |
[11] | ANWAR S, HWANG K, SUNG W. Structured pruning of deep convolutional neural networks[J]. ACM Journal on Emerging Technologies in Computing Systems, 2017, 13(3): 1-18. |
[12] | HINTON G, VINYALS O, DEAN J. Distilling the knowledge in a neural network[EB/OL]. [2022-06-30]. 2015: arXiv: 1503.02531. https://arxiv.org/abs/1503.0253. |
[13] | HARTIGAN J A, WONG M A. Algorithm AS 136: a K-means clustering algorithm[J]. Applied Statistics, 1979, 28(1): 100. |
[14] | IANDOLA F N, HAN S, MOSKEWICZ M W, et al. SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and<0.5MB model size[EB/OL]. [2022-06-30]. 2016: arXiv: 1602.07360. https://arxiv.org/abs/1602.07360. |
[15] | ZHANG X Y, ZHOU X Y, LIN M X, et al. ShuffleNet: an extremely efficient convolutional neural network for mobile devices[C]// 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. June 18-23, 2018, Salt Lake City, UT, USA. IEEE, 2018: 6848-6856. |
[16] | HOWARD A G, ZHU M L, CHEN B, et al. MobileNets: efficient convolutional neural networks for mobile vision applications[EB/OL]. [2022-06-30]. 2017: arXiv: 1704.04861. https://arxiv.org/abs/1704.04861. |
[17] | LUO J H, WU J X, LIN W Y. ThiNet: a filter level pruning method for deep neural network compression[C]// 2017 IEEE International Conference on Computer Vision (ICCV). October 22-29, 2017, Venice, Italy. IEEE, 2017: 5068-5076. |
[18] | HE Y, LIU P, WANG Z W, et al. Filter pruning via geometric Median for deep convolutional neural networks acceleration[C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 15-20, 2019, Long Beach, CA, USA. IEEE, 2020: 4335-4344. |
[19] | LIN M B, JI R R, WANG Y, et al. HRank: filter pruning using high-rank feature map[C]// 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 13-19, 2020, Seattle, WA, USA. IEEE, 2020: 1526-1535. |
[20] | 樊湘鹏, 许燕, 周建平, 等. 基于迁移学习和改进CNN的葡萄叶部病害检测系统[J]. 农业工程学报, 2021, 37(6): 151-159. |
FAN X P, XU Y, ZHOU J P, et al. Detection system for grape leaf diseases based on transfer learning and updated CNN[J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(6): 151-159. (in Chinese with English abstract) | |
[21] | 何东健, 王鹏, 牛童, 等. 基于改进残差网络的田间葡萄霜霉病病害程度分级模型[J]. 农业机械学报, 2022, 53(1): 235-243. |
HE D J, WANG P, NIU T, et al. Classification model of grape downy mildew disease degree in field based on improved residual network[J]. Transactions of the Chinese Society for Agricultural Machinery, 2022, 53(1): 235-243. (in Chinese with English abstract) | |
[22] | 赵辉, 曹宇航, 岳有军, 等. 基于改进DenseNet的田间杂草识别[J]. 农业工程学报, 2021, 37(18): 136-142. |
ZHAO H, CAO Y H, YUE Y J, et al. Field weed recognition based on improved DenseNet[J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(18): 136-142. (in Chinese with English abstract) | |
[23] | SIMONYAN K, ZISSERMAN A. Very deep convolutional networks for large-scale image recognition[EB/OL]. [2022-06-30]. 2014: arXiv: 1409.1556. https://arxiv.org/abs/1409.1556. |
[24] | HE K M, ZHANG X Y, REN S Q, et al. Deep residual learning for image recognition[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). June 27-30, 2016, Las Vegas, NV, USA. IEEE, 2016: 770-778. |
[25] | HE K M, ZHANG X Y, REN S Q, et al. Identity mappings in deep residual networks[C]// European Conference on Computer Vision. Cham: Springer, 2016: 630-645. |
[26] | HUANG G, LIU Z, VAN DER MAATEN L, et al. Densely connected convolutional networks[C]// 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). July 21-26, 2017, Honolulu, HI, USA. IEEE, 2017: 2261-2269. |
[27] | IOFFE S, SZEGEDY C. Batch normalization: accelerating deep network training by reducing internal covariate shift[EB/OL]. [2022-06-30]. 2015: arXiv: 1502.03167. https://arxiv.org/abs/1502.03167. |
[28] | LIU Z, LI J G, SHEN Z Q, et al. Learning efficient convolutional networks through network slimming[C]// 2017 IEEE International Conference on Computer Vision (ICCV). October 22-29, 2017, Venice, Italy. IEEE, 2017: 2755-2763. |
[29] | HUGHES D P, SALATHE M. An open access repository of images on plant health to enable the development of mobile disease diagnostics[EB/OL]. [2022-06-30]. 2015: arXiv: 1511.08060. https://arxiv.org/abs/1511.08060. |
[1] | 柴琴琴, 曾建, 张勋. 基于贝叶斯优化卷积神经网络的金线莲伪品鉴别[J]. 浙江农业学报, 2022, 34(2): 391-396. |
[2] | 李超, 李锋, 黄炜嘉. 基于并联卷积神经网络的水果品种识别[J]. 浙江农业学报, 2022, 34(11): 2533-2541. |
[3] | 张晴晴, 刘连忠, 宁井铭, 吴国栋, 江朝晖, 李孟杰, 李栋梁. 基于YOLOV3优化模型的复杂场景下茶树嫩芽识别[J]. 浙江农业学报, 2021, 33(9): 1740-1747. |
[4] | 张宁, 吴华瑞, 韩笑, 缪祎晟. 基于多尺度和注意力机制的番茄病害识别方法[J]. 浙江农业学报, 2021, 33(7): 1329-1338. |
[5] | 鲍烈, 王曼韬, 刘江川, 文波, 明月. 基于卷积神经网络的小麦产量预估方法[J]. 浙江农业学报, 2020, 32(12): 2244-2252. |
[6] | 蒋丰千, 李旸, 余大为, 孙敏, 张恩宝. 基于Caffe卷积神经网络的大豆病害检测系统[J]. 浙江农业学报, 2019, 31(7): 1177-1183. |
[7] | 金秀, 卢杰, 傅运之, 王帅, 许高健, 李绍稳. 基于深度卷积神经网络的小麦赤霉病高光谱病症点分类方法[J]. 浙江农业学报, 2019, 31(2): 315-325. |
[8] | 张善文, 黄文准, 尤著宏. 基于物联网和深度卷积神经网络的冬枣病害识别方法[J]. 浙江农业学报, 2017, 29(11): 1868-1874. |
[9] | 金伟萍;邵泱峰;何勇;*. 剪枝对山地茄子光合特性及同化物分配的影响[J]. , 2012, 24(4): 0-592. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||