Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Use of test-day records to predict first lactation 305-day milk yield using artificial neural network in Kenyan Holstein–Friesian dairy cows

  • 237 Accesses

  • 14 Citations


The study is focused on the capability of artificial neural networks (ANNs) to predict next month and first lactation 305-day milk yields (FLMY305) of Kenyan Holstein–Friesian (KHF) dairy cows based on a few available test days (TD) records in early lactation. The developed model was compared with multiple linear regressions (MLR). A total of 39,034 first parity TD records of KHF dairy cows collected over 102 herds were analyzed. Different ANNs were modeled and the best performing number of hidden layers and neurons and training algorithms retained. The best ANN model had one hidden layer of logistic transfer function for all models, but hidden nodes varied from 2 to 7. The R 2 value for ANNs for training, validation, and test data were consistently high showing that the models captured the features accurately. The R 2, r, and root mean square were consistently superior for ANN than MLR but significantly different (p > 0.05). The prediction equation with four variables, i.e., first, second, third, and fourth TD milk yield, gave adequate accuracy (79.0%) in estimating the FLMY305 from TD yield. It emerges from this study that the ANN model can be an alternative for prediction of FLMY305 and monthly TD in KHF.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2



Artificial neural network


Dairy recording services of Kenya


Multilayer perceptron


Neural network


Statistical analysis software


Matrix Laboratory


  1. Bertis B, Johnston WL, Lovell A, Olson S, Steed S., Cross M (2001) Data mining in U.S. corn fields. Proc. First SIAM International Conference on Data Mining, Chicago, 3 IL, USA.

  2. Cunningham, S. J. and Holmes, G. 2001. Developing innovative applications in agriculture using data mining. Department of Computer Science, University of Waikato, Hamilton, New Zealand.

  3. El Emary I. M. M. 2006. On the Application of Artificial Neural Networks in Analyzing and Classifying the Human Chromosomes. Journal of Computer Science 2 (1): 72-75.

  4. El Faro, L. and de Albuquerque, L.G., 2003. Estimation of genetic parameters for the lactation test-day records and total milk yield for Caracu cows. Rev. Bras. De Zootecn., 32: 284-294.

  5. Ferreira, W.J., Teixeira, N.M., Torres, R.A. and Silva, M.V.G.B. 2002. Utilizao da produo de leite no dia do controle na avaliao genetica em gado de leite - Uma reviso. Archivos Latinoamericanos de Produccion Animal 10:46-53.

  6. Haykin, S. 1994, Neural Networks: A Comprehensive Foundation, Macmillan, New York, 1994.

  7. Haykin, S. 1999. Neural Networks: A Comprehensive Foundation. Prentice Hall, Upper Saddle River.

  8. Huang Mei, G.P., Zhang J. and Zhang, S. 2006. Application of artificial neural networks to the prediction of dust storms in Northwest China. Global and Planetary Change 52:216–224.

  9. Ilatsia, E.D., Muasya, T.K., Muhuyi, W.B. and Kahi, A.K. 2006. Use of test day milk yield records for genetic evaluation in Sahiwal cattle. Proceedings of the 8th World Congress on Genetics Applied to Livestock Production, Belo Horizonte, Minas Gerais, Brazil.

  10. Jensen, J. 2001. Genetic evaluation of dairy cattle using test-day models. Journal of Dairy Science 84:2803-2812.

  11. Jensen, J. 2002. Genetic evaluation of dairy cattle using test-day models. Journal of Dairy Science 84, 2803-2812.

  12. Kaya, I., Akbap, Y. and Uzmay, C. 2003. Estimation of Breeding Values for Dairy Cattle Using Test- Day Milk Yields. Turk. J. Vet. Anim. Sci., 27: 459-464.

  13. Kominaks, A.P., Abas Z., Maltaris, I. and Rogdakis, E. 2002. A preliminary study of the application of artificial neural networks to prediction of milk yield in dairy sheep. Computers and Electronics in Agriculture, v.35, p. 35-48.

  14. López-Benavides M.G., Samarasinghe S. and Hickford J.G.H. 2003. The use of artificial neural networks to diagnose mastitis in dairy cattle. Proceedings of the International Joint Conference on Neural Networks (IJCNN)

  15. MATLAB 2002. Matlab 6.5 (Release 13), The Language of Technical Computing, The MathWorks, Natick.

  16. Meyer, K., Graser, H.U. and Hammond, K. 1989. Estimates of genetic parameters for first lactation test day production of Australian black and white cows. Livest. Prod. Sci., 21: 177-199.

  17. Mostert, B.E., Theron, H.E., Kanfer, F.H.J. and van Marle-Köster, E. 2006. Comparison of breeding values and genetic trends for production traits estimated by a Lactation Model and a Fixed Regression Test-day Model. S. Afr. J. Anim. Sci. 36, 36, 71-78

  18. Omore, A., Muriuki, H., Kenyanjui, M., Owango, M and Staal, S. 1999. The Kenya dairy sub-sector: A rapid appraisal. Smallholder Dairy (Research & Development). http://www.smallholderdairy.org/milk%20cons%20and%20marketing.htm

  19. Reed, R.D. and Marks, R. J. 1998. Neural smithing: Supervised learning in feedforward artificial neural networks. Cambridge: MIT Press.

  20. SAS 2003 Procedures guide for personal computers (version 9 edition). SAS Institute Inc, Cary.

  21. Salehi, F., Lacroix, R. and Wade, K.M. 1998. Improving dairy yield predictions through combined records classifiers and specialized artificial neural network. Computers and Electronics Agriculture, v.20, p. 199-213.

  22. Schaeffer, L.R., Jamrozik, J., Kistemaker, G.J. and Van Doornmaal, B.J. 2000. Experience with a test-day model. J. Dairy Sci. 83, 1135-1144.

  23. Swalve, H.H. 1995. The effect of Test Day Models on the Estimation of Genetic parameters and Breeding Values for Dairy Yields Traits. J. Dairy Sci., 78: 929-938.

  24. Swalve, H.H. 1998. Use of test day records for genetic evaluation. In Proceedings of the sixth world congress of genetics applied to livestock production, Armidale, Australia. CD-ROM.

  25. Swalve, H.H. 2000. Theoretical basis and computational for different test-day genetic evaluation methods. Journal of Dairy Science 83, 1115-1124.

  26. Wade, K.M. and Lacroix, R. 1994. The Role of Artificial Neural Networks in Animal Breeding, Proceedings of the 5th World Congress on Genetics Applied to Livestock Production, Guelph, Canada, v.22, pp. 31–34.

Download references


Appreciation is expressed to the Dairy Recording Services of Kenya for providing data.

Author information

Correspondence to D. M. Njubi.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Njubi, D.M., Wakhungu, J.W. & Badamana, M.S. Use of test-day records to predict first lactation 305-day milk yield using artificial neural network in Kenyan Holstein–Friesian dairy cows. Trop Anim Health Prod 42, 639–644 (2010). https://doi.org/10.1007/s11250-009-9468-7

Download citation


  • Artificial neural networks
  • Back propagation
  • Dairy cows
  • Milk-yield prediction