Papers
Topics
Authors
Recent
Search
2000 character limit reached

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

Published 5 Apr 2026 in cs.CV | (2604.04098v1)

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.

Summary

  • The paper introduces a digital twin framework that combines physics-based ODEs, behavioral Markov chains, Kalman filters, and Gaussian processes for robust core body temperature forecasting.
  • It fuses multimodal sensor data and behavioral dynamics, achieving 2-hour-ahead forecasts with significantly improved performance (R² = 0.783) over conventional methods.
  • The approach offers effective uncertainty quantification and heat stress classification, providing actionable insights for precision livestock management.

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

Introduction

The paper "A Physics-Informed, Behavior-Aware Digital Twin for Robust Multimodal Forecasting of Core Body Temperature in Precision Livestock Farming" (2604.04098) presents a novel approach to modeling and forecasting core body temperature (CBT) and heat stress in dairy cattle using a digital twin (DT) framework. Leveraging multimodal sensor data, the method integrates mechanistic physiological modeling, behavioral dynamics, probabilistic inference, and uncertainty quantification within a unified machine learning pipeline. The framework targets the prediction of 2-hour-ahead CBT and the timely classification of impending heat stress states, addressing limitations in purely data-centric models that lack physiological grounding, robustness to missing data, and reliable uncertainty estimates. Figure 1

Figure 1: High-level architecture of the proposed multimodal forecasting framework, illustrating the integration of sensor data with a physics-informed digital twin and stacked ensemble learning to produce real-time CBT forecasts and heat-stress classification.

Methodological Framework

Multimodal Data Integration and Preprocessing

The pipeline utilizes the MmCows dataset, capturing per-minute multimodal time series from eight synchronized streams: UWB-based 3D position, IMMU-based acceleration, barometric pressure, vaginal CBT, ankle posture sensors, indoor THI, detailed weather, and automated milking output. Rigorous temporal alignment, UTC normalization, short-gap interpolation, and explicit missingness encoding are performed to enable joint modeling while mitigating data leakage and causal inconsistencies. Figure 2

Figure 2: Overview of the proposed pipeline, showing sensor fusion, DT-based feature extraction, and meta-modeling.

Physics-Informed Digital Twin

The DT consists of four tightly-coupled modules:

  1. Thermal ODE-based Model: Implements an energy-balance ODE with learnable animal-specific parameters for metabolic and environmental heat flux, activity-dependent generation, and cooling efficiency. This ensures physical plausibility and individualized trajectory forecasting.
  2. Behavioral Markov Chain: Models probabilistic transitions among behavioral states (lying, standing, walking, feeding), with transition dynamics modulated by environmental and diurnal factors.
  3. Kalman Filter: Recursively fuses noisy multimodal sensor measurements with DT-simulated latent states, yielding smoothed and variance-attenuated state estimates robust to missing sensor data.
  4. Gaussian Process Residual Model: Captures nonlinear, cow-specific residual dynamics and epistemic uncertainty not explained by the ODE.

The output is a compact uncertainty-aware representation, including smoothed CBT, forecast CBT, probability of heat stress, behavioral distribution, and uncertainty quantification. Figure 3

Figure 3: The recursive computational loop of the DT, integrating ODE prediction, behavioral context, sensor fusion, and uncertainty modeling.

Feature Engineering and Expert-Based Fusion

Derived DT features are fused with engineered temporal, physiological, and interaction-based predictors (rolling statistics, time embeddings, first derivatives, thermal gradients, cross-modality products, and cumulative stress integrals). Each modality feeds an independent LightGBM regressor, trained and weighted by out-of-fold R2R^2 performance to form a reliability-driven specialist ensemble. Figure 4

Figure 4: Hierarchical fusion strategy where weighted specialist predictions and global context are fused by a LightGBM meta-regressor.

Meta-Ensemble and Uncertainty Quantification

A meta-level LightGBM regressor is trained on concatenated modality outputs and global features, with hyperparameter optimization via Optuna. Predictive uncertainty is quantified through bootstrap ensembles, with intervals calibrated via empirical Prediction Interval Coverage Probability (PICP).

Experimental Validation

Benchmarking and Ablation Studies

Using GroupKFold splits on the MmCows dataset, the framework is benchmarked against established baselines (linear regression, trees, kernel SVR, LSTM, Temporal Fusion Transformer). The full model achieves R2=0.783R^2=0.783, MAE=0.114°C, RMSE=0.143°C, and PICP=92.38% for 2-hour-ahead CBT forecasting—substantially outperforming all baselines (XGBoost best-of-others: R2=0.591R^2=0.591).

Ablation reveals that no single modality yields sufficient performance (R2<0.38R^2<0.38 individually); predictive advantage emerges from their nonlinear fusion. Removal of DT-features degrades R2R^2 by 13% and PICP by 6.8%, confirming the unique contribution of physiology-based regularization and individualized latent estimation.

Qualitative Model Behavior

The model's predicted CBT trajectories closely follow ground-truth, accurately flagging threshold crossings (stress onset) and achieving balanced precision ($0.841$) and recall ($0.845$) for heat stress classification. Residuals are homoscedastic, error autocorrelation is negligible, and uncertainty intervals cover observed outcomes at the nominal rate. Figure 5

Figure 5: Modality prediction correlation matrix showing model diversity.

Figure 6

Figure 6: Model prediction vs. ground-truth CBT over time, including heat stress threshold crossing.

Figure 7

Figure 7: Regression diagnostics — scatter, error distributions, temporal alignment, and uncertainty intervals.

Figure 8

Figure 8: Residual auto-correlation, rolling performance metrics, and error variance analysis over continuous segments.

Figure 9

Figure 9: Heat-stress classification confusion matrix, ROC and PR curve, demonstrating high AUC and robust class balance.

Implications and Future Directions

The integration of first-principles ODEs, Bayesian residual modeling, and reliability-weighted multimodal fusion establishes new theoretical and practical standards for physiological forecasting in precision livestock. Key implications include:

  • Causal Forecasting: The physically grounded DT constrains learned representations to biologically plausible subspaces, improving generalization and robustness to missing/corrupted sensor modalities.
  • Uncertainty-Aware Early Warning: Well-calibrated confidence intervals and individualized stress probabilities enable actionable, risk-aware decision support (e.g., targeted cooling interventions).
  • Scalability and Interpretability: The computational efficiency of the framework makes it deployable in real-time farm environments, with feature attributions tractable via tree-based models.
  • Advancement over Deep Learning: Temporal models such as LSTM or TFT are not competitive when physical, behavioral, and engineered features are explicitly modeled, aligning with findings that GBDT-based ensembles dominate on structured tabular sensor inputs.

The proposed framework presents a foundation for future extension to heterogeneous farms, breeds, climates, and sensor networks. Integrating adaptive priors, continual learning, and domain adaptation mechanisms will be essential to achieve transferability and out-of-distribution resilience.

Conclusion

This work demonstrates that embedding physical and behavioral priors into machine learning architectures for multimodal livestock monitoring yields superior accuracy, generalization, and uncertainty quantification compared to purely data-driven or statistically fused models. The approach is theoretically principled, practically robust, and provides interpretable, uncertainty-aware, and actionable CBT and heat stress forecasts for precision livestock management, substantiating a paradigm shift toward digital-twin-based animal health monitoring.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.