movement

a Python toolbox for analysing motion tracking data

Niko Sirmpilatze @ The Behaviour Forum Webinar

2026-04-02

Measuring behaviour as movement

Defining behaviour is tricky, but many have tried.

The total movements made by the intact animal (Tinbergen 1951).

We can quantify movements through various tools:

  • 🎥 Video cameras
  • 📱 Inertial measurement units (IMUs)
  • 🛰️ GPS-based biologgers

From videos to motion

By danceinthesky, openverse.org

CRISPR Ants Lose Ability to Smell” (2017)

Markerless pose estimation

Animal behaviour 🤝 computer vision

What happens after tracking?

  • Lack of standardised data formats and tools
  • Lots of fragile ‘in-house’ scripts
  • Piles of un-analysed data

movement: overview

The movement dataset

Dataset types

movement input/output

Cleaning data

Quick plots

Quantifying motion

Scripting with movement

from movement.io import load_dataset
from movement.filtering import rolling_filter
from movement.kinematics import compute_speed

ds = load_dataset(
  "path/to/my_data.h5", source_software="DeepLabCut", fps=30
)

ds = ds.sel(time=slice(600, 2400))

ds["position_smooth"] = rolling_filter(
  ds["position"], window=5, statistic="median"
)

ds["speed"] = compute_speed(ds["position_smooth"])

ds.to_netcdf("my_data_processed.nc")

movement GUI

Drawing regions of interest

Using regions of interest

  • Load into as polygons or lines
  • Compute distances and angles relative to regions
  • Compute region occupancy

Keeping it light

  • Package available on PyPI and conda-forge
  • | | Works across OSes
  • No dedicated GPU required

Long-term vision

movement as the scikit-image for animal motion data.

If you prefer the R ecosystem, check out the animovement toolbox by Mikkel Roald-Arbøl.

Behaviour segmentation?

Aligning data streams

movement community

~90k downloads | 42 code contributors | ~370 merged pull requests

Join the movement

References

CRISPR Ants Lose Ability to Smell.” 2017. Nature 548 (7667): 263–63. https://doi.org/10.1038/d41586-017-02337-4.
Mathis, Alexander, Pranav Mamidanna, Kevin M. Cury, et al. 2018. DeepLabCut: Markerless Pose Estimation of User-Defined Body Parts with Deep Learning.” Nature Neuroscience 21 (9): 1281–89. https://doi.org/10.1038/s41593-018-0209-y.
Pereira, Talmo D., Nathaniel Tabris, Arie Matsliah, et al. 2022. SLEAP: A Deep Learning System for Multi-Animal Pose Tracking.” Nature Methods 19 (4): 486–95. https://doi.org/10.1038/s41592-022-01426-1.
Tinbergen, Niko. 1951. The Study of Instinct. Clarendon Press.