Action Segmentation in Mice
An evaluation pipeline for a neural behavior classifier used in computational neuroscience research.
The Problem
Understanding animal behavior from continuous pose-tracking and sensor data requires segmenting it into discrete, meaningful actions — and once you have a model that does that, you need real tooling to check whether its predictions actually hold up across many different recording sessions and labs, not just one dataset.
The Approach
Built the evaluation and behavioral-fingerprinting pipeline around DAART, a pretrained Temporal Convolutional Network classifier from the International Brain Laboratory (IBL), applying it across 57 real research sessions spanning 8 different labs — pulling data via the IBL's own ONE API and validating predictions both quantitatively and qualitatively.






- ▹Loaded a pretrained daart.models.Segmenter (TCN) via PyTorch state dict, ran inference across sessions pulled with one.api.ONE and brainbox.io.one.SessionLoader
- ▹Custom non-uniform Savitzky-Golay smoothing: fits a least-squares polynomial per window to handle irregular timestamps from dropped tracking frames, rather than assuming uniform sampling
Highlights
- ▹Wrote a custom non-uniform Savitzky-Golay filter to smooth pose-tracking data that had irregular dropped/missing frames — the standard scipy implementation only handles uniformly-sampled data
- ▹Built an 88-dimensional behavioral "fingerprint" per trial (state-duration histograms across time bins and task periods) and visualized cross-session structure with UMAP
- ▹Validated the model two ways: quantitatively via macro-averaged F1 agreement scores and event-aligned heatmaps, and qualitatively via frame-by-frame video overlays of predicted states against real footage
- ▹Pulled real multi-lab data (57 sessions, 8 IBL labs) via the IBL's ONE API and brainbox tooling, not a single canned dataset