Behavioral architecture for larva foraging.

A: In the trilayer architecture the bottom layer consists of three basic sensorimotor effectors that constitute the locomotory model. The intermediate layer features innate reactive behavior in response to sensory input that reflects changes in the environment. The top layer allows for behavioral adaptation through experience. Framed areas denote more complex behaviors that require subsumption of subordinate behaviors. B: Suggested implementation of basic behavioral modules at the bottom layer. Initiation or cessation of a behavior is controlled by the intermittency module. The turner and crawler module are phasically coupled during forward locomotion, while crawling and feeding are implemented as mutually exclusive sensorimotor primitives.

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 v 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 Figure 2—video 1 and Figure 2—video 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 d divided by the body-length l. C: Scaled forward velocity v 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 v 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 2π. 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 Figure 2—video 1 and Figure 2—video 2 respectively. F: Definition of bending angle θb 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 θb, bend and orientation angular velocities ωb, ω 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 v in (D).

Population-level analysis.

A: Fourier analysis of the forward v (red) and angular ω (blue) velocity across 100 larvae. Inset shows the respective dominant frequencies within suitable ranges 1 ⩽ fC ⩽ 2.5 and 0.1 ⩽ fT ⩽ 0.8 for v 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 Levy 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 2π. C: Forward velocity of 5 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 seconds. Individual tracks have been transposed to originate from the center of the arena. The entire temporal course shown in Figure 4—video 1. B: Dispersal from origin. Line indicates the group median while shaded area denotes first and third quartiles. C: Histograms for total number of strides, time ratio allocated to crawling and pathlength. (arena dimensions = 500×500mm, N = 200 larvae, experiment duration = 3 minutes, simulation timestep =1/16).

Simulation of chemotaxis.

A: Experiment 1: A single odor source of 8.9μ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 2.0μ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. 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×60mm, N = 30 larvae, experiment duration = 3 and 5 minutes respectively, simulation timestep =1/16).

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 Figure 6—video 1 for videos of two sample simulations. B: The pipeline used for coupling the Mushroom Body (MB) model with the behavioral simulation. First a MB model is trained via a classical conditioning experiment where olfactory input is combined with reward. The resulting odor valence MBout is then converted to odor gain G 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 = 100x100mm, N = 30 larvae, experiment duration = 3 minutes, simulation timestep =0.1.

Individuality: empirical (blue) and fitted (red) parameter distributions.

Diagonal: Histogram and kernel density estimates (KDE) for body-length l, crawling frequency fC and mean scaled displacement per stride across a population of 200 larvae in the experimental dataset. Below: Bivariate projection of 3-dim. KDE outlined contours for each parameter pair. Above: Red ellipses represent the bivariate projections of the 3-dim. fitted Gaussian distributions at 0.5, 1, 2 and 3 standard deviations. In our model this Gaussian is used to sample a parameter set for each individual larva. The blue dots denote the empirically measured parameters.

Locomotory model configuration.

The parameters of the calibrated average locomotory model, organized per module.

Segmentation and velocity definition.

A: Forward velocity definition. 13 candidate velocity metrics are compared for use in stride annotation of 3-minute 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. vcen : centroid velocity, v1v12 : 1st-12th point’s velocity. B: Regression analysis of individual and cumulative angular velocities ωi=1−10 to orientation angular velocity ω. When considered individually, ω2 best predicts reorientation with the ω3 and ω1 following. When considered cumulatively the anterior 4 ωi allow optimal prediction of reorientation velocity. C: Correlation analysis of the sum of all possible ωi combinations to ω. The sum shows the highest correlation therefore we define as shown in A. For illustration purposes only the 5 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.