Soft Computing Approaches for Predicting Shade-Seeking Behavior in Dairy Cattle Under Heat Stress: A Comparative Study of Random Forests and Neural Networks

Heat stress is one of the main welfare and productivity problems faced by dairy cattle in Mediterranean climates. The main objective of this work is to predict heat stress in livestock from shade-seeking behavior captured by computer vision, combined with some climatic features, in a completely non-invasive way. To this end, we evaluate two soft computing algorithms—Random Forests and Neural Networks—clarifying the trade-off between accuracy and interpretability for real-world farm deployment. Data were gathered at a commercial dairy farm in Titaguas (Valencia, Spain) using overhead cameras that counted cows in the shade every 5–10 min during summer 2023. Each record contains the shaded-cow count, ambient temperature, relative humidity, and an exact timestamp. From here, three thermal indices were derived: the current THI, the previous-night mean THI, and the day-time accumulated THI. The resulting dataset covers 75 days and 6907 day-time observations. To evaluate the models’ performance a 5-fold cross-validation is also used. The results show that both soft computing models outperform a single Decision Tree baseline. The best Neural Network (3 hidden layers, 16 neurons each, learning rate =10−3) reaches an average RMSE of 14.78, while a Random Forest (10 trees, depth =5) achieves 14.97 and offers the best interpretability. Daily error distributions reveal a median RMSE of 13.84 and confirm that predictions deviate less than one hour from observed shade-seeking peaks. Although the dataset came from a single farm, the results generalized well within the observed range. However, the models could not accurately predict the exact number of cows in the shade. This suggests the influence of other variables not included in the analysis (such as solar radiation or wind data), which opens the door for future research.

Authors

Institutions

Publication Details

Journal
Mathematics
Published
2025-08-19
DOI
https://doi.org/10.3390/math13162662
Citations
1
Primary Topic
Effects of Environmental Stressors on Livestock
Type
article
Field-Weighted Citation Impact
1.19

Funders

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

Soft Computing Approaches for Predicting Shade-Seeking Behavior in Dairy Cattle Under Heat Stress: A Comparative Study of Random Forests and Neural Networks

J. M. Calabuig, Fernándo Estellés, Daniel Alexander Méndez, Roger Arnau et al.
1 citations
Mathematics
Effects of Environmental Stressors on Livestock
1.19
article

Soft Computing Approaches for Predicting Shade-Seeking Behavior in Dairy Cattle Under Heat Stress: A Comparative Study of Random Forests and Neural Networks

J. M. Calabuig, Fernándo Estellés, Daniel Alexander Méndez, Roger Arnau, Xabier Díaz de Otálora, Sergi Sanjuan
article en
1 citations

Abstract

Heat stress is one of the main welfare and productivity problems faced by dairy cattle in Mediterranean climates. The main objective of this work is to predict heat stress in livestock from shade-seeking behavior captured by computer vision, combined with some climatic features, in a completely non-invasive way. To this end, we evaluate two soft computing algorithms—Random Forests and Neural Networks—clarifying the trade-off between accuracy and interpretability for real-world farm deployment. Data were gathered at a commercial dairy farm in Titaguas (Valencia, Spain) using overhead cameras that counted cows in the shade every 5–10 min during summer 2023. Each record contains the shaded-cow count, ambient temperature, relative humidity, and an exact timestamp. From here, three thermal indices were derived: the current THI, the previous-night mean THI, and the day-time accumulated THI. The resulting dataset covers 75 days and 6907 day-time observations. To evaluate the models’ performance a 5-fold cross-validation is also used. The results show that both soft computing models outperform a single Decision Tree baseline. The best Neural Network (3 hidden layers, 16 neurons each, learning rate =10−3) reaches an average RMSE of 14.78, while a Random Forest (10 trees, depth =5) achieves 14.97 and offers the best interpretability. Daily error distributions reveal a median RMSE of 13.84 and confirm that predictions deviate less than one hour from observed shade-seeking peaks. Although the dataset came from a single farm, the results generalized well within the observed range. However, the models could not accurately predict the exact number of cows in the shade. This suggests the influence of other variables not included in the analysis (such as solar radiation or wind data), which opens the door for future research.

MathematicsVol. 13(16)
Universitat Politècnica de València (ES)
European Commission, HORIZON EUROPE Framework Programme, Universitat Politècnica de València, Agencia Estatal de Investigación
Openalex Percentile: Top 21%
Effects of Environmental Stressors on Livestock
1.19
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.