The flies
A fly and its brain
What every bar in the brain panel means.
On this page
One fly, in full
Each racer is a small fly in a walled lane. It has a body (position, heading, speed, an energy reserve), a set of simulated senses, and a brain. The brain is the only thing that decides where it steers and how fast it goes. Everything else in a race is physics and the course.

Sense, think, move
Every moment of the race runs the same three-step loop for every fly:
1. Sense
The body measures its surroundings: rays to nearby hazards and walls, the shape of the track ahead, heading, lures, hawks, wind, its own rotation and speed, and whether it is in the final stretch.
2. Think
Those readings become the chance that each input neuron fires. A small network of simulated spiking neurons runs for a few sub-steps, with excitatory and inhibitory neurons passing signals on.
3. Move
The firing rates of three output pools (left turn, right turn, forward) are decoded into a turn rate and a forward speed, which the physics then applies.
The breed's tuning values change how strongly some of these links push (see The four breeds). The network is the same for all four; the numbers on its reflexes differ.
Reading the brain panel
On a race page, the brain panel shows the selected fly's network live, in step with the race. Press a fly in the Switch brain row to look at another one.

- The neuron cloud. Each dot is one neuron. It flashes when it spikes and fades out quickly. Dim base brightness shows whether a neuron is excitatory (brighter) or inhibitory (dimmer). The cloud is a stylised layout of the four brain regions described below, not an anatomical scan.
- The bars. One row per population, grouped in the same order as the signal flows: senses first, then the interneurons, then the motor pools. The coloured bar shows how active that population is right now; the number on the right is its firing rate.
- Switch brain. Mini activity traces for all four flies, with a playhead, to hop between brains.
How to read a bar
- The number (Hz) is the average spike rate per neuron in that population over the last few moments, expressed per second (the panel samples at 30 steps per second, so 30 Hz would mean firing on every step).
- The fill is relative to that population's own typical range in this race (from its quiet moments up to its busy ones), not to a global maximum. A bar half full means “in the middle of its usual range”. A population that is almost always busy (the tonic bias, interneurons, motor pools) therefore still shows visible movement.
- The colour is the brain region the population is placed in (key below).
Every bar explained
Sixteen populations make up each brain. In a sense, the bars read like a story: senses at the top react to the world, the middle bars mix those reactions, and the motor pools at the bottom decide what the body does.
Hazard / rail rays
8 neuronsEight feelers fan out around the fly, one neuron each. A neuron fires faster the closer a hazard or the lane wall is in its direction.
What it does: A hazard on the left drives the right-turn pool and slows the fly; on the right, the reverse. Dead ahead or behind splits the turn both ways but still slows it. Caution scales how hard it steers away.
Visual lookahead bearing / path clearance
3 neuronsLooks a short way up the track. One neuron fires when the track ahead bends left, one when it bends right, and one (straight) fires more the clearer and straighter the path is.
What it does: Turns the fly toward the bend and drives it forward harder when the road ahead is open. Every breed has this reflex at the same strength.
Compass (E-PG ring)
8 neuronsA ring of eight neurons that together encode which way the fly is facing compared with straight down its lane, like a built-in heading sense. Different neurons are active depending on its heading.
What it does: Reads out as a restoring steer: when the nose drifts off-line, the ring pushes it back toward the finish. Same strength for every breed.
Food / light / sugar attraction
2 neuronsLeft and right neurons that fire when the strongest active lure (food, light or a sugar spill) is on that side.
What it does: Turns the fly toward the lure. How hard depends on its lure pull (distractibility), so Erratic is yanked sideways while Direct barely notices.
Predator looming
3 neuronsLeft and right neurons fire when a hawk is on that side, and a third fires more as the hawk gets closer and bigger in view.
What it does: Turns the fly away from the threat and triggers a burst of speed. Scaled by hawk reaction (fearfulness): strong in Erratic, weak in Bold.
Wind gust
2 neuronsLeft and right neurons fire when a gust is pushing the fly sideways in that direction.
What it does: Counter-steers against the push. Scaled by wind resistance: Cautious fights it well, Bold hardly at all.
Halteres
2 neuronsNamed after the real fly’s balance organs. They fire when the fly was rotating left or right a moment ago.
What it does: A damping reflex: a counter-turn proportional to the last rotation, which smooths out zig-zag.
Optic flow
3 neuronsSenses how the ground slides past: one neuron grows when the fly is going slower than it wants (for example into a headwind), the other two when it has drifted left or right across its lane.
What it does: Pushes forward drive up when speed falls short and counter-steers against drift.
Taste
1 neuronFires when the fly’s feet touch food or sugar on the track.
What it does: A feeding stop: it cuts forward drive while the fly stands on food. Scaled by lure pull, so Erratic stops hard and for long.
Late sprint surge
1 neuronRamps up over the last fifth of the lane.
What it does: A forward-drive boost in the closing stretch, scaled by finishing kick.
Tonic bias
1 neuronA neuron with constant background input, not tied to any sense.
What it does: Keeps a baseline forward push going so a fly with nothing to react to still runs. It fires steadily, so its bar sits fairly flat.
Excitatory interneurons
158 of 200The middle layer. These neurons receive input from the senses and from each other, and make the neurons they connect to more likely to fire.
What it does: They carry and mix signals, adding the recurrent back-and-forth that makes a fly’s decisions slightly different from one moment to the next.
Inhibitory interneurons
42 of 200The rest of the middle layer. These make the neurons they connect to less likely to fire.
What it does: Keep activity in check so the network does not run away. About four in five interneurons are excitatory and one in five inhibitory.
Left-turn motor pool
24 neuronsOutput neurons that, together, ask the body to turn left.
What it does: The difference between the left and right pools becomes the fly’s turn rate.
Right-turn motor pool
24 neuronsOutput neurons that ask the body to turn right.
What it does: See above. If both pools fire evenly, the fly goes straight.
Forward motor pool
24 neuronsOutput neurons that ask the body to go faster.
What it does: Its firing rate becomes forward speed. Aggression, track clearance, surge and the tonic bias all push it up; hazards, taste and a tired body pull it down.
Brain regions
The panel groups neurons into four regions, shown as clusters in the cloud and as bar colours. The names are borrowed from real fly anatomy to make the layout easy to read; they describe the role each group plays in this simulation.
| Region | Colour | Role here | Bars in it |
|---|---|---|---|
| Optic lobe | Sky blue | Vision-like senses: seeing hazards close by, a looming predator, and ground flow. | Hazard / rail rays, Predator looming, Optic flow |
| Antennal lobe | Pink | Smell-, touch- and chemical-like senses: attraction to lures, wind, taste. | Food / light / sugar attraction, Wind gust, Taste |
| Central brain | Amber | Integration: track and heading, the sprint cue, the constant bias, and the interneurons that mix everything. | Visual lookahead, Compass, Late sprint surge, Tonic bias, Excitatory and Inhibitory interneurons |
| Descending / motor | Green | Output to the body (the column that sends commands down), plus the balance sense. | Left-turn, Right-turn and Forward motor pools, Halteres |
What this is, and is not
There is also an off-chain exhibition mode on sim-only race pages that uses a larger network (2,124 neurons) whose recurrent wiring was extracted from a published map of a real fly's neurons (MaleCNS v1.0 from the FlyEM team at HHMI Janelia and partners, CC-BY 4.0). It is for looking at, and races you bet on do not use it. Even there, forward speed is mostly a calibrated reflex rather than something the data decides.
The spikes you see are exactly what the simulation recorded. The panel replays the race's trace; it does not make up activity. Because the race is deterministic, re-running the same seed reproduces every spike (see Fair play and verification). The recorded trace schema is described in docs/trace-schema.md in the repository.