基于改进YOLOv5对果园环境中李的识别
CSTR:
作者:
作者单位:

1.四川农业大学信息工程学院,雅安 625014;2.雅安市数字农业工程技术研究中心,雅安 625014

作者简介:

贺英豪,E-mail:heyinghao@sicau.edu.cn

通讯作者:

倪铭,E-mail:nm@sicau.edu.cn

中图分类号:

TP391.4

基金项目:

四川省自然科学基金项目(2022NSFSC0172);四川农业大学专业建设支持计划(040-2121997775)


Recognizing plums in orchard environment based on improved YOLOv5
Author:
Affiliation:

1.College of Information Engineering Sichuan Agricultural University, Ya’an 625014, China;2.Ya’an Digital Agricultural Engineering Technology Research Center, Ya’an 625014, China

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献 [28]
  • |
  • 相似文献 [20]
  • | | |
  • 文章评论
    摘要:

    为提高果园中高遮挡和密集的李(Prunus salicina Lindl.)的检测精度,提出一种改进YOLOv5s模型,在促进模型轻量化的同时提高模型对李的检测精度。首先,使用新的结构Focus-Maxpool模块替换主干网络中的下采样卷积,使改进模型在下采样时能够保留更多高遮挡目标和小目标的特征信息。其次,使用focal loss和交叉熵函数的加权损失作为改进模型的分类损失,提升改进模型对粘连目标的识别能力。最后,设计若干组检测试验来评价改进模型的性能。结果显示,改进YOLOv5s模型的平均精度优于YOLOv5s、YOLOv4、Faster-RCNN、SSD和Centernet;与YOLOv5s模型的检测结果相比,改进YOLOv5s模型的平均精度、召回率和精度分别提高2.84、9.53和1.66百分点,检测速度可达到91.37帧/s,能够满足实时检测需求。研究结果表明,改进的YOLOv5s模型在真实果园环境下具有较高的检测精度和鲁棒性。

    Abstract:

    This article proposed an improved YOLOv5s model to improve the accuracy of detecting plums (Prunus salicina Lindl.) with high occlusion and density in orchards and the lightweight. Firstly, a new Focus-Maxpool module was used to replace the down-sampling convolution in the backbone network, enabling the model to retain more feature information of small and highly occluded targets during down-sampling. Secondly, the weighted loss of focal loss and cross-entropy function was used as the classification loss of the model to improve its recognition ability for adhesive targets. Finally, several sets of detection experiments were designed to evaluate the performance of the model. The results showed that the average accuracy of the improved YOLOv5s model was better than that of YOLOv5s,YOLOv4,Faster RCNN,SSD,and Centernet. Compared with the detection results of the YOLOv5s model, the average accuracy, recall rate, and accuracy of the improved model increased by 2.84,9.53,and 1.66 percentages, respectively. The detection speed of the improved model reached 91.37 frames per second, meeting the requirements of real-time detection. It is indicated that the model improved has higher accuracy of detection and robustness in real orchard environments. It will provide data reference for studying fruit-picking robots and monitoring orchard environments.

    表 2 不同密度情况下的检测结果Table 2 Test results at different densities
    表 3 消融试验结果Table 3 Result of ablation test
    图1 图片标注示例Fig.1 Example of image annotation
    图2 Focus模块Fig.2 Focus module
    图3 Focus-Maxpool模块Fig.3 Focus-Maxpool module
    图4 YOLOv5s改进前后的主干网络结构Fig.4 Backbone network structure before and after YOLOv5s improvements
    图5 改进YOLOv5s网络结构Fig.5 Improved YOLOv5s network architecture
    图6 YOLOv5s改进前后的检测结果Fig.6 Detection results before and after the improvement of YOLOv5s
    图7 YOLOv5s改进前后的损失曲线Fig.7 Loss curve before and after YOLOv5s improvements
    图8 YOLOv5s模型改进前后对不同密度李的检测结果Fig.8 Detection results of different densities of plums before and after improvement of YOLOv5s model
    图9 不同模型对不同大小目标的检测结果Fig.9 Detection results of different models for targets of different sizes
    表 4 改进YOLOv5s与其他模型的性能对比试验结果Table 4 Experimental results comparing performance of improved YOLOv5s with other models
    表 1 YOLOv5s模型改进前后的结果对比Table 1 Comparison of results before and after improvement of the YOLOv5s model
    参考文献
    [1] 李东,李静雅,雷雨,等.李子的品质特性及其精深加工产品研究进展[J].北方园艺,2022(19):128-135.LI D,LI J Y,LEI Y,et al.Research progress on quality characteristics and intensive processing products of plum (Prunus salicina Lindl.)[J].Northern horticulture,2022(19):128-135(in Chinese with English abstract).
    [2] 李欣,王玉德.基于颜色模型和阈值分割的有遮挡的柑橘果实识别算法[J].计算技术与自动化,2022,41(2):136-140.LI X,WANG Y D.Occluded Citrus fruit recognition algorithm based on color model and threshold segmentation[J].Computing technology and automation,2022,41(2):136-140(in Chinese with English abstract).
    [3] 周文静,马晓晓,张洚宇,等.基于颜色因子逻辑与运算的田间红葡萄果穗识别[J].南方农机,2022,53(7):16-18.ZHOU W J,MA X X,ZHANG J Y,et al.Ear recognition of field red grape based on color factor logic and operation[J].China southern agricultural machinery,2022,53(7):16-18(in Chinese).
    [4] 杨晓珍.基于数字图像技术的西红柿智能分类[J].单片机与嵌入式系统应用,2022,22(1):79-83.YANG X Z.Intelligent classification of tomatoes based on digital image technology[J].Microcontrollers & embedded systems,2022,22(1):79-83(in Chinese with English abstract).
    [5] 吕佳,李帅军,曾梦瑶,等.基于半监督SPM-YOLOv5的套袋柑橘检测算法[J].农业工程学报,2022,38(18):204-211.LYU J,LI S J,ZENG M Y,et al.Detecting bagged citrus using a semi-supervised SPM-YOLOv5[J].Transactions of the CSAE,2022,38(18):204-211(in Chinese with English abstract).
    [6] 姚松鹏,朱隆睿,乔波.基于目标检测的苹果探测与定位研究[J].电脑与信息技术,2022,30(5):22-24.YAO S P,ZHU L R,QIAO B.Research on fruit detection and location based on target detection[J].Computer and information technology,2022,30(5):22-24(in Chinese with English abstract).
    [7] 周焜.基于深度学习的杨梅成熟度检测仪的研发[D].杭州:浙江科技学院,2022.ZHOU K.Development of myrica rubra maturity detector based on deep learning[D].Hangzhou:Zhejiang University of Science & Technology,2022(in Chinese with English abstract).
    [8] 李竹,牟昌红,嵇康轩,等.基于深度学习的蓝莓成熟度预测[J].安徽农业科学,2023,51(5):232-236.LI Z,MOU C H,JI K X,et al.Prediction of blueberry maturity based on deep learning[J].Journal of Anhui agricultural sciences,2023,51(5):232-236(in Chinese with English abstract).
    [9] GIRSHICK R.Fast R-CNN[C]//2015 IEEE International Conference on Computer Vision (ICCV).December 7-13,2015.Santiago,Chile.Santiago:IEEE,2015:1440-1448.
    [10] 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.
    [11] 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.Las Vegas:IEEE,2016:779-788.
    [12] REDMON J,FARHADI A.YOLOv3:an incremental improvement[DB/OL].arXiv,2018:1804.02767[2023-04-25]. https://doi.org/10.48550/arXiv.1804.02767.
    [13] BOCHKOVSKIY A, WANG C Y, LIAO H Y M.Yolov4: Optimal speed and accuracy of object detection[DB/OL].arXiv,2020:2004.10934[2023-04-25].https://doi.org/10.48550/arXiv.2004.10934.
    [14] LIU W,ANGUELOV D,ERHAN D,et al.SSD:single shot MultiBox detector[M]//Computer Vision–ECCV 2016.Cham:Springer International Publishing,2016:21-37.
    [15] DUAN K W,BAI S,XIE L X,et al.CenterNet:keypoint triplets for object detection[C]//2019 IEEE/CVF International Conference on Computer Vision (ICCV).October 27-November 2,2019.Seoul,Korea (South).Seoul :IEEE,2019:6569-6578.
    [16] LAW H,DENG J.CornerNet:detecting objects as paired keypoints[J].International journal of computer vision,2020,128(3):642-656.
    [17] 石展鲲,杨风,韩建宁,等.基于Faster-RCNN的自然环境下苹果识别[J].计算机与现代化,2023(2):62-65.SHI Z K,YANG F,HAN J N,et al.Apples recognition in natural environment based on faster-RCNN[J].Computer and modernization,2023(2):62-65(in Chinese with English abstract).
    [18] WANG L L,ZHAO Y J,LIU S B,et al.Precision detection of dense plums in orchards using the improved YOLOv4 model[J/OL].Frontiers in plant science,2022,13:839269[2023-04-25].https://doi.org/10.3389/fpls.2022.839269.
    [19] 杨福增,雷小燕,刘志杰,等.基于CenterNet的密集场景下多苹果目标快速识别方法[J].农业机械学报,2022,53(2):265-273.YANG F Z,LEI X Y,LIU Z J,et al.Fast recognition method for multiple apple targets in dense scenes based on CenterNet[J].Transactions of the CSAM,2022,53(2):265-273(in Chinese with English abstract).
    [20] 曾乾,李博.基于改进SSD的青瓜检测算法[J].国外电子测量技术,2023,42(4):158-165.ZENG Q,LI B.Cucumber detection algorithm based on improved SSD[J].Foreign electronic measurement technology,2023,42(4):158-165(in Chinese with English abstract).
    [21] 郜统哲,王亮,张晓,等.基于YOLOv3的杨梅关键发育期识别技术[J].现代农业科技,2023(5):79-82.GAO T Z,WANG L,ZHANG X,et al.Identification technology of key developmental stages of Myrica rubra based on YOLOv3[J].Modern agricultural science and technology,2023(5):79-82(in Chinese).
    [22] 黄彤镔,黄河清,李震,等.基于YOLOv5改进模型的柑橘果实识别方法[J].华中农业大学学报,2022,41(4):170-177.HUANG T B,HUANG H Q,LI Z,et al.Citrus fruit recognition method based on the improved model of YOLOv5[J].Journal of Huazhong Agricultural University,2022,41(4):170-177(in Chinese with English abstract).
    [23] 赵文清,孔子旭,赵振兵.隔级融合特征金字塔与CornerNet相结合的小目标检测[J].智能系统学报,2021,16(1):108-116.ZHAO W Q,KONG Z X,ZHAO Z B.Small target detection based on a combination of feature pyramid and CornerNet[J].CAAI transactions on intelligent systems,2021,16(1):108-116(in Chinese with English abstract).
    [24] 李兆旭,蒋红海,杨肖,等.基于轻量化深度学习模型的豆角苗-杂草检测方法[J].农业装备与车辆工程,2022,60(9):98-102.LI Z X,JIANG H H,YANG X,et al.Bean seedling-weed detection method based on lightweight deep learning model[J].Agricultural equipment & vehicle engineering,2022,60(9):98-102(in Chinese with English abstract).
    [25] 赵越,赵辉,姜永成,等.基于深度学习的马铃薯叶片病害检测方法[J].中国农机化学报,2022,43(10):183-189.ZHAO Y,ZHAO H,JIANG Y C,et al.Detection method of potato leaf diseases based on deep learning[J].Journal of Chinese agricultural mechanization,2022,43(10):183-189(in Chinese with English abstract).
    [26] 祁金文.基于YOLOv5的苹果目标识别方法研究[J].电脑编程技巧与维护,2022(8):137-139.QI J W.Research on apple target recognition method based on YOLOv5[J].Computer programming skills & maintenance,2022(8):137-139(in Chinese).
    [27] 邵良玉.基于迁移学习的花类图像分类方法研究[J].农业装备与车辆工程,2022,60(7):62-64.SHAO L Y.Flower image classification based on transfer learning[J].Agricultural equipment & vehicle engineering,2022,60(7):62-64(in Chinese with English abstract).
    [28] LIN T Y,GOYAL P,GIRSHICK R,et al.Focal loss for dense object detection[C]//2017 IEEE International Conference on Computer Vision (ICCV).October 22-29,2017.Venice.Venice:IEEE,2017:2980-2988.
    引证文献
    网友评论
    网友评论
    分享到微博
    发 布
引用本文

贺英豪,唐德钊,倪铭,蔡起起.基于改进YOLOv5对果园环境中李的识别[J].华中农业大学学报,2024,43(5):31-40

复制
分享
文章指标
  • 点击次数:107
  • 下载次数: 683
  • HTML阅读次数: 65
  • 引用次数: 0
历史
  • 收稿日期:2023-04-25
  • 在线发布日期: 2024-10-08
文章二维码