Projects catalogue · project page
flyvis: the connectome-constrained model of fly motion vision, what it predicts and what it has not been tested against
flyvis is the code behind Lappalainen et al. 2024 (Nature): a computer model of the motion-vision circuits of one fruit fly eye (the optic lobe). Its 45,669 model neurons of 64 cell types are wired by an electron-microscopy connectome; the 734 unknown neuron and synapse settings are learned by training the network to estimate motion in movies. The authors then compare the trained model's neurons with published recordings. Several catalogue projects use it as the "eye" of a fly brain.
Short answer
A well-tested model of one part of the fly brain, not a whole fly. In the paper, the median of 50 trained models predicts whether each of 32 well-studied cell types prefers light increments or decrements (ON or OFF) correctly for all 32, and its predictions agree with measurements from 26 published studies.
What it has not been tested against: a network with the same sparseness but scrambled wiring. The authors' controls change the parameters or remove connectome detail; none shuffles who connects to whom, and a referee asked for exactly that. We read every number below in the full text ourselves on 3 Oct 2026, corrected one statement in our own record, and read the 50 pretrained models' scores from the authors' files.
What is in the model
- 45,669model neurons of 64 cell types on a hexagonal lattice of 721 columns, with 1,513,231 connections (paper)
- 734free parameters learned by training; the wiring itself is fixed (paper)
- 50trained models in the authors' ensemble, all on the same connectome and task (paper; files read by us)
| Part | What it is | Kind |
|---|---|---|
| Wiring | FlyEM FIB-25 and FIB-19 optic-lobe column reconstructions, compiled per column by the authors (fib25-fib19_v2.2.json): who connects to whom, synapse signs and synapse counts. Not FlyWire and not a whole brain. | Measured |
| Neuron model | Non-spiking point neurons: a graded voltage with a ReLU output, fixed synapse signs and counts from the connectome. | Modelled |
| Input | Light intensity written onto the photoreceptors (R1–R8) of the 721-column lattice. | Hand-made |
| Trained parts | Time constants and resting potentials per cell type and one synapse-strength scale per pair of cell types (734 numbers), trained together with a decoder that reads optic flow out of the network: Sintel movies, l2norm loss, 250,000 iterations per model. | Trained |
| Output | Optic flow from the learned decoder; the scientific output is the predicted activity of every cell type. | Learned readout |
| Body, scripts | No body; nothing scripted. | None |
What it predicts, quoted from the paper
Every number comes from the Europe PMC full text of the paper (PMC11525180), read by us on 3 Oct 2026. We did not re-run the model.
| Number | The paper's words | Section |
|---|---|---|
| 45,669 neurons, 64 cell types, 721 columns, 1,513,231 connections | "In total, the connectome-constrained model comprises 45,669 neurons and 1,513,231 connections, across 64 cell types arranged in a hexagonal lattice consisting of 721 columns" | Results (model construction) |
| 734 free parameters | "… result in a marked reduction to just 734 free parameters for this large network model." | Results (model construction) |
| 32 of 32 cell types (ensemble median) | "the median flash response index (FRI) across the ensemble predicts the correct ON- and OFF-preferred contrast selectivity for all 32 cell types for which contrast selectivity has been experimentally established" | Ensembles of DMNs predict tuning properties |
| 30 of 32 (best single model) | "This is also the case for the model with the best task performance (task-optimal model), which correctly predicts the preferred contrast of 30 of 32 cells" | Ensembles of DMNs predict tuning properties |
| r = 0.60, P = 2.6 × 10⁻⁶ | "models with higher task performance predict the direction selectivity index of T4 and T5 cells and their inputs better (r = 0.60, P = 2.6 × 10⁻⁶)" | Connectome and task are both necessary |
| 26 studies | "We found that model predictions agreed with experimental measurements of neural activity across 26 studies." | Abstract |
| 50 models | "we generated an ensemble of 50 models, all constrained with the same connectome, and optimized to perform the same task." | DMN ensemble predicts known activity |
A correction to our own record
We wrote
"Ablations show synapse counts are needed for direction tuning."
The paper says
Direction selectivity can be predicted from cell connectivity without synapse counts. Only the preferred direction of the motion-detecting T4 and T5 cells needs connectome detail at single-neuron resolution. Our catalogue record now says this.
| Measured wiring the model gets | ON/OFF contrast preference | Direction selectivity | Preferred direction (T4/T5) |
|---|---|---|---|
| Synapse signs only | accurate | not enough | not enough |
| Cell connectivity, no synapse counts | accurate | accurate | not enough |
| Full connectome at single-neuron resolution | accurate | accurate | accurate |
The paper's words: "accurate predictions of contrast preference (FRI) were possible as long as measurements of the connection-signs were available, and that accurate predictions of the direction selectivity—but not preferred direction—could be achieved with measurements of cell connectivity, without the need for synapse count measurements".
The controls, and the one that is missing
- Random parameters Full connectome, random neuron and synapse settings: "accurate predictions of preferred contrast, but poor predictions of direction selectivity and preferred direction."
- Cell-type wiring only "task-optimized models with access to only cell-type connectivity predicted neural activity poorly."
- Merged cell types Merging all 37 excitatory, 22 inhibitory and 4 mixed cell types into three types "led to poor performance on par with the random DMN."
- Decoder alone The trained models "exhibited superior task performance to both the decoder network alone and models with random parameter configurations".
- Missing No shuffled-wiring network: no network with the same sparseness but scrambled connections was trained and compared.
"what is missing is a demonstration that the specific connectivity of the fly visual system is what enables optimal performance, rather than a generic neural network with the same level of sparseness and gross connectivity statistics of the biological network."
The controls appear only as a figure (Extended Data Fig. 2), with no number in the text, the supplement or the peer-review file and no source data, so our controls ledger records no values for them. Our search of the supplement was crude (we had no PDF tool), so it may have missed a number. In our ledger flyvis counts as a study with ablations and a decoder-only baseline but no wiring null: study row.
The 50 pretrained models
The authors publish their 50 trained models as a 3.4 MB download. We fetched it with the authors' own download script settings, checked that its sha256 equals the checksum in that script, and read each model's stored validation loss.
All 50 values
| Rank | Model folder | Validation loss |
|---|---|---|
| 1 | flow/0000/000 | 5.1366 |
| 2 | flow/0000/001 | 5.1910 |
| 3 | flow/0000/002 | 5.2201 |
| 4 | flow/0000/003 | 5.2472 |
| 5 | flow/0000/004 | 5.2513 |
| 6 | flow/0000/005 | 5.2599 |
| 7 | flow/0000/006 | 5.2604 |
| 8 | flow/0000/007 | 5.2625 |
| 9 | flow/0000/008 | 5.2700 |
| 10 | flow/0000/009 | 5.2703 |
| 11 | flow/0000/010 | 5.2719 |
| 12 | flow/0000/011 | 5.2775 |
| 13 | flow/0000/012 | 5.2779 |
| 14 | flow/0000/013 | 5.2812 |
| 15 | flow/0000/014 | 5.2831 |
| 16 | flow/0000/015 | 5.2852 |
| 17 | flow/0000/016 | 5.2897 |
| 18 | flow/0000/017 | 5.2919 |
| 19 | flow/0000/018 | 5.2922 |
| 20 | flow/0000/019 | 5.2955 |
| 21 | flow/0000/020 | 5.2956 |
| 22 | flow/0000/021 | 5.2969 |
| 23 | flow/0000/022 | 5.2980 |
| 24 | flow/0000/023 | 5.2989 |
| 25 | flow/0000/024 | 5.2994 |
| 26 | flow/0000/025 | 5.3009 |
| 27 | flow/0000/026 | 5.3035 |
| 28 | flow/0000/027 | 5.3070 |
| 29 | flow/0000/028 | 5.3082 |
| 30 | flow/0000/029 | 5.3188 |
| 31 | flow/0000/030 | 5.3195 |
| 32 | flow/0000/031 | 5.3196 |
| 33 | flow/0000/032 | 5.3244 |
| 34 | flow/0000/033 | 5.3290 |
| 35 | flow/0000/034 | 5.3310 |
| 36 | flow/0000/035 | 5.3316 |
| 37 | flow/0000/036 | 5.3321 |
| 38 | flow/0000/037 | 5.3327 |
| 39 | flow/0000/038 | 5.3358 |
| 40 | flow/0000/039 | 5.3554 |
| 41 | flow/0000/040 | 5.3597 |
| 42 | flow/0000/041 | 5.3597 |
| 43 | flow/0000/042 | 5.3664 |
| 44 | flow/0000/043 | 5.3716 |
| 45 | flow/0000/044 | 5.3786 |
| 46 | flow/0000/045 | 5.3839 |
| 47 | flow/0000/046 | 5.4180 |
| 48 | flow/0000/047 | 5.4183 |
| 49 | flow/0000/048 | 5.4278 |
| 50 | flow/0000/049 | 5.6779 |
Licences
| Part | Licence | Where we read it |
|---|---|---|
| Code | MIT | LICENSE file in the repository (commit 92b3845); GitHub reports MIT |
| Pretrained models | MIT | license.txt in the authors' public download folder, added 29 Sep 2026 ("MIT License, Copyright (c) 2023 Janne K. Lappalainen, Fabian D. Tschopp, Mason McGill, Jakob H. Macke, Srinivas C. Turaga") |
| Connectome | No separate data licence stated | FlyEM FIB-25 and FIB-19 reconstructions (Janelia), compiled per column by the authors; the repository states no licence for the data file |
Try it and run it
| Item | Value | Our status |
|---|---|---|
| No-install option | Colab notebook from the authors (free Google account needed) | Page responds, not run by us |
| Install | pip install flyvis (version 1.2.0, 6 Aug 2026; Python 3.9 to 3.12, tested by the authors on Linux) | Not installed by us |
| Download size | flyvis itself 0.4 MB, but its direct dependencies are about 654 MB of wheels with PyPI's default PyTorch (554.6 MB of it), or about 290 MB with the 196.3 MB CPU-only PyTorch. Unpacked, an estimated 0.8–1.2 GB. Pretrained models 3.4 MB. | Sizes read from PyPI and the PyTorch index |
| GPU | Helps for training; running the pretrained models may work on a CPU | Untested |
Could we test the wiring ourselves? Our pre-check
Not now; possibly later, with a weaker question. We checked, without installing anything, whether a later run could test on a CPU whether the pretrained models need the real wiring.
- No-go under this run's memory plan. Even with the CPU-only PyTorch the install is an estimated 0.8–1.2 GB, more than our 0.5 GB scratch limit on a shared 3 GB machine.
- Flash stimuli are synthetic (drawn on the hexagonal lattice), so no movie download is needed, and the connectome file path is a setting, so a modified file can be swapped in.
- Only a limited null works without retraining. The trained synapse strengths are stored per pair of cell types, so a null must keep the same set of connected cell-type pairs, for example by shuffling the column offsets within each pair. A shuffle that changes which cell types connect, like the ones in our ledger, would need retraining on movies, which our machine cannot do.
- Conditional go for run 9 at the earliest, with its own memory plan (about 1.2 GB of scratch, nothing else running) and that retrain-free null. Such a test asks whether the trained settings still work on scrambled wiring, which is a weaker question than whether training on scrambled wiring would do as well; we will say so in the result.
Catalogue projects that use flyvis
A good grade for flyvis does not carry over: each project is graded on what it adds.
- Are fruit flies zero-shot adapters? A pretrained flyvis outputs drive same-type FlyWire neurons as inputs, column by column; scrambled wiring stops the fly steering (details).
- fly-brain (Lulzx) A a separately trained flyvis network drives the optic-lobe inputs from eye raycasts; in our browser check it passed our memory limit (details).
- flybench A optional flyvis front end for vision tasks.
- Embodied brain emulation (Eon Systems) U names flyvis as its vision; the body code is not released.
What you cannot claim from flyvis
- It is not a whole-brain model: one eye's optic-lobe motion pathways only, 64 cell types.
- It has not been shown to beat a shuffled-wiring network: the controls vary the parameters and how much of the wiring is known, not whether scrambled wiring would do as well.
- Its neurons are non-spiking and its settings are trained, so matching a recording is a prediction of a trained model, not a simulation of measured biophysics.
- The 50 models give different answers for some cell types (the paper's own cluster analysis); one model is not "the" fly.
Status
| Field | Value |
|---|---|
| Code | github.com/TuragaLab/flyvis |
| Last commit (default branch) | 92b3845, 6 Aug 2026; unchanged on 6 Oct 2026 |
| Last release | v1.2.0, 6 Aug 2026 |
| Paper | Lappalainen et al. 2024, "Connectome-constrained networks predict neural activity across the fly visual system", Nature 634, 1132–1140, peer-reviewed: doi, full text |
| Link check | The Colab notebook and GitHub answered (HTTP 200) on 6 Oct 2026; doi.org showed a bot check to our script, which does not mean it is dead. |
| GitHub stars | 190 on 27 Sep 2026 (not re-queried since) |
| Catalogue entry | flyvis, grade A, last verified 6 Oct 2026; controls: no-brain baseline only, in Does fly wiring help? |
Sources
- Lappalainen et al. 2024, Nature: Europe PMC full text (XML), read 3 Oct 2026; doi.
- Peer-review file (referee quote) and the supplementary information, text-searched 3 Oct 2026.
- flyvis repository at commit 92b3845, including download_pretrained_models.py (checksum and download folder of the pretrained models).
- The authors'
results_pretrained_models.zip(50 models) andlicense.txt, read 3 Oct 2026; third-party files were not kept. - Our research record: the report of 3 Oct 2026, which added this page.