Machine Learning-Based Prediction of Hen-Day Egg Production in Commercial Laying Hens: A Hybrid Stacking Ensemble Approach

Authors

  • Jennifer Chi Department of Agriculture, Food and Resource Sciences, University of Maryland Eastern Shore, Princess Anne, Maryland, USA. Author

DOI:

https://doi.org/10.63282/3050-9262.IJAIDSML-V7I3P117

Keywords:

Hen-Day Egg Production, Machine Learning, Stacking Ensemble, Regression Modeling, Poultry Production, Precision Livestock Farming, Predictive Analytics

Abstract

Accurate prediction of hen-day egg production (HDEP) is critical for optimizing flock management, feed allocation, and economic planning in commercial poultry operations. This study applied a comprehensive machine learning framework to predict HDEP (%) from 17 environmental, nutritional, management, and production-related predictors in 1,500 synthetic flock-day observations representing four commercial laying hen breeds: Hy-Line Brown (n = 519), Lohmann Brown (n = 468), White Leghorn (n = 304), and NOVOgen White (n = 209). Nine supervised regression algorithms were evaluated, including Linear Regression (LR), Ridge Regression (RR), Lasso Regression (Lasso), Decision Tree (DT), Random Forest (RF), Gradient Boosting (GB), Support Vector Regression (SVR), K-Nearest Neighbors (KNN), and Multi-Layer Perceptron (MLP), each implemented within a Scikit-learn Pipeline with StandardScaler so that the feature scaling was fitted on training data only. Data were partitioned 80/20 into training and test sets using a fixed random seed of 42. A two-level Stacking Regressor was subsequently constructed using RR, RF, and MLP as base learners and RR as meta-learner, trained via 5-fold cross-validation on the training data. Linear and regularized regression models (LR, RR, Lasso) achieved the highest individual accuracy (R² ≥ 0.997, RMSE ≤ 0.90) across all breeds. The Stacking Regressor surpassed all individual models for three of four breeds, attaining test-set R² values of 0.9983, 0.9978, 0.9977, and 0.9978 and RMSE values of 0.663, 0.717, 0.678, and 0.682 for Hy-Line Brown, Lohmann Brown, NOVOgen White, and White Leghorn, respectively, with MAPE values below 1%. Cross-validation confirmed robust generalization (CV R² ≥ 0.991). The results support further testing of stacking ensemble for egg production forecasting on field data restricted to upstream management and environmental inputs.

References

[1] FAO (2023). FAOSTAT Agricultural Production Database. Food and Agriculture Organization of the United Nations. www.fao.org/faostat.

[2] Leeson, S., and Summers, J. D. (2009). Poultry Metabolic Disorders and Mycotoxins. University Books, Guelph, Ontario.

[3] Bessei, W. (2018). Impact of animal welfare on worldwide poultry production. Worlds Poultry Science Journal, 74(2), 211-224.

[4] Montgomery, D. C., Peck, E. A., & Vining, G. G. (2021). Introduction to linear regression analysis (6th ed.). Wiley.

[5] Benjamin, M., and Yik, S. (2019). Precision livestock farming in swine welfare: a review for swine practitioners. Animals, 9(4), 133.

[6] Neethirajan, S. (2020). The role of sensors, big data and machine learning in modern animal farming. Sensing and Bio-Sensing Research, 29, 100367.

[7] LeCun, Y., Bengio, Y., and Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444.

[8] Hastie, T., Tibshirani, R., & Friedman, J. (2021). The elements of statistical learning: Data mining, inference, and prediction (2nd ed.). Springer.

[9] James, G., Witten, D., Hastie, T., & Tibshirani, R. (2023). An introduction to statistical learning with applications in Python (2nd ed.). Springer.

[10] Shadpour, S., VanderHout, D. L., Wood, B. J., and Miller, S. P. (2021). Machine learning prediction of mortality in juvenile laying hens. Poultry Science, 100(10), 101379.

[11] Musa, S., Jibrin, N. A., Alabi, O. J., and Yahaya, M. S. (2022). Application of artificial neural network for predicting egg production in laying hens under different rearing conditions. Livestock Science, 265, 105025.

[12] Fernandes, A. F. A., Dorea, J. R. R., and Rosa, G. J. M. (2020). Image analysis and computer vision applications in animal sciences: an overview. Frontiers in Veterinary Science, 7, 551269.

[13] Okinda, C., Lu, M., Liu, L., Nyalala, I., Muneri, C., Wang, J., Zhang, H., and Shen, M. (2020). A review on computer vision systems in monitoring of poultry: a welfare perspective. Artificial Intelligence in Agriculture, 4, 184-208.

[14] Savegnago, R. P., Nunes, B. N., Caetano, S. L., Ferraudo, A. S., Schmidt, G. S., Ledur, M. C., and Munari, D. P. (2011). Comparison of logistic and neural network models to fit to the egg production curve of White Leghorn hens. Poultry Science, 90(3), 705-711.

[15] Roush, W. B., and Branton, S. L. (2005). A comparison of fitting growth models with a genetic algorithm and nonlinear regression. Poultry Science, 84(3), 494-502.

