Hobby build — 2026
Scientists have mapped every neuron and connection in a fruit-fly brain, and a published computer model turns that map into a brain that can be switched on. I ran it: feed it sugar, watch the spikes, then silence two neurons and see what changes.
01 — The story
In my talk The Whole Fly, Wired I reviewed three papers on the fruit-fly connectome. One of them, by Philip Shiu and colleagues (Nature, 2024), turns the wiring map of a whole fly brain into a computer model that can be switched on. This hobby project runs that published model on a laptop and asks it one question: what happens inside the brain when the fly tastes sugar?
The page follows the experiment in four steps. First the map, then the simple rule every neuron follows. Then the main test: switch on the 21 sugar-taste neurons the paper used and follow the spikes to MN9, a motor neuron that lifts the proboscis, the fly’s feeding tube. Then silence two neurons out of 127,400, run the exact same experiment again, and plug the brain into a simple walking fly to see what that difference could look like.
Nothing here was recorded from a living fly. Every spike is computed by the model and replayed from runs I made on 23 October 2026.
Credit where it’s due
I did not build the brain model or the wiring map. The model is the work of Philip Shiu, Gabriella Sterne, Nico Spiller and colleagues in Kristin Scott’s lab, shared openly under the MIT licence. The map is the FlyWire connectome. My part is running the model, checking it against the original, and showing what it does.
Meet the people behind the model ↓How to read this page
Every figure and number carries one of three tags, so you always know where it comes from.
Credits — the people behind the model
This project only exists because Philip Shiu, Gabriella Sterne, Nico Spiller and their colleagues, in work led by Kristin Scott, built the model and shared their code openly for anyone to run. Thank you.




