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
- Chinmoy Saha (ORCID: https://orcid.org/0000-0003-0474-0615)
- Brian Medeiros (ORCID: https://orcid.org/0000-0003-2188-4784)
- Toufik Abdul‐Rahman (ORCID: https://orcid.org/0000-0003-0153-287X)
- Jeffrey D. Hooker (ORCID: https://orcid.org/0000-0003-4299-6152)
- Anderson Antônio Carvalho Alves (ORCID: https://orcid.org/0000-0001-8306-0487)
Institutions
- University of Georgia (US)
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