摘要
针对我国鸡蛋外观缺陷检测依赖人工识别,存在主观性较强、效率低及检测周期长等问题,提出一种基于YOLOv8n的鸡蛋外观缺陷检测模型——YOLOv8-LK。在C2f模块中,引入iRMB(倒置残差移动模块),并引入SWC模块进行二次改进,命名为C2f-iRMB-SWC模块。引入ADown模块,增强多尺度特征表征能力,并结合局部窗口注意力机制,强化遮挡目标的边界敏感性。将基于点采样的动态上采样器Dysample引入模型,增强其对低分辨率和细微缺陷的检测能力。引入WIoUv2损失函数,解决样本不均衡问题,增强模型鲁棒性,提升算法性能。试验结果表明:与基准YOLOv8n模型相比,YOLOv8-LK模型的精确率、召回率、mAP@0.5和mAP@0.5:0.95分别提高1.5,2.7,1.8,4.1个百分点,模型大小从6.1 MB降至5.5 MB,参数量从3.0 MB降至2.6 MB,分别减少9.8%,13.3%。研究为鸡蛋的自动化检测提供技术支持。
To address the issues in manual egg defect detection in China,such as strong subjectivity,low efficiency,and long inspection cycles,this paper proposes an egg appearance defect detection model named YOLOv8-LK based on YOLOv8n.In the C2f module,the inverted Residual Mobile Block(iRMB)is introduced,followed by a secondary improvement using the SWC module,resulting in a new module named C2f-iRMB-SWC.The ADown module is incorporated to enhance multi-scale feature representation capability.Combined with a local window attention mechanism,it strengthens the boundary sensitivity for occluded objects.The point-based dynamic upsampler,Dysample,is introduced into the model to improve its detection capability for low-resolution and subtle defects.The WIoUv2 loss function is adopted to solve the problem of sample imbalance,enhance model robustness,and improve algorithm performance.Experimental results show that compared to the baseline YOLOv8n model,the YOLOv8-LK model achieves increases of 1.5 percentage points in precision,2.7 percentage points in recall,1.8 percentage points in mAP@0.5,and 4.1 percentage points in mAP@0.5:0.95.The model size is reduced from 6.1 MB to 5.5 MB,and the parameter count is reduced from 3.0 MB to 2.6 MB,representing reductions of 9.8%and 13.3%,respectively.This research provides technical support for the automated detection of eggs.
作者
徐君鹏
林凯凯
梁顺婷
李浩
王文腾
XU Junpeng;LIN Kaikai;LIANG Shunting;LI Hao;WANG Wenteng(School of Mechanical and Electrical Engineering,Henan Institute of Science and Technology,Xinxiang 453003,China)
出处
《包装与食品机械》
北大核心
2025年第5期42-50,共9页
Packaging and Food Machinery
基金
河南省科技攻关项目(242102110014)
河南省高等学校重点科研项目(25CY010)。
关键词
鸡蛋外观检测
深度学习
倒置残差移动模块
轻量化模型
egg appearance detection
deep learning
inverted residual mobile block
lightweight model