《计算机应用》唯一官方网站 ›› 2022, Vol. 42 ›› Issue (11): 3580-3587.DOI: 10.11772/j.issn.1001-9081.2021122164
所属专题: 第二十一届中国虚拟现实大会
收稿日期:
2021-12-24
修回日期:
2022-03-14
接受日期:
2022-03-17
发布日期:
2022-05-17
出版日期:
2022-11-10
通讯作者:
蔡兴泉
作者简介:
孙海燕(1980—),女,山东济宁人,讲师,博士,主要研究方向:虚拟现实、深度学习基金资助:
Haiyan SUN, Yunbo CHEN, Dingwei FENG, Tong WANG, Xingquan CAI()
Received:
2021-12-24
Revised:
2022-03-14
Accepted:
2022-03-17
Online:
2022-05-17
Published:
2022-11-10
Contact:
Xingquan CAI
About author:
SUN Haiyan, born in 1980, Ph. D., lecturer. Her research interests include virtual reality, deep learning.Supported by:
摘要:
针对当前林业害虫检测方法检测速度慢、准确率较低和存在漏检误检等问题,提出一种基于注意力模型和轻量化YOLOv4的林业害虫检测方法。首先构建数据集,使用几何变换、随机色彩抖动和Mosaic数据增强技术对数据集进行预处理;其次将YOLOv4的主干网络替换为轻量化网络MobileNetV3,并在改进后的路径聚合网络(PANet)中添加卷积块注意力模块(CBAM),搭建改进的轻量化YOLOv4网络模型;然后引入Focal Loss优化YOLOv4网络模型的损失函数;最后将预处理后的数据集输入到改进后的网络模型中,输出包含害虫种类和位置信息的检测结果。实验结果表明,该网络的各项改进点对模型的性能提升都有效;相较于原YOLOv4模型,新模型的检测速度更快,平均精度均值(mAP)更高,并且能有效解决漏检和误检问题。新模型优于目前的主流网络模型,能满足林业害虫实时检测的精度和速度要求。
中图分类号:
孙海燕, 陈云博, 封丁惟, 王通, 蔡兴泉. 基于注意力模型和轻量化YOLOv4的林业害虫检测方法[J]. 计算机应用, 2022, 42(11): 3580-3587.
Haiyan SUN, Yunbo CHEN, Dingwei FENG, Tong WANG, Xingquan CAI. Forest pest detection method based on attention model and lightweight YOLOv4[J]. Journal of Computer Applications, 2022, 42(11): 3580-3587.
害虫种类 | 样本数量 | 害虫种类 | 样本数量 |
---|---|---|---|
Boerner | 2 232 | armandi | 2 346 |
Leconte | 2 450 | coleoptera | 2 091 |
Linnaeus | 1 860 | linnaeus | 1 967 |
acuminatus | 1 604 |
表1 每类害虫样本的数量统计
Tab. 1 Number statistics of samples of different species of pests
害虫种类 | 样本数量 | 害虫种类 | 样本数量 |
---|---|---|---|
Boerner | 2 232 | armandi | 2 346 |
Leconte | 2 450 | coleoptera | 2 091 |
Linnaeus | 1 860 | linnaeus | 1 967 |
acuminatus | 1 604 |
模型 | AP/% | mAP/% | 帧率/FPS | ||||||
---|---|---|---|---|---|---|---|---|---|
Boerner | Leconte | Linnaeus | acuminatus | armandi | coleoptera | linnaeus | |||
YOLOv4 | 95.9 | 94.8 | 85.6 | 70.5 | 89.2 | 81.9 | 91.5 | 87.0 | 25 |
本文模型 | 99.7 | 98.6 | 90.1 | 84.0 | 95.0 | 91.1 | 97.5 | 93.7 | 56 |
表2 本文模型与原YOLOv4模型的客观数据对比
Tab. 2 Comparison of objective data of proposed model and original YOLOv4 model
模型 | AP/% | mAP/% | 帧率/FPS | ||||||
---|---|---|---|---|---|---|---|---|---|
Boerner | Leconte | Linnaeus | acuminatus | armandi | coleoptera | linnaeus | |||
YOLOv4 | 95.9 | 94.8 | 85.6 | 70.5 | 89.2 | 81.9 | 91.5 | 87.0 | 25 |
本文模型 | 99.7 | 98.6 | 90.1 | 84.0 | 95.0 | 91.1 | 97.5 | 93.7 | 56 |
MobileNetV3 | 轻量化 PANet | +CBAM | +Focal Loss | mAP/% | 帧率/FPS |
---|---|---|---|---|---|
87.0 | 25 | ||||
| 86.5 | 43 | |||
| 87.8 | 34 | |||
| 90.2 | 26 | |||
| 91.0 | 30 | |||
| | | | 93.7 | 56 |
表3 消融实验的结果
Tab. 3 Results of ablation experiments
MobileNetV3 | 轻量化 PANet | +CBAM | +Focal Loss | mAP/% | 帧率/FPS |
---|---|---|---|---|---|
87.0 | 25 | ||||
| 86.5 | 43 | |||
| 87.8 | 34 | |||
| 90.2 | 26 | |||
| 91.0 | 30 | |||
| | | | 93.7 | 56 |
注意力模块 | mAP/% | 帧率/FPS |
---|---|---|
无 | 87.0 | 25 |
+SE | 87.8 | 25 |
+ECA | 89.4 | 26 |
+CBAM | 90.2 | 26 |
表4 不同注意力机制的对比
Tab. 4 Comparison of different attention mechanisms
注意力模块 | mAP/% | 帧率/FPS |
---|---|---|
无 | 87.0 | 25 |
+SE | 87.8 | 25 |
+ECA | 89.4 | 26 |
+CBAM | 90.2 | 26 |
模型 | mAP/% | 帧率/FPS | 模型 | mAP/% | 帧率/FPS |
---|---|---|---|---|---|
Faster‑RCNN | 86.6 | 15 | 文献[ | 84.5 | 50 |
SSD | 79.8 | 23 | 本文模型 | 93.7 | 56 |
YOLOv5 | 91.6 | 36 |
表5 本文模型与其他模型的对比
Tab. 5 Comparison of proposed model and other models
模型 | mAP/% | 帧率/FPS | 模型 | mAP/% | 帧率/FPS |
---|---|---|---|---|---|
Faster‑RCNN | 86.6 | 15 | 文献[ | 84.5 | 50 |
SSD | 79.8 | 23 | 本文模型 | 93.7 | 56 |
YOLOv5 | 91.6 | 36 |
1 | 刘汉生. 陷阱式储粮害虫信息采集终端及其系统的研究与实现[D]. 北京:北京邮电大学, 2018. |
LIU H S. The research and implementation of the trap based information acquisition terminal and information system for stored grain pests[D]. Beijing: Beijing University of Posts and Telecommunications, 2018. | |
2 | 竺乐庆,张大兴,张真. 基于韦伯局部描述子和颜色直方图的鳞翅目昆虫翅图像特征描述与种类识别[J]. 昆虫学报, 2015, 58(4): 419-426. |
ZHU L Q, ZHANG D X, ZHANG Z. Feature description of lepidopteran insect wing images based on WLD and HoC and its application in species recognition[J]. Acta Entomologica Sinica, 2015, 58(4): 419-426. | |
3 | GIRSHICK R. Fast R‑CNN[C]// Proceedings of the 2015 IEEE International Conference on Computer Vision. Piscataway: IEEE, 2015: 1440-1448. 10.1109/iccv.2015.169 |
4 | REN S Q, HE K M, GIRSHICK R, et al. Faster R‑CNN: towards real‑time object detection with region proposal networks[C]// Proceedings of the 28th International Conference on Neural Information Processing Systems. Cambridge: MIT Press, 2015:91-99. |
5 | DAI J F, LI Y, HE K M, et al. R‑FCN: object detection via region‑based fully convolutional networks[C]// Proceedings of the 30th International Conference on Neural Information Processing Systems. Red Hook, NY: Curran Associates Inc., 2016: 379-387. |
6 | LIN T Y, DOLLÁR P, GIRSHICK R, et al. Feature pyramid networks for object detection[C]// Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2017: 936-944. 10.1109/cvpr.2017.106 |
7 | REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real‑time object detection[C]// Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2016: 779-788. 10.1109/cvpr.2016.91 |
8 | REDMON J, FARHADI A. YOLO9000: better, faster, stronger[C]// Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2017: 6517-6525. 10.1109/cvpr.2017.690 |
9 | REDMON J, FARHADI A. YOLOv3: an incremental improvement[EB/OL]. (2018-04-08) [2021-12-10].. 10.1109/cvpr.2017.690 |
10 | BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection[EB/OL]. (2020-04-23) [2021-11-05].. |
11 | LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multiBox detector[C]// Proceedings of the 2016 European Conference on Computer Vision, LNCS 9905. Cham: Springer, 2016: 21-37. |
12 | 苗海委,周慧玲. 基于深度学习的粘虫板储粮害虫图像检测算法的研究[J]. 中国粮油学报, 2019, 34(12): 93-99. 10.3969/j.issn.1003-0174.2019.12.016 |
MIAO H W, ZHOU H L. Detection of stored‑grain insects image on sticky board using deep learning[J]. Journal of the Chinese Cereals and Oils Association, 2019, 34(12): 93-99. 10.3969/j.issn.1003-0174.2019.12.016 | |
13 | 候瑞环,杨喜旺,王智超,等. 一种基于YOLOv4‑TIA的林业害虫实时检测方法[J]. 计算机工程, 2022, 48(4): 255-261. |
HOU R H, YANG X W, WANG Z C, et al. A real‑time detection methods for forestry pests based on YOLOv4‑TIA[J]. Computer Engineering, 2022, 48(4): 255-261. | |
14 | 袁哲明,袁鸿杰,言雨璇,等. 基于深度学习的轻量化田间昆虫识别及分类模型[J]. 吉林大学学报(工学版), 2021, 51(3): 1131-1139. |
YUAN Z M, YUAN H J, YAN Y X, et al. Automatic recognition and classification of field insects based on lightweight deep learning model[J]. Journal of Jilin University (Engineering and Technology Edition), 2021, 51(3): 1131-1139. | |
15 | 李启运,纪庆革,洪赛丁. FastFace:实时鲁棒的人脸检测算法[J]. 中国图象图形学报, 2019, 24(10): 1761-1771. 10.11834/jig.180662 |
LI Q Y, JI Q G, HONG S D. FastFace: a real‑time robust algorithm for face detection[J]. Journal of Image and Graphics, 2019, 24(10): 1761-1771. 10.11834/jig.180662 | |
16 | 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]. (2016-11-04) [2021-11-22].. |
17 | HOWARD A G, ZHU M L, CHEN B, et al. MobileNets: efficient convolutional neural networks for mobile vision applications[EB/OL]. (2017-04-17) [2021-12-08].. 10.48550/arXiv.1704.04861 |
18 | SANDLER M, HOWARD A, ZHU M L, et al. MobileNetV2: inverted residuals and linear bottlenecks[C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018: 4510-4520. 10.1109/cvpr.2018.00474 |
19 | HOWARD A, SANDLER M, CHEN B, et al. Searching for MobileNetV3[C]// Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE, 2019: 1314-1324. 10.1109/iccv.2019.00140 |
20 | ZHANG X Y, ZHOU X Y, LIN M X, et al. ShuffleNet: an extremely efficient convolutional neural network for mobile devices[C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018: 6848-6856. 10.1109/cvpr.2018.00716 |
21 | MA N N, ZHANG X Y, ZHENG H T, et al. ShuffleNet V2: practical guidelines for efficient CNN architecture design[C]// Proceedings of the 2018 European Conference on Computer Vision, LNCS 11218. Cham: Springer, 2018: 122-138. |
22 | HAN K, WANG Y H, TIAN Q, et al. GhostNet: more features from cheap operations[C]// Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2020: 1577-1586. 10.1109/cvpr42600.2020.00165 |
23 | WOO S, PARK J, LEE J Y, et al. CBAM: convolutional block attention module[C]// Proceedings of the 2018 European Conference on Computer Vision, LNCS 11211. Cham: Springer, 2018: 3-19. |
[1] | 李钟华, 白云起, 王雪津, 黄雷雷, 林初俊, 廖诗宇. 基于图像增强的低照度人脸检测[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2588-2594. |
[2] | 邓凯丽, 魏伟波, 潘振宽. 改进掩码自编码器的工业缺陷检测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2595-2603. |
[3] | 孔哲, 李寒, 甘少伟, 孔明茹, 何冰涛, 郭子钰, 金督程, 邱兆文. 基于非对称多解码器和注意力模块的三维肾脏影像结构分割模型[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2216-2224. |
[4] | 程小辉, 黄云天, 张瑞芳. 基于多尺度和加权坐标注意力的轻量化红外道路场景检测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1927-1934. |
[5] | 李威, 陈玲, 徐修远, 朱敏, 郭际香, 周凯, 牛颢, 张煜宸, 易珊烨, 章毅, 罗凤鸣. 基于多任务学习的间质性肺病分割算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1285-1293. |
[6] | 陈天华, 朱家煊, 印杰. 基于注意力机制的鸟类识别算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1114-1120. |
[7] | 刘涛, 鞠事宏, 高一萌. 基于改进YOLOv8n的无人机视角下小目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3603-3609. |
[8] | 李大海, 李冰涛, 王振东. 基于改进YOLOv8的水下目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3610-3616. |
[9] | 王宏, 钱清, 王欢, 龙永. 融合大核注意力卷积的轻量化图像篡改定位算法[J]. 《计算机应用》唯一官方网站, 2023, 43(9): 2692-2699. |
[10] | 郭祥, 姜文刚, 王宇航. 基于改进Inception-ResNet的加密流量分类方法[J]. 《计算机应用》唯一官方网站, 2023, 43(8): 2471-2476. |
[11] | 吕宗喆, 徐慧, 杨骁, 王勇, 王唯鉴. 面向小目标的YOLOv5安全帽检测算法[J]. 《计算机应用》唯一官方网站, 2023, 43(6): 1943-1949. |
[12] | 陈志, 李歆, 林丽燕, 钟婧, 时鹏. 引入门控轴向自注意力的多通道病理图像分割[J]. 《计算机应用》唯一官方网站, 2023, 43(4): 1269-1277. |
[13] | 祖佳贞, 周永霞, 陈乐. 结合注意力的双分支残差低光照图像增强[J]. 《计算机应用》唯一官方网站, 2023, 43(4): 1240-1247. |
[14] | 姚英茂, 姜晓燕. 基于图卷积网络与自注意力图池化的视频行人重识别方法[J]. 《计算机应用》唯一官方网站, 2023, 43(3): 728-735. |
[15] | 伏博毅, 彭云聪, 蓝鑫, 秦小林. 基于深度学习的标签噪声学习算法综述[J]. 《计算机应用》唯一官方网站, 2023, 43(3): 674-684. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||