arXiv:2611.00688cs.LGOct 2026

Manuscript Offprint

arXiv:2611.00688

Shaped by What's Missing: Topological Invariance Simplification Discovers Behavioral Transitions

Kaiwen Bian, Eric J. Leonardis, Yuanjia Yang, Charles Zhang, Yusu Wang, Talmo D. Pereira

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Kaiwen Bian1,2^{1,2}

Eric J. Leonardis2^{2}

Yuanjia Yang1,2^{1,2}

Charles Zhang3^{3}

Yusu Wang1^{1}

Talmo D. Pereira1,2^{1,2}

KBIAN@UCSD.EDU

ELEONARDIS@sALK.EDU

SCYANG@sALK.EDU

CHARLESZHANG@FAS.HARVARD.EDU

YUSUWANG@UCSD.EDU

TALMO@sALK.EDU

1^{1}University of California San Diego

2^{2}Salk Institute for Biological Studies

3^{3}Harvard University

Editors: List of editors' names

Website: https://kbian.org/TopoMimic-website/

Code: https://github.com/KevinBian107/TopoMIMIC

Abstract

Understanding how animals move between behaviors is a central question in neuroethology, yet most segmentation methods first partition time into discrete states, leaving transitions as the unmodeled residue between them. We take the opposite view: in a suitable feature space, sustained behaviors are dense regions of the trajectory's density landscape, and transitions are the sparse corridors and loops that connect them. Because this structure is a property of the landscape's shape rather than of any particular coordinates, it can be read off directly with topology and should persist across feature spaces. We build this landscape from frame-by-frame trajectories, extract its discrete-Morse graph, and keep two kinds of structure: paths, the corridors a trajectory follows between dense behavioral regions, and cycles, closed routes whose entry and exit take different ways. Clustering these structures yields transitions directly, with no upstream state partition. On a rat behavior dataset across three feature spaces, including the latent space of a neural-network controller that imitates the animal in a physics simulator, the approach recovers transitions at coverage comparable to state-space and topological-clustering baselines, while carrying substantially more information about the transition identity, forming clusters at least as tight as the baselines', and matching annotated transitions with less reliance on time-warping. More broadly, the results show that behavioral transitions are a topological feature of a representation: recoverable from the shape of its trajectories, and consistent across distinct feature spaces.

Keywords: behavioral transitions, neuroethology, discrete Morse theory, topological data analysis, imitation learning, biomechanical simulation, latent representations

© 2026 K. Bian, E.J. Leonardis, Y. Yang, C. Zhang, Y. Wang & T.D. Pereira.

1. Introduction

How animals orchestrate transitions between behavioral modes (such as walking to rearing) is a central challenge in neuroethology, especially when the behavior is diverse. Transitions happen at many time scales, yet existing tools describe them only at macro resolution, because they treat a transition as downstream of a coarse-graining applied to the raw trajectory. An autoregressive HMM or a switching linear dynamical system (SLDS) (Wiltschko et al., 2015; Weinreb et al., 2024; Hsu and Yttri, 2021) assigns each frame a syllable and summarizes transitions as a matrix over syllables. A variational autoencoder (Luxem et al., 2022) partitions a latent embedding and treats transitions as switches between partitions. Mapper (Singh et al., 2007; Saggar et al., 2022) builds a cluster graph over overlapping density patches and reads transitions off its topology. The coarse-graining always happens first, so a transition is inherited from the state assignment rather than from the trajectory, and how the body reconfigures frame by frame is lost before any analysis is run.

Deep reinforcement learning imitation policies expand this toolkit by emulating behavior in a physics simulator that reproduces recorded motion trajectories (Merel et al., 2020; Aldarondo et al., 2024; Zhang et al., 2025). In MIMIC-MJX (Zhang et al., 2025) (Figure 4), inverse kinematics was performed on 3D pose recordings of freely behaving rats to produce joint angles (qpos) and serve as an imitation target. Then an encoder maps a short qpos reference window into a latent intention iti_t, and a decoder combines iti_t with proprioception to produce a biomechanically realistic action. Latent intentions and joint angles are control-relevant spaces that we utilize to study how behaviors transition, in comparison with the egocentric positions of body parts (keypoints) for contrast.

We extract transition structure directly from the raw trajectory, applying discrete-Morse graph reconstruction (Dey et al., 2018; Magee and Wang, 2022; Wang et al., 2015) to the density-weighted trajectory point cloud and recover the one-dimensional skeleton of its density terrain (Figure 3A shows the canonical road-network example). Two primitives live on this skeleton (Figure 3B): DM-paths, the corridors between dense behavioral regions, and DM-cycles, the loops left when a behavior's entry and exit arms occupy distinct routes. These are feature-level objects where one trajectory yields several primitives containing behavior segments. Our contributions are two fold: (i) We define these primitives and a Wasserstein clustering over them, a transition-centric representation needing no upstream state partition. (ii) We evaluate our method on a rat behavioral dataset in three feature spaces against Keypoint-MoSeq and Mapper baselines, showing its advantage lies in transition information, internal consistency, and agreement with ground truth behavior labels.

References (32)