Balancing Accuracy and Speed: Toward Practical Egg Grading and Defect Detection using Hybrid Models
Effective egg grading and surface defect detection are critical for ensuring operational efficiency, food safety, and quality control in the poultry industry. Conventional manual inspection is labor-intensive, subjective, and impractical for high-throughput environments, while mechanical grading systems often overlook external defects in this domain. This study proposes a machine vision–based framework employing multiple learning strategies, including a custom Convolutional Neural Network (CNN), transfer-learning-based VGG16, YOLOv8n object detection, Random Forest (RF), and a novel hybrid VGG16 and RF model for automated egg grading and crack detection. Experiments were conducted using two datasets: a public egg crack detection dataset and a self-collected RGB dataset that captures real-world variations in lighting, orientation, background, and imaging devices. Eleven image pre-processing pipelines were systematically evaluated to examine their influence on accuracy, robustness, and computational efficiency. Results demonstrate that VGG16 achieved the highest classification accuracy, reaching 98.85% on the public dataset and 97.54% on the self-collected dataset. However, the proposed hybrid VGG16–RF model attained competitive performance (97.91% and 95.25%, respectively) while significantly reducing training and processing time. These findings indicate that the hybrid approach offers a favorable accuracy–efficiency trade-off, making it particularly suitable for real-time or resource-constrained deployment in practical poultry production settings.