02 — The map DATA
The FlyWire project reconstructed the whole brain of one adult female fruit fly from electron-microscope images: every neuron, and every synapse between them. The release used here (v630) has 127,400 neurons joined by about 14.7 million connections, made of 52.8 million synapses.
Each dot below is one of those neurons, placed where it sits in the real brain (positions from Schlegel et al. 2024, matched by neuron ID; 127,320 of the 127,400 have one). More than half of them are in the two optic lobes, the wide wings on either side, which handle vision. Taste and feeding live in the lower middle, in the subesophageal zone.
Seen from the front, with the fly’s right on your left. Drag sideways, or focus the picture and use the arrow keys, to turn it.
03 — Turning the map into a brain MODEL
Shiu and colleagues gave all 127,400 neurons the same simple rule, called leaky integrate-and-fire. Think of a bucket with a small hole. Incoming spikes pour charge in, the charge slowly leaks out, and if the level rises past a line the neuron fires a spike of its own and the bucket empties.
How hard one neuron pushes another depends only on how many synapses connect them, and on whether its chemical messenger excites or inhibits (GABA and glutamate count as inhibitory). Each synapse is worth 0.275 mV, the model’s one tuned number. There is no learning, no hormones and no spontaneous firing. That is the whole model.
The rule, as the model writes it
dv/dt = (v₀ − v + g) / τ_m dg/dt = −g / τ_s v > v_th → spike, v = v₀, g = 0 input spike → g += synapses × 0.275 mV
| Resting level v₀ | −52 mV |
| Firing line v_th | −45 mV |
| Leak time τ_m | 20 ms |
| Input decay τ_s | 5 ms |
| Rest after a spike | 2.2 ms |
| Travel delay | 1.8 ms |
| Time step | 0.1 ms |
Same equations and parameters as the full model. Too few inputs and the leak wins, so it never fires. In the real network each neuron’s inputs come from the neurons wired to it in FlyWire.
04 — Sugar in, spikes out MODEL
This is the paper’s own test. The 21 sugar-taste neurons (gustatory receptor neurons) get random spikes at 100 per second each for one simulated second, a stand-in for the fly touching sugar, and every spike anywhere in the brain is recorded.
The readout is MN9. Its firing drives the proboscis drawing beside the brain; how far a real proboscis moves for a given MN9 rate is not known, so that mapping is my choice and tagged APP. Switch to the second run to see the same input with two neurons silenced.
In the picture
A neuron firing a simulated spike
The 21 sugar-taste neurons (input)
MN9, the two motor neurons (output)
The two Roundup neurons, when silenced
Each flash is one simulated spike. Activity starts at the sugar-taste neurons in the lower brain.
05 — Silence two neurons MODEL
The model can switch any neuron off. Silencing, exactly as in the original code, removes everything a neuron sends: it can still fire, but nothing downstream hears it. I silenced Roundup, a cell type the paper places just before the motor neurons in the sugar-to-feeding pathway (two neurons, one per side), and repeated the same 10 trials.
The comparison is paired. Trial 3 of the silenced run received exactly the same random sugar input as trial 3 of the normal run, so each pair of bars differs only by the silencing.
Result, within this model
MN9: 65.5 → 24.7 spikes/s
A drop of 62%, lower in all 10 of 10 paired trials. The other MN9 fell harder, from 49.8 to 5.4 (−89%).
Does it match the paper?
Yes in direction. The paper calls Roundup “the pre-MN with the strongest predicted silencing phenotype”. This is a result inside the model, not a tested prediction about a living fly.
06 — From brain to behaviour HYBRID DEMO
The brain model only produces spikes. To see what they could mean for a fly, I connected it to a simple, hand-written walking controller in a small arena with two sugar patches. The fly wanders at random. When it stands on sugar, the 21 sugar neurons switch on. If MN9 then fires fast enough, the controller stops the fly to feed.
The walking and turning are mine, not the model’s: the wiring map has no nerve cord, so the brain cannot move legs. Only the decision to stop and feed comes from the simulated brain. Nothing learns, and a fly that finds sugar found it by chance.
Same seed, same random walk: until they reach sugar, both flies take exactly the same path. Off the sugar, the sugar neurons are silent and MN9 stays at 0.
07 — Under the hood
The project, which I call FlyBrain Arcade, is a small pipeline. It fetches the original model and its data, runs the whole brain fast enough to experiment with, measures the results honestly, and turns them into the pictures on this page. Pick a stage to see what it does and which files do it.
Stage 01 DATA
Downloads the published model at a pinned version (commit 91bdd1e) together with its FlyWire v630 files, about 200 MB, and checks each file’s SHA-256 fingerprint. The model’s parameters are read straight from the original code rather than typed in again, and a test checks them.
scripts/fetch_upstream.pyflybrain/upstream.py
Stage 02 DATA
Loads the connection table into a compressed sparse matrix: for each neuron, the list of neurons it talks to and how strongly (synapse count × ±1 × 0.275 mV). A second file holds the verified neuron IDs: the 21 sugar neurons, both MN9s, Roundup and the 106 feeding-region cell types from the paper’s own files.
flybrain/network.pyflybrain/neurons.py
Stage 03 MODEL
Two engines run the same model on all 127,400 neurons, with nothing pruned. The default is my Numba re-implementation, which compiles the update loop to machine code: one simulated second takes about 2.3 s on my laptop. The second engine runs the unmodified original Brian2 code, about 21 s per simulated second, and serves as the reference.
flybrain/engine_fast.pyflybrain/engine_brian2.py
Stage 04 MODEL
Switching on uses the original mechanism: each target neuron gets random kicks of 68.75 mV at the chosen rate, enough to make it fire. Switching off sets all of a neuron’s outgoing connections to zero, exactly like the original silence(). Settings are checked before a run: 0–200 spikes/s, up to 2 s and up to 30 trials.
flybrain/experiment.py
Stage 05 MODEL
Computes spike counts, firing rates and rate-over-time curves in 5 ms bins. Comparisons are paired: trial k of both runs uses the same random seed, so a difference comes from the intervention alone. Every result exports as CSV, JSON, SVG or PNG with a record of exactly how it was made.
flybrain/metrics.pyflybrain/runs.py
Stage 06 APP
Every 50 ms of simulated time: sugar under the fly sets the sugar neurons’ input rate, the brain runs, MN9’s rate becomes a stop-and-feed signal, and the hand-written controller moves the fly. The brain keeps its full state between windows, and a test proves that chopping a run into windows changes not a single spike.
flybrain/arena/
Stage 07 APP
A FastAPI server runs simulations in a background worker. The React and three.js app draws a 3D fly, the brain cloud with spike flashes and the arena; the frame at the top of this page comes from it. One script exports the precomputed runs that this page replays, so it needs no server.
flybrain/api.pyflybrain/jobs.pyfrontend/src/three/scripts/export_site_data.py
Stage 08
The same random input goes into the original Brian2 code and into my Numba version, and every spike of all 127,400 neurons is compared. They are identical in all four test runs. Against the results bundled with the paper’s code, firing rates agree with a correlation above 0.999. 44 automated tests pass.
scripts/validate_exact.pyscripts/validate_statistical.pybackend/tests/
Checked spike for spike against the original
| Test run | Original | Mine | Different |
|---|---|---|---|
| 200 ms, 100 Hz | 1,874 | 1,874 | 0 |
| 1 s, 100 Hz | 9,242 | 9,242 | 0 |
| 1 s, 200 Hz, Roundup silenced | 13,689 | 13,689 | 0 |
| 500 ms, 50 Hz, one Rattle silenced | 1,597 | 1,597 | 0 |
How fast, on a laptop
| Job | Time | Memory |
|---|---|---|
| 1 trial × 1 s, Numba | 2.3 s | 0.5 GB |
| 10 trials × 1 s, Numba | 4.5 s | 0.5 GB |
| 30 trials × 1 s, Numba | 9.1 s | 0.6 GB |
| 1 trial × 1 s, original Brian2 | 20.8 s | 3.1 GB |
08 — Honest limits
Sources and credits
Discussion
Register with your email to join the discussion
No comments yet. Be the first to share your thoughts.
Hobby build — 2026
Scientists have mapped every neuron and connection in a fruit-fly brain, and a published computer model turns that map into a brain that can be switched on. I ran it: feed it sugar, watch the spikes, then silence two neurons and see what changes.
01 — The story
In my talk The Whole Fly, Wired I reviewed three papers on the fruit-fly connectome. One of them, by Philip Shiu and colleagues (Nature, 2024), turns the wiring map of a whole fly brain into a computer model that can be switched on. This hobby project runs that published model on a laptop and asks it one question: what happens inside the brain when the fly tastes sugar?
The page follows the experiment in four steps. First the map, then the simple rule every neuron follows. Then the main test: switch on the 21 sugar-taste neurons the paper used and follow the spikes to MN9, a motor neuron that lifts the proboscis, the fly’s feeding tube. Then silence two neurons out of 127,400, run the exact same experiment again, and plug the brain into a simple walking fly to see what that difference could look like.
Nothing here was recorded from a living fly. Every spike is computed by the model and replayed from runs I made on 23 October 2026.
Credit where it’s due
I did not build the brain model or the wiring map. The model is the work of Philip Shiu, Gabriella Sterne, Nico Spiller and colleagues in Kristin Scott’s lab, shared openly under the MIT licence. The map is the FlyWire connectome. My part is running the model, checking it against the original, and showing what it does.
Meet the people behind the model ↓How to read this page
Every figure and number carries one of three tags, so you always know where it comes from.
Credits — the people behind the model
This project only exists because Philip Shiu, Gabriella Sterne, Nico Spiller and their colleagues, in work led by Kristin Scott, built the model and shared their code openly for anyone to run. Thank you.




