Digital Twin

Digital Twin. A laptop screen showing the twin's dark dashboard, with live growth traces and pump readouts.

Abstract

ReLEAF's digital twin software aims to help the bioreactor run for weeks with minimal manual instruction, automated control and risk evaluation. It is an AIoT system that connects the bioreactor's sensors and valves, alongside local sensors and online forecasts, to models that learn from new data.

The digital twin reads optical density, pH, pressure and flow from the bioreactor, all live, and commands its pinch and Luer valves from the same interface. We calibrated its photometer against TiO₂ and SiO₂ and ran B. subtilis in the bioreactor six times, the longest for 434 hours. Replayed over that run, the twin flagged the photometer 26.7 hours before its reading failed. On the October run its growth rate came out inside the interval we had registered a fortnight earlier, from a prior fitted on a light plate. Green light, dissolved oxygen and the field sensors have each been tested on their own. The future version adds leaf temperature, leaf wetness and the weather forecast into the full loop. Its Ask tab lets a farmer ask about the bioreactor in plain language and act on the answer, without expertise in biomanufacturing.

Contents

On this page

Digital Twin and ReLEAF's System

ReLEAF's bioreactor is built to stand beside a rice field and keep producing for weeks at a time. The person responsible for it there grows rice, and nobody with laboratory training is on hand to draw a sample or read a trace. That situation set the list of jobs before any software existed. Somebody has to see what the culture is doing while it runs. Something has to raise an alarm when a reading or the culture starts to drift, because a week can be lost before the next visit. The grower needs to know how much biomass there will be in a few hours, and whether the protectant will be ready when the crop wants it, which means watching the weather forecast and the crop as well as the vessel. And the answer has to come back in plain language, so that acting on it does not depend on reading a dashboard built for a laboratory.

Live readings alone cover only the first of those. A drift alarm needs a model of what a healthy run looks like; a delivery date needs the batch carried forward in simulation; a suggested setting needs that simulation returned to the bioreactor. This is the distinction the literature draws. A digital model represents a physical system but is updated by hand. A digital shadow receives live data automatically, but changes back to the system still need a person. A digital twin closes the loop: data flows automatically from the system to the model and back [1, 2]. The jobs above describe the third one, so that is what we built: a second simulated world running the same batch as the physical one but ahead of it, which is what lets the software hand over a risk assessment and a suggested action before the event instead of a report after it.

ReLEAF is an AIoT system: the bioreactor's sensors and valves are wired to a board that logs every reading, and models learn from those readings. The twin reads optical density, pH, pressure and flow live, and the pinch and Luer valves are commanded from the same interface. Some of what it watches sits outside the bioreactor: a sensor beside the crop reads leaf temperature and leaf wetness, two readings that together say when the weather is letting disease into the field. An autoencoder our team trained on the healthy first 120 hours of the 434-hour run flagged a failing photometer 26.7 hours before its reading became unusable (R2). One thing the twin cannot read at all is how much protectant a batch has made: that comes from a sample drawn by hand and assayed at the bench, ELISA for the amount and DNPH for the activity, and it reaches the decision through a person (section 4). The models have so far run on recorded data after each run, and a person still makes every decision. The next Digital Twin joins them to the live loop and adds the Ask tab, where a farmer with no expertise in biomanufacturing can ask about the bioreactor in plain language and act on the answer.

1What it takes in

Within the bioreactor

Bioreactor sensors
  • Live
  • OD600
  • pH
  • Flow rate
  • Pressure × 4

At the bench

Sample assays ELISA for how much enzyme, DNPH for whether it works

Outside the bioreactor

Field sensors Leaf temperature and wetness, air temperature and humidity
Weather forecast Temperature, humidity, rain, wind

2What the models do

Sensor alarm Autoencoder on the sensor and process axes R2
Batch forecast Kalman filter, 2 to 12 h ahead R5
Growth prior Logistic fit from the light plate R6
Crop-stress risk Stress index and the rice blast rule

