Skip to main content

birdnet

CI codecov PyPI PyPI MIT

A Python library for identifying bird species by their sounds.

The library is geared towards providing a robust workflow for ecological data analysis in bioacoustic projects. While it covers essential functionalities, it doesnโ€™t include all the features found in BirdNET-Analyzer, which is available here. Some features might only be available in the BirdNET Analyzer and not in this package.

[!NOTE] This project is under active development, so you might encounter changes that could affect your current workflow. We recommend checking for updates regularly.

The package is also available as an R package at: birdnetR.

Features

  • ๐Ÿฆ Extract classification scores and embeddings from audio recordings โ€” 6,522 species (V2.4) or 11,000+ (V3.0 preview)
  • ๐Ÿ“ Predict species presence for a given location and time โ€” 6,522 species (V2.4) or 12,000+ (V3.0)
  • ๐Ÿง  Utilize your custom-trained acoustic models from BirdNET-Analyzer
  • โš™๏ธ Support for both CPU and GPU execution (including multiple GPUs at the same time)
  • ๐Ÿš€ Multiprocessing support for fast batch analysis of large datasets
  • ๐Ÿ’พ Low memory footprint and small disk space requirements
  • ๐ŸŽต Support for various audio file formats (WAV, FLAC, OGG, MP3, etc.)
  • ๐Ÿ“Š Export results in various output file formats (CSV, Arrow table, Parquet, Numpy, etc.)
  • ๐Ÿ’ป Cross-platform: Windows, macOS, and Linux
  • ๐ŸŒ Use multilingual species names (English, German, French, Spanish, etc.)
  • โฌ‡๏ธ Auto-download of all official models
  • ๐Ÿ›œ Full offline usage using local (custom) model files

The library is optimized for a minimal memory footprint and maximum scalability, making it suitable for both edge devices and high-performance computing clusters.

Speed benchmarks

Device Specs Disk OS Real-time factor Time to predict 1 h
Intel i7 8th Gen 4 cores NVMe Windows 50ร— 72 s
Ryzen 7 3800X 8 cores NVMe Linux 420ร— 8.5 s
Nvidia Titan RTX 24 GB VRAM NVMe Linux 2460ร— 1.5 s

For more detailed benchmarks, please refer to the documentation.

Installation

Platform support and Python versions

Platform Architecture ProtoBuf-CPU ProtoBuf-GPU TFLite LiteRT
Linux x86_64 3.11, 3.12, 3.13 3.11, 3.12, 3.13 3.11, 3.12, 3.13 3.11, 3.12
ARM64 3.11, 3.12, 3.13 / 3.11, 3.12, 3.13 3.11, 3.12
MacOS x86_64 3.11, 3.12 / 3.11, 3.12 /
ARM64 3.11, 3.12, 3.13 / 3.11, 3.12, 3.13 /
Windows x86_64 3.11, 3.12, 3.13 / 3.11, 3.12, 3.13 /
ARM64 / / / /

For details see the official TensorFlow documentation.

Python 3.14

TensorFlow does not yet publish wheels for Python 3.14, so the table above (all TensorFlow-based backends: ProtoBuf, TFLite/LiteRT) is limited to Python 3.11โ€“3.13. On Python 3.14, birdnet installs without TensorFlow and supports the models that have a TensorFlow-free backend: the acoustic 3.0 model and the geo 3.0 model (both via onnx or pt):

pip install birdnet[onnx] --user   # or birdnet[pt]
import birdnet

model = birdnet.load("acoustic", "3.0", "onnx")  # 'pt' also works
predictions = model.predict("example/soundscape.wav")

geo = birdnet.load("geo", "3.0", "onnx")  # 'pt' also works
geo_predictions = geo.predict(42.5, -76.45, week=4)

The TensorFlow-only paths โ€” the tf/pb backends, the acoustic 2.4 and Perch models, and the geo 2.4 model โ€” raise a clear error on Python 3.14. To use them, install birdnet on Python 3.11โ€“3.13. Full 3.14 support will follow once TensorFlow ships Python 3.14 wheels.

Instructions

# For CPU users
pip install birdnet --user

# For GPU users (NVIDIA GPU driver and CUDA need to be installed in advance)
pip install birdnet[and-cuda] --user

The V3.0 models add two additional backends that require optional dependencies:

# PyTorch backend (.pt models)
pip install birdnet[pt] --user

# ONNX backend (.onnx models)
pip install birdnet[onnx] --user

