CUBE finds and measures behaviour in video of animals. It combines DeepLabCut (DLC) pose estimation with unsupervised machine learning: it tracks body points, groups similar movements into clusters, lets you name the clusters by watching example clips, and then compares behaviour between animals or groups.
The method builds on B-SOiD (Hsu & Yttri 2021, Nat. Commun. 12:5188) and adds:
- multi-scale movement features (100 ms and 200 ms windows) and body-size-independent geometry;
- automatic selection of the clustering settings, with split and merge refinement of the clusters;
- stability checks across random seeds;
- hidden Markov model (HMM) smoothing of the labels over time;
- interactive annotation and optional guided labelling with your own labels;
- group statistics, a Group Predictor with permutation testing, and paradigm-specific reports.
What CUBE does not require: manual behaviour labels, predefined behaviour categories, or frame-by-frame annotation. You can add labels later (see Guided labelling) when you want clusters to follow behaviours you define.
What you provide: video recordings of your animals. CUBE can run the DLC SuperAnimal quadruped model for you, or you can bring your own DLC output files (H5 or CSV).
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
- 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.
- 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.
- 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.
- 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.
- 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.
Related tools
- 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.
The five steps at a glance
| Step | What happens | You get |
|---|---|---|
| 1. DLC | Body points are tracked in every frame | One filtered keypoint file (H5) per video |
| 2. Pre-process | Well-tracked body points are selected and checked | Cleaned keypoint files and a confidence report |
| 3. Cluster | Movement is turned into features, clustered and smoothed | Clusters, bout tables, plots and example clips |
| 4. Annotate | You name the clusters by watching example clips | Behaviour names |
| 5. Analyse | You compare behaviour between animals and groups | Ethograms, statistics and figures |
The pipeline at a glance
Start
Quick start: your first analysis
The shortest path from a folder of videos to named behaviours and your first figures, in ten steps.
Read →Installation and launching
Install CUBE with one double-click on Windows, check the installation, launch the app and the standalone tools, and fix common problems.
Read →The pipeline
Step 1: DLC inference
Run DeepLabCut pose estimation on your videos (2D, or 3D for multi-camera rigs) and produce filtered keypoint files.
Read →Smart Adapt: adapting the tracking model
How CUBE adapts the SuperAnimal model to your footage without hand labels: pooled same-camera videos, filtered pseudo-labels, and the corrections applied to every tracked video.
Read →Step 2: pre-processing
Check the tracking quality, keep the well-tracked body points, and prepare the data for clustering.
Read →Step 3: features, UMAP and clustering
How CUBE turns movement into clusters: features, UMAP, HDBSCAN, refinement, the classifier and HMM smoothing, with the settings you are most likely to change.
Read →Step 4: cluster annotation
Name each cluster by watching example clips in the Video Explorer.
Read →Step 5: behavioural analysis
Open the analyser for ethograms, statistics, transitions and group comparisons.
Read →Understanding the output files
Where CUBE writes results and what each file contains, including the bout-length tables the analyser reads.
Read →Analyse
The behavioural analyser
Reference for the CUBE analyser: its tabs, group labels, statistics, the Behavioral Explorer and the Group Predictor.
Read →Recombination guide
Merge and re-cluster behaviours after the fact: the three methods, their parameters and when to use each.
Read →Behavioural paradigms and arena context
Paradigm-specific results (open field, elevated plus maze, Y-maze, novel object and more) and how to trace arenas, regions and objects.
Read →Guided labelling
Human-in-the-loop labelling: steer unsupervised clusters towards the behaviours you care about and check them honestly.
Read →Reference
HMM smoothing
How a hidden Markov model smooths classifier output over time, and the two sets of outputs it produces.
Read →Advanced settings
Every setting in the Advanced CUBE Analysis window, with its default, what it does and what changing it means.
Read →Autosave, loading and compatibility
How CUBE autosaves your session, how to load it again, and how to reproduce results from older versions.
Read →