File size: 2,973 Bytes
7fa130d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# CalMS21 — files used by BehaVERT

Pose keypoints and behavior annotations of resident–intruder mouse pairs from
**CalMS21** (Sun et al., 2021). Keypoints were tracked with MARS: 2 mice
(0 = resident, black; 1 = intruder, white) × 7 body parts (nose, left ear,
right ear, neck, left hip, right hip, tail base), in pixels of a 1024 × 570 video.

```
calms21/
├── calms21_all_keypoints.pt                       # pretraining input (built by us)
├── task1/calms21_task1_{train,test}.json          # original files, Task 1
└── task3_new_behaviors/calms21_task3_{train,test}.json   # original files, Task 3
```

## 1. Task 1 and Task 3 JSON files (unchanged)

These are the original CalMS21 files. Format:
`{group: {session: {"keypoints": [T, 2 mice, 2 (x, y), 7], "scores": [T, 2, 7],
"annotations": [T], "metadata": {...}}}}`.

- **Task 1** (paper Table 1): `attack = 0, investigation = 1, mount = 2, other = 3`.
  `other` is not scored.
- **Task 3** (paper Table 3): seven rarer behaviors, each annotated in its own
  set of sessions. The top-level keys of the JSON are the behavior names.

## 2. `calms21_all_keypoints.pt` (built by us)

Every session from every CalMS21 keypoint file, with labels and confidence
scores removed, for self-supervised pretraining (masked keypoint modeling):

```
{
  "sessions": [FloatTensor[T, 28], ...],   # 574 sessions, 9,195,792 frames
  "metadata": {"files", "num_frames_per_file", "session_names",
               "num_frames_per_session", "session_to_file_idx",
               "total_frames", "total_sessions"}
}
```

Each frame is flattened to 28 values in `mouse → keypoint → (x, y)` order.
Source files (all 10 CalMS21 keypoint JSONs):

| Source | Notes |
|---|---|
| Task 1 train, test | |
| Task 2 (annotation styles) train, test | used only here |
| Task 3 (new behaviors) train, test | |
| Unlabeled videos, parts 1–4 | used only here |

Because this file covers every split, **pretraining sees the poses (not the
labels) of the Task 1 and Task 3 test sessions**, as described in the paper
("using the entire CalMS21 dataset across all tasks and splits"). Use only the
training files if you need a strictly held-out test set.

The Task 2 and unlabeled-video JSONs themselves are not included: their
keypoints are already inside this file. Download them from the official site
if you need the scores or the original layout.

## 3. Videos

Not included. The original Task 1 videos are only needed for the optional
synchronized-video visualization; download them from the CalMS21 site.

## 4. Source, license and citation

Original data: Sun et al., *The Multi-Agent Behavior Dataset: Mouse Dyadic
Social Interactions*, NeurIPS 2021 Datasets and Benchmarks (arXiv:2104.02710),
<https://data.caltech.edu/records/s0vdx-0k302>. Licensed under
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); these files are
shared under the same license. Please cite the original paper together with
BehaVERT.