AI-powered fire weather monitoring and spread simulation system for the Western Ghats forest reserves.
The Wildfire Intelligence Platform is a full-stack geospatial intelligence system that combines real-time weather ingestion, machine learning fire-risk prediction, satellite fire detection (NASA FIRMS), and a physics-based cellular automata fire spread simulator β all presented in a glassmorphic, interactive dashboard.
It was built specifically to monitor fire-prone forest reserves across the Western Ghats of India, providing actionable risk intelligence to ecologists, forest rangers, and fire management teams.
| Feature | Description |
|---|---|
| π‘οΈ Real-time Weather Ingestion | Pulls temperature, humidity, wind, and rainfall from Open-Meteo at 15-minute intervals |
| π°οΈ NASA FIRMS Integration | Ingests active fire detections (VIIRS/MODIS) from NASA's Fire Information for Resource Management System |
| πΏ NDVI Monitoring | Vegetation greenness index tracking via satellite-derived fuel moisture proxy |
| π€ ML Fire Risk Prediction | XGBoost model with SHAP explainability providing per-station fire risk probability |
| π§ͺ Anomaly Detection | Isolation Forest detects abnormal meteorological conditions preceding fire events |
| π§ Fuel Moisture Estimation | Random Forest model estimating live fuel moisture content from weather variables |
| πΊοΈ Fire Spread Simulator | Physics-based Cellular Automata (CA) simulation with wind vector, slope, and dryness acceleration |
| π Interactive Analytics | SHAP waterfall charts, gauge indicators, trend analytics, and telemetry panels |
| π₯οΈ Glassmorphic Dashboard | Modern, responsive UI with real-time data across Overview, Map, Analytics, Trends, Simulation, and Operations views |
wildfire-intelligence/
βββ backend/ # FastAPI Python backend
β βββ app/
β β βββ routers/ # REST API route handlers
β β β βββ health.py # System health & DB connectivity
β β β βββ stations.py # Station metadata & FFWI readings
β β β βββ readings.py # Time-series weather data
β β β βββ predictions.py# ML fire risk predictions
β β β βββ detections.py # NASA FIRMS fire detections
β β β βββ simulation.py # Fire spread simulation engine
β β β βββ models.py # Model cards & performance metrics
β β βββ engines/
β β β βββ ffwi.py # Fosberg Fire Weather Index engine
β β β βββ fire_season.py# Fire season calendar logic
β β β βββ risk_bands.py # Risk band classification (LowβCritical)
β β βββ ingestion/
β β β βββ open_meteo.py # Open-Meteo weather data ingestion
β β β βββ ndvi.py # NDVI satellite data ingestion
β β β βββ fsi.py # Fire Season Index computation
β β β βββ scheduler.py # APScheduler background task runner
β β βββ main.py # FastAPI app entry point
β β βββ config.py # Pydantic settings management
β β βββ database.py # SQLAlchemy async session factory
β βββ ml/
β βββ train_xgboost.py # Fire risk XGBoost trainer
β βββ train_isolation_forest.py # Anomaly detection trainer
β βββ train_fuel_moisture.py # Fuel moisture Random Forest trainer
β βββ feature_engineering.py # Shared feature pipeline
β βββ shap_explainer.py # SHAP value computation
β
βββ frontend/ # React + TypeScript + Vite frontend
βββ src/
βββ views/
β βββ Overview.tsx # Station grid with FFWI risk cards
β βββ MapView.tsx # MapLibre GL interactive fire map
β βββ Analytics.tsx # SHAP, anomaly & fuel moisture panels
β βββ Trends.tsx # Historical weather trend charts
β βββ Simulation.tsx # Interactive fire spread simulator
β βββ Operations.tsx # Data pipeline & model ops status
βββ styles/
β βββ tokens.css # Design system CSS custom properties
β βββ glassmorphism.css
βββ hooks/ # Custom React data hooks
βββ utils/ # Shared utilities
Predicts the probability of fire ignition at each station over the next 24 hours using weather and terrain features. SHAP values provide per-prediction explanations visible directly in the Analytics view.
Key Features: Temperature, Relative Humidity, Wind Speed, FFWI score, NDVI, Rainfall (7-day), Fire Season flag.
Detects statistically anomalous weather patterns (e.g., sudden temperature spike + humidity drop) that historically precede fire events, even when individual values appear within normal range.
Estimates live fuel moisture content (%) from meteorological inputs. Dry fuel (<15% moisture) accelerates fire spread dramatically in the simulation engine.
The simulation engine implements a physics-based Cellular Automata model on a high-resolution geospatial grid over the selected reserve:
- Wind Vector Acceleration: Spread rate multiplied in downwind directions using the wind azimuth
- Terrain Slope: Uphill spread is geometrically accelerated (tilted flame pre-heating)
- Fuel Moisture: Drier cells (from ML model output) have shorter transit times between grid nodes
- Fosberg Fire Weather Index (FFWI): Real-time scalar that gates overall spread intensity
- Interactive Controls: Click ignition origin, adjust wind speed/direction, playback timeline scrubber, and real-time elapsed timer
- Python 3.11+
- Node.js 18+ and npm
- PostgreSQL 15+ (with PostGIS recommended)
- NASA FIRMS API key β Register here
git clone https://github.com/Nekilesh001/forest-fire-ai.git
cd forest-fire-ai# Create and activate virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r backend/requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env with your database credentials and NASA FIRMS key| Variable | Description | Default |
|---|---|---|
POSTGRES_HOST |
PostgreSQL host | localhost |
POSTGRES_PORT |
PostgreSQL port | 5432 |
POSTGRES_DB |
Database name | wildfire |
POSTGRES_USER |
DB username | postgres |
POSTGRES_PASSWORD |
DB password | (required) |
NASA_FIRMS_KEY |
NASA FIRMS API key | (required) |
ALLOWED_ORIGINS |
CORS origins | http://localhost:5173 |
LOG_LEVEL |
Logging verbosity | INFO |
# From project root
uvicorn backend.app.main:app --reload --host 0.0.0.0 --port 8000API docs available at: http://localhost:8000/docs
Run training scripts before launching the backend for the first time (or whenever you want to retrain on updated data):
cd backend
python -m ml.train_xgboost
python -m ml.train_isolation_forest
python -m ml.train_fuel_moisturecd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend runs at: http://localhost:5173
cd frontend
npm run build
# Output in frontend/dist/| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
System health and DB connectivity check |
GET |
/api/stations |
All monitoring stations with latest readings |
GET |
/api/stations/{id}/readings |
Time-series weather data for a station |
GET |
/api/predictions/{station_id} |
ML fire risk predictions |
GET |
/api/detections |
NASA FIRMS active fire detections |
POST |
/api/simulation/run |
Run a fire spread simulation |
GET |
/api/models |
Model cards and performance metrics |
Full interactive API documentation: /docs (Swagger UI) or /redoc
| View | Description |
|---|---|
| Overview | Station grid cards with FFWI score, risk band, and 4-metric weather summary |
| Map | Real-time interactive MapLibre GL map with fire detections and spread simulation overlay |
| Analytics | SHAP waterfall explanations, Isolation Forest anomaly indicator, fuel moisture gauge |
| Trends | Historical time-series charts with extreme value panels |
| Simulation | Interactive fire spread simulator with wind/terrain physics controls |
| Operations | Data pipeline health, ingestion schedules, model performance metrics |
- FastAPI β Async REST API framework
- SQLAlchemy (Async) β ORM and database session management
- PostgreSQL β Primary time-series and geospatial data store
- APScheduler β Background scheduler for weather ingestion
- XGBoost β Gradient boosting fire risk classifier
- scikit-learn β Isolation Forest and Random Forest models
- SHAP β Model explainability and feature attribution
- Loguru β Structured application logging
- React 19 + TypeScript β UI framework
- Vite β Build tool and development server
- MapLibre GL JS β Open-source WebGL interactive mapping
- Deck.gl β GPU-accelerated geospatial visualization layers
- D3.js β Custom data-driven charts and gauges
- React Router v7 β Client-side navigation
- Tailwind CSS β Utility-first styling with custom design tokens
| Source | Data Type | Update Frequency |
|---|---|---|
| Open-Meteo | Temperature, Humidity, Wind, Rainfall | Every 15 minutes |
| NASA FIRMS | VIIRS/MODIS active fire detections | Daily |
| Copernicus/Sentinel | NDVI vegetation index | Weekly/On-demand |
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit changes:
git commit -m "Add my feature" - Push to branch:
git push origin feature/my-feature - Open a Pull Request
Please ensure backend changes include unit tests in backend/tests/ and frontend changes follow the existing component patterns.
This project is licensed under the MIT License β see the LICENSE file for details.
- NASA FIRMS for open access fire detection data
- Open-Meteo for free, open weather API
- MapLibre GL for the open-source mapping engine
- The Western Ghats forest ecology community for domain expertise
Built with β€οΈ for forest fire intelligence and conservation.