Fig. 5: Automatic classification of movement patterns and behavioral states during social interactions.

a Tracked position of both mice, across an example 21 min recording. b Extracted behavioral features: three speed components (forward, left, and up in the mice’s egocentric reference frames), and three ‘social distances’ (nose-to-nose distance and two nose-to-tail distances). Colors indicate ethograms of automatically detected behavioral states. c Examples of identified social events: nose-to-nose-touch, and anogenital nose-contacts. d Mean and covariance (3 standard deviations indicated by ellipsoids) for each latent state for the forward/leftward running (dots indicate a subsample of tracked speeds, colored by their most likely latent state) e Mean and variance of latent states in the z-plane (shaded color) as well as distribution of tracked data assigned to those latent states (histograms) f Distribution of the duration of the five behavioral states in the xy-plane. Periods of rest (blue) are the longest (p < 0.05, two-sided Mann–Whitney U-tests) and bouts of fast forward movement (green) are longer other movement bouts (p < 0.001, two-sided Mann–Whitney U-tests). g Distribution of duration of the three behavioral states in the z-plane. Periods of rest (light blue) are either very short or very long. h Plot of body elevation against behavior duration. Short periods of rest happen when the z-coordinate is high (the mouse rears up, waits for a brief moment before ducking back down), whereas long periods of rest happen when the z-coordinate is low (when the mouse is resting or moving around the arena, ρ = −0.47, p < 0.001, two-sided Spearman’s rank correlation coefficient test). Source data and analysis scripts that generate the figures are available in the associated code/data files (see “Methods”).