Table of Contents
Fetching ...

A Physics-Informed, Behavior-Aware Digital Twin for Robust Multimodal Forecasting of Core Body Temperature in Precision Livestock Farming

Riasad Alvi, Mohaimenul Azam Khan Raiaan, Sadia Sultana Chowa, Arefin Ittesafun Abian, Reem E Mohamed, Md Rafiqul Islam, Yakub Sebastian, Sheikh Izzal Azid, Sami Azam

Abstract

Precision livestock farming requires accurate and timely heat stress prediction to ensure animal welfare and optimize farm management. This study presents a physics-informed digital twin (DT) framework combined with an uncertainty-aware, expert-weighted stacked ensemble for multimodal forecasting of Core Body Temperature (CBT) in dairy cattle. Using the high-frequency, heterogeneous MmCows dataset, the DT integrates an ordinary differential equation (ODE)-based thermoregulation model that simulates metabolic heat production and dissipation, a Gaussian process for capturing cow-specific deviations, a Kalman filter for aligning predictions with real-time sensor data, and a behavioral Markov chain that models activity-state transitions under varying environmental conditions. The DT outputs key physiological indicators, such as predicted CBT, heat stress probability, and behavioral state distributions are fused with raw sensor data and enriched through multi-scale temporal analysis and cross-modal feature engineering to form a comprehensive feature set. The predictive methodology is designed in a three-stage stacked ensemble, where stage 1 trains modality-specific LightGBM 'expert' models on distinct feature groups, stage 2 collects their predictions as meta-features, and at stage 3 Optuna-tuned LightGBM meta-model yields the final CBT forecast. Predictive uncertainty is quantified via bootstrapping and validated using Prediction Interval Coverage Probability (PICP). Ablation analysis confirms that incorporating DT-derived features and multimodal fusion substantially enhances performance. The proposed framework achieves a cross-validated R2 of 0.783, F1 score of 84.25% and PICP of 92.38% for 2-hour ahead forecasting, providing a robust, uncertainty-aware, and physically principled system for early heat stress detection and precision livestock management.

A Physics-Informed, Behavior-Aware Digital Twin for Robust Multimodal Forecasting of Core Body Temperature in Precision Livestock Farming

Abstract

Precision livestock farming requires accurate and timely heat stress prediction to ensure animal welfare and optimize farm management. This study presents a physics-informed digital twin (DT) framework combined with an uncertainty-aware, expert-weighted stacked ensemble for multimodal forecasting of Core Body Temperature (CBT) in dairy cattle. Using the high-frequency, heterogeneous MmCows dataset, the DT integrates an ordinary differential equation (ODE)-based thermoregulation model that simulates metabolic heat production and dissipation, a Gaussian process for capturing cow-specific deviations, a Kalman filter for aligning predictions with real-time sensor data, and a behavioral Markov chain that models activity-state transitions under varying environmental conditions. The DT outputs key physiological indicators, such as predicted CBT, heat stress probability, and behavioral state distributions are fused with raw sensor data and enriched through multi-scale temporal analysis and cross-modal feature engineering to form a comprehensive feature set. The predictive methodology is designed in a three-stage stacked ensemble, where stage 1 trains modality-specific LightGBM 'expert' models on distinct feature groups, stage 2 collects their predictions as meta-features, and at stage 3 Optuna-tuned LightGBM meta-model yields the final CBT forecast. Predictive uncertainty is quantified via bootstrapping and validated using Prediction Interval Coverage Probability (PICP). Ablation analysis confirms that incorporating DT-derived features and multimodal fusion substantially enhances performance. The proposed framework achieves a cross-validated R2 of 0.783, F1 score of 84.25% and PICP of 92.38% for 2-hour ahead forecasting, providing a robust, uncertainty-aware, and physically principled system for early heat stress detection and precision livestock management.

Paper Structure

This paper contains 50 sections, 36 equations, 9 figures, 4 tables, 1 algorithm.

Figures (9)

  • Figure 1: High-level architecture of the proposed multimodal forecasting framework. Raw data from cow-worn and environmental sensors undergo temporal alignment and preprocessing before being fed into a Physics-Informed Digital Twin. The digital twin dynamically couples a behavioral Markov model, a thermodynamic ODE, a Kalman filter, and a Gaussian process to generate uncertainty-aware physiological and behavioral state features. These are fused with multi-scale engineered features to train modality-specific experts and an optimized meta-model, ultimately yielding continuous 2-hour ahead core body temperature (CBT) forecasts and heat-stress classification. Copyright Free Cow Image source: Freepik.
  • Figure 2: Overview of the proposed pipeline. Sensor data from eight modalities are aligned and preprocessed, then passed through a physics-informed DT that models thermal and behavioral dynamics. Multi-scale features are engineered and fed into modality-specific base models. An expert-weighted ensemble fuses predictions, with bootstrap-based uncertainty quantification yielding final CBT forecasts and heat-stress risk estimates.
  • Figure 3: Internal Computational Loop of the physics-informed DT. The diagram illustrates the recursive state estimation cycle performed at each time step $t$. It unifies the mechanistic prediction (ODE), behavioral context (Markov), sensor correction (Kalman Filter), and uncertainty quantification (Gaussian Process) into a closed-loop adaptive system.
  • Figure 4: The overview of the hierarchical fusion strategy. Modality-specific "Specialist" models ($M_1 \ldots M_n$) are trained independently. Their validation performance ($R^2$) determines their contribution weight ($W_i$). These weighted predictions are concatenated with global context features ($F_{global}$) to train the Meta-Regressor ($f_{meta}$), which outputs both the final forecast and uncertainty bounds.
  • Figure 5: Modality Prediction Correlation Matrix. This heatmap illustrates the Pearson correlation coefficients between the predictions of the modality-specific base learners. The high correlation between dt_features and phys_cbt (0.67) validates the DT's physiological fidelity, while lower correlations in environmental features confirm the model diversity required for the stacked ensemble.
  • ...and 4 more figures