Introduction
This project connects a computational model of a fruit fly’s nervous system to a small quadrotor. The nervous system model is built directly from the wiring diagram of a real fly. The quadrotor is a Bitcraze Crazyflie 2.1 carrying a forward-facing camera and a downward-facing flow and range sensor. The camera feeds the model’s photoreceptors, the gyroscope feeds the neurons that a fly uses to sense body rotation, and the model’s wing motor neurons are read out and turned into flight commands. A learning procedure tunes the boundaries of the system, the way sensors are encoded and the way motor neurons are decoded, along with a small number of physiological constants, so that the whole thing can keep the drone in the air. The wiring itself is never changed.
The project is named Flatline, after the Dixie Flatline of Gibson’s Neuromancer: a recorded mind, run as a program, to do a job. The recorded wiring that the engine runs is called an imago, the entomological term for the adult insect and the Latin for image. A built imago is a file, and the engine animates it.
This section explains the ideas the design rests on, for readers who know software or robotics but not neuroscience, or the reverse.
Connectomes
A connectome is a map of every neuron in a piece of nervous tissue and every synapse between them, reconstructed from electron microscopy at a resolution fine enough to see individual synaptic contacts. The dataset used here is the Janelia FlyEM male central nervous system (CNS) release, version 1.0. It covers the brain, the optic lobes, and the ventral nerve cord (the fly’s equivalent of a spinal cord) of one adult male Drosophila melanogaster. It contains about 166,000 neurons with assigned cell types and about 25 million significant connections, where each connection records how many synapses link a presynaptic neuron to a postsynaptic one.
Three properties of this dataset make the project possible.
- It is complete from sense organ to muscle. Photoreceptors, the mechanosensory neurons of the halteres (the fly’s gyroscopic organs), the descending neurons that carry commands from the brain to the body, and the motor neurons that drive the wing muscles are all present and labeled.
- Each neuron has a predicted neurotransmitter. In the fly, acetylcholine is the main excitatory transmitter and GABA and glutamate are the main inhibitory ones. Knowing the transmitter tells us the sign of every connection.
- The optic lobe neurons carry coordinates on the hexagonal lattice of the compound eye, which lets us place each photoreceptor in the visual field.
A connectome is a structure, not a program. It says which neurons talk to which and how strongly, but not what any of them are doing at a given moment. To get behavior out of it, the structure has to be animated with a model of how neurons work.
Leaky integrate-and-fire models
The simplest useful model of a neuron treats its membrane voltage as a leaky capacitor. Incoming spikes push the voltage up (excitatory) or down (inhibitory), the voltage relaxes back toward a resting level with a characteristic time constant, and when it crosses a threshold the neuron emits a spike of its own, resets, and stays quiet for a brief refractory period. This is the leaky integrate-and-fire (LIF) model.
In 2024, Shiu and colleagues built a LIF model of an entire fly brain from the FlyWire connectome, with one free parameter, the voltage jump per synapse, and with connection signs taken from neurotransmitter predictions. Despite its simplicity the model reproduced known sensorimotor circuits: stimulating sugar-sensing neurons activated the feeding motor program, and stimulating specific mechanosensory neurons activated grooming. That result is the license for this project. If a signed LIF network built from a connectome recapitulates real circuits, it is worth asking what its flight circuits do when connected to a flying machine.
This project uses the same neuron model and the same initial constants, applied to the male CNS connectome, which unlike FlyWire includes the ventral nerve cord and therefore the wing motor neurons. One caution is owed up front: Shiu et al. drove spiking taste and touch neurons. This project’s main input is the retina, whose photoreceptors release histamine, an inhibitory transmitter, onto lamina cells that in the real fly signal by graded potentials rather than spikes. The design spec, section 8.6, states how this design keeps that pathway alive and how it will be checked.
How a fly flies, briefly
A fly’s flight control loop has four stages that the design mirrors.
- Vision. The compound eyes each have about 800 facets, and each facet samples one direction in the visual field. Downstream circuits in the optic lobes compute local motion, and wide-field neurons in the lobula plate integrate that motion into estimates of self-rotation and self-translation. This is optic flow processing, and it is the fly’s main source of information about drift.
- Halteres. The hindwings of flies have evolved into small club-shaped organs that beat with the wings. When the body rotates, Coriolis forces deflect them, and strain-sensing neurons at their base report the rotation. Halteres are fast gyroscopes and are essential for stable flight.
- Descending neurons. About 1,300 neurons carry commands from the brain down into the ventral nerve cord.
- Wing motor neurons. Two large power muscles drive the wingbeat, and about a dozen small steering muscles per side adjust wing stroke to produce turns, climbs, and corrections. The male CNS contains 67 wing motor neurons and 16 haltere motor neurons.
A quadrotor has none of this anatomy, so the last stage requires a translation: the pattern of activity across the wing motor neurons is mapped to the four things a quadrotor can be told to do, move sideways, move forward, turn, and climb.
The Crazyflie platform
The Crazyflie 2.1 is a 27 gram open-source quadrotor with a well-documented firmware and a Python client library. Two expansion decks are used. The AI deck adds a monochrome 324 by 324 pixel camera with an 87 degree field of view, a small processor, and a WiFi radio that can stream frames to a laptop. The flow deck v2 adds a downward time-of-flight range sensor and an optical-flow sensor, which let the firmware hold height and estimate horizontal velocity.
The firmware’s own stabilizer stays in the loop. The fly brain does not drive motors directly; it issues setpoints that the firmware executes. Two levels of setpoint are used. In hover mode the brain commands velocities and the firmware nulls drift on its own, which is safe but masks the brain’s contribution. In attitude mode the brain commands roll and pitch angles and must correct drift itself from vision and haltere input, which is the real experiment.
Evolution strategies
The parameters that must be learned are few, roughly ten thousand, and the system being tuned is a spiking network that is not differentiable in any convenient way. Evolution strategies fit this case. The optimizer keeps a mean parameter vector, samples a population of perturbed copies, runs each through a simulated flight, scores it, and moves the mean toward the perturbations that scored well. It needs only episode returns, runs identically on any hardware, and parallelizes across a population. The price is sample inefficiency, which is paid for with a batched simulator that advances many brains and many drones at once.
What to expect
It is not known whether a frozen connectome with tuned boundaries can hold a quadrotor in a hover. The literature suggests the visual and haltere circuits are the right ones, and the model will be given every sensible advantage: correct signs, correct sensory placement, a stabilizing firmware underneath, and a training curriculum that starts easy. But the project is an experiment, and the documentation is built as a lab notebook so that negative results are recorded as carefully as positive ones.