This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
Most of us live in cities, and birds are already all around us. We just don't know who is calling.
Trail Birder listens to a bird recording, tells you which species is singing, and writes a short, friendly field-guide note about it. It then adds the bird to your personal life list, so every sighting counts. It is built for a terrace, a park, or a trail where there may be no phone signal. Everything runs on your own computer, with no cloud AI and no account.
The idea is to make the screen the shortest part of the experience: you stand outside and listen, and the app only answers the question "what bird is that?" It is for anyone who has ever stopped and wondered.
Demo
In my tests, an Asian Koel recording was identified at 95% confidence across 11 three-second windows, and a House Sparrow recording at 75% across 12 windows.
I want to be upfront: I tested with field recordings made by other people (credited below), not my own outdoor session. I tried to record birds around my home in the middle of a city but didn't capture a usable clip this week. An outdoor test is my first next step. The app is designed for that use, but I won't claim I have proven it there.
Code
🐦 Trail Birder
Identify birds by their sound, fully offline, with open-source AI.
Trail Birder listens to a bird recording, tells you which species is singing, and writes a short, friendly field-guide note about it. Everything runs on your own machine: no cloud AI API, no account, and no signal needed once the models are downloaded.
Built for the Hacktoberfest Open-Source AI Challenge, Week 1: Touch Grass.
Table of contents
- Why I built it
- Features
- How it works
- Open-source AI used
- How it avoids hallucination
- Getting started
- Example output
- Test results
- Configuration
- Web API
- Privacy
- Project structure
- Adding facts for a bird
- Troubleshooting
- Limitations
- Roadmap
- Credits
- License
Why I built it
Most people live in cities, but birds are already around us. We just don't know who is calling. Trail Birder is meant to be used standing on a terrace, in a park, or on a trail, where a…
The README covers setup, the web API, troubleshooting, and limitations.
How I Built It
Two open-source models and a little glue code:
- BirdNET v3.0 (ONNX) listens to the audio. It splits the clip into 3-second windows and scores every species it recognises in each one. I drop anything below 50% confidence and pick the species detected in the most windows.
- Gemma 3 4B through Ollama turns facts into a warm three-sentence note.
- Flask serves a simple page with audio playback, a confidence bar, and the life list. There is also a command-line mode.
The problem that shaped the project
My first version asked Gemma, "Tell me about the Asian Koel." The answer sounded great and was partly wrong. It said koels mimic other birds and make "kleet kleet" calls. Neither is true. Koels are really known for laying their eggs in crows' nests.
A small model is fluent, but it is not a reliable source of facts, and in a field guide a confident wrong answer is worse than none. So I redesigned it so the model never has to remember anything:
-
Hand-written facts come first. A small
facts.jsonholds short facts for birds I expect to hear. - Wikipedia is the fallback. For any other species, the app fetches the summary once and caches it, so it works offline afterwards. Those notes are labelled auto-fetched, not hand-verified, with a source link.
- Gemma only rewrites. The prompt says to use only the supplied text and add nothing else.
- Notes are cached with a fingerprint of their facts. Repeat birds load instantly, and when I edit a fact, the note refreshes itself.
After this change, the koel note correctly mentioned the red eyes, the rising "ku-oo" call, and the crow-nest habit.
Things that went wrong along the way
- On Windows, BirdNET starts worker processes that re-import your script. Without an
if __name__ == "__main__":guard, it crashed with a long, repeating traceback. - A clip with no clear bird produced an empty file and crashed the server. It now says "No bird heard clearly."
- The 540 MB model download dropped several times on my connection before it finished.
Limitations
- Traffic, wind, and several birds at once reduce accuracy.
- It reports one bird per clip.
- Only a few species have hand-written facts, and Wikipedia can be wrong too.
- It has not been field-tested yet.
Credits
Test recordings are from xeno-canto and are not included in the repository:
- Asian Koel, XC743612, Sathyan Meppayur
- Common Myna, XC157876, Rajgopal Patil
- Indian Robin, XC507730, Jean Roché
Why Does Open Innovation Matter?
It works where closed APIs can't. A bird app that needs the internet fails exactly where people use it: on a trail or in a park with no signal. Because both models are open and run locally, Trail Birder keeps working with no connection, costs nothing per request, and never sends a recording anywhere.
I could inspect and fix it. When Gemma invented facts, I could see why and change how it was used. I decided exactly what it was allowed to say, rewrote the prompt, and added caching, all on my own machine. With a hosted black box, I could only have hoped the next answer was better.
Open work builds on open work. A research team trained BirdNET on thousands of species and shared it. I built something useful on top of it in a few days, and anyone can now improve my facts file or swap in a bigger model.
One honest note: the BirdNET model weights use a non-commercial license, so this project is for learning and personal use. Open does not always mean unrestricted.
Prize Categories
- Best Use of Gemma: Gemma 3 4B runs locally through Ollama and writes every field note in the app.
Top comments (0)