DEV Community

Prasang Verma
Prasang Verma

Posted on

Trail Birder: An Offline Bird Identifier Built with Open-Source AI

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

Trail Birder is an offline bird identifier. You record a bird call with your laptop mic (or upload a clip), and it tells you the species, a confidence score, and a short, friendly field note about the bird.

The idea is to make the screen the shortest part of a walk: listen, record about 10 seconds, glance at the answer, then look up to find the bird. Because it runs with no internet, it works on a trail with no signal. It's for beginner birdwatchers, students, and anyone who hears a call and wonders "what is that?"

Screenshots:

  • Wi-Fi turned off, correctly identifying an Asian Koel:
    Wi-Fi off, Asian Koel identified

  • Mic recording test:
    Mic recording test result

Trail Birder

Record a bird call and get the species, a confidence score, and a short field note. It runs fully offline, so it works on a trail with no signal.

Offline proof

Why open-source AI

  • Offline: BirdNET (bird sound model) and Llama 3.2 3B (via Ollama) both run on my laptop. I tested it with Wi-Fi off.
  • Private: recordings never leave the device.
  • Free: no API keys, no usage fees.
  • Swappable: I can change the language model without touching the rest of the app 2

How it works

Browser mic or file upload -> Flask -> ffmpeg converts to WAV -> BirdNET identifies the species -> Ollama writes a 2-sentence field note.

How to run

  1. pip install -r requirements.txt
  2. Install ffmpeg and Ollama, then ollama pull llama3.2:3b
  3. python app.py and open http://127.0.0.1:5000

##Test results

# Test Bird App's answer Confidence Wi-Fi
1 File upload Asian Koel Asian Koel 0.9819 On
2
…

Two open models run locally on my laptop (HP ProBook, 14 GB RAM, no GPU):

  1. BirdNET v2.4 identifies the species from audio, through the birdnet Python package with the LiteRT runtime.
  2. Llama 3.2 3B, served by Ollama, writes a 2-sentence field note. If confidence is low, the prompt tells the model to say the match is uncertain.

The rest is a Flask backend, a browser page that records audio with the MediaRecorder API, and ffmpeg to convert recordings to WAV before BirdNET reads them.

Flow: mic or file -> Flask -> ffmpeg -> BirdNET -> Ollama -> result on the page.

I built it with Antigravity's agent for most of the code, then tested and fixed each step myself. Along the way I hit a Python 3.14 / TensorFlow incompatibility (fixed by switching BirdNET to the LiteRT runtime), a multiprocessing "main guard" error, and "No bird detected" on mic recordings that I fixed by adjusting the audio input and detection settings.

Why open matters here:

  1. It works offline. I tested it with Wi-Fi off and it still identified an Asian Koel at 0.9832 confidence. A cloud API can't work on a trail with no signal.
  2. Privacy. Recordings never leave my laptop.
  3. Zero running cost. No API keys, no usage limits.
  4. Swappable parts. I can change the language model (for example 3B to 8B) or the bird model without rewriting the app.

Test results:

# Test Bird App's answer Confidence Wi-Fi
1 File upload Asian Koel Asian Koel 0.9832 On
2 Mic record Asian Koel Asian Koel 0.9913 Off
3 File upload Asian Koel Asian Koel 0.9832 Off

These are recorded-clip tests, not yet a live outdoor walk. Laptop mics struggle with quiet or noisy audio, and the 3B model can invent bird facts, so I treat field notes as friendly hints. BirdNET's model files are licensed for non-commercial use.

Top comments (0)