Online real-time detection system for cracked eggs using improved YOLOv7

被引:0
|
作者
Zhao Z. [1 ]
Wei H. [1 ]
Huang Y. [1 ]
Huang X. [2 ]
Mi Y. [1 ]
Luo Y. [1 ]
机构
[1] College of Engineering, South China Agricultural University, Guangzhou
[2] Guangzhou Guangxing Animal Husbandry Equipment Group Co., Ltd., Guangzhou
关键词
broken shell eggs; deep learning; image processing; improved YOLOv7; models; real time detection;
D O I
10.11975/j.issn.1002-6819.202305228
中图分类号
学科分类号
摘要
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 unqualified data after data augmentation. Finally, a final dataset was obtained with 1 729 images, including 3 782 intact and 1 574 cracked eggs. The experimental results on the PC side show that better performance was achieved in the improved model, with an average precision (mAP) of 94.0% on the test set. The single image detection time of 13.1 ms was 2.9 percentage points higher than before, where the detection time was only extended by 1.0 ms. The parameter quantity of the improved model was 3.64×107, indicating a decrease of 2.1 percentage points, compared with the original model. In addition, the improved YOLOv7 model enhanced the mAP of broken shell eggs by 5.4, 3.4, and 4.5 percentage points, compared with the SSD, Faster R-CNN, and YOLOv5 models, respectively. The best detection accuracy was achieved for the broken shell eggs, indicating the high effectiveness of the improved model. Finally, the model was also deployed to the device side through the format conversion. The ONNXRuntime deep learning was utilized to conduct the online detection and verification under its inference framework. The improved model was reduced by 3.8 percentage points on the false detection rate of broken eggs, whereas, the missed detection rate remained unchanged. The average frame rate was about 54 frames/s for online detection. The strong robustness of the improved model fully met the requirements of online real-time detection. This finding can provide the technical reference for the online detection of broken shell eggs. © 2023 Chinese Society of Agricultural Engineering. All rights reserved.
引用
收藏
页码:255 / 265
页数:10
相关论文
共 41 条
  • [1] SUN Congjiao, CAO Jingsheng, YU Aizhi, Et al., The development of the laying hen industry in 2022, future development trends and suggestions, Chinese Journal of Animal Husbandry, 59, 3, pp. 269-273, (2023)
  • [2] ORLOVA Y, LINKER R, SPEKTOR B., Expansion of cracks in chicken eggs exposed to sub-atmospheric pressure, Biosystems Engineering, 112, 4, pp. 278-284, (2012)
  • [3] WIDDICOMBE J P, RYCROFT A N, GREGORY N G., Hazards with cracked eggs and their relationship to egg shell strength, Journal of the Science of Food and Agriculture, 89, 2, pp. 201-205, (2009)
  • [4] BAO G, JIA M, XUN Y, Et al., Cracked egg recognition based on machine vision, Computers and Electronics in Agriculture, 158, pp. 159-166, (2019)
  • [5] KERTESZ I, ZSOM-MUHA V, ANDRAS R, Et al., Development of a novel acoustic spectroscopy method for detection of eggshell cracks, Molecules, 26, 15, (2021)
  • [6] CHEN Jing, LIANG Junyi, Design of on-line detection system for egg appearance quality based on machine vision, The Food Industry, 41, 5, pp. 232-234, (2020)
  • [7] HUANG Y, LUO Y, CAO Y, Et al., Damage detection of unwashed eggs through video and deep learning, Foods, 12, 11, (2023)
  • [8] PAN Leiqing, TU Kang, ZHAN Ge, Et al., Eggshell crack detection based on information fusion between computer vision and acoustic response, Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 26, 11, pp. 332-337, (2010)
  • [9] SUN L, FENG S, CHEN C, Et al., Identification of eggshell crack for hen egg and duck egg using correlation analysis based on acoustic resonance method, Journal of Food Process Engineering, 43, 8, (2020)
  • [10] WU L, WANG Q, JIE D, Et al., Detection of crack eggs by image processing and soft-margin support vector machine, Journal of Computational Methods in Sciences and Engineering, 18, 1, pp. 21-31, (2018)