3What it works out

Batch readiness Is the protectant ready in time, and is there enough of it
Field need When the crop will want it

4What it decides

Induction decision Switch the green light on, and for how long A person approves

5What it acts on

Valves
  • Live
  • Pinch valve
  • Luer valves × 4
Commanded from the controller UI
Green light Tested, not yet integrated
How the twin's inputs reach the induction decision. Live on the bioreactor today Runs on our recorded data Designed, not yet connected; the return closes once induction is automatic

What our digital twin measures

Within the bioreactor

Measured channels and actuators of the bioreactor
ChannelInstrumentPurposeProvenance
Optical density 600 nmPhotometer: amber LED, 2 mm flow cuvette, sample and reference lux sensorsBiomasslive
pHArduino pH probeGrowth and secretion conditions; alarmlive
Pressure × 4Pressure transducersLumen ΔP, trans-membrane pressure (TMP), foulinglive
Flow rateTurbine flow meterCross-flow, wall shear, hydraulic model (R4)live
Pinch valveServoLumen isolationlive control
Luer valves × 4Valves on the loopRouting between reservoir, module and permeatelive control
Lumen ΔP, TMP, fouling ratioPressure and flow through the hydraulic modelMembrane state; when to cleanindirect
Green lightTested separately, but not integrated yetInduces the CcaS/CcaR strain to make protectanttested, not integrated
Dissolved oxygenHad trouble calibrating our DO sensorMeasure DOexperimented, not integrated

Results

Every run so far

The six bioreactor runs, what changed in each and what they gave
RunSet-upOD600What it gave
1 · 6 June
prototype 260606
B. subtilis 168 WT. PES hollow fibre, lumen about 200 mL; 300 mL LB plus 20 mL overnight culture; peristaltic pump at 94 mL/min; no stirringHand samples to 27 h: bioreactor 0.17 to 0.37, flask to 2.46Stopped by a pump leak. 2 mL of shell-side liquid grew no colonies. Next: BPT tubing, stirring, sampling at the reservoir
2 · 14 June
prototype 260614
B. subtilis 168 WT. Run 1 plus stirring at 200 rpm and a sampler before the pump; 37 °C; 300 mL as in run 1Samples every 15–20 min to 7.1 h: bioreactor 0.90 by 145 min, flask 0.83 by 278 minStirred bioreactor plateaued about two hours before the flask. Next: 22 °C
3 · 21 July to 8 AugustB. subtilis 168 WT at 22 °C, 300 mL, hollow fibre module fitted, in-line photometer434 h continuous, peak about 1.5The sensor alarm (R2)
4 · 1 to 6 SeptemberB. subtilis 168 with constitutive ACC deaminase secretion, in the incubator, full-length hollow fibre module; 1 LTwo files: 3.2 h from near zero to 0.24; 10.2 h unlogged; then 102 h from 0.84 to 3.77The forecast comparison (R5), on the second file; the Dry Lab Notebook's 53 hours are its first part
5 · 8 to 10 OctoberB. subtilis WB800 with constitutive ACC deaminase secretion, 37 °C, hollow fibre module; permeate drawn at 24 mL/min, a flux of 72 LMH37.5 h logged over 38 h in four files: 0.10 to 0.30 in the first nine hours, then the reading breaks downHalved flux and an acceptance gate on the photometer, both carried into run 6
6 · 14 to 16 OctoberAs run 5, with the permeate halved to 12 mL/min, 36 LMH, and the acceptance gate running41.8 h continuous: 0.14 to 2.71 by 37 h, then the sample beam was lostThe registered forecast scored (R5) and a fouling trace that held
Six panels of OD600 against time: run 1 and run 2 hand-sampled against a shake flask, run 3 over 434 hours in-line, run 4 in two logged parts with a 10-hour unlogged gap, run 5 breaking down after ten hours, and run 6 rising cleanly over 42 hours with a fitted growth rate.
The six bioreactor runs of B. subtilis: optical density at 600 nm against time. Grey marks the readings the twin does not use.

