A comparative analysis of machine learning classifiers for modeling the number of liveborn piglets

The profitability of pig farms is largely dependent on the productivity of their sow herds, often measured as the number of piglets weaned per sow per year, which is closely linked to the number of liveborn piglets (NLB) per sow per litter. To improve farming efficiency, underproducing sows are often culled and replaced to reduce and compensate for their maintenance costs. However, wrongly culling highly productive sows incurs costs associated with replacement and missed opportunities. Therefore, the ability to distinguish between sows with high and low productivity is very valuable. This study evaluated the predictive performance of six traditional and three ensemble machine learning classification models to predict whether NLB in the subsequent parity is "Low" (NLB < 13), "Medium" (13 ≤ NLB ≤ 16) or "High" (NLB > 16). This evaluation was conducted using data collected during the current parity from two distinct farm settings: the CDPQ Dataset (415 sows, 468 parity records, 1 research farm) from a research farm, and the Hypor Dataset (11,633 sows, 27,547 records, 12 commercial farms). Six input production measurements were common across both datasets: parity, gestation length, lactation length, current parity NLB, and the number of stillborn, mummified and weaned piglets. The CDPQ Dataset included 6 additional input production measurements: body weight (BW) and backfat thickness (BFT) measured at the time of breeding, farrowing and weaning. Classifiers used these input variables to generate predictions, and their performances were assessed using weighted F1-Score. The best-performing classifier for the CDPQ and the Hypor Datasets was Stochastic Gradient Descent (SGD), which achieved the highest weighted F1-Score of 0.37 and 0.45, respectively. In addition, by removing the six BW and BFT variables from the CDPQ Dataset (reduced CDPQ Dataset), the SGD classifier only attained a weighted F1-Score of 0.43, likely caused by information redundancy and limited dataset size. Despite improved performance, variable importance analysis for the CDPQ dataset identified BW and BFT at weaning as the key predictors, suggesting that including these traits could similarly enhance models trained on the Hypor dataset. Overall, the study demonstrated that machine learning classifiers show promise for forecasting sow productivity, though further research with more extensive and higher-quality datasets is required before broad industry adoption.

Authors

Institutions

Publication Details

Journal
Journal of Animal Science
Published
2025-12-05
DOI
https://doi.org/10.1093/jas/skaf414
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A comparative analysis of machine learning classifiers for modeling the number of liveborn piglets

Dan Tulpan, Laurence Maignel, Patrick Gagnon, Mohsen Jafarikia et al.
Journal of Animal Science
Animal Behavior and Welfare Studies
article

A comparative analysis of machine learning classifiers for modeling the number of liveborn piglets

Dan Tulpan, Laurence Maignel, Patrick Gagnon, Mohsen Jafarikia, Ji Yang, Julang Li, B. M. DeVries
article en

Abstract

The profitability of pig farms is largely dependent on the productivity of their sow herds, often measured as the number of piglets weaned per sow per year, which is closely linked to the number of liveborn piglets (NLB) per sow per litter. To improve farming efficiency, underproducing sows are often culled and replaced to reduce and compensate for their maintenance costs. However, wrongly culling highly productive sows incurs costs associated with replacement and missed opportunities. Therefore, the ability to distinguish between sows with high and low productivity is very valuable. This study evaluated the predictive performance of six traditional and three ensemble machine learning classification models to predict whether NLB in the subsequent parity is "Low" (NLB < 13), "Medium" (13 ≤ NLB ≤ 16) or "High" (NLB > 16). This evaluation was conducted using data collected during the current parity from two distinct farm settings: the CDPQ Dataset (415 sows, 468 parity records, 1 research farm) from a research farm, and the Hypor Dataset (11,633 sows, 27,547 records, 12 commercial farms). Six input production measurements were common across both datasets: parity, gestation length, lactation length, current parity NLB, and the number of stillborn, mummified and weaned piglets. The CDPQ Dataset included 6 additional input production measurements: body weight (BW) and backfat thickness (BFT) measured at the time of breeding, farrowing and weaning. Classifiers used these input variables to generate predictions, and their performances were assessed using weighted F1-Score. The best-performing classifier for the CDPQ and the Hypor Datasets was Stochastic Gradient Descent (SGD), which achieved the highest weighted F1-Score of 0.37 and 0.45, respectively. In addition, by removing the six BW and BFT variables from the CDPQ Dataset (reduced CDPQ Dataset), the SGD classifier only attained a weighted F1-Score of 0.43, likely caused by information redundancy and limited dataset size. Despite improved performance, variable importance analysis for the CDPQ dataset identified BW and BFT at weaning as the key predictors, suggesting that including these traits could similarly enhance models trained on the Hypor dataset. Overall, the study demonstrated that machine learning classifiers show promise for forecasting sow productivity, though further research with more extensive and higher-quality datasets is required before broad industry adoption.

Journal of Animal ScienceVol. 104
Dalhousie University (CA), Hendrix Genetics (Canada) (CA), Canadiana.org (CA), Centre de Développement du Porc du Québec (CA), University of Guelph (CA)
Canada First Research Excellence Fund, Natural Sciences and Engineering Research Council of Canada
Openalex Percentile: Top 56%
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.