Figures and data

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

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

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

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

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.