Run 5 was restarted three times, so it arrives as four files covering 37.5 of its 38 hours. The in-line reading rose from 0.10 to 0.30 over the first nine hours and then fell away while the culture was still there: a sixth of its windows carried more than 20% bubbles, and the reference channel, which never passes through the culture, moved by a factor of 4.8 across the run. Nothing after 10.6 hours can be read as a growth curve. The pH channel then held at 6.90 for twenty hours, which is the probe and not the culture.

Run 6 is the same strain with two changes. The permeate was drawn at half the rate, 12 mL/min against 24, and the photometer was given an acceptance gate that holds the last good value when a window fails its own checks. It ran 41.8 hours without a restart. The gate turned away 31 of 1,083 windows, no window carried more than 20% bubbles, the reference held within 17%, and the trace came out clean: 0.14 at the first window, 1.01 at 7 h, 2.71 at 37 h. After that the sample channel fell to a tenth of the reference and the reading stepped to about 9.9 and stayed there, flagged as low signal, and the twin does not use it. pH fell from 6.93 to 6.41 over the first seventeen hours and then stepped back to 7.0 inside one window, which the log does not explain.

The pressure the module needed beyond what its own geometry needs for clean water rose from 2.0 to 3.8 kPa over those 42 hours. That is the fouling signal the twin watches for, and at 3.8 kPa it is far from the point where the membrane would have to be cleaned. Two excursions break that line, at 1.1 h and 24.3 h. In both the permeate pressure reads zero while the feed rises, so both are the permeate side being opened and neither is the membrane.

Photometer calibration against TiO₂ and SiO₂

TiO₂, 23 August

On 23 August 2026, cumulative TiO₂ additions into a stirred 400 mL loop gave 45 paired points between the in-line photometer and the BioDrop spectrophotometer. Up to an optical density of 1.2 the photometer follows the BioDrop with slope 1.018 and R² 0.995.

In-line photometer and BioDrop readings against cumulative TiO2 dose from 2 to 60 mg, each with a fitted straight line and its R squared.
Optical density at 600 nm from the in-line photometer and the BioDrop against the mass of TiO₂ added, 23 August 2026.
A student in a lab coat adds TiO2 suspension by syringe to a stirred bottle of white liquid that is pumped through the black in-line photometer on the desk, while an instructor watches from the side.
A student adding TiO₂ during the calibration on 23 August 2026.

SiO₂, 10 October

On 10 October 2026 the same loop ran the calibration iGEM's protocol actually asks for: silica in 2.5 mg steps from 2.5 to 100 mg in 500 mL of 1% SDS, read at every step on the BioDrop and on both photometer builds, and logged in-line every five seconds for 4 h 27 min.

Both in-line photometer builds and the BioDrop against cumulative SiO2 dose from 2.5 to 100 mg, each with a fitted straight line and its R squared.
Optical density at 600 nm from both in-line photometers and the BioDrop against the mass of SiO₂ added, 10 October 2026.
A student in a lab coat pipettes a sample into a cuvette beside the black in-line photometer and its stirred beaker, while an instructor logs the readings on a laptop.
A student sampling for the BioDrop during the SiO₂ calibration on 10 October 2026.

The run carries its own check. At 137.6 min the suspension was diluted and then restored, which tests proportionality without the dose being known: 2.3610 before (SD 0.0033, 29 readings), 0.7943 after (SD 0.0017, 38), and 2.3665 restored (SD 0.0157, 16). The ratio across the dilution is 2.97 one way and 2.98 the other, and the restored reading returns within 0.2% of the original. A reading of 2.36 therefore carries the same proportional meaning as one of 0.79, which is the property a calibration needs for the twin to compare one reading against another.

What the results amount to

The green-light decision making questions

