Flyer

FlyWire connectome · spiking simulation

We asked a fly brain what it wants to eat.

Scientists mapped every neuron in a fruit fly's brain and shared the wiring with the world. Flyer switches that map on inside a computer, all 138,639 neurons of it, and lets it taste things. Sugar was always on the table. On top of it, the brain reached for water, a little salt and something from the throat. It never once picked a smell. Then we drew what its brain did.

A fly brain drawn as an antique ink plate: the two optic lobes branch like trees on either side of the central brain, with fine lines connecting them.
Not a photo, and not a food. This is what the brain's response looks like, drawn from the neurons that fired.

How it works

How do you ask a brain what it likes?

You can't just ask a brain. So we gave it no menu and no recipes. We started with sugar, added every other taste and smell one at a time, and watched the neuron that drives feeding. Whatever the brain liked, it had to show in its wiring.

  1. Try everything

    All 63 channels (10 tastes, 53 smells) are added to sugar, one by one, for 16 simulated trials each.

  2. Check again

    Anything that looked even slightly promising is measured again, 64 trials each. Plenty of early hopefuls fade back into noise here.

  3. Build a blend

    The survivors are stacked on top of each other, best first, until the next addition stops helping.

  4. Confirm

    The finished blend races sugar alone in a fresh batch of 32 trials. In run 3, MN9 fired at 48.1 ± 0.9 Hz on sugar and 63.1 ± 0.8 Hz with the blend.

Water, salt and a throat taste.

Sugar was always on. On top of it, the brain picked water, a little salt and one throat taste. We ran the whole search six times, each from fresh random noise, and the answer never changed. No smell was ever picked, and most of them made the fly less keen to eat.

