A whole fly brain you can poke, in six simulators
This repo turns the FlyWire connectome into a runnable leaky integrate-and-fire model and races it across Brian2, PyTorch, GeNN, NEST GPU and more.
What it does: It simulates the entire adult fruit fly brain, roughly 138k neurons and 5M synapses from the FlyWire connectome, as a leaky integrate-and-fire network. You can activate arbitrary neurons at a chosen frequency (mimicking optogenetic stimulation, via Poisson spiking) or silence others by zeroing all their synapses, then watch spikes propagate downstream. The output is spike times and firing rates for every affected neuron.
The interesting bit: Beyond the neuroscience, the repo doubles as a cross-framework benchmark harness. The same model runs on six backends (Brian2 CPU, Brian2CUDA, PyTorch, NEST GPU, GeNN, Brian2GeNN), all sharing identical data, parameters, and spike-output schema, with Brian2 CPU treated as the accuracy ground truth since it implements the canonical model from the Shiu et al. Nature 2024 paper.
Key highlights
- Built on the FlyWire connectome and the Shiu et al. model, which reported 91% prediction accuracy against experimental Drosophila data.
- Comparison tooling computes active-neuron Jaccard overlap, firing-rate correlations, and spike-count ratios between backends.
- Timing is split into setup (loading, compilation) versus simulation, and spike exports go to parquet outside the timed section so file I/O does not pollute the numbers.
- A labeled paper run produces a bundle of 600 spike parquet files across six frameworks and five rounds, with checksums and a manifest.
- GeNN runs cap the on-device spike recording buffer to avoid CUDA out-of-memory errors on large batched runs.
Caveats
- NEST GPU needs a from-source build with a custom
user_m1neuron model and a patchednestgpu.py. - Brian2GeNN lives in a separate conda environment because its Brian2 version pin conflicts with Brian2CUDA’s.
- The full publication spike bundle is stored on Google Drive rather than in Git.
Verdict: Worth a look if you care about connectome-scale simulation, simulator benchmarking, or reproducible computational neuroscience. If you wanted a biophysically detailed fly brain rather than point-neuron LIF dynamics, this is the wrong fly.
Frequently asked
- What is eonsystemspbc/fly-brain?
- This repo turns the FlyWire connectome into a runnable leaky integrate-and-fire model and races it across Brian2, PyTorch, GeNN, NEST GPU and more.
- Is fly-brain open source?
- Yes — eonsystemspbc/fly-brain is open source, released under the GPL-2.0 license.
- What language is fly-brain written in?
- eonsystemspbc/fly-brain is primarily written in Python.
- How popular is fly-brain?
- eonsystemspbc/fly-brain has 1k stars on GitHub.
- Where can I find fly-brain?
- eonsystemspbc/fly-brain is on GitHub at https://github.com/eonsystemspbc/fly-brain.