splits/train.csv (2,160 crops), splits/val.csv (540) and splits/test.csv (211,800) list every image used in the study. Each image is a crop of one animal, cut from a video frame with a bounding box, and carries that animal’s behavior label at that time in the source dataset.
train_test_split(test_size=0.2, stratify=label, random_state=42).test_index is the row order used for evaluation and in all prediction files.| Behavior | Source | Training | Validation | Test |
|---|---|---|---|---|
| Drinking | MmCows | 240 | 60 | 3,011 |
| Eating head down | MmCows | 240 | 60 | 30,952 |
| Eating head up | MmCows | 240 | 60 | 18,783 |
| Lying | MmCows | 240 | 60 | 83,509 |
| Standing | MmCows | 240 | 60 | 69,807 |
| Walking | MmCows | 240 | 60 | 3,819 |
| Frontal pushing | PlayBehavior | 240 | 60 | 600 |
| Gallop | PlayBehavior | 240 | 60 | 575 |
| Leap | PlayBehavior | 240 | 60 | 744 |
| Total | 2,160 | 540 | 211,800 |
| Column | Description |
|---|---|
split |
train, val or test |
test_index |
0–211,799, test rows only; order of evaluation and of results/*/test_predictions.csv.gz |
source |
MmCows or PlayBehavior |
behavior |
behavior name used in the paper |
source_label |
label in the source dataset (MmCows calls the eating behaviors Feeding head down/up) |
crop_file |
MmCows: crop file name ID<cow>+<camera>+<unix time>_<hh-mm-ss>_<hash>.jpg. PlayBehavior: pb_<8-hex hash>.jpg |
animal_id |
MmCows: cow_1 … cow_16. PlayBehavior, released farms: calf_id of the public dataset (e.g. FarmA-2642, FarmB-9). PlayBehavior, unreleased farms: unreleased_farm_k_calf_n |
site |
MmCows: the MmCows pen. PlayBehavior: Farm A or Farm B (the pseudonyms of the public dataset), or unreleased_farm_1, unreleased_farm_2 |
camera |
MmCows: cam_1 … cam_4 (synchronized, so the same cow at the same second appears in several views). PlayBehavior: camera channel |
timestamp_unix |
MmCows only: Unix time of the frame (1 frame per second) |
public_session_id |
PlayBehavior, released farms: session of the public dataset (e.g. FarmA_2024-06-11_PM) |
public_frame |
PlayBehavior, released farms: frame of that session (e.g. 0135340.jpg) |
public_frame_tar |
PlayBehavior, released farms: shard of the public dataset that contains the frame |
Class order of all prediction and confusion-matrix files (index 0–8): Drinking, Eating head down, Eating head up, Lying, Standing, Walking, Frontal pushing, Gallop, Leap.
PlayBehavior. 2,528 of the 2,819 calf crops come from the two farms whose videos, decoded frames, annotations and calf tracks are public under CC0: the Calf Play Behavior Dataset, version 1.2 (doi:10.57967/hf/11689), described in arXiv:2611.21706. Each of these rows gives the session, frame, shard and calf in that dataset. All 2,528 frames were checked against the version 1.2 frame index.
import io, tarfile
from PIL import Image
from huggingface_hub import hf_hub_download
row = {"public_frame_tar": "frames/FarmA_2024-06-11_PM/FarmA_2024-06-11_PM_video046.tar", "public_frame": "0135340.jpg"}
path = hf_hub_download("Sonam5/Calf-Play-Behavior-Dataset", row["public_frame_tar"], repo_type="dataset")
with tarfile.open(path) as tf:
frame = Image.open(io.BytesIO(tf.extractfile(row["public_frame"]).read()))
The dataset’s tracking/ files hold automatic calf boxes for most tracked calves. The exact boxes used to cut our crops are not included. From version 1.2, people in the footage are covered by a mosaic; a mosaic can occasionally fall on a calf (see the dataset card).