This document outlines the technical architecture of the Bird Identification System, a multi-stage machine learning pipeline and modern web application for avian acoustic analysis.
The system is designed as a decoupled architecture consisting of a React-based Frontend and a FastAPI-powered Backend.
- Input: Audio is captured via the browser microphone or uploaded as a file.
- Preprocessing: The backend uses
ffmpegandlibrosato normalize the audio (44.1kHz, mono, noise gating). - Analysis Stage 1 (BirdNet): A pre-trained BirdNet-Analyzer identifies likely species candidates.
- Analysis Stage 2 (Custom CNN): A custom PyTorch Convolutional Neural Network extracts deep audio features (Mel Spectrogram, MFCC, Chroma) and provides complementary species insights.
- Knowledge Enrichment (Groq LLM): The system queries the
llama-3.3-70b-versatilemodel via Groq API to generate structured habitat, diet, and geographic data. - Output: Results are visualized in a responsive "Nature-Tech" UI with interactive OpenStreetMap integration.
Located in /backend and /model.
backend/main.py: The API gateway. Handles file uploads, asynchronous processing, and defines the REST endpoints (/analyze,/features).model/classifier.py: The orchestration engine. Coordinates the BirdNet analyzer, custom model inference, and LLM calls.model/feature_extractor.py: A dedicated signal processing module that converts raw waveforms into multi-channel tensors (Mel + MFCC + Contrast).model/neural_network.py: PyTorch implementation of theBirdAudioCNNarchitecture.
- BirdNet-Analyzer: Used for broad species detection across thousands of classes.
- Groq API: Used for generating structured JSON descriptions.
- PyTorch: Powers the custom CNN classification pipeline.
Located in /frontend.
- Nature-Tech Design System: Built with modern CSS (glassmorphism, vibrant forest gradients) and Framer Motion for animations.
SpotlightCard.jsx: Dynamically highlights top-confidence matches with celebratory effects.AudioVisualizer.jsx: Real-time Web Audio API visualization for live recording feedback.App.jsx: Local state management using React hooks (useState,useRef,useEffect) andreact-leafletfor geographic visualization.
- React-Leaflet: OpenStreetMap integration for species distribution mapping.
- Lucide-React: Harmonious icon system for nature-tech visual language.
- Axios: Promised-based HTTP client for API communication.
- Canvas-Confetti: UI micro-interactions for high-confidence detections.
The system utilizes an enhanced OpenStreetMap integration that goes beyond simple ranges:
- Primary Habitiat: Markings for the geographic center of the bird's distribution.
- Conservation Hotspots: AI-identified "Major Places" (National Parks/Reserves) plotted on the map with custom popups describing their significance.
.
├── backend/ # FastAPI Application
├── frontend/ # React Native/Web Application
│ ├── src/
│ │ ├── components/ # UI Components (Spotlight, Visualizer)
│ │ └── App.jsx # Main Logic
├── model/ # AI Model Logic
│ ├── classifier.py # Core Orchestrator
│ ├── neural_network.py # PyTorch CNN
│ └── feature_extractor.py# Signal Processing
└── architecture.md # This Document