The poultry industry faces growing demands for automated, high-precision egg grading systems to ensure quality control and meet market standards. Traditional methods relying on manual inspection are time-consuming, subjective, and prone to human error. Although state-of-the-art YOLO architectures have achieved high accuracy in object detection, their limited interpretability constrains adoption in agricultural contexts where transparency and biological relevance are critical. This study presents an interpretable deep learning framework based on YOLOv12 architecture for real-time egg size detection and classification. Using a dataset of 844 egg images, the performance of YOLO models (v7–v12) is compared, with YOLOv12-X achieving a mean Average Precision (mAP) of 99.4%. To enhance transparency in automated decision-making, Explainable AI (XAI) techniques, including Grad-CAM and EigenCAM, are integrated to visualize the model’s focus regions during classification. This approach not only validates the model’s alignment with biologically relevant features, such as egg contours, but also provides actionable insights for stakeholders in agriculture and food processing. This work bridges the gap between high-accuracy detection and interpretability, paving the way for smarter, more trustworthy automation in the poultry supply chain.
Atwa et al. (Fri,) studied this question.