How it works
How a fruit fly brain simulation works: the FlyWire connectome, neuron models and bodies
Every digital fly project has the same basic loop. Something goes in, a model of the brain turns it into activity, and something comes out. What matters is which parts of that loop come from the real fly and which parts a person added.
The sense → model → act loop
- MeasuredTaken from the real animal. In most projects this is only the wiring: which neurons connect, and through how many synapses.
- ModelledA mathematical rule chosen by scientists, such as how a neuron adds up its inputs and when it fires. It is a simplification of real biology.
- Hand-madeChosen by the project author: which neurons receive the input, which neurons are read out, and what counts as an action.
- TrainedLearned by a machine learning method, for example a readout layer or a controller trained to reach a goal.
- ScriptedOrdinary program code or animation that does not depend on the simulated neurons.
A project can use a real connectome and still get most of its visible behaviour from hand-made or scripted parts. That is why we grade each project separately. See Is it real? Whether the measured wiring itself makes a difference is a separate question, tested by scrambling it: Does fly wiring help? compares 31 such studies.
What a connectome is
A connectome is a map of the connections in a nervous system: which neurons exist, which neurons connect to which, and how many synapses join them. Fly connectomes are traced from electron microscope images of one animal, cut into thousands of very thin slices. Computers and human proofreaders follow each neuron through the images.
A connectome is a wiring diagram, not a working brain. It does not say directly how strong each connection is, how neurons change with learning, or how chemicals such as hormones change activity. A simulation has to add those parts, usually with simple rules.
Map or brain? Run with such a model, the map still does something specific to its wiring. In our own looming test (5 Oct 2026) a shadow on one eye made the real map's turning neurons fire on the far side and turned a simulated fly away in 4 of 4 runs; scrambled maps with the same number of connections per neuron stayed silent (0 of 3). One model, open loop, our hand-made mapping, a constant external walking drive, 1 s; not a real fly.
What the whole-brain models add, and what they leave out
Most projects reuse the leaky integrate-and-fire (LIF) model of Shiu et al. (Nature, 2024). In that model, and in most copies of it:
- Connection strength comes from synapse counts. Each connection's weight is its FlyWire synapse count multiplied by one free number. The authors chose that number by hand so that sugar-sensing neurons firing at 100 Hz drive the proboscis motor neuron MN9 to about 80% of its maximum.
- Excitation or inhibition comes from predicted transmitters. The sign of each connection comes from a machine-learning prediction of the neurotransmitter, not from a measurement of each synapse.
- Many parts of biology are missing. In the authors' words, the model "does not account for gap junctions, non-spiking neurons, internal state or long-range neuropeptides, and assumes that the basal firing of each neuron is zero". Neuromodulation and learning (plasticity) are not in the base model.
- It is slow on a normal computer. The paper reports about 5 minutes per simulated second per CPU thread for the Brian2 version.
Source: Shiu et al. 2024, Methods and Discussion (full text on PubMed Central).
Datasets compared: FlyWire connectome, MaleCNS, BANC and others
Different teams have mapped different flies and different parts of the nervous system. Always read a neuron count together with its dataset, version and scope. Never add a brain count to a nerve-cord count from a different animal.
| Dataset | Animal and scope | Neurons (release) | Connections | How to get it | Data licence | Main paper |
|---|---|---|---|---|---|---|
| FlyWire FAFB (Female Adult Fly Brain) Entry flywire-fafb |
Adult female; whole brain including both optic lobes; no nerve cord | 139,255 in public release v783 (Oct 2023 snapshot). 127,400 proofread neurons in v630, used by the Shiu et al. model | 3,732,460 neuron pairs at 5 or more synapses (Codex default); "50 million" synapses in the headline | Codex (Google sign-in for apps and downloads); CAVEclient; the Shiu model repository ships v630 and v783 files (about 87 MB and 101 MB) | CC BY-NC 4.0 Non-commercial only. "FlyWire's public release data is made available under license CC BY-NC 4.0" (flywire.ai/guidelines). Cite Dorkenwald et al. 2024 and Schlegel et al. 2024. |
Dorkenwald et al., Nature 2024 (doi); Schlegel et al., Nature 2024 (doi) |
| MaleCNS (Male Central Nervous System) Entry malecns |
Adult male; whole central nervous system: brain, optic lobes and nerve cord, with the neck intact | 166,700 in v1.0 (released 8 Jun 2026). 166,691 in the v0.9 preprint. 165,122 fully traced neurons in v1.0, the subset many simulators load | 6,242,118 at 5 or more synapses (Codex); "125 million synaptic connections" (Google Research) | neuPrint (account token); neuprint-python; bulk files from male-cns.janelia.org; Codex | CC BY 4.0 "The Male CNS dataset is licensed under CC-BY." Commercial use allowed with attribution. |
Berg et al., Cell 2026, published 3 Sep 2026 (doi) |
| BANC (Brain And Nerve Cord) Entry banc |
Adult female; brain and nerve cord in one animal; lamina and ocellar ganglion missing | 158,262 in v888 (Codex). 155,916 in the Nature paper (analyses on v626). The project README says "approximately 188,000"; its scope is not stated (unresolved) | 3,037,361 at 3 or more synapses (Codex v888) | Codex; Harvard Dataverse deposit | CC BY 4.0 for the Dataverse data The analysis repository has no licence file, although its README says CC BY 4.0. |
Bates, Phelps, Kim, Yang et al., Nature 2026 (doi) |
| MANC (Male Adult Nerve Cord) Entry manc |
Adult male; nerve cord and neck connective only | 23,665 in v1.2.1 (Codex) | 5,305,638 at 1 or more synapse (Codex) | neuPrint; public Google bucket; Codex | CC BY (version not stated) "The MANC is licensed under CC-BY." (Janelia) |
Takemura et al., eLife 2024; Marin et al.; Cheong et al. |
| Hemibrain Entry hemibrain |
Adult female; part of the central brain (most of the right half), no optic lobes, no nerve cord | About 25,000 in v1.2.1 | About 20 million synapses (widely quoted; not re-checked) | neuPrint; neuroglancer | CC BY (version not stated) "Hemibrain is licensed under CC-BY." (Janelia) |
Scheffer et al., eLife 2020 (doi) |
| FANC (Female Adult Nerve Cord) Entry fanc |
Adult female; nerve cord | About 14,600 cell bodies in the paper (search summary only, not verified) | About 45 million synapses (search summary only) | Latest reconstruction restricted to authorised users; electron-microscope images public via BossDB | No open data licence found Access follows the FANC community rules. The tool code is GPL-3.0. |
Azevedo, Lesser, Phelps, Mark et al., Nature 2024 (doi) |
| Larval L1 brain Entry larva-l1 |
First-instar female larva, 6 hours old; brain only | 3,016 (480 input neurons and 2,536 brain neurons) | About 548,000 synaptic sites | Paper supplementary files; CATMAID hosted by Virtual Fly Brain; code on Zenodo | Article CC BY 4.0 No separate data licence found; treat with care. |
Winding et al., Science 2023 (doi) |
Codex also lists MAOL v1.1 (male right optic lobe, 52,445 neurons). It comes from the same male fly as MaleCNS, so its neurons are part of MaleCNS, not extra.
Sources: Codex, FlyWire guidelines, male-cns.janelia.org, BANC project, Virtual Fly Brain neuron counts, Winding et al. 2023, Google Research blog.
Why the neuron counts differ
News stories quote many different neuron counts. Each one belongs to a specific dataset, version and scope:
| Number | What it actually is |
|---|---|
| "more than 125,000" | Rounded headline for the FlyWire brain in the Shiu et al. 2024 abstract |
| 127,400 | Proofread neurons in FlyWire v630; all are simulated in the Shiu et al. model |
| 127,978 | FlyWire count in the bioRxiv preprint, before more proofreading |
| 138,639 | Neurons in the v783 input file of the Shiu model repository; what most "FlyWire v783" simulations run |
| 139,255 | FlyWire public release v783, whole brain including optic lobes |
| "140K" | Rounded figure on flywire.ai |
| 165,122 | MaleCNS v1.0 neurons with status "Traced" (fully proofread), out of 211,577 annotated bodies. Counted by a community project from the official files; not re-counted by us |
| 166,691 | MaleCNS preprint (v0.9) |
| 166,700 | MaleCNS v1.0 in Codex |
| "over 166,000" | Rounded headline on the Google Research blog |
Still unexplained: 616 neurons. The Shiu repository's v783 file has 138,639 neurons, while the v783 release has 139,255. We have not found out why. One possible reason is that neurons without connections in the exported table were dropped, but this is not verified.
What you have to download, and how big it is
On 6 Oct 2026 we read the size, checksum, licence and access rule of every file in 8 releases (403 files) from each host's own storage metadata, without downloading the data. To run the Shiu et al. model you need two files, 104.1 MB; a full release is gigabytes to hundreds of gigabytes. How to get the two files: Build your own.
| Release | Files | Size | Checksum | Licence | Access |
|---|---|---|---|---|---|
| Our beginner path: the Shiu et al. repository copies at commit 91bdd1e7 | 2 | 104.1 MB Connectivity_783.parquet 100,804,642 B; Completeness_783.csv 3,327,347 B | None published; our sha256: efeb23fb… and bbb847a4… | FlyWire data (the stricter reading: CC BY-NC 4.0); the repository's MIT licence covers the code, not the data. | Open |
| FlyWire FAFB v783, the official files (Zenodo) | 5 | 10.6 GB every synapse 9.5 GB; proofread connections 852,022,274 B | MD5 per file (Zenodo) | Zenodo record: CC BY 4.0; flywire.ai guidelines: CC BY-NC 4.0. Conflict, unresolved: we follow the stricter, non-commercial reading. | Open |
| FlyWire Codex download page | – | not checked | – | Zenodo record: CC BY 4.0; flywire.ai guidelines: CC BY-NC 4.0. Conflict, unresolved: we follow the stricter, non-commercial reading. | Sign-in; the files listed there were not read |
| FlyWire neuron annotations (Schlegel et al., commit a83b2776) | 1 | 31.7 MB 31,720,298 B | None published; our sha256: b214970b… | Not stated in the repository; the FlyWire data behind it: as above. | Open |
| MaleCNS v1.0 flat connectome (brain and nerve cord of a male fly) | 11 | 31.3 GB wiring only (traced): 508,025,642 B | MD5 + CRC32C (Google Cloud Storage) | CC BY 4.0 | Open |
| BANC v888 (brain and nerve cord, Harvard Dataverse, version 3.0) | 379 | 536.1 GB 227.8 GB open (102 files); 308.3 GB in 277 influence-matrix chunks on request | MD5 per file (Dataverse) | CC BY 4.0 | 102 open, 277 on request |
| hemibrain v1.2 compact connection summary | 1 | 45.9 MB 45,872,577 B; the page's newest flat file is v1.2, neuPrint serves v1.2.1 | MD5 + CRC32C (storage header) | CC BY 4.0 | Open |
| MANC v1.2.1 (male nerve cord) | – | Not stated: the bucket was not listed (our request limit was reached) | Not checked | CC BY 4.0 | Open (public bucket) |
| FANC (female nerve cord) | – | No public bulk file | – | No open licence found (community access rules) | Community rules |
| Larva L1 brain (Winding et al. 2023, Science) | – | Not stated: the supplement page answered with a robot check, the mirror timed out | None published | Article CC BY 4.0; no separate data licence found | Open |
The FlyWire licence question is open. The Zenodo record of FlyWire v783 says CC BY 4.0 (reuse with credit, also commercially). FlyWire's own guidelines page says its public release data is CC BY-NC 4.0 (credit, and non-commercial use only). We have not resolved the conflict, so we follow the stricter reading: non-commercial, with credit, until FlyWire says otherwise. This is not legal advice. MaleCNS, BANC, hemibrain and MANC state CC BY 4.0.
Neuron models and engines
The neuron model decides how activity moves through the wiring. Most projects use the Shiu et al. LIF model or a copy of it on faster hardware. Numbers below come from the code and from the authors; we did not re-run them.
| Model or engine | What it is | Data | Key facts from the code | Grade |
|---|---|---|---|---|
| Shiu et al. Drosophila_brain_model | Whole-brain LIF model in Brian2 | FlyWire v630 (default); v783 files included | Threshold −45 mV, reset −52 mV, membrane time constant 20 ms, one weight scale of 0.275 mV per synapse. Python 3.10 and Brian2 2.5.1. Last commit 14 Sep 2024 | A |
| drosophila-brain-mlx | The same model on Apple MLX (Mac GPU) | FlyWire v630; MaleCNS v1.0 | With real wiring MN9 fires at 67.30 Hz; with shuffled wiring at 0 Hz. About 0.29 s per simulated second on an M4 Pro, against 2.07 s for Brian2 (author's figures) | A |
| flyvis | Trained rate model of the fly's motion-vision pathway | FlyEM FIB-25 and FIB-19 optic-lobe columns (not FlyWire) | Synapse counts and signs fixed from the connectome; time constants and some scales trained on optic flow | A |
| Eon fly-brain | The Shiu model on six engines, with speed comparisons | FlyWire v783 | Engines agree closely (16,418 to 17,429 spikes for the same 1 s sugar test). Brain only; no body code | n/a |
| fasterfly | GPU kernels that simulate many flies at once | MaleCNS v1.0 | 51,159 fly-steps per second for 64 flies on an RTX 3090 (author). Own simplified constants; no licence file | n/a |
| dotFly | C# and .NET version of the Shiu LIF model | FlyWire v630 and v783; MaleCNS v1.0 | Matches Brian2 spike for spike in its tests; its room demo is mostly a hand-written decoder | C |
| Loihi 2 fly brain (Sandia) | The Shiu model on 12 neuromorphic Loihi 2 chips | FlyWire | Compared with Brian2 only; about 3 to 350 times faster in the preprint. No code link found | U |
Bodies: NeuroMechFly (FlyGym) and flybody
A brain model alone does not move. To walk, groom or fly, a project needs a simulated body with legs, joints and physics, and a way to connect neurons to muscles.
| Body | What it gives you | Versions and requirements (from the code) | Licence |
|---|---|---|---|
| NeuroMechFly (FlyGym), EPFL | A MuJoCo fly body with vision, smell, leg adhesion and joint sensing. No brain: you write the controller. | v2.1.0 (24 Jun 2026) is a full rewrite; code written for FlyGym 1.x will not run without changes (the old API moved to flygym-gymnasium). Python 3.12 to 3.14. Optional NVIDIA GPU extra | Apache-2.0 |
| flybody, Turaga lab and DeepMind | A detailed MuJoCo body with walking and flight policies trained by reinforcement learning. These are ordinary neural networks, not the connectome. | Last release v0.1.0 (16 May 2024); last default-branch commit 30 Jul 2025. The TensorFlow extra pins Python 3.10 in practice | Apache-2.0 |
Every embodied connectome demo we inspected needs extra machinery between brain and body: pre-trained or pre-programmed walking controllers, fitted rhythm generators, or trained gains. None of the brain datasets alone makes a fly walk.
Measured: who does the walking when a brain drives a body
On 2 Oct 2026 we measured this split ourselves. We connected the Shiu et al. whole-brain model to FlyGym's walking fly, stimulated the brain's forward-walking neurons (P9) and turned its descending neurons' rates into FlyGym's two-number walking drive with a rule we wrote. Each stage of the loop above did a different part of the work:
The result: the fly walked 13.9 mm in 1 s with the real brain, 14.1 mm with a scrambled brain and 14.3 mm with no brain. The legs, rhythm and balance were FlyGym's; the brain added turning commands. Chart, controls and limits: Who does the walking?; build it: Add a body.
Measured: who does the turning when a looming shadow appears
On 5 Oct 2026 we added a sense. We showed a looming shadow to one eye of the same brain model (every LC4 and LPLC2 neuron of that eye, the fly's looming detectors), held the walking drive constant ourselves, and let the brain's turning neurons steer. This time the brain's wiring decided which side's turning neurons fired; the walking was still FlyGym's, and the rule from rates to legs, which turns that side into a direction, was still ours:
The result: the real map turned the fly away in 4 of 4 runs, scrambled maps in 0 of 3 (their drives were the same as no brain). Small n, much quieter scrambled brains, and a direction that rests on our mapping (our caption, fixed before the test: "fly67's claim; the direction in real flies was not verified by us.") Chart and caveats: We ran the map; build it: Add a sense: looming.
Where in the map the turn runs
On 6 Oct 2026 we looked inside the brain model (no body). The looming detectors have no direct synapses onto the turning neurons DNa02: their signal reaches the far-side DNa02 through relay neurons, the strongest being PVLP141 on the eye's side. They do synapse directly onto the giant fibre, the escape neuron, of their own side. We then scrambled only the inside of the map, keeping every connection onto the output neurons. In the words we fixed in advance: "Scrambling only the inside of the map kept about -9% of the turn command and 69% of the escape signal." (−9% means none: the far-side command was absent in all 6 trials.) Silencing the giant fibre left the turn command alone, as the map predicts: it has no giant fibre → DNa02 connections. Scrambled maps turned up to the real map's activity still gave no turn command. These are counts and spike rates in one model, not a moving fly. Chart and caveats: Where in the wiring is the turn?