《计算机应用》唯一官方网站 ›› 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]. 《计算机应用》唯一官方网站, 2022, 42(7): 2118-2124. |
[2] | 钟志峰, 夏一帆, 周冬平, 晏阳天. 基于改进YOLOv4的轻量化目标检测算法[J]. 《计算机应用》唯一官方网站, 2022, 42(7): 2201-2209. |
[3] | 危德健, 王文明, 王全玉, 任好盼, 高彦彦, 王志. 改进的基于锚点的三维手部姿态估计网络[J]. 《计算机应用》唯一官方网站, 2022, 42(3): 953-959. |
[4] | 吕剑清, 王先兵, 陈刚, 张华, 王明刚. 面向工业生产的中文Text-to-SQL模型[J]. 《计算机应用》唯一官方网站, 2022, 42(10): 2996-3002. |
[5] | 吴奇文, 王建华, 郑翔, 冯居, 姜洪岩, 王昱博. 基于改进U-Net的水草图像分割方法[J]. 《计算机应用》唯一官方网站, 2022, 42(10): 3177-3183. |
[6] | 王素玉, 杨静, 李越. 基于双注意力机制信息蒸馏网络的图像超分辨率复原算法[J]. 《计算机应用》唯一官方网站, 2022, 42(1): 239-244. |
[7] | 王月, 江逸茗, 兰巨龙. 基于改进三元组网络和K近邻算法的入侵检测[J]. 计算机应用, 2021, 41(7): 1996-2002. |
[8] | 蒋宁, 方景龙, 杨庆. 基于单点多盒检测器的全局-局部层级的域适应目标检测[J]. 计算机应用, 2021, 41(2): 517-522. |
[9] | 高闯, 唐冕, 赵亮. 基于L-Metric重叠子图发现的B细胞表位预测模型[J]. 《计算机应用》唯一官方网站, 2021, 41(12): 3702-3706. |
[10] | 汪涛, 靳聪, 李小兵, 帖云, 齐林. 基于Transformer的多轨音乐生成对抗网络[J]. 《计算机应用》唯一官方网站, 2021, 41(12): 3585-3589. |
[11] | 赵扬, 李波. 基于增强生成器条件生成对抗网络的单幅图像去雾[J]. 《计算机应用》唯一官方网站, 2021, 41(12): 3686-3691. |
[12] | 袁野, 谭晓阳. 复杂环境下的冰箱金属表面缺陷检测[J]. 计算机应用, 2021, 41(1): 270-274. |
[13] | 江金洪, 鲍胜利, 史文旭, 韦振坤. 基于YOLO v3算法改进的交通标志识别算法[J]. 计算机应用, 2020, 40(8): 2472-2478. |
[14] | 邓雄, 王洪春. 基于深度学习和特征融合的人脸活体检测算法[J]. 计算机应用, 2020, 40(4): 1009-1015. |
[15] | 杨文霞, 王萌, 张亮. 基于密集连接块U-Net的语义人脸图像修复[J]. 计算机应用, 2020, 40(12): 3651-3657. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||