02 — The map DATA
The FlyWire project reconstructed the whole brain of one adult female fruit fly from electron-microscope images: every neuron, and every synapse between them. The release used here (v630) has 127,400 neurons joined by about 14.7 million connections, made of 52.8 million synapses.
Each dot below is one of those neurons, placed where it sits in the real brain (positions from Schlegel et al. 2024, matched by neuron ID; 127,320 of the 127,400 have one). More than half of them are in the two optic lobes, the wide wings on either side, which handle vision. Taste and feeding live in the lower middle, in the subesophageal zone.
Seen from the front, with the fly’s right on your left. Drag sideways, or focus the picture and use the arrow keys, to turn it.
03 — Turning the map into a brain MODEL
Shiu and colleagues gave all 127,400 neurons the same simple rule, called leaky integrate-and-fire. Think of a bucket with a small hole. Incoming spikes pour charge in, the charge slowly leaks out, and if the level rises past a line the neuron fires a spike of its own and the bucket empties.
How hard one neuron pushes another depends only on how many synapses connect them, and on whether its chemical messenger excites or inhibits (GABA and glutamate count as inhibitory). Each synapse is worth 0.275 mV, the model’s one tuned number. There is no learning, no hormones and no spontaneous firing. That is the whole model.
The rule, as the model writes it
dv/dt = (v₀ − v + g) / τ_m dg/dt = −g / τ_s v > v_th → spike, v = v₀, g = 0 input spike → g += synapses × 0.275 mV
| Resting level v₀ | −52 mV |
| Firing line v_th | −45 mV |
| Leak time τ_m | 20 ms |
| Input decay τ_s | 5 ms |
| Rest after a spike | 2.2 ms |
| Travel delay | 1.8 ms |
| Time step | 0.1 ms |
Same equations and parameters as the full model. Too few inputs and the leak wins, so it never fires. In the real network each neuron’s inputs come from the neurons wired to it in FlyWire.
04 — Sugar in, spikes out MODEL
This is the paper’s own test. The 21 sugar-taste neurons (gustatory receptor neurons) get random spikes at 100 per second each for one simulated second, a stand-in for the fly touching sugar, and every spike anywhere in the brain is recorded.
The readout is MN9. Its firing drives the proboscis drawing beside the brain; how far a real proboscis moves for a given MN9 rate is not known, so that mapping is my choice and tagged APP. Switch to the second run to see the same input with two neurons silenced.
In the picture
A neuron firing a simulated spike
The 21 sugar-taste neurons (input)
MN9, the two motor neurons (output)
The two Roundup neurons, when silenced
Each flash is one simulated spike. Activity starts at the sugar-taste neurons in the lower brain.
05 — Silence two neurons MODEL
The model can switch any neuron off. Silencing, exactly as in the original code, removes everything a neuron sends: it can still fire, but nothing downstream hears it. I silenced Roundup, a cell type the paper places just before the motor neurons in the sugar-to-feeding pathway (two neurons, one per side), and repeated the same 10 trials.
The comparison is paired. Trial 3 of the silenced run received exactly the same random sugar input as trial 3 of the normal run, so each pair of bars differs only by the silencing.
Result, within this model
MN9: 65.5 → 24.7 spikes/s
A drop of 62%, lower in all 10 of 10 paired trials. The other MN9 fell harder, from 49.8 to 5.4 (−89%).
Does it match the paper?
Yes in direction. The paper calls Roundup “the pre-MN with the strongest predicted silencing phenotype”. This is a result inside the model, not a tested prediction about a living fly.
06 — From brain to behaviour HYBRID DEMO
The brain model only produces spikes. To see what they could mean for a fly, I connected it to a simple, hand-written walking controller in a small arena with two sugar patches. The fly wanders at random. When it stands on sugar, the 21 sugar neurons switch on. If MN9 then fires fast enough, the controller stops the fly to feed.
The walking and turning are mine, not the model’s: the wiring map has no nerve cord, so the brain cannot move legs. Only the decision to stop and feed comes from the simulated brain. Nothing learns, and a fly that finds sugar found it by chance.
Same seed, same random walk: until they reach sugar, both flies take exactly the same path. Off the sugar, the sugar neurons are silent and MN9 stays at 0.
07 — Under the hood
The project, which I call FlyBrain Arcade, is a small pipeline. It fetches the original model and its data, runs the whole brain fast enough to experiment with, measures the results honestly, and turns them into the pictures on this page. Pick a stage to see what it does and which files do it.
Stage 01 DATA
Downloads the published model at a pinned version (commit 91bdd1e) together with its FlyWire v630 files, about 200 MB, and checks each file’s SHA-256 fingerprint. The model’s parameters are read straight from the original code rather than typed in again, and a test checks them.
scripts/fetch_upstream.pyflybrain/upstream.py
Stage 02 DATA
Loads the connection table into a compressed sparse matrix: for each neuron, the list of neurons it talks to and how strongly (synapse count × ±1 × 0.275 mV). A second file holds the verified neuron IDs: the 21 sugar neurons, both MN9s, Roundup and the 106 feeding-region cell types from the paper’s own files.
flybrain/network.pyflybrain/neurons.py
Stage 03 MODEL
Two engines run the same model on all 127,400 neurons, with nothing pruned. The default is my Numba re-implementation, which compiles the update loop to machine code: one simulated second takes about 2.3 s on my laptop. The second engine runs the unmodified original Brian2 code, about 21 s per simulated second, and serves as the reference.
flybrain/engine_fast.pyflybrain/engine_brian2.py
Stage 04 MODEL
Switching on uses the original mechanism: each target neuron gets random kicks of 68.75 mV at the chosen rate, enough to make it fire. Switching off sets all of a neuron’s outgoing connections to zero, exactly like the original silence(). Settings are checked before a run: 0–200 spikes/s, up to 2 s and up to 30 trials.
flybrain/experiment.py
Stage 05 MODEL
Computes spike counts, firing rates and rate-over-time curves in 5 ms bins. Comparisons are paired: trial k of both runs uses the same random seed, so a difference comes from the intervention alone. Every result exports as CSV, JSON, SVG or PNG with a record of exactly how it was made.
flybrain/metrics.pyflybrain/runs.py
Stage 06 APP
Every 50 ms of simulated time: sugar under the fly sets the sugar neurons’ input rate, the brain runs, MN9’s rate becomes a stop-and-feed signal, and the hand-written controller moves the fly. The brain keeps its full state between windows, and a test proves that chopping a run into windows changes not a single spike.
flybrain/arena/
Stage 07 APP
A FastAPI server runs simulations in a background worker. The React and three.js app draws a 3D fly, the brain cloud with spike flashes and the arena; the frame at the top of this page comes from it. One script exports the precomputed runs that this page replays, so it needs no server.
flybrain/api.pyflybrain/jobs.pyfrontend/src/three/scripts/export_site_data.py
Stage 08
The same random input goes into the original Brian2 code and into my Numba version, and every spike of all 127,400 neurons is compared. They are identical in all four test runs. Against the results bundled with the paper’s code, firing rates agree with a correlation above 0.999. 44 automated tests pass.
scripts/validate_exact.pyscripts/validate_statistical.pybackend/tests/
Checked spike for spike against the original
| Test run | Original | Mine | Different |
|---|---|---|---|
| 200 ms, 100 Hz | 1,874 | 1,874 | 0 |
| 1 s, 100 Hz | 9,242 | 9,242 | 0 |
| 1 s, 200 Hz, Roundup silenced | 13,689 | 13,689 | 0 |
| 500 ms, 50 Hz, one Rattle silenced | 1,597 | 1,597 | 0 |
How fast, on a laptop
| Job | Time | Memory |
|---|---|---|
| 1 trial × 1 s, Numba | 2.3 s | 0.5 GB |
| 10 trials × 1 s, Numba | 4.5 s | 0.5 GB |
| 30 trials × 1 s, Numba | 9.1 s | 0.6 GB |
| 1 trial × 1 s, original Brian2 | 20.8 s | 3.1 GB |
08 — Honest limits
Sources and credits
Discussion
Register with your email to join the discussion
{{cm.err}}
{{cm.err}}
No comments yet. Be the first to share your thoughts.
{{c.text}}