Cognesia Simulations: Attempting to Model Membrane-Potential Responses to a Moving Grating in Drosophila ()
1. Introduction
Cognesia is a computer program used to simulate the physiological controls of a Drosophila brain, allowing for personalized controls of voltage, electrical nodes, chemical messengers, and physiological state. The simulation primarily consists of the visual apparatus, the optic lobe, and the central brain, with 15.09 million directed connections between neuron pairs in the recorded runs.
The simulation focuses on the relationships between exterior simple stimulus, such as a grating pattern, and the simulated membrane-potential responses to visual stimuli. Motion detection in Drosophila has been studied extensively in the past; for instance, Clark et al. defined the computational structure of the minimum motion detector and characterized the circuitry underlying Drosophila’s perception of simple motion stimuli [1].
In his article, he observes the ommatidia: roughly 800 of them on each eye; is composed of eight subunits, enumerated from R1 to R8. R1 - R6 are outer photoreceptors that provide major input to achromatic motion-vision pathways, connected directly to the lamina, where the visual signals are early on, processed, acting as a neuropil; R7 - R8 on the other hand are inner photoreceptors important for color and polarized-light vision, focusing on the perception of more complex images; being projected through the lamina to the medulla [2] [3].
However, neuromodulation of fly visual processing has been demonstrated previously [4]; Cognesia attempts to integrate several such state variables in one simulation, specifically focusing on how different states and levels of diverse chemical messengers affect simulated membrane potential. For instance, it is a fact that a fly behaves differently when it is full and when it is starved; yet is reasonable to question the causes behind such relation. Studies report that starvation alters food seeking, locomotor activity, and sensitivity to food-related cues [5] [6].
This article aims to use the simple simulation to examine membrane-potential responses to a moving grating under combined chemical and physiological settings, and hopefully lays groundwork for future, more comprehensive studies. It is worth noting that the model “Cognesia” is neither sponsored nor funded: it is run in silico; its outputs should be treated as exploratory model results rather than in vivo experimental data.
2. Methodology
To conduct this exploratory study, it is reasonable to begin with a simple visual stimulus. For the sake of this study, focusing on the Drosophila, there are multiple types of visual stimuli, including moving grating, full field flash, moving edge, looming disc, and apparent motion. Different types of visual stimuli can be configured through tweaking the direction, velocity, and rapidness of the visual stimulus.
For this study, the selected visual stimulus is the moving grating. Baseline spatial period will be at 30˚ with a square wave in Figure 1 and a sinusoidal wave in Figure 2 and Figure 3; further research likely focuses on increasing the spatial period by multiples of 30˚, eventually reaching the largest possible for the simulation: 180˚.
To investigate simulated voltage responses under combined controls, different, customized model states will be configured for the Drosophila, with “tweakable” values including the control parameters of dopamine, octopamine, serotonin, nitric oxide, short neuropeptide F, pooled peptide signal, tyramine, and acetylcholine (Graph 1).
Additional “tweakable” physiological values include energy reserves, hydration levels, general arousal, stress drive and daily clock phase, as represented in Figure 4.
Figure 1. Mean R1 - R6 voltage in the well-fed model scenario, responding to a square-wave moving grating at 30˚ spatial period, speed 300˚/s, direction 135˚, mean luminance 0.5 and contrast 100%. The displayed run lasts 10 s.
Figure 2. Mean R1 - R6 voltage in the hungry model scenario, responding to a sinusoidal moving grating at 30˚ spatial period, speed 60˚/s, direction 0˚, mean luminance 0.5 and contrast 100%. The run lasts 1 s and includes the added input described in the simulation protocol.
Figure 3. Mean central-brain voltage in the trance-like model scenario, responding to a sinusoidal moving grating at 30˚ spatial period, speed 60˚/s, direction 0˚, mean luminance 0.5 and contrast 100%. The run lasts 1 s and includes the added input described in the simulation protocol.
Graph 1. “Tweakable” chemical messenger values.
Figure 4. “Tweakable” physiological values.
Manually held chemical values stay fixed within each run; nitric oxide in the hungry-state run remains under model control. Physiological values are selected to define each model scenario. Several controls change together, so the contribution of an individual messenger cannot be isolated.
Chemical and physiological settings differ between the well-fed-state, hungry-state and trance-like-state; these names describe exploratory model scenarios, without establishing the corresponding biological states.
Again, all results derived from such experiment should only be treated as a baseline, rather than a well-researched, well backed result.
Model equations used to calculate voltage changes & timestep rules
Currently, Cognesia uses LIF spiking neurons alongside passive graded neurons.
The spiking neurons follow,
The variable g is a normalized synaptic drive in mV. Between different inputs, the value decays, and presynaptic spikes add,
Here N is synapse count, s is the connection’s sign, and the default w is 0.275 mV per synapse.
When chemical compounding is enabled, as it is in all experimental stages, concentration C is in arbitrary units (a.u.).
2.1. Model Controls
Within Cognesia, the chemical controls alter response gain, membrane time constants and synaptic release in selected neurons. Dopamine reduces selected dopamine neurons’ gain and release and, when plasticity is enabled, changes Kenyon-cell-to-MBON weights. Octopamine increases selected visual and dopamine neurons’ gain and shortens selected visual neurons’ membrane time constants; serotonin increases selected inhibitory antennal-lobe neurons’ gain; acetylcholine reduces Kenyon-cell gain; and sNPF increases selected Kenyon-cell-to-MBON release. Nitric oxide, tyramine and the pooled peptide signal have no direct receptor effect in this configuration.
Energy affects PAM dopamine-neuron gain through a hunger and insulin term, while energy, hydration and stress affect endocrine secretion. Arousal scales octopamine source activity, and daily clock phase scales dopamine and serotonin source activity. Holding chemical levels fixed overrides source-driven changes in those fields, so changing a state control need not change voltage.
Studies support octopamine modulation of visual responses and hunger-sensitive signaling in particular circuits [5], but the receptor coverage, coupling strengths, time constants and state equations used here are imposed assumptions. The scenario values are treated as exploratory settings; no calibration to measured chemical concentrations or physiological states is documented. Chemical values are in arbitrary units; physiological controls are normalized from zero to one, with clock phase measured in cycles.
2.2. Simulation Protocol
Each run starts from −52 mV membrane potential and zero synaptic drive, followed by 1000 ms of preparation under stationary mean luminance with electrical input off. The saved chemical and physiological initial settings are supplied in the run configurations. The numerical timestep is 0.1 ms and the recording interval is 20 ms. Figure 1 runs for 10,000 ms; Figure 2 and Figure 3 run for 1000 ms. One deterministic stimulus run per scenario is reported, each with a paired stationary-luminance control; there are no independent repetitions. Figure 2 and Figure 3 additionally apply a 5 mV-equivalent, 20 Hz square-pulse input to model neuron index 125,632, with 50% duty cycle from 100 to 1000 ms. This is an additive model input, rather than a measured electrode voltage. All three runs failed the pre-equilibration stationarity check and recorded voltage clamping, which limits their interpretation.
Figure 1 and Figure 2 represent the population mean of 7932 R1 - R6 neurons; Figure 3 represents the mean of 32,379 central-brain neurons. They do not represent individual-neuron voltages. The R1 - R6 ranges and oscillation midranges are calculated over the same 200 - 980 ms interval, including 40 samples at 20 ms spacing and excluding the first 200 ms. The midrange is the average of the minimum and maximum. This common interval does not remove the differences in stimulation between runs.
2.3. Reproducibility
These runs use FlyWire materialization 783: all 138,639 neurons in Completeness_783.csv and all 15,091,983 directed connections in Connectivity_783.parquet, representing 54,492,922 synapses. Neuron annotations are joined by root ID without an additional cell-type or completion-status filter; no additional synapse-count threshold is imposed. Photoreceptor sign corrections are model assumptions. Cognesia code is available at https://github.com/allenwuzhouhan-web/cognesia. The accompanying Cognesia run configurations.zip contains the original manifests, matching configuration files, dataset hashes and population-mean traces, identifying runs 20260927T053650Z_visual_grating_cd43a5, 20261001T024631Z_visual_grating_172a17 and 20261001T032519Z_visual_grating_f41d6e for Figures 1-3, respectively. The screenshots in Graph 2 and Graph 4 differ from the saved settings; the manifests specify the values actually used. The runs used a modified working tree without a complete archived source snapshot, so exact rerunning is not fully reproducible from the public release; the reported trace calculations can be repeated from the accompanying files.
3. Results
3.1. Well-Fed-State
It is reasonable to begin with the “well-fed-state” as the first model scenario. Graph 2 shows the displayed settings; the saved run configuration records the settings actually used for Figure 1.
Graph 2. Displayed well-fed-state settings. These differ from the saved Figure 1 configuration supplied with the manuscript.
Data
Focusing on the mean voltage of R1 to R6, it can be observed, as in Figure 4, it shows an abrupt drop from −43.73 mV, followed by small oscillations. Over the common analysis interval of 200 - 980 ms, the voltage ranges from −45.34 to −45.28 mV, with an oscillation midrange of −45.31 mV. Here the midrange is the average of the minimum and maximum, rather than the time average.
Analysis
Conclusion
In such case, the stimulus may drive downstream direction-selective motion circuitry [7]; this R1 - R6 trace alone does not predict turning direction.
In details, T4 cells and T5 cells receive the input of the visual electrical signals [7], forming part of the direction-selective motion pathway; their activity and locomotor output were not quantified here.
In this well-fed model condition, the R1 - R6 voltage trace reflects the specified stimulus and parameter settings, without establishing behavior under natural conditions.
3.2. Hungry-State
Secondly, it is worthwhile to investigate the hungry-state model scenario. The simulated physiological values and chemical messenger controls in model units are shown in Graph 3; the corresponding voltage graph is shown in Figure 2.
Data
Analysis
This presents a rather intriguing result, as the voltage over 200 - 980 ms ranges from −44.65 to −44.46 mV. Over this same interval, the oscillation midrange is −44.55 mV, compared with −45.31 mV in the well-fed run. These values are calculated from the minimum and maximum of each population-mean trace. Over 0 - 980 ms, both traces have the same overall maximum of −43.73 mV.
In this hungry-state scenario, energy reserves, hydration and several other controls are changed together. The stimulus and added electrical input also differ from Figure 1, so the voltage difference cannot be attributed to hunger or an individual messenger.
Connections
Sluggishness and delayed responses remain untested hypotheses. The voltage trace alone does not establish locomotor speed or response latency; behavioral measurements would be needed to test those predictions. Yang et al. (2015) instead report starvation-induced hyperactivity in adult Drosophila, which should be considered when interpreting this scenario [6].
To test such hypotheses in real life, food deprivation, hydration and stress would need to be controlled separately, with locomotor activity and response latency measured directly.
Graph 3. Value settings for hungry state.
3.3. Trance-Like-State
Lastly, an edge case worth diverting attention to is the “trance-like-state”. This is an author-defined model label; dizziness, altered awareness and unconsciousness remain untested hypotheses, rather than states established by the voltages.
Because this condition was hypothesized to act on central circuits, we analyzed mean membrane potential across 32,379 central-brain neurons, as shown in Figure 3. Figure 1 and Figure 2 instead measure R1 - R6 voltage. Without corresponding well-fed and hungry central-brain traces in these figures, they do not provide a like-for-like comparison across all three states. Graph 4 shows displayed settings; the saved run configuration records the settings actually used.
Graph 4. Displayed trance-like-state settings. These differ from the saved Figure 3 configuration supplied with the manuscript.
Data
Analysis
The simulated central-brain voltage fluctuates over the 0 - 980 ms recording, ranging from −52.28 mV to −52.09 mV (0.20 mV peak to peak, calculated before rounding the endpoints).
Connections
The simulated central-brain trace fluctuates during visual stimulation, but it does not establish behavioral responsiveness or response latency.
4. Conclusions
Within Cognesia, the recorded voltage responses reflect combined parameter settings, stimuli and added inputs. These runs cannot isolate the effect of an individual messenger or physiological control. Whether the simulated responses reproduce biological Drosophila physiology requires further experimental validation; motion vectors, locomotor output and conscious states are not established here.
Cognesia is still under development and is derived from the opensource data of FlyWire [8] [9]. Once again, all results derived from the studies should be treated as baselines only, rather than conclusive statements. Further research can focus on experimenting with different types of visual stimuli, different spatial periods, and different velocities.
Future work could scale Cognesia to incorporate more synaptic connections and test how network size changes predicted voltage traces. A connectome-scale simulation could incorporate all synaptic connections, but realistic neurotransmission would require additional physiological parameters beyond FlyWire connectivity. Scaled outputs would still require empirical validation before biological interpretation.
Additional Assets
Additional table explaining all variables or chemical elements used in the simulations
Term |
Definition |
Acetylcholine |
A major excitatory neurotransmitter in the Drosophila brain, used by neurons to transmit signals. Source: [10]. |
Central brain |
The fly brain region between the two optic lobes, containing circuits that integrate sensory information and guide behavior. Source: [3] [11]. |
Contrast |
The relative difference between bright and dark portions of a visual pattern; for a grating, Michelson contrast = (Lmax − Lmin)/(Lmax + Lmin). Source: [12]. |
Daily clock phase |
Position in the fly’s roughly 24-hour circadian cycle, which helps set the timing of activity, feeding, and sleep. Source: [13]. |
Dopamine |
A neuromodulatory transmitter used by fly circuits to encode reinforcement and support learned responses to reward or punishment. Source: [14] [15]. |
Energy reserves |
Stored metabolic fuel, especially glycogen and triglycerides, that flies can mobilize when food is scarce. Source: [16]. |
General arousal & wakefulness |
A behavioral state of being awake and responsive; fly arousal can be assessed by activity and responsiveness to sensory stimulation. Source: [17]. |
Hydration |
Body-water status and fluid balance; water deficit increases thirst and water-seeking behavior in Drosophila. Source: [18]. |
Mean luminance |
Average brightness of a visual pattern, such as a grating, independent of the pattern’s relative light–dark contrast.
Source: [19]. |
mv |
Assuming “mv” means mV: millivolt, one-thousandth of a volt; a unit used for neuronal membrane potential or voltage change. Source: [20]. |
Nitric Oxide |
A short-lived gaseous signaling molecule (NO) that can act as a cotransmitter and influence memory dynamics in Drosophila. Source: [21]. |
Octopamine |
A biogenic-amine neuromodulator made from tyramine; it helps regulate fly behavioral responses, including appetitive learning. Source: [15] [22]. |
Pooled peptide signal |
Model-specific summary of signaling from multiple neuropeptides, not one named molecule; its exact calculation must be checked against the simulation equations. Background: [23] [24]. |
R1 - R6 |
The six outer photoreceptors in each fly ommatidium; they project to the lamina and provide major input to motion vision. Source: [2]. |
R7 - R8 |
The two inner photoreceptors in each fly ommatidium; they project to the medulla and provide spectral inputs important for color vision. Source: [2]. |
Serotonin |
Also called 5-HT: a neuromodulator that influences sleep, feeding, and other behaviors in Drosophila. Source: [25]. |
Short
neuropeptide F |
sNPF: a fly neuropeptide whose receptor signaling contributes to food seeking and other hunger-dependent behaviors. Source: [5]. |
Stress drive |
Model-specific measure of stress- or threat-related behavioral pressure, not a single established fly molecule; check the simulation for its exact update rule. Background: [26]. |
Tyramine |
A biogenic amine made from tyrosine; it signals through its own receptors and is the precursor of octopamine. Source: [22]. |
Visual grating |
A repeated pattern of alternating light and dark bands, stationary or moving, used to test responses of fly visual circuits.
Source: [27]. |
Bibliography—Additional Background
B1. MRC Laboratory of Molecular Biology. Whole Brain Connectome of Fruit Fly Is Most Complex Brain ever Mapped. MRC Laboratory of Molecular Biology (n.d.; accessed 2 October 2026).
https://mrclmb.ac.uk/news-events/articles/whole-brain-connectome-of-fruit-fly-is-most-complex-brain-ever-mapped/
B2. Gauthey, W., et al. (2026) High-Speed Whole-Brain Imaging in Drosophila. Nat. Commun. 17, Article No. 5810. https://doi.org/10.1038/s41467-026-72437-1
B3. Januszewski, M. & Jain, V. A Connectomics Milestone: Mapping the Complete Male Fruit Fly Brain. Google Research (3 September 2026; accessed 2 October 2026).
https://research.google/blog/a-connectomics-milestone-mapping-the-complete-male-fruit-fly-brain/
B4. Bassi, M. This New Brain Map Shows Every Nerve Cell in an Adult Male Fruit Fly’s Central Nervous System. Here’s Why That Matters. Smithsonian Magazine (16 September 2026; accessed 2 October 2026).
https://www.smithsonianmag.com/smart-news/this-new-brain-map-shows-every-nerve-cell-in-an-adult-male-fruit-flys-central-nervous-system-heres-why-that-matters-180989490/