Foods (Aug 2024)

On-Line Detection Method of Salted Egg Yolks with Impurities Based on Improved YOLOv7 Combined with DeepSORT

  • Dongjun Gong,
  • Shida Zhao,
  • Shucai Wang,
  • Yuehui Li,
  • Yong Ye,
  • Lianfei Huo,
  • Zongchun Bai

DOI
https://doi.org/10.3390/foods13162562
Journal volume & issue
Vol. 13, no. 16
p. 2562

Abstract

Read online

Salted duck egg yolk, a key ingredient in various specialty foods in China, frequently contains broken eggshell fragments embedded in the yolk due to high-speed shell-breaking processes, which pose significant food safety risks. This paper presents an online detection method, YOLOv7-SEY-DeepSORT (salted egg yolk, SEY), designed to integrate an enhanced YOLOv7 with DeepSORT for real-time and accurate identification of salted egg yolks with impurities on production lines. The proposed method utilizes YOLOv7 as the core network, incorporating multiple Coordinate Attention (CA) modules in its Neck section to enhance the extraction of subtle eggshell impurities. To address the impact of imbalanced sample proportions on detection accuracy, the Focal-EIoU loss function is employed, adaptively adjusting bounding box loss values to ensure precise localization of yolks with impurities in images. The backbone network is replaced with the lightweight MobileOne neural network to reduce model parameters and improve real-time detection performance. DeepSORT is used for matching and tracking yolk targets across frames, accommodating rotational variations. Experimental results demonstrate that YOLOv7-SEY-DeepSORT achieves a mean average precision (mAP) of 0.931, reflecting a 0.53% improvement over the original YOLOv7. The method also shows enhanced tracking performance, with Multiple Object Tracking Accuracy (MOTA) and Multiple Object Tracking Precision (MOTP) scores of 87.9% and 73.8%, respectively, representing increases of 17.0% and 9.8% over SORT and 2.9% and 4.7% over Tracktor. Overall, the proposed method balances high detection accuracy with real-time performance, surpassing other mainstream object detection methods in comprehensive performance. Thus, it provides a robust solution for the rapid and accurate detection of defective salted egg yolks and offers a technical foundation and reference for future research on the automated and safe processing of egg products.

Keywords