Skip to main content

Command Palette

Search for a command to run...

Physics-informed machine learning: when it beats a black box

When to build the laws of a system into your model instead of throwing a bigger network at it, and how.

Updated
6 min readView as Markdown
Physics-informed machine learning: when it beats a black box
M

Mohsen is a seasoned optimization expert who takes a principal role in implementing and validating data science and artificial intelligence models.

PhD in AI • Senior Consultant #MachineLearning #DataScience @BasicFitNL Previous: @Shell @LINKITGroup @FU_Mashhad @TUDelft @ErasmusMC @DanielDenHoed @CapgeminiNL @KLM

Every practitioner eventually hits a wall where the answer is not "more data" or "a bigger network." The system you are modelling obeys physical laws you already know, and the black box keeps producing outputs those laws forbid. Physics-informed machine learning is the response: build what you know into the model instead of hoping it re-derives it from data. This is what that means, when it actually beats a black box, and how the methods differ.

What "physics-informed" actually means

A black-box model learns a mapping from inputs to outputs with no prior about the system. A physics-informed model adds one: the known governing equations, conservation laws, symmetries, or bounds enter through the loss, the architecture, or the constraints. You are not replacing learning with equations; you are giving the learner a strong prior about the shape of the answer.

The field has a literature and a name. A 2021 review in Nature Reviews Physics [1] lays out the three main places physics enters: as observational bias (data generated or augmented to respect the physics), inductive bias (architectures that satisfy a law by construction), and learning bias (soft penalties in the loss when the model breaks the physics). Most practical work mixes the three.

When it beats a black box

Three conditions, and you usually need at least two:

  1. Data is scarce or expensive. A black box is a universal approximator with a matching appetite for data. When each labelled example costs a real experiment, a season of a crop, a run of a reactor, a flight, you cannot feed it enough. Physics does part of the modelling for free, so the network only learns the residual, from far less data.

  2. You need to extrapolate, or stay physically valid. Black boxes interpolate well and extrapolate badly. Step outside the training distribution and predictions drift, sometimes into states that violate conservation of energy or mass. If deployment will see conditions your data never covered, or an impossible prediction is unacceptable, a model that respects the governing equations by construction is what you need.

  3. The output feeds control or a decision with consequences. A model that steers a physical process has to stay inside safe, physical bounds, and a black box gives no guarantee it will. Writing in Nature, Reichstein and colleagues [2] made this case for the Earth sciences: pure data-driven learning hits a ceiling, and the way past it is to couple physical process models with machine learning, keeping the mechanism and adding the flexibility.

If none of these hold, abundant data, you never leave the training regime, nobody acts on the output, a black box is often the pragmatic choice. Physics-informed methods buy data efficiency, extrapolation, and trust; if you do not need those, do not pay for them.

The methods, from soft to hard

The approaches sit on a spectrum by how strictly they enforce the physics.

Physics-based regularization (soft). Add a penalty for violating the governing equations. Physics-informed neural networks (PINNs), formalised by Raissi, Perdikaris, and Karniadakis in 2019 [3], are the canonical example: the loss includes the PDE residual at collocation points, so the network is pushed toward solutions that satisfy the equation as well as the data. Flexible and easy to bolt onto an existing model, but the physics is a soft target you tune, and balancing the data and physics loss terms is its own problem.

Gray-box and residual learning (medium). Wrap a learned component around a mechanistic core. The physics model makes the base prediction; the network learns only the correction the equations get wrong for this system. You keep the mechanistic guarantees and spend data only on what they cannot capture. Often the most practical option when you have a decent but imperfect first-principles model.

Hard-constrained architectures (hard). Design the network so a law holds by construction, a layer that conserves a quantity exactly, an architecture that respects a known symmetry. The physics is guaranteed, but only some laws map cleanly to an architecture, and it takes more design effort.

Differentiable simulation (structural). Make the simulator itself differentiable and train through it, so gradients flow from data back through the equations. Powerful for control and inverse problems, heavier to build.

Known and strict physics, go harder; partial and forgiving, a soft penalty or a residual model is usually enough.

A concrete case: greenhouse climate control

Greenhouse climate control hits all three conditions at once. Data is expensive (you cannot run a thousand experiments on a live crop), the controller must extrapolate to conditions the season has not shown, and its outputs drive heating, venting, and CO2, so impossible predictions are unacceptable. The climate also obeys well-understood physics: an energy balance for temperature and humidity, transpiration tied to vapour pressure deficit, photosynthesis models decades old.

That makes it a natural home for physics-aware control. A model predictive controller needs an accurate, physically sound forward prediction over the coming hours, and a physics-aware model gives that on far less data than a black box while keeping its predictions valid. Recent work pairs economic optimisation over dynamic energy prices with a learned controller and validates it in simulation [4].

For a full treatment of how this plays out in greenhouse climate and crop control, and where the headroom still sits, see the deep dive on physics-aware AI for greenhouse climate and crop control from the team at Growmatics, and their piece on the sense-decide-act loop a controller runs.

When not to reach for it

Physics-informed ML is not free and not always right. With abundant data and no excursions outside the training regime, a black box is simpler and often as good. And the physics you build in has to be correct: a wrong or oversimplified assumption baked into the model does as much harm as a bad dataset, and it is harder to catch because it hides inside the "trusted" part. Coupling fast and slow dynamics, or quantifying how far to trust a prediction, stays genuinely hard.

Where this is going

The direction is clear enough that Reichstein's argument for the Earth sciences [2], that the future is hybrid, physical knowledge joined to data-driven learning, is becoming the mainstream view. For any domain where the physics is well understood and the data is expensive, control, robotics, climate, materials, that hybrid is the most direct route to models you can actually trust.

Sources

  1. Karniadakis, G. E., et al. (2021). Physics-informed machine learning. Nature Reviews Physics, 3, 422-440.

  2. Reichstein, M., et al. (2019). Deep learning and process understanding for data-driven Earth system science. Nature, 566, 195-204.

  3. Raissi, M., Perdikaris, P. & Karniadakis, G. E. (2019). Physics-informed neural networks. Journal of Computational Physics, 378, 686-707.

  4. Mansour, M. M., et al. (2025). Adaptive robust greenhouse climate control: combining deep reinforcement learning and economic optimization. Smart Agricultural Technology, 12, 101327.

Further reading

Control

Part 1 of 1

Physics-aware and physics-informed machine learning, model predictive control, optimization, and sim-to-real: making AI that steers real physical systems.