Key questionWhich result settles itThe number
Is our OD reading accurate? R1, photometer against TiO₂ and SiO₂ Slope 1.018 against the BioDrop to OD 1.2; a threefold dilution returns within 0.2%
When does the OD reading stop being accurate? R2, autoencoder on the sensor and process axes 26.7 h of warning before the channel gave out; 31 of 1,083 windows gated in run 6
What could the B. subtilis growth look like an hour in the future, without green light activation? R5, Kalman filter 41% less error at 2 h than assuming nothing changes
What could B. subtilis growth look like under green light? R6 prior, scored Growth rate 0.286, inside the 0.2705 to 0.3300 interval registered a fortnight earlier
Can the bioreactor vessel keep delivering? R4, pressure and flow Shear from two independent sensors agrees to 2.8%; fouling rose 2.0 to 3.8 kPa over 42 h, far from cleaning
When does the crop need the protectant? R3, field sensors and the weather forecast, and the math model connection Bench only: the leaf sensor reads 1.2 to 1.9 °C warm, and nothing is on a plant yet
How much protectant is actually there? ELISA for how much, DNPH for whether it works: an anti-His ELISA on samples drawn through the run, read off a logit standard curve, and the DNPH assay reading α-ketobutyrate, the product of the ACC deaminase reaction About 5 µg/mL of ACC deaminase across both October runs, between 3.4 and 6.5 and flat over 41 h; 0.5503 mM α-ketobutyrate after 3 h of induction, our best activity figure. Both from single samples

Read down that column and the decision assembles itself from two directions.

From the field. The forecast and the crop-stress rule give an hour at which the crop comes under stress. Protectant takes time to make, so the light has to come on before that hour, not at it. The twin subtracts one from the other.

From the vessel. The prior says what this strain does before the batch starts, so a target time exists on hour zero. The Kalman filter updates it as the run proceeds. The trust layer decides whether the readings feeding both are worth using, and the fouling trace says whether the membrane will still be passing permeate when the moment arrives.

Where the two meet is the answer. If the culture reaches the needed density before the field needs the protectant, the twin names the hour to induce. If it does not, the useful output is the opposite: this batch cannot meet this demand, and the grower learns that days early rather than on the day of stress.

The last number is the one that says a batch is worth harvesting, and the two assays are the first readings of it. The ELISA says how much enzyme the run made, about 5 µg/mL, flat from the first hour to the forty-first: that strain secretes constitutively, so this is what a run makes with no light on it at all. The DNPH assay says the enzyme works, and puts 0.5503 mM of α-ketobutyrate against three hours of induction. Neither can yet set the induction length. Both are single samples, the activity reading sits below the assay's quantitation limit, and the two readouts of it disagree twenty-twofold depending on how long the reaction ran. So the twin can say when the culture will be ready, and a person still decides how long to leave the light on, from a sample drawn by hand and carried to the bench. Repeating the assays on an induced batch, and fitting green light to the bioreactor, are what close the loop.

The Software

The Digital Twin

It has three parts. Firmware v4.2.2 (sketch/sketch.ino) runs on the Uno Q's microcontroller, samples the instruments and holds every interlock, including a pressure trip that stops the pumps when any of the three pressure channels passes 0.70 bar. Backend v6.2.2 (python/main.py and five modules beside it) runs on the board's Linux side, computes optical density, growth rate, the membrane values and the alarms, runs the automatic pH control, writes the log to the board's disk and serves the page on port 7000. Interface v6.2.2 (assets/index.html) is one file in the browser: it shows the live readings and sends the pump and valve commands, and holds no interlock of its own. The firmware pushes readings to the backend and the backend calls the firmware for commands, over the board's Bridge link.

This is the version we froze the wiki with. Run 6 was recorded on v5.1 and runs 1 to 5 on earlier versions. Since v5.1 it adds a feed pump that doses base under automatic pH control, a shell sampling valve, a feed valve and the pressure trip. These have been run against a simulated board; of them, only the feed pump has been wired to the real one.

