Shaped by What's Missing

1Computational Neurobiology Laboratory, Salk Institute for Biological Studies  2Halicioğlu Data Science Institute, UC San Diego  3Department of Neurosciences, UC San Diego  4Department of Computer Science, Harvard University  5Department of Organismic and Evolutionary Biology, Harvard University  6Molecular Neurobiology Laboratory, Salk Institute for Biological Studies

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

Abstract

Understanding how animals transition between behavioral modes is central to neuro-ethology, yet existing tools describe these transitions only at macro resolution. AR-HMM-based segmenters such as Keypoint-MoSeq [Weinreb et al., 2024] summarize transitions in a matrix over discrete syllables after coarsening each trajectory into states; deep autoencoder-based segmenters (VAME, [Luxem et al., 2022]) and topological tools such as Mapper [Singh et al., 2007] also coarsen first, then read transitions off the coarsened object. In every case the resolution of any transition claim inherits from that coarsening. We take the opposite route and recover transition structure directly from the raw trajectory, at the fidelity of individual frames. Using discrete Morse theory on density-weighted point clouds, we extract two topological primitives (DM-primitives) on the behavioral manifold: DM-paths (H0H_0), which thread through the sparse regions between behavioral basins, and DM-cycles (H1H_1), which encode asymmetric forward and return motor programs when geometric conditions hold. We prove that behavioral transitions force these primitives to exist in the skeleton, making their presence a guarantee rather than a heuristic. On a rat behavior dataset across three representations (egocentric keypoints, joint configurations, learned intentions), unsupervised Wasserstein clustering of the primitives (DM-WKC) recovers transitions that the AR-HMM, deep-autoencoder, and Mapper baselines miss, at a fidelity coarsening-based methods structurally cannot reach. DM-primitives provide a complementary feature space whose transition information the existing camps leave on the table.

A look at what the method sees

Behavior, viewed as a dense cloud of poses, has shape — and that shape carries the transitions. The clips below are intentionally minimal: no equations, no labels, just the raw geometric objects our method works with. Hover over each to see them play.

The shape of a familiar manifold

A torus is the textbook example of a space whose shape is more than its bounding box: it has a hole. Our skeleton extraction is built so that, given only a point cloud, that hole is recovered as a primitive of the underlying space rather than inferred from a model. The animation walks through the six phases of the construction:

Point CloudGreedy Permutation (sample order from densest to sparsest) → Vertex Weighting (assign each point an inverse-density score) → SWR Filtration Sweep (grow a sparse weighted Rips graph by adding edges in order of weight) → DM Skeleton (collapse paired simplices via the discrete Morse matching, keep only the critical ones) → Cycle Detection (H₁) (the surviving unfilled loops are the topological obstructions — the hole of the torus shows up here).

The shape of a behavior landscape

Real animal behavior is messier than a torus, but the same idea applies. Pose density forms basins (where behavior settles) and ridges (where it crosses). The skeleton our method extracts traces only the structure that the density forces — peaks, valleys, the saddles between them.

A two-basin landscape (left), the cycle and path the skeleton extracts (middle), and the top-down density map (right).

The shape of a transition

When two density basins are kept apart by a low-density ridge, the corridor that bridges them — and the loop that closes around them when the forward and return paths are geometrically distinct — is precisely what the method picks out. Below, two such routes recovered on a single rodent clip, with the rendered pose at each waypoint.

Two routes between behavioral modes, with the rodent pose along each route.

Zooming out from a single transition to a single clip: rich enough to span four distinct behaviors (Immobile, Walking, Left Turn, Rear), one cluster minimum per behavior label, and a DM-path between every minimum pair. The left panel is a t-SNE of the clip’s intention features, points colored by behavior and a star at each cluster’s inverse-density minimum; as the video plays, every DM-path on the t-SNE grows simultaneously, with each line segment taking the cluster color of the point underneath, so the line itself reads as a behavior-to-behavior gradient. The rows on the right play the rodent traversing each path in real time, with the body’s tint shifting continuously from the source cluster’s color to the destination cluster’s color — the same gradient idea applied to the actual movement.

A single clip, four cluster minima, six DM-paths. Left: t-SNE with cluster minima (stars) and DM-paths growing in cluster-colored segments. Right: the rodent traversing each path, body tinted source-cluster → destination-cluster.

Recovering transitions from shape alone

A surprising property of the method is how little temporal information it needs. The skeleton is built from the spatial density of poses — what configurations the body actually visits, and how often — without explicit Markov dynamics, sequence models, or labels. From that alone, the same behavior pair the human annotator labelled (left two columns of each video) can be reconstructed end-to-end (right two columns), one example each from the DM-cycle (DMC) and DM-path (DMP) primitives. We omit the transitions that the method did not find.

Immobile ↔ Rear. Left two: ground truth. Right two: DMC and DMP discovered.
Immobile ↔ Turn. Left two: ground truth. Right two: DMC and DMP discovered.
Immobile ↔ Walk. Left two: ground truth. Right two: DMC and DMP discovered.
Rear ↔ Turn. Left two: ground truth. Right two: DMC and DMP discovered.

Full method, theorems, and benchmarks in the paper. More content coming soon.

BibTeX citation

@article{topomimic2026,
title={Shaped by What's Missing: Topological Invariance
Simplification Discovers Behavioral Transitions},
author={Bian, Kaiwen and Leonardis, Eric J. and Yang, Yuanjia
and Zhang, Charles and Azim, Eiman
and {\"O}lveczky, Bence P. and Wang, Yusu
and Pereira, Talmo D.},
journal={arXiv preprint},
year={2026}
}