A behavioral architecture for realistic simulations of Drosophila larva locomotion and foraging
Figures
Behavioral architecture for larva foraging.
(A) In the three-layer hierarchical architecture, the bottom layer (motor) consists of three basic sensorimotor effectors that constitute the locomotory model. The intermediate layer (reactive) features innate reactive behavior in response to sensory input that reflects changes in the environment. The top layer (adaptive) allows for behavioral adaptation through experience. Framed areas denote more complex behaviors that require subsumption of subordinate behaviors. The signal from feeding to the above layers is neuromodulatory, as indicated by the purple arrowhead. (B) The intermittent coupled-oscillator locomotory model implemented at the motor layer. The turner and crawler module are phasically coupled during forward locomotion (head casts and weathervaning are not separate modules; both emerge from this crawl–bend interference), while crawling and feeding are implemented as mutually exclusive sensorimotor primitives. Initiation or cessation of crawling is controlled by the intermittency module. Darker shades mark modules used in the present simulations; faded modules indicate possible extensions.
Kinematic analysis of a single Drosophila larva in locomotion.
(A) Individual larva trajectory tracking a posterior point along the midline of the animal. Trajectory color denotes the forward velocity from 0 (red) to maximum (green). Inset focuses on a shorter track epoch analyzed in C and G. The full-length trajectory and the epoch in the inset are shown in Videos 1 and 2, respectively. Dark green rectangle denotes the single stride described in B. (B) Sketch of the single crawling stride indicated in A. The larva first stretches its head forward, anchors it to the substrate, and then drags its body forward via peristaltic contraction. Scaled stride displacement is defined as the resulting displacement divided by the body-length . (C) Scaled forward velocity during the 40-s track epoch selected in A (inset). Green and red markers denote the local maxima and minima used for stride annotation. Individual strides are tiled by vertical dashed lines. Successive strides constitute uninterrupted stridechains (white). Epochs that do not show any strides are annotated as crawl-pauses (gray). (D) Scaled forward velocity of head, midpoint, and tail as a function of the stride cycle phase . All detected strides have been interpolated to a stride oscillation cycle of period . Solid lines denote the median, shaded areas the lower and upper quartiles across strides. (E) Same trajectory as in (A) now tracking the head segment. Color denotes the absolute orientation angular velocity from 0 (red) to maximum (green). The full-length trajectory and the epoch in the inset are shown in Videos 1 and 2, respectively. (F) Definition of bending angle and orientation angle for the original 12-segment (blue) and the simplified 2-segment (red) larvae. (G) Three angular parameters during the same track epoch shown in (C). Bending angle , bend and orientation angular velocities , are shown. Background shadings denote left and right turning bouts. For illustration purposes only turns resulting in a change of orientation angle > 20° are shown. (H) Absolute orientation angular velocity during the stride cycle, as shown for in (D).
Population-level analysis.
(A) Fourier analysis of the forward (red) and angular (blue) velocity across 100 larvae. Inset shows the respective dominant frequencies within suitable ranges and for and , respectively. Crawling exhibits a dominant frequency of around 1.4, while lateral bending has a slower, more variable rhythm of around 0.4. (B) Epoch-duration distribution. Dots describe the cumulative probability density over logarithmic bins for the length of stridechains and the duration of crawl-pauses pooled across the larva population. Lines indicate the distribution with the lowest Kolmogorov–Smirnov distance among the best-fitting power-law, exponential, log-normal, and Lévy distributions. Stridechain length and pause duration are best approximated by log-normal distributions. (C, D) Crawl–bend interference. The stride cycle kinematics are depicted for a single individual. All detected strides have been interpolated into a 64-bin oscillation cycle of period . (C) Forward velocity of five points along the larva midline. Velocity is scaled to the larva body-length. (D) Absolute angular velocity (blue) normalized by the average value computed during the pause epochs. Fitted Gaussian function (red) describes well the phase-dependent attenuation imposed on and is used for the implementation of the coupled-oscillator locomotory model. Solid lines denote the median, shaded areas the lower and upper quartiles. Vertical dashed lines denote the cycle phase where the respective velocity reaches its maximum value. Inset: Phase offset between the peak phase of each midline point’s forward velocity and the peak phase of angular velocity across a dataset of 100 tracked larvae. Notably, reaches its maximum just before the head forward velocity reaches its maximum.
Free exploration in simulation and experiment.
(A) Dispersal of 200 larvae in experiment (left) and simulation (right) during 40 s. Individual tracks have been transposed to originate from the center of the arena. The entire temporal course is shown in Video 4. (B) Dispersal from origin (Euclidean distance during the initial 40 s; larvae approach arena edges thereafter). Line indicates the group median while the shaded area denotes first and third quartiles. (C) Histograms for total number of strides, time ratio allocated to crawling, and pathlength (cumulative distance). (arena dimensions = 500 × 500 mm, N = 200 larvae, experiment duration = 3 min, simulation timestep = 1/16).
Simulation of chemotaxis.
(A) Experiment 1: A single odor source of µM peak concentration is placed on the right side of the rectangular arena creating a chemical gradient as indicated by the color scale. Larvae are placed on the left side facing to the right. Larvae are expected to navigate up the gradient approaching the source. A single-larva trajectory is shown. This setup mimics the first experiment in Gomez-Marin et al., 2011. (B) Experiment 2: A single odor source of µM peak concentration is placed at the center of the rectangular arena. Larvae are placed in close proximity to the odor source. Larvae are expected to locally explore generating trajectories around and across the source. A single-larva trajectory is shown. This setup mimics the second experiment in Gomez-Marin et al., 2011. (C, D) The trajectories of 25 virtual larvae during the two experiments. (E, F) The odor concentration encountered by the virtual larvae as a function of time, measured in µM. Red curves refer to the single larva in A and B. Gray denotes the mean and quartiles of all 25 larvae in C and D. The simulation results fit well to the experimental estimates of concentration sensing during larval chemotaxis in Gomez-Marin et al., 2011 (arena dimensions = 100 × 60 mm, = 30 larvae, experiment duration = 3 and 5 min, respectively, simulation timestep = 1/16). Because the present chemotaxis implementation is a qualitative reproduction of the behavioral patterns reported by Gomez-Marin et al., 2011 and not a quantitatively calibrated model, we do not report success rates, approach distances, or track-length statistics; these metrics depend strongly on the specific odorscape geometry and experimental constraints and therefore lie outside the scope of the proof-of-concept simulations presented here. Parameterization of the motor layer was kept identical to exploration simulations.
Simulation of innate and learned odor preference.
(A) A total of 252 simulations are shown with the resulting Preference Index for different gains of the left and right odor. On the top left, the initial state is shown with the larvae randomly generated at the center of the dish. The final state of three additional simulations is depicted on the top right and bottom left and right. See Video 6 for videos of two sample simulations. (B) The pipeline used for coupling the mushroom body (MB) model with the behavioral simulation. First, an MB model is trained via a classical conditioning experiment where olfactory input is combined with reward. The resulting odor valence is then converted to odor gain via a simple linear transformation and used to generate a virtual larva. Finally, the odor preference of a virtual larva population is evaluated in a behavioral simulation. (C) The spiking neural network comprising the MB model. The number of neurons comprising each layer is indicated. (D) The resulting PIs for 100 simulations per number of training trials. In each of the 100 simulations per condition a population of 30 virtual larvae was generated and evaluated using a different random seed, always bearing the exact same 30 odor gains derived from the respective group of 30 trained MB models (arena dimensions = 100 × 100 mm, = 30 larvae, experiment duration = 3 min, simulation timestep = 0.1).
Individuality: empirical (blue) and fitted (red) parameter distributions.
Diagonal panels show histogram and kernel density estimates (KDEs) for body-length , crawling frequency , and mean scaled displacement per stride across a population of 200 larvae in the experimental dataset. Lower off-diagonal panels depict bivariate projections of the empirical three-dimensional KDE. Upper off-diagonal panels show the corresponding projections of the fitted multivariate Gaussian distribution, with ellipses indicating 0.5, 1, 2, and 3 standard deviations. In the virtual population, parameter sets for individual larvae are generated by sampling from this multivariate Gaussian. Blue dots represent empirically measured larvae.
Segmentation and velocity definition.
(A) Forward velocity definition. Thirteen candidate velocity metrics are compared for use in stride annotation of 3-min tracks of a population of 30 larvae. For each candidate, the mean coefficient of variation of temporal duration and spatial displacement of the annotated strides is shown. Midline point 9 velocity provides the most temporally and spatially stereotypical strides; therefore, it is selected as the reference forward velocity for stride annotation and model fitting. : centroid velocity, : 1st-12th point’s velocity. (B) Regression analysis of individual and cumulative angular velocities to orientation angular velocity . When considered individually, best predicts reorientation, with the and following. When considered cumulatively, the anterior 4 allow optimal prediction of reorientation velocity. (C) Correlation analysis of the sum of all possible combinations to . The sum shows the highest correlation; therefore, we define as shown in A. For illustration purposes, only the five highest correlations are shown.
Average locomotory model summary.
(A) Distribution of stride-cycle-related parameters over the empirical dataset. Red dotted line denotes the median value used in the crawler module of the average locomotory model. (B) Normalized average curves of angular metrics during the stride cycle for each individual larva. Red line denotes the group median. (C) Pooled distribution of runs and pauses over the entire dataset (blue). Runs are detected as chains of concatenated strides (stridechains). Stridechains and pauses generated by the fitted distributions are shown in red. These distributions are used in the Intermitter module of the average locomotory model. (D) Sample simulation of the model with all modules active. The model features additionally bend correction due to forward motion and crawling phase-coupled suppression of angular motion.
Videos
Full-length larva trajectory.
The full-length trajectory shown in Figure 2A, E; colored according to angular and forward velocity.
Short larva trajectory epoch.
The short track epoch depicted in the insets of Figure 2A, E; colored according to forward and angular velocity.
Free-exploration simulation.
A population of 25 real (left) or virtual (right) larvae is placed on a dish and left to freely explore. The body of the real larvae has been simplified into two segments as described in Video Bisegmental body.
Dispersal simulation.
The temporal course of dispersal for real (left) and virtual (right) larvae is shown in Figure 4A.
Chemotaxis simulations.
Time course of the two simulated chemotaxis experiments described in Figure 5.
Odor preference simulations.
Two odor preference simulations, one with an appetitive and one with an aversive odor source placed on the left side of the dish. A non-valenced odor source is placed on the right side.
Filter selection.
The effect of inadequate or excessive filtering of the empirical larva recordings is illustrated. The left video shows the jittery original recording while the effect of lowpass filtering at cutoff frequencies of 4, 2, and 0.5 Hz is shown on the rest. Selection of an intermediate 2 Hz cutoff frequency eliminates the unrealistic jitter while preserving the behaviorally relevant crawling frequency.
Locomotory model for Drosophila larva.
The function of the intermittent coupled-oscillator locomotory model in Figure 1B is illustrated by adding its four modules stepwise: (1) crawler only, (2) turner only, (3) crawler + turner uncoupled, (4) crawler + turner coupled (stride-phase attenuation of bending), (5) crawler + turner uncoupled + crawl intermittency (runs/pauses), and (6) crawler + turner coupled + crawl intermittency (complete intermittent coupled-oscillator model). The inset indicates active modules per clip.
Bisegmental larva-body simplification.
The first panel shows the original tracked larval body with 12 midline points and a 22-point contour. Subsequent panels illustrate successive simplifications: removal of the contour, replacement with rectangular segment proxies, and finally a two-segment representation. The absolute head orientation angle is preserved, and the single bending angle is defined as across the anterior body.
Tables
Locomotory model configuration.
The parameters of the calibrated average locomotory model, organized per module.
| Parameter | Symbol | Value | Unit | |
|---|---|---|---|---|
| Physics | Torque coefficient | 0.5 | s−2 | |
| Angular damping | 1.0 | s−1 | ||
| Body spring constant | 1.0 | s−2 | ||
| Bend correction coefficient | 1.0 | – | ||
| Body | Length | 4.0 | mm | |
| Number of body segments | – | 2 | # segments | |
| Turner | Tonic input | 21.43 | – | |
| Input range | [10, 40] | – | ||
| Time constant | 0.1 | s | ||
| Spike response steepness | 2.37 | – | ||
| Crawler | Crawling frequency | 1.42 | Hz | |
| Maximum scaled velocity | 0.51 | body-lengths/s | ||
| Stride distance mean | 0.24 | body-lengths | ||
| Stride distance std | 0.04 | body-lengths | ||
| Max velocity phase | 3.49 | rads | ||
| Interference | Suppression coefficient | 0.46 | – | |
| Suppression relief coefficient | 0.54 | – | ||
| Max relief phase | 2.05 | rads | ||
| Intermitter | Run length distribution | Log-normal ( = 1.4, = 1.15) | – | |
| Run length range | [1, 142] | # strides | ||
| Pause duration distribution | Exp( = 1.0) | – | ||
| Pause duration range | [0.12, 16.0] | s |