Shaduf.Research preview
Digital Fly Lab/flyvis (fly vision model)

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.

  • Our grade: A tested against published recordings, with ablation controls but no shuffled-wiring control
  • Code: TuragaLab/flyvis, MIT licence; pretrained models MIT
  • Data: FlyEM FIB-25 and FIB-19 optic-lobe reconstructions (Janelia); no separate data licence stated
  • Checked by us: , code unchanged since release v1.2.0

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)
The model's parts, from its code (read in our earlier checks) and the paper's full text (read 3 Oct 2026).
PartWhat it isKind
WiringFlyEM 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 modelNon-spiking point neurons: a graded voltage with a ReLU output, fixed synapse signs and counts from the connectome.Modelled
InputLight intensity written onto the photoreceptors (R1–R8) of the 721-column lattice.Hand-made
Trained partsTime 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
OutputOptic flow from the learned decoder; the scientific output is the predicted activity of every cell type.Learned readout
Body, scriptsNo 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.

flyvis numbers with their direct source (section titles from the full text).
NumberThe paper's wordsSection
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.

What must be measured to predict what, according to the paper's ablations (results shown in Extended Data Fig. 2; the text gives no numbers).
Measured wiring the model getsON/OFF contrast preferenceDirection selectivityPreferred direction (T4/T5)
Synapse signs onlyaccuratenot enoughnot enough
Cell connectivity, no synapse countsaccurateaccuratenot enough
Full connectome at single-neuron resolutionaccurateaccurateaccurate

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."

A referee of the paper, in the published peer-review file (read by us on 3 Oct 2026). A referee's statement, not a result.

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.

