Abstract
Natural behavior consists of dynamics that are both unpredictable, can switch suddenly, and unfold over many different timescales. While some success has been found in building representations of behavior under constrained or simplified task-based conditions, many of these models cannot be applied to free and naturalistic settings due to the fact that they assume a single scale of temporal dynamics. In this work, we introduce Bootstrap Across Multiple Scales (BAMS), a multi-scale representation learning model for behavior: we combine a pooling module that aggregates features extracted over encoders with different temporal receptive fields, and design a set of latent objectives to bootstrap the representations in each respective space to encourage disentanglement across different timescales. We first apply our method on a dataset of quadrupeds navigating in different terrain types, and show that our model captures the temporal complexity of behavior. We then apply our method to the MABe 2022 Multi-agent behavior challenge, where our model ranks 3rd overall and 1st on two subtasks, and show the importance of incorporating multi-timescales when analyzing behavior.
Introduction
Quantifying behavior is a fundamental challenge in neuroscience and robotics because behavior is inherently multi-scale. A mouse's actions range from sub-second paw movements to minute-long grooming sequences and hour-long circadian shifts. Most existing representation learning models assume a single temporal scale or aggregate information in a way that blurs these distinctions. If a model designed for fast movements is used to analyze long-term traits, the "big picture" is lost; conversely, a model focused on long-term trends might miss subtle, high-frequency kinematics.
To address this, we propose Bootstrap Across Multiple Scales (BAMS), a self-supervised framework designed to disentangle these layers. BAMS captures both the "how" (kinematics) and the "why" (internal states or environmental context) of behavior by explicitly modeling dynamics across a temporal hierarchy.
Methods: Temporal Pyramid Pooling and Latent Bootstrapping
The core of the BAMS architecture is the Temporal Pyramid Pooling module. Rather than using a single large encoder, BAMS utilizes three parallel Temporal Convolutional Network (TCN) branches, each with a distinct receptive field:
- Recent-past encoder ($f_{rp}$): Captures sub-second, high-frequency movements.
- Short-term behavior encoder ($f_s$): Focuses on 1–10 second windows (e.g., distinguishing running from drinking).
- Long-term behavior encoder ($f_l$): Aggregates information over minutes to capture stable traits or environmental factors.
To train these encoders without manual labels, we employ two types of objectives. First, standard Pretext Tasks require the model to predict future actions and reconstruct hidden features. Second, we introduce Multi-timescale Latent Bootstrapping. Inspired by BYOL (Bootstrap Your Own Latent), the model learns to make the representation of a current time point similar to a "neighboring" time point in the future. Crucially, "neighboring" is defined relative to each scale: a few seconds for the short-term encoder and several minutes for the long-term encoder. This forces the long-term encoder to ignore transient, fast-changing details and focus on stable underlying factors.
Experimental Setup
We validated BAMS on two distinct datasets to test its ability to disentangle morphology from environment and to handle complex social interactions:
- Simulated Legged Robots: Using NVIDIA’s Isaac Gym, we generated data of two different quadruped robots (ANYmal B and C) navigating five terrain types (stairs up/down, slopes, flat). This provided ground truth for "morphology" (long-term trait) vs. "terrain" (short-term context).
- MABe 2022 Multi-agent Behavior Challenge: This large-scale dataset features "mouse triplets" (three interacting mice) across 1,600 one-minute videos. It includes 13 sets of labels ranging from frame-level actions to sequence-level traits.
Results and Discussion
BAMS demonstrated superior performance in capturing multi-scale dynamics. In the MABe 2022 Challenge, BAMS ranked 3rd overall globally and 1st on two specific subtasks, proving highly competitive against more computationally expensive models.
Analysis of the mouse data (Figure 6) revealed that different behaviors are captured by different timescales. For instance, some subtasks are almost entirely captured by a single timescale, while others require integrated information from both short and long-term embeddings.
In the robot experiments, the combined representation achieved a 0.73 F1-score for terrain identification and 0.98 for robot type. Notably, using only the long-term embedding improved robot identification to 0.99. This suggests that short-term kinematic data can actually act as "noise" when trying to identify stable traits like robot morphology, justifying the need for temporal disentanglement.
Conclusion
BAMS provides a robust framework for learning structured behavior representations by physically separating encoders and applying scale-dependent temporal objectives. While currently reliant on pose-tracking inputs, future work will explore extending this multi-timescale approach to raw video pixels and improving the interpretability of the learned latent spaces.
Summary updated