What it found
Project concluded, October 2026. The same fly wiring, grown step by step with a camera, light-adapting eyes, the fly's smell pathway and memory, learned every handling task up to picking only the ripe tomatoes off a plant, by sight and smell, at 98 %. On any truss of two to six tomatoes it plateaus at 67–72 % (task 14), while a scripted teacher solves 98 %.
- The senses are not the limit. A standard machine-learning model reads the teacher's “close now” moment from exactly the brain's camera inputs almost perfectly, and the distance to the tomato to 0.3 mm.
- The decisions are. Copying the teacher (five variants) never passed 26 %; a learned speed for every neuron and reading all 156 of its command neurons changed nothing; letting the teacher start each practice try gave 71 %. The brain learns the open-and-close moments of the hand only partly.
- Honest negatives: random mazes were never learned, camera noise broke the early vision brains, the drone is on hold, and bruising stayed a 10–15 % failure in the harvest tasks.
How the robots are wired
The fly brain has been mapped neuron by neuron: about 139,000 neurons and 15 million connections (FlyWire). For each robot I take the few thousand neurons that lie on the real pathways from the fly's eye and body sense to its command neurons, keep who connects to whom and whether each connection excites or inhibits, and train only the connection strengths with reinforcement learning.
The eye drives the fly's photoreceptors: in the first robots one camera pixel per photoreceptor, in the drone and the Panda arm a fly-like compound eye whose facets feed the R1–6, R7 (ultraviolet) and R8 (green) cells. Body readings go into ascending neurons, the channel that normally carries body sensation up to the fly's brain. The robot is driven from descending neurons, the brain's outgoing commands.
Every task below is a single training run, so read the numbers as first results, not a benchmark. The videos are short; each one has full-screen in its controls.
Balance a ball on a tray, given its position as numbers
DoneThe first network used the 1,000 most connected fly neurons, with inputs and outputs picked by me rather than by biology. It learned to keep a rolling ball on a flat tray in about 100,000 steps and coped with noise, pushes and a heavier ball. An easy start, so the tasks got harder.
- Full 10 s from ~100k steps
- Robust to noise, pushes, heavy ball
A tilt-maze puzzle, given the ball's position as numbers
PartlyLike the wooden labyrinth toy: tilt the board so the ball rolls round the walls into the green goal, and stop it there. The network gets the wall layout but not the route. On one fixed maze it reached 30–40 % after a million steps, still rising; new random mazes were too hard.
- Fixed maze: 30–40 % at 1M steps
- Random mazes: not yet
Shortcuts it found, and how they were closed
It learned to flick the ball over the walls (fixed with a glass lid), and to hover in and out of the goal to collect reward (fixed by taking the resting reward back if the ball leaves).
Balance a ball by camera, wired like a fly
DoneThen the robot was rewired through the fly's own channels, as in the diagram, and the ball's position was taken away: the brain gets only a 16×16 camera image and its joints. From 250,000 steps on it kept the ball for the full 10 seconds, also with a heavier ball and random shoves.
- Normal, heavy ball, pushes: 100 %
- Ball hidden: 0 %
- Camera noise: 0 %
All tests
| Test (10 new episodes) | Kept the ball 10 s | Mean steps (of 500) |
|---|---|---|
| Normal conditions | 100 % | 500 |
| Ball three times heavier | 100 % | 500 |
| Random pushes on the ball | 100 % | 500 |
| Light noise on the camera image | 0 % | 144 |
| Strong noise on the camera image | 0 % | 63 |
| Ball removed from the camera image | 0 % | 28 |
Without seeing the ball it fails at once, so it really steers by what comes through its eye. Its weak spot is a noisy picture, which it never saw while learning.
The tilt maze, seen only through the camera
DoneThe same camera brain had to see the walls, goal and ball in a 16×16 picture, find the way round and stop the ball in the goal. With fast motors it pinned the ball in the goal's corner and never counted as solved. With slower, smoother motors and practice starts along the route, it solved every test from 1.1M steps, in about 2.6 seconds.
- Trained maze: 100 %
- Heavy ball: 100 %
- Pushes: 60 %
- New mazes: 0 %
All tests
| Test (10 episodes) | Solved | Mean steps (of 300) |
|---|---|---|
| The trained maze | 100 % | 132 |
| Ball three times heavier | 100 % | 141 |
| Random pushes on the ball | 60 % | 220 |
| Noise on the camera image | 0 % | 300 |
| Ball removed from the camera image | 0 % | 300 |
| Mazes it has never seen | 0 % | 300 |
It steers by what it sees, but it memorised this one maze rather than learning to read walls. Training on a new random maze every episode stalled, which is one reason the project moved to a real robot arm with more varied but simpler tasks.
A drone with a fly's compound eyes
On holdA fly's brain evolved to steer flight, so the next robot was a small quadcopter seeing through two compound eyes of 160 facets each, covering almost every direction. A simple stabiliser keeps it level, the job a fly's halteres do outside the brain; the 4,000-neuron fly brain decides where to fly. Task: find a yellow ball somewhere in a room, among blue decoys, in wind and gusts, and hover on it.
- Eye-only pilot: 83 %
- Ball invisible: 0 %
- Brain at 600k: reaches close balls, rarely far ones
What was learned building it
A first version painted the floor green: the yellow ball was camouflaged against it, much as a flower can be in grass, so the room is now grey. A penalty for jerky commands punished the network's own exploration and stalled learning, so it was removed. The drone is paused to focus on the arm.
Franka Panda arm: reach a block it finds by eye
DoneA real lab robot (Franka Panda with its two-finger gripper), set up the way robot-learning benchmarks do it: the brain's command neurons say "move the hand this way, open or close", and a controller turns that into joint motions, much as a fly's nerve cord turns descending commands into leg movements. Two compound eyes: one on a head beside the table to find things, one on the wrist to line up. Task: bring the gripper just above a yellow block that appears somewhere new each time, with blue decoys around.
- Across the table: 73 % → 94 %
- Clean: 90 %
- 3× eye noise: 75 %
- Block invisible: 5 %
First run · 109/150 (73 %)
After edge practice · 141/150 (94 %)
Each cell: a block position on the table (5 × 5 grid, seen from the robot), number of successes out of 6 tries with different starts. Stronger colour = more successes.
Tests, corners and what went wrong on the way
| Test (best brain, 20 episodes) | Reached |
|---|---|
| Normal conditions | 90 % |
| No decoy blocks | 90 % |
| Three times more noise in the eyes | 75 % |
| Brightness changes twice as large (±40 % instead of ±20 %) | 70 % |
| Yellow block made invisible | 5 % |
| Exact corner tip (20 tries) | First run | After edge practice |
|---|---|---|
| Centre (reference) | 18 | 20 |
| Far left | 9 | 15 |
| Near left | 6 | 11 |
| Near right | 5 | 10 |
| Far right | 10 | 4 |
Corner misses end about 30 cm away, drifting towards the table centre: at the extreme tips the block is a small, dim dot for the head eye and outside the downward wrist eye, so the brain falls back to where blocks usually are. Decoys hardly matter (82–83 % with 0, 1 or 2).
On the way: a success rule that also demanded a nearly still hand could not be met under the network's own exploration jitter (even a perfect pilot with that jitter passed 27 %), so it became "stay within 3 cm for 0.2 s". The first run peaked at 90 % and then declined, so the best brain was kept and fine-tuned at a lower learning rate, with more practice blocks near the table edges.
Franka Panda arm: grasp the block and lift it
DoneSame robot, eyes and brain, plus touch: the brain feels whether each finger presses on something, like a fly's mechanosensors. It must close both fingers on the yellow block, lift it to a point 8 cm straight above where it lay, and hold it there.
Trial and error alone (v9) got the first lifts after 2 million steps and about one success in five by 3.2 million, but the lifts were sloppy: the block was typically carried about 20 cm sideways while going up.
Teacher, then practice (v10): a scripted teacher that knows where the block is showed the fly brain the right move in the situations the brain itself got into (10 short rounds, 165k steps, the method called DAgger). Then the brain practised on its own with trial and error. The teacher only supplied training targets: the fly brain never receives the block's position, and every test, map and video below is the brain alone, using its eyes. Within 0.6 million practice steps it solved 84 %, and around 90 % from then on.
- Solved alone: 90 % (was ~20 %)
- Off target at the end: 1.3 cm (was ~20 cm)
- 3× eye noise: 96 %
- Block invisible: 0 %
Before: trial and error only (v9) · 52/200 (26 %)
After: teacher, then practice (v10) · 180/200 (90 %)
Each cell: a block position on the table (5 × 5 grid, seen from the robot, decoys removed), number of successes out of 8 tries with different starts. Before: block at least 7.5 cm up at the end (v9's own, looser rule). After: block held within 2.5 cm of the point straight above its start (the stricter rule). The right edge is still the weakest.
Precision, before and after (200 new layouts each)
| Measure | Trial and error (v9) | Teacher, then practice (v10) |
|---|---|---|
| Grasped the block | 85 % | 100 % |
| Block 7.5 cm or more up at the end | 29 % | 98 % |
| Held at the target point at the end (within 2.5 cm) | 0 % | 94 % |
| Distance from the target point at the end (median) | 20.4 cm | 1.3 cm |
| Largest sideways drift while in the air (median) | 23.4 cm | 1.1 cm |
| Time to finish (median, of 4 s) | – | 1.5 s |
| Test (best brain, 50 episodes) | v9 | v10 |
|---|---|---|
| Normal conditions | 16 % | 90 % |
| No decoy blocks | 24 % | 90 % |
| Three times more noise in the eyes | 8 % | 96 % |
| Brightness changes twice as large (±40 % instead of ±20 %) | 20 % | 60 % |
| Yellow block made invisible | 0 % | 0 % |
It still works only by eye (0 % with the block invisible). Lighting is the weak spot: it never saw lighting changes while practising. One training run.
How the teacher rounds went
Round 1 the teacher drives every step; then the brain drives more and more (50 %, 25 % …) while the teacher keeps saying what it would do. The brain alone solved 0 % after rounds 1–2, up to 56 % after round 7, then fell to 4 % by round 10: once the brain drove almost all the time, the examples filled with its own near-misses, and it lost the final lift while keeping a clean reach and grasp. Practice with trial and error then took it from 4 % to about 90 %. During practice a second network that judges how well things are going (the critic) saw the true positions; it is used only for learning, never for acting.
Before: trial and error alone (v9)
For 2 million steps it found the block, went down to it and learned to close its fingers, but never completed a lift. At 2.15 million steps the first full lifts appeared, and by 3.2 million it solved about one attempt in five, often swinging the block sideways while raising it.
How it got there, and the tests
| Steps | Change | Effect |
|---|---|---|
| 0–0.7M | start from the reaching brain | goes down to the block, never grasps |
| 0.75M | some practice episodes start at the block (open, or already holding it) | learns to close and hold |
| 1.1M | exploration noise reset once, lower learning rate | aim restored; grasps; lifts a little |
| 2.15M | – | first full lifts |
| 3.2M | – | best brain: about 1 in 5 solved |
| Test (best brain, 50 episodes) | Solved |
|---|---|
| Normal conditions | 16 % |
| No decoy blocks | 24 % |
| Brightness changes twice as large (±40 % instead of ±20 %) | 20 % |
| Three times more noise in the eyes | 8 % |
| Yellow block made invisible | 0 % |
One training run; 50-episode tests swing by about ±10 points. Videos and tests always start from scratch (no help), unlike some practice episodes.
Checks before training
| Behaviour (40 episodes) | Return | Lifted |
|---|---|---|
| Random, or doing nothing | 2 | 0 % |
| Hovering above the block (the reaching brain) | 13 | 0 % |
| Touching it with a closed gripper | 15 | 0 % |
| Grasping but never lifting | 31 | 0 % |
| Scripted pilot with training-like noise | 52 | 78 % |
| Scripted pilot | 66 | 92 % |
Every step towards the goal pays more, so the reward cannot be gamed by stopping halfway.
Franka Panda arm: pick the block and place it in a bin
DoneA shallow red bin (14 × 14 cm, 1.5 cm rim) appears somewhere new on the table each time, away from the yellow block. The fly brain has to find both by eye, grasp the block, carry it over the bin, lower it onto the bin's floor, let go and move its hand away. Solved = the block rests inside the bin, touched by neither finger, for 0.2 s, within 6 seconds.
Same recipe as the lift: starting from the lift brain, a scripted teacher (knows where block and bin are) showed it the right moves for 10 short rounds, then it practised on its own. The teacher rounds alone already reached 82–88 %; practice then held it at 84–92 %, levelling off within 0.2 million steps. Total: 0.77 million steps, under 4 hours on the desktop.
- Solved alone: 92 %
- Block lands 1.0 cm from the bin centre
- 3× eye noise: 86 %
- Block invisible: 0 %
Where the bin was · 160/200 (80 %)
Each cell: a bin position on the table (5 × 5 grid, seen from the robot), number of successes out of 8 layouts with the block, decoys and start placed at random. Weakest: the bin near the middle of the table and in the far-left corner.
Tests and what goes wrong (best brain)
| Test (50 episodes) | Solved |
|---|---|
| Normal conditions | 92 % |
| No decoy blocks | 92 % |
| Three times more noise in the eyes | 86 % |
| Brightness changes twice as large (±40 % instead of ±20 %) | 58 % |
| Yellow block made invisible | 0 % |
| 200 new layouts | |
|---|---|
| Grasped the block | 94 % |
| Carried it over the bin | 90 % |
| Solved (in the bin, released) | 84 % |
| Block centre to bin centre when placed (median) | 1.0 cm |
| Time to solve (median) | 2.7 s |
On 200 layouts it solved 84 %, against 92 % on the 50-episode test: the honest figure is somewhere in the high 80s. The most common miss (7 %): it holds the block 2–3 cm above the bin floor and never lowers it (in the case examined, the block was gripped high and hung tilted between the fingers). Then: never grasping the block (6 %), and ending with the block in the bin but still held (1–2 %). Lighting remains the weak spot, as for the lift.
Franka Panda arm: sort blocks by colour
DoneA sorting station: three identical red bins in a row along the far side of the table, and one block per episode, yellow, blue or orange at random. Yellow goes into the left bin, blue into the centre, orange into the right. The bins look the same, so the only way to know where a block goes is to see its colour, through the fly's photoreceptors (brightness, UV and green channels).
Started from the pick-and-place brain: 10 teacher rounds, then practice. In 0.5 million steps (about 3 hours) it solved 98 % of the evaluation episodes.
- Solved alone: 98 % of 300
- Wrong bin: 0 of 300
- Any brightness ×0.4–2.5: 100 %
- Block invisible: 0 %
Does it really sort by colour? (300 new layouts)
| Block colour | Solved | Left bin | Centre bin | Right bin | No bin |
|---|---|---|---|---|---|
| Yellow (→ left) | 98 % | 101 | 0 | 0 | 2 |
| Blue (→ centre) | 92 % | 0 | 98 | 0 | 9 |
| Orange (→ right) | 97 % | 0 | 0 | 87 | 3 |
Every block that landed in a bin landed in the right one: the colour decides the bin. The 14 misses (5 %) never reached a bin at all: dropped on the way (6), still holding it at the end (5), never grasped (3). Blue, the decoy colour it was taught to ignore in earlier tasks, is the weakest. Placed blocks end a median 1.3 cm from the bin centre; sorting takes a median 2.8 s.
| Test (best brain, 50 episodes) | Solved |
|---|---|
| Normal conditions | 92 % |
| Three times more noise in the eyes | 84 % |
| Brightness changes twice as large (±40 % instead of ±20 %) | 50 % |
| Block made invisible | 0 % |
Brightness changes hurt colour sorting the most (50 %), probably because brightness is one of the three channels the colours differ in (not yet checked per colour). A first design, with bins coloured like the blocks and at random places, failed in the teacher rounds (0 %): a big yellow bin looked like "the yellow thing" too, so the brain could no longer find the block.
Changing light: fly-like light adaptation in the eyes (v14)
Real fly photoreceptors adapt to the light level: each receptor type adjusts its sensitivity to the light it currently receives, so the brain gets contrast rather than absolute brightness. The eye model now does the same (with photon noise that grows in dim light). The brain then practised under normal light only, so every other lighting below is new to it.
| Fixed brightness (40 layouts each) | ×0.4 | ×0.5 | ×0.7 | ×1 | ×1.4 | ×2 | ×2.5 |
|---|---|---|---|---|---|---|---|
| v12: practised ×0.8–1.2 | 0 % | 0 % | 15 % | 90 % | 0 % | 0 % | 0 % |
| v13: practised ×0.5–2 | 5 % | 42 % | 92 % | 82 % | 70 % | 62 % | 0 % |
| v14: adapting eyes, practised ×0.8–1.2 | 100 % | 100 % | 100 % | 100 % | 100 % | 100 % | 100 % |
| Lighting adaptation cannot simply cancel | v12 | v13 | v14 |
|---|---|---|---|
| Uneven: one side of the view ×2, the other ×0.5 | 3 % | 3 % | 48–60 % |
| Uneven, milder: ×1.4 / ×0.7 | – | – | 88 % |
| Tinted: receptor types ×0.7 / ×1.4 / ×1.0 | 15 % | 30 % | 98 % |
Practising under many brightness levels (v13) only helped inside the practised range. Adapting eyes made overall brightness irrelevant (largely by design: adaptation cancels a global change), corrected a colour cast (like colour constancy), and handled moderately uneven light it never saw. At normal light it also sorted better than ever: 98 % of 300 new layouts, none in a wrong bin. Strongly uneven light remains the weak spot.
Ripe or rotten, by smell alone
DoneThe brain grows a sense. The trained 4,000-neuron brain was kept exactly, and the fly's smell pathway from the FlyWire map was added to it: 106 olfactory receptor neurons (53 receptor types, two antennae) and 370 neurons on their routes into the existing brain, mostly antennal-lobe projection and local neurons. How each receptor type responds to each chemical comes from measured fly data (the DoOR database). Two antennae sit beside the gripper.
The task. One fruit, ripe or rotten, looking exactly the same. Ripe goes left, rotten right. Ripe fruit smells of fruity esters; rotten fruit of fermentation (ethanol, acetic acid, ethyl acetate, diacetyl), which mainly drives the fly's acid-sensing receptors. The videos show the true fruit and what the antennae report; the brain only gets the smell.
- Sorted: 98 % of 300
- Wrong bin: 0
- Antennae silenced: 50 % (chance)
- 3× smell noise: 100 %
Does it really decide by smell?
| Fruit | Solved | Ripe bin | Rotten bin | No bin | |
|---|---|---|---|---|---|
| With smell (300) | Ripe | 99 % | 166 | 0 | 1 |
| Rotten | 97 % | 0 | 129 | 4 | |
| Antennae silenced (100) | Ripe | 97 % | 60 | 0 | 2 |
| Rotten | 0 % | 37 | 0 | 1 |
Without smell it still picks up and carries every fruit, but always to the ripe bin: "ripe" is its default, and the smell of rot is what sends a fruit to the other bin. Nothing else in the scene gives the answer away. Honest limits: the fruit recipes are simplified, some receptor responses were never measured (counted as none), the odour plume is smooth rather than turbulent, and the mushroom body (odour learning) is not included yet.
Greenhouse, phase 1: pick a tomato off the plant
DoneTowards a real job. The end goal is a greenhouse harvesting robot: an arm on a cart that drives a loop through tomato rows, picks ripe tomatoes into a basket, removes rotten ones and unloads after each lap. Phase 1 is the core skill. One cherry tomato hangs on its stalk from a plant; the arm comes at it from the front and above, the way greenhouse harvesting robots do, closes on it, pulls until the stalk snaps, and drops it into the basket beside the robot. Touching the plant costs reward (a broken stem costs a grower weeks of fruit). Same brain as task 10, so it can still smell.
- Picked into the basket: 98 % of 200
- Time to the basket: 2.4 s
- Dropped: 1 %
- Uneven light: 0 %
What does it use smell for?
| Smell (50 layouts each) | Solved | Closest to the tomato |
|---|---|---|
| Normal | 98 % | 0.5 cm |
| Antennae silenced | 0 % | 4.1 cm |
| Smell coming from 6 cm beside the tomato | 96 % | 0.6 cm |
| Full-strength smell everywhere | 20 % | 13.5 cm |
It finds the tomato by sight (moving the smell aside does not move the hand), but uses how strong the smell gets as the hand closes in to time the grasp: without smell it stops 4 cm short and never closes. Nobody taught it this; the teacher only ever moved by the true tomato position. Honest limits: the plant the eyes and physics see is simple (a stem, a branch, the stalk, three leaves; the leafy plant in the videos is drawn for viewers only), stems do not bend, and the hand brushes the stalk briefly in most picks. Strongly uneven light breaks it, as in the sorting task.
Greenhouse, phase 2a: pick only the ripe tomato
DoneChoosing. Three cherry tomatoes hang side by side on a truss; one is ripe, the others green or turning. Pick the ripe one, leave the rest. The fly's own eye failed here, and we measured why: its facets are about 11° apart, so from the head the three tomatoes are one blur, and even the wrist eye read ripeness at only 85–92 %. So, as harvesting robots do, the hand now carries a close-range depth camera (like an Intel RealSense D405). Its image, 16×10 pixels of colour and distance, goes into the same fly-brain neurons the wrist eye used, each pixel to the facet pointing the same way, so the fly's visual pathways stay in place. The head keeps the fly eye; smell is unchanged.
- Picked correctly: 98 % of 200
- Unripe picked: 0 of 400
- All look ripe: 54 %
- No smell: 0 %
What it took (three failed tries first)
- The eye was too coarse from a distance, so the teacher now first brings the hand close to the truss, the same move whatever is ripe, then goes for the ripe one.
- A bug in the eye model: a thin stalk hid the whole tomato from the wrist eye at grasping distance. Fixed.
- The teacher had a memory the brain lacks (it kept its earlier choice): in 12 % of situations its choice was not one the brain could make from what it senses. Now it decides from the present only.
- One step at a time: one ripe tomato among three first, two ripe next.
Each fix was found by measuring rather than guessing: a linear read-out of "is this tomato ripe" from each sense showed where the information was missing. The camera then made it 100 %. Honest limits: the camera is an engineering part, not a fly eye; it has no white balance yet, so tinted light (12 %) and uneven light (0 %) break it; the brain still uses smell to time its grasp.
Greenhouse, phase 2b: pick every ripe tomato, gently
DoneRepeating, remembering, not bruising. One or two of the three tomatoes are ripe. The arm must pick one, drop it in the basket, come back, find the next and pick it, without picking an unripe one and without bruising any fruit: any knock harder than 5 N, or a hard landing in the basket, fails the harvest. The robot got what real harvesters have: a front depth camera on the cart that sees the whole truss (into the fly's head-eye neurons), a gripper whose force is capped below what bruises a tomato, and an observation pose it returns to after each fruit. The fly brain got memory: each neuron keeps part of its activity from one moment to the next.
- Solved: 79–82 % of 200
- Unripe picked: 1 of 290
- Time: 4.9 s
- Memory wiped: 74 → 62 %
Each step, measured on the same 200 layouts
| Brain | Solved | Unripe picked | Bruised | Time |
|---|---|---|---|---|
| Without memory and front camera (dashboard) | ~66 % | – | – | – |
| Two cameras + memory + gentle | 82 % | 2 % | 11 % | 5.2 s |
| + smooth (touching other tomatoes costs) | 79 % | 4 % | 9 % | 4.9 s |
| + front camera zoomed (34° → 26°) | 79 % | 0.5 % | 10 % | 4.9 s |
The zoom was found from the videos: the hand went to the orange tomato first, looked, then took the red one. At 34° a tomato covered about 1.4 pixels of the front camera; at the tomato's pixel, red and orange were told apart 93 % of the time, at 26° 99 %.
What went wrong on the way
- Memory made learning blow up: carrying all of each neuron's activity over scrambled the copied brain. Now each neuron learns how much to keep, starting at 5 %.
- The second tomato was never taken: the arm would have had to remember where it was for ~3 s of carrying. Real harvesters look again; so does this one now, from a pose aimed by its camera.
- The way back knocked tomatoes (up to 80 N): now it rises out of the basket first.
- Practice slowly made it worse (90 % → 60 %): learning rate lowered.
- The physics engine blew up after a knocked tomato flew into the table: a flung tomato now ends the try as a lost fruit.
Honest limits: bruises still fail 10 % of layouts, mostly a finger hitting the ripe tomato on the final approach (an impact within one 40 ms control step; stopping the push on contact did not help); a dropped tomato 4 %; tinted or uneven light breaks the cameras (no white balance); one training run.
Greenhouse, phase 2c: any truss
DoneNo two trusses alike. Two to six tomatoes hang on irregular stalks along a zig-zag stem; one to three are ripe. Same robot and fly brain as task 13 (two depth cameras, smell, memory, a gripper that cannot squeeze hard). A bruise of any tomato, by a knock above 5 N or a hard landing, fails the harvest. The scripted teacher it learned from solves 75–83 % of these trusses.
- Solved: 67 % of 200
- Three ripe: ~51 %
- Bruised: 14 % of layouts
- Time: 5.6 s
- Plateau: 67–72 % (teacher 98 %)
Each step, measured on the same 200 layouts
| Brain | Solved | 3 ripe | Ripe in basket | Bruised |
|---|---|---|---|---|
| Teacher, then practice (4M steps) | 60 % | ~42 % | 324 / 373 | 28 % |
| + a bruise ends the try | 62 % | ~31 % | 292 / 373 | 15 % |
| + each tomato paid once (final) | 67 % | ~51 % | 321 / 373 | 14 % |
Ending the try at the first bruise halved the bruising, but the arm learned to stop after its first tomato: following the hand showed it standing back for the rest of the time, never trying again, and more time did not help. The reason was the reward: every tomato already in the basket kept paying a little each moment, and a bruise would end all of it, so not trying was the safe choice. Paying each tomato once, when it lands, banks it; finishing the truss pays the rest.
Honest limits
Bruises still fail 14 % of layouts (mostly the fingers closing on the ripe tomato, or knocking a neighbour on the way in); in 10 % the arm still stops before the last ripe tomato; tinted or uneven light breaks the cameras (no white balance); one training run. Training on a GPU (MuJoCo MJX, Kaggle T4) was measured and was slower than the training PC for this contact-rich scene, so it stays on the CPU.
How far the fly brain reaches: the closing experiments
The goal afterwards was a near-perfect teacher and a fly brain at 95 %. The teacher got there; the brain did not.
| Attempt | Solved |
|---|---|
| Scripted teacher, rebuilt from its own failure list (1,000 new trusses) | 98 % |
| The v19 brain on that version of the task (200 trusses) | 72 % |
| Copying the teacher again (imitation, 5 variants) | best 26 % |
| + a learned speed for every neuron / all 156 command neurons instead of 64 | no effect |
| Teacher drives the start of each practice try, the brain the rest (Jump-Start RL) | 71 % (no gain) |
The cameras are not the problem: a standard machine-learning model reads the teacher's “close now” moment from exactly the brain's inputs almost perfectly, and the distance to 0.3 mm. Watching the copying brain step by step found why it froze: closing or opening the hand happens on one step per tomato, and it learned the average, a hand that stays open. Weighting those moments removed the freeze (5 to 17 of 40 trusses), but never brought copying past the brain's own practice. On this task the fly brain plateaus at 67–72 %, and the arm series ends here.
Where the arm series ends
The aim was to test whether a fly brain can learn basic human-like handling tasks with a robot arm. Over fourteen tasks it got as far as any truss of tomatoes, where it plateaus at 67–72 % (task 14). Since the next steps add more of the same kind of decision, they are left as open directions:
- Rotten and infected fruitgrey mould and rot by look and smell, into a separate reject bin so it does not spread
- A real plantleaves that hide fruit, bending stems, fruit at different heights, leaf shadows (uneven light)
- The greenhouse loopthe arm on a cart driving a loop through the rows, stopping at each plant, unloading after each lap
- Mushroom body and real armthe fly's odour-learning centre; the vision part on a low-cost real arm with real cherry tomatoes
What is biological here, and what is not
| Part | Status |
|---|---|
| Which neurons are used (eye, body sense, commands) | Real fly cell types |
| Who connects to whom, excitatory or inhibitory | Real wiring |
| Route from eye through optic lobe and central brain to commands | Real pathways |
| Connection strengths | Start from real synapse counts, then retrained |
| Neurons | Simple rate units, not spiking cells |
| The eye's input | Early arm: a 16×16 grey image. Drone and Panda: a fly-like compound eye with real photoreceptor types, but 160 instead of ~800 facets per eye and 25 instead of ~200 images per second |
| Below the brain | A controller turns hand commands into joint motions (Panda) or keeps the drone level, standing in for the nerve cord and halteres, which the brain map does not include |
| Depth (tasks 12–14) | Robot depth cameras, fed into the eye neurons by layout; flies judge distance mainly from motion, not stereo depth |
| Learning | Reinforcement learning (PPO) and imitation of a scripted teacher, not how a fly learns |
So this is not a simulated fly mind. It uses the fly brain's circuit layout as the design of a robot controller, and asks how well that design can learn tasks a fly never does.
Run it yourself
Runs on a laptop, a free Kaggle notebook or an always-on Linux PC (see scripts/desktop/).
git clone https://github.com/nihal4/connectome-tray-balance
cd connectome-tray-balance
pip install -r requirements.txt
python scripts/download_connectome.py # fly wiring + cell types
python scripts/download_panda.py # Franka Panda model (MuJoCo Menagerie)
python scripts/build_flybrain.py --eye compound --facets 160 --n 4000 --hops 5
python scripts/train.py --env panda_reach --policy connectome \
--subset data/flybrain_eye160_N4000.npz --profile desktop --random_start 0.3
