Damage Detection of Unwashed Eggs through Video and Deep Learning
Abstract
:1. Introduction
2. Materials and Methods
2.1. Machine Vision System
2.2. Production of Datasets
2.3. Broken Egg Detection Methods
2.3.1. Broken Egg Detection Based on Improved YOLOv5
- 1.
- Co-ordinate Attention (CA)
- 2.
- BiFPN
- 3.
- GSConv
2.3.2. Egg Tracking Based on ByteTrack
2.3.3. Real-Time Video-Based Detection Model
2.4. Evaluation Metrics
3. Results
3.1. Model Training Results and Ablation Experiments
3.2. Comparison of Object Detection Algorithm
3.3. Comparison of Actual Detection Effect
3.4. Application Performance
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Sharaf Eddin, A.; Ibrahim, S.A.; Tahergorabi, R. Egg quality and safety with an overview of edible coating application for egg preservation. Food Chem. 2019, 296, 29–39. [Google Scholar] [CrossRef] [PubMed]
- Kertész, I.; Zsom-Muha, V.; András, R.; Horváth, F.; Németh, C.; Felföldi, J. Development of a Novel Acoustic Spectroscopy Method for Detection of Eggshell Cracks. Molecules 2021, 26, 4693. [Google Scholar] [CrossRef] [PubMed]
- Orlova, Y.; Linker, R.; Spektor, B. Expansion of cracks in chicken eggs exposed to sub-atmospheric pressure. Biosyst. Eng. 2012, 112, 278–284. [Google Scholar] [CrossRef]
- Widdicombe, J.P.; Rycroft, A.N.; Gregory, N.G. Hazards with cracked eggs and their relationship to egg shell strength. J. Sci. Food Agr. 2009, 89, 201–205. [Google Scholar] [CrossRef]
- Priyadumkol, J.; Kittichaikarn, C.; Thainimit, S. Crack detection on unwashed eggs using image processing. J. Food Eng. 2017, 209, 76–82. [Google Scholar] [CrossRef]
- Lunadei, L.; Ruiz-Garcia, L.; Bodria, L.; Guidetti, R. Automatic Identification of Defects on Eggshell through a Multispectral Vision System. Food Bioprocess Technol. 2012, 5, 3042–3050. [Google Scholar] [CrossRef]
- Yuan, X.; Li, Y.; Mo, Q.; Zhang, B.; Shu, D.; Sun, L.; Yang, H.; Xie, X.; Liu, Y.; Zang, Y. A combined approach using slightly acidic electrolyzed water spraying and chitosan and pectin coating on the quality of the egg cuticle, prevention of bacterial invasion, and extension of shelf life of eggs during storage. Food Chem. 2022, 389, 133129. [Google Scholar] [CrossRef]
- Seidler, E.S. Egg marketing. A guide for the production and sale of eggs. FAO Agric. Serv. Bull. (FAO) 2003, 150, 29–51. [Google Scholar]
- Braun, P.G.; Wittmann, C.; Fehlhaber, K. Experimental studies on the influence of washing of table eggs on their microbial quality. Arch. Lebensm. 2011, 62, 157–161. [Google Scholar]
- De Ketelaere, B.; Coucke, P.; De Baerdemaeker, J. Eggshell Crack Detection based on Acoustic Resonance Frequency Analysis. J. Agric. Eng. Res. 2000, 76, 157–163. [Google Scholar] [CrossRef]
- Peng, H.; Wen, Y.; Wang, Q.; Wang, S.; Wu, L. Crack detection in eggs with multi-level wavelet transform and BP neural network. Nongye Jixie Xuebao = Trans. Chin. Soc. Agric. Mach. 2009, 40, 170–174. [Google Scholar]
- Wang, Y. Research on the computer vision cracked eggs detecting method. Comput. Appl. Technol. 2014, 50, 215–219. [Google Scholar] [CrossRef]
- Guanjun, B.; Mimi, J.; Yi, X.; Shibo, C.; Qinghua, Y. Cracked egg recognition based on machine vision. Comput. Electron. Agr. 2019, 158, 159–166. [Google Scholar] [CrossRef]
- Dehrouyeh, M.H.; Omid, M.; Ahmadi, H.; Mohtasebi, S.S.; Jamzad, M. Grading and quality inspection of defected eggs using machine vision. Int. J. Adv. Sci. Technol. 2010, 17, 23–30. [Google Scholar]
- Xiong, L.R.; Xie, C.; Zhu, Z.H. An identification method based on multi-feature and Adaboosting-SVM of eggshell crack. J. Huazhong Agric. Univ. 2015, 2, 136–140. [Google Scholar]
- Omid, M.; Soltani, M.; Dehrouyeh, M.H.; Mohtasebi, S.S.; Ahmadi, H. An expert egg grading system based on machine vision and artificial intelligence techniques. J. Food Eng. 2013, 118, 70–77. [Google Scholar] [CrossRef]
- Datta, A.K.; Botta, B.; Gattam, S.S.R. Damage detection on chicken eggshells using Faster R-CNN. In Proceedings of the ASABE 2019 Annual International Meeting, Boston, MA, USA, 7–10 July 2019. [Google Scholar] [CrossRef]
- Tang, W.; Hu, J.; Wang, Q. High-Throughput Online Visual Detection Method of Cracked Preserved Eggs Based on Deep Learning. Appl. Sci. 2022, 12, 952. [Google Scholar] [CrossRef]
- Turkoglu, M. Defective egg detection based on deep features and Bidirectional Long-Short-Term-Memory. Comput. Electron. Agr. 2021, 185, 106152. [Google Scholar] [CrossRef]
- Nasiri, A.; Omid, M.; Taheri-Garavand, A. An automatic sorting system for unwashed eggs using deep learning. J. Food Eng. 2020, 283, 110036. [Google Scholar] [CrossRef]
- Botta, B.; Gattam, S.S.R.; Datta, A.K. Eggshell crack detection using deep convolutional neural networks. J. Food Eng. 2022, 315, 110798. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the Computer Vision & Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016. [Google Scholar]
- Qi, J.; Liu, X.; Liu, K.; Xu, F.; Guo, H.; Tian, X.; Li, M.; Bao, Z.; Li, Y. An improved YOLOv5 model based on visual attention mechanism: Application to recognition of tomato virus disease. Comput. Electron. Agric. 2022, 194, 106780. [Google Scholar] [CrossRef]
- She, J.; Zhan, W.; Hong, S.; Min, C.; Dong, T.; Huang, H.; He, Z. A method for automatic real-time detection and counting of fruit fly pests in orchards by trap bottles via convolutional neural network with attention mechanism added. Ecol. Inform. 2022, 70, 101690. [Google Scholar] [CrossRef]
- Hou, Q.; Zhou, D.; Feng, J. Coordinate attention for efficient mobile network design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Virtual, 19–25 June 2021. [Google Scholar]
- Lin, T.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 8759–8768. [Google Scholar]
- Tan, M.; Pang, R.; Le, Q.V. EfficientDet: Scalable and efficient object detection. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-neck by GSConv: A better design paradigm of detector architectures for autonomous vehicles. arXiv 2022, arXiv:2206.02424. [Google Scholar]
- Zhang, Y.; Sun, P.; Jiang, Y.; Yu, D.; Yuan, Z.; Luo, P.; Liu, W.; Wang, X. ByteTrack: Multi-Object Tracking by Associating Every Detection Box. arXiv 2021, arXiv:2110.06864. [Google Scholar]
- Kalman, R.E. A New Approach to Linear Filtering and Prediction Problems. ASME J. Basic Eng. 1960, 82, 35–45. [Google Scholar] [CrossRef]
- Yu, L.; Qian, M.; Chen, Q.; Sun, F.; Pan, J. An Improved YOLOv5 Model: Application to Mixed Impurities Detection for Walnut Kernels. Foods 2023, 12, 624. [Google Scholar] [CrossRef] [PubMed]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015, 28, 1137–1149. [Google Scholar] [CrossRef]
- Bochkovskiy, A.; Wang, C.; Liao, H.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Wang, C.; Bochkovskiy, A.; Liao, H.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. arXiv 2022, arXiv:2207.02696. [Google Scholar]
Configuration | Parameter |
---|---|
Development environment | Anaconda3-2021.11 + Pycharm |
CPU | Intel Core i9-11900 K |
GPU | Nvidia GeForce RTX 3060 Ti |
Operating system | Windows 10 |
Accelerated environment | CUDA11.3 CUDNN8.3.0 |
Development of language | Python3.8 |
CA | BiFPN | GSConv | Precision (%) | Recall (%) | mAP:0.5 (%) |
---|---|---|---|---|---|
− | − | − | 95.6 | 90.1 | 91.1 |
√ | − | − | 97.2 | 92.7 | 93.4 |
− | √ | − | 96.9 | 92.4 | 93.3 |
− | − | √ | 95.8 | 91.3 | 91.8 |
√ | √ | √ | 97.8 | 94.6 | 95.2 |
Model | Class | Precision (%) | Recall (%) | mAP:0.5 (%) | FPS |
---|---|---|---|---|---|
SSD | Non-broken | 89.3 | 80.4 | 75.5 | 22 |
Broken | 73.1 | 68 | |||
Faster RCNN | Non-broken | 90.8 | 83.2 | 79.5 | 16 |
Broken | 80.0 | 77.4 | |||
YOLOv4 | Non-broken | 97.4 | 92.2 | 89.4 | 31 |
Broken | 91.2 | 88 | |||
YOLOv7 | Non-broken | 99.1 | 94.8 | 94.9 | 37 |
Broken | 96.8 | 93.6 | |||
YOLOv5_add | Non-broken | 98.9 | 95.6 | 95.2 | 45 |
Broken | 96.7 | 93.5 |
Intact (Actual) | Broken (Actual) | Total | |
---|---|---|---|
Intact (detection) | 145 | 4 | 149 |
Broken (detection) | 5 | 98 | 103 |
Total | 150 | 102 | 252 |
Researchers | Unwashed Egg | Class | Method | Accuracy | ||
---|---|---|---|---|---|---|
Intact | Broken | Bloody | ||||
Xiong et al. [15] | − | √ | √ | − | SVM | 97.5% |
Tang et al. [18] | − | √ | √ | − | Improved MobileNetV3 | 96.3% |
Peng et al. [11] | − | √ | √ | − | WT and BP | 90% |
Botta et al. [21] | − | √ | √ | − | SVM and CNN | 95.38% |
Bao et al. [13] | − | √ | √ | − | Image Processing | 92.5% |
Priyadumkol et al. [5] | √ | √ | √ | − | Image Processing | 94% |
Nasiri et al. [20] | √ | √ | √ | √ | Improved VGG16 | 94.8% |
Proposed Model | √ | √ | √ | − | Improved YOLOv5 and ByteTrack | 96.25% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Huang, Y.; Luo, Y.; Cao, Y.; Lin, X.; Wei, H.; Wu, M.; Yang, X.; Zhao, Z. Damage Detection of Unwashed Eggs through Video and Deep Learning. Foods 2023, 12, 2179. https://doi.org/10.3390/foods12112179
Huang Y, Luo Y, Cao Y, Lin X, Wei H, Wu M, Yang X, Zhao Z. Damage Detection of Unwashed Eggs through Video and Deep Learning. Foods. 2023; 12(11):2179. https://doi.org/10.3390/foods12112179
Chicago/Turabian StyleHuang, Yuan, Yangfan Luo, Yangyang Cao, Xu Lin, Hongfei Wei, Mengcheng Wu, Xiaonan Yang, and Zuoxi Zhao. 2023. "Damage Detection of Unwashed Eggs through Video and Deep Learning" Foods 12, no. 11: 2179. https://doi.org/10.3390/foods12112179
APA StyleHuang, Y., Luo, Y., Cao, Y., Lin, X., Wei, H., Wu, M., Yang, X., & Zhao, Z. (2023). Damage Detection of Unwashed Eggs through Video and Deep Learning. Foods, 12(11), 2179. https://doi.org/10.3390/foods12112179