The Digital Twin Open full screen →
The bioreactor inside an incubator with its door open: a stirred bottle of amber culture, tubing, the black in-line photometer and wiring, with a peristaltic pump and a laptop showing the dashboard on top.
The bioreactor running on 8 October 2026, with the Digital Twin on the laptop above it.
A laptop screen showing the Digital Twin dashboard during a run: the optical density and pH charts, the four pressure traces, the membrane filtration warnings and the pump and feed valve controls.
The Digital Twin during the run on 18 October 2026.
The System map tab of the next Digital Twin: a flow diagram of the reservoir, pumps, pinch valve and hollow-fibre module with live pressure, pH, flow and optical density readings on demo data.
The next Digital Twin, System map tab, on demo data.
The Ask tab of the next Digital Twin: a chat box with example questions on the left, and on the right a panel to choose an AI provider and model and paste an API key.
The next Digital Twin, Ask tab. A farmer can ask about the bioreactor in plain language and act on the answer, without expertise in biomanufacturing.

Current limits

Four things are not yet in the twin. Loop temperature: the probe is fitted but has not been answering, so the runs used a temperature typed in by the operator. Dissolved oxygen: we had trouble calibrating the sensor and neither probe can be autoclaved, so it is not on the bioreactor. Green light on the bioreactor: induction was tested on the light-programmable array and is not built into the bioreactor, so the twin cannot yet switch it on. Induction light in the culture: it is not measured, and a dense culture will dim it by an amount nothing on the bioreactor reads.

The October runs added a fifth. The in-line photometer has a top end: somewhere above an optical density of 2.7 the sample beam fell to a tenth of the reference, and the reading stepped to about 9.9 and stayed there for the last four hours of run 6. The acceptance gate marks those windows as low signal, which is enough for the twin to stop trusting them and not enough to recover a number from them. Above that density the bioreactor is blind until someone draws a sample by hand.

References

  1. Portela, R. M. C., Varsakelis, C., Richelle, A., Giannelos, N., Pence, J., Dessoy, S., & von Stosch, M. (2021). When is an in silico representation a digital twin? A biopharmaceutical industry approach to the digital twin concept. Advances in Biochemical Engineering/Biotechnology 176, 35–56. doi:10.1007/10_2020_138
  2. Gargalo, C. L., Caño de las Heras, S., Jones, M. N., Udugama, I., Mansouri, S. S., Krühne, U., & Gernaey, K. V. (2021). Towards the development of digital twins for the bio-manufacturing industry. Advances in Biochemical Engineering/Biotechnology 176, 1–34. doi:10.1007/10_2020_142
  3. Koshimizu, Y. (1988). [BLASTAM, leaf blast forecasting from AMeDAS weather data; in Japanese.] Bulletin of the Tohoku National Agricultural Experiment Station 78, 67–121. Cited from secondary sources; the original was not read.
  4. Yoshino, R. (1979). [Leaf wetness duration and temperature required for rice blast infection; in Japanese.] Bulletin of the Hokuriku National Agricultural Experiment Station 22, 163. Cited from secondary sources; the original was not read.
  5. Sentelhas, P. C., Dalla Marta, A., Orlandini, S., Santos, E. A., Gillespie, T. J., & Gleason, M. L. (2008). Suitability of relative humidity as an estimator of leaf wetness duration. Agricultural and Forest Meteorology 148, 392–400. doi:10.1016/j.agrformet.2007.09.011
  6. Sinner, P., Daume, S., Herwig, C., & Kager, J. (2021). Usage of digital twins along a typical process development cycle. Advances in Biochemical Engineering/Biotechnology 176, 71–96. doi:10.1007/10_2020_149

Licence

Both programs, the Digital Twin and the next Digital Twin, are released under the MIT licence. The text is in software/LICENSE, beside the Digital Twin's source in software/rig-app/. Both are published in iGEM's software repository as well, gitlab.igem.org/2026/software/gems-taiwan/digital-twin, with the running instrument under rig-app/ and the browser twin under next-twin/. The wiki's own text and figures stay under CC BY 4.0.