Evaluating the contribution of behavioral, milking system, and environmental data to short-term milk yield prediction in commercial dairy cows using machine learning

The objectives of this study were 2-fold: (1) to investigate the associations among variables derived from an automatic milking system (AMS), rumination collars (SCR Heatime), and public weather stations; and (2) to assess how combinations of specific data types (e.g., AMS, SCR, or weather data) influence the predictive accuracy of 7-d average milk yield (DMY7) using different machine learning methods. Data were collected from 1,312 lactating cows in a freestall system with AMS at a commercial dairy farm in Chowchilla, California. The dataset comprised 326,204 AMS-derived observations, including daily milk yield (DMY), electrical conductivity (EC), milk flow rate, and number of milkings, as well as 363,554 collar-based observations of rumination and activity time using the SCR system. Daily weather data were obtained from a nearby station and used to calculate the temperature-humidity index (THI). We investigated the associations between these variables using Pearson correlation and mixed-model analyses. Time series features were extracted from 14-d intervals to predict DMY7 considering different dataset combinations: Base, Weather, SCR, SCR+Weather, DMY, DMY+Weather, DMY+Weather+SCR, AMS, AMS+Weather, and All. Based on the different feature datasets, 3 predictive models were trained: ridge regression, gradient boosting machine, and random forest. Model performance was evaluated based on the coefficient of determination (R<sup>2</sup>) and mean absolute error (MAE). The effects of variable combination and prediction algorithm on the R<sup>2</sup> and MAE obtained for DMY7 predictions were tested using a linear mixed-model analysis. Exploratory analyses revealed clear differences in AMS traits across lactation stages and parities. Elevated THI reduced milk yield, rumination time, and milking frequency, while increasing EC and activity, indicating a detrimental impact of heat stress on these traits. Weak to moderate correlations were observed between milk yield and rumination (r = 0.34-0.54) or activity (r = -0.17 to -0.37), supporting the inclusion of behavioral data as predictive features. In the absence of historical DMY, integrating collar and weather data significantly improved prediction performance, increasing average R<sup>2</sup> from 0.263 (Base) to 0.396 (SCR+Weather) and reducing MAE from 5.886 to 5.337 kg. Including previous DMY yielded the greatest gains (R<sup>2</sup> = 0.827; MAE = 2.69 kg) compared with Base variables. Although additional AMS, collar, and weather data had a limited effect on R<sup>2</sup> in DMY-informed models, they significantly reduced prediction error. These findings highlight the importance of behavioral and environmental data in milk yield prediction, particularly when historical milk yield records are unavailable. Integrating sensor-based monitoring can enhance precision dairy strategies and improve forecasting accuracy.

Authors

Institutions

Publication Details

Journal
Journal of Dairy Science
Published
2025-08-15
DOI
https://doi.org/10.3168/jds.2025-26724
Primary Topic
Effects of Environmental Stressors on Livestock
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Evaluating the contribution of behavioral, milking system, and environmental data to short-term milk yield prediction in commercial dairy cows using machine learning

Chinmoy Saha, Brian Medeiros, Toufik Abdul‐Rahman, Jeffrey D. Hooker et al.
1 links
Journal of Dairy Science
Effects of Environmental Stressors on Livestock
article

Evaluating the contribution of behavioral, milking system, and environmental data to short-term milk yield prediction in commercial dairy cows using machine learning

Chinmoy Saha, Brian Medeiros, Toufik Abdul‐Rahman, Jeffrey D. Hooker, Anderson Antônio Carvalho Alves
article en

Abstract

The objectives of this study were 2-fold: (1) to investigate the associations among variables derived from an automatic milking system (AMS), rumination collars (SCR Heatime), and public weather stations; and (2) to assess how combinations of specific data types (e.g., AMS, SCR, or weather data) influence the predictive accuracy of 7-d average milk yield (DMY7) using different machine learning methods. Data were collected from 1,312 lactating cows in a freestall system with AMS at a commercial dairy farm in Chowchilla, California. The dataset comprised 326,204 AMS-derived observations, including daily milk yield (DMY), electrical conductivity (EC), milk flow rate, and number of milkings, as well as 363,554 collar-based observations of rumination and activity time using the SCR system. Daily weather data were obtained from a nearby station and used to calculate the temperature-humidity index (THI). We investigated the associations between these variables using Pearson correlation and mixed-model analyses. Time series features were extracted from 14-d intervals to predict DMY7 considering different dataset combinations: Base, Weather, SCR, SCR+Weather, DMY, DMY+Weather, DMY+Weather+SCR, AMS, AMS+Weather, and All. Based on the different feature datasets, 3 predictive models were trained: ridge regression, gradient boosting machine, and random forest. Model performance was evaluated based on the coefficient of determination (R<sup>2</sup>) and mean absolute error (MAE). The effects of variable combination and prediction algorithm on the R<sup>2</sup> and MAE obtained for DMY7 predictions were tested using a linear mixed-model analysis. Exploratory analyses revealed clear differences in AMS traits across lactation stages and parities. Elevated THI reduced milk yield, rumination time, and milking frequency, while increasing EC and activity, indicating a detrimental impact of heat stress on these traits. Weak to moderate correlations were observed between milk yield and rumination (r = 0.34-0.54) or activity (r = -0.17 to -0.37), supporting the inclusion of behavioral data as predictive features. In the absence of historical DMY, integrating collar and weather data significantly improved prediction performance, increasing average R<sup>2</sup> from 0.263 (Base) to 0.396 (SCR+Weather) and reducing MAE from 5.886 to 5.337 kg. Including previous DMY yielded the greatest gains (R<sup>2</sup> = 0.827; MAE = 2.69 kg) compared with Base variables. Although additional AMS, collar, and weather data had a limited effect on R<sup>2</sup> in DMY-informed models, they significantly reduced prediction error. These findings highlight the importance of behavioral and environmental data in milk yield prediction, particularly when historical milk yield records are unavailable. Integrating sensor-based monitoring can enhance precision dairy strategies and improve forecasting accuracy.

Journal of Dairy ScienceVol. 108(10)
University of Georgia (US)
Life in Land
Openalex Percentile: Top 76%
Effects of Environmental Stressors on Livestock
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.