FERAL: Feature Extraction for Recognition of Animal Locomotion
Project description
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.
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-windowsis installed automatically as a drop-in replacement for the officialtritonpackage, which has no Windows build.- PyTorch 2.8-2.9 has a known bug on Windows where
torch.compilecrashes withOverflowError: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feral-0.3.0.tar.gz.
File metadata
- Download URL: feral-0.3.0.tar.gz
- Upload date:
- Size: 52.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b924328e65754be2ec6a254253f8f6413d002a538912fc3b0207f920f134e182
|
|
| MD5 |
576a7a6410ceb74422c6fe54d0527f44
|
|
| BLAKE2b-256 |
bc72d060dd5591edff64039b7b8b8fd0788e7c4b490d084e713df2de3ce8cba1
|
File details
Details for the file feral-0.3.0-py3-none-any.whl.
File metadata
- Download URL: feral-0.3.0-py3-none-any.whl
- Upload date:
- Size: 43.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b402c183d0a0d500475df4d17204bdcabef659a27e9c0961389d5820c223e24
|
|
| MD5 |
835e092d5ff93d9986738064396c181f
|
|
| BLAKE2b-256 |
92e8c40c0662ad9f5b9fe497ea05729cbeac3f106160280380d9564719cdd269
|