If you encounter issues with audio file reading, please ensure that libsndfile is installed on your system.

  • Ubuntu/Debian: sudo apt-get install libsndfile1
  • macOS (using Homebrew): brew install libsndfile
  • Windows: Download and install the precompiled binaries from the official website, extract them and add the folder to path.

Supported operations, precisions and devices

V2.4

Model Acoustic Acoustic Acoustic Geo Geo
Backend TFLite/
LiteRT
ProtoBuf ProtoBuf
Raven*
TFLite/
LiteRT
ProtoBuf
predict(..) โœ… โœ… โœ… โœ… โœ…
encode(..) โœ… โœ… โŒ โŒ โŒ
INT8 CPU โŒ โŒ โŒ โŒ
FP16 CPU โŒ โŒ โŒ โŒ
FP32 CPU CPU/GPU CPU/GPU CPU CPU/GPU

โœ… = Supportedโ€ƒโŒ = Not supported
*ProtoBuf Raven is only available for custom acoustic models.

V3.0

The V3.0 acoustic and geo models are both available in four backends (TFLite/LiteRT, ProtoBuf, PyTorch and ONNX). The PyTorch backend requires birdnet[pt] and the ONNX backend requires birdnet[onnx].

Model Acoustic Acoustic Acoustic Acoustic Geo Geo Geo Geo
Backend TFLite/
LiteRT
ProtoBuf PyTorch ONNX TFLite/
LiteRT
ProtoBuf PyTorch ONNX
predict(..) โœ… โœ… โœ… โœ… โœ… โœ… โœ… โœ…
encode(..) โœ… โœ… โœ… โœ… โŒ โŒ โŒ โŒ
INT8 โŒ โŒ โŒ โŒ CPU โŒ โŒ โŒ
FP16 CPU โŒ โŒ CPU/GPU CPU โŒ โŒ CPU/GPU
FP32 CPU CPU/GPU CPU/GPU CPU/GPU CPU CPU/GPU CPU/GPU CPU/GPU

โœ… = Supported โŒ = Not supported

Load a V3.0 model by passing the version and backend, e.g. birdnet.load("acoustic", "3.0", "onnx") or birdnet.load("geo", "3.0", "tf").

Perch V2

Model Acoustic Geo
Backend ProtoBuf โŒ
predict(..) โœ… โŒ
encode(..) โœ… โŒ
INT8 โŒ โŒ
FP16 โŒ โŒ
FP32 CPU/GPU โŒ

Note: Perch can not be run on Intel macOS systems due to compatibility issues with TensorFlow.

Example usage

Identify species within an audio file

import birdnet

model = birdnet.load("acoustic", "2.4", "tf")

predictions = model.predict(
  "example/soundscape.wav",
  # predict only the species from the file
  custom_species_list="example/species_list.txt",
)

predictions.to_csv("example/predictions.csv")

The resulting predictions look like this (excerpt, scores may vary):

input start_time end_time species_name confidence
/home/.../example/soundscape.wav 00:00:00.00 00:00:03.00 Poecile atricapillus_Black-capped Chickadee 0.814
/home/.../example/soundscape.wav 00:00:03.00 00:00:06.00 Poecile atricapillus_Black-capped Chickadee 0.3084
/home/.../example/soundscape.wav 00:00:06.00 00:00:09.00 Baeolophus bicolor_Tufted Titmouse 0.1864
/home/.../example/soundscape.wav 00:00:09.00 00:00:12.00 Haemorhous mexicanus_House Finch 0.6392
/home/.../example/soundscape.wav 00:00:18.00 00:00:21.00 Cyanocitta cristata_Blue Jay 0.4353
/home/.../example/soundscape.wav 00:00:21.00 00:00:24.00 Cyanocitta cristata_Blue Jay 0.3291
/home/.../example/soundscape.wav 00:00:21.00 00:00:24.00 Haemorhous mexicanus_House Finch 0.1866
... ... ... ... ...

For a more detailed prediction you can take a look at example/predictions.csv.

Predict species for a given location and time

import birdnet

model = birdnet.load("geo", "2.4", "tf")

predictions = model.predict(42.5, -76.45, week=4)

predictions.to_csv("example/location.csv")

The resulting predictions look like this (excerpt, scores may vary; sorted alphabetically):

