Foods (Jul 2024)

Robust Detection of Cracked Eggs Using a Multi-Domain Training Method for Practical Egg Production

  • Yuxuan Cheng,
  • Yidan Huang,
  • Jingjing Zhang,
  • Xuehong Zhang,
  • Qiaohua Wang,
  • Wei Fan

DOI
https://doi.org/10.3390/foods13152313
Journal volume & issue
Vol. 13, no. 15
p. 2313

Abstract

Read online

The presence of cracks reduces egg quality and safety, and can easily cause food safety hazards to consumers. Machine vision-based methods for cracked egg detection have achieved significant success on in-domain egg data. However, the performance of deep learning models usually decreases under practical industrial scenarios, such as the different egg varieties, origins, and environmental changes. Existing researches that rely on improving network structures or increasing training data volumes cannot effectively solve the problem of model performance decline on unknown egg testing data in practical egg production. To address these challenges, a novel and robust detection method is proposed to extract max domain-invariant features to enhance the model performance on unknown test egg data. Firstly, multi-domain egg data are built on different egg origins and acquisition devices. Then, a multi-domain trained strategy is established by using Maximum Mean Discrepancy with Normalized Squared Feature Estimation (NSFE-MMD) to obtain the optimal matching egg training domain. With the NSFE-MMD method, the original deep learning model can be applied without network structure improvements, which reduces the extremely complex tuning process and hyperparameter adjustments. Finally, robust cracked egg detection experiments are carried out on several unknown testing egg domains. The YOLOV5 (You Only Look Once v5) model trained by the proposed multi-domain training method with NSFE-MMD has a detection mAP of 86.6% on the unknown test Domain 4, and the YOLOV8 (You Only Look Once v8) model has a detection mAP of 88.8% on Domain 4, which is an increase of 8% and 4.4% compared to the best performance of models trained on a single domain, and an increase of 4.7% and 3.7% compared to models trained on all domains. In addition, the YOLOV5 model trained by the proposed multi-domain training method has a detection mAP of 87.9% on egg data of the unknown testing Domain 5. The experimental results demonstrate the robustness and effectiveness of the proposed multi-domain training method, which can be more suitable for the large quantity and variety of egg detection production.

Keywords