Fig 1.
Behavioral and neuronal datasets:
(a) Overview of the experimental setup: Zebrafish larvae are free to move in a tank that is kept at a desired constant temperature by a Peltier module. An imaging system records images of the fish from above at a rate of 25 frames per second. The upper right panel provides a close-up view of a larva in a raw image. Adapted from [24]. (b) Example trajectories of zebrafish larvae in 2D space at various temperatures. Each point represents a swim bout, with the color indicating the corresponding re-orientation angle defined in panel c. The trajectories’ starting points are denoted by black arrows. (c) Convention used for the reorientation angle () between two consecutive swim bouts (n and
). (d) Distribution of re-orientation angles (
) for each ambient temperature. The grayed-out area corresponds to the re-orientation angles classified as forward bouts by a thresholds at
. (e) Diagram of the Anterior Rhombencephalic Turning Region (ARTR) in larval zebrafish. Adapted from [29]. (f) Example ARTR activity at 22°C. Top : Raster plot of neurons located in the left and right ARTR (blue and red respectively). Bottom : Mean activity mL and mR of neurons in the left and right ARTR. (g) Mean activities
of the ARTR for all recordings in the dataset. The blue contour line represents 90% of the joint distribution.
Fig 2.
3-state Markov Chain and hidden Markov models - Stronger persistence emerges from better labeling:
(a) Diagram of the 3-state Hidden Markov Model (HMM) with normal emissions for Forward bouts, and gamma emissions for Turning bouts. Example emission distributions were taken at 26°C. (b) Example trajectory at 22°C. Each point represents a swim bout, with the left color for the threshold labeling (Markov Chain model), and the right color for the HMM labeling using the Viterbi algorithm. Top: 2D trajectory. Bottom: reorientation angle for this trajectory, with the threshold
as a dashed line. (c) Probability
of observing a streak of
consecutive forward bouts (black) or same-direction turning bouts (pink), for MC (circles) and HMM (triangles), at 22°C. Inset: Exponential decay characteristic length (
, solid lines), and theoretical persistence length computed from the transition matrix (
, dashed lines). (d) Ratio of persistence length
(observed vs. no-memory null model) vs. temperature, for Forward (s = F, black) and turning (
, pink) bouts. (e) stubbornness factor at q = 0 intermediary Forward bouts,
. (f) stubbornness factor at q = 1 intermediary Forward bouts,
. (e-f) Shaded bands represent the estimated errors from aggregated fish data (see Materials and methods 4.5).
Fig 3.
Fish identification from long trajectories:
(a) Dataset : 18 fish recorded individually for 2-hour sessions. Each session is split into 10 chunks (mean = 9.5 0.5 trajectories per chunk). (b) Example trajectories for fish 1. (c) HMM parameters inferred from all the trajectories of a fish (referred to as global) vs. inferred per-chunk. Only four HMM parameters are shown for clarity (see S5 Fig for all parameters). Each dot represents a fish, and the error bars correspond to the standard error of the mean. Points labeled in red correspond to fish misidentified in panel d. (d) Confusion matrix of the relative likelihood
of data coming from fish i and HMM trained on fish j. The fish identity most likely according to each model is indicated with a star (black : correctly identified fish, red : misidentified). (e) Average number of correctly identified fish when a fraction f of the test data is used for identification. Shaded band : standard deviation across 100 trials. In each trial, the trajectories of each fish were randomly split into train and test sets (50%).
Fig 4.
3-state Hidden Markov Model (HMM) describes ARTR neuronal statistics:
(a) Diagram of the 3-state Hidden Markov Model (HMM) with emissions described as independent models of the ARTR neuronal population, see Eq (4). Distributions of fields are shown for all fish for neurons in the left (blue) and right (red) ARTR. (b) Example ARTR activity (see Fig 1f) classified by the 3-state HMM. Solid lines represent the mean activity of neurons in the left (mL, blue) and right (mR, red) ARTR. (c) HMM classification in
space. Dots : neuronal configurations from the example recording in panel b. Solid lines : 90% of the distributions for all recordings combined. (d) Distributions of
per state (all recordings combined). (e-f) Empirical vs. HMM-generated neuronal statistics (all recordings combined). (e) Mean activity
of neuron i. (f) Covariance
of neurons i and j on opposite sides (left plot) and on the same sides (right plot) of the ARTR.
Fig 5.
Behavior vs. Neuronal temporal structure:
(a) Sojourn-time distribution for forward (left) and turn states (right) : behavior (black), neuronal before (orange) and after (magenta) temporal re-scaling. A single re-scaling factor is used for forward and turning states, for all temperatures, and recordings. (b) Behavior vs. neuronal state-transition probabilities (for all state pairs and all temperatures), before (left) and after (right) temporal re-scaling. Each dot represents a single transition probability at a given temperature. For neuronal state-transition, we show the mean and standard error over all recordings. (c) Diagram showing two possible transition trajectories between left and right states in ARTR
space. Transitions through the forward state are more probable (see panel d). (d) Distributions of
for behavior (black) and neuronal data before (orange) and after (magenta) temporal re-scaling (all temperatures combined). These distributions are shown as standard box plots (median, quartiles, and outliers beyond
the inter-quartile range from the median).
Fig 6.
Generative ability of HMM models and trajectory reconstruction from neural HMMs:
(a,b,c) Pipeline to convert neuronal activity to swim trajectory. (a) ARTR activity is first converted to the most likely sequence of forward/left/right hidden states using the Viterbi algorithm on the Neuronal Hidden Markov Models (N-HMM). (Example empirical ARTR activity at 26°C). (b) Time is then re-scaled using the scaling factor identified in Fig 5, and sampled based on the empirical distribution of inter-bout intervals . Bout-angle sequences are then sampled based on the Behavioral Hidden Markov Models (B-HMM). (c) Swim trajectories are constructed for each bout sequence by sampling the bout distances dn from the empirical distribution. An example trajectory generated from the empirical neuronal activity at 26°C is shown. Point color corresponds to bout type (left, right, forward), and point size corresponds to inter-bout interval. (d,b,e) Pipeline to convert N-HMM-generated state sequences to swim trajectories. (d) The N-HMM is first sampled to generate a sequence of forward/left/right internal states. The sequence is then temporally rescaled and sampled as before (see panel b). (e) Swim trajectories are constructed as before (see panel c). An example N-HMM-generated trajectory at 26°C is shown. (f) Distributions of reorientation angles
, inter-bout intervals
, and bout distances dn; for the aggregated multiple-fish trajectories (gray), trajectories generated from B-HMM (black), and generated from N-HMM (blue); at 22°C. (g) Mean Square Reorientation (MSR) accumulated after q bouts for aggregated multiple-fish trajectories (normal : grey, shuffled : red dashed), single-fish long trajectories (green), and trajectories generated from N-HMM (blue). For both long and N-HMM-generated trajectories, we show the mean and standard deviation over all individuals (solid line and band). (see S7 Fig for individual trajectories and all temperatures) (h) MSR at q = 10 bouts, with mean (horizontal bars) and standard deviation (vertical bars).