Spread across the authors' 50 trained flyvis modelsValidation loss of each of the authors' 50 pretrained flyvis models on their training task (optic flow on Sintel movies; lower is better), read from the authors' own files: minimum 5.137, first quartile 5.279, median 5.300, third quartile 5.333, maximum 5.678. Most models sit within 0.05 of each other; the worst is 1.105 times the best. These numbers measure the training task, not a match to fly biology.median 5.300middle half: 5.279–5.333validation loss 5.1366validation loss 5.1910validation loss 5.2201validation loss 5.2472validation loss 5.2513validation loss 5.2599validation loss 5.2604validation loss 5.2625validation loss 5.2700validation loss 5.2703validation loss 5.2719validation loss 5.2775validation loss 5.2779validation loss 5.2812validation loss 5.2831validation loss 5.2852validation loss 5.2897validation loss 5.2919validation loss 5.2922validation loss 5.2955validation loss 5.2956validation loss 5.2969validation loss 5.2980validation loss 5.2989validation loss 5.2994validation loss 5.3009validation loss 5.3035validation loss 5.3070validation loss 5.3082validation loss 5.3188validation loss 5.3195validation loss 5.3196validation loss 5.3244validation loss 5.3290validation loss 5.3310validation loss 5.3316validation loss 5.3321validation loss 5.3327validation loss 5.3358validation loss 5.3554validation loss 5.3597validation loss 5.3597validation loss 5.3664validation loss 5.3716validation loss 5.3786validation loss 5.3839validation loss 5.4180validation loss 5.4183validation loss 5.4278validation loss 5.6779best 5.137worst 5.6785.15.25.35.45.55.65.7Validation loss on the training task (lower is better) Validation loss of each of the authors' 50 pretrained flyvis models on their training task (optic flow on Sintel movies; lower is better), read from the authors' own files: minimum 5.137, first quartile 5.279, median 5.300, third quartile 5.333, maximum 5.678. Most models sit within 0.05 of each other; the worst is 1.105 times the best. These numbers measure the training task, not a match to fly biology.Median 5.300Middle half 5.279–5.333Range 5.137–5.678validation loss 5.1366validation loss 5.1910validation loss 5.2201validation loss 5.2472validation loss 5.2513validation loss 5.2599validation loss 5.2604validation loss 5.2625validation loss 5.2700validation loss 5.2703validation loss 5.2719validation loss 5.2775validation loss 5.2779validation loss 5.2812validation loss 5.2831validation loss 5.2852validation loss 5.2897validation loss 5.2919validation loss 5.2922validation loss 5.2955validation loss 5.2956validation loss 5.2969validation loss 5.2980validation loss 5.2989validation loss 5.2994validation loss 5.3009validation loss 5.3035validation loss 5.3070validation loss 5.3082validation loss 5.3188validation loss 5.3195validation loss 5.3196validation loss 5.3244validation loss 5.3290validation loss 5.3310validation loss 5.3316validation loss 5.3321validation loss 5.3327validation loss 5.3358validation loss 5.3554validation loss 5.3597validation loss 5.3597validation loss 5.3664validation loss 5.3716validation loss 5.3786validation loss 5.3839validation loss 5.4180validation loss 5.4183validation loss 5.4278validation loss 5.67795.15.45.7Lower is better
Spread across the authors' 50 trained models; from their files. Each dot is one model's validation loss on the task it was trained for: estimating motion (optic flow) in Sintel movies. The shaded band is the middle half of the models, the line the median. These numbers measure the training task, not how well a model matches the fly; the paper's biological comparisons are in the section above.
All 50 values
Validation loss per pretrained model (flow/0000/000 to 049), from validation_loss.h5 in the authors' results_pretrained_models.zip (3,417,042 bytes; its sha256 equals the checksum in the authors' download script). Each model stores one value, so "final" and "best" cannot be told apart.
RankModel folderValidation loss
1flow/0000/0005.1366
2flow/0000/0015.1910
3flow/0000/0025.2201
4flow/0000/0035.2472
5flow/0000/0045.2513
6flow/0000/0055.2599
7flow/0000/0065.2604
8flow/0000/0075.2625
9flow/0000/0085.2700
10flow/0000/0095.2703
11flow/0000/0105.2719
12flow/0000/0115.2775
13flow/0000/0125.2779
14flow/0000/0135.2812
15flow/0000/0145.2831
16flow/0000/0155.2852
17flow/0000/0165.2897
18flow/0000/0175.2919
19flow/0000/0185.2922
20flow/0000/0195.2955
21flow/0000/0205.2956
22flow/0000/0215.2969
23flow/0000/0225.2980
24flow/0000/0235.2989
25flow/0000/0245.2994
26flow/0000/0255.3009
27flow/0000/0265.3035
28flow/0000/0275.3070
29flow/0000/0285.3082
30flow/0000/0295.3188
31flow/0000/0305.3195
32flow/0000/0315.3196
33flow/0000/0325.3244
34flow/0000/0335.3290
35flow/0000/0345.3310
36flow/0000/0355.3316
37flow/0000/0365.3321
38flow/0000/0375.3327
39flow/0000/0385.3358
40flow/0000/0395.3554
41flow/0000/0405.3597
42flow/0000/0415.3597
43flow/0000/0425.3664
44flow/0000/0435.3716
45flow/0000/0445.3786
46flow/0000/0455.3839
47flow/0000/0465.4180
48flow/0000/0475.4183
49flow/0000/0485.4278
50flow/0000/0495.6779

Licences

Licences of flyvis's parts, checked 3 Oct 2026.
PartLicenceWhere we read it
CodeMITLICENSE file in the repository (commit 92b3845); GitHub reports MIT
Pretrained modelsMITlicense.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")
ConnectomeNo separate data licence statedFlyEM 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

What flyvis needs, and what we tested (3 Oct 2026).
ItemValueOur status
No-install optionColab notebook from the authors (free Google account needed)Page responds, not run by us
Installpip 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 sizeflyvis 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
GPUHelps for training; running the pretrained models may work on a CPUUntested

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.

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

flyvis status on 6 Oct 2026.
FieldValue
Codegithub.com/TuragaLab/flyvis
Last commit (default branch)92b3845, 6 Aug 2026; unchanged on 6 Oct 2026
Last releasev1.2.0, 6 Aug 2026
PaperLappalainen et al. 2024, "Connectome-constrained networks predict neural activity across the fly visual system", Nature 634, 1132–1140, peer-reviewed: doi, full text
Link checkThe 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 stars190 on 27 Sep 2026 (not re-queried since)
Catalogue entryflyvis, grade A, last verified 6 Oct 2026; controls: no-brain baseline only, in Does fly wiring help?

Sources

Search published pools, pages, reports, and evidence.