A fixed, 26-neuron steering circuit inside a simulated surface vessel. I built the control system, compared programmed and learned behavior, and measured when extra learning helped—and where it did not.
Could a steering circuit selected from a fruit-fly connectome become a useful part of a boat controller? And would reinforcement learning improve the navigation around it?
I developed FlyNeuron as an independent project, from the neural model and engineered input/output interface through the simulator integration, behavior policies, experiments, and replay tools. The vessel is a WAM-V unmanned surface vehicle (USV) in VRX / Gazebo. Earlier Otter experiments established the heading-control and visualization workflow.
The model uses 24 PFL3 input neurons and two DNa02 output neurons from MaleCNS data. Their connectivity shapes a reduced spiking circuit. Its parameters stay fixed; the learned policies choose heading and speed references above it. The sensor encoding and mapping from neural activity to engine steering are engineering choices.
My role
Sole developer · modeling, control, RL, integration & evaluation
Project status
Simulation study · live demonstration captured October 22, 2026
Small time savings from residual learning; the planner remains the default.
The scope of the model
The experiment models one selected 26-neuron pathway. It does not reconstruct a fly’s whole brain or establish biological fidelity for boat control.
02 / Live simulation
One run. Three views.
The programmed planner and fixed neural circuit guide the WAM-V past two piles to a goal 65 metres north.
Captured on October 22, this Stage B development run shows the complete loop in motion: Gazebo’s overview camera, a camera following the vessel, and the live odometry track in RViz. A PI controller regulates forward speed.
The upper panel follows the whole course from a fixed Gazebo camera. Below, a chase camera follows the WAM-V while RViz draws its odometry track. The vessel curves around two orange cylindrical piles and stops at the goal. RViz’s obstacle and goal markers come from the scenario configuration; they are not detections from a perception system. The 47.44-second recording plays 94.8 seconds of simulated motion at 2× speed, with no speech or audio.
Clearance is scored from an oriented hull footprint with an allowance for motion between samples. Both October 22 takes match the saved development run’s control, neural-activity, and arrival traces byte for byte. Planner decision values also match after excluding run identifiers and generated-world hashes. This is a repeated development course. The separate held-out learning comparison appears in the evaluation below.
03 / System architecture
Give each layer a clear job.
A behavior policy chooses where to point and how fast to move. Below it, the fixed neural circuit handles steering and a proportional–integral (PI) controller regulates forward speed. Keeping these interfaces stable lets the experiments change one layer at a time.
Acknowledge commands → advance physics → collect timestamped state
State feedback returns to the next control cycle. PD steering provides a conventional comparison through the same actuation interface. Open the diagram ↗
The simulator interface was part of the engineering work. Each thrust and steering command is acknowledged before paused physics advances. Recorded state, contact events, and measured joint angles make command timing inspectable. The neural dynamics run at 0.1 ms resolution within each 50 ms control interval.
03 / Inspect the circuit · MaleCNS centerlines with modeled activity from an earlier Otter replay. Data credit ↓Check the circuit against conventional and disabled steering
On the east-corner route, both neural and proportional–derivative (PD) steering reach the two waypoints. Quieting the neural inputs or disconnecting the circuit leaves the boat traveling almost straight; both runs time out without reaching a waypoint.
04 / Circuit regression · Neural: 88.0 s; PD: 84.8 s. Both disabled variants: timeout at 160.0 s. Grey circles mark the 5 m waypoint scoring radius. Open the full-resolution figure ↗
Across the 40-trial regression suite, neural and PD steering each pass 12/13 cases; quiet-input and disconnected variants each pass 0/7. These reuse earlier scenarios with one evaluation seed. They test the circuit’s role in this engineered controller, rather than general navigation reliability.
04 / Engineering decisions
Keep the comparison interpretable.
01 / Keep a fixed interface
Learn above the circuit.
Standalone Soft Actor-Critic (SAC) learns heading and speed commands. It does not update the fly circuit’s synapses. A common observation and actuation interface makes behavior policies and steering controllers easier to compare.
02 / Build a useful baseline
Predict before acting.
The programmed planner samples heading and speed candidates, forecasts motion with a model fitted to WAM-V response measurements, and rejects paths that violate its clearance buffer.
03 / Bound learned corrections
Make residuals small.
Stage D adds learned corrections of up to ±5° and ±0.05 m/s around the planner. A prediction filter checks each request and can return to a freshly checked planner reference.
04 / Preserve the failures
Check the saved evidence.
Frozen configurations, checkpoint identities, timestamped traces, and independent scoring keep failed missions in the comparison. The replay lets me follow a decision from its inputs to the vessel’s response.
Prediction filtering checks an approximate model. Its clearance buffer is not a proof of physical safety.
05 / Evaluation
A little faster. A little further off track.
The residual policy completed every evaluation case, as did the programmed planner. Its small travel-time saving came with greater tracking error.
Programmed planner8/8
Four layouts × two steering controllers
Planner + residual SAC24/24
Four layouts × three seeds × two controllers
Transferred standalone SAC22/24
Two seed-43 timeouts retained as failures
All 56 episodes were contact-free. Mission success also required reaching the ordered waypoints, completing the execution trace, and satisfying the scoring checks. The two timeouts therefore remain failures.
05 / Residual − planner · Each point averages four paired routes for one seed and steering controller. Fly uses the neural circuit; PD uses proportional–derivative steering. These are descriptive means.
Average residual − planner change across three training seeds
Measure
Fly steering
PD steering
Mission time
−1.304 s
−1.138 s
Cross-track RMSE
+0.279 m
+0.308 m
Mean episode-minimum clearance
+0.216 m
+0.166 m
Time and error use four layouts per seed/controller; clearance uses the three obstacle layouts. The same baseline runs are reused across seeds. PD reuses policy weights trained with fly steering. The standalone and residual policies had different training experiences.
The decision
Keep the programmed planner as the default. Residual training took 50.76 recorded hours and showed no completion gain on this suite. Its roughly one-second saving did not establish a consistent overall benefit.
These are four fixed layouts reused across seeds and controllers. They provide a bounded comparison, with no claim of statistical significance or broad navigation reliability.
Look back at standalone SAC training: all three seeds
Before the residual experiment, Stage C trained standalone SAC to choose heading and speed. Seeds 7 and 19 finish with stronger training performance than seed 43.
In Stage C’s separate 32-mission held-out suite, SAC completes 11/12 missions with each steering controller. The programmed planner completes 2/4 with fly steering and 4/4 with PD. All runs avoid contact: two fly-steered planner runs stop without a feasible maneuver, while SAC seed 43 times out on repeated piles with both controllers. These are different layouts from the Stage D comparison above.
Stage C / Trailing 100-episode means · Training behavior, distinct from the Stage D mission counts above. Open the full-resolution figure ↗Inspect a learned-policy mission: Stage D replay
This saved mission uses residual SAC, seed 7, with fly steering. Its 115.6 simulated seconds play at approximately 5× speed. The map, selected maneuver, references, and neural activity all come from the recorded episode.
Stage D / Residual SAC · seed 7 · fly steeringRecorded simulation · silent · ~5×Read a description of the replay
The vessel starts near the bottom of a north-up map and follows a recorded path past two circular obstacles toward its goal. The neighboring panel shows the selected maneuver and heading, speed, and actuator references. The lower panel shows activity in the fixed PFL3 → DNa02 circuit. The episode finishes at 115.6 simulation seconds with no recorded obstacle contacts and 1.619 metres minimum hull clearance. This is a screen recording of a saved simulation replay, with no speech or audio.
The useful outcome was a comparison that could justify keeping the simpler system. The residual policy improved average clearance and saved some time, but also increased tracking error. Those tradeoffs matter more than a training curve alone.
01
Separate avoidance from arrival.
Standalone SAC seed 43 timed out after 270 seconds on the repeated-obstacle layout with both steering controllers. Both runs avoided contact but missed the goal criteria. A contact-free trajectory can still fail the task.
02
Measure the filter’s influence.
The residual system used planner fallback for 382 of 2,476 behavior decisions (15.43%). Its prediction filter materially affected execution, so the result describes the combined policy and filter.
03
Keep the next test independent.
These inspected layouts now serve as regression cases. A change to the reward, correction bounds, or goal approach needs a new declared campaign and fresh evaluation layouts.
What this study establishes
A working, inspectable simulation pipeline and a measured policy comparison under calm water, forward motion, ideal static obstacle geometry, and truth or GPS/IMU navigation. Earlier controller regressions also probe wind and waves; they do not extend the learned-policy results to those conditions. Moving vessels, camera-based perception, collision regulations, and physical deployment remain outside the policy evaluation.
07 / Evidence & reproducibility
Keep the work inspectable.
The learning campaign was completed and audited on October 3, 2026. The original portfolio collection checked 280 metric values against all 56 saved traces and reran a selected episode audit plus 14 neural controller tests in Docker. The October 25 update adds the October 22 live recordings and verifies their saved traces against the development run.
Current source reviewed: ef87204. The live footage was captured at faa2b09; the original campaign evidence was reviewed at d168df9. The intervening tracked changes are documentation and media. This update checks supplied recordings and saved artifacts; it does not rerun physics or training.
Credits
Project engineering, experiments, and visualization: Jerry Chang. Connectome and skeleton data: MaleCNS collaboration (FlyEM at HHMI Janelia, University of Cambridge, MRC LMB, and Google Research), under CC BY 4.0. The anatomical view overlays modeled point-neuron activity on published centerlines.
Simulation and learning use upstream open-source tools including VRX, Gazebo, ROS 2, NumPy, SciPy, PyTorch, and Stable-Baselines3. The anatomical viewer uses Three.js; its MIT license is retained in the standalone export. Earlier Otter work uses the Python Vehicle Simulator.