Image Analysis for Hen Egg Classification and Size Estimation
Main Article Content
Abstract
Egg size and shape are critical parameters in the poultry industry’s quality grading and consumer assessment. This study presents an automated image-based system to classify and estimate hen egg size, improving quality control and operational efficiency. We assembled a dataset of 150 hen eggs under Thai agricultural standards. We employed two primary image processing techniques: binary thresholding and maximum likelihood. Binary thresholding segmented egg images based on pixel intensity values, while the maximum likelihood approach—utilizing the HSV (Hue, Saturation, and Value) color space—effectively discriminated egg regions from the background. For geometric analysis, least-squares ellipse fitting and RANSAC (Random Sample Consensus) algorithms were applied to estimate egg dimensions. The classification results showed that binary thresholding achieved true positive rates of 95% and 94% on the training and test datasets, respectively, at a threshold of 0.55. The maximum likelihood method outperformed this approach, achieving classification true positive rates of 97% and 96% on the training and test datasets, respectively. Shape estimation also demonstrated high reliability, with accuracies exceeding 95% and reaching above 98%. These findings suggest that the proposed system is both accurate and practical for automated egg quality assessment in industrial settings.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
เนื้อหาข้อมูล
References
[1] J. Alikhanov, Z. Shynybay, A. Moldazhanov, A. Kulmak-Hambetova, and P. Daskalov, “Machine control system operation for automatic sorting of eggs into categories,” in Proc. 5th Int. Sci. Congr. Agricultural Machinery, 2017, pp. 222-226.
[2] I. Bagus, K. Dzinavatongaet, E. Chimana, and C. Mabuyaye, “Design and development of an IoT-based chicken egg sorting prototype based on egg weight,” in Proc. 3rd Conf. IDB Bali, 2024, pp. 356-362.
[3] K. Limpadapun and T. Borirak, “Advancing industrial inspection through image processing techniques with OpenCV,” EAU Heritage Journal Science and Technology, vol. 19, no. 1, pp. 63-76, Apr. 2025, https://he01.tci-thaijo.org/index.php/EAUHJSci/article/view/275593/186733
[4] D. M. Mendoza, R. G. De Luna, C. F. C. Navarro, M. R. Isada, L. Tuason, and J. M. P. Macadag-Um, “Standardized Sizing through Machine Learning (SML): Utilizing decision tree algorithm to classify white chicken egg sizes,” in Proc. IEEE Region 10 Humanitarian Technology Conf. (R10-HTC), 2024. pp. 66-71, https://doi.org/10.1109/R10-HTC59322.2024.10778850
[5] M. Sedghi and M. Ghaderi, “Digital analysis of egg surface area and volume: Effects of longitudinal axis, maximum breadth and weight,” Inf. Process. Agric., vol. 10, no. 2, pp. 229-239, Jun. 2023, https://doi.org/10.1016/j.inpa.2022.01.003
[6] C. Liu et al., “Single-view measurement method for egg size based on small-batch images,” Foods, vol. 12, no. 5, Mar. 2023, https://doi.org/10.3390/foods12050936
[7] V. G. Narushin, G. Lu, J. Cugley, M. N. Romanov, and D. K. Griffin, “A 2-D imaging-assisted geometrical transformation method for non-destructive evaluation of the volume and surface area of avian eggs,” Food Control, vol. 112, Jun. 2020, https://doi.org/10.1016/j.foodcont.2020.107112
[8] V. G. Narushin, J. P. Kent, A. Salamon, M. N. Romanov, and D. K. Griffin, “Density of egg interior: Looking inside an egg while keeping it intact,” Innov. Food Sci. Emerg. Technol., vol. 87, Jul. 2023, https://doi.org/10.1016/j.ifset.2023.103387
[9] National Bureau of Agricultural Commodity and Food Standards, Thai Agricultural Standard (TAS 6702-2005): Hen egg. Bangkok, Thailand: ACFS, 2005. [Online]. Available: https://faolex.fao.org/docs/pdf/tha166331.pdf
[10] S. Chaivivatrakul, “Automatic assessment of seed germination percentage,” Eng. J., vol. 24, no. 4, pp. 85-96, Jul. 2020, https://doi.org/10.4186/ej.2020.24.4.85
[11] K. P. Murphy, Machine Learning: A Probabilistic Perspective. Cambridge, MA, USA: MIT Press, 2012, pp. 1-1104.
[12] R. Brown, “fitellipse.m,” MATLAB Central File Exchange, 2025. [Online]. Available: https://www.mathworks.com/matlabcentral/fileexchange/15125-fitellipse-m [Accessed Jun. 10, 2025].
[13] M. Arthington, “Distance from points to an ellipse,” MATLAB Central File Exchange, 2025. [Online]. Available: https://www.mathworks.com/matlabcentral/fileexchange/26261-distance-from-points-to-an-ellipse [Accessed: Jun. 10, 2025].
[14] M. Isik, “Comprehensive empirical evaluation of feature extractors in computer vision,” Peer J Comput. Sci., vol. 10, p. e2415, Nov. 2024, https://doi.org/10.7717/peerj-cs.2415
[15] Y. Liu et al., “A survey of visual transformers,” IEEE Trans. Neural Netw. Learn. Syst., vol. 35, no. 6, 2024, https://doi.org/10.1109/TNNLS.2022.3227717
[16] R. Azad et al., “Advances in medical image analysis with vision transformers: A comprehensive review,” Med. Image Anal., vol. 91, Art. no. 103000, Jan. 2024, https://www.sciencedirect.com/science/article/pii/S1361841523002608
[17] C. -Y. Wang, I.-H. Yeh, and H. -Y. M. Liao, “YOLOv9: Learning what you want to learn using programmable gradient information,” in Proc. Eur. Conf. Comput. Vis. (ECCV), 2024, pp. 1-21.
[18] Z. Zong, G. Song, and Y. Liu, “DETRs with collaborative hybrid assignments training,” in Proc. IEEE Int. Conf. Comput. Vis. (ICCV), 2023, pp. 6748-6758.
[19] E. Xie, W. Wang, Z. Yu, A. Anandkumar, J. M. Alvarez, and P. Luo, “SegFormer: Simple and efficient design for semantic segmentation with transformers,” in Adv. Neural Inf. Process. Syst., 2021, pp. 12077-12090.
[20] K. Orkphol, K. Satianpakiranakorn, J. Chaihuadjaroen, and T. Valeeprakhon, “A transfer learning-based deep convolutional neural network approach for white shrimp abnormality classification,” Int. Sci. J. Eng. Technol. (ISJET), vol. 8, no. 2, Dec. 2024.
[21] M. Tan and Q. V. Le, “EfficientNetV2: Smaller models and faster training,” in Proc. 38th Int. Conf. Mach. Learn. (ICML), 2021, pp. 10096-10106.
[22] Z. Luo, W. Yang, Y. Yuan, R. Gou, and X. Li, “Semantic segmentation of agricultural images: A survey,” Inf. Process. Agric., vol. 11, no. 2, pp. 172-186, Jun. 2024, https://www.sciencedirect.com/science/article/pii/S2214317323000112