Fly Terrarium
Whole-brain simulation · runs in your browser

A fly with a real brain, in a dish on your screen.

Every move comes from 138,639 simulated neurons, wired exactly like a real fly’s. Drop sugar, puff air or cast a shadow — then watch which neurons answer.

Whose brain
Waiting for the brain…
loading the brain…

The brain

female · 138,639 neurons
loading the brain…
Senses
Actions
What it senses
In the brain
0
spikes per second
What it does
How it works

Plain words, real mechanics

No neuroscience needed. Each card explains one piece of what happens between your click and the fly’s reaction.

A map of every wire

Scientists sliced a fly’s brain into thousands of layers, photographed each with an electron microscope and traced every neuron and every contact between them. That wiring map is the connectome: 138,639 neurons and 15 million connections for the female, 165,122 neurons for the male, whose map also covers the nerve cord.

Each neuron is a leaky bucket

Incoming signals pour charge in, and it slowly leaks out. When the level reaches −45 millivolts, the neuron fires a spike and empties back to −52. That is the whole neuron model — “leaky integrate-and-fire” from Shiu et al., Nature 2024 — and all of them follow it.

The wiring decides

A spike reaches the neuron’s partners 1.8 ms later. How hard it pushes depends on how many synapses join the two cells; which way — excite or calm — on the chemical the sender uses. Nobody tuned a single connection: they come straight from the map.

A loop every 20 milliseconds

The page works out what the fly senses — sugar under its mouth, air on its antennae, a shadow growing in one eye — and turns it into spikes in the matching sensory neurons. The brain runs 20 ms in 0.1 ms steps; then the page reads a handful of output neurons and moves the fly. And again.

Only busy neurons cost time

Updating every neuron 10,000 times a second is too slow for a browser. So a neuron is only updated when a spike reaches it: an exact formula jumps it forward and predicts when — if ever — it will fire. A quiet brain costs nothing, and the result matches the Python version to a correlation of 0.9996.

Proof it is the wiring

Tick “Shuffle the wiring” and every neuron keeps its synapses, but they now lead to random cells. Same neurons, same numbers, a random map — and the fly no longer eats, grooms or escapes. The behaviour lives in the connections.

Honesty

What is real, what is made up

Real

The wiring of every neuron, from two scanned flies: FlyWire’s female and Janelia’s male.

The neuron model and all its constants, from Shiu et al. (Nature, 2024).

Which output neurons answer a stimulus. The page never chooses that — the wiring does.

The sensory neurons each tool stimulates, from published lists and cell types.

Made up

The stroll. The model has no activity of its own, so while the brain is quiet the fly wanders by a simple rule.

How strong each stimulus is, and the eye: a formula for how fast a shadow grows, not a simulated retina.

Turning spike rates into speed, turns and jumps. For the female, “a giant fibre spike means jump” is our rule.

The dish, its walls and the body animation. The Python version of the project has a real physical body.

Two flies

Same stimuli, different answers

Female · FlyWireMale · MaleCNS
What was scannedThe brain: 138,639 neuronsBrain and nerve cord: 165,122 neurons
JumpingOur rule: a giant fibre spikeThe jump motor neuron TTMn fires — straight through the wiring
Cleaning antennaeOnly the left antenna answers, and only to a close puffBoth antennae, even from afar; the right one also twitches the proboscis
SugarBoth sides of the proboscis answerOnly the left side answers
Calming downAlways falls quiet after a stimulusA puff right at the antennae starts a wave in 5,600 neurons that never stops by itself
Download30 MB48 MB