Flybrain: typing rare neurons in an unlabeled connectome
A graph neural network that sees only anonymous wiring is transferred to an unlabeled fly connectome. For the rarest cell types it selects candidates, and graph matching assigns their types. Pre-registered tests on five connectomes.

Problem
A connectome is the wiring diagram of a nervous system, reconstructed neuron by neuron from electron microscopy. To use one, every neuron needs a cell type. FlyWire, the first complete adult Drosophila brain, was typed largely by hand. New connectomes (the male CNS, BANC, nerve cords) now arrive faster than they can be annotated.
The hard case is the rare types. About three quarters of FlyWire’s cell types have only two to four neurons. A classifier sees almost no examples of each, and they are the last ones a labeling budget reaches. On top of that, the new connectome comes without labels, its wiring differs from the reference animal’s, and some volumes are reconstructed less densely. So the question is: can a neuron be typed from its wiring alone, in a connectome where no neuron is labeled?
Approach
Stage 1: a GNN on anonymous wiring. A directed GraphSAGE variant (Dir-SAGE) with synapse-weighted aggregation over inputs and outputs, on six degree and synapse-count features per neuron. The model never sees a partner’s label, so it can be applied to a connectome where nothing is labeled.
Label-free transfer. The trained model is applied to the target in several alignment variants. Prior matching rescales the predicted type sizes to the reference, a label-free rule (type sizes plus agreement between seeds) chooses among the candidates, and NTAC refines the result where three GNNs agree.
Stage 2: graph matching for rare types. Target neurons whose stage-1 type is a 2–4-neuron type become candidates. They are matched to the source’s rare-type neurons by Frank–Wolfe on the relaxed quadratic assignment problem, blocked by hemisphere, and each candidate takes its partner’s type.
Pre-registration. Every test on a new dataset was fixed in a written protocol before the run it covers. Between tests, methods were changed only on degraded copies of the development connectomes.
Results
- FlyWire → BANC brain
- 41.3%
- vs. 22.2% GNN alone
- MANC → BANC nerve cord
- 61.0%
- vs. 39.5% GNN alone
- MANC → MCNS nerve cord
- 82.2%
- vs. 72.0% GNN alone
- Common types, unlabeled hemisphere
- 94.5%
- vs. 8.4% NTAC
- Of the pre-registered expectations, all four held on the BANC brain and two of four on each nerve cord. On MCNS a +15-point gain was out of reach because stage 1 already reached 72%.
- For common types (≥ 20 neurons), wiring alone reaches 95.3% on a random split of FlyWire. Label-free transfer from FlyWire to the male CNS reaches 92.6%, against 96.6% for a model trained on MCNS labels.
- Wiring complements morphology, but less than the exploratory analysis suggested. A pre-specified combination with NBLAST matches gained +2.3 points on the BANC brain (95% CI 1.3–3.2), below the 3-point bar set in advance. In the nerve cord, where NBLAST matches are weak, it gained 23.2 points.
- Label-free transfer fails on partial volumes such as the hemibrain (19.6%). Reconstruction density explains about half of the loss on BANC.
Every number has a command and a result file in the reproduction map.
My role
Sole author. I designed the method, wrote the code, wrote and committed the protocols before each test, ran the experiments and wrote the paper.
What I’d do differently
- Fix the evaluation before the method. The label-free selection rule was first developed on FlyWire → MCNS while looking at its errors, and it failed on the sparser BANC brain. Pre-registering from the first cross-dataset run would have exposed that earlier.
- Circularity. Cell types were partly defined from connectivity, and every cross-dataset reference comes from matching that uses wiring, morphology or both. An independent check (for example transcriptomic labels) would make the claim stronger.
- Scope. Single-neuron types are not predicted, and the matching is one-to-one while type sizes differ between animals. A many-to-one matching is the next step.
- Next. Reproducing the connectome-constrained visual-system model of Lappalainen et al. (2024) and testing it under shuffled wiring.