Every sound is a signal.
It started as a personal challenge: train a model that recognises mammals by their sound. But why stop at detection? MammalRadar grew into a complete open-source ecosystem β from a cheap field device to a self-learning AI that understands why an animal is there.
| Solution | Cost | AI | Species | Open? |
|---|---|---|---|---|
| Rainforest Connection | High | β | Tropical | β Commercial |
| BirdNET-Go | Low | β | Birds only | β |
| AudioMoth | Low | β Record only | All | β |
| MammalRadar | ~β¬25 | β Self-learning | All wildlife π | β Open source |
Low-cost philosophy:
| Component | Cost |
|---|---|
| Field device (Pi Zero 2W + microphone) | ~β¬25 |
| SIM data (Simbase, pay-per-MB) | ~β¬0.50 / year |
| Software | Free (open source) |
MammalRadar is more than a detector. It is a layered ecosystem where cheap hardware, edge AI, cloud intelligence, and ecological knowledge reinforce each other.
- Directional microphone + pre-amp
- Edge device: ESP32, Pi Zero 2W, or Pi 4
- GSM module for data transfer
- Local buffering of audio snippets
- Timestamp + GPS or fixed location
- Optional: weather sensors
- API for receiving detections
- Storage of audio, metadata, and spectrograms
- Database for species, behaviour, and context
- Model inference engine
- Feedback engine
- Model version management
- Base model (13 Dutch mammal species)
- Augmentation pipeline
- Class balancing
- Periodic retraining
- Context-aware scoring
- Model evolution (specialised models for rain, night, forest, etc.)
- Species presence maps
- Seasonal activity curves
- Habitat matching
- Regional sensitivity tuning
- Detection validation
- Behaviour classification (alarm, territorial, foraging, mating)
- Contextual explanation in natural language
- Multi-species analysis
- Uncertainty estimation
Every detection flows through a smart, data-efficient pipeline:
Field device detects sound
β Generates spectrogram locally
β Runs CNN inference on-device
β confidence > 0.85 : sends spectrogram + audio via GSM (~80 KB)
β confidence 0.5β0.85: sends spectrogram only (~10 KB)
β confidence < 0.5 : discarded
Backend:
β NatureLM analyses behaviour
β GBIF validates ecological probability
β Result β dashboard + user notification
This keeps monthly data costs at roughly 9 MB for a typical deployment β well within any pay-per-MB SIM plan.
MammalRadar becomes smarter over time through four reinforcing loops:
- Data-driven β every new audio clip feeds back into retraining
- Context-driven β time of day, season, habitat, weather, and GBIF presence data all influence scoring
- Feedback loops β false positives are flagged; rare species get extra training weight
- Model evolution β specialised models are spawned for specific conditions (rain, night, dense forest)
β
1. Base detection + GSM
β
2. Backend + storage
π 3. First AI model (13 species) β in progress
β¬ 4. Augmentation + retraining
β¬ 5. Context engine
β¬ 6. NatureLM integration
β¬ 7. GBIF integration
β¬ 8. Feedback loops
β¬ 9. Model evolution
β¬ 10. Dashboard
β¬ 11. Automatic retraining
The live development environment running at home:
- ESP32-C6 microphone β MediaMTX RTSP relay
- mammal-watcher (Docker) β mammal detection
- BirdNET-Go in parallel β bird detection
- MQTT β Home Assistant
This setup proves the full pipeline end-to-end and drives the first training dataset.
- πΏ Nature reserve managers
- π¬ Researchers & universities
- ποΈ Rangers & field workers
- π¨βπΎ Farmers (predator detection)
- π§ Schools & education
- π Anyone, anywhere in the world
If you can solder a microphone and run a Docker container, you can deploy MammalRadar.
MammalRadar is built in spare time, driven by a passion for wildlife and open technology. If you find it useful, a coffee is always appreciated! β
MammalRadar is open and welcoming. Whether you improve the model, add a new species dataset, build a better field enclosure, or translate the dashboard β every contribution matters. Open an issue or pull request β all skill levels welcome.
No contribution is too small. The goal is to make wildlife monitoring accessible to everyone.
MIT β see LICENSE.
MammalRadar stands on the shoulders of two projects that made it possible:
-
BirdNET-Go by @tphakala β the project that started it all π¦ A complete, polished open-source bird detection system that proved real-time audio AI on consumer hardware is possible. MammalRadar is essentially "what if we did this for mammals?"
-
Sukecz/esp32-birdnet-mic by @Sukecz β built an ESP32 I2S microphone specifically to feed audio into BirdNET-Go π€ That same firmware is what MammalRadar uses as its field microphone today.
And the broader ecosystem it builds on:
- MediaMTX β RTSP relay that makes fan-out to multiple consumers possible
- NatureLM β behaviour interpretation and audio AI research
- GBIF β ecological presence data for plausibility validation
The sections below document the current home test architecture and are preserved for reference during active development.
| Component | Details |
|---|---|
| ποΈ Microphone | ESP32-C6 with IΒ²S mic β rtsp://192.168.2.20:8554/audio @ 54 kHz mono |
| π₯οΈ Server | HP T630 (n8nserver, 192.168.2.35) β Ubuntu 24.04, Docker 29.4.2 |
| π¦ Bird detector | BirdNET-Go on NUC (192.168.2.23) |
| π‘ MQTT broker | Home Assistant (homeassistant:1883) |
| π€ Automation | n8n 2.8.4 (native systemd on T630) |
ESP32-C6 (192.168.2.20:8554/audio)
β
βΌ RTSP/TCP pull
βββββββββββββββββββββββββββββββββββββββββββββββββ
β HP T630 (n8nserver, 192.168.2.35) β
β β
β ββββββββββββββββ push /mic β
β β rtsp-bridge ββββββββββββββββ β
β β (ffmpeg) β βΌ β
β ββββββββββββββββ ββββββββββββββββββββ β
β β MediaMTX β β
β β :8554/mic β β
β β (Docker) β β
β ββββββββββ¬ββββββββββ β
β RTSP fan-out β β
β βββββββββββββββββββββ€ β
β βΌ βΌ β
β ββββββββββββββββ ββββββββββββββββββββ β
β β mammal- β β BirdNET-Go β β
β β watcher β β (NUC :8554/mic) β β
β β (Docker) β ββββββββββββββββββββ β
β ββββββββ¬ββββββββ β
βββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β MQTT publish
βΌ
homeassistant:1883 β Home Assistant sensors
Why ffmpeg-bridge + source: publisher?
The ESP32 firmware accepts only one RTSP client at a time. MediaMTX's built-in RTSP client caused unexpected interleaved frame errors with the ESP32 firmware. Using ffmpeg as a pull/push bridge works around this limitation.
See INSTALL.md for the full step-by-step guide. In short:
# 1. Clone the repo
git clone https://github.com/natuurwaarnemer/mammal-watcher.git
cd mammal-watcher
# 2. Set ESP32 IP
cp .env.example .env
nano .env # set ESP32_RTSP_URL to your ESP32's address
# 3. Configure MQTT credentials
nano config.yaml
# 4. Start the stack
docker compose up -d
# 5. Re-point BirdNET-Go to the MediaMTX relay
# Change in BirdNET-Go config:
# rtsp.url: rtsp://<T630-host>:8554/mic
# (was: rtsp://192.168.2.20:8554/audio)python mammal_watcher.py --no-rtsp --dry-run --config config.yamlPrints one sample payload to stdout and exits with code 0. Useful for verifying the pipeline without real hardware.
# 1. Create .env (once)
cp .env.example .env
# 2. Make startup script executable
chmod +x startup.sh
# 3. Install systemd service
sudo cp systemd/mammal-watcher.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable mammal-watcher.service
sudo systemctl start mammal-watcher.service
# 4. Verify
sudo systemctl status mammal-watcher.service
docker compose psThe ESP32 firmware accepts only one RTSP client at a time. If BirdNET-Go is still connected directly to rtsp://192.168.2.20:8554/audio when rtsp-bridge tries to connect, the ESP32 drops one of them.
First-time startup β order matters:
- Disable the BirdNET-Go stream (or temporarily change the URL) before starting ffmpeg-bridge.
- Start the stack:
docker compose up -d - Verify rtsp-bridge is connected:
docker logs mammal-rtsp-bridge | tail -5 - Re-point BirdNET-Go to
rtsp://<T630-host>:8554/mic(the MediaMTX relay). Both consumers can now listen in parallel.
RTP packets are too big (1460 > 1440), remuxing them into smaller ones
This is harmless. The ESP32 sends 1460-byte RTP packets; MediaMTX automatically fragments them to β€ 1440 bytes without data loss. No action needed.
MammalRadar is een volledig open-source ecosysteem voor akoestische wildlife monitoring β van een goedkoop veldkastje (Β±β¬25) tot zelflerend AI-model. Het project begon als een persoonlijke uitdaging en groeide uit tot een compleet platform voor iedereen die natuur wil monitoren.
