https://github.com/zephyrusblaze/wildfire-detection
A Wildfire Detection System that integrates machine learning models with satellite imagery, camera feeds, and weather data to predict and detect wildfires effectively.
https://github.com/zephyrusblaze/wildfire-detection
classification cnn-keras deep-learning flask html-css-javascript keras resnet-50 satellite-imagery tailwindcss tensorflow transfer-learning weather-data wildfire-detection
Last synced: about 2 months ago
JSON representation
A Wildfire Detection System that integrates machine learning models with satellite imagery, camera feeds, and weather data to predict and detect wildfires effectively.
- Host: GitHub
- URL: https://github.com/zephyrusblaze/wildfire-detection
- Owner: ZephyrusBlaze
- License: apache-2.0
- Created: 2024-06-13T09:06:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-27T15:32:33.000Z (7 months ago)
- Last Synced: 2024-10-27T18:06:04.787Z (7 months ago)
- Topics: classification, cnn-keras, deep-learning, flask, html-css-javascript, keras, resnet-50, satellite-imagery, tailwindcss, tensorflow, transfer-learning, weather-data, wildfire-detection
- Language: Jupyter Notebook
- Homepage:
- Size: 11.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Wildfire Detection System π₯
[](https://www.python.org/downloads/release/python-31013/)
[](https://flask.palletsprojects.com/en/3.0.x/)
[](https://www.tensorflow.org/)
[](LICENSE)
[](https://github.com/username/repo)
## Table of Contents π
1. [Background on Wildfires π](#background-on-wildfires-)
2. [Project Overview π](#project-overview-)
3. [Features π](#features-)
4. [Screenshot πΈ](#screenshot-)
5. [Installation π οΈ](#installation-%EF%B8%8F)
6. [Usage π»](#usage-)
7. [File Structure π](#file-structure-)
8. [Requirements π¦](#requirements-)
9. [Improvements β¨](#improvements-)
10. [Contributing π€](#contributing-)
11. [License π](#license-)---
## Background on Wildfires π
Wildfires pose a significant environmental and economic threat worldwide. Their frequency and intensity have been escalating due to various factors, particularly climate change.
### Key Facts:
- **Global Impact**: Wildfires have caused devastating damage across various regions, from the Amazon Rainforest to Australia. In 2020, wildfires in California alone burned over 4.2 million acresγ[Cal Fire](https://www.fire.ca.gov/incidents/2020/)γ.
- **Frequency**: Over 100,000 wildfires occur annually in the U.S. aloneγ[National Geographic](https://www.nationalgeographic.com/environment/article/wildfires)γ.
- **Economic Impact**: Wildfires cause an estimated $5 billion in damage annually in the U.S.γ[Insurance Information Institute](https://www.iii.org/fact-statistic/facts-statistics-wildfires)γ.
- **Climate Change**: Rising global temperatures and drier conditions are significantly increasing the risk and severity of wildfiresγ[NASA](https://climate.nasa.gov/news/2878/the-link-between-climate-change-and-wildfires/)γ.These alarming statistics underscore the urgent need for efficient wildfire detection and monitoring systems. Our **Wildfire Detection System** aims to address this need by leveraging cutting-edge technology to provide early detection and alerts, potentially saving lives and reducing damage.
## Project Overview π
This project presents an innovative solution combining satellite imagery, camera feeds, and weather data to predict the risk of wildfires. Using advanced deep learning techniques, our system performs accurate predictions and provides timely alerts through a user-friendly Flask application.
Our models include:
- **Satellite Classification CNN**: Using ResNet50v2, this model detects wildfire probabilities from satellite images with an accuracy of 97%.
- **Image Classification CNN**: Also based on ResNet50v2, this model identifies fires in uploaded images with an accuracy of 98%.
- **Weather Data Model**: This model predicts wildfire risks from meteorological data with an accuracy of 100%, albeit on a limited dataset.## Features π
- **Satellite Detection**: Detect wildfires using high-resolution satellite imagery.
- **Camera Detection**: Identify wildfire outbreaks through analysis of images from cameras or drones.
- **Weather Prediction**: Predict wildfire risks based on current and forecasted weather conditions.
- **Alert System**: Receive hourly email alerts about wildfire risks in specified locations.## Screenshot πΈ
Here's a glimpse of the Wildfire Detection System interface:

## Installation π οΈ
Follow these steps to set up the project locally:
1. **Clone the repository**:
```bash
git clone https://github.com/ZephyrusBlaze/Wildfire-Detection
cd Wildfire-Detection
```2. **Create a virtual environment**:
```bash
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```3. **Install dependencies**:
```bash
pip install -r requirements.txt
```Make sure to run the Jupyter notebooks for model training and saving on Kaggle:
- Open `wildfire-camera-detection.ipynb` and `wildfire-satellite-detection.ipynb` in Kaggle Notebooks to train and save the respective models.4. **Set up environment variables**:
Create a `.env` file and add your Mapbox token and other necessary configurations:
```bash
MAPBOX_TOKEN=your_mapbox_token
MAILERSEND_KEY=your_mailersend_key
```5. **Initialize the database**:
```bash
python -c 'from src.app import init_db; init_db()'
```6. **Run the application**:
```bash
python src/app.py
```## Usage π»
Once the application is running, navigate to the homepage to explore the features:
- **Home**: Overview and introduction to the system.
- **Camera Detection**: Upload images for wildfire detection.
- **Satellite Detection**: Analyze satellite data for wildfire hotspots.
- **Alert Service**: Subscribe for wildfire alerts for specific geographic areas.## File Structure π
```bash
.
βββ LICENSE # Project license
βββ README.md # You're here!
βββ alerts.db # Database file for alerts
βββ requirements.txt # List of dependencies
βββ analysis # Analysis and model files
β βββ meteorological-detection-classification.ipynb # Notebook for weather-based detection
β βββ wildfire-camera-detection.ipynb # Notebook for camera image detection
β βββ wildfire-satellite-detection.ipynb # Notebook for satellite image detection
β βββ meteorological-detection-classification.keras # Saved weather detection model
β βββ std_scaler_weather.pkl # Scaler for weather data
β βββ wildfire_camera_detection_model.keras # Saved camera detection model
β βββ wildfire_satellite_detection_model.keras # Saved satellite detection model
βββ src # Source code directory
β βββ app.py # Main application file
β βββ camera_functions.py # Functions for camera image processing
β βββ email_alert.py # Functions for sending email alerts
β βββ meteorological_functions.py # Functions for weather data processing
β βββ satellite_functions.py # Functions for satellite image processing
β βββ static # Static files (JS, images)
β β βββ js # JavaScript files
β β β βββ alert_map.js # JS for alert map
β β β βββ camera.js # JS for camera detection page
β β β βββ map.js # JS for satellite detection map
β β βββ images # Image files
β β β βββ Screenshot.png # Screenshot of the application
β βββ templates # HTML templates
β βββ alert.html # Template for alert page
β βββ base.html # Base template
β βββ detect_camera.html # Template for camera detection page
β βββ detect_satellite.html # Template for satellite detection page
β βββ home.html # Template for homepage
```## Requirements π¦
- **Python 3.10.13**
- **Flask 3.0.3**
- **TensorFlow 2.16.1**
- **Pandas 2.2.2**
- **Scikit-Learn 1.5.0**
- **Mailersend 0.5.6**
- **OpenMeteo SDK 1.11.7**For the full list of dependencies, see the [requirements.txt](requirements.txt) file.
## Improvements β¨
Future enhancements could further improve the effectiveness of the Wildfire Detection System:
- **Diverse Datasets**: Integrating datasets from various regions would improve the systemβs global applicability.
- **Data Quantity and Quality**: Expanding the amount and quality of training data can enhance model accuracy.
- **Advanced Algorithms**: Implementing more sophisticated machine learning algorithms could improve detection precision.
- **Real-Time Processing**: Enhancing the system to process data in real-time would provide faster alerts and responses.
- **User Interface**: Improving the UI/UX for easier navigation and interaction.## Contributing π€
We welcome contributions from the community! Please read our [Contributing Guidelines](CONTRIBUTING.md) to get started. Hereβs how you can contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit them (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a Pull Request (PR) using our [PR Template](.github/PULL_REQUEST_TEMPLATE.md).For reporting bugs or suggesting features, please use our [Issue Templates](.github/ISSUE_TEMPLATE/bug_report.md).
## License π
This project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for more information.