首页|期刊导航|华南农业大学学报|基于改进YOLOv7算法的自然环境下柑橘缺陷检测

基于改进YOLOv7算法的自然环境下柑橘缺陷检测OA

Detection of citrus defects in natural environment based on improved YOLOv7 algorithm

中文摘要英文摘要

[目的]柑橘缺陷识别是实现柑橘果实自动采摘、把控柑橘果实品质的关键环节.本研究致力于提高自然环境下的柑橘缺陷识别精度,实现智能采摘的全天候作业.[方法]通过对关键模块进行优化,提出改进的YOLOv7 算法,具体做法包括引入完全交并比(Complete intersection over union,CIoU)损失函数提升边界框回归精度;采用HardSwish激活函数增强网络学习与计算效率;融合无注意力机制(Attention free transformer,AFT)强化目标特征识别;结合残差多层感知机(Residual multi-layer perceptron,ResMLP)和动态卷积(Dynamic convolution,DC)技术,提高模型在复杂光照下的适应性与稳定性.[结果]利用双光源系统,该算法可实现自然环境下柑橘果实和缺陷的全天候检测,在自然光或白光下能检测黑斑、裂纹等缺陷;在夜间可将紫光作为补充手段,基于荧光反应检测在白光或自然光下不明显的缺陷.试验结果表明,改进后的YOLOv7 算法,在日间对柑橘及缺陷的识别精度分别达 97.9%和 92.8%,比原算法提升 3.8 和 13.4 个百分点;在夜间对缺陷识别精度为82.4%.[结论]本文提出的柑橘缺陷识别方法准确率高、适用时段广,可为柑橘产业采摘智能化提供新思路.

[Objective]Citrus defect recognition is a key link in realizing automatic citrus fruit picking and controlling fruit quality.This study aims to improve the accuracy of citrus defect recognition in natural environments and achieve all-weather operation of intelligent picking.[Method]By optimizing key modules,an improved YOLOv7 algorithm was proposed.The specific improvements included introducing the complete intersection over union(CIoU)loss function to improve bounding box regression accuracy;adopting the HardSwish activation function to enhance network learning and computational efficiency;integrating the attention free transformer(AFT)to strengthen target feature recognition;combining the residual multilayer perceptron(ResMLP)and dynamic convolution(DC)technologies to improve model's adaptability and stability under complex lighting conditions.[Result]Using a dual light source system,this algorithm achieved all-weather detection of citrus fruits and their defects in natural environments.It detected defects such as black spots and cracks under natural light or white light,while at night,violet light served as a complementary means to detect defects that were not obvious under white light or natural light based on fluorescent responses.The experimental results showed that the improved YOLOv7 algorithm achieved 97.9%recognition accuracy for citrus fruits and 92.8%for defects during daytime,which were 3.8 and 13.4 percentage points higher than those of the original YOLOv7 algorithm,respectively;the defect recognition accuracy at night reached 82.4%.[Conclusion]The citrus defect recognition method proposed in this paper has high accuracy and a wide applicable time range,providing new insights for the intelligent harvesting in the citrus industry.

余林豪;钟沅;宋淑然;熊俊涛;孙道宗;薛秀云;代秋芳;李震

华南农业大学电子工程学院(人工智能学院),广东 广州 510642珠海市职业训练指导服务中心,广东 珠海 519015广州软件学院电子信息与控制工程学院,广东 广州 510900华南农业大学数学与信息学院,广东 广州 510642华南农业大学电子工程学院(人工智能学院),广东 广州 510642华南农业大学电子工程学院(人工智能学院),广东 广州 510642华南农业大学电子工程学院(人工智能学院),广东 广州 510642华南农业大学电子工程学院(人工智能学院),广东 广州 510642

农业科技

机器视觉目标检测柑橘缺陷YOLOv7缺陷检测

Machine visionObject detectionCitrus defectYOLOv7Defect detection

《华南农业大学学报》 2026 (1)

94-105,12

国家自然科学基金(32472020)广东省现代农业产业技术体系创新团队建设项目(2024CXTD10)广东省重点领域研发计划(2023B0202090001)财政部和农业农村部:国家现代农业产业技术体系建设专项(CARS-26)

10.7671/j.issn.1001-411X.202505006

评论