§ ESCAPE
This is the bridge to the endgame — and the endgame is now built. A looming object is read bilaterally — angular size and expansion rate, left eye vs right — and the fly flees fast in the correct direction. The direction isn't hard-coded; it falls out of the left−right looming asymmetry. And unlike the other behaviors, escape maps onto a real, mapped circuit — which now runs in the loop: the real FlyWire LC4/LPLC2 → Giant Fiber wiring, a spiking connectome driving the body (the Embodied tab).
The real circuit — now in the loop
Escape is the behavior with the cleanest known wiring diagram, which is exactly why it's the natural bridge to the connectome endgame. The amber backbone is the real circuit: a looming object read by two visual projection neuron types — LC4 (angular velocity) and LPLC2 (angular size) — converging on the Giant Fiber / DNp01, which sums size and velocity and whose single-spike timing sets a short vs long takeoff. The green rail is our hand-built stand-in mapped onto it: two bilateral loom channels stand in for LC4 + LPLC2, the learned controller for the descending readout. That stand-in is now only half the story — the real LC4/LPLC2 → DNp01 wiring has since been run as a spiking connectome in a closed loop, routing a looming cue to an embodied escape (the Embodied tab). Hover, tap, or focus any part to read its role.
Cites Ache et al. 2019 (Current Biology — Giant Fiber size/velocity encoding) and von Reyn et al. 2017 (single-spike timing → short/long takeoff). The dashed band is the seam where the real FlyWire LC4/LPLC2 → DNp01 wiring is now wired in — run as a spiking connectome alongside the hand-built front-end.
Launch the threat
The live, in-browser escape: a MuJoCo fly running the trainedcontroller, and a looming threat you launch at it from any azimuth. Each control step the loop reads the fly's pose from the sim, evaluates the analytic looming front-end against the live pose, and feeds the two eye magnitudes in — the fly bolts, and the direction falls out of the loom_L − loom_R asymmetry, never a hard-coded rule.
The trained escaper walking the real fly, live — and fleeing the threat you launch. Pick an azimuth (or click anywhere in the arena to launch from that bearing); a looming disk streaks in on a target-leading collision course. Each control step the loop reads its thorax pose from the sim, computes the bilateral loom, and bolts. The direction falls out of the loom_L − loom_R asymmetry — no flee is hard-coded. The threat geometry → loom is analytic (the hand-built stand-in for the LC4/LPLC2 → DNp01 circuit); only the response is learned.
top-down · fly-centred (north up). click anywhere to launch a threat from that bearing.
Loading the trained controller…
live MuJoCo · the loop reads thorax pose from the sim and the loom from the threat you launch, every step · loading controller…. The [0,1] loom cue is multiplied by loom_input_gain = 8before conv1 — the bang-bang warm-start gait can't be moved by an unamplified cue (the escape analog of chemotaxis's strong antenna baseline); amplifying a zero loom is still zero, so with no threat the fly just walks.
Same controller, opposite threats → opposite bolts
Two recorded rollouts of the trained fly: a threat from the left and from the right. Same controller, opposite turns — and the direction is emergent, the response to a left-vs-right looming difference, never a hard-coded rule. Left threat (90°) → bolts right (away-turn +2.07, 28 ms); right threat (270°) → bolts left (+1.48, 48 ms); head-on (0°) escapes by displacement (19.3 units).
Shared circuit across both panels: LC4 / LPLC2 → Giant Fiber (DNp01) — the same measured wiring drives both bolts; only the left−right looming asymmetry differs. A real-Drosophila reference clip belongs beside these two; that panel is a deliberate gap (a licensed asset, not a scraped one) — see the placeholder above.
Every escape, top-down — and it generalizes
The recorded rollouts as a map: each panel a fly bolting away from a threat streaking in toward its target-leading aim point. It survives on 3 of 3 trained azimuths (mean closest 17.8 units, mean reaction 40 ms) — and on the held-out diagonals {45°, 135°, 315°} it survives 3/3 too. Survival generalizes beyond the panel it was selected on.
trained front · left · right — the panel X-A was selected on
held-out diagonals never trained on — survival generalizes
loom_L − loom_R asymmetry rather than any hard-coded rule.Where the threat came from, when the fly pivoted
The hard thing to read in any escape clip is where the threat entered and the instant the fly committed to its turn — the tracking camera hides both. So here are the three embodied-loop runs drawn world-fixed, top-down, with those two moments marked from the recorded trace: the orange dot is where the looming object entered, and the green ring is the pivot— the first step after onset where the fly's turn (vs the no-threat baseline) crosses 10°. Left threat pivots away to the right, right threat to the left, and the baseline never pivots: no threat, Giant Fiber silent, it just walks.
The same three runs, top-down camera
And the recorded clips from the top-down angle — a second, world-fixed camera (R2-WP2) bolted to the arena instead of the fly, so the bolt reads as real travel across the ground rather than jitter around a re-centred fly.
These are the connectome embodied-loop runs (real FlyWire LC4/LPLC2 → DNp01 driving the body), not the hand-built escape controller above — shown here because “where was the threat, when did it pivot” is the escape question. The threat entry, course, pivot step, and both camera angles all come straight from the schema-v2 export; nothing is re-simulated in the browser.
Honest about what this is
- The looming front-end here is hand-built. On this page the threat geometry → loom signal is an analytic stand-in for the real LC4/LPLC2 → DNp01 (Giant Fiber) circuit, and only the response is learned. The connectome swap itself is no longer the endgame — the real FlyWire wiring now runs as a spiking brain in the embodied loop (the Embodied tab); the two bilateral loom channels were the clean seam it dropped into.
- loom_input_gain = 8. The [0,1] loom cue is amplified before conv1 — the bang-bang warm-start gait can't be moved by an unamplified cue (the escape analog of chemotaxis's deliberately strong antenna baseline). It is A/B-preserving: amplifying a zero loom is still zero, so with no threat the fly reproduces the closed-loop walking dynamics exactly.
- 180° (behind) is omitted.A full U-turn won't fit the ~1.2 s episode; the panel is {front, left, right} plus the held-out diagonals.
- The escape fitness scalar isn't comparable across behaviors.Its reward shaping is task-specific — don't read it against walking or chemotaxis.
What it senses
Bilateral looming.Two new sensor channels per eye — the object's angular size and its expansion rate — sampled for the left and right visual field and written into the grid each control step, the same way proprioception and the odor gradient are wired in the Sensing tab. Size is an LPLC2-like channel (≈ Gaussian, peaking near collision); expansion is an LC4-like velocity channel (≈ linear). As with chemotaxis, the signal that carries direction is the left−right difference.
The reward
React fast, flee the right way. Fitness rewards a quick, large escape away from the looming object — both the latency (how fast the takeoff fires once the object is close) and the correctness of the direction. No term tells it which wayto go; that has to be discovered from the asymmetry. (This is a different objective from the other behaviors — don't read its fitness scalar against theirs.)
The result
The direction of escape emerges from the L/R looming asymmetry. A threat looming from the left grows faster on the left eye; the same controller turns and flees right (away-turn +2.07, 28 ms), and the mirror case flips — a right threat → flee left (+1.48, 48 ms) — with nothing in the controller saying “flee away from the bigger side.” It survives 3/3 trained azimuths and the 3/3 held-out diagonals, exactly as steering emerged in chemotaxis. The live demo and the recorded map below are this result, in your browser.
Connectome link
This is the behavior that maps onto a real, mapped circuit. A looming object is detected by two lobula columnar projection neuron types — LC4 (angular velocity) and LPLC2 (angular size) — that converge on the Giant Fiber descending neuron (DNp01): ~55 LC4 + ~108 LPLC2 neurons per hemisphere onto its lateral dendrite — through hundreds of synapses (LC4 ~374–431, LPLC2 ~458–622 per side in FlyWire v783) — summing size + velocity, the timing of a single spike setting a short vs long takeoff (Ache et al. 2019; von Reyn et al. 2017). That circuit is now in the loop: the actual FlyWire LC4/LPLC2 → DNp01wiring has been run as a spiking connectome that routes a looming cue to an embodied escape — a concrete sub-circuit far smaller than the whole brain, the most tractable “a real connectome drives the body” demo, walked out on the Embodied tab. The honest line: this shows the connectome routing the cue, not a calibrated escape threshold — in isolation the Giant Fiber saturates. The diagram above marks the seam where it wired in.
The math behind this — equations and constants — is in the appendix.