摘要
本研究提出了一种基于YOLOv5s的草莓成熟度实时检测算法YOLOv5s-SCS,该算法针对检测过程中草莓数量多、体积小、果实之间遮挡、重叠、密集等特点,优化了对小目标和密集目标存在误检和漏检等问题,显著提升了检测速度。首先,引入SimOTA匹配算法动态分配成熟草莓正样本,提高成熟草莓的识别能力;其次,将YOLOv5s颈部的部分C3模块替换成C2f模块,实现了模型的轻量化,提升了模型的平均检测精度;最后,在YOLOv5s骨干网络的首个C3模块中添加具有全局感受野的SE(Squeeze-and-Excitation)注意力机制,该机制通过自动学习方式获取每个特征通道的重要程度,并且利用得到的重要程度来提升特征并抑制对当前任务不重要的特征。实验结果表明,改进后的算法平均精度均值、精确率、召回率、模型体积、检测速度分别为98.3%、92.6%、96.6%、13.5 MB和89.3 FPS,相较于原始YOLOv5s平均精度均值提高了1.8个百分点,精确率和召回率分别提升了1.3个和2.1个百分点,模型体积减小了0.3 MB,检测速度提高了82.24%,NMS(非极大值抑制处理)和图像预处理的时间大幅缩减,检测速度达到实时检测要求。该算法与其他算法比较,识别精度及模型体积均优于其他算法,在复杂环境下具有良好的鲁棒性,为开发草莓成熟度实时检测系统提供了解决方案。
In this study,YOLOv5s-SCS,a real-time detection algorithm for strawberry maturity was pro-posed based on YOLOv5s.Aiming at the characteristics of large number,small size,covered,overlapping and density of strawberries during detection process,the algorithm optimized the problems of false detection and missing detection for small and dense targets,and significantly improved the detection speed.Firstly,SimOTA matching algorithm was introduced to dynamically assign positive samples of ripe strawberries to improve the recognition ability of ripe strawberries.Secondly,part of C3 module in YOLOv5s neck was replaced with C2f module,which realized the lightweight of model and improved the average detection accuracy.Finally,the Squeeze-and-Excitation(SE)attention mechanism with global receptor field was added to the first C3 module of the YOLOv5s backbone network.The SE mechanism can obtain the importance of each feature channel through automatic learning,and then use the obtained importance to promote features and suppress features which are not important to the task at hand.The experimental results showed that the mean average precision(mAP),accuracy rate,recall rate,model volume and detection speed of the improved algorithm were 98.3%,92.6%,96.6%,13.5 MB and 89.3 frames per second respectively,which were 1.8,1.3 and 2.1 per-centage points higher in mAP,accuracy rate and recall rate respectively compared with the original YOLOv5s,and also 0.32 MB less in model volume and 82.2%higher in detection speed;the time of NMS(non-maximum suppression processing)and image preprocessing was greatly reduced,and the detection speed could meet the real-time detection requirement.Compared with other algorithms,the algorithm had better recognition accuracy and smaller model volume,and had good robustness in complex environment,which provided a solution for developing real-time detection system of strawberry maturity.
作者
梁敖
代东南
牛思琪
许晓琳
周延培
马德新
Liang Ao;Dai Dongnan;Niu Siqi;Xu Xiaolin;Zhou Yanpei;Ma Dexin(College of Communication,Qingdao Agricultural University,Qingdao 266109,China;Kaisheng Haofeng Agricultural Group Co.,Ltd.,Qingdao 266109,China;Institute of Intelligent Agriculture,Qingdao Agricultural University,Qingdao 266109,China)
出处
《山东农业科学》
2024年第11期156-163,共8页
Shandong Agricultural Sciences
基金
山东省重点研发计划项目(2024CXGC010905,2023TZXD023)
山东省自然科学基金项目(ZR2022MC152)
中央引导地方科技发展专项计划项目(23-1-3-6-zyyd-nsh)。