Yasser Sheikh · MSc BEng AMIChemE RITTech

Writing · Feb 2026

When the neural network meets the mass balance.

Ask a neural network trained on a year of plant data what happens at operating conditions the plant has never visited, and it will answer with complete confidence and no idea. That is not a defect in the network. Interpolation machines behave exactly like this when you ask them to extrapolate. The awkward part is that extrapolation is the whole point of optimisation: you are trying to move the plant somewhere better than its own history, which by definition means somewhere the training data is thin.

Physics does not need training data

A mass balance holds at every operating point there has ever been. Reaction kinetics, thermodynamic equilibria and conservation laws are valid far outside any training distribution, because they are not trained, they are derived. What they lack is fidelity. Real equipment fouls, drifts and misbehaves in ways the textbook equations do not capture, and two nominally identical plants never behave identically. So you have two imperfect witnesses: a learned model that knows this particular plant but only within its own history, and a first-principles model that knows all plants, approximately.

The hybrid contract

Hybrid modelling, done properly, is an explicit decision about which witness to trust for what. The structure I keep returning to puts a first-principles backbone in charge of the physics, the conservation laws, the equilibria and the known kinetics, and gives machine learning the residual: the fouling, the drift, the unmeasured disturbances, the gap between the ideal reactor in the derivation and the one actually bolted to the floor. The physics stops the ML from inventing impossible worlds, and the ML corrects the physics where reality disagrees with the textbook. Each half covers precisely the weakness of the other, which is what makes the arrangement more than the sum of its parts.

Uncertainty is the safety case

For a model to steer a live process, the people running that process need to know when to stop trusting it. This is why probabilistic models, and Gaussian processes in particular, punch so far above their benchmark scores in industry: they report their own ignorance. A recommendation with a tight confidence band is an instruction. The same recommendation with a wide band is a question, and it should be treated as one. A system that cannot tell those two apart does not stay in control of anything for long. There is an interactive Gaussian process on this site if you want to feel the difference for yourself.

Validation is where hybrids win

I carried a habit over from numerical methods: before a model earns any authority, you demonstrate consistency, that it agrees with known physics in known regimes; stability, that its errors stay bounded as conditions drift; and convergence, that more data makes it better rather than stranger. With a pure black box those three questions are hard to even pose. With a hybrid they become natural, because you can test the physics and the residual separately, and when the model is wrong you know which half to interrogate. That, more than any accuracy metric, is why the models I trust in production are hybrids.