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.4.0.tar.gz (43.2 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.4.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for feral-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4917aa86c9590c79103817fbe2a2dff8ea98a353171216d52bc16c1e8f676421
MD5 b04416c1f1f6aa3568fab90677697f06
BLAKE2b-256 414c8b3a82b3fe908e776e3896bb4e340638e7cda2bd40ef11491e7043ed8351

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for feral-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cc7e3f9727d2ba32e752f8ca24bf6c12d54b3ecce92ed91701a0e2357befe00
MD5 420b0604514e440b9ab4b7930d4d38cd
BLAKE2b-256 baa5d61cc49e40f42d0997cbbf576d387f566bb701adae758b17a871f0a9aeeb

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