Embedding Physical Laws into Neural Network Loss Functions

This direction is split into other directions: differentiable inverse modeling, multi-component loss function (hybrid loss function), physics-informed loss regularization. Its last version stays readable and citable here.

Version 1 of 1765 papers913 conceptsfrozen 2026-10-04

In traditional machine learning, a model is a "black box" that learns patterns solely from data. If you train a neural network to predict the flow of water around a bend, it might learn to mimic the training examples perfectly, yet suggest a solution that violates the conservation of mass. In scientific domains—from fluid mechanics to epidemiology—we are often "data-poor but physics-rich," as noted by Mohamed Mehana in A Critical Review of Physics-Informed Machine Learning Applications in Subsurface Energy Systems. We have decades of rigorous mathematical equations describing how the world works, but our sensors are sparse and noisy.

The research direction of Physics-Informed Machine Learning (PIML) or Physics-Informed Neural Networks (PINNs) seeks to bridge this gap. Instead of relying on data alone, these models treat physical laws as structural guardrails that guide the learning process.

The Mechanism: Physics as a Regularizer

The core intuition behind this approach is to bake the laws of nature directly into the objective function of the neural network. In a standard network, the loss function measures the difference between the prediction and the ground truth. In a physics-informed model, the loss function is augmented with a "physics residual."

As explained by Chuizheng Meng and Yan Liu in When physics meets machine learning: a survey of physics-informed machine learning, the total loss becomes a weighted sum: $$ \mathcal{L}_{total} = \mathcal{L}_{data} + \lambda \mathcal{L}_{physics} $$

The $\mathcal{L}_{physics}$ term represents the degree to which the model's output violates a governing equation, such as a Partial Differential Equation (PDE). For example, if a model is predicting magnetic fields, Gauss’s Law for Magnetism dictates that the divergence of the field must be zero. If the model predicts a field with non-zero divergence, the physics loss increases, penalizing the network during backpropagation.

Why It Works: Constraining the Search Space

Neural networks are universal function approximators, meaning they can fit almost any set of points. However, many of those possible functions are physically impossible. By adding a physics loss, we effectively shrink the "search space" of the network.

Steven L. Brunton argues in The transformative potential of machine learning for experiments in fluid mechanics that integrating equations like Navier-Stokes ensures predicted flow fields remain consistent even when data is sparse. This acts as a powerful regularizer, preventing the model from "memorizing" noise in the training data and forcing it to learn the underlying logic of the system.

This approach is particularly effective in "inaccessible" scenarios. For instance, researchers have used PINNs to map magnetic fields inside vacuum chambers where sensors cannot be placed, relying on Maxwell’s equations to "fill in" the gaps from external measurements (Magnetic field mapping of inaccessible regions using physics-informed neural networks).

From Fluids to Physiology

While fluid dynamics is a classic application, the principle of physics-informed loss functions is being applied across diverse fields:

  • Epidemiology: Thang Nguyen and Truyen Tran developed MP-PINN, which uses SIR (Susceptible-Infectious-Recovered) models as constraints to forecast disease spread during lockdowns.
  • Biomedicine: In Distinguishing Healthy Ageing from Dementia, Mariana da Silva and Cher Bass incorporate hyper-elastic material models into the loss function to ensure that simulated brain atrophy adheres to biophysical constraints.
  • Geosciences: Dongxiao Zhang has pioneered Theory-guided Neural Networks (TgNN) for subsurface flow, using discretized governing equations to ensure mass conservation in groundwater modeling.

Challenges and Trade-offs

Despite its promise, physics-informed training is not a "free lunch." As Skyler Wu points out in Are Statistical Methods Obsolete in the Era of Deep Learning?, these models can be significantly harder to tune than standard networks. The optimization landscape becomes more complex when trying to balance data fidelity against physical consistency.

Furthermore, Mansi Sakarvadia and colleagues caution in The False Promise of Zero-Shot Super-Resolution in Machine-Learned Operators that even with physics constraints, models may fail to generalize to unseen frequencies (aliasing) if the training protocol isn't carefully designed.

Ultimately, the goal of this research direction, as summarized by Yuntian Chen and Dongxiao Zhang in Integration of knowledge and data in machine learning, is to move toward a "closed loop" where machine learning doesn't just predict data, but respects and even helps discover the fundamental laws of the universe.

Papers in this version

Showing 60 of 765 papers.

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_embedding_physical_laws_into_neural_netw_1d188530,
  title = {Embedding Physical Laws into Neural Network Loss Functions},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/embedding-physical-laws-into-neural-network-loss-functions/rdr_1d188530ab764c7ea3c76f46e06e8c7b},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_embedding_physical_laws_into_neural_netw_1d188530_v1,
  title = {Embedding Physical Laws into Neural Network Loss Functions},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/embedding-physical-laws-into-neural-network-loss-functions/rdr_1d188530ab764c7ea3c76f46e06e8c7b/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}