Huang Yuan, Luo Yangfan, Cao Yangyang, Lin Xu, Wei Hongfei, Wu Mengcheng, Yang Xiaonan, Zhao Zuoxi
College of Engineering, South China Agricultural University, Guangzhou 510642, China.
Key Laboratory of Key Technology on Agricultural Machine and Equipment, South China Agricultural University, Ministry of Education, Guangzhou 510642, China.
Foods. 2023 May 29;12(11):2179. doi: 10.3390/foods12112179.
Broken eggs can be harmful to human health but are also unfavorable for transportation and production. This study proposes a video-based detection model for the real-time detection of broken eggs regarding unwashed eggs in dynamic scenes. A system capable of the continuous rotation and translation of eggs was designed to display the entire surface of an egg. We added CA into the backbone network, fusing BiFPN and GSConv with the neck to improve YOLOv5. The improved YOLOV5 model uses intact and broken eggs for training. In order to accurately judge the category of eggs in the process of movement, ByteTrack was used to track the eggs and assign an ID to each egg. The detection results of the different frames of YOLOv5 in the video were associated by ID, and we used the method of five consecutive frames to determine the egg category. The experimental results show that, when compared to the original YOLOv5, the improved YOLOv5 model improves the precision of detecting broken eggs by 2.2%, recall by 4.4%, and mAP:0.5 by 4.1%. The experimental field results showed an accuracy of 96.4% when the improved YOLOv5 (combined with ByteTrack) was used for the video detection of broken eggs. The video-based model can detect eggs that are always in motion, which is more suitable for actual detection than a single image-based detection model. In addition, this study provides a reference for the research of video-based non-destructive testing.
破损鸡蛋不仅会对人体健康造成危害,还不利于运输和生产。本研究提出了一种基于视频的检测模型,用于在动态场景中实时检测未清洗鸡蛋中的破损鸡蛋。设计了一个能够使鸡蛋连续旋转和平移的系统,以展示鸡蛋的整个表面。我们在骨干网络中加入了CA,将BiFPN和GSConv与颈部融合以改进YOLOv5。改进后的YOLOV5模型使用完整鸡蛋和破损鸡蛋进行训练。为了在鸡蛋运动过程中准确判断其类别,使用ByteTrack对鸡蛋进行跟踪,并为每个鸡蛋分配一个ID。通过ID关联视频中YOLOv5不同帧的检测结果,我们使用连续五帧的方法来确定鸡蛋类别。实验结果表明,与原始YOLOv5相比,改进后的YOLOv5模型将破损鸡蛋的检测精度提高了2.2%,召回率提高了4.4%,mAP:0.5提高了4.1%。当使用改进后的YOLOv5(结合ByteTrack)对破损鸡蛋进行视频检测时,现场实验结果显示准确率为96.4%。基于视频的模型可以检测始终处于运动状态的鸡蛋,比基于单张图像的检测模型更适合实际检测。此外,本研究为基于视频的无损检测研究提供了参考。