Prediction of pregnancy state from milk mid-infrared (MIR) spectroscopy in dairy cows

Lisa Rienesl, Philipp Pfeiffer, Negar Khayatzdadeh, Astrid Koeck, Laura Dale, Andreas Werner, Clément Grelet, Nicolas Gengler, Franz-Josef Auer, Christa Egger-Danner, Julie Leblois, Johann Sölkner


Submitted 2020-07-14 | Accepted 2020-08-18 | Available 2020-12-01

Pregnancy assessment is a very important tool for the reproductive management in efficient and profitable dairy farms. Nowadays, mid-infrared (MIR) spectroscopy is the method of choice in the routine milk recording system for quality control and to determine standard milk components. Since it is well known that there are changes in milk yield and composition during pregnancy, the aim of this study was to develop a discriminant model to predict the pregnancy state from routinely recorded MIR spectral data. The data for this study was from the Austrian milk recording system. Test day records of Fleckvieh, Brown Swiss and Holstein Friesian cows between 3 and 305 days of lactation were included in the study. As predictor variables, the first derivative of 212 selected MIR spectral wavenumbers were used. The data set contained roughly 400,000 records from around 40,000 cows and was randomly split into calibration and validation set by farm. Prediction was done with Partial Least Square Discriminant Analysis. Indicators of model fit were sensitivity, specificity, balanced accuracy and Area Under Receiver Operating Characteristic Curve (AUC). In a first approach, one discriminant model for all cows across the whole lactation and gestation lengths was applied. The sensitivity and specificity of this model in validation were 0.856 and 0.836, respectively. Splitting up the results for different lactation stages showed that the model was not able to predict pregnant cases before the third month of lactation and vice versa not able to predict non-pregnancy after the third month of lactation. Consequently, in the second approach a prediction model for each different (expected) pregnancy stage and lactation stage was developed. Balanced accuracies ranged from 0.523 to 0.918. Whether prediction accuracies from this study are sufficient to provide farmers with an additional tool for fertility management, it needs to be explored in discussions with farmers and breeding organizations.

Keywords: MIR spectroscopy, pregnancy prediction, dairy cow, PLS


Balhara, A. K., Gupta, M., Singh, S., Mohanty, A. K., & Singh, I. (2013). Early pregnancy diagnosis in bovines: Current status and future directions. The Scientific World Journal, 2013. h

Bekele, N., Addis, M., Abdela, N., & Ahmed, W. M. (2016). Pregnancy Diagnosis in Cattle for Fertility Management: A Review. Global Veterinaria, 16(4), 355–364.

Benedet, A., Franzoi, M., Penasa, M., Pellattiero, E., & De Marchi, M. (2019). Prediction of blood metabolites from milk mid-infrared spectra in early-lactation cows. Journal of Dairy Science, 102(12), 11298–11307.

Delhez, P., Ho, P. N., Gengler, N., Soyeurt, H., & Pryce, J. E. (2020). Diagnosing the pregnancy status of dairy cows: How useful is milk mid-infrared spectroscopy? Journal of Dairy Science, 103(4), 3264–3274.

Egger-Danner, C., Fürst, C., Mayerhofer, M., Rain, C., & Rehling, C. (2018). ZuchtData Jahresbericht 2018. Vienna. [Online]. Available at: [Accessed: 2020, May 15].

Gengler, N., Tijani, A., Wiggans, G. R., & Misztal, I. (1999). Estimation of (Co)variance function coefficients for test day yield with a expectation-maximization restricted maximum likelihood algorithm. Journal of Dairy Science, 82(8), 1849.e1-1849.e23.

Grelet, C., Fernández Pierna, J. A., Dardenne, P., Baeten, V., & Dehareng, F. (2015). Standardization of milk mid-infrared spectra from a European dairy network. Journal of Dairy Science, 98(4), 2150–2160.

Grelet, C., Bastin, C., Gelé, M., Davière, J. B., Johan, M., Werner, A., Reding, R., Fernandes Pierna, J. A., Colinet, F. G., Dardenne, P., Gendler, N., Soyeurt, H. & Dehareng, F. (2016). Development of Fourier transform mid-infrared calibrations to predict acetone, β-hydroxybutyrate, and citrate contents in bovine milk through a European dairy network. Journal of Dairy Science, 99(6), 4816–4825.

Hirpa, A., Yehualaw, B., Wube, A., Asnake, A., Jemberu, A., Medicine, V., & Box, P. O. (2018). Review on Pregnancy Diagnosis in Dairy Cows, 9(2), 45–55.

Ho, P. N., Bonfatti, V., Luke, T. D. W., & Pryce, J. E. (2019). Classifying the fertility of dairy cows using milk mid-infrared spectroscopy. Journal of Dairy Science.

Humblot, P. (2001). Monitor Pregnancy and Determine the Timing , Frequencies and Sources of Embryonic Mortality in Ruminants. Theriogenology, 56(01), 1417–1433.

