Predicting reticuloruminal pH and subacute ruminal acidosis of individual cows using machine learning and Fourier-transform infrared spectroscopy milk analysis

Low reticuloruminal pH (rpH) for a prolonged period could lead to SARA. This disease negatively affects cow health and is associated with monetary losses for the dairy industry. The aim of this study was to predict rpH and SARA separately using different machine learning (ML) models applied to Fourier-transform infrared spectroscopy (FTIR) spectra obtained from routine DHI milk analysis of individual cows. A total of 107 primiparous and multiparous Holstein cows were selected from 12 commercial farms in Québec, Canada, and their rpH was continuously monitored for 150 d using wireless boluses. In parallel, 2,634 individual milk samples were collected in the morning and afternoon and analyzed to obtain FTIR spectra. After the cleaning process, 1,744 samples remained, evenly divided into 872 morning (a.m.) and 872 afternoon (p.m.) samples. The FTIR and rpH data were combined to create 3 equally balanced datasets for ML model development: one for a.m. samples, one for p.m. samples, and one composed of both a.m. and p.m. samples, with 872 samples in each dataset. Various spectra preprocessing methods were evaluated, including using the first derivative of the spectra and filtering with 3 different sets of spectra. Additionally, different ML algorithms, including partial least squares, random forest, and gradient boosting, were used to predict rpH and SARA. A total of 36 different models were developed and evaluated for both rpH and SARA prediction. All ML models were assessed using 3 different cross-validation (C-V) methods: nested 10-fold, nested leave-one-farm-out (LOFO), and nested leave-cows-out (LCO) C-V. For rpH prediction, the best performance was achieved using nested 10-fold C-V with median R<sup>2</sup> values of 0.26, 0.26, and 0.22 for the a.m., p.m., and a.m./p.m. datasets, respectively. However, these performances were likely overoptimistic as none of the models evaluated using nested LOFO or nested LCO C-V obtained R<sup>2</sup> higher than 0.12. Unlike rpH, SARA prediction accuracies evaluated using nested LOFO (a.m.: 59%, p.m.: 69%, a.m./p.m.: 64%), and nested LCO (a.m.: 67%, p.m.: 66%, a.m./p.m.: 64%) were closer to the nested 10-fold C-V. These results indicated that rpH was likely not predictable from FTIR, but SARA can be predicted separately and directly from FTIR with 69% accuracy from routine DHI milk samples of individual cows.

Authors

Institutions

Publication Details

Journal
Journal of Dairy Science
Published
2025-06-09
DOI
https://doi.org/10.3168/jds.2024-25970
Primary Topic
Spectroscopy and Chemometric Analyses
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Predicting reticuloruminal pH and subacute ruminal acidosis of individual cows using machine learning and Fourier-transform infrared spectroscopy milk analysis

É R Paquet, A. Bunel, D.E. Santschi, Dennis Warner et al.
Journal of Dairy Science
Spectroscopy and Chemometric Analyses
article

Predicting reticuloruminal pH and subacute ruminal acidosis of individual cows using machine learning and Fourier-transform infrared spectroscopy milk analysis

É R Paquet, A. Bunel, D.E. Santschi, Dennis Warner, R. Gervais, François Huot, S. Claveau, T Touil
article en

Abstract

Low reticuloruminal pH (rpH) for a prolonged period could lead to SARA. This disease negatively affects cow health and is associated with monetary losses for the dairy industry. The aim of this study was to predict rpH and SARA separately using different machine learning (ML) models applied to Fourier-transform infrared spectroscopy (FTIR) spectra obtained from routine DHI milk analysis of individual cows. A total of 107 primiparous and multiparous Holstein cows were selected from 12 commercial farms in Québec, Canada, and their rpH was continuously monitored for 150 d using wireless boluses. In parallel, 2,634 individual milk samples were collected in the morning and afternoon and analyzed to obtain FTIR spectra. After the cleaning process, 1,744 samples remained, evenly divided into 872 morning (a.m.) and 872 afternoon (p.m.) samples. The FTIR and rpH data were combined to create 3 equally balanced datasets for ML model development: one for a.m. samples, one for p.m. samples, and one composed of both a.m. and p.m. samples, with 872 samples in each dataset. Various spectra preprocessing methods were evaluated, including using the first derivative of the spectra and filtering with 3 different sets of spectra. Additionally, different ML algorithms, including partial least squares, random forest, and gradient boosting, were used to predict rpH and SARA. A total of 36 different models were developed and evaluated for both rpH and SARA prediction. All ML models were assessed using 3 different cross-validation (C-V) methods: nested 10-fold, nested leave-one-farm-out (LOFO), and nested leave-cows-out (LCO) C-V. For rpH prediction, the best performance was achieved using nested 10-fold C-V with median R<sup>2</sup> values of 0.26, 0.26, and 0.22 for the a.m., p.m., and a.m./p.m. datasets, respectively. However, these performances were likely overoptimistic as none of the models evaluated using nested LOFO or nested LCO C-V obtained R<sup>2</sup> higher than 0.12. Unlike rpH, SARA prediction accuracies evaluated using nested LOFO (a.m.: 59%, p.m.: 69%, a.m./p.m.: 64%), and nested LCO (a.m.: 67%, p.m.: 66%, a.m./p.m.: 64%) were closer to the nested 10-fold C-V. These results indicated that rpH was likely not predictable from FTIR, but SARA can be predicted separately and directly from FTIR with 69% accuracy from routine DHI milk samples of individual cows.

Journal of Dairy ScienceVol. 108(8)
Agriculture and Agri-Food Canada (CA), Ste. Anne's Hospital (CA), Université Laval (CA)
Zero hunger
Openalex Percentile: Top 86%
Spectroscopy and Chemometric Analyses
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.