浙江农业学报 ›› 2025, Vol. 37 ›› Issue (10): 2198-2208.DOI: 10.3969/j.issn.1004-1524.20240868
收稿日期:2024-10-10
出版日期:2025-10-25
发布日期:2025-11-13
作者简介:李萌民(2000—),女,湖南嘉禾人,硕士研究生,主要从事计算机视觉研究。E-mail:330200669@qq.com
通讯作者:
刘朔,E-mail:874417154@qq.com
基金资助:
LI Mengmin(
), LIU Shuo(
), OUYANG Yu, ZHANG Peng
Received:2024-10-10
Online:2025-10-25
Published:2025-11-13
摘要:
为提高模型对柑橘叶片边缘病害和小目标病变的检测准确率,提升现有检测模型的性能,提出一种基于YOLOv8n基准模型的高效轻量化目标检测模型YOLOv8-DTBI。首先,在基准模型的骨干网络中引入更加轻量化的C2f_DT模块。该模块采用双卷积(dual convolution)和三重注意力机制(triplet attention)的组合结构,以增强模型的特征提取能力。其次,在基准模型中引入双向特征金字塔网络(BiFPN)并构建小目标检测层,在降低模型参数量的同时提高模型对柑橘叶片病害小目标的检测能力。最后,基于Inner IoU损失函数对模型进行训练,加速边界框回归,提高模型准确率和召回率。实验结果表明,所提出的YOLOv8-DTBI模型的准确率、召回率、平均精度均值(mAP)分别为89.2%、90.8%和92.1%,相较基准模型分别提高了5.6、5.3和1.4百分点,同时模型大小降低了8.5%,在柑橘叶片病害数据集上展现出更好的检测性能。此项研究为柑橘叶片病害的精准检测提供了一种切实可行的检测模型。
中图分类号:
李萌民, 刘朔, 欧阳宇, 张鹏. 基于YOLOv8n的高效轻量化柑橘叶片病害检测模型[J]. 浙江农业学报, 2025, 37(10): 2198-2208.
LI Mengmin, LIU Shuo, OUYANG Yu, ZHANG Peng. An efficient and lightweight citrus leaf disease detection model based on YOLOv8n[J]. Acta Agriculturae Zhejiangensis, 2025, 37(10): 2198-2208.
| 标签 Label | 类型 Type | 图像数量Quantity of images | ||||
|---|---|---|---|---|---|---|
| 增强前 Before enhancement | 增强后 After enhancement | 训练集 Training set | 验证集 Validation set | 测试集 Test set | ||
| 0 | 黑斑病Black spot | 223 | 1 115 | 892 | 112 | 111 |
| 1 | 黑点病Melanose | 297 | 1 188 | 950 | 119 | 119 |
| 2 | 溃疡病Canker | 335 | 1 340 | 1 072 | 134 | 134 |
| 3 | 黄龙病Huanglongbing | 291 | 1 164 | 931 | 117 | 116 |
| 4 | 健康Healthy | 231 | 1 155 | 924 | 116 | 115 |
表1 数据集的基本信息
Table 1 Basic information of dataset
| 标签 Label | 类型 Type | 图像数量Quantity of images | ||||
|---|---|---|---|---|---|---|
| 增强前 Before enhancement | 增强后 After enhancement | 训练集 Training set | 验证集 Validation set | 测试集 Test set | ||
| 0 | 黑斑病Black spot | 223 | 1 115 | 892 | 112 | 111 |
| 1 | 黑点病Melanose | 297 | 1 188 | 950 | 119 | 119 |
| 2 | 溃疡病Canker | 335 | 1 340 | 1 072 | 134 | 134 |
| 3 | 黄龙病Huanglongbing | 291 | 1 164 | 931 | 117 | 116 |
| 4 | 健康Healthy | 231 | 1 155 | 924 | 116 | 115 |
图2 YOLOv8-DTBI网络的架构 Input,输入;Backbone,骨干网络;Neck,颈部;Head,头部;Concat,拼接;Upsample,上采样;Bbox.Loss,目标框损失;Cls.Loss,类别损失;Bottleneck,(模块中的)颈部;Conv,卷积;DualConv,双卷积;MaxPool,最大池化;BN,批标准化;Triplet attention,三重注意力机制。下同。
Fig.2 Structure of YOLOv8-DTBI network Bbox.Loss, Bounding box loss; Cls.Loss, Classification loss; Conv, Convolution; DualConv, Dual convolution; MaxPool, Max pooling; BN, Batch normalization. The same as below.
| 模块 Module | 将模块嵌入不同位置后模型的精度 Precision of models with module deployed at different locations | ||
|---|---|---|---|
| 骨干网络 Backbone | 颈部 Neck | 骨干网络+颈部 Backbone+neck | |
| C2f | — | — | 83.6 |
| C2f_SE | 86.6 | 83.5 | 88.8 |
| C2f_CBAM | 87.0 | 87.4 | 84.5 |
| C2f_DT | 89.2 | 84.3 | 87.8 |
表2 将注意力机制嵌入不同位置对YOLOv8n模型精度的影响
Table 2 Precision of YOLOv8n with attention mechanism deployed at different locations %
| 模块 Module | 将模块嵌入不同位置后模型的精度 Precision of models with module deployed at different locations | ||
|---|---|---|---|
| 骨干网络 Backbone | 颈部 Neck | 骨干网络+颈部 Backbone+neck | |
| C2f | — | — | 83.6 |
| C2f_SE | 86.6 | 83.5 | 88.8 |
| C2f_CBAM | 87.0 | 87.4 | 84.5 |
| C2f_DT | 89.2 | 84.3 | 87.8 |
图6 YOLOv8n和YOLOv8-DTBI模型在小目标检测上的效果对比 图中的数值为置信度分数。下同。
Fig.6 Comparison of performance of YOLOv8n and YOLOv8-DTBI models on small target detection The values in the above figures are confidence scores. The same as below.
| 损失函数 Loss function | P | R | mAP@50 | F1 |
|---|---|---|---|---|
| CIoU | 83.6 | 85.5 | 90.7 | 84.5 |
| EIoU | 85.1 | 89.9 | 91.1 | 87.4 |
| GIoU | 85.5 | 89.3 | 90.1 | 87.4 |
| SIoU | 87.9 | 87.4 | 91.1 | 87.6 |
| Inner IoU | 89.2 | 90.8 | 92.1 | 90.9 |
表3 不同损失函数对模型性能的影响
Table 3 Effects of different loss functions on performace of model %
| 损失函数 Loss function | P | R | mAP@50 | F1 |
|---|---|---|---|---|
| CIoU | 83.6 | 85.5 | 90.7 | 84.5 |
| EIoU | 85.1 | 89.9 | 91.1 | 87.4 |
| GIoU | 85.5 | 89.3 | 90.1 | 87.4 |
| SIoU | 87.9 | 87.4 | 91.1 | 87.6 |
| Inner IoU | 89.2 | 90.8 | 92.1 | 90.9 |
| r | P | R | mAP@50 | F1 |
|---|---|---|---|---|
| 0.5 | 84.7 | 87.5 | 90.0 | 86.1 |
| 0.6 | 88.6 | 89.6 | 90.9 | 89.1 |
| 0.7 | 89.0 | 85.7 | 90.1 | 87.3 |
| 0.8 | 83.5 | 89.2 | 90.3 | 86.3 |
| 0.9 | 87.0 | 84.5 | 90.8 | 85.7 |
| 1.0 | 89.2 | 90.8 | 92.1 | 90.0 |
| 1.1 | 87.3 | 88.9 | 90.8 | 88.1 |
| 1.2 | 87.4 | 87.9 | 90.3 | 87.6 |
| 1.3 | 85.9 | 89.3 | 91.0 | 87.6 |
| 1.4 | 87.8 | 89.3 | 92.0 | 88.5 |
| 1.5 | 87.1 | 88.8 | 91.3 | 87.9 |
表4 比例因子(r)对模型性能的影响
Table 4 Effects of ratio (r) on performance of model
| r | P | R | mAP@50 | F1 |
|---|---|---|---|---|
| 0.5 | 84.7 | 87.5 | 90.0 | 86.1 |
| 0.6 | 88.6 | 89.6 | 90.9 | 89.1 |
| 0.7 | 89.0 | 85.7 | 90.1 | 87.3 |
| 0.8 | 83.5 | 89.2 | 90.3 | 86.3 |
| 0.9 | 87.0 | 84.5 | 90.8 | 85.7 |
| 1.0 | 89.2 | 90.8 | 92.1 | 90.0 |
| 1.1 | 87.3 | 88.9 | 90.8 | 88.1 |
| 1.2 | 87.4 | 87.9 | 90.3 | 87.6 |
| 1.3 | 85.9 | 89.3 | 91.0 | 87.6 |
| 1.4 | 87.8 | 89.3 | 92.0 | 88.5 |
| 1.5 | 87.1 | 88.8 | 91.3 | 87.9 |
| 样本类型 Sample type | 不同模型的精度 Precision of different models | 不同模型的mAP@50 mAP@50 of different models | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| YOLOv8n | YOLOv8n- C2f_DT | YOLOv8n- BiFPN | YOLOv8n- Inner IoU | YOLOv8- DTBI | YOLOv8n | YOLOv8n- C2f_DT | YOLOv8n- BiFPN | YOLOv8n- Inner IoU | YOLOv8- DTBI | ||
| 黑斑病 Black spot | 89.6 | 98.5 | 98.3 | 97.1 | 98.9 | 98.1 | 99.5 | 98.7 | 98.9 | 99.5 | |
| 黑点病 Melanose | 79.9 | 81.4 | 80.5 | 79.5 | 80.0 | 89.3 | 86.1 | 89.1 | 91.2 | 91.4 | |
| 溃疡病Canker | 75.2 | 82.5 | 83.8 | 82.0 | 87.0 | 85.3 | 86.2 | 85.4 | 87.4 | 87.0 | |
| 黄龙病 Huanglongbing | 76.9 | 82.4 | 77.6 | 87.2 | 83.1 | 82.6 | 86.8 | 83.7 | 84.7 | 83.2 | |
| 健康Healthy | 96.3 | 95.4 | 97.5 | 95.8 | 97.1 | 98.3 | 99.1 | 99.0 | 98.5 | 99.4 | |
| 全部All | 83.6 | 88.0 | 87.5 | 88.3 | 89.2 | 90.7 | 91.5 | 91.2 | 92.1 | 92.1 | |
表5 不同改进点对模型性能的影响
Table 5 Effects of different structure improvement on performance of model %
| 样本类型 Sample type | 不同模型的精度 Precision of different models | 不同模型的mAP@50 mAP@50 of different models | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| YOLOv8n | YOLOv8n- C2f_DT | YOLOv8n- BiFPN | YOLOv8n- Inner IoU | YOLOv8- DTBI | YOLOv8n | YOLOv8n- C2f_DT | YOLOv8n- BiFPN | YOLOv8n- Inner IoU | YOLOv8- DTBI | ||
| 黑斑病 Black spot | 89.6 | 98.5 | 98.3 | 97.1 | 98.9 | 98.1 | 99.5 | 98.7 | 98.9 | 99.5 | |
| 黑点病 Melanose | 79.9 | 81.4 | 80.5 | 79.5 | 80.0 | 89.3 | 86.1 | 89.1 | 91.2 | 91.4 | |
| 溃疡病Canker | 75.2 | 82.5 | 83.8 | 82.0 | 87.0 | 85.3 | 86.2 | 85.4 | 87.4 | 87.0 | |
| 黄龙病 Huanglongbing | 76.9 | 82.4 | 77.6 | 87.2 | 83.1 | 82.6 | 86.8 | 83.7 | 84.7 | 83.2 | |
| 健康Healthy | 96.3 | 95.4 | 97.5 | 95.8 | 97.1 | 98.3 | 99.1 | 99.0 | 98.5 | 99.4 | |
| 全部All | 83.6 | 88.0 | 87.5 | 88.3 | 89.2 | 90.7 | 91.5 | 91.2 | 92.1 | 92.1 | |
| 模型 Model | P | R | mAP@50 | 参数量 Parameters/MB | 模型大小 Model size/MB |
|---|---|---|---|---|---|
| SSD | 82.5 | 84.9 | 89.7 | 25.6 | 92.6 |
| Faster R-CNN | 83.2 | 85.3 | 91.3 | 72.4 | 521.3 |
| YOLOv7n | 80.3 | 82.7 | 87.5 | 3.7 | 74.9 |
| YOLOv8n | 83.6 | 85.5 | 90.7 | 3.0 | 5.9 |
| YOLOv9s | 84.1 | 86.4 | 91.6 | 9.7 | 19.4 |
| YOLOv8-DTBI | 89.2 | 90.8 | 92.1 | 2.4 | 5.4 |
表6 不同模型的性能对比
Table 6 Comparison of performace of different models
| 模型 Model | P | R | mAP@50 | 参数量 Parameters/MB | 模型大小 Model size/MB |
|---|---|---|---|---|---|
| SSD | 82.5 | 84.9 | 89.7 | 25.6 | 92.6 |
| Faster R-CNN | 83.2 | 85.3 | 91.3 | 72.4 | 521.3 |
| YOLOv7n | 80.3 | 82.7 | 87.5 | 3.7 | 74.9 |
| YOLOv8n | 83.6 | 85.5 | 90.7 | 3.0 | 5.9 |
| YOLOv9s | 84.1 | 86.4 | 91.6 | 9.7 | 19.4 |
| YOLOv8-DTBI | 89.2 | 90.8 | 92.1 | 2.4 | 5.4 |
| [1] | 周志英. 柑橘绿色种植与管理技术要点[J]. 河北农业, 2024(8): 86-87. |
| ZHOU Z Y. Key points of citrus green planting and management technology[J]. Hebei Agriculture, 2024(8): 86-87. (in Chinese with English abstract) | |
| [2] | 彭桂芳, 向长海. 农文旅融合视域下我国柑橘产业可持续发展研究[J]. 当代县域经济, 2024 (8):22-25. |
| PENG G F. XIANG C H. Research on the sustainable development of Chinese citrus industry from the perspective of agricultural, cultural and tourism integration[J]. Dangdai Xianyu Jingji, 2024 (8): 22-25. (in Chinese) | |
| [3] | 贾惠, 伍希志, 薛洋, 等. 基于迁移学习和数据增强的小样本柑橘缺陷检测研究[J]. 农业与技术, 2024, 44(2): 23-27. |
| JIA H, WU X Z, XUE Y, et al. Research on defect detection of small sample citrus based on transfer learning and data enhancement[J]. Agriculture and Technology, 2024, 44(2): 23-27. (in Chinese with English abstract) | |
| [4] | 谭彬, 蔡健荣, 许骞, 等. 基于注意力机制改进卷积神经网络的柑橘病虫害识别[J]. 江苏农业科学, 2024, 52(8): 176-182. |
| TAN B, CAI J R, XU J, et al. Recognition of citrus pests and diseases based on attention mechanism improved convolutional neural networks[J]. Jiangsu Agricultural Sciences, 2024, 52(8): 176-182. (in Chinese with English abstract) | |
| [5] | REN S Q, HE K M, GIRSHICK R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149. |
| [6] | HE K M, GKIOXARI G, DOLLAR P, et al. Mask R-CNN[C]// 2017 IEEE International Conference on Computer Vision (ICCV). October 22-29, 2017. Venice. New York: IEEE, 2017: 2980-2988. |
| [7] | 王云露, 吴杰芳, 兰鹏, 等. 基于改进Faster R-CNN的苹果叶部病害识别方法[J]. 林业工程学报, 2022, 7(1): 153-159. |
| WANG Y L, WU J F, LAN P, et al. Apple disease identification using improved Faster R-CNN[J]. Journal of Forestry Engineering, 2022, 7(1): 153-159. (in Chinese with English abstract) | |
| [8] | 杨宁, 程巍, 张钊源, 等. 基于Mask R-CNN的稻瘟病图像片上识别算法[J/OL]. 农业机械学报, 2024: 1-10. (2024-05-21)[2024-10-10]. https://kns.cnki.net/KCMS/detail/detail.aspxfilename=NYJX20240516003&dbname=CJFD&dbcode=CJFQ. |
| YANG N, CHENG W, ZHANG Z Y, et al. Mask R-CNN based on-chip recognition algorithm for rice blast image[J/OL]. Transactions of the Chinese Society for Agricultural Machinery, 2024: 1-10. (2024-05-21)[2024-10-10]. https://kns.cnki.net/KCMS/detail/detail.aspxfilename=NYJX20240516003&dbname=CJFD&dbcode=CJFQ. (in Chinese with English abstract) | |
| [9] | LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot MultiBox detector[C]// Computer Vision:ECCV 2016. Cham: Springer, 2016: 21-37. |
| [10] | REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once:unified, real-time object detection[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). June 27-30, 2016, Las Vegas, NV, USA. New York: IEEE, 2016: 779-788. |
| [11] | 李大华, 孔舒, 李栋, 等. 基于改进SSD模型的柑橘叶片病害轻量化检测模型[J]. 浙江农业学报, 2024, 36(3): 662-670. |
| LI D H, KONG S, LI D, et al. Lightweight detection model of citrus leaf disease based on improved SSD[J]. Acta Agriculturae Zhejiangensis, 2024, 36(3): 662-670. (in Chinese with English abstract) | |
| [12] | 郑宇达, 陈仁凡, 杨长才, 等. 基于改进YOLOv5s模型的柑橘病虫害识别方法[J]. 华中农业大学学报, 2024, 43(2): 134-143. |
| ZHENG Y D, CHEN R F, YANG C C, et al. Improved YOLOv5s based identification of pests and diseases in citrus[J]. Journal of Huazhong Agricultural University, 2024, 43(2): 134-143. (in Chinese with English abstract) | |
| [13] | 贾雪莹, 赵春江, 周娟, 等. 基于改进YOLOv7模型的柑橘表面缺陷在线检测[J]. 农业工程学报, 2023, 39(23): 142-151. |
| JIA X Y, ZHAO C J, ZHOU J, et al. Online detection of citrus surface defects using improved YOLOv7 modeling[J]. Transactions of the Chinese Society of Agricultural Engineering, 2023, 39(23): 142-151. (in Chinese with English abstract) | |
| [14] | 岳凯, 张鹏超, 王磊, 等. 基于改进YOLOv8n的复杂环境下柑橘识别[J]. 农业工程学报, 2024, 40(8): 152-158. |
| YUE K, ZHANG P C, WANG L, et al. Recognizing citrus in complex environment using improved YOLOv8n[J]. Transactions of the Chinese Society of Agricultural Engineering, 2024, 40(8): 152-158. (in Chinese with English abstract) | |
| [15] | ZHONG J C, CHEN J Y, MIAN A. DualConv: dual convolutional kernels for lightweight deep neural networks[J]. IEEE Transactions on Neural Networks and Learning Systems, 2022, 34(11): 9528-9535. |
| [16] | MISRA D, NALAMADA T, ARASANIPALAI A U, et al. Rotate to attend:convolutional triplet attention module[C]// 2021 IEEE Winter Conference on Applications of Computer Vision (WACV). January 3-8, 2021, Waikoloa, HI, USA. New York: IEEE, 2021: 3138-3147. |
| [17] | KRIZHEVSKY A, SUTSKEVER I, HINTON G E. ImageNet classification with deep convolutional neural networks[J]. Communications of the ACM, 2017, 60(6): 84-90. |
| [18] | SINGH P, VERMA V K, RAI P, et al. HetConv:heterogeneous kernel-based convolutions for deep CNNs[C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 15-20, 2019, Long Beach, CA, USA. New York: IEEE, 2019: 4830-4839. |
| [19] | HU J, SHEN L, SUN G. Squeeze-and-excitation networks[C]// 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. June 18-23, 2018, Salt Lake City, UT, USA. New York: IEEE, 2018: 7132-7141. |
| [20] | WOO S, PARK J, LEE J Y, et al. CBAM: convolutional block attention module[C]// Computer Vision:ECCV 2018. Cham: Springer, 2018: 3-19. |
| [21] | TAN M X, PANG R M, LE Q V. EfficientDet:scalable and efficient object detection[C]// 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 13-19, 2020, Seattle, WA, USA. New York: IEEE, 2020: 10778-10787. |
| [22] | WANG X F, SONG J. ICIoU: improved loss based on complete intersection over union for bounding box regression[J]. IEEE Access, 2021, 9: 105686-105695. |
| [23] | ZHANG H, XU C, ZHANG S. Inner-IoU: more effective intersection over union loss with auxiliary bounding box[EB/OL]. (2023-11-14) [2024-10-10]. https://arxiv.org/abs/2311.02877. |
| [24] | YANG Z M, WANG X L, LI J G. EIoU: an improved vehicle detection algorithm based on VehicleNet neural network[J]. Journal of Physics: Conference Series, 2021, 1924(1): 012001. |
| [25] | REZATOFIGHI H, TSOI N, GWAK J, et al. Generalized intersection over union:a metric and a loss for bounding box regression[C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 15-20, 2019, Long Beach, CA, USA. New York: IEEE, 2019: 658-666. |
| [26] | GEVORGYAN Z. SIoU loss: More powerful learning for bounding box regression[EB/OL]. (2022-05-25) [2024-10-10]. https://arxiv.org/abs/2205.12740. |
| [27] | WANG C Y, YEH I H, MARK LIAO H Y. YOLOv9: learning what you want to learn using programmable gradient information[C]// Computer Visio:ECCV 2024. Cham: Springer, 2025: 1-21. |
| [1] | 吕胤春, 段恩泽, 朱一星, 郑霞, 柏宗春. 基于YOLOv8-Swin Transformer模型的翻覆肉鸭实时检测[J]. 浙江农业学报, 2025, 37(7): 1556-1566. |
| [2] | 郭秀明, 王大伟, 刘升平, 诸叶平, 刘晓辉, 林克剑, 王佳宇, 李非. 基于深度学习的近地面草原鼠洞识别计数关键问题研究与应用[J]. 浙江农业学报, 2024, 36(9): 2146-2154. |
| [3] | 宁文楷, 李静, 沈晓东, 吴鑫, 李臻锋. 南瓜干燥过程中β-胡萝卜素的多源融合预测[J]. 浙江农业学报, 2023, 35(8): 1876-1887. |
| [4] | 闫宁, 张晗, 董宏图, 康凯, 罗斌. 基于透射光和反射光图像同位分割的小麦品种识别方法研究[J]. 浙江农业学报, 2022, 34(3): 590-598. |
| [5] | 包晓敏, 盛家文. 粘虫板害虫自动识别计数研究[J]. 浙江农业学报, 2019, 31(9): 1516-1522. |
| [6] | 伍渊远, 尚欣, 张呈彬, 谢新义. 自然光照下智能叶菜收获机作业参数的获取[J]. 浙江农业学报, 2017, 29(11): 1930-1937. |
| [7] | 田海韬, 赵军, 蒲富鹏. 马铃薯芽眼图像的分割与定位方法[J]. 浙江农业学报, 2016, 28(11): 1947-1953. |
| [8] | 任磊1,张俊2,*,陆胜民2. 脱囊衣橘片自动分拣机器视觉算法研究[J]. 浙江农业学报, 2015, 27(12): 2212-. |
| [9] | 刘建军;姚立健;彭樟林. 基于机器视觉的山核桃等级检测技术[J]. , 2010, 22(6): 854-858. |
| [10] | 梁琨;罗汉亚;沈明霞;*;何瑞银;张璐. 水稻播种质量检测技术的研究进展及展望[J]. , 2010, 22(2): 0-257. |
| [11] | 王勇;沈明霞;姬长英. 基于色差信息的田间成熟棉花识别[J]. , 2007, 19(5): 0-388. |
| 阅读次数 | ||||||
|
全文 |
|
|||||
|
摘要 |
|
|||||