Kuhn, M. (2008). Building Predictive Models in R Using the caret Package. Journal of Statistical Software, 28(5), 1–26.

Lainé, A., Bel Mabrouk, H., Dale, L. M., Bastin, C., & Gengler, N. (2014). How to use mid-infrared spectral information from milk recording system to detect the pregnancy status of dairy cows. Communications in Agricultural and Applied Biological Sciences, 79(1), 33–38.

Lainé, A., Bastin, C., Grelet, C., Hammami, H., Colinet, F. G., Dale, L. M., Gillon, A., Vandenplas, J., Deharend, F. & Gengler, N. (2017). Assessing the effect of pregnancy stage on milk composition of dairy cows using mid-infrared spectra. Journal of Dairy Science, 100(4), 2863–2876.

Lantz, B. (2015). Machine Learning with R. Machine Learning (Second Edi). Packt Publishing Ltd.
Mineur, A., Köck, A., Grelet, C., Gengler, N., Egger-Danner, C., & Sölkner, J. (2017). First Results in the Use of Milk Mid-infrared Spectra in the Detection of Lameness in Austrian Dairy Cows Genomic evaluation View project MACSUR View project. Agriculturae Conspectus Scientifi Cus, Vol. 82(No. 2 (163-166)), (163-166). Retrieved from

Olori, V. E., Brotherstone, S., Hill, W. G., & McGuirk, B. J. (1997). Effect of gestation stage on milk yield and composition in Holstein Friesian dairy cattle. Livestock Production Science, 52(2), 167–176.

Pohler, K. G., Franco, G. A., Reese, S. T., Dantas, F. G., Ellis, M. D., & Payton, R. R. (2016). Past, present and future of pregnancy detection methods. Applied Reproductive Strategies in Beef Cattle 7-8 September 2016, 251–259.

Rienesl, L., Khayatzadeh, N., Köck, A., Dale, L., Werner, A., Grelet, C., Gengler, N., Auer, F-J., Egger-Danner, C., Massart, X. & Sölkner, J. (2019). Mastitis detection from milk mid-infrared (MIR) spectroscopy in dairy cows. Acta Universitatis Agriculturae et Silviculturae Mendelianae Brunensis, 67(5), 1221–1226.

Santos, J. E. P., Thatcher, W. W., Chebel, R. C., Cerri, R. L. A., & Galvão, K. N. (2004). The effect of embryonic death rates in cattle on the efficacy of estrus synchronization programs. Animal Reproduction Science, 82–83, 513–535.

SAS Institute Inc. (2017). SAS software 9.4. SAS Institute Inc., Cary, NC, USA.

Soyeurt, H., Dehareng, F., Gengler, N., McParland, S., Wall, E., Berry, D. P., Coffey, P. & Dardenne, P. (2011). Mid-infrared prediction of bovine milk fatty acids across multiple breeds, production systems, and countries. Journal of Dairy Science, 94(4), 1657–1667.

Soyeurt, H., Bastin, C., Colinet, F. G., Arnould, V. M.-R., Berry, D. P., Wall, E., Dehareng, F., Nguyen, H. N., Pardenne, P., Schefers, J., Vandenplas, J., Weigel, K., Coffey, M., Théron, L., Detilleux, J., Reding, E., Gengler, N. & McParland, S. (2012). Mid-infrared prediction of lactoferrin content in bovine milk: potential indicator of mastitis. Animal, 6(11), 1830–1838.

Toffanin, V., De Marchi, M., Lopez-Villalobos, N., & Cassandro, M. (2015). Effectiveness of mid-infrared spectroscopy for prediction of the contents of calcium and phosphorus, and titratable acidity of milk and their relationship with milk quality and coagulation properties. International Dairy Journal, 41, 68–73.

Vanlierde, A., Vanrobays, M.-L., Dehareng, F., Froidmont, E., Soyeurt, H., McParland, S., S., Lewis, E., Deighton, M. H., Grandl, F., Kreuzer, M., Gredler, B., Dardenne, P. & Gengler, N. (2015). Hot topic: Innovative lactation-stage-dependent prediction of methane emissions from milk mid-infrared spectra. Journal of Dairy Science, 98(8), 5740–5747.

Vanlierde, A., Soyeurt, H., Gengler, N., Colinet, F. G., Froidmont, E., Kreuzer, M., Grandl, F., Bell, M., Lund, P., Olijhoek, D. W., Eugéne M., Martin, C., Kuhla, B. & Dehareng, F. (2018). Short communication: Development of an equation for estimating methane emissions of dairy cows from milk Fourier transform mid-infrared spectra by using reference data obtained exclusively from respiration chambers. Journal of Dairy Science, 101(8).


Full Text:



  • There are currently no refbacks.

Copyright (c) 2020 Acta Fytotechnica et Zootechnica

© Slovak University of Agriculture in Nitra, Faculty of Agrobiology and Food Resources