The fly plays Pong

Can the real circuit turn the position of a moving ball into well timed paddle movements?

Trained readout on fixed wiringFruit fly multisensory circuit (FlyWire)Train it yourself →Benchmark scores →
Loading 3D view…
Fly ·
livein your browser

What we measured

Real wiring, held out
2.88 points
Rewired, same degrees, held out
-2.31 points
Random wiring, held out
-1.43 points
Circuit silenced, held out
-3.69 points
Hand written readout (DNa02 right minus left)
-2.13 points
Measured with
scripts/gym-benchmark.ts: 12 generations of 16, same seed and budget for every circuit
Train it yourself
/train/gym-pong

What happens

The fly walks left and right behind a paddle at the end of a walled court. While the ball approaches, its offset from the paddle drives the LPLC1 neurons on that side of the fly, more strongly as the ball comes closer.

A readout of the 21 output neurons sets the walking speed. The score counts hits, minus misses, minus a little for being far from the ball.

Training uses a slower ball; the held out test a faster one with steeper angles.

What you see is the readout the benchmark trained on the real circuit, playing the held out setting. Switch the circuit to a rewired one to watch the same readout on wiring it was not trained for, or train your own in the training lab.

Inspired by: DishBrain (Kagan et al. 2022), where cultured neurons played Pong.

How the brain is wired to the world

The mapping is part of the experiment design. Everything between senses and motor output is the connectome.

Senses → neurons
  • Ball to the left of the paddle → LPLC1 left
  • Ball to the right → LPLC1 right
Neurons → movement
  • Trained readout of 21 output neurons → walk right (+) or left (−)

Dataset: Subcircuit of FlyWire v783: inputs HSE, HSN, HSS, LPLC1, LC4, LPLC2, LC16, ORN_DM1, ORN_DA2, sugar/water, bitter; outputs DNa01, DNa02, DNa03, DNb05, DNa11, DNp01, MDN, DNp09, DNg13, DNp03, CB0701; paths with at least 40 synapses per step. About this dataset

Run it locally

Every experiment can also use the local runner, which simulates the brain on your own computer. It is required for connectomes too large for a browser.

git clone https://github.com/berkeyc/connectome-lab.git
cd connectome-lab
pip install -r local/requirements.txt
python local/runner.py            # listens on ws://localhost:8765

Then choose “Local runner” in the player controls and press Restart. Your browser may ask for permission to connect to a local device.