All MAIN articles
MAIN · Technical record
MAIN · Technical6 min read

PhycoNet: Federated Learning Across Reactors

Reactors trade the learned parameters of their digital twins — never raw culture data — so the network converges on a strain’s productive regime faster than any one reactor could alone.

Key facts
  • Only learned twin parameters cross the network — six floats plus a performance score, never raw telemetry
  • Federated Averaging weights each reactor by its performance and how much calibration data backs it
  • Incoming global parameters are finite- and bounds-checked before they can touch a live twin
  • Runs over MQTT with no cloud, and works with as few as two reactors

A single reactor learns slowly. MAIN calibrates its digital twin from the culture in front of it — nudging the model’s parameters until its forecasts match what the sensors actually report — but one reactor only ever sees one culture, under one set of conditions. PhycoNet is the network layer that lets a fleet of reactors pool what each has learned. The design constraint is strict: reactors help each other converge on a strain’s productive regime without ever exchanging raw culture data.

What travels between reactors is not telemetry. Each reactor shares only the learned parameters of its twin — six numbers: the maximum growth rate (µmax), the optimal light level (I_opt, the peak of Steele’s light curve), a loss/death rate, the optimal temperature and pH (the peaks of the bell-shaped response curves), and the maximum nutrient-uptake rate (vmax) that feeds Droop’s cell-quota term. Alongside them go two bookkeeping figures: a performance score and the number of data points behind the calibration. No sensor logs, no images, no pH-and-temperature history ever leave the Pi. Privacy here is a property of the format, not a promise — there is simply nothing in a payload but a handful of floats.

Aggregation uses Federated Averaging (FedAvg). An aggregator — a laptop or a small server, not a cloud service — subscribes over MQTT, collects the latest parameter set from each reactor, computes a weighted average, and publishes that global model back to every reactor. The whole exchange is local: it runs on a home network with no internet, and it works with as few as two reactors, scaling up from there. Each reactor merges the returned global model into its own twin as a warm start, then keeps calibrating against its own culture.

The averaging is weighted, not uniform. Each reactor’s contribution is scaled by its performance score times the amount of calibration data behind it, so a reactor that is growing well and has observed a lot pulls the global model harder than one that is barely started or struggling. The performance score is deliberately simple: the slope of recent biomass over time — roughly grams per liter per day — normalized to a 0–1 range. Parameters are only comparable when reactors cultivate the same strain toward the same goal; averaging a high-density production run against a strain held at slow maintenance growth would blur two different optima into one that fits neither.

The most important code in the module is the part that distrusts the network. A global model arrives over a topic any node can publish to, so a corrupt or malicious payload — µmax as NaN, I_opt as zero — is perfectly valid JSON and would quietly poison the twin. Because MAIN’s Layer-2 safety gate uses that same twin to simulate and veto proposed actions, a poisoned model would not merely forecast nonsense; it could defeat the gate that is supposed to catch nonsense. So every incoming parameter is checked for being finite and within physical bounds before it is allowed anywhere near a live twin, and anything out of range is dropped. The validated parameters are then applied on the main loop’s next tick rather than from the network thread, so the swap never races the ODE integrator mid-simulation.

PhycoNet is deliberately modest about what it changes. It accelerates calibration; it does not take control. A shared model only ever adjusts the twin’s parameters — it never issues a command, and every proposed action still passes through the same deterministic hard limits and twin-checked safety gate on the local reactor. Shared learning is a suggestion the network offers; the reactor in front of you always has the last word. Like the rest of MAIN, it is open-source, non-commercial, and built to be studied — the point is to let a small, distributed community of growers learn faster together than any of them could alone.

All MAIN articles Reserve a reactor