食品科学 ›› 2025, Vol. 46 ›› Issue (22): 1-12.doi: 10.7506/spkx1002-6630-20250415-117

• 基于计算机视觉和深度学习的食品检测技术专栏 • 上一篇    下一篇

苹果在线分级的多尺度轻量化改进YOLOv8表面缺陷检测模型

郭志明,肖海迪,王陈,孙婵骏,江水泉,邹小波   

  1. (1.江苏大学食品与生物工程学院,江苏?镇江 212013;2.中国轻工业食品智能检测与加工重点实验室,江苏?镇江 212013;3.江苏楷益智能科技股份有限公司,国家果蔬加工装备研发专业中心,江苏?无锡 214174)
  • 发布日期:2025-11-10
  • 基金资助:
    “十四五”国家重点研发计划课题(2024YFD2101105);国家自然科学基金面上项目(32472431); 江苏省重点研发计划重点项目(BE2022363)

Improved YOLOv8 Model with Multi-scale Lightweight for Surface Defect Detection in Online Apple Grading

GUO Zhiming, XIAO Haidi, WANG Chen, SUN Chanjun, JIANG Shuiquan, ZOU Xiaobo   

  1. (1. School of Food and Biological Engineering, Jiangsu University, Zhenjiang 212013, China; 2. Key Laboratory of Intelligent Detection and Processing of Food in China Light Industry, Zhenjiang 212013, China; 3. National R&D Center for Fruit and Vegetable Processing Equipment, Jiangsu Kaiyi Intelligent Technology Co., Ltd., Wuxi 214174, China)
  • Published:2025-11-10

摘要: 针对果园现场苹果分级存在的计算资源受限和表面缺陷尺度差异大的问题,本研究构建基于机器视觉的改进YOLOv8苹果表面缺陷识别模型,在提高苹果表面缺陷检测效率的同时保证检测准确率。采用自搭建的机器视觉系统采集5 500 张苹果样本的表面特征及缺陷图像,涵盖果柄、花萼的特征与黑点、腐烂、机械损伤、日灼、褐斑和裂纹6 种常见表面缺陷以及1 种环境杂物并完成特征标注。引入RepGhostNeXt和EffQAFPN算法结构,对YOLOv8(You Only Look Once version 8)检测模型的主干特征提取网络和特征金字塔进行改进。在此基础上,研究训练并比较了YOLOv8、YOLOv8n、YOLOv8+EffQAFPN、YOLOv8+RepGhostNeXt和YOLOv8+EffQAFPN+RepGhostNeXt 5 种模型,并重点对比模型在苹果表面瑕疵检测中的检测准确率和模型检测速度。研究结果表明,YOLOv8+EffQAFPN+RepGhostNeXt模型在综合检测性能上表现最佳,其整体识别准确率为94.9%,且保持了7.81 帧/s的平均检测帧率。综上,该模型能够在计算资源有限的环境下高效完成苹果表面缺陷检测任务,为实现果园现场高效便捷的苹果分级提供技术支撑。

关键词: 机器视觉;苹果表面缺陷;YOLOv8;缺陷检测

Abstract: To address the problems of limited computational resources and large-scale variations in surface defects encountered in apple grading in orchards, an improved machine vision-based model for apple surface defect recognition was developed using You Only Look Once version 8 (YOLOv8), increasing the detection efficiency of apple surface defects and simultaneously ensuring the accuracy of the detection. A machine vision system was built in our laboratory to capture 5 500 images of Fuji apples, showing pedicel and calyx characteristics, six common surface defects (black spots, rot, mechanical damage, sunburn, brown spots, and cracks), and one type of environmental debris, which were annotated on the images. The replicated ghost next (RepGhostNeXt) and efficient quality-aware feature pyramid network (EffQAFPN) algorithm structures were introduced to improve the backbone feature extraction network and feature pyramid of the YOLOv8 model. Subsequently, five models were trained and compared: YOLOv8, YOLOv8n, YOLOv8 + EffQAFPN, YOLOv8 + RepGhostNeXt, and YOLOv8 + EffQAFPN + RepGhostNeXt. The focus was placed on comparing the accuracy and efficiency of the models in apple surface defect detection. Experimental results indicated that the YOLOv8 + EffQAFPN + RepGhostNeXt model exhibited the best overall detection performance with an overall recognition accuracy of 94.9% and an average frame rate of 7.81 frames per second (FPS). The model demonstrated efficient apple surface defect detection under limited computational resources, providing technical support for efficient and convenient apple grading in orchards.

Key words: machine vision; apple surface defects; You Only Look Once version 8; defect detection

中图分类号: