Skip to content

Explore oruk

← Research
9 min read

We taught a fruit fly to hear human emotion

We took 499 neurons from a fruit fly's wiring diagram, copied their connections into software, and fed them human voices. A small output layer learned to predict the emotion labels people had given those recordings.

Most of this model never learned anything about speech. The connections inside the fly circuit stayed fixed through training. We only taught a readout what to make of the activity that came out.

Loading the reconstructed neurons…
Each neuron and its branches take the color of their strongest relative emotion response, averaged across 10,099 recordings. We account for each emotion's overall activity level first. Brighter branches show a larger lead over the next emotion; weak preferences fade into the background.

The model uses 499 neurons from the fly's central brain. We gave them an artificial input pathway and simple mathematical dynamics. The task is to predict how a voice sounds to a listener; this experiment says nothing about whether a living fly understands human feelings.

Building a neural network from a fly brain

The MaleCNS release includes connection tables and reconstructed neuron shapes. We selected a densely connected group in which every neuron can reach every other neuron through some directed path. That gave us 15,865 connections, supported by 867,344 synaptic contacts.

A connection in the model gets stronger when the reconstruction contains more synaptic contacts. We also assign positive or negative signs using neurotransmitter annotations. These are engineering choices: a wiring diagram does not supply every receptor, time constant or physiological detail needed to simulate the original cells.

What it does supply is a recurrent network. A signal can travel through several neurons and feed back into cells it has already reached. We wanted to see what that network would do with a human voice.

Teaching the model to recognize emotion

Every 10 milliseconds, we turn the sound into 32 numbers describing its energy across frequency bands. A fixed random projection sends those numbers into the circuit. Each neuron combines that input with the previous activity of its neighbors and retains part of its own previous state. The resulting activity depends on both the present sound and what happened just before it.

This is reservoir computing. You feed a signal through a fixed recurrent network and train a small model to read its response. Suárez and colleagues built conn2res to study this with biological connectomes. Costi and colleagues have already used a fruit fly connectome for time-series prediction. Our experiment applies the approach to listener judgments of speech.

Voice32 audio bandsFly circuit499 fixed neuronsReadoutlearned weights31 labelsPooled audio also goes directly to the readoutVoice32 audio bandsFly circuit499 fixed neuronsReadoutlearned weights31 labelsPooled audioalso entersthe readout

We average the neuron states within four successive parts of each recording and fit a linear readout to 15 emotion labels and 16 speaking styles. The readout also gets a direct set of pooled audio features. That branch matters: some of what this model predicts can come straight from the voice without passing through the fly circuit.

Training used 16,995 voice clips. We chose the settings on a separate validation set, then evaluated the models on 2,022 test clips. Known speakers stay in one split; where speaker identity is unreliable, we keep the entire source corpus together.

What emotional speech does to the network

These six recordings pass through the same circuit. Drag any brain to turn all six views, or move the shared slider to compare the activity at the same point in each clip. The heatmaps keep the neurons in the same order and use one intensity scale. Open “Listen to the examples” to hear each recording.

Loading the reconstructed neurons…
Each panel is one held-out recording, colored by a human listener's label. The common cursor follows relative clip progress; the counters show each clip's own time in seconds. Heatmap rows are neurons, columns are time, and darker color means larger absolute model activity. The clips differ in speaker and words as well as perceived emotion.

Those differences limit what we can infer from the picture. A bright patch can reflect the words, pitch, speaker or recording conditions. Calling the indigo cells "sadness neurons" would turn a color choice into a finding. We use these examples to inspect the model; the held-out test is where we measure whether it learned anything useful.

Scrambled wiring worked just as well

A fly-shaped network is an appealing thing to look at. The harder question is whether the biological wiring helps.

We shuffled the destinations of the connections, preserving each source neuron's outgoing connection count, signs and weight values before rescaling. Then we selected the settings and trained a new readout for that network. We also trained an audio-only model and a version with the connections between neurons removed.

Loading the reconstructed neurons…
Mean average precision gives equal weight to all 31 labels and measures how well each model ranks positive examples. It is not classification accuracy. The intervals resample 45 held-out speaker/corpus groups. Use the selector to highlight a control.

Fly wiring scored 16.84% mAP. Scrambled wiring scored 16.88%. Their paired difference was −0.04 percentage points, with a 95% interval from −0.16 to +0.07. On this split, the two were effectively tied.

Constant scores give 9.71% mAP on this test set, so the models learned some useful ranking. This is a modest speech classifier, and the comparison gives us no evidence that the fly's particular wiring is an advantage.

What happens when 50 neurons go silent?

The next experiment holds the trained readout fixed and changes what it receives. Move the slider below to silence neurons, starting with those that have the largest readout weights. The browser removes their input and recurrent connections, runs the voice through the circuit again, and calculates new output scores.

