摘要
针对破壳鸡蛋(破口蛋和裂纹蛋)缺陷差异性大,在线检测要求实时,以及人工检测依靠主观经验且检测速度慢、检测精度不高等问题,该研究提出一种基于改进的YOLOv7(You Only Look Once v7)模型的破壳鸡蛋在线实时检测系统。以YOLOv7网络为基础,将YOLOv7网络的损失函数CIoU(complete-IoU)替换为WIoUv2(wise-IoU),在骨干网络(backbone)中嵌入坐标注意力模块(coordinate attention,CA)和添加可变形卷积DCNv2(deformable convnet)模块,同时将YOLOv7网络中的检测头(IDetect)替换为具有隐式知识学习的解耦检测头(IDetect_Decoupled)模块。在PC端的试验结果表明,改进后的模型在测试集上平均精度均值(mean average precision,m AP)为94.0%,单张图片检测时间为13.1 ms,与模型改进之前相比,其mAP提高了2.9个百分点,检测时间仅延长1.0 ms;改进后模型的参数量为3.64×10^(7),较原始模型降低了2.1%。最后通过格式转换并利用ONNXRun time深度学习框架把模型部署至设备端,在ONNXRuntime推理框架下进行在线检测验证。试验结果表明:该算法相较原始YOLOv7误检率降低了3.8个百分点,漏检率不变,并且在线检测平均帧率约为54帧/s,满足在线实时性检测需求。该研究可为破壳鸡蛋在线检测研究提供技术参考。
An accurate and rapid detection of eggshell damage has been one of the most important steps in the field of egg processing.Eggshells are prone to mechanical impact and damage during laying and processing,leading to the leakage of egg contents.It has also posed serious bacterial infections and food safety risks on the rest of the intact eggs in the processing line,particularly for the cleaning work and production costs.Furthermore,the current manual detection relies mainly on the subjective experience with slow speed and low accuracy.Therefore,it is of great practical significance to rapidly,accurately,and low-costly detect broken shell eggs in egg processing.In this study,an online real-time detection system was proposed for the broken shell eggs using the improved YOLOv7(you only look once)model.Significant differences were also presented in the defects between broken shell eggs.Specifically,the YOLOv7 network was selected to replace the loss function CIoU(complete-IoU)with WIoUv2(wise-IoU).The coordinate attention(CA)modules were added into the deformable convolutional DCNv2(deformable convnet)in the backbone network.At the same time,the detection head(IDetect)module was replaced in the YOLOv7 network with a decoupled detection head(IDetect-Decoupled)with implicit knowledge learning.Among them,the CA module was used to effectively identify and locate targets of interest for optimal model performance,where the deformable convolution was combined to decouple the detection heads.WIoU loss functions were used to learn the local and global information while improving the accuracy and speed of shell-breaking egg detection with the less missed and false detections.The generalization and robustness of the model were further improved using data augmentation.Various operations were performed on the training set,such as random cropping,50%probability of random horizontal and vertical flipping,50%probability of random rotation and scaling,random noise,brightness and color adjustments.The dataset was screened to remove the
作者
赵祚喜
魏洪飞
黄渊
黄杏彪
米亚龙
罗阳帆
ZHAO Zuoxi;WEI Hongfei;HUANG Yuan;HUANG Xingbiao;MI Yalong;LUO Yangfan(College of Engineering,South China Agricultural University,Guangzhou 510642,China;Guangzhou Guangxing Animal Husbandry Equipment Group Co.,Ltd.,Guangzhou 510540,China)
出处
《农业工程学报》
EI
CAS
CSCD
北大核心
2023年第20期255-265,共11页
Transactions of the Chinese Society of Agricultural Engineering
基金
广东省现代农业产业共性关键技术研发创新团队建设项目:禽蛋收集与包装机器人(2019KJ129)
国家重点研发计划项目:“主要饲草饲料生产全程智能化作业装备创制与应用”子课题:“主要饲草饲料全程智能化生产共性关键技术研究与应用”(2022YFD2001901)。