cat README
RIPE OR ROTTING
Hunger, yeast and distance decide which banana a simulated fruit fly chooses. A simulation that runs from the chemistry of a real banana, through the air and the complete wiring diagram of a fly's nervous system, to the fly's decision to fly to it and eat.
preprint draftSep 2026Charbel KassabPython · MaleCNS v1.0 connectome
Flies deprived of food and protein search the odour plumes of a ripe (blue) and a rotting (orange) banana. Grey flies are casting; green flies surge upwind after their simulated brain detects the odour; yellow flies are feeding.
cat question.txt
Fruit flies end up on rotting fruit. But is that because rotting fruit smells louder, because it tastes better, or because the fly's hunger, for energy or for protein, changes how it values both? Those explanations are usually tangled together. A simulation lets you pull them apart and switch each one on and off.
./summary --numbers
165,122
neurons in the simulated male fly nervous system
10×
lower odour detection threshold for rotting banana
8–19 m
detection range for rotting banana, vs 2–6 m ripe
4 / 9
checks against real fly data passed
ls pipeline/
01 chemistry
Fruit
14 days of ripening and yeast fermentation: sugars, ethanol, acetic acid, yeast, by-products, pH.
02 emission
Volatiles
How fast 11 odour molecules and CO₂ leave the fruit, from Henry's-law constants and temperature.
03 atmosphere
Plume
A turbulent, intermittent odour plume in a breeze: filaments, meander, dilution.
04 transduction
Receptors
59 olfactory receptors and 6 taste neuron classes driven by measured response data.
05 connectome
Brain
The complete male fly central nervous system as a spiking network, in four hunger states.
06 behaviour
Reaction
Surge-and-cast flight, landing, and a feeding decision from the brain's taste response.
cat findings.txt
Fermentation mainly makes fruit easier to detect.
Yeast volatiles let the brain detect rotting banana at a tenth of the concentration, from about three times farther away.
threshold 17.8 vs 1.78 s/m³ · range 2.4–6.0 m vs 7.7–19.2 m at 0.3 m/s
The long-range pull of rotting fruit should be strongest in well-fed flies.
Hunger sensitises the receptors ripe fruit uses. From 10 m, fed flies reached rotting fruit first; starved flies split evenly.
fed 62–70% · starved 51%
Up close, smell doesn't choose between fruits.
Within a few metres both plumes are strong enough in every filament; the plume's path decides.
first landings 50–53% on rotting across states, wind and temperature
Rotting fruit tastes worse; the yeast on it tastes better.
Less sugar, more acid and ethanol suppress sugar neurons. Surface yeast colonies more than compensate.
rotting pulp 2–4× less acceptable to the brain
What a fly eats depends on what it lacks.
Protein-deprived flies feed mostly on yeasty fruit; sugar-starved flies are the least drawn to it.
feeding on rotting fruit: protein-deprived 60–99% · sugar-starved 30–52%
tail validation.log
[PASS] feeding neurons rise with sucrose concentration
[PASS] starvation increases sugar acceptance
[PASS] held-out test: half-maximal feeding at 238 mM, measured 300 mM
[PASS] different odours give different brain patterns
[BUILT] bitter suppresses sugar acceptance (by construction)
[PART] odour plume statistics (near field only)
[FAIL] predicting attraction to 108 odours (r = 0.06)
[FAIL] odour on one antenna steering the fly
[FAIL] hunger increasing upwind flight success
The model is honest about where it breaks. The paper covers why, and what would fix it.
open figures/
Atmosphere: odour arrives as brief filaments; rotting banana is detectable from about three times farther away.
Taste: rotting pulp loses to ripe pulp, surface yeast wins, and hunger changes the margin.
ls -la /links
cd ..
Back to projects