Skip to main content

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 classifier
  • ZooCustom_v1_Labels.txt – species labels
  • fusion_model_perchv2_best.pth – trained fusion model
  • architecture_info_public.json – model architecture config
  • perch_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


Download files

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

Source Distribution

aria_inference-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

aria_inference-0.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file aria_inference-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for aria_inference-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa704079f3af9227234dc07fd4342f95daf98bc15f3737b66b9f9f7c271d6e4a
MD5 18e24af646c87b6da728445cad5e1c39
BLAKE2b-256 afcb9e4d1703c5da9322bcb87697e463000c7330ce671d6a8ced97768ac177d6

See more details on using hashes here.

File details

Details for the file aria_inference-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for aria_inference-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6593b842abad8fb55c18105f750f7251ee726e82c92f86f0af967414c0fd7f50
MD5 deeacc5948be43291686bea174a2f427
BLAKE2b-256 3758f4d403244c6bc789d685b26fc578b01395f63ce3bbe088235a370cb6a400

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