WildfireGuard is a state-of-the-art early detection system that focus Computer Vision and Meteorological Data to predict wildfire risks in real-time. Whether it's analyzing a live camera feed or scanning satellite tiles from space, WildfireGuard acts as an AI-powered sentinel for our forests.
This isn't just a website; it's a decision support system powered by an ensemble of neural networks. We combine visual evidence with atmospheric conditions to reduce false positives and increase detection confidence.
We deploy Transfer Learning using the powerful ResNet50V2 architecture.
- Backbone: ResNet50V2 pre-trained on ImageNet (frozen layers to retain feature extraction capabilities).
- Custom Head: Dense top layers trained specifically on our Wildfire vs. No-Wildfire dataset.
- Input Pipeline: Images are resized to
224x224, normalized to[0,1], and augmented (rotation, zoom, flips) to ensure model robustness against different angles and lighting conditions. - Satellite Model: Trained on overhead orbital imagery to spot smoke plumes and thermal anomalies.
- Camera Model: Trained on ground-level footage to detect immediate flame outbreaks.
Fire doesn't happen in a vacuum. We analyze the environment using a dedicated Dense Neural Network.
- Data Source: Real-time fetch via Open-Meteo API.
- Features: Temperature, Humidity, Wind Speed, Rain, and calculated FWI (Fire Weather Indices: FFMC, DMC, DC, ISI, BUI).
- Preprocessing:
StandardScaler(std_scaler_weather.pkl) ensures inputs match the training distribution.
The system doesn't rely on a single source of truth. It calculates a Weighted Risk Score:
If the combined confidence crosses the threshold (>50%), the system triggers a Wildfire Alert.
- π°οΈ Orbital Scan: Interactive Leaflet maps allow users to drop pins anywhere on Earth. The backend grabs the satellite tile, crops it, and feeds it to the CNN.
- π· Vision Analysis: Upload local drone or CCTV footage for instant binary classification.
- βοΈ Live Weather Scoring: Automatically pulls weather data for the selected geolocation to validate visual predictions.
- π Subscription System: Users can subscribe to specific coordinates. (Alerts stored in SQLite
alerts.db). - π¨ Modern UI: Built with Tailwind CSS and Glassmorphism design principles for a sleek, dark-mode experience.
| Component | Technology | Description |
|---|---|---|
| ML Engine | TensorFlow / Keras | ResNet50V2 & Dense Networks |
| Backend | Flask (Python) | REST API & Model Serving |
| Frontend | Tailwind CSS + HTML5 | Responsive, modern styling |
| Mapping | Leaflet.js | Open-source interactive maps |
| Search | Nominatim API | Geocoding & Location search |
| Weather | Open-Meteo | Real-time meteorological data |
Ensure you have Python 3.9+ and pip installed. A GPU is recommended for training, but the pre-trained models run fine on CPU for inference.
# Clone the repo
git clone https://github.com/yourusername/Wildfire-Detection-System.git
cd Wildfire-Detection-System
# Create virtual environment
python -m venv venv
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtNote: The trained model files are too large for GitHub. You can download them from this Google Drive link: Click.
Place the downloaded models in the analysis/ directory. The system looks for:
wildfire_detection_model.keras(Camera)wildfire_satellite_detection_model.keras(Satellite)meteorological-detection-classification.keras(Weather)std_scaler_weather.pkl(Weather Scaler)
(Note: If models are missing, the system gracefully degrades to a default 50% probability to keep the UI functional for demos.)
python src/app.pyNavigate to http://127.0.0.1:5000 and start detecting.
The backend exposes simple REST endpoints for integration:
| Method | Endpoint | Payload | Response |
|---|---|---|---|
POST |
/satellite_predict |
{"location": [lng, lat], "zoom": 15} |
JSON with Satellite, Weather, and Average probabilities. |
POST |
/camera_predict |
FormData (image file) |
{"wildfire_prediction": 0/1, "confidence": %} |
POST |
/alert |
{"email": "...", "lat": ..., "lng": ...} |
Success message (stored in DB). |
- Map Tiles: We use OpenStreetMap (OSM) via Leaflet. It is free but rate-limited.
- Email Alerts: The scheduler code for sending emails is currently commented out for safety/demo purposes. Subscriptions are saved to
alerts.db. - Data Privacy: Uploaded images are processed in memory or temporarily saved for inference and immediately discarded.
Built with β€οΈ for a greener, safer planet.