Six ways to put physics into machine learning
Ordinary machine learning learns only from data. Scientific ML also respects physics. Here are the six places to inject it, one use case each.
Ordinary machine learning learns from data and nothing else. Give it enough examples and it will find a pattern, but it has no idea that energy is conserved, that a rotated molecule is the same molecule, or that a diffusion coefficient cannot be negative. It will happily predict all three if the data nudges it that way.
Scientific machine learning is the correction to that. It keeps the learning from data but also respects what we already know: governing equations, symmetries, conservation laws, structure. The interesting part is that there is no single way to do this. The methods differ mainly in one question, and once you see the question, the whole field organises itself.
The question is: where do you inject the physics?
There are six answers. I built a small, working example of each while making my scientific-machine-learning series, and this article is the map. For every method there is a one-line idea and a materials use case.
1. Physics in the loss: obey the equation
The simplest place to add knowledge is the loss function. A normal network is punished only for missing the data. A physics-informed neural network (PINN) is also punished for breaking the governing equation, the differential equation is written directly into the loss as an extra penalty.
The effect is striking. With only a handful of data points and the equation to obey, a PINN can reconstruct a full solution it was never shown, and it refuses to predict values that would violate the physics. This is the method to reach for when data is scarce but the governing law is known, for example recovering a full temperature or concentration field from a few noisy sensor readings.
Methods: PINNs, physics residuals in the loss.
2. Physics in the architecture: cannot break the rules
Adding a penalty asks the network nicely to respect physics. Changing the architecture forces it. Here you build a network that cannot violate the physics by construction, because the structure, symmetry and conservation are baked into its shape.
The clearest example is symmetry. Rotate a molecule in space and its energy does not change, it is the same molecule. Yet a plain network handed the atom coordinates will give a different answer for the rotated version, because it treats the numbers as arbitrary. Equivariant networks fix this at the level of the architecture, so the symmetry is guaranteed rather than learned. This is exactly why interatomic potentials like MACE and NequIP now rival full quantum calculations at a fraction of the cost.
Methods: graph neural networks, equivariant networks, MACE and NequIP, Hamiltonian neural networks.
3. Physics in the dynamics: the network is the rate
Many materials problems are about change over time: kinetics, creep, capacity fade, corrosion. For these, you do not ask the network for the answer directly. You let the network be the rate of change, the derivative, and then integrate it forward through time.
This is the neural ODE. Its more honest cousin is the universal differential equation (UDE), which is my favourite idea in the whole tour. Most physics-based models are mostly right and confidently wrong about the rest. A UDE keeps the part of the physics you trust and learns only the missing piece with a small network. You get a model that respects the known dynamics and quietly corrects where the textbook falls short, which is the realistic situation for almost every real material.
Methods: neural ODEs, universal differential equations.
4. Discover the equation: read the law from data
The methods above assume you know the governing equation. Sometimes you do not, and you would rather the machine hand it to you. Instead of a black box, these methods recover an interpretable equation or descriptor straight from measurements.
Give SINDy a noisy, wobbly curve and no hints, and it can return the exact equation that produced it, with no neural network involved at all. Symbolic regression does something similar for functional relationships, searching for a short formula rather than a set of weights. In materials specifically, SISSO was built to find compact descriptors: a simple expression of known quantities that predicts a property. The output is something a scientist can read, argue with, and publish.
Methods: SINDy, symbolic regression, SISSO.
5. Physics as an operator: learn the solver itself
A PINN solves one problem. Change the boundary conditions and you train again. Neural operators aim higher: they learn the whole solution map, the operator that turns any input into its solution, so a single trained model acts as an instant surrogate for a slow simulator.
Once trained, a neural operator can replace a costly partial-differential-equation solve with a millisecond prediction, even for inputs it was never trained on. If simulation is the bottleneck in your work, this is the idea to know, because it turns a five-hour solve into something you can call thousands of times inside an optimisation loop.
Methods: DeepONet, Fourier neural operator.
6. Physics in generation: invent valid designs
The final method flips the direction. Instead of predicting a property from a material, it generates genuinely new materials that could actually exist: molecules, crystals and structures that are physically valid rather than random.
Diffusion models are the engine here. They are trained to do one boring thing, remove a little noise from data, and then, started from pure static, they can paint brand-new structures step by step. Constrained to respect chemistry and symmetry, they propose novel, stable candidates with target properties. This is the idea behind generative materials tools like MatterGen and CDVAE.
Methods: diffusion models, CDVAE, MatterGen.
The lesson underneath all six
Building each of these on real materials data taught me something that no single method could. Across two full series, one problem beat every model I made: a representation based only on chemical composition cannot tell polymorphs apart, because two different crystal structures of the same formula look identical to it. No amount of extra layers fixed it. Changing what the model could see, giving it the actual atomic structure through a graph network, finally did.
That is the deeper point, and it applies far beyond these six methods. Your result is limited less by the model than by two things: what your data lets the model see, and how much of what you already know you are willing to build in. Choose the representation carefully, respect the physics, and half the outcome is decided before training even starts.
If you are learning this field, do not read six explanations and move on. Pick one method from this list and build the smallest working version yourself. Watch a PINN refuse to break the physics, or a UDE patch a broken model, or a diffusion process turn static into structure. That is the whole trick, and it is the most useful thing I have done for my own understanding.
Found a mistake? Good, tell me. This publication flags its own suspect values. Reach me on LinkedIn.