[16] Abubakar, A., Shi, R., Nguyen, T., and Zhang, Y. (2023). Prediction of laying hen egg production using gradient boosting and feature importance analysis. Computers and Electronics in Agriculture, 207, 107723.

[17] Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5-32.

[18] Wolpert, D. H. (1992). Stacked generalization. Neural Networks, 5(2), 241-259.

[19] Ogutu, J. O., Schulz-Streeck, T., and Piepho, H. P. (2011). Genomic selection using regularized linear regression models: ridge regression, lasso, elastic net and their extensions. BMC Proceedings, 5(Suppl 3), S6. https://pmc.ncbi.nlm.nih.gov/articles/PMC3363152/pdf/1753-6561-6-S2-S10.pdf

[20] Sagi, O., and Rokach, L. (2018). Ensemble learning: a survey. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 8(4), e1249, 18 pp.

[21] Mashaly, M. M., Hendricks, G. L., Kalama, M. A., Gehad, A. E., Abbas, A. O., and Patterson, P. H. (2004). Effect of heat stress on production parameters and immune responses of commercial laying hens. Poultry Science, 83(6), 889-894.

[22] Kilic, I., and Simsek, E. (2013). The effects of heat stress on egg production and quality of laying hens. Journal of Animal and Veterinary Advances, 12(1), 42-47.

[23] Lewis, P. D., and Morris, T. R. (2006). Poultry and artificial lighting. Worlds Poultry Science Journal, 62(3), 417-430.

[24] Miles, D. M., Branton, S. L., and Lott, B. D. (2006). Atmospheric ammonia is detrimental to the performance of modern commercial broilers. Poultry Science, 83(10), 1650-1654.

[25] Nys, Y., Gautron, J., Garcia-Ruiz, J. M., and Hincke, M. T. (2004). Avian eggshell mineralisation: biochemical and functional characterisation of matrix proteins. Comptes Rendus Palevol, 3(6-7), 549-562.

[26] Lay, D. C., Fulton, R. M., Hester, P. Y., Karcher, D. M., Kjaer, J. B., Mench, J. A., Mullens, B. A., Newberry, R. C., Nicol, C. J., O'Sullivan, N. P., and Porter, R. E. (2011). Hen welfare in different housing systems. Poultry Science, 90(1), 278-294.

[27] Nasiri, S., Taheri-Garavand, A., Fanourakis, D., Zhang, Y.-D., and Nikoloudakis, N. (2021). Automated grapevine disease detection based on leaf image analysis and machine learning. Agronomy, 11(10), 2020.

[28] Géron, A. (2019). Hands-On machine learning with Scikit-Learn, Keras, and TensorFlow (2nd ed.). O'Reilly Media, Sebastopol, CA.

[29] Dietterich, T. G. (2000). Ensemble methods in machine learning. In Multiple Classifier Systems: First International Workshop, MCS 2000, pp. 1-15. Springer, Berlin.

[30] Breiman, L. (1996). Stacked regressions. Machine Learning, 24(1), 49-64.

[31] van der Laan, M. J., Polley, E. C., and Hubbard, A. E. (2007). Super Learner. Statistical Applications in Genetics and Molecular Biology, 6(1), Article 25.

[32] Hoerl, A. E., & Kennard, R. W. (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1), 55-67.

[33] Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B, 58(1), 267-288.

[34] Breiman, L., Friedman, J. H., Olshen, R. A., & Stone, C. J. (1984). Classification and regression trees. Wadsworth International Group.

[35] Friedman, J. H. (2001). Greedy function approximation: A gradient boosting machine. Annals of Statistics, 29(5), 1189-1232.

[36] Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning, 20(3), 273-297.

[37] Vapnik, V. N. (1998). Statistical learning theory. Wiley.

[38] Smola, A. J., & Schölkopf, B. (2004). A tutorial on support vector regression. Statistics and Computing, 14(3), 199-222.

[39] Cover, T., & Hart, P. (1967). Nearest neighbor pattern classification. IEEE Transactions on Information Theory, 13(1), 21-27.

[40] Rosenblatt, F. (1958). The perceptron: A probabilistic model for information storage and organization in the brain. Psychological Review, 65(6), 386-408.

[41] Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. MIT Press.

[42] Hornik, K., Stinchcombe, M., & White, H. (1989). Multilayer feedforward networks are universal approximators. Neural Networks, 2(5), 359-366.

[43] Chen, T., and Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 785-794.

[44] Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E. (2011). Scikit-learn: machine learning in Python. Journal of Machine Learning Research, 12, 2825-2830.

Downloads

Published

2026-09-07

Issue

Section

Articles

How to Cite

Chi, J. (2026). Machine Learning-Based Prediction of Hen-Day Egg Production in Commercial Laying Hens: A Hybrid Stacking Ensemble Approach. International Journal of Artificial Intelligence, Data Science, and Machine Learning, 7(3), 150-169. https://doi.org/10.63282/3050-9262.IJAIDSML-V7I3P117