DEV Community

Javier Tan
Javier Tan

Posted on

Forest Echo: The AI Bird Identifier That Knows When to Shut Up

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

What I Built

Forest Echo is a silence-first, voice-first companion for walks, hikes and trail runs. It stays quiet until you notice a sound. Then you hold one button (or press your headphone button) for a few seconds. It identifies the bird, speaks one short naturalist note through your headphones, and goes silent again.

Notice β†’ hold β†’ hear β†’ silence β†’ keep walking.

Most outdoor apps compete for your attention. Forest Echo is built to lose that competition on purpose. It's for the walk you were already taking. Its job is to give you a quiet reason to look up and listen, not to narrate the forest.

  • There is no continuous listening. The microphone is released after every hold, and a hold is capped at 5 seconds.
  • There are no spoken badges, no "keep going" lines, and no replay of the sound you just heard.
  • If nothing is identified with enough confidence, it says nothing instead of guessing.
  • After a note, the screen fades to black ("pocket mode") so you look up instead of down.

A few quiet extras, all shown on screen only and never spoken or pushed:

  • Near you this week: opt-in location shows which species BirdNET's geo model predicts around you, with a βœ“ on the ones you've heard.
  • Quiet invitations: when you open the app, one card shows the best listening window today (computed on the phone from sunrise), one bird to listen for this week, and seven dots for the days you were outdoors. There are no notifications and no streak-loss messages.
  • Walk stats: start and end a walk to see its length, your holds and identifications, and how long the screen was actually on. This uses the Page Visibility API, so it's a lower bound on total phone use.
  • Life list: every real species you've identified, with a quiet "New to your life list" the first time.

It's for anyone who already walks, hikes or runs and is curious about the birds they keep hearing. It identifies birds only, and it's tuned for the United States, where BirdNET's data is strongest.

Demo

The hosted Render instance runs a clearly labelled demo classifier and doesn't run Gemma, so you can try the interaction without it pretending to do real acoustic inference. The full pipeline (BirdNET β†’ Mastra β†’ Gemma 3n) runs locally.

Trying it yourself: play a clear recording of one bird, close to the phone, and hold for 4–5 seconds. If Use my location is on, only birds plausible where you are this week are accepted, so a bird from another continent will be ignored. Turn location off to identify any bird in BirdNET's list of about 6,000 species.

Code

GitHub logo electrum21 / hacktoberfest-forest-echo

Submission for the Hacktoberfest Open-Source AI Challenge: Week 1

Forest Echo 🌿

Forest Echo is a silence-first, voice-first outdoor nature companion for hikes, walks and trail runs.

The AI is not the destination. Nature is.

Forest Echo does not get you out of the house. It's for the walk you were already taking, and it keeps the screen out of it: one hold, one spoken line, then silence.

When something catches your attention, hold one button for a few seconds. Forest Echo identifies the acoustic observation, generates one short naturalist explanation, speaks it through your headphones, and then returns to silence.

Try it

  • Live demo: forest-echo.onrender.com. The hosted server runs in explicit demo mode (results are labelled demo), and the free plan can take up to a minute to wake on the first visit. On-device mode runs the real BirdNET model in your browser from this URL.
  • Demo video:
demo.mp4

To test identification, play a clear recording…

MIT licensed. BirdNET's models are CC BY-NC-SA 4.0 (non-commercial), so I credit the BirdNET team (Cornell Lab of Ornithology and Chemnitz University of Technology). The repo also includes a write-up of what I learned building it (docs/LESSONS_LEARNED.md).

How I Built It

hold (1–5 s) β†’ BirdNET β†’ curated fact β†’ Mastra workflow β†’ Gemma 3n β†’ verify β†’ ElevenLabs β†’ silence
Enter fullscreen mode Exit fullscreen mode
  1. BirdNET (open): identifies the likely species from the short sample. Low-frequency wind rumble is filtered out, results below a confidence threshold are dropped, and an optional location and week filter narrows results to plausible species.
  2. Curated facts: BirdNET only returns a label, and a small model is good at phrasing but bad at remembering. So the app attaches one short fact or "where to look" cue from a vetted file of 33 common US birds. Birds not in the file get no extra detail instead of an invented one.
  3. Mastra (open): a typed workflow turns the observation into quiet badge metadata and a Gemma draft, then runs a verification step.
  4. Gemma 3n (open-weight, via Ollama): words a 10–25 word field note around that one detail. It rephrases and does not supply facts.
  5. Verify: the note must be 35 words or fewer, name the species exactly once, and contain no questions, badge talk, phone instructions or filler. On failure, Gemma retries once with the specific problem. If it still fails, the note is built from supplied data only.
  6. Voice: ElevenLabs (Flash model, for low latency) when a key is configured, otherwise the phone's own on-device voice.
  7. Render: the FastAPI + PWA container deploys from render.yaml.

Fully offline options. With OFFLINE_MODE=true, the API turns the cloud voice off, blocks every outbound connection to a non-local address, and refuses to start if the models weren't cached. BirdNET, the geo model and Gemma then all run on your own computer.

On-device mode. BirdNET V2.4 and its geo model can also run inside the phone's browser (LiteRT.js, TensorFlow Lite compiled to WebAssembly). After a one-time ~75 MB download, a hold needs no server and no signal. Automated tests run the real models in WebAssembly against a Python reference. On a real recording, ten consecutive windows give the same species and the same confidence, within 0.001. I also tested it with a recording of an Asian koel, and it identified the bird correctly. Phone support depends on the browser's WebAssembly and audio decoding.

The project has tests for the API, the offline guard, the launcher, the Mastra validator, and the front-end logic.

Why Does Open Innovation Matter?

  • Privacy that's real, not promised. Because BirdNET, the geo model and Gemma are open, identification can run on my machine or on the phone itself. No audio has to leave the device unless I choose to turn on a cloud voice. The location feature needs coordinates, and with open models those stay local, rounded to about 1 km and not stored. A closed API would need them too.
  • Guardrails I could add myself. A small open model needed a verification step to keep it to one short, factual, silence-respecting sentence. Because I controlled the model, the prompt and the workflow, I could build that contract and retry loop instead of hoping a hosted model behaved.
  • Works where the signal doesn't. Trails often have no coverage. Open weights made the offline and on-device modes possible at all.

Where it isn't open: ElevenLabs is a closed cloud service. Without a key, Forest Echo falls back to the phone's on-device voice, which is less pleasant but works without a signal. The curated facts cover only 33 US birds, and I'd welcome corrections and additions.

Prize Categories

  • Best Use of Gemma: Gemma 3n writes the constrained field note locally via Ollama, around a vetted fact, with a verification step that rejects anything off-contract.
  • Best Use of Mastra: badge β†’ draft β†’ verify as a typed workflow, with retry and a safe fallback.
  • Best Use of ElevenLabs: the only AI speech in the interaction, short by design (Flash model for low latency), after which playback ends.
  • Best Use of Render: the FastAPI/PWA container deploys reproducibly from render.yaml in explicit demo mode.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.