Skip to main content

FERAL: Feature Extraction for Recognition of Animal Locomotion

Project description

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.

System Requirements

  • Preferably Linux. Windows should work too. We haven't tested on Mac.
  • Python 3.10+
  • PyTorch 2.4+ (with a compatible CUDA version)
  • NVIDIA GPU with Ampere architecture or newer (compute capability 8.0+) and 24+ GB VRAM. FERAL uses bfloat16 and flash attention, which require newer architectures.

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.

Windows Notes

  • triton-windows is installed automatically as a drop-in replacement for the official triton package, which has no Windows build.
  • 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.

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. Start Training

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

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.

3. 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 default_config.yaml. See configs/ for examples.

4. 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 contact us at jacopo.razza@gmail.com or peter.skovorodnikov@gmail.com for instructions on how to cite our work.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feral-0.2.0.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

feral-0.2.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file feral-0.2.0.tar.gz.

File metadata

  • Download URL: feral-0.2.0.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for feral-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e4ac2d46625b8e9671582aaa8d7b818552fc6d13ce17ff635a2e8527ea4dbe0
MD5 8a36579ab0e5fe0bc9d24120d4852612
BLAKE2b-256 9b4977511f46f5eea13b315357a7fbe357028c1dc40e100fc79caa11d1925970

See more details on using hashes here.

File details

Details for the file feral-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: feral-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for feral-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe8268f7857dd3dd09a3b58d29a7b2209ec8d7519aaecf31ff558027eb563e7f
MD5 0da38b2220ca2db161764ae04d6c1fd6
BLAKE2b-256 c6174b19016b981c14c217c300207c167f8973f3c8c913f96439a66d871dbfc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page