Full ARIA inference: BirdNET + PERCH v2 + Fusion for bird species detection
Project description
aria-inference
Full ARIA inference package: BirdNET + PERCH v2 + Fusion for bird species detection in zoo aviaries.
This is the complete baseline system for the BioDCASE 2026 Challenge. For BirdNET-only inference, see aria-inference-birdnet.
Installation
Requires Python 3.11 or 3.12 and a working installation of FFmpeg.
pip install aria-inference
This automatically installs BirdNET (via birdnetlib), PERCH v2 (via perch-hoplite), TensorFlow, and PyTorch.
Note: PERCH v2 auto-downloads its model from Kaggle on first use (~500 MB). This happens once and is cached locally.
Quick start
1. Download model files
aria-inference download-models --dir ./models
This fetches from GitHub Releases:
ZooCustom_v1.tflite– custom BirdNET classifierZooCustom_v1_Labels.txt– species labelsfusion_model_perchv2_best.pth– trained fusion modelarchitecture_info_public.json– model architecture configperch_v2_zoo_species_mapping.json– BirdNET-to-PERCH species mapping
2. Run detection on an aviary
aria-inference detect \
--input aviary_1/ \
--output predictions_aviary_1.csv \
--model-dir ./models \
--aviary-config aviary_config.json \
--aviary aviary_1
3. List available aviaries
aria-inference list-aviaries --aviary-config aviary_config.json
4. Python API
from pathlib import Path
from aria_inference import run_full_inference
run_full_inference(
input_path=Path("aviary_1/"),
output_csv=Path("predictions_aviary_1.csv"),
model_dir=Path("models/"),
aviary_config=Path("aviary_config.json"),
aviary_id="aviary_1",
)
How it works
ARIA uses a three-model ensemble for robust species detection:
Audio (3-second segments)
│
├─ BirdNET (custom TFLite) → 87-dim probability vector
│
├─ PERCH v2 (foundation model) → 87-dim constrained logits
│
└─ Fusion model (PyTorch) → combines BirdNET + PERCH → predictions
│
└─ Ensemble voting merges all three → final species + confidence
Two inference modes are available:
- Ensemble voting (default,
--mode voting): all three models run on every segment; predictions are merged using weighted voting with a consensus boost when 2+ models agree. - Tier-based fallback (
--mode tiers): BirdNET runs first; if confidence < threshold, fusion runs; if fusion is also low, PERCH provides a fallback.
CLI reference
detect
| Flag | Default | Description |
|---|---|---|
--input |
(required) | Audio file or directory |
--output |
(required) | Output CSV path |
--model-dir |
(required) | Directory with all model files |
--aviary-config |
None |
Path to aviary_config.json |
--aviary |
None |
Aviary ID (e.g. aviary_1) |
--allowed-species-file |
None |
Flat species whitelist (alternative) |
--temperature |
1.8 |
BirdNET confidence scaling |
--tier1-threshold |
0.85 |
BirdNET-only acceptance threshold |
--min-confidence |
0.30 |
Global minimum confidence |
--perch-min-confidence |
0.10 |
PERCH fallback minimum |
--top-k |
3 |
Max species per segment |
--segment-length |
3.0 |
Segment length in seconds |
--overlap |
0.0 |
Segment overlap in seconds |
--mode |
voting |
voting or tiers |
download-models
| Flag | Default | Description |
|---|---|---|
--dir |
(required) | Local directory for model files |
list-aviaries
| Flag | Default | Description |
|---|---|---|
--aviary-config |
(required) | Path to aviary_config.json |
Output format
File name,Start (s),End (s),Species,Confidence,Method
recording_001.wav,0.00,3.00,Greater Flamingo,0.8734,Ensemble Voting
recording_001.wav,3.00,6.00,Hadada Ibis,0.7521,Ensemble Voting
Notes
- This package is inference-only. It does not include training, data fetching, or segmentation.
- Model binaries are hosted as GitHub Release assets to keep the pip package small.
- PERCH v2 auto-downloads from Kaggle on first use and is cached locally.
- GPU is optional but recommended for faster PERCH inference.
- Python 3.10 is not supported due to dependency constraints.
License
Apache-2.0
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 aria_inference-0.1.2.tar.gz.
File metadata
- Download URL: aria_inference-0.1.2.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97dbf8e3bf1686fdffbc4b524415baaf5ae5c07e4af934d3f5f56eec77aa569e
|
|
| MD5 |
3e1f00af804d72eed94d26be13318780
|
|
| BLAKE2b-256 |
3885527b9363064d655e86da9c2d6decaad01b37142fc28ed1fbdd4ed95585df
|
Provenance
The following attestation bundles were made for aria_inference-0.1.2.tar.gz:
Publisher:
publish.yml on ml4biodiversity/aria-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aria_inference-0.1.2.tar.gz -
Subject digest:
97dbf8e3bf1686fdffbc4b524415baaf5ae5c07e4af934d3f5f56eec77aa569e - Sigstore transparency entry: 1191491356
- Sigstore integration time:
-
Permalink:
ml4biodiversity/aria-inference@2cda6127271b0e9f9827cbd015892be4bf2b08d0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ml4biodiversity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cda6127271b0e9f9827cbd015892be4bf2b08d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aria_inference-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aria_inference-0.1.2-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a3f177ad5bf0836b03164af5ea4366f66b0171cf664e221babf80079a0430a8
|
|
| MD5 |
95a92d06521b1c40c7df9fb95c09e961
|
|
| BLAKE2b-256 |
afb82bf9ae42df69c5a1fd9d808677a1d49c0ef3cec398d14fd468c246b48e22
|
Provenance
The following attestation bundles were made for aria_inference-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on ml4biodiversity/aria-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aria_inference-0.1.2-py3-none-any.whl -
Subject digest:
9a3f177ad5bf0836b03164af5ea4366f66b0171cf664e221babf80079a0430a8 - Sigstore transparency entry: 1191491357
- Sigstore integration time:
-
Permalink:
ml4biodiversity/aria-inference@2cda6127271b0e9f9827cbd015892be4bf2b08d0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ml4biodiversity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cda6127271b0e9f9827cbd015892be4bf2b08d0 -
Trigger Event:
push
-
Statement type: