Abstract
Accurate prediction of infectious disease dynamics is essential for effective prevention and control, particularly in livestock health. Mastitis, a prevalent and economically significant disease in dairy cattle, poses challenges for traditional compartmental models such as the Susceptible-Infected-Susceptible (SIS) model. These models often fail to account for nonlinear interactions, noise, and unobserved factors in real-world scenarios. In this study, we propose a hybrid modelling approach that combines mechanistic compartmental models with data-driven machine learning techniques, including Physics-Informed Neural Networks (PINNs), Recurrent Neural Networks (RNNs), and Neural Ordinary Differential Equations (Neural ODEs) to improve the prediction of mastitis transmission dynamics. Using real-world longitudinal data from dairy farms, we compare these models against the classical SIS model. Our results reveal that the RNN achieves superior accuracy (RMSE: 0.004 vs. 0.050 for SIS; R2: 0.99 vs. 0.02), while Neural ODEs balance interpretability and performance (RMSE: 0.025–0.030). PINNs, though outperforming SIS (RMSE: 0.046 vs. 0.050), are constrained by their physics-based framework. All data-driven models significantly improve upon the SIS model in capturing nonlinearities, noise, and unobserved factors. This study highlights the potential of integrating machine learning with compartmental theory to enhance disease modelling, risk prediction, and decision-making in animal health management.