针对果园现场苹果分级存在的计算资源受限和表面缺陷尺度差异大的问题,本研究构建基于机器视觉的改进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的平均检测帧率。综上,该模型能够在计算资源有限的环境下高效完成苹果表面缺陷检测任务,为实现果园现场高效便捷的苹果分级提供技术支撑。
GUO Zhiming
,
XIAO Haidi
,
WANG Chen
,
SUN Chanjun
,
JIANG Shuiquan
,
ZOU Xiaobo
. 苹果在线分级的多尺度轻量化改进YOLOv8表面缺陷检测模型[J]. 食品科学, 2025
, 46(22)
: 1
-12
.
DOI: 10.7506/spkx1002-6630-20250415-117
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.