A web-based application built using Flask that predicts the Fire Weather Index (FWI) using a machine learning model. The app accepts weather and environmental parameters as inputs and returns a prediction of the FWI, which helps in assessing wildfire risks.
- Overview
- Features
- Technologies Used
- Installation
- Usage
- Input Parameters
- Output
- File Structure
- Screenshots
- Future Enhancements
- Contributing
- License
Wildfires are a significant hazard affecting ecosystems and human communities. The Fire Weather Index (FWI) is a key component used to assess the potential risk of wildfires based on various environmental and weather conditions. This project leverages machine learning to predict the FWI given a set of weather-related inputs.
The application is simple and intuitive, allowing users to input parameters like temperature, humidity, wind speed, and other related factors to generate predictions.
- User-friendly interface for inputting weather data.
- Real-time predictions powered by a Ridge Regression machine learning model.
- Data pre-processing using a StandardScaler to normalize inputs.
- Flask-based backend with dynamic HTML templates.
- Easily deployable on any server or cloud platform.
- Programming Language: Python
- Web Framework: Flask
- Machine Learning Model: Ridge Regression (using scikit-learn)
- Frontend: HTML
- Libraries:
numpy
pandas
scikit-learn
pickle
- Deployment Ready: Compatible with services like Heroku or AWS.
Follow these steps to set up and run the application locally:
-
Clone the repository:
git clone https://github.com/your-username/fwi-prediction.git cd fwi-prediction
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure that the models directory contains:
ridge.pkl
(trained Ridge Regression model)scaler.pkl
(fitted StandardScaler object)
-
Run the Flask application:
python application.py
-
Open the application in your browser:
http://127.0.0.1:5000
- Navigate to the application in your browser.
- Enter the required weather parameters in the form fields:
- Temperature
- Relative Humidity (RH)
- Wind Speed (Ws)
- Rain
- Fine Fuel Moisture Code (FFMC)
- Duff Moisture Code (DMC)
- Initial Spread Index (ISI)
- Classes
- Region
- Click the Predict button.
- View the Fire Weather Index (FWI) prediction displayed below the form.
Parameter | Description | Example Value |
---|---|---|
Temperature |
Air temperature in degrees Celsius | 22.5 |
RH |
Relative humidity in percentage | 45 |
Ws |
Wind speed in km/h | 12.3 |
Rain |
Rainfall in mm | 0.0 |
FFMC |
Fine Fuel Moisture Code | 85.2 |
DMC |
Duff Moisture Code | 45.7 |
ISI |
Initial Spread Index | 4.2 |
Classes |
Fire classes | 1 |
Region |
Region code | 2 |
The application predicts the Fire Weather Index (FWI) as a single numerical value. This index indicates the potential for wildfire occurrence and severity.
fwi-prediction/
│
├── models/
│ ├── ridge.pkl # Trained Ridge Regression model
│ ├── scaler.pkl # Fitted StandardScaler object
│
├── templates/
│ ├── index.html # Welcome Page
| ├── home.html # Main HTML template for the form
│
├── application.py # Flask application
├── README.md # Project documentation
- Add data visualization to display trends in historical FWI data.
- Improve the UI with better styling and animations.
- Support multiple machine learning models for comparison.
- Deploy the application to a public cloud platform (e.g., Heroku, AWS).
- Add error handling and validation for user inputs.
Contributions are welcome! If you have ideas or suggestions for improving the application:
- Fork this repository.
- Create a new branch for your feature:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature"
- Push your changes to your forked repository:
git push origin feature-name
- Submit a pull request!