Exploring the Potential of Symbolic Regression in Precision Livestock Farming
Authors: Elisabeth Mayrhuber, Maciej Oczak, Michael Iwersen, David Brunner, Viktoria Dorfer, Stephan Winkler
Organizations: Bioinformatics Research Group, PLFDoc, University of Applied Sciences Upper Austria, Hagenberg, Austria · Computer Vision Lab, TU Wien, Vienna, Austria · Precision Livestock Farming Hub, The University of Veterinary Medicine Vienna, Vienna, Austria · Center for Animal Nutrition and Welfare, The University of Veterinary Medicine Vienna, Vienna, Austria · Center for Veterinary Systems Transformation and Sustainability, Clinical Unit for Herd Health Management, The University of Veterinary Medicine Vienna, Vienna, Austria
The ability to predict farrowing time in pigs is crucial for optimal farm management and ensuring piglet survival. This study investigates the potential of explainable artificial intelligence for precision livestock farming, focusing on acceleration sensor data from sows around the time of farrowing. Accurately predicting farrowing allows farmers to balance both, piglet safety by avoiding piglet crushing events and the mother sow's welfare, by avoiding early crating. Traditional machine learning models often lack interpretability (``closed-box'' problem). Explainable artificial intelligence offers a solution by revealing the decision-making processes within the models. This work is split into two stages. First the detection of nest building behaviour and second the prediction of the remaining time to farrowing. The nest building detection was possible for 166 out of 180 sows and successful within 48 hours before farrowing for 149 sows. The nest building detection is purely based on the change of a sow's activity level and uses no machine learning techniques. Further, this study utilizes symbolic regression, an open-box modelling technique that generates interpretable mathematical formulas, to predict the remaining time until the onset of farrowing. The results are compared with closed-box models, like support vector regression and artificial neural networks, for both explainability and performance. Notably, symbolic regression achieved a mean absolute error of 9.28 hours for the time-to-farrowing prediction, outperforming the closed-box models in terms of performance and interpretability. This research demonstrates that explainable artificial intelligence, specifically symbolic regression, can offer both interpretable results and competitive performance in precision livestock farming.
Figures & tables
Pen type
Training
Test
Wing
48
12
SWAP
44
12
Trapezoid
52
12
Total
144
36
Table 1: Number of sows used training and test split based on pen types.
Model
MAE [h]
PCC
Training
Validation
Training
Validation
Mean
Std
Mean
Std
Mean
Std
Mean
Std
SR
17.70
1.21
22.55
2.25
0.60
0.05
0.42
0.06
LR
26.80
0.85
27.22
2.42
0.45
0.01
0.44
0.04
ANN
23.17
1.03
24.56
2.22
0.56
0.02
0.50
0.04
RF
8.83
0.43
24.35
2.73
0.96
0.004
0.49
0.06
Table 2: Training and validation performance for 5-fold cross-validation.
Figure 1: Detection of nest building behaviour for one sow. The dashed line (red) shows the detected start of nest building behaviour, and the highlighted area (green) shows the true time of farrowing. This detection is done online using a sliding window approach.
Method
MAE [h]
PCC
Training
Test
Training
Test
Mean
Std
Mean
Std
Mean
Std
Mean
Std
SR
19.57
26.61
9.28
13.09
0.73
0.31
0.76
0.21
LR
22.05
20.59
18.04
10.51
0.89
0.22
0.90
0.29
ANN
21.46
25.33
17.28
14.36
0.81
0.25
0.86
0.22
RF
20.51
22.40
19.10
16.88
0.74
0.33
0.79
0.23
Table 3: Performance of different models in a real time setting for time to farrowing predictions.
Figure 2: The points show the predicted compared to the actual time to farrowing for one sow, using symbolic regression. The line shows how a perfect prediction would look like.
Figure 3: Both images show the performance of the time to farrowing prediction for the same sow as in Figure 2 . The left figure (a) shows the prediction made by the linear regression model and the right figure (b) shows the prediction of the artificial neural network.
May 25, 2026·Marcos Vinicius Mendes Faria, Thiago Borges Pereira, Isabella C. F. S. Condotta +2Edge InferencePseudo-Labeling
Coordenadoria de Inform´atica, Instituto Federal do Esp´ırito Santo (IFES), Serra, ES · Department of Animal Sciences, University of Illinois at Urbana-Champaign, USA
a School of Computing, Mathematics and Engineering, Charles Sturt University, Wagga Wagga, NSW 2650, Australia · b School of Computing, Mathematics and Engineering, Charles Sturt University, Albury, NSW 2640, Australia · c Gulbali Institute for Agriculture, Water and Environment, Charles Sturt University, Wagga Wagga, NSW 2678, Australia +4