species_name confidence
Acanthis flammea_Common Redpoll 0.0442
Accipiter cooperii_Cooper's Hawk 0.0812
Agelaius phoeniceus_Red-winged Blackbird 0.0996
Anas platyrhynchos_Mallard 0.4468
Anas rubripes_American Black Duck 0.11
... ...

The full result is at example/location.csv.

Location of Log File

If something goes wrong, you can find the log file in the following locations:

  • Windows: C:\Users\{user}\AppData\Local\Temp\birdnet.log
  • Linux/MacOS: /tmp/birdnet.log

File formats

The audio models support all formats compatible with the SoundFile library (see here). This includes, but is not limited to, WAV, FLAC, OGG, and AIFF. The flexibility of supported formats ensures that the models can handle a wide variety of audio input types, making them adaptable to different use cases and environments.

  • Supported: AIFC, AIFF, AU, AVR, CAF, FLAC, HTK, IRCAM, MAT4, MAT5, MP3, MPC2K, NIST, OGG, OPUS, PAF, PVF, RAW, RF64, SD2, SDS, SVX, VOC, W64, WAV, WAVEX, WVE, XI
  • Not supported at the moment: AAC, M4A, WMA

Model formats and execution details

Depending on the model version, this project provides up to four model formats: Protobuf/Raven, TFLite, PyTorch and ONNX. All formats are designed to have identical precision up to 2 decimal places, with differences only appearing from the third decimal place onward.

  • TFLite Model (tf): Limited to CPU execution only.
  • ProtoBuf Model (pb): Can be executed on both GPU and CPU.
  • PyTorch Model (pt, V3.0 only): Can be executed on both GPU and CPU. Requires birdnet[pt].
  • ONNX Model (onnx, V3.0 only): Can be executed on both GPU and CPU. Requires birdnet[onnx].

Ensure your environment is configured to utilize the appropriate model and available hardware optimally.

License

Please ensure you review and adhere to the specific license terms provided with each model. Note that educational and research purposes are considered non-commercial use cases.

Citation

Feel free to use birdnet for your acoustic analyses and research. If you do, please cite as:

@article{kahl2021birdnet,
  title={BirdNET: A deep learning solution for avian diversity monitoring},
  author={Kahl, Stefan and Wood, Connor M and Eibl, Maximilian and Klinck, Holger},
  journal={Ecological Informatics},
  volume={61},
  pages={101236},
  year={2021},
  publisher={Elsevier}
}

Funding

Our work in the K. Lisa Yang Center for Conservation Bioacoustics is made possible by the generosity of K. Lisa Yang to advance innovative conservation technologies to inspire and inform the conservation of wildlife and habitats.

The development of BirdNET is supported by the German Federal Ministry of Research, Technology and Space (FKZ 01|S22072), the German Federal Ministry for the Environment, Climate Action, Nature Conservation and Nuclear Safety (FKZ 67KI31040E), the German Federal Ministry of Economic Affairs and Energy (FKZ 16KN095550), the Deutsche Bundesstiftung Umwelt (project 39263/01) and the European Social Fund.

Partners

BirdNET is a joint effort of partners from academia and industry. Without these partnerships, this project would not have been possible. Thank you!

Our partners

Download files

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

Source Distribution

birdnet-1.0.0.tar.gz (4.6 MB view details)

Uploaded Source

Built Distribution

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

birdnet-1.0.0-py3-none-any.whl (172.9 kB view details)

Uploaded Python 3

File details

Details for the file birdnet-1.0.0.tar.gz.

File metadata

  • Download URL: birdnet-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for birdnet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f83db75d4dfdfde3f92448bc4ca5ecb2244fcdffa6c9ea1caf4b4d38d91b999a
MD5 90852cab485582b9e4dc4c767db7c195
BLAKE2b-256 2730b8116cfe451470f716f7ba67434eeff4ee5572c428a791b3b30288abb50b

See more details on using hashes here.

Provenance

The following attestation bundles were made for birdnet-1.0.0.tar.gz:

Publisher: publish.yml on birdnet-team/birdnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file birdnet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: birdnet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 172.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for birdnet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa10fd586fea41968607d40cfab54a8503a8ebf9e4f951750c7460a22d4e29ab
MD5 d339299678e89a98e0f7466b30a2480b
BLAKE2b-256 86b003687dd217a69de256a57a5a424fec686cede13bf1b82b537e2b1a586785

See more details on using hashes here.

Provenance

The following attestation bundles were made for birdnet-1.0.0-py3-none-any.whl:

Publisher: publish.yml on birdnet-team/birdnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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