Home / About

What is CUBE?

CUBE, the Comprehensive Unsupervised Behavioral Explorer, turns raw video of animals into named behaviours and group statistics, with a point-and-click interface.

The idea

CUBE integrates DeepLabCut pose estimation with an unsupervised machine-learning pipeline to automatically discover and quantify behavioural patterns. It does not need manual labelling, predefined behaviour categories or frame-by-frame annotation. You provide videos; CUBE finds the recurring postures and movements, shows you examples, and lets you name them.

CUBE is built on the approach introduced by B-SOiD (Hsu and Yttri 2021, Nature Communications 12:5188): pose features, UMAP embedding, HDBSCAN clustering and a fast classifier. CUBE v5 adds multi-scale features, body-size normalisation, a cluster-validity sweep, temporal smoothing, interactive annotation and a built-in statistics suite, and it builds on the B-SOiD work rather than replacing it. This page describes version 5.

The pipeline

1. Record

Use any camera. For synchronised multi-camera rigs, CUBE can align recordings from Bonsai and flag filled or dropped frames so downstream steps know which frames to trust.

2. Track

DeepLabCut estimates body points in every frame, using a pretrained SuperAnimal quadruped model that is adapted to your videos, without hand labels. For calibrated four-camera rigs, CUBE triangulates the 2D points into a 3D skeleton. Confidence is checked, points that jump away from the animal are flagged, short gaps are interpolated, and a short median filter removes jitter.

3. Discover

From the tracked body points CUBE builds multi-scale features: pairwise distances, velocity, acceleration and, when available, body-axis angles, over 100 ms and 200 ms windows (plus a 50 ms window at 60 frames per second or more). UMAP embeds these windows, HDBSCAN groups them into clusters (with the minimum cluster size chosen by a sweep that scores each candidate with the DBCV validity index), and a classifier labels every window in every video. A hidden Markov model then smooths the labels over time.

4. Annotate

The cluster annotator plays example clips of each cluster with the pose overlaid. You name a cluster once, and the name is applied everywhere. If you want a stronger link to your own definitions, optional guided labelling uses labelled examples to steer clusters and reports how well they match on held-out data.

5. Analyse

The analyser provides ethograms, bout statistics, transition analyses, group comparisons and reclustering, plus a Group Predictor that tests whether behavioural profiles can classify group membership (with permutation testing). Paradigm-aware metrics are available when you trace arena regions and objects.

How CUBE relates to other tools

CUBE builds on B-SOiD and sits alongside other well-validated tools such as VAME and keypoint-MoSeq. These tools were designed for different needs, and none is best in every setting. The points below describe where CUBE's design differs. They reflect design choices rather than measured differences in performance. CUBE is under active development, and suggestions are very welcome.

Where CUBE's design differs

  1. A single application from recording to figures. Video alignment, pose estimation, pre-processing, clustering, annotation and statistics are run from one point-and-click interface, so a complete analysis does not require programming or moving files between separate programs. Every stage of a run is saved to one folder.
  2. Temporally aware, animal-centred clustering with a reproducibility check. Features describe posture and movement in animal-centred (egocentric) coordinates together with the order of movements. Clustering is repeated across random seeds and the agreement between runs is reported. When agreement is low, CUBE builds a representative (medoid) or consensus partition, so that the result depends less on a single seed.
  3. Researcher-guided refinement and correction. Clusters are named by watching example clips, and can be merged, split or recombined by hand, with a dendrogram view to support the decision. Optional guided labelling lets you supply your own labelled examples, so manual input remains possible at each stage rather than only at the end.
  4. Built-in analysis and figures. The analyser produces ethograms, bout statistics, bar charts, transition analyses and group comparisons that highlight clusters whose usage changes between conditions, including behaviours that were not defined in advance. A Group Predictor, based on regularised logistic regression (a generalised linear model) with permutation testing, asks whether behavioural profiles distinguish the groups.
  5. Arena-aware clustering. Optionally, clustering can take the position of the animal in traced regions of the arena into account, such as the open arms of an elevated plus maze, so that spatial context can help separate behaviours without letting position replace movement as the classification signal.
  • B-SOiD (Hsu and Yttri 2021) introduced the pose-feature, UMAP, HDBSCAN and fast-classifier approach that CUBE follows. CUBE keeps its speed and its lack of GPU training.
  • VAME (Luxem et al. 2022) learns a temporal embedding with a neural network. CUBE does not adopt that architecture or its training cost, and uses temporally aware features and smoothing to address a related question by simpler means.
  • keypoint-MoSeq (Weinreb et al. 2024) models keypoint uncertainty explicitly. CUBE uses a simpler analogue, in which low per-body-part confidence is used as a feature so that unreliable frames can be separated from behaviour clusters.

CUBE is under active development, and formal comparisons with other tools are still to come. The points above describe design choices rather than measured differences in performance. The tools mentioned are well-established, widely used methods, and comments and suggestions are very welcome.

What you need

  • Video recordings of your animals
  • Windows 10 or 11 (CUBE installs its own Python with one double-click; no programming needed)
  • A CUDA-capable GPU is recommended for pose tracking and not required for analysis
  • Optionally, your own DeepLabCut model; otherwise CUBE can run the SuperAnimal model for you

Get started Cite CUBE