Connectome-constrained visual flight control coupling a frozen Drosophila optic-lobe network (flyvis) to a recurrent central-complex circuit wired from the FlyWire adult brain connectome.
Figure 1. Three-dimensional reconstruction from FlyWire release 783 (sk_lod1_783_healed_ds2.parquet) showing the two neural systems coupled in this repository. Left panel displays the whole adult brain (139,273 neurons) with the frozen flyvis optic-lobe pathway (57 upstream retinotopic cell types in cyan and 8 direction-selective T4a-d / T5a-d output types in gold) feeding the midline central complex. Right panel shows a 4x midline zoom of all 457 reconstructed central-complex skeletons (17,041 directed edges thresholded at ≥ 5 synapses) across the protocerebral bridge (PB), ellipsoid body (EB), lateral bulbs (BU), and lateral accessory lobe (LAL).
Fly-By-Wire is a closed-loop sensorimotor control system in which a simulated Crazyflie 2.x quadcopter navigates obstacle corridors using two biologically constrained neural stages. First-person grayscale video frames rendered at BoxEye, flyvis model flow/0000/000, comprising
Figure 2. Closed-loop flight progression across training stages on held-out slalom corridor seed 10001 (1.6 m obstacle spacing). Tile headers report closed-loop survival rates across 200 held-out slalom corridors.
Figure 3. Closed-loop flight of the Stage 5b network (lptc.mode=full, 95.5% survival over 200 held-out forest corridors) navigating a forest corridor with paired pillar rows spaced every 1.6 m. Panels show the external chase view, hexagonal retinal input, top-down corridor trajectory, and 16-wedge EPG activity on the anatomical ellipsoid-body ring with true heading (solid red) and decoded heading (dashed cyan).
Figure 4. Closed-loop flight on slalom corridor seed 10001 with EPG compass neurons silenced at t = 6.0 s. Silencing EPG extinguishes the ellipsoid-body bump, removes downstream drive to PFL3, and causes the quadcopter to lose directional control.
Figure 5. Closed-loop architecture (compiled from docs/media/architecture.tex). Grey blocks are frozen, pink blocks are trained, and each badge gives the block's clock rate. Gradients stop at the T4/T5 output of the optic lobe (dashed red line); behavior cloning reads cached fp16 T4/T5 voltages from disk and never runs flyvis.
Timing relationships are defined in flybywire/clocks.py (Clocks) and shared across trajectory collection, cache generation, behavior cloning, and reinforcement learning.
| Subsystem | Frequency | Step Interval | Ticks per Decision | Role |
|---|---|---|---|---|
PyBullet Physics & PID (BaseAviary) |
Rigid-body aerodynamics and DSLPIDControl velocity tracking |
|||
Retina, flyvis Stepper & CX Core |
Frame rendering, optic-lobe integration, and recurrent CX update | |||
PFL3 Actor Readout |
Action emission after sensory tick |
An episode of
The recurrent core is built from FlyWire Codex snapshot 783 (flybywire/connectome/flywire.py). Synaptic counts between each presynaptic and postsynaptic root ID are summed across all neuropils before applying the threshold syn_count
| Cell Group | Glob Pattern | Neurons ( |
Anatomical Compartments | Circuit Role in Model |
|---|---|---|---|---|
ER* |
Lateral Bulbs (BU) |
Exclusive target of visual self-motion projection |
||
EPG* |
Ellipsoid Body (EB) |
Compass wedge neurons ( |
||
PEN* |
Protocerebral Bridge (PB) |
Angular-velocity shift neurons (PEN_a/PEN1, PEN_b/PEN2) |
||
PEG* |
Protocerebral Bridge (PB) |
Recurrent bridge-to-ellipsoid maintenance neurons | ||
Delta7* |
Protocerebral Bridge (PB) | Bridge-wide inhibitory shaping interneurons | ||
PFL3* |
PB & Fan-Shaped Body (FB) |
Exclusive source for |
||
| Total |
|
Single recurrent population with zero off-mask pathways |
Parameter counts are reported by scripts/count_params.py (make params). Off-mask entries of
| Component | Shape / Structure |
gains + learned
|
gains + anatomical
|
full + anatomical
|
|---|---|---|---|---|
| Connectome weights |
|
|||
| Core time constants & biases ( |
||||
| Input projection ( |
||||
LPTC pooling (LPTCPool) |
|
|||
| Heading decoder ( |
|
|||
| Actor head ( |
||||
| Total Behavior Cloning | Excludes critic MLP | |||
| Value critic MLP (PPO only) | ||||
| Total with Critic | All modules |
Frames (BoxEye into yaw, pitch, roll, forward, lateral, vertical, loom_left, loom_right) the ego-motion flow field flybywire/vision/flowfields.py). Each flybywire/vision/directions.py). Templates flyvis voltages flybywire/vision/lptc.py):
lptc.mode=gains trains only the gains lptc.mode=full trains the templates
flybywire/core/population.py):
The heading target is flybywire/core/heads.py) gives each of the scripts/epg_anatomy.py), and trains only a gain and bias: flybywire/eval/ring.py) is the first-harmonic fraction
At decision
Behavior Cloning. Truncated BPTT over windows of flybywire/train/bc.py). Action and heading errors are averaged over the decisions
PPO. Clipped surrogate (flybywire/train/ppo.py).
The rewire condition (flybywire/connectome/rewire.py) applies
Three quantitative gates were specified prior to model training to validate the sensory interface, motion decodability, and compass representation.
| Gate | Verification Target | Quantitative Criterion | Measured Outcome | Status |
|---|---|---|---|---|
| 1 | Stateful step-by-step flyvis equivalence & speed |
Max relative error |
Max relative |
PASS |
| 2 | Linear yaw-rate decodability from corridor |
Ridge regression |
Test |
PASS |
| 3 |
|
Test heading |
Heading |
FAIL |
Controlled comparisons between the biological FlyWire adjacency matrix (real) and seeded degree-preserving rewires (rewire) were executed across three pre-registered experimental protocols in docs/protocols/.
Trained on
| Mask / Readout | Seeds | Open-Loop Heading |
Anatomical Bump Share | Closed-Loop per Seed ( |
Closed-Loop Mean over |
|---|---|---|---|---|---|
real / learned
|
|
|
|||
rewire / learned
|
|
|
|||
real / anatomical
|
|
|
|||
rewire / anatomical
|
|
|
Across the real and rewire produce identical first-harmonic bump shares (rewire achieves a higher mean survival rate (
On real) versus rewire). On the pre-registered replication subset (seeds
To test whether multi-stable heading attractors near flyvis state-branching bank).
| Condition (Anatomical Readout) | Seeds | 2 s Hold Drift ( |
Velocity Field RMS ( |
Bump Share | Closed-Loop Survival |
|---|---|---|---|---|---|
Uniform holds, real
|
|
||||
Uniform holds, rewire
|
|
||||
Discrete angles control, real
|
- | ||||
Discrete angles control, rewire
|
- |
Time-freeze pause training reduces 2-second heading drift under a held visual frame from real and rewire masks remain statistically indistinguishable across drift (
When evaluated on denser obstacle layouts, networks using fixed 8-channel LPTC flow templates (lptc.mode=gains) occasionally collided with pillars positioned directly on the flight axis. A diagnostic classification probe (scripts/probe_pillar_dodge.py) across
| Feature Representation | Feature Dimension | Linear Probe (All / Dead Ahead) | 2-Layer MLP Probe (All / Dead Ahead) |
|---|---|---|---|
| Privileged obstacle geometry ( |
|
|
|
Fixed 8-channel LPTC (lptc8) |
|
|
|
Fixed lptc8 with |
|
|
|
|
|
|
|
|
Raw frozen flyvis |
While raw lptc.mode=full, initialized from the calibrated flow templates) resolves this bottleneck across every corridor difficulty level (
| Training Stage / Network | Default ( |
Spaced ( |
Dense ( |
Slalom ( |
Forest ( |
|---|---|---|---|---|---|
| Scripted expert (privileged state) |
|
|
|
|
|
| Untrained network |
|
- | - |
|
- |
|
Stage 1. BC, plain expert ( |
|
- | - |
|
- |
|
Stage 2. BC, turning expert ( |
|
- | - |
|
- |
|
Stage 3. BC, DART + DAgger ( |
|
|
|
|
- |
|
Stage 4. + Spaced/Dense/Slalom ( |
|
|
|
|
|
Stage 5a. + Forest data, lptc.mode=gains
|
|
|
|
|
|
Stage 5b. + Forest data, lptc.mode=full
|
Inference-time silencing (m_keep[group] = 0) across scripts/eval_lesions.py) reveals dissociable functional roles among central-complex populations. Bump tracking gain measures the ratio of ellipsoid-body bump rotation to physical quadcopter yaw rotation across
| Silenced Cell Group | Stage 3 Survival | Stage 3 Heading Error | Stage 3 Bump Gain | Stage 4 Survival | Stage 4 Heading Error | Stage 4 Bump Gain | Observed Closed-Loop Phenotype |
|---|---|---|---|---|---|---|---|
| None (Intact) |
|
|
Normal obstacle avoidance and compass tracking | ||||
|
|
|
|
Bump vanishes, |
||||
|
|
|
|
Direct |
||||
|
|
|
|
Compass ring remains intact ( |
PPO fine-tuning (flybywire/train/ppo.py) was evaluated from Stage 3 (real_anatomical_s5, dense_s5,
All experiments were developed and run on a single workstation. make check prints the equivalent preflight table for any machine.
| Component | Specification |
|---|---|
| Operating system | Kubuntu 26.04.1 LTS |
| CPU | Intel Core i7-14700 |
| Memory | 32 GB DDR5 |
| GPU | NVIDIA GeForce RTX 5060 Ti, 16 GB, Blackwell sm_120 (compute capability 12.0) |
| GPU driver | NVIDIA 595.99.02, CUDA 13.2 |
| Python / PyTorch | Python 3.12.15, PyTorch 2.14.1+cu130 (fp32 throughout) |
| Simulation and vision | flyvis 1.2.0, gymnasium 1.4.0, gym-pybullet-drones 2.2.0 |
| Rendering (160x160) | EGL 1.76 ms/frame, TinyRenderer 3.89 ms/frame (TinyRenderer is the default; EGL draws shadow-map artefacts) |
The environment requires Linux or WSL2 on a Linux filesystem, an NVIDIA GPU (Blackwell sm_120 cards require CUDA build-essential) to compile pybullet, and system libraries libgl1, libegl1, and libglib2.0-0. Python 3.12 is required to satisfy both gym-pybullet-drones >= 2.2.0 (>=3.12) and flyvis 1.2.0 (<3.13).
make env # runs bash scripts/setup_env.sh to build conda env "flybywire"
conda activate flybywire
make check # verifies GPU compute capability, CUDA arch list, flyvis weights, and EGL/TinyRendererAll datasets reside under data/ (configured via .env with FLYVIS_ROOT_DIR=./data/flyvis and FBW_DATA_DIR=./data).
1. Pretrained flyvis Optic-Lobe Models (automated by make env)
FLYVIS_ROOT_DIR=$PWD/data/flyvis flyvis download-pretrained --skip_large_files2. FlyWire Snapshot 783 Connectome Tables
Download the following release 783 files from FlyWire Codex and place them in data/flywire/raw/ matching the schema in configs/default.yaml.
connections_princeton.csvcontaining columnspre_root_id,post_root_id, andsyn_countconsolidated_cell_types.csvcontaining columnsroot_idandprimary_typenames.csvcontaining columnsroot_idandname
Build the processed central-complex graph data/flywire/processed/cx_graph.npz.
python -m flybywire.connectome.flywire3. FlyWire 3D Neuron Skeletons (for Anatomical EPG Ring Angles and 3D Brain Rendering)
Download sk_lod1_783_healed_ds2.parquet (data/flywire/skeletons/ and extract the ellipsoid-body anatomical angles.
python -I scripts/epg_anatomy.py data/flywire/skeletons/sk_lod1_783_healed_ds2.parquet \
--out data/flywire/processed/epg_eb_angles.npz --report-dir runs/anatomyThe checkpoints behind the results and figures are tracked in the repository at the paths the commands below use (about 1.4 MB each, CC BY-NC 4.0, see License). Loading one still builds the model from data/flywire/processed/cx_graph.npz, data/flywire/processed/epg_eb_angles.npz and data/flyvis/direction_map.json, so complete the data setup above and make calibrate first.
| Stage | Checkpoint |
|---|---|
| 1. BC, plain expert | runs/bc/real_s0/model.pt |
| 2. BC, turning expert | runs/bc/turns_s0/model_best.pt |
| 3. BC, DART + DAgger | runs/sweep_dart/real_anatomical_s5/model_best.pt |
| 4. + Spaced/Dense/Slalom | runs/curriculum/dense_s5/model.pt |
5a. + Forest, lptc.mode=gains |
runs/curriculum/forest_gains_s5/model.pt |
5b. + Forest, lptc.mode=full |
runs/curriculum/forest_full_s5/model.pt |
| Artifact | Measured Disk Size |
|---|---|
Conda environment (flybywire) |
|
flyvis pretrained ensemble + connectome cache |
|
| FlyWire raw CSV tables + 3D skeleton parquet | |
Stored expert trajectories (hexals fp16, actions, state) |
|
|
|
|
| Checkpoints, evaluation reports, and media |
make check # hardware and dependency verification table
make test # runs pytest suite verifying architectural invariants 1-10
make params # prints trainable parameter breakdown and connectome-to-LPTC ratios
make smoke # end-to-end pipeline verification on synthetic trajectories (~20 s)
make gate1 # Gate 1 stateful flyvis equivalence and throughput -> runs/gate1/report.json
make calibrate # calibrates T4a-d / T5a-d preferred directions -> data/flyvis/direction_map.json# Baseline 300-episode collection and Gate 2 linear yaw-rate decoding
make collect # 300 scripted-expert episodes -> data/expert
make cache # steps frozen flyvis over stored hexals -> data/cache
make gate2 # ridge regression T4/T5 -> yaw rate -> runs/gate2/report.json
# DART turning-expert collection (1000 train episodes + 100 test episodes)
NOISE="expert.exec_noise={sd: [0.1, 0.25, 0.0, 0.8], tau_s: 0.5, scale: [0.0, 1.0]}"
python scripts/collect_expert.py --n 1000 --seed 0 --out data/expert_dart "$NOISE"
python scripts/collect_expert.py --n 100 --seed 2000 --out data/expert_dart_test "$NOISE"
# Curriculum expert collection across Spaced, Dense, Slalom, and Forest levels (400 episodes each)
python scripts/collect_expert.py --n 400 --seed 3000 --out data/expert_spaced \
env.obstacle_spacing_m=2.5 env.n_obstacles=9 "$NOISE"
python scripts/collect_expert.py --n 400 --seed 3000 --out data/expert_dense \
env.obstacle_spacing_m=2.0 env.n_obstacles=12 expert.speed=1.0 expert.max_heading_deg=65 expert.influence_m=0.5 "$NOISE"
python scripts/collect_expert.py --n 400 --seed 3000 --out data/expert_slalom \
env.obstacle_spacing_m=1.6 env.n_obstacles=14 expert.speed=1.0 expert.max_heading_deg=65 expert.influence_m=0.5 "$NOISE"
python scripts/collect_expert.py --n 400 --seed 3000 --out data/expert_forest \
env.obstacle_spacing_m=1.6 env.n_obstacles=20 env.pair_prob=0.5 expert.speed=1.0 expert.max_heading_deg=65 expert.influence_m=0.5 "$NOISE"
# Build the combined 2600-episode T4/T5 memmap cache
python scripts/build_cache.py \
--traj-dir data/expert_dart data/expert_spaced data/expert_dense data/expert_slalom data/expert_forest \
--out data/cache_curriculum# Train a single BC model with the anatomical EPG population-vector readout
python -m flybywire.train.bc --cache data/cache_dart_agg2 --out runs/sweep_dart/real_anatomical_s5 \
seed=5 connectome.mask_type=real heads.decoder=anatomical
# Multi-seed real vs. rewired sweep
python -m flybywire.train.sweep --cache data/cache_dart_agg2 --out runs/sweep_dart \
sweep.conditions=[real,rewire] sweep.decoders=[learned,anatomical] sweep.seeds=[0,1,2,3,4,5]
# Stage 4 dense-corridor fine-tuning
python -m flybywire.train.bc --cache data/cache_curriculum --out runs/curriculum/dense_s5 \
--init runs/sweep_dart/real_anatomical_s5/model_best.pt heads.decoder=anatomical bc.lr=3e-4 bc.epochs=20
# Stage 5b fine-tuning with learnable LPTC spatial templates (lptc.mode=full)
python -m flybywire.train.bc --cache data/cache_curriculum --out runs/curriculum/forest_full_s5 \
--init runs/curriculum/dense_s5/model.pt heads.decoder=anatomical lptc.mode=full bc.lr=3e-4 bc.epochs=20
# Stage 5a gains-only control (lptc.mode=gains)
python -m flybywire.train.bc --cache data/cache_curriculum --out runs/curriculum/forest_gains_s5 \
--init runs/curriculum/dense_s5/model.pt heads.decoder=anatomical lptc.mode=gains bc.lr=3e-4 bc.epochs=20python -m flybywire.train.ppo \
--bc runs/curriculum/dense_s5/model.pt \
--out runs/ppo/dense_s5_forest \
--watch --record-every 50 \
env.obstacle_spacing_m=1.6 env.n_obstacles=20 env.pair_prob=0.5# Gate 3 open-loop heading R^2 and 16-wedge Fourier bump share
python scripts/gate3_heading_decode.py \
--ckpt runs/sweep_dart/real_anatomical_s5/model_best.pt \
--cache data/cache_dart_test \
--out runs/gate3_dart/real_anatomical_s5
# Closed-loop survival and forward progress across all curriculum corridor levels
python scripts/eval_curriculum.py \
--ckpts "stage4=runs/curriculum/dense_s5/model.pt" \
"gains=runs/curriculum/forest_gains_s5/model.pt" \
"full=runs/curriculum/forest_full_s5/model.pt" \
--levels default spaced dense slalom forest --n 200 --seed 10000 \
--out runs/curriculum/eval_forest_stage.json
# Closed-loop cell-type lesions (intact, EPG, PEN, Delta7) across 200 held-out episodes
python scripts/eval_lesions.py --ckpt runs/curriculum/dense_s5/model.pt \
--n 200 --seed 10000 --out runs/lesions/dense_s5
# Visual bottleneck probe comparing raw T4/T5 vs fixed LPTC channels on pillar dodge direction
python scripts/probe_pillar_dodge.py --out runs/probe/report.jsonCell groups can be silenced programmatically in Python using flybywire/core/lesion.py.
from flybywire.config import load_config
from flybywire.core.model import build_model
from flybywire.core.lesion import lesioned
model = build_model(load_config())
model.lesion(["EPG"]) # zeroes EPG firing rates on all subsequent steps
model.restore()
with lesioned(model, ["PEN", "D7"]): # context-managed lesion
...Regenerate all figures, animations, and the interactive dashboard with the following commands.
# 1. 3D rotating FlyWire brain and Central Complex connectome GIF (Figure 1)
python scripts/render_brain_3d.py --out docs/media/fly_brain_3d.gif --frames 72 --fps 20
# 2. Multi-stage slalom flight progression GIF (Figure 2)
python scripts/render_progress.py --out docs/media/progress.gif --seed 10001 --seconds 12 \
env.obstacle_spacing_m=1.6 env.n_obstacles=14 \
--stages "untrained=untrained" \
"1. BC, plain expert (25.5%)=runs/bc/real_s0/model.pt" \
"2. + turns (31.5%)=runs/bc/turns_s0/model_best.pt" \
"3. + DART, DAgger (54.5%)=runs/sweep_dart/real_anatomical_s5/model_best.pt" \
"4. + dense corridors (70.0%)=runs/curriculum/dense_s5/model.pt"
# 3. Closed-loop forest corridor flight GIF (Figure 3)
python scripts/render_lesion_video.py --ckpt runs/curriculum/forest_full_s5/model.pt \
--out docs/media/dashboard_forest.mp4 --gif docs/media/dashboard_forest.gif \
--seed 10001 --seconds 10 \
env.obstacle_spacing_m=1.6 env.n_obstacles=20 env.pair_prob=0.5 --schedule
# 4. Closed-loop slalom flight with mid-flight EPG lesion at t = 6 s (Figure 4)
python scripts/render_lesion_video.py --ckpt runs/curriculum/dense_s5/model.pt \
--out docs/media/dashboard.mp4 --gif docs/media/dashboard.gif \
--seed 10001 --seconds 12 \
env.obstacle_spacing_m=1.6 env.n_obstacles=14 --schedule EPG:6-12
# 5. Compile TikZ architecture diagram to PDF and 300-DPI PNG (Figure 5)
pdflatex -interaction=nonstopmode -output-directory=docs/media docs/media/architecture.tex
pdftoppm -png -r 300 -singlefile docs/media/architecture.pdf docs/media/architecture
# 6. Launch interactive Streamlit flight dashboard with live cell-type lesion toggles
streamlit run flybywire/dash/app.py -- --ckpt runs/curriculum/forest_full_s5/model.ptconfigs/
default.yaml # Single configuration source (clocks, vision, connectome, core, BC, PPO, curriculum)
flybywire/
clocks.py # Multi-rate timing definitions (200 Hz physics, 100 Hz sensory/core, 25 Hz actor)
config.py # OmegaConf loader and directory resolution
paths.py # Safe flyvis import wrapper preserving working directory and torch default device
connectome/
celltypes.py # Connectome container and cell-type glob matching
flywire.py # FlyWire snapshot 783 loader and synapse aggregation
masks.py # Connectome builder (real, rewire, Erdos-Renyi) and EB angle loader
rewire.py # Seeded directed degree-preserving double-edge swap algorithm
vision/
boxeye.py # Hexagonal retinal filter (160x160 frame -> 721 ommatidia)
directions.py # T4/T5 grating direction calibration and baseline extraction
farneback.py # Classical OpenCV dense optical-flow fallback backend
flowfields.py # Longuet-Higgins & Prazdny ego-motion flow templates on hexal coordinates
flyvis_stepper.py # Frozen stateful flyvis integrator with per-environment reset
lptc.py # LPTCPool module (frozen, gains, and full template modes)
stimuli.py # Synthetic drifting gratings and panoramas
core/
heads.py # InputProjection (ER), HeadingDecoder / AnatomicalHeadingDecoder (EPG), Actor (PFL3), Critic
lesion.py # Cell-type lesion mask helpers and context manager
model.py # Multi-rate FlyByWireModel assembly
population.py # CentralComplex leaky rate population masked by W * M
data/
cache.py # Memory-mapped fp16 T4/T5 trajectory cache reader/writer
pause_bank.py # Precomputed state-branched time-freeze pause bank
trajectories.py # Expert episode storage and relative heading targets
envs/
corridor.py # PyBullet CF2X obstacle corridor environment
expert.py # Potential-field scripted expert with turning maneuvers and DART noise
vec.py # Spawned AsyncVectorEnv wrapper with SAME_STEP autoreset
train/
bc.py # Truncated-BPTT behavior cloning trainer
ppo.py # Recurrent PPO trainer with KL anchor and GAE
sweep.py # Parallel multi-seed condition sweep runner
watch.py # Live training viewer and streaming MP4 episode recorder
eval/
closed_loop.py # Parallel closed-loop flight evaluator and DAgger recorder
darkness.py # Visual stasis and grey-screen drift diagnostics
live.py # Real-time flight renderer for lesion videos and dashboard
metrics.py # Circular error and joint sin/cos R^2 metrics
ring.py # 16-wedge ellipsoid-body ring layout and Fourier bump analysis
topography.py # Circular correlation, PCA ring-plane fitting, and permutation tests
dash/
app.py # Interactive Streamlit flight and lesion dashboard
scripts/ # CLI entry points for gates, calibration, data collection, probes, and media rendering
tests/ # Pytest suite enforcing architectural invariants 1-10
docs/
media/ # Rendered GIFs, TikZ architecture diagram source, and compiled figures
protocols/ # Pre-registered statistical protocols for connectome comparisons
- Lappalainen, J. K., Tschopp, F. D., Prakhya, S., McGill, M., Nern, A., Shinomiya, K., Takemura, S., Reiser, M. B., Turaga, S. C., & Srini, S. (2024). Connectome-constrained networks predict neural activity across the fly visual system. Nature, 634, 1132-1140. doi:10.1038/s41586-024-07939-3
- Dorkenwald, S., Matsliah, A., Sterling, A. R., Schlegel, P., Yu, S. C., McKellar, C. E., Lin, A., Costa, M., Eichler, K., Yin, Y., Silversmith, W., Schneider-Mizell, C., Jordan, C. S., & Seung, H. S. (2024). Neuronal wiring diagram of an adult brain. Nature, 634, 124-138. doi:10.1038/s41586-024-07558-y
- Schlegel, P., Yin, Y., Bates, A. S., Dorkenwald, S., Eichler, K., Brooks, P., Han, D. S., Gkantia, M., Dos Santos, M., Munnelly, E. J., Badalamente, G., Serratosa Capdevila, L., Ito, M., & Jefferis, G. S. X. E. (2024). Whole-brain annotation and multi-connectome cell typing of Drosophila. Nature, 634, 139-152. doi:10.1038/s41586-024-07686-5
- Hulse, B. K., Haberkern, H., Franconville, R., Turner-Evans, D. B., Takemura, S., Wolff, T., Noorman, M., Dreher, M., Dan, C., Parekh, R., Hermundstad, A. M., Rubin, G. M., & Jayaraman, V. (2021). A connectome of the Drosophila central complex reveals network motifs suitable for flexible navigation and context-dependent action selection. eLife, 10, e66039.
- Seelig, J. D., & Jayaraman, V. (2015). Neural dynamics for landmark orientation and angular path integration. Nature, 521, 186-191.
- Turner-Evans, D., Wegener, S., Rouault, H., Franconville, R., Wolff, T., Seelig, J. D., Druckmann, S., & Jayaraman, V. (2017). Angular velocity integration in a fly heading circuit. eLife, 6, e23496.
- Green, J., Adachi, A., Shah, K. K., Hirokawa, J. D., Magani, P. S., & Maimon, G. (2017). A neural circuit architecture for angular integration in Drosophila. Nature, 546, 101-106.
- Westeinde, E. A., Kellogg, E., Dawson, P. M., Lu, J., Hamburg, L., Midler, B., Druckmann, S., & Wilson, R. I. (2024). Transforming a head direction signal into a goal-oriented steering command. Nature, 626, 819-826.
- Krapp, H. G., & Hengstenberg, R. (1996). Estimation of self-motion by optic flow processing in single visual interneurons. Nature, 384, 463-466.
- Longuet-Higgins, H. C., & Prazdny, K. (1980). The interpretation of a moving retinal image. Proceedings of the Royal Society of London. Series B, Biological Sciences, 208(1173), 385-397.
- Laskey, M., Lee, J., Fox, R., Dragan, A., & Goldberg, K. (2017). DART: Noise injection for robust imitation learning. Conference on Robot Learning (CoRL), PMLR 78, 143-156.
- Panerati, J., Zheng, H., Zhou, S., Xu, J., Prorok, A., & Schoellig, A. P. (2021). Learning to fly: a Gym environment with PyBullet physics for reinforcement learning of multi-agent quadcopter control. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 7512-7519.
- Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347.
If you use this code, please cite the repository:
@misc{flybywire2026,
author = {NotArsenic},
title = {Fly-By-Wire: Connectome-Constrained Visual Flight Control with a FlyWire Central Complex},
year = {2026},
publisher = {GitHub},
howpublished = {\url{https://github.com/NotArsenic/FlyByWire}}
}Please also cite flyvis (Lappalainen et al., 2024) and FlyWire (Dorkenwald et al., 2024; Schlegel et al., 2024), listed under References.
The code is released under the MIT License (LICENSE). The model checkpoints under runs/ and docs/media/fly_brain_3d.gif contain or are rendered from FlyWire connectome data and are released under CC BY-NC 4.0 (LICENSE-DATA): they may not be used commercially, and reuse must cite FlyWire (Dorkenwald et al., 2024; Schlegel et al., 2024).