What each channel did to feeding (change in the feeding neuron's spikes per second, run 3)
  • Water+7.0
  • Low salt+4.9
  • Throat taste+4.2
  • Citrus smell−7.4
  • Vinegar smell−9.5
  • Bitter−26.7

The 63 channels

10 tastes: water, low salt, bitter, the taste pegs inside the mouth, three pharyngeal (throat) groups, two accessory pharyngeal groups, and taste sensors from the legs and body.

53 smells: one for each group of smell receptor neurons in the antenna, from fruity esters and vinegar to citrus, carbon dioxide and pheromones. Each channel switches on just that group's sensory neurons.

Why no smell?

Four tastes raised feeding beyond noise. No smell did: 18 pushed it down and the other 35 changed nothing. MN9 measures the act of feeding, so this says which inputs make the brain eat, not which ones a fly likes the scent of. Smell may matter more for finding food, and this experiment doesn't measure that.

The brain is the FlyWire connectome (not ours, see the credit above): 138,639 neurons and about 15 million connections between them, simulated as a leaky integrate-and-fire network. In plain words, each neuron collects input, leaks a little, and fires once it has had enough. We ported Shiu et al.'s model (Nature, 2024) to PyTorch and changed one thing: in the original, a single smell neuron could set off thousands of others, so we corrected how the smell signals are signed. Taste behaves just as in the paper. The details are in the README.

The portrait

Then we drew what its brain did.

The neurons that fired, at their real places in the brain, and the connections between them, become a picture. Our code draws them two ways: a colourful data portrait and a bare line map. The line map goes to an image model (SDXL with a ControlNet), which is asked for an old scientific ink plate, never for food. These four pictures come from run 3.

The data portrait: dots for neurons that fired, coloured by first spike, joined by thin connection lines.
1. Data portrait. Straight from the data. Each dot is a neuron that fired, each line a strong connection.
The line map: the brain outline and connections as bare white lines on black.
2. Line map. The same thing as bare lines. This is all the image model gets to see.
The free drawing: an ink plate of the brain that follows the line map but adds its own flourishes.
3. Free drawing. The model follows the lines but can't resist embellishing. About 27% of its strongest lines sit on real data; random lines would manage 21%.
The strict drawing: the same ink plate with everything away from real data lines faded to paper.
4. Strict drawing. Only ink near a real data line survives; the rest fades to paper. 74% of its strongest lines sit on the data.

Same brain, other moods

Change the style, the colours or the angle, and the same response looks like a different picture. Four plates from one saved run:

A fly brain in fine pen and ink on cream paper.
Cajal ink plate. Pen and ink on old paper, the way early neuroanatomists drew.
The brain seen from the side and above as a copper-brown etching.
Etching. Turned and tilted, coloured by the data.
The brain as a white cyanotype print on deep blue.
Cyanotype. White on blue, like a sun print.
A pale ink drawing of the brain outline with a web of thin lines across its centre.
Cajal, coloured by the data. A quieter version where the wiring still shows.

The app

Flyer runs on your own computer.

Watch the search unfold, spin the brain around in 3D, and dig into where every number came from. The drawing arrives last. It runs best on a GPU (NVIDIA or Apple silicon), and the drawings need ComfyUI with an SDXL model.

The Flyer app, 3D brain tab: a dark brain with the neurons that fired glowing white and their strongest connections as thin lines, and the chosen blend listed on the right.
3D brain. The neurons that fired and the strongest links between them, with the answer on the right.
The Flyer app, picture tab: a finished ink drawing of the brain, with buttons for the line map, strict and free versions, and a chart of how the blend adds up.
Picture. Flip between the free and strict drawings, the line map and the raw data lines.

Run it

git clone https://github.com/thepixelabs/flyer && cd flyer
uv run python scripts/prepare.py      # one-time: downloads the data (~135 MB)
uv run uvicorn app:app --port 8420    # then open http://localhost:8420

The drawings need ComfyUI and two models from Hugging Face. The README walks you through it.

Or let your AI assistant do the setup

Set up the drawing models for Flyer by following the "Set up drawing" steps in the README at github.com/thepixelabs/flyer. Ask me before you download anything.

Fair warning

It isn't what the fly sees.

We tried to find a picture that, seen through the fly's eyes, would set off the same feeding response. There isn't one. In the simulation, visual input fades out inside the optic lobes. In the wiring itself, vision barely touches the flavour circuit: about 50 times less than it touches random central neurons, and no better than chance. Flies find food with their noses and mouths, and the model agrees. So the drawing is a portrait of the brain's response, not an imagined meal.

What to keep in mind

  • Sugar is always on, because nothing else gets this model to start feeding by itself. The other sugar sensors are left out, so "just add more sugar" can't win.
  • MN9 is one readout of feeding, not the whole story.
  • Every channel is driven at the same 30 Hz. Real tastes and smells vary in strength.
  • The style, and the free drawing's flourishes, come from the image model. The strict version shows what's really data.
  • Nobody knows yet which chemicals the throat taste groups respond to.
  • It's a model: only as good as the wiring map and the simplifications behind it.

Credits

Standing on open science.

None of this exists without the FlyWire Consortium (Princeton University, Janelia Research Campus and the MRC Laboratory of Molecular Biology), who mapped this brain neuron by neuron (the FlyWire connectome, materialization 783, shared under CC BY 4.0), and without Shiu and colleagues, whose simulation model (MIT) we rebuilt. The pictures and screen results here are derived from that data, and we offer them under CC BY 4.0 too. Please credit FlyWire and cite the papers. No FlyWire root IDs are included, and no endorsement by the authors is implied. Our code is MIT.

Drawings are rendered locally with Juggernaut XL v9 (RunDiffusion and KandooAI) and ControlNet Union SDXL ProMax (xinsir). No model weights are distributed.

Source code and full licence notices on GitHub

The papers behind it

If you reuse the data, the model or these results, please cite them.

  1. Dorkenwald, S. et al. Neuronal wiring diagram of an adult brain. Nature 634, 124–138 (2024). doi:10.1038/s41586-024-07558-y
  2. Schlegel, P. et al. Whole-brain annotation and multi-connectome cell typing of Drosophila. Nature 634, 139–152 (2024). doi:10.1038/s41586-024-07686-5
  3. Matsliah, A. et al. Neuronal parts list and wiring diagram for a visual system. Nature 634, 166–180 (2024). doi:10.1038/s41586-024-07981-1
  4. Berg, S. et al. Sexual dimorphism in the complete Drosophila male central nervous system connectome. Cell 189, 5504–5526.e15 (2026). doi:10.1016/j.cell.2026.08.015
  5. Shiu, P. K. et al. A Drosophila computational brain model reveals sensorimotor processing. Nature 634, 210–219 (2024). doi:10.1038/s41586-024-07763-9