CalMS21-mini
A small subset of the Caltech Mouse Social Interactions (CalMS21) dataset, packaged for teaching. It contains the first 40 sequences of the CalMS21 Task 1 training set (pose tracking plus frame-level behavior annotations) in a single compressed NumPy file, so a classroom of students can download it quickly in Colab without fetching the full ~460 MB archive.
It was made for the tutorial Extracting Features and Detecting Actions in Pose Datasets (Kennedy Lab, Scripps Research). For research use, please download the full dataset from CaltechDATA.
Dataset description
The sequences are top-view recordings of pairs of freely behaving mice in a standard resident-intruder assay. Both animals were tracked with MARS, and each frame was manually annotated by a single expert annotator for one of four behaviors.
| Sequences | 40 (from CalMS21 Task 1, train split) |
| Frames | 242846 |
| Frame rate | 30 fps |
| Animals per frame | 2 (index 0 = resident, index 1 = intruder) |
| Keypoints per animal | 7: nose, left ear, right ear, neck, left hip, right hip, tail base |
| Behavior labels | attack (0), investigation (1), mount (2), other (3) |
| Annotators | 1 |
| File | calms21_task1_train_subset40.npz (23.2 MB) |
File format
calms21_task1_train_subset40.npz holds, for each sequence i = 0 … 39:
| Key | Shape | dtype | Contents |
|---|---|---|---|
keypoints_{i} |
(frames, 2, 2, 7) | float32 | pixel coordinates: (frame, mouse, x/y, keypoint) |
scores_{i} |
(frames, 2, 7) | float16 | keypoint confidence from MARS, 0 (worst) to 1 (best) |
annotations_{i} |
(frames,) | int8 | behavior label per frame (see vocabulary above) |
plus two shared entries:
| Key | Contents |
|---|---|
names |
original CalMS21 sequence names, e.g. task1/train/mouse001_task1_annotator1, in original file order |
metadata_json |
JSON list with each sequence's original metadata dict (annotator id and behavior vocabulary) |
Usage
import json, urllib.request
import numpy as np
url = 'https://huggingface.co/datasets/annkennedy/calms21-mini/resolve/main/calms21_task1_train_subset40.npz'
urllib.request.urlretrieve(url, 'calms21_mini.npz')
with np.load('calms21_mini.npz') as d:
names = [str(n) for n in d['names']]
metadata = json.loads(str(d['metadata_json']))
keypoints = d['keypoints_0'] # (frames, 2, 2, 7)
annotations = d['annotations_0'] # (frames,)
vocab = metadata[0]['vocab'] # {'attack': 0, 'investigation': 1, 'mount': 2, 'other': 3}
The tutorial rebuilds these arrays into the same nested-dictionary layout as the original CalMS21 JSON
(data['annotator-id_0'][name] → keypoints, scores, annotations, metadata).
Splits
These are not the official CalMS21 train/test splits: all 40 sequences come from the official training set. Report results on the official CalMS21 test set when comparing against published benchmarks.
Intended use and limitations
- Intended for teaching and quick prototyping of pose-based behavior analysis and classification.
- Covers only 40 sequences from a single annotator and a single assay, so models trained on it will not generalize well and results should not be compared with benchmarks on the full dataset.
- Behaviors are imbalanced:
otherandinvestigationmake up most frames, andattackappears in only a minority of sequences. - Raw video, unlabeled sequences, and the Task 2 and Task 3 data are not included.
Source and license
Derived from the CalMS21 dataset (doi:10.22002/D1.1991), released under CC BY 4.0. This subset is redistributed under the same license. Changes from the original: selection of the first 40 Task 1 training sequences, conversion from JSON to compressed NumPy, and reduced numeric precision as described above.
Citation
If you use this data, please cite the original CalMS21 paper:
@article{sun2021multi,
title={The multi-agent behavior dataset: Mouse dyadic social interactions},
author={Sun, Jennifer J and Karigo, Tomomi and Chakraborty, Dipam and Mohanty, Sharada P and Wild, Benjamin and Sun, Quan and Chen, Chen and Anderson, David J and Perona, Pietro and Yue, Yisong and Kennedy, Ann},
journal={Advances in neural information processing systems},
volume={2021},
number={DB1},
pages={1},
year={2021}
}
- Downloads last month
- 76