Running the whole fly

A spiking simulation of the complete Drosophila central nervous system, six behavioural experiments, and the place where the model stops

← Back to Research
OngoingComputational neuroscienceUpdated October 10, 2026

The question

In September 2026 Janelia released MaleCNS: the first complete wiring diagram of a fly's brain and ventral nerve cord together, 164,606 neurons and about 6,234,901 connections carrying 90 million synapses. Two years earlier, Shiu and colleagues showed that an almost embarrassingly simple neuron model, the leaky integrate-and-fire (LIF), dropped onto a brain-only wiring diagram with a single fitted number, predicts which neurons fire when you feed the fly sugar, and matches real behaviour about nine times in ten.

Nobody had run that model on the whole nervous system. With the nerve cord attached, you can for the first time poke an identified sensory neuron and read out an identified motor neuron: the actual muscle command, not a proxy. So the question was simply: does the wiring alone, with no learning and one global weight, carry a signal from sense organ to muscle across the entire fly? And if so, which behaviours does it get right, which does it get wrong, and where does the approach itself break?

Overview: every neuron drawn at its soma position (brain left, nerve cord right), glowing when it spikes. Rest condition, then the weight problem, then a preview of each experiment. 47 s.

Setup

The model

Every neuron is a leaky integrate-and-fire unit with Shiu et al.'s 2024 parameters copied verbatim: resting and reset potential −52 mV, threshold −45 mV, membrane time constant 20 ms, synaptic time constant 5 ms, refractory period 2.2 ms, 1.8 ms conduction delay, 0.1 ms time step. Each connection's strength is one global weight × the number of synapses in the reconstruction. Its sign comes from the presynaptic neuron's predicted neurotransmitter: acetylcholine excites, GABA and glutamate inhibit, everything else is treated as excitatory. There is no learning, no neuromodulation, no gap junctions, no dendrites. Edges with fewer than 5 synapses are dropped (3 and 10 are tested in E5).

The engine is a custom PyTorch sparse implementation running on one RTX A6000: the full 164,606-neuron network takes under 0.1 GB of GPU memory and runs at about a third of real time. Before trusting it we checked it spike-for-spike against Brian2, the standard reference simulator, on a 4,000-neuron subgraph downstream of the taste neurons: 3,675 spikes in both, identical timing.

Figure 1. The anatomy the simulation runs on. Brain (left) and ventral nerve cord (right), every soma plotted, coloured
Figure 1. The anatomy the simulation runs on. Brain (left) and ventral nerve cord (right), every soma plotted, coloured by class. The bridge between them is 3,770 descending and ascending neurons; there are zero direct cord→brain connections in the dataset.
Figure 2. Engine validation. The torch LIF (ours) against Brian2 on a 4,000-neuron / 148k-edge subgraph: identical spike
Figure 2. Engine validation. The torch LIF (ours) against Brian2 on a 4,000-neuron / 148k-edge subgraph: identical spike count and identical raster.

The one number, and why it doesn't transfer

Shiu's single fitted parameter is the per-synapse weight, 0.275 mV. We expected to inherit it. We couldn't. MaleCNS is a denser reconstruction than the FlyWire brain it was fitted on, and at 0.275 mV any input at all ignites the whole network: the sugar experiment lit up 15,508 neurons and 1,324,213 spikes in a second, and activity re-ignites itself 300 ms after the input stops. At 0.15 mV the same input drives 728 neurons and 69,632 spikes, the network falls silent when the input stops, and the rest condition is silent (0 spikes in 500 ms). Every result below uses 0.15 mV, and E5 tests 0.12 and 0.20 as well.

Figure 3. The weight problem. Shiu's 0.275 mV (left) versus 0.15 mV (right) on the same sugar input. The published numbe
Figure 3. The weight problem. Shiu's 0.275 mV (left) versus 0.15 mV (right) on the same sugar input. The published number does not transfer to a denser reconstruction; this is the one free parameter and it had to be re-fitted.
How every result is judged. A claim counts only if (a) the rest condition is silent, (b) a degree-preserving shuffle of the wiring, which keeps every neuron's in- and out-degree but scrambles who connects to whom, kills the effect, and (c) the effect survives all nine combinations of edge threshold {3, 5, 10} × weight {0.12, 0.15, 0.20} mV. E5 below is that test applied to every claim.

E1 · Taste → feeding

The replication. Sugar-sensing neurons on the labellum are driven at 150 Hz and the readout is MN9, the motor neuron of the proboscis-extension muscle, plus the second-order taste neurons Shiu named (Rattle, Usnea, Zorro, Phantom, Fudog for sugar; Scapula for bitter). MaleCNS names taste neurons by sensillum rather than receptor, so sugar/bitter identity had to be resolved by connectivity first: LB3a–d project 21–37 % of their output onto the sugar second-order cells, LB1a–d onto bitter.

conditionMN9 (Hz)RattleScapulaspikesactive neurons
rest0.0——00
sugar41.851.70.069,632728
sugar + bitter0.048.7153.3289,1245,265
bitter alone0.00.0170.465,403635
sugar, shuffled wiring0.00.0—37,684273

Sugar drives MN9 (41.8 Hz; one of the two MN9 cells fires at 83.7 Hz, the other is silent, which is itself a prediction). Adding bitter input silences MN9 completely while the sugar pathway (Rattle) stays active: the veto happens downstream of the sensory neurons, in the circuit, exactly as in the real fly. Shuffled wiring: nothing. All three claims are robust across all nine E5 settings.

Figure 4. E1 taste. Sugar → MN9 (feeding), bitter veto, and the shuffle control, from the result files.
Figure 4. E1 taste. Sugar → MN9 (feeding), bitter veto, and the shuffle control, from the result files.
E1 animated: the taste input enters at the labellum, activity propagates through the gnathal ganglion to MN9; then the bitter veto and the shuffle, side by side. 43 s.

E2 · Looming → escape

The first brain-to-cord result. The looming-sensitive visual projection neurons LC4 and LPLC2 (311 cells) are driven at 100 Hz, standing in for an object expanding on the retina. The readouts are the Giant Fibre (DNp01, the famous escape neuron), and in the nerve cord the jump muscle motor neuron TTMn and the wing depressor motor neurons DLMn.

conditionGiant Fibre DNp01 (Hz)TTMn jump (Hz)DLMn wing (Hz)TTMn first spike
looming248.053.374.518.5 ms
looming, Giant Fibre silenced247.7 (silenced output)22.068.750.0 ms
looming, shuffled wiring0.00.00.1—

Looming drives the Giant Fibre hard and both motor pools fire within 20 ms, with the jump command (TTMn) arriving after the wing command (DLMn), which is the right order for a take-off. Then the interesting part: silencing the Giant Fibre cuts TTMn from 53.3 to 22.0 Hz but leaves DLMn almost untouched (74.5 → 68.7 Hz), and delays the first TTMn spike from 18.5 to 50.0 ms. The Giant Fibre is not the only road from eye to muscle. Real flies have a fast GF-mediated escape and a slower, GF-independent one; the wiring reproduces both. E6 traces the second road.

Figure 5. E2 escape: motor neuron rates and first-spike latencies for intact, Giant-Fibre-silenced, GF+AN19B001-silenced
Figure 5. E2 escape: motor neuron rates and first-spike latencies for intact, Giant-Fibre-silenced, GF+AN19B001-silenced (from E6), and shuffled wiring.
E2 animated: looming input in the lobula, Giant Fibre descending, jump and wing motor neurons in the cord; then GF silencing and the shuffle. 36 s.

E3 · Steering

Can one descending neuron on one side bias the nerve cord to that side? DNa01, DNa02 (turning) and DNp09 (walking) are each driven on the right only, and the readout is the total spike output of the ~700 nerve-cord motor neurons split by side, summarised as an index (R − L)/(R + L): +1 means all right, 0 means symmetric.

right-side driverVNC output L (Hz, summed)VNC output Rindex (R−L)/(R+L)
DNa01118.3690.3+0.71
DNa01, shuffled49.718.0-0.47 (output 67.7 vs 808.7 intact)
DNa0291.0453.0+0.67
DNa02, shuffled159.3160.3+0.00
DNp09 (walk)848.7425.3-0.33

The turning neurons bias the cord strongly to their own side (0.71 and 0.67), which is what a turn command should do. Shuffling the wiring collapses the total nerve-cord output to a few percent of intact, so the shuffled index is noise from a handful of cells and the criterion for "shuffle kills it" is output < 25 % of intact or |index| < 0.3. The walking neuron DNp09 comes out slightly contralateral (-0.33); it was predicted bilateral, and that claim failed E5 at the working weight, so it is reported as not robust.

Figure 6. E3 steering: nerve-cord motor output by side for each unilateral driver and its shuffle.
Figure 6. E3 steering: nerve-cord motor output by side for each unilateral driver and its shuffle.
E3 animated: one descending neuron driven on the right; the cord lights up on the right. 30 s.

E4 · Courtship song

The experiment that needs a male and a nerve cord, which no previous dataset had. P1 neurons, the male-specific courtship command cells, are driven at 150 Hz. The circuit in the literature runs P1 → pIP10 (descending) → dPR1 (cord) → wing motor neurons (hg1–4, ps1) that produce the pulse song.

conditionpIP10 (Hz)dPR1hg1–4 wing MNsps1 wing MN
P1 driven91.087.257.358.8
P1 driven, pIP10 silenced111.2 (silenced output)55.220.739.5
P1 driven, shuffled wiring0.00.00.00.0

The whole chain fires, brain to wing muscle, and the shuffle kills every stage. But as with escape, silencing the textbook relay (pIP10) only reduces the wing motor neurons, to roughly a third of intact; it does not abolish them. There is a second route into the song circuit. Honest caveat: the motor loop is open (no wings, no proprioception), so this shows song initiation, not the 30 ms pulse rhythm.

Figure 7. E4 song: every stage of the P1 → wing-muscle chain, intact, with pIP10 silenced, with pIP10 + pMP2 silenced (f
Figure 7. E4 song: every stage of the P1 → wing-muscle chain, intact, with pIP10 silenced, with pIP10 + pMP2 silenced (from E6), and shuffled.
E4 animated: P1 in the brain, pIP10 descending, dPR1 and the wing motor neurons in the cord. 45 s.

E5 · Robustness: 162 runs and a verdict table

Every claim above was re-run across the full grid, edge threshold {3, 5, 10} synapses × weight {0.12, 0.15, 0.20} mV, with the shuffle control at every setting. A claim is robust only if it passes all 9 and the shuffle fails all 9. 12 of 19 claims survive.

claimsettings passshuffle killsverdictfails at
E1 sugar -> MN9 fires (>5 Hz)9/99/9robust
E1 sugar: Rattle on, Scapula off9/9n/arobust
E1 bitter suppresses MN9 (<25% of sugar)9/9n/arobust
E2 looming -> GF (>100 Hz)9/99/9robust
E2 looming -> TTMn & DLMn (>5 Hz)9/99/9robust
E2 GF silenced -> TTMn reduced (<75% of intact)9/9n/arobust
E2 GF silenced -> TTMn abolished (<25%)4/9n/anot robustmin3/w0.15; min3/w0.2; min5/w0.15; min5/w0.2; min10/w0.2
E2 GF silenced -> DLMn unchanged (>75% of intact)9/9n/arobust
E4 P1 -> pIP10 & dPR1 (>20 Hz)9/99/9robust
E4 P1 -> hg1-4 & ps1 wing MNs (>5 Hz)9/99/9robust
E4 pIP10 silenced -> wing MNs reduced (<75%)9/9n/arobust
E4 pIP10 silenced -> wing MNs abolished (<25%)0/9n/anot robustmin3/w0.12; min3/w0.15; min3/w0.2; min5/w0.12; min5/w0.15; min5/w0.2; min10/w0.12; min10/w0.15; min10/w0.2
E6 GF+AN19B001 silenced -> DLMn abolished (<10% of intact)6/9n/anot robustmin3/w0.2; min5/w0.2; min10/w0.2
E6 GF+AN19B001 silenced -> TTMn <25% of intact6/9n/anot robustmin3/w0.2; min5/w0.2; min10/w0.2
E6 pIP10+pMP2 silenced -> wing MNs abolished (<5% of intact)8/9n/anot robustmin3/w0.2
E3 DNa01_R -> ipsilateral VNC (index > 0.3)9/99/9robust
E3 DNa02_R -> ipsilateral VNC (index > 0.3)9/99/9robust
E3 DNp09_R -> bilateral VNC (|index| < 0.3)6/9n/anot robustmin3/w0.15; min5/w0.15; min10/w0.15
Network stays bounded (<5% of neurons active)6/9n/anot robustmin3/w0.2; min5/w0.2; min10/w0.2

The pattern in the failures is informative. The two "abolished" claims fail because the alternate routes found in E6 carry a third of the signal regardless of parameters. The "network stays bounded" and E6 double-silencing claims fail only at 0.20 mV, where the model is back in the runaway regime, which is why 0.15 mV is the working point and 0.20 is treated as out of range rather than as evidence against the circuit.

Figure 8. E5 verdict grid: each cell is one (threshold, weight) setting; green passes, orange fails.
Figure 8. E5 verdict grid: each cell is one (threshold, weight) setting; green passes, orange fails.
E5 animated: the sweep grid filling in and the verdict card. 59 s.

E6 · The second routes

When silencing the textbook hub doesn't abolish the output, what is carrying it? For each silenced run we ranked every neuron type still exciting the target motor neurons by drive = its firing rate × its signed synaptic weight onto them, then confirmed by silencing the top candidate on top of the hub.

Escape without the Giant Fibre

With DNp01 silenced, a third of the remaining excitation onto the jump and wing motor neurons comes from AN19B001: four cholinergic ascending neurons in the cord firing at 124 Hz, themselves driven by the looming detectors LC4 (31 % of their input) and the escape descending neurons DNp02, DNp04, DNp06 and DNp11. Silencing the Giant Fibre and AN19B001 takes TTMn from 53.3 to 6.5 Hz and DLMn from 74.5 to 0.8 Hz. That is the second escape road: a parallel descending set converging on a cord interneuron that distributes to the same muscles.

Song without pIP10

With pIP10 silenced, dPR1 is still driven at 55 Hz, 17.5 % of it from pMP2, two cholinergic descending neurons that also drive the other song-related cord types dMS2, vMS12 and TN1a. Silencing pIP10 and pMP2 together takes dPR1, hg1–4 and ps1 all to 0 Hz. Both double-silencings are robust at 0.12 and 0.15 mV and fail only in the runaway regime.

Caveat on E6. AN19B001 and pMP2 are model-derived candidates. They have not yet been checked against the experimental literature; if either has been characterised as a GF- or pIP10-independent pathway, this is a replication; if not, it is a prediction a Gal4 line could test.
Figure 9. The two parallel routes. Left: escape via the Giant Fibre and via DNp02/04/06/11 → AN19B001. Right: song via p
Figure 9. The two parallel routes. Left: escape via the Giant Fibre and via DNp02/04/06/11 → AN19B001. Right: song via pIP10 and via pMP2. Widths are the drive fractions from the silenced runs.

Phase 7 · Showing the fly a picture, and where it stops

Everything above drives named neurons directly. The obvious next question was whether we could give the simulated fly an image, let its own retina and optic lobe do the work, and watch what gets through. MaleCNS annotates the hexagonal column of every optic-lobe cell, which gave us a map of 892 ommatidia per eye, a viewing direction for each, and column assignments for the photoreceptors and all 13,579 T4/T5 motion-detector cells. Validated against the Mi1 soma sheet: R² 0.92. An image is projected onto that hexagonal retina, blurred by the 5° acceptance angle of a fly ommatidium, and converted to firing rates.

Figure 10. The stages, from a synthetic hawk-against-sky scene: photograph → 892-ommatidium luminance → ON and OFF contr
Figure 10. The stages, from a synthetic hawk-against-sky scene: photograph → 892-ommatidium luminance → ON and OFF contrast maps in the medulla → motion detectors → feature detectors → Giant Fibre. The first three stages work; stage four stalls.

Where it stopped

Stages one to three work. The image is legible on the eye and splits into ON (Mi1) and OFF (Tm1) edge maps, the real first computation of the fly's medulla. Then the motion detectors T4 and T5, which should respond to the image moving across the eye, fire at essentially zero (0.00 Hz T4a, 0.11 Hz T5c on the photograph), and the looming detectors LC4/LPLC2 sit at 1.2 Hz for a looming disc and 1.3 Hz with shuffled wiring: indistinguishable from noise. A looming disc reaches the Giant Fibre at 2 Hz (shuffle: 0, but the shuffled network fires DNp04/DNp11 at 12 Hz instead), against the 248.0 Hz we get driving LC4 directly in E2. Nothing from pixels is a reportable result.

Figure 11. Why. Measured excitatory and inhibitory synaptic drive onto each medulla cell type when the lamina is driven
Figure 11. Why. Measured excitatory and inhibitory synaptic drive onto each medulla cell type when the lamina is driven by the picture. Mi1, the first ON-pathway cell, receives more inhibition than excitation and cannot fire.

The reason is structural, and it is the most useful thing Phase 7 produced. A fly photoreceptor releases histamine, which inhibits the lamina; the lamina neurons L1 and L2 depolarise when light goes off. The whole ON pathway is then built on disinhibition: L1 stops inhibiting Mi1. A rate-coded integrate-and-fire neuron with no tonic firing cannot express "less inhibition". Measured directly, Mi1 receives +0.26 mV/ms of excitation against −0.48 mV/ms of inhibition and never crosses threshold. The sensorimotor circuits in E1–E6 worked because they are feed-forward chains of excitation. Early vision is push-pull and sign-inverting, and it is exactly where "structure dominates neuron model" stops being true. We did not fix this by raising the weight until T4 fires; that re-enters the runaway regime. The fix is per-cell-type gain training with the wiring frozen, as in Lappalainen et al. 2024, and that is the next step once GPU time allows.

The parts of the pipeline that do work, the eye and the ON/OFF maps, make pictures worth looking at. Each row below is one image: the original, what 892 ommatidia sample, the fly's colour (no red receptor, and no UV in a normal photograph), then the OFF and ON edge maps, which are the actual Tm1 and Mi1 firing after a 400 ms run of the entire nervous system on that image.

Figure 12. Photographs by Greg Robison through the fly's eye. The puppy portraits are the clearest demonstration: the OF
Figure 12. Photographs by Greg Robison through the fly's eye. The puppy portraits are the clearest demonstration: the OFF cells land on the eyes and nose, the ON cells on the bright fur, with nothing scripted.
Figure 13. Paintings: three by Freda Lee (fredalee.com), then the Mona Lisa and The Starry Night. The cypress in Starry
Figure 13. Paintings: three by Freda Lee (fredalee.com), then the Mona Lisa and The Starry Night. The cypress in Starry Night survives the OFF channel almost intact.

Flies see ultraviolet, and a camera does not. The top row of Figure 14 is a real reflected-UV photograph of winter jasmine by Dave Kennard (Wikimedia Commons, CC BY-SA 3.0): the flower's centre goes black in UV, a landing target invisible to us. The bottom row is a generated black-eyed Susan with the documented UV bullseye for the species painted on as a reflectance model, labelled as such. To display UV we put it in red, the channel the fly lacks; so orange in the "with UV" tiles is a convention, not a colour the fly experiences.

Figure 14. Adding the UV channel. Top: real UV photograph (Kennard, CC BY-SA 3.0). Bottom: modelled UV bullseye. Right-h
Figure 14. Adding the UV channel. Top: real UV photograph (Kennard, CC BY-SA 3.0). Bottom: modelled UV bullseye. Right-hand tiles: fly colour without and with UV.
The eye scanning the modelled flower: fixate, saccade, fixate, with the whole nervous system running continuously and the input recomputed every 2 ms. Top: scene with footprint and gaze trail, ommatidial luminance, fly colour with UV. Bottom: OFF edges, ON edges, and the motion detectors, which stay at zero (see Phase 7). Playback is ¼ real time; 24 s.

What this is and isn't

  • It is a structural hypothesis generator, not a fly. No neuromodulation, gap junctions, dendritic computation or plasticity. Neurotransmitter predictions are ~85–90 % accurate, so a mis-signed hub neuron can flip a result.
  • The motor loop is open. No body, no proprioceptive feedback. E3 and E4 show the initiation of a turn or a song, not a sustained rhythm.
  • One global weight. It had to be re-fitted for this dataset (0.15 mV, not Shiu's 0.275), and results at 0.20 mV are discounted as runaway rather than counted against the circuit.
  • Vision is the limit of the approach. Phase 7 shows that the first two synapses of fly vision cannot be carried by a rate LIF on wiring alone; anything about what the fly "sees" waits on gain training.
  • Two neurons await literature. AN19B001 and pMP2 are model-derived and unverified.

Changelog

  • 2026-10-10 — Page created. Correction logged: an earlier internal draft reported the pixel-driven looming → Giant Fibre rate as 27 Hz; the current result files say 2 Hz. The 27 came from a run before a contrast-floor fix and had been carried in prose rather than re-read. All numbers on this page are generated from the result files at build time.
  • 2026-10-09 — Gallery, UV channel, eye-scanning video; Phase 7 built and the ON-pathway sign problem measured.
  • 2026-10-03 — E5 sweep extended to 162 runs with verdicts; E6 route tracing; export and figures.
  • 2026-09-19 → 10-01 — Engine, Brian2 validation, weight re-fit, E1–E4, explainer videos.
Simulation, analysis, figures, videos and this page by Hermes, the lab's AI agent, on the lab's own hardware (one RTX A6000). Greg Robison designed the study and reviews everything before it goes live. Every number above is read from the simulation's result files when the page is built. Data: Janelia MaleCNS v1.0. Model: Shiu et al., Nature 2024. Gain-training reference: Lappalainen et al., Nature 2024. Photographs © Greg Robison; paintings © Freda Lee, used with permission; UV jasmine photograph by Dave Kennard, CC BY-SA 3.0.