u/Leetzers

Image 1 — Update: the fruit-fly brain playing Pokémon on my Pi 5 is now a 24/7 experiment that collects and publishes a full dataset every run
Image 2 — Update: the fruit-fly brain playing Pokémon on my Pi 5 is now a 24/7 experiment that collects and publishes a full dataset every run
Image 3 — Update: the fruit-fly brain playing Pokémon on my Pi 5 is now a 24/7 experiment that collects and publishes a full dataset every run
Image 4 — Update: the fruit-fly brain playing Pokémon on my Pi 5 is now a 24/7 experiment that collects and publishes a full dataset every run

Update: the fruit-fly brain playing Pokémon on my Pi 5 is now a 24/7 experiment that collects and publishes a full dataset every run

Update to my post from 10 days ago: the simulated fruit-fly brain playing Pokémon FireRed on my Pi 5 is still running 24/7, and it has grown into an ongoing experiment.

Quick recap: it's 139,255 neurons wired from the FlyWire connectome (the full reconstructed brain of an adult fruit fly), simulated on the Pi alongside the emulator. The game screen feeds its eyes, people and doors reach it as smells, and its motor neurons press the buttons. Nothing is scripted. Chat can steer it, or train it with !pain / !pleasure, which releases dopamine in the fly's learning centre.

What's new: it now runs in 30-day runs. Each one starts from a brand-new game and an untrained brain, and the settings only change between runs, so every run is a comparable dataset. Every run collects:

- every step, battle and milestone, tagged "fly alone" or "chat helped" (80% of its steps this run are its own)

- every viewer input, and whether they steered with the fly or against it

- every lesson it learns, who caused it, and how fast it fades

- brain activity per region (vision, navigation, memory, reward, punishment, motor) and everything it senses

- which way it turns and what made it turn

- its "thoughts" (the captions on stream) and how often they were right

At the end of each run everything goes into a published PDF report, including a "what held it back" page with fixes to try in the next run. We also run preregistered experiments, announced on stream before they happen. The first one, a "mirror world" test, found the fly has a built-in right-turn bias that doesn't come from the map. Tonight it plays with and without everything it has learned, to see whether training actually changes its behaviour.

Watch live: twitch.tv/leetzerzz (chat can steer and train it) and youtube.com/@leetzerzz

Run reports and experiment results: in the Discord linked on both channels

u/Leetzers — 7 days ago

Pi 5 running a real fruit fly's brain, playing Pokémon

All 139,255 neurons of the FlyWire FAFB v783 reconstruction — a complete adult female Drosophila brain, though not the ventral nerve cord —simulated on a Pi 5 alongside mGBA, using connections of five or more synapses.

The spatial layout of walls, doors and people is read out of the game's memory and fed to the looming-detector populations (LPLC1, LC10, LPLC4) as left/right drive. It isn't doing image processing — there's no retinotopy, which is the honest limitation. Descending neuron activity decodes into button presses.

Stack: Pi 5 16GB (Rev 1.1, stock 2.4GHz) with a Silicon Power A60 1TB — DRAM-less Phison E15, PCIe 3.0 — 800x480 DSI touchscreen, active fan on the 4-pin header.

Runs at roughly real time, and deliberately uneven: the brain gets the full 16.7ms of thinking time per frame while the fly is navigating, and the game runs about 3x faster in battles and menus where its vision drives nothing anyway.

The brain gets 2 of the 4 cores, and OMP_WAIT_POLICY is PASSIVE. Spinning cost real throughput — 4 threads PASSIVE 0.759x vs 4 threads ACTIVE 0.665x — because the spinning threads starved the video encoder and the display of the cores they needed.

Twitch chat can stimulate its reward and punishment neurons directly, which does real plasticity on the mushroom body. It forgets in about ten minutes, though that decay constant is one I picked rather than measured.

It has a Rattata. It wandered into a Pokémon Center and a man sold it a Magikarp for 500.

Twitch.com/leetzerzz

Connectome: FlyWire FAFB v783, CC-BY-4.0 —Dorkenwald et al. 2024, Schlegel et al. 2024.

u/Leetzers — 18 days ago