Improving interpretability and applicability of welfare management decisions in dairy cows through explainable artificial intelligence
Abstract
Abstract Background Improving animal welfare and health is a key objective in modern dairy systems. However, translating routinely available dairy herd improvement records into transparent and actionable welfare-related decisions remains challenging, particularly when using complex machine learning (ML) models. This study was designed as a proof of concept to evaluate whether explainable artificial intelligence (XAI) can improve the interpretability of ML models trained to reconstruct welfare indicators (WIs) derived from the Italian Breeders Association welfare-risk framework. Results Monthly records from 798 dairy cows were used to predict individual WIs for mastitis, subclinical acidosis, subclinical ketosis, longevity, and reproduction. Random forest regression models were trained using six routinely available test-day traits: milk acetone, fat, lactose, protein, urea, and electrical conductivity. The final dataset included 125,285 monthly cow records, split into training and test sets. In the test set, the models achieved Pearson correlations of 0.982, 0.987, 0.971, 0.979, and 0.978 for longevity, mastitis, subclinical ketosis, subclinical acidosis, and reproduction, respectively. The predicted WIs were used to reconstruct the overall welfare class, classified as good, intermediate, or risk, achieving a balanced accuracy of 0.841. SHapley Additive exPlanations were used to evaluate how the fitted models used each feature, while counterfactual explanations identified minimal feature changes required to shift risk predictions toward good welfare. Most explanation patterns were biologically plausible, although some non-intuitive outputs highlighted the need for expert oversight. Conclusions This proof-of-concept study shows how XAI can improve transparency and model auditing in welfare-related decision-support systems, while emphasizing the need for external validation before on-farm implementation.
// Source
Authors: Pablo Augusto de Souza Fonseca, Aroa Suárez‐Vega, Beatriz Gutiérrez-Gil, Christos Dadousis, Nophar Geifman, C. Melilli, Lorenzo Pascarella, Anthony D. Whetton, J. J. Arranz
Institutions: University of Surrey, Universidad de León, Instituto de Ganadería de Montaña, Associazione Italiana Arbitri, Associazione Italiana Sclerosi Multipla, ANT Foundation Italy Onlus