Skip to main content

Documentation Colab Website

FERAL

FERAL is an open-source toolkit for supervised animal behavior segmentation that leverages state-of-the-art video-understanding models.

  • No pose estimation
  • Install and start training in 3 commands
  • Scale a small set of manual labels to terabytes of video

Quickest Start (Google Colab)

The easiest way to run FERAL is directly in your browser through Google Colab, but you'll need a Colab Pro subscription to access good GPUs. Good news: Colab Pro is free for academics with an institutional email.

Open in Google Colab

Use with an A100 or L4 GPU.

Manual Installation

pip install feral

That's it. Now you should be able to run everything.

pip install feral accepts a range of dependency versions so it can share an environment with other tools. To get the exact versions we test with, install requirements.txt first:

pip install -r requirements.txt
pip install feral

System Requirements

  • Preferably Linux. Windows should work too. We haven't tested on Mac.
  • Python 3.10+
  • PyTorch 2.6+ (with a compatible CUDA version)
  • NVIDIA GPU with Ampere architecture or newer (compute capability 8.0+). 8 GB configurations are benchmarked below; 24+ GB gives more room for batch size. FERAL uses bfloat16 and flash attention, which require newer architectures.

Historical V-JEPA experiments used PyTorch 2.4, but pip install feral requires PyTorch 2.6+ and may upgrade an older environment. Earlier releases can execute code from an untrusted checkpoint file.

Older GPUs like V100 (Volta) and T4 (Turing) — including free Google Colab T4 instances — will not work. Supported GPUs include: A100, H100, A10, L4, L40, RTX 3000/4000/5000 series, and newer.

For 8 GB GPUs, start with:

feral train path/to/videos path/to/labels.json --mode lite --gradient-checkpointing --no-wandb

Paper v2, Table 3 benchmarks an RTX 3070 (8 GB): lite with gradient checkpointing trains at 1.82 chunks/s and runs inference at 7 chunks/s, with an estimated 24.2 hours for full CalMS21 training. These are measured recipe-specific rates, not guarantees for every dataset; Table 8 compares preset accuracy. Training stays on your own hardware with --no-wandb (initial model-weight downloads still require network access).

The Docker image uses PyTorch 2.11.0 / CUDA 12.8. The V-JEPA experiments used PyTorch 2.4 / CUDA 12.4. PyTorch is intentionally not pinned so existing GPU environments can keep a compatible build.

Windows Notes

  • decord and triton-windows are installed automatically. Windows GPU training has not been revalidated for this release.
  • Triton must match your PyTorch minor version: 2.6 → 3.2, 2.7 → 3.3, 2.8 → 3.4, 2.9 → 3.5, 2.10 → 3.6. For example, with PyTorch 2.10 run pip install "triton-windows>=3.6,<3.7". Unlike the other dependencies, it is not pinned because it follows the user-installed PyTorch build. See the upstream compatibility table.
  • PyTorch 2.8-2.9 has a known bug on Windows where torch.compile crashes with OverflowError: Python int too large to convert to C long (pytorch#162430). Use PyTorch 2.7 or 2.10+ to avoid this. See issue #11 for details.

We've used RunPod extensively to run experiments. It's very easy to set up.

Troubleshooting

  • AMD RDNA GPUs (ROCm): use PyTorch 2.13+ Older PyTorch ROCm builds have a LayerNorm backward bug on RDNA (wave32) GPUs, such as the RX 9070 XT, Radeon AI PRO R9700, and Radeon 8060S (Strix Halo), that can silently produce incorrect gradients even while training loss decreases. Upgrade to a compatible ROCm build of PyTorch 2.13+ for the upstream fix. See PR #23 and the upstream Strix Halo report for details and hardware validation.

Running FERAL

1. Re-encode Videos

FERAL needs videos in a format that supports random frame access, so we recommend re-encoding your videos with the provided tool. It will install FFmpeg if it doesn't find it on your system.

feral reencode path/to/videos path/for/reencoded/videos

2. Validate Your Dataset

feral validate path/to/videos path/to/labels.json

This checks the label JSON and that every video's frame count matches its labels, then prints a per-split summary of videos, labeled frames, and frames per class. Add --json to get a single JSON object for scripts; the exit code is 0 when the dataset is valid and 1 otherwise.

3. Start Training

feral train path/to/videos path/to/labels

For batch/HPC jobs, add --no-wandb to disable external logging and prompts, or --public-wandb to explicitly publish logs to the community project. Run feral train --help for preset, batch-size, and gradient-checkpointing options.

Without either flag, this will prompt you about logging options — you can select what fits you. You'll be able to see per-epoch metrics either way. If you select W&B, you'll also get automatically generated ethograms, per-step loss, and system utilization info.

Results will be saved to answers/_inference_{run_name}_{timestamp}.json.

4. Training from a Config

If you don't want to run this in an interactive terminal, you can start training with:

feral train-config path/to/config

This requires a config in the same format as the packaged feral/default_config.yaml.

5. Inference

You can run inference through the train command by removing the train partition from your config. But you can also run inference standalone without a config:

feral infer path/to/checkpoint path/to/videos

Example Datasets

FERAL has been validated on multiple datasets:

  • CalMS21 - mouse social interactions
  • MaBE - multi-species benchmark (mice, beetles, ants, flies)
  • C. elegans - locomotor states (forward/reverse/turn/pause)
  • Ooceraea biroi - self vs. allogrooming and collective raids

Access details and converters are documented at getferal.ai.

Citation

Please cite the FERAL preprint; the revised manuscript (v2) includes hardware and preset benchmarks.

Authors

Peter Skovorodnikov† (Rockefeller University) Jacopo Razzauti† (Vosshall Lab, Rockefeller University; Price Family Center for the Social Brain)

† Equal contribution Contact: jacopo.razza@gmail.com | peter.skovorodnikov@gmail.com


FERAL = Feature Extraction for Recognition of Animal Locomotion

Metadata

Release files for feral 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feral 1.0.5
File Size Uploaded Provenance Actions
feral-1.0.5.tar.gz 94.8 kB Without provenance Details for feral-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for feral 1.0.5
File Interpreter ABI Platform Actions
feral-1.0.5-py3-none-any.whl Python 3 none any Details for feral-1.0.5-py3-none-any.whl

Total release size: 159.2 kB

Release files / feral-1.0.5.tar.gz

Download URL feral-1.0.5.tar.gz
Size 94.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b86c7a1af526359d8d5e78066ba8da3a05c9eb06ee9f98b9a38d27b7d9545d05
BLAKE2b-256 checksum
How to use checksums
dcccef68998386537c62e8cbe0f3514e2fde6a88344440e9908ee03ab5a421c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / feral-1.0.5-py3-none-any.whl

Download URL feral-1.0.5-py3-none-any.whl
Size 64.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
078de6951fccc421236e9b5a0b96369c4de6687e5e1f1e6cd4dc9730a9791b50
BLAKE2b-256 checksum
How to use checksums
365df41fc9e5eefdb4bb000d2736c65c9ffd8f8cf1a7f3c1dd5c0ff905c82415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for feral 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page