Loading the reconstructed neurons…
Both panels receive the same angry-labeled recording. The slider selects neurons by the norm of their trained readout coefficients, across all labels. Silencing removes incoming, outgoing and input weights without retraining or rescaling. The readout scores refer to the complete clip; play the audio to compare the two activity traces.

With all 499 neurons intact, the anger score for this recording is +0.29. Switch off 50 and it drops to −0.43. These are raw linear scores, so the negative value has no interpretation as a probability. It means the altered circuit gives the fixed readout less evidence for that label.

The effect extends beyond this one clip. For this fitted model, silencing the same 50 neurons drops test mAP from 16.91% to 10.83%. Those neurons are useful to the readout we trained. That does not make them biological emotion cells, or show that their wiring was the best starting point.

There is no contradiction between this result and the scrambled control. A readout learns to use the features its circuit produces. Remove part of that circuit after training and the features change under it. Give a different circuit its own training run and its readout can learn to use different features just as well.

I'd repeat this with many different fly circuits and the same sentence spoken in several emotional styles. This run used one circuit and mostly one listener judgment per recording. Both choices could matter more than the fly.

How we ran the experiment

The dataset contains 21,256 distinct waveforms and 21,600 retained ratings: 16,995 training clips, 2,239 validation clips and 2,022 test clips. Most recordings have one listener rating. Repeated ratings become soft targets; evaluation treats a label selected by at least half of the available ratings as positive. Exact duplicate audio and speaker/corpus groups have no overlap across splits.

The 499 neurons form the largest strongly connected component among the 512 strongest eligible central-brain intrinsic neurons in MaleCNS v1.0. We retained traced cells with the modeled transmitter signs and at least five contacts per edge. We assign acetylcholine a positive sign and GABA and glutamate negative signs. Each weight starts as sign × log(1 + contact count), followed by global spectral scaling. These assignments are model assumptions.

x[t] = (1 − α)x[t−1] + α tanh(Wx[t−1] + Wᵢₙu[t])

The interactive circuit uses α = 0.15 and a target spectral radius of 0.9.

Audio is resampled to 8 kHz, converted to 32 log-mel bands with a 25 ms window and 10 ms hop, normalized using training frames, and clipped to ±5. Four temporal means of 499 states are concatenated with 128 pooled audio features. The 31-output ridge readout is the only learned part. The demos use the validation-selected seed-42 model, input scale 0.3 and ridge penalty 10.

The model comparison averages three prespecified seeds per reservoir architecture; the audio-only baseline is deterministic. The 95% intervals use 500 paired bootstrap resamples of the 45 test speaker/corpus groups, without refitting. They are conditional on this split and these fitted models. The single-model intervention starts at 16.91% mAP, which differs from the 16.84% three-seed mean.

The six recordings are illustrative positive held-out examples from CREMA-D and VCTK. Display labels come from listener judgments and can differ from the emotion an actor was asked to perform. We selected the public excerpts for illustration and redistribution; their selection does not change the fitting, split or benchmark results.

The opening map uses all 10,099 training clips with at least one of its six emotion labels at a listener-vote fraction of 0.5 or higher. Each recording starts from zero state. We take absolute neuron activity, interpolate each recording onto 241 equally spaced points from its first to last frame, and average with equal weight per clip within each emotion. Clips with several labels enter each relevant average. We do not select clips by model score, balance speakers or corpora, or align words. The four-second animation follows relative recording progress. Counts and aggregation details.

For the opening view, each emotion's mean activity is divided by its mean across the circuit at that time point. Each neuron takes the color of the largest normalized response. Preference strength is the gap between its top two emotions divided by its mean across all six. A fixed 0–15% gap range controls opacity and point size, with square-root scaling for the points. Larger gaps saturate; ties have no emotion color. This describes relative model responses, without testing their statistical significance or identifying biological modules.

The browser uses saved model states for playback and recomputes the full retained graph for interventions. The anatomy views sample every fourth cached centerline segment within each of all 499 neurons and quantize coordinates for display. The opening map colors points and reconstructed branches by their owning neuron's current preference. This affects drawing detail, not the simulation. The individual-recording views use a fixed absolute-state range of 0 to 0.8. Heatmaps average subpixel rows at display resolution. Color identifies the listener label, not a cell type or biological function.

Anatomy and connectivity: MaleCNS v1.0, FlyEM at HHMI Janelia, University of Cambridge, MRC Laboratory of Molecular Biology and Google Research, licensed CC BY. Adaptation: selected circuit, simplified rendering and simulated activity. Background: Suárez et al., 2024; Costi et al., 2025.

Audio: CREMA-D, Cao and colleagues (2014), under the Open Database License and Database Contents License; CSTR VCTK 0.92, Yamagishi, Veaux and MacDonald (2019), CC BY 4.0. Excerpts are converted to mono PCM at their original speed. Clip sources, licenses and adaptation details.

The interactive figures include the fitted 499-neuron model and six demonstration excerpts. The full speech-labeling dataset and listener records remain private.