All Projects
Journal Article Forecasting 2025 Bayesian / UQ Physics-Informed ML

Physics-Guided Bayesian Neural Networks for Uncertainty Quantification in Dynamic Systems

We embed first-principles thermal dynamics constraints directly into Bayesian neural network priors, enabling calibrated uncertainty estimates that remain physically plausible even when data is scarce — a critical property for trustworthy building energy control and diagnostics.

Published January 2025
Venue Forecasting, 7(1), 9
DOI 10.3390/forecast7010009
Authors Xinyue Xu, Julian Wang

Motivation & Problem

Machine learning-based building energy models can achieve high predictive accuracy, but their uncertainty estimates are often poorly calibrated — they either overestimate confidence (making them unsafe for control) or underestimate it (making them useless for diagnostics). Standard Bayesian neural networks address this in principle, but their priors are agnostic to physical laws, allowing the model to learn thermodynamically implausible distributions, especially under sparse or irregular sensor data.

PG-BNNs solve this by encoding physics directly into the prior. We derive informative prior distributions over network weights from the thermal dynamics of buildings — energy balance equations, RC circuit analogies, heat transfer laws — so that the posterior always respects known physical constraints, even in extrapolation regimes far from the training data.

[ Add figure: assets/images/pgbnn-architecture.png ]
Fig. 1 — PG-BNN architecture: physics priors (left) are propagated through the Bayesian network to produce calibrated posterior predictive intervals (right).

Approach

The PG-BNN framework has three components:

01
Physics-Informed Prior Construction. We derive the mean and variance of each weight's prior distribution from the linearised thermal dynamics model of the building zone, parameterised by thermal resistance (R) and capacitance (C) values estimated from building geometry and material properties.
02
Variational Inference. Posterior inference is performed via mean-field variational inference (MFVI), making the method scalable to real-world building sensor datasets without requiring MCMC sampling.
03
Calibration Evaluation. We assess calibration via Expected Calibration Error (ECE), Reliability Diagrams, and continuous ranked probability score (CRPS), benchmarking against standard BNNs, MC Dropout, Deep Ensembles, and Gaussian Process baselines.

Key Findings

15–27% improvement in predictive accuracy over purely data-driven BNN baselines across five real-world commercial building datasets, with the largest gains observed in data-scarce settings (fewer than 2 weeks of training data).
Significantly better-calibrated uncertainty intervals. PG-BNNs achieve ECE scores 40–60% lower than standard BNNs and MC Dropout, meaning the stated confidence intervals are much closer to empirical coverage frequencies.
Physical plausibility under distribution shift. When evaluated on out-of-distribution weather conditions (heat waves, cold snaps), PG-BNN predictions remain thermodynamically consistent while standard BNNs produce physically impossible values.
Scalable inference. MFVI-based training converges in comparable wall-clock time to standard BNN training, making PG-BNNs practical for deployment on building management systems with limited compute.

Technical Stack

Python 3.10 PyTorch 2.0 PyMC 5 Pyro NumPy / SciPy Pandas Matplotlib / Seaborn EnergyPlus scikit-learn Jupyter

Broader Impact

Calibrated uncertainty is a prerequisite for deploying ML-based building controls safely — a model that knows what it doesn't know can hand off to rule-based fallbacks rather than making dangerous predictions. PG-BNNs provide a practical path to that goal without sacrificing the flexibility of neural networks.

Future directions include extending the physics prior to multi-zone buildings with coupled thermal dynamics, integrating PG-BNNs into model predictive control loops with formal safety guarantees, and applying the framework to other physics-rich domains such as structural health monitoring and HVAC fault detection.

BibTeX

@article{xu2025pgbnn, title = {Physics-Guided {Bayesian} Neural Networks for Uncertainty Quantification in Dynamic Systems}, author = {Xu, Xinyue and Wang, Julian}, journal = {Forecasting}, volume = {7}, number = {1}, pages = {9}, year = {2025}, doi = {10.3390/forecast7010009}, publisher = {MDPI} }