Recent feeding history drives prediction of daily feed intake in lactating sows

Abstract Accurate prediction of feed intake (FI) in lactating sows is essential for precision nutrition, welfare monitoring, and sustainable production. Feed intake during lactation is influenced by both physiological and environmental factors, but the complexity of individual FI makes traditional modeling approaches challenging. Machine learning (ML) provides flexible tools for capturing nonlinear dynamics in sow-feeding datasets. This study evaluated multiple ML algorithms to predict and forecast FI using 17,171 daily observations from 898 lactating sows. Five ML algorithms were tested: Generalized Additive Model (GAM), Elastic Net Regression (ENET), Random Forest (RDF), Extreme Gradient Boosting (XGB), and Light Gradient Boosting Machine (LGB). Predictors included environmental variables (daily maximum air temperature and daily maximum dew point), biological variables (parity and lactation day), and historical data derived from recent FI events (moving averages, lag variables, and intake variability), along with their interactions. An 8:2 sow-level train/test split was employed, along with grouped 5-fold cross-validation (CV) to prevent data leakage. Model performance, feature importance, and forecasting ability were assessed. All models performed similarly, with R ² values between 0.818 (ENET) and 0.828 (LGB) on the test sets and root mean squared errors (RMSE) between 0.993 kg (RDF) and 1.014 kg (ENET). However, GAM, ENET, and LGB showed less overfitting than XGB and RDF, evidenced by a train-test performance gap of over 5 percentage points. Forecasting accuracy remained strong for 1- to 3-day-ahead predictions (R² = 0.61–0.71) but declined progressively thereafter, suggesting that ML models captured short-term individual dynamics but gradually reverted toward lactation-specific averages over longer periods. Historical variables contributed to 71.6% of the total predictive power, with the three-day moving average being the most influential feature, according to its mean absolute Shapley additive explanatory value (SHAP) of 0.728, followed by the one-day lag (SHAP = 0.715). Models without historical variables showed decreased performance, with errors increasing from +0.294 to + 0.316 kg/d. Overall, this study demonstrates that ML models can accurately predict daily FI when incorporating historical data, highlighting the potential of ML-driven forecasting to facilitate personalized, data-driven feeding strategies in precision swine production systems.

Authors

Institutions

Publication Details

Journal
Translational Animal Science
Published
2026-08-04
DOI
https://doi.org/10.1093/tas/txag118
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Recent feeding history drives prediction of daily feed intake in lactating sows

Hinayah Rojas de Oliveira, Qianqian Huang, Luiz Fernando Brito, Hyatt Frobose et al.
Translational Animal Science
Animal Behavior and Welfare Studies
article

Recent feeding history drives prediction of daily feed intake in lactating sows

Hinayah Rojas de Oliveira, Qianqian Huang, Luiz Fernando Brito, Hyatt Frobose, Maria Victoria Souza, Alex Batista Trentin, Brian Richert, Allan Schinckel
article en

Abstract

Abstract Accurate prediction of feed intake (FI) in lactating sows is essential for precision nutrition, welfare monitoring, and sustainable production. Feed intake during lactation is influenced by both physiological and environmental factors, but the complexity of individual FI makes traditional modeling approaches challenging. Machine learning (ML) provides flexible tools for capturing nonlinear dynamics in sow-feeding datasets. This study evaluated multiple ML algorithms to predict and forecast FI using 17,171 daily observations from 898 lactating sows. Five ML algorithms were tested: Generalized Additive Model (GAM), Elastic Net Regression (ENET), Random Forest (RDF), Extreme Gradient Boosting (XGB), and Light Gradient Boosting Machine (LGB). Predictors included environmental variables (daily maximum air temperature and daily maximum dew point), biological variables (parity and lactation day), and historical data derived from recent FI events (moving averages, lag variables, and intake variability), along with their interactions. An 8:2 sow-level train/test split was employed, along with grouped 5-fold cross-validation (CV) to prevent data leakage. Model performance, feature importance, and forecasting ability were assessed. All models performed similarly, with R ² values between 0.818 (ENET) and 0.828 (LGB) on the test sets and root mean squared errors (RMSE) between 0.993 kg (RDF) and 1.014 kg (ENET). However, GAM, ENET, and LGB showed less overfitting than XGB and RDF, evidenced by a train-test performance gap of over 5 percentage points. Forecasting accuracy remained strong for 1- to 3-day-ahead predictions (R² = 0.61–0.71) but declined progressively thereafter, suggesting that ML models captured short-term individual dynamics but gradually reverted toward lactation-specific averages over longer periods. Historical variables contributed to 71.6% of the total predictive power, with the three-day moving average being the most influential feature, according to its mean absolute Shapley additive explanatory value (SHAP) of 0.728, followed by the one-day lag (SHAP = 0.715). Models without historical variables showed decreased performance, with errors increasing from +0.294 to + 0.316 kg/d. Overall, this study demonstrates that ML models can accurately predict daily FI when incorporating historical data, highlighting the potential of ML-driven forecasting to facilitate personalized, data-driven feeding strategies in precision swine production systems.

Translational Animal Science
Purdue University West Lafayette (US), Université Laval (CA)
Responsible consumption and production
Openalex Percentile: Top 7%
Animal Behavior and Welfare Studies
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.

Laika access coming soon