Closing the Loop on Biological Systems
A Brief History of the Loop
Control systems engineers have spent decades learning how to test complex systems without destroying them. The core insight is simple: if a physical component is expensive, dangerous, or impossible to test in isolation, replace it with a model — and test everything else against that model in real time.
This is the logic behind X-in-the-Loop testing, a family of methodologies that has become foundational in automotive, aerospace, and energy systems engineering. Model-in-the-Loop (MiL) tests control software against a simulated plant model before a single line of code touches hardware. Software-in-the-Loop (SiL) compiles that code and runs it against the same model in a more realistic execution environment. Hardware-in-the-Loop (HiL) connects real physical hardware — an engine control unit, a battery management system, a flight controller — to a real-time simulator that replaces the rest of the physical system with a high-fidelity model.
At each stage, the loop closes more tightly around reality. The model becomes more accurate, the hardware more representative, and the test more meaningful — until finally the complete system can be validated with confidence before it ever encounters the conditions it was designed for.
Wetware-in-the-Loop (WitL) extends this logic to biological systems. The “wetware” — living cells, tissue, soil microbiomes, food matrices, fermentation broths — enters the loop as the physical component under test. Everything else: the measurement system, the analytical model, the control logic, the decision framework — is implemented in software, in hardware, or in real-time simulation. The loop closes around the biology.
Why Biology Resisted the Loop
X-in-the-Loop methodologies matured in domains where the physics of the system under test is well-understood, mathematically tractable, and measurable with precision. The dynamics of a combustion engine, an electric motor, or an aircraft control surface can be modelled from first principles with sufficient fidelity to make HiL testing meaningful. Deviations between model and reality are quantifiable, reproducible, and correctable.
Biological systems have historically resisted this treatment for several reasons.
First, biological variability is not noise — it is signal. Two soil samples taken from adjacent plots may differ substantially in microbial composition, organic matter distribution, and moisture retention. Two batches of the same food ingredient processed under nominally identical conditions may have different compositional profiles. A model that averages over this variability does not capture the biology — it obscures it.
Second, measuring biological state without perturbing it is genuinely difficult. Classical analytical chemistry is predominantly destructive: homogenise the sample, extract the analytes, quantify them, discard what remains. This is adequate for periodic quality checks but structurally incompatible with a real-time control loop. You cannot close a loop on a system you can only observe by dismantling it.
Third, the relevant state variables in a biological system are compositional rather than physical. Temperature and pressure can be measured with a thermocouple and a transducer. Fat content, protein concentration, moisture, organic matter, and metabolite profiles require analytical instrumentation capable of resolving chemical composition — continuously, non-destructively, and at sufficient speed to be useful in a control context.
Near-infrared spectroscopy addresses all three of these constraints directly.
NIR as the Sensing Layer
A near-infrared spectrometer measures how a sample absorbs light across the 900–1700 nm wavelength range. Different molecular bonds — C-H, O-H, N-H — absorb at characteristic wavelengths, and the resulting spectrum encodes information about the chemical composition of the sample without altering it. Measurement takes seconds. The sample is returned intact.
This makes NIR spectroscopy a natural candidate for the sensing layer in a Wetware-in-the-Loop architecture. The biological system — food matrix, soil sample, fermentation broth, tissue — is measured continuously and non-destructively. The resulting spectral data feeds a chemometric model that translates raw absorbance into compositional state estimates. Those estimates drive a real-time analytical or control system that responds to what the biology is actually doing, rather than what a static model predicts it should be doing.
The loop, in other words, closes around the wetware. The biology is no longer a black box approximated by a model — it is the real-time reference against which everything else is calibrated.
What Closes the Loop
A functional WitL architecture has four components.
The biological system under test. This is the wetware itself — the food matrix on the production line, the soil column in the agricultural field trial, the fermentation vessel in the bioprocess facility, the tissue sample in the clinical measurement context. It is the ground truth that the system is designed to measure, model, and ultimately influence.
The non-destructive sensing layer. NIR spectroscopy provides continuous, real-time compositional data from the biological system without interrupting it. Portable handheld analysers extend this capability beyond fixed laboratory or at-line installations to field deployment, enabling the loop to close wherever the biology is — not just where the instruments can be permanently installed.
The chemometric and analytical model. Raw spectral data is not directly interpretable as a control signal. A calibrated chemometric model — ideally chemistry-informed, as discussed in a companion article — translates spectra into compositional estimates with quantified uncertainty. This model is not static: it is updated continuously as new spectral data accumulates, improving its accuracy over time and adapting to drift in both the instrument and the biological system.
The control or decision layer. The output of the chemometric model drives an action — adjust a process parameter, flag a batch for secondary testing, update a predictive model, generate an alert. In the most closed implementations, this layer operates autonomously. In others, it surfaces information to a human operator whose expertise and judgment remain in the loop alongside the wetware.
Cross-Industry Convergence
The value of WitL thinking is not confined to any single application domain — it is a framework that transfers across industries wherever biological systems are measured, monitored, or controlled.
Food and beverage production. Continuous NIR measurement of composition at-line closes the loop between raw material variability and process response. Rather than sampling periodically and correcting after the fact, production systems can respond to compositional drift in real time — adjusting blending ratios, processing parameters, or batch release decisions as the biology of the incoming material demands.
Precision agriculture. Soil is a living system whose composition changes continuously in response to weather, biology, and management practices. A WitL architecture that combines portable NIR measurement with real-time agronomic models could close the loop between soil state and intervention — fertiliser application, irrigation scheduling, cover crop selection — at a spatial and temporal resolution that population-average agronomic recommendations cannot approach.
Industrial biotechnology. Fermentation processes are inherently dynamic — the biochemical state of the vessel changes continuously as organisms consume substrate and produce product. WitL testing of process control algorithms against real fermentation systems, rather than against simplified kinetic models, produces control strategies that are robust to the biological variability that simplified models cannot capture.
Environmental monitoring. Water treatment, carbon sequestration assessment, and pollution remediation all involve biological systems whose state is relevant to control decisions. NIR-based continuous monitoring of these systems provides the real-time compositional data that closes the loop between environmental state and management response.
The Human in the Loop
A note on the “wetware” terminology that gives this methodology its name. In engineering parlance, wetware originally referred to the human operator — the biological intelligence in the control loop, distinguished from hardware and software by the inconvenient fact of being made of water. In the WitL framework developed here, the term has been extended to encompass biological systems more broadly — but the original meaning is not discarded.
The human remains in the loop. Analytical models have uncertainty. Biological systems have variability that even well-calibrated chemometric models do not fully capture. Control decisions in food production, agriculture, and medicine carry consequences that require human judgment, regulatory accountability, and domain expertise that no model fully encodes.
WitL is not an argument for removing the human from the loop. It is an argument for giving the human better information — continuous, compositionally resolved, non-destructive — on which to exercise that judgment. The loop closes more tightly around the biology when the measurement layer is real-time and the analytical model is chemistry-informed. The human at the decision layer benefits from both.