File Formats
This section documents the format of JABS output files that may be needed for downstream analysis.
Prediction File
An inference file represents the predicted classes for each identity present in one video file.
Location
The prediction files are saved in <JABS project dir>/jabs/predictions/<video_name>.h5 if they were generated by the JABS GUI.
The jabs-classify script saves inference files in <out-dir>/<video_name>_behavior.h5
Contents
The H5 file contains one group, called predictions. This group contains one or more behavior prediction groups. Each behavior prediction group contains 3 datasets and 1 new group.
Attributes
The root file contains the following attributes:
- pose_file: filename of the pose file used during prediction
- pose_hash: blake2b hash of pose file
- version: prediction output version
Each behavior prediction group contains the following attributes:
- classifier_file: filename of the classifier file used to predict
- classifier_hash: blake2b hash of the classifier file
- app_version: JABS application version used to make predictions
- prediction_date: date when predictions were made
predicted_class
- dtype: 8-bit integer
- shape: #identities x #frames
This dataset contains the predicted class. Each element contains one of three values:
- 0: "not behavior"
- 1: "behavior"
- -1: "identity not present in frame".
probabilities
- dtype: 32-bit floating point
- shape: #identities x #frames
This dataset contains the probability (0.0-1.0) of each prediction. If there is no prediction (the identity doesn't exist at a given frame) then the prediction probability is 0.0.
identity_to_track
- dtype: 32-bit integer
- shape: #identities x #frames
This dataset maps each JABS-assigned identity (Pose version 3) back to the original track ID from the pose file at each frame. -1 indicates the identity does not map to a track for that frame. For Pose File Version 4 and greater, JABS uses the identity assignment contained in the pose file. For pose version 2, there will be exactly one identity (0).
Feature File
A feature file represents features calculated by JABS for a single animal in a video file.
Location
Feature files are saved per identity at <JABS project dir>/jabs/features/<video_name>/<identity>/features.h5.
Contents
The H5 file contains feature data described in the feature documentation. Features used in JABS classifiers are located within the features group, further separated by per_frame and window_features_<window_size> groups. Features not used in JABS classifiers are located outside the features group.
All features are a vector of data containing the feature value for each frame in the video.
The root file contains the following attributes:
- distance_scale_factor: scale factor used when converting from pixel space to cm space
- identity: identity value from the original pose value
- num_frames: number of frames in the video
- pose_hash: blake2b hash of pose file
- version: feature version used when generating this feature file
Per-Frame Feature Names
Per frame features are named <feature module> <feature name>. Feature modules cannot contain spaces, while feature names can.
Window Feature Names
Window features are named <feature module> <window operation> <feature name>. Feature modules and window operations cannot contain spaces, while feature names can.