---
title: Physics Constrained Deep Learning
url: https://www.emergentmind.com/topics/physics-constrained-deep-learning-1957cf52-1f1b-46bf-9e24-7ba2dea0979b
type: topic
---

# Physics Constrained Deep Learning

Physics-constrained deep learning is a family of scientific machine-learning methods in which governing equations, constitutive relations, conservation laws, admissible state constraints, or mechanistic update rules are embedded into neural architectures, objective functions, or projection operators so that learned predictors remain compatible with known physics. In the current literature, the paradigm spans postprocessing, surrogate modeling, inverse problems, uncertainty quantification, control, and generative modeling, with constraints drawn from thermodynamic state equations, Richards’ equation, incompressible Navier–Stokes dynamics, Fokker–Planck equations, Lagrangian mechanics, and domain-specific state-space models [2212.04487; 2403.08154; 1906.02382; 2309.15139; 2110.01894].

## 1. Conceptual scope and motivation

A recurrent motivation is that purely statistical or black-box deep models can fit data while violating physical structure. In weather postprocessing, statistical correction can improve forecast skill but can also lead to predictions that violate physical principles or disregard dependencies between variables, which is problematic for downstream applications and trustworthiness; the same work argues that integrating meteorological expertise in the form of analytic equations yields physically-consistent predictions of temperature and humidity without compromising performance, and is especially advantageous when data is scarce [2212.04487].

The same concern appears in mechanics, biomedical inverse problems, and turbulence modeling. In robotics, unconstrained deep dynamics models may ignore the existing knowledge of physics, learn dynamics that violate the laws of physics, and produce inconsistent forward and inverse models; DeLaN was introduced precisely to guarantee physically plausible dynamics by incorporating Lagrangian mechanics and conserving energy [2110.01894]. In inverse ECG, the body-to-heart operator is rank-deficient and ill-conditioned, so embedding cardiac wave-propagation physics regularizes an otherwise unstable reconstruction problem [2107.12780]. In turbulence-model uncertainty quantification, the Eigenspace Perturbation Method prescribes physically admissible perturbations but does not determine how much to perturb, which leads to very generous uncertainty envelopes; physics-constrained deep learning is used there to learn a spatially varying correction while retaining the physically grounded perturbation mechanism [2405.16554].

These examples indicate that the field is not defined by a single algorithmic template. Rather, its unifying feature is that the neural component is not free to represent arbitrary input–output maps: it is restricted, regularized, or post-corrected by known physical structure. This suggests that physics-constrained deep learning is best understood as a design principle for reducing the admissible hypothesis space in scientifically meaningful ways.

## 2. Mechanisms for enforcing physical structure

One major mechanism is the addition of physics residuals to a data-fitting objective. In soil-moisture estimation, the total loss is explicitly written as $\mathcal{L}(\Theta_{NN}) = \mathcal{L}_D + \mathcal{L}_{RRE}$, where the data term fits measured pressure head and the physics term penalizes the residual of the Richardson-Richards equation computed by automatic differentiation; the same general pattern appears in inverse ECG, where a body-heart data term is combined with boundary and PDE residuals from the Aliev–Panfilov model [2403.08154; 2107.12780]. Comparable residual-based formulations are used for incompressible cavity flow, where the network minimizes momentum and continuity residuals, and for data-free incompressible-flow surrogates, where Navier–Stokes residuals replace labeled CFD targets [2211.06375; 1906.02382].

A second mechanism is hard enforcement by construction. In cavity-flow learning, boundary conditions are embedded exactly through output transformations, and the stream-function formulation guarantees incompressibility exactly via $u=\partial\psi/\partial y$ and $v=-\partial\psi/\partial x$ [2211.06375]. In PINF, the log-density parameterization $\phi_\theta(x,t)=\log p_0(x)+t\,u(x,t;\theta)$ enforces the initial condition exactly, while the flow formulation gives normalization “for free” in the time-dependent Fokker–Planck setting [2309.15139]. In VB-NET, the non-trainable differentiable physics layer updates the virtual-battery state of charge as $\hat{S}_{t+1}=\text{Clamp}\!\left(\hat{S}_t+\frac{\Delta t}{\hat{C}_f}[\eta P_{ac}(t)-\hat{P}_{loss}(t)],0,1\right)$, which prevents arbitrary state trajectories [2603.07601]. DAE-HardNet goes further by projecting predictions onto a constraint manifold so that algebraic and differential constraints are satisfied through a differentiable projection layer rather than soft penalties [2512.05881].

A third mechanism replaces penalty balancing with constrained optimization. PECANN argues that the standard PINN objective, in which PDE residuals and boundary conditions are lumped into a single soft-penalty loss with manually tuned weights, is the source of severe limitations. It reformulates learning as a constrained optimization problem solved with the augmented Lagrangian method, enforcing boundary, initial, and high-fidelity constraints as equality constraints rather than as ordinary penalties [2109.14860]. This distinction between soft penalties, architectural hard constraints, and explicit constrained optimization is one of the central methodological fault lines in the literature.

## 3. Structured dynamical models and gray-box formulations

A prominent branch of the field constrains latent or reduced-order dynamics rather than only enforcing instantaneous PDE residuals. In partially observed geophysical systems, bounded nonlinear forecasts are obtained by learning an augmented latent state $u_t^T=[\mathcal{M}(x_t)^T,y_t^T]$ and evolving it with a neural ODE whose vector field is restricted to a linear-quadratic form. Energy-preserving quadratic constraints and a negative-definite symmetric linear part are imposed through regularizers $\mathcal{C}_1$ and $\mathcal{C}_2$, yielding a monotonically attracting trapping region and bounded trajectories for arbitrary initial conditions [2202.05750].

In mechanics, Deep Lagrangian Networks encode physics at the level of system energy. Rather than learning accelerations directly, DeLaN parameterizes the Lagrangian $\mathcal{L}(q,\dot q)=\frac{1}{2}\dot q^\top H(q)\dot q - V(q)$ with neural networks for the mass matrix and potential energy, and obtains forward and inverse dynamics from the Euler–Lagrange equation. Because $H(q)$ is constructed from a Cholesky factor, the mass matrix remains positive definite and the kinetic energy remains physically meaningful [2110.01894]. This is a particularly clear example of a structure-preserving model: the network does not merely approximate trajectories but inherits the algebraic organization of classical mechanics.

Control-oriented building models adopt an analogous gray-box strategy. Physics-constrained deep learning of multi-zone building thermal dynamics uses a block-structured recurrent architecture with separate components for autonomous propagation, HVAC input, disturbances, output mapping, and a learned observer. Stability and dissipativeness are encoded through a Perron–Frobenius-based constrained matrix parameterization with dominant eigenvalues bounded in $[0.8,1.0]$, while temperature predictions are kept within physically realistic and safe operating ranges by inequality penalties [2011.05987]. VB-NET applies the same gray-box logic to air conditioning systems by proving an isomorphic equivalence between AC dynamics and a virtual battery, decoupling shared meteorological drivers from private building thermal fingerprints, and learning only physically interpretable parameters passed to a differentiable physics evolution layer [2603.07601].

Across these works, physics constraints are not limited to conservation laws. They also include boundedness, dissipativity, eigenvalue location, admissible operating ranges, and shared-vs-private decompositions of physical drivers. This broadens the meaning of “physics” from explicit PDEs to mechanistic dynamical structure.

## 4. PDE-constrained surrogates, generative models, and scientific solvers

A large portion of the literature uses neural networks as surrogates for families of PDE solutions. One early direction eliminates labeled simulation data entirely. For Darcy flow, a convolutional encoder-decoder surrogate and a conditional flow-based generative model are trained by minimizing PDE and boundary violations, where the reference conditional density is posed as a Boltzmann-Gibbs distribution and the learning objective is a reverse Kullback–Leibler divergence between model and physics-defined densities [1901.06314]. For incompressible fluid flow, a structured fully connected network is trained without CFD labels by embedding initial and Dirichlet boundary conditions in the ansatz and minimizing Navier–Stokes residuals at collocation points; the paper reports roughly 2000× speedup for Monte Carlo uncertainty propagation compared to CFD [1906.02382].

Parameterized surrogate learning is especially visible in fluid mechanics. In incompressible cavity flow, a single neural network learns the five-dimensional map $(x,y,Re,K,a)\mapsto(u,v,p)$ or $(\psi,p)$, with hard boundary constraints and exact incompressibility in the stream-function formulation. The paper shows that zero-data training is accurate up to intermediate Reynolds numbers, but fails to train for sufficiently high Reynolds numbers, whereas a small quantity of flow data enables accurate description up to $Re=21{,}000$ in the square-cavity example [2211.06375]. For multiphase flow in 3D heterogeneous porous media, a physics-constrained U-Net uses 3D-to-2D layer decomposition, a continuity-based smoother for pressure, and transient-region penalties; it achieves a speedup of ~1400 times, average temporal errors of 0.27% for pressure and 0.099% for saturation plumes, and mean water-rate error less than 5% [2105.09467].

Physics-constrained generative formulations extend the same logic beyond deterministic surrogates. PINF reformulates time-dependent and steady-state Fokker–Planck equations as characteristic ODEs within continuous normalizing flows, enforcing probability conservation through change-of-variables and continuity relations while remaining mesh-free and causality-free [2309.15139]. DAE-HardNet likewise reframes constraint enforcement by learning both functions and derivatives simultaneously and then projecting them onto the feasible set defined by differential-algebraic equations [2512.05881]. These models are notable because the learned object is not necessarily a single field value; it may be a normalized probability density, a feasible DAE state, or a parameterized family of PDE solutions.

## 5. Application domains and reported performance

The breadth of applications is unusually wide. In hydrology, physics-constrained deep learning reconstructs pressure head, soil moisture, and hydraulic conductivity fields from sparse sensors by combining Richards-type transport with the van Genuchten constitutive model. A direct optimizer comparison found that Adam consistently outperforms RMSProp and GD, with full-batch Adam reaching final loss 0.0010, $re_\psi=0.0049$, and $re_\theta=0.0009$ in the reported setup [2403.08154]. The same domain also produced a unified physics-constrained active learning framework for sensor placement, where combining residual-based sampling with maximin space-filling design reduced relative error by 42.4% in evaporation and improved accuracy by 51.8% in infiltration compared with random placement [2403.07228].

In turbulence and CFD uncertainty quantification, the dominant pattern is hybridization of a physics backbone with learned modulation. Physics Constrained Deep Learning for turbulence model uncertainty quantification retains eigenspace perturbations of Reynolds stresses but uses a lightweight 1D-CNN or CNN-based correction to control the degree of eigenvalue perturbation spatially. On separated flows such as the SD7003 airfoil and periodic hills, the corrected prediction reduces $L^1$ error by about two orders of magnitude relative to RANS in difficult regions, while also concentrating uncertainty in separation bubbles and reattachment zones instead of distributing worst-case perturbations uniformly [2405.16554; 2509.03833].

In imaging, the same paradigm appears in both inverse reconstruction and modality fusion. PtychoPINN combines the diffraction forward map with real-space overlap constraints and a Poisson photon-counting likelihood, retaining the factor of 100-to-1000 speedup of deep learning-based reconstruction while improving reconstruction quality with a typical 10 dB PSNR increase and a 2- to 6-fold gain in linear resolution [2306.11014]. In proton therapy, the PDMI framework combines MRI, dual-energy CT, and a physics-constrained loss tied to an empirical HU model; the paper reports that PRN-MR-DE predicted the densities of soft tissue and bone within expected intervals based on the literature survey, while PRN-DE generated large density deviations [2207.13150].

In biomedical and building applications, physics constraints are likewise tied to robustness and interpretability. The inverse ECG model combines the torso-heart transfer matrix with the Aliev–Panfilov reaction-diffusion system and, at $\sigma_\epsilon=0.1$, reports $\text{RE}\approx0.1544$ and $\text{MSE}\approx0.0076$, outperforming Tikhonov and spatiotemporal regularization baselines [2107.12780]. For a real-world office building with 20 thermal zones, the structured constrained recurrent model uses only 10 days’ measurements for training, generalizes over 20 consecutive days, and reaches a normalized open-loop test MSE of about 0.0052, corresponding to roughly 0.18 K error per output [2011.05987]. VB-NET extends the same philosophy to demand-side flexibility, reporting high-precision modeling for new AC units using only 2% to 6% of historical data [2603.07601].

## 6. Methodological tensions, limitations, and open questions

The central controversy concerns soft versus hard enforcement. PECANN explicitly argues that the standard PINN formulation is limited because PDE residuals and boundary conditions are treated as soft penalties with manually tuned weights, and reports orders of magnitude improvements in accuracy when constraints are enforced through an augmented Lagrangian formulation instead [2109.14860]. DAE-HardNet makes a related argument for DAEs, stating that traditional PINNs do not always satisfy physics-based constraints and that hard projection can achieve orders of magnitude reduction in the physics loss while maintaining prediction accuracy [2512.05881]. By contrast, other works deliberately retain soft penalties because they are easy to implement and differentiable in standard frameworks, as in soil moisture, inverse ECG, and building thermal modeling [2403.08154; 2107.12780; 2011.05987].

Optimization remains a substantive issue rather than a mere implementation detail. The soil-moisture study shows that, in a highly nonlinear physics-constrained objective, adaptive optimization matters markedly: GD converges slowest, RMSProp improves adaptivity, and Adam gives the best empirical convergence in both mini-batch and full-batch training [2403.08154]. This optimization sensitivity is consistent with broader reports that training remains nonconvex, that penalty balancing can destabilize learning, and that even physically correct formulations may fail without appropriate architectures or optimizers [2109.14860; 1906.02382].

Generalization is another qualified success. Several papers report improved sample efficiency or cold-start behavior when physical structure reduces the effective hypothesis space: weather postprocessing is especially advantageous when data is scarce, the building model generalizes from only 10 training days, and VB-NET adapts to new AC units with only 2% to 6% of historical data [2212.04487; 2011.05987; 2603.07601]. Yet extrapolation limits remain explicit. In periodic hills, performance deteriorates as $\alpha$ increases beyond the training case [2509.03833]. In high-dimensional probabilistic PDE surrogates, uncertainty does not always inflate on far-away out-of-distribution inputs [1901.06314]. In cavity flow, zero-data learning fails for sufficiently high Reynolds numbers [2211.06375]. These results caution against equating physics constraints with universal extrapolation guarantees.

A final limitation is that “physics” is itself model-dependent. Reaction-diffusion priors in inverse ECG, screened-collision assumptions in runaway-electron modeling, or specific constitutive laws in soil hydrology can all be imperfect representations of the underlying system [2107.12780; 2412.12980; 2403.08154]. Physics-constrained deep learning therefore inherits both the strengths and the misspecification risks of the embedded model. The literature nonetheless converges on a common conclusion: when the governing structure is known well enough to be encoded, neural networks that learn within that structure tend to be more interpretable, more stable, and more data-efficient than unconstrained alternatives.

Source: https://www.emergentmind.com/topics/physics-constrained-deep-learning-1957cf52-1f1b-46bf-9e24-7ba2dea0979b