Project Report
Project Report
On
“FWI PREDICTION USING MACHINE LEARNING”
Bachelor of Technology
in
Computer Engineering
Submitted by:
Khushi
8722131
Submitted To:
(2022-2026)
Declaration
I hereby declare that the Project report entitled "FWI Prediction Using Machine Learning"
submitted to the Department of Computer Engineering, SIET, Nilokheri in partial fulfilment of the
requirements for the award of the degree of Bachelor of Technology (Computer Engineering) is a
record of original work done by me, under the guidance and supervision of Mrs. Monika and it
has not formed the basis for the award of any Degree or other similar title to any candidate of any
University.
Place: Khushi
8722131
ii
Certificate
iii
Acknowledgement
I would like to express my deepest gratitude to everyone who supported and guided me throughout this
Fire Weather Index (FWI) Prediction project. First and foremost, I extend my sincere thanks to my
mentors and faculty advisors Mrs. Monika whose insights and expertise have been invaluable in shaping
this project. Their guidance in data science and predictive modelling provided the foundation for
tackling the complexities of wildfire risk prediction. I would also like to acknowledge the creators and
researchers behind the Canadian Fire Weather Index system and the Algerian Forest dataset, as their
pioneering work and data resources were essential to the development and validation of this project.
Special thanks to my family for their continuous encouragement and support, which motivated me
throughout the project. Finally, I am grateful for the open-source community and the tools that made
this work possible, including Python, Scikit-Learn, and Flask, as well as the online resources that
fostered my learning in machine learning and data analysis. Thank you to all who contributed directly
or indirectly to the success of this project.
Khushi
iv
Abstract
Algeria is one of the Maghreb countries most affected by wildfires. The economic, environmental, and
societal consequences of these fires can last several years after the wildfire. Often, it is possible to avoid
such disasters if the detection of the outbreak of fire is fast enough, reliable, and early. The lack of
datasets has limited the methods used to predict wildfires in Algeria to the mapping risk areas, which is
updated annually. This study is the result of the availability of a recent dataset relating the history of
forest fires in the cities of Bejaia and Sidi Bel-Abbes during the year 2012.
The aim of this project is to develop a system which can perform early prediction of FWI for a patient
with a higher accuracy by combining the results of different machine learning techniques.
This project aims to predict FWI via different supervised machine learning methods including: Linear
Regression, Lasso Regression, Ridge Regression and Elastic Net Regression. This project also aims to
propose an effective technique for earlier detection of the diabetes disease using Machine learning
algorithms and end to end deployment using flask.
v
Company Profile
Physics Wallah is an Indian ed-tech platform founded by Alakh Pandey, offering high-quality,
affordable online education for students, particularly in subjects like Physics, Chemistry, and
Mathematics. Physics Wallah has expanded its educational offerings to include coding and computer
science courses, providing affordable and quality learning resources for students. The platform now
offers courses on programming languages like Python, Java, and C++, as well as data structures,
algorithms, and competitive coding. With its clear and engaging teaching style, Physics Wallah aims
to make coding accessible to students, especially those preparing for competitive exams like JEE and
those looking to improve their problem-solving skills. The platform’s coding courses are designed
to provide hands-on experience, helping students gain practical skills in software development and
coding challenges.
vi
List of Figures
Fig.4.4 Heatmap 16
vii
Table of Content
Title Page no.
Declaration ii
Certificate iii
Acknowledgment iv
Abstract v
Company profile vi
List of figures vii
Chapter 1: Introduction 1-2
1.1 Problem Statement 1
1.2 Project Objective 1
1.3 Project Scope 2
1.4 Goals 2
Chapter 2: Literature Survey 3-10
2.1 Python 3
2.2 Machine Learning 5
2.3 Frontend 6
2.4 Backend 6
2.5 Frameworks 7
2.6 Flask 8
Chapter 3: Project in Detail 11-14
3.1 Introduction 11
3.2 What is FWI? 11
3.3 Purpose 12
3.4 Code Structure 12
3.5 Why is it popular? 12
Chapter 4: Results and Outputs 15-20
4.1 Main Output 15
4.2 Dataset 15
4.3 FE and EDA 16
4.4 Correlation 16
4.5 Training and Testing Dataset 17
4.6 Box Plots 17
4.7 Modelling 18
Chapter 5: Conclusion & Future Scope 21
5.1 Conclusion 21
5.2 Future Scope 21
References 22
CHAPTER-1
INTRODUCTION
1.1 Problem Statement
Forest fires are a significant environmental and economic issue in Algeria, impacting biodiversity,
climate, and human health. Predicting the Fire Weather Index (FWI) in this region is crucial for
understanding fire behaviour and making timely management decisions. The Algerian Forest dataset
contains meteorological information and associated FWI values, representing real-world
environmental conditions in Algeria’s forests.
The objective of this project is to develop a predictive model for the Fire Weather Index (FWI)
specifically tailored to Algerian forest conditions. The FWI is a critical metric used to gauge fire risk
based on weather factors like temperature, humidity, wind speed, and rainfall. By accurately forecasting
FWI, the project aims to equip forest management agencies in Algeria with an essential tool for assessing
fire risk levels and making proactive decisions to prevent and manage forest fires.
Through this project, we will analyse historical weather data from Algerian forests and identify
patterns linked to fire risks. The goal is to train a model that reliably predicts FWI values, helping
officials anticipate periods of high fire risk and implement preventive measures in advance. Accurate
FWI predictions are vital for optimizing resource allocation, minimizing environmental damage, and
protecting human lives and property.
Overall, this project seeks to enhance Algeria's fire management capabilities by providing a data-
driven solution that improves preparedness and response strategies. The long-term impact is to
contribute toward a safer, more resilient environment through better forest fire prediction and risk
management practices.
1.4 Goals
• To create a reliable machine learning model that accurately predicts FWI values based on
meteorological data from Algerian forests, minimizing prediction error.
• To establish a system that alerts forestry agencies of high fire risk in real-time, based on the
predicted FWI values.
2
CHAPTER-2
LITERATURE SURVEY
In a literature survey, identifying previous researchers or projects that have contributed to similar work
on Fire Weather Index (FWI) prediction is valuable. Researchers from environmental sciences, forestry,
and data science have worked on wildfire prediction, each contributing different methods and insights.
1. Canadian Forest Service: They developed the original Canadian Fire Weather Index (FWI)
system, which many countries use for wildfire risk prediction. Their work serves as the
foundation for wildfire indices globally.
2. U.S. Forest Service & NASA Collaborations: These organizations have conducted significant
research integrating satellite imagery and meteorological data for wildfire prediction. NASA's
work with machine learning models for environmental applications has been particularly
impactful.
3. Academic Researchers: Numerous academic researchers have explored machine learning
applications for FWI, such as using neural networks, random forests, or support vector machines
to improve prediction accuracy. Researchers in this field often publish in journals like Remote
Sensing of Environment and International Journal of Wildland Fire.
4. Recent Data Science Projects: Platforms like Kaggle have also hosted competitions and datasets
for wildfire prediction, contributing community-driven insights, especially with modern
machine learning frameworks like XGBoost, LSTM, and other deep learning models.
2.1 Python: -
Python features a dynamic type system and automatic memory management. It supports multi
paradigms, object-oriented, imperative, functional and procedural, easy to learn and has a large and
comprehensive standard library.
Python interpreters are available for many operating systems. Python, the reference implementation
of Python, is open-source software and has a community-based development model, as do nearly
all of Python's other implementations. Python and CPython are managed by the non-profit Python
Software Foundation.
Python has a simple, easy to learn syntax emphasizes readability hence, it reduces the cost of
program maintenance. Also, Python supports modules and packages, which encourages program
3
modularity and code reuse.[2]http://www.python.org/doc.
Python offers simplicity and readability, making it accessible for beginners and efficient for
experienced developers. It has extensive libraries (e.g., Pandas, NumPy, Scikit-Learn) for data
analysis and machine learning, robust community support, and compatibility across platforms,
making it ideal for rapid development and deployment of data-driven projects.
Machine learning (ML) is a field within artificial intelligence (AI) focused on developing algorithms
that enable computers to learn from data and improve at tasks over time without explicit
programming. It allows systems to identify patterns, make decisions, and predict outcomes by
analysing and learning from historical data. Machine learning models generally operate through
three main types of learning:
1. Supervised Learning: Involves training a model on labelled data, where inputs are paired with the
correct output. Common tasks include classification (e.g., spam detection) and regression (e.g.,
predicting housing prices).
2. Unsupervised Learning: The model works with unlabelled data, finding structure and patterns
within it. It’s widely used for clustering (e.g., customer segmentation) and dimensionality reduction
(e.g., simplifying data features).
3. Reinforcement Learning: This method involves training a model through rewards and penalties
based on its actions, helping it learn strategies for tasks like game playing or robotic navigation.
Machine learning models leverage algorithms such as linear regression, decision trees, neural
networks, and clustering methods like K-means. The development process includes data collection,
preprocessing, feature engineering, model training, and evaluation to ensure the model can
generalize well to new data.
ML has transformative applications in industries like healthcare (for diagnosis), finance (fraud
detection), retail (recommendation engines), and manufacturing (predictive maintenance). With
advancements in computing power and data availability, machine learning is increasingly pivotal to
automating decision-making, enabling personalized experiences, and solving complex problems at
scale. As a result, it plays a critical role in advancing AI capabilities and innovation.
[5] https://pwskills.com/
2.2.1 Models
Machine learning models are algorithms designed to find patterns in data and make predictions or
decisions based on it. Some common types include:
1. Linear Regression: Predicts continuous values by establishing a linear relationship between input
variables and the target variable.
2. Decision Trees: Splits data into branches based on feature values for classification or regression
tasks.
3. Support Vector Machines (SVM): Finds the optimal boundary that separates data into classes.
4. Neural Networks: Mimics the human brain structure, excelling at complex tasks like image and
speech recognition.
5. Clustering Models (e.g., K-means): Groups data based on similarity in unsupervised learning
scenarios
5
2.2.2 Importance of Machine Learning
Machine learning is vital for transforming data into actionable insights and automating complex
tasks across industries. It enables systems to analyse vast amounts of data, identify patterns, and
make predictions with minimal human intervention, leading to more informed decision-making. ML
drives innovation in fields like healthcare (for disease diagnosis and drug discovery), finance (fraud
detection and algorithmic trading), retail (personalized recommendations), and transportation (self-
driving technology). By continuously learning from data, machine learning enhances productivity,
efficiency, and personalization, making it fundamental to advancements in artificial intelligence and
essential for addressing today’s data-driven challenges.
2.3 Frontend
In machine learning, the frontend is crucial for creating user interfaces that allow users to interact
with ML models effectively. A well-designed frontend helps users input data, view predictions,
interpret results, and manage settings, making machine learning applications accessible even to those
without technical expertise.
Common Technologies
Frontend technologies like React, Vue, and Angular are often used alongside Python Flask or Django
APIs to connect the frontend with the backend ML models, ensuring smooth data flow and real-time
responses.
2.4 Backend
In a machine learning project, the backend is responsible for handling the processing, storage, and
deployment of ML models, as well as managing data and user requests. It serves as the core that connects
6
the frontend with the machine learning model, enabling seamless communication between the user
interface and the model’s computations.
Common Technologies
Backend development in ML commonly uses Python frameworks (Flask, Django), Node.js for REST
APIs, and database systems like SQL or NoSQL databases. Additionally, cloud services and CI/CD
pipelines are integrated to automate model deployment and updates.
2.5 Frameworks
In machine learning, various frameworks provide the tools and libraries needed for data processing,
model building, deployment, and scalability. Here are some widely used frameworks across different
stages of an ML project:
7
2. Data Preprocessing and Analysis Frameworks
● Pandas: A data manipulation library in Python, ideal for data cleaning, transformation, and
handling structured data.
● NumPy: A foundational library for numerical computing in Python, providing support for arrays
and mathematical functions.
● Apache Spark: An open-source framework for big data processing, used for handling large
datasets with distributed computing.
5. Visualization Frameworks
● Matplotlib, Seaborn: Python libraries for creating static, animated, and interactive
visualizations.
● Plotly: An interactive visualization library useful for building dashboards.
● TensorBoard: A TensorFlow tool for visualizing metrics, model structure, and data flow graphs
in deep learning models.
These frameworks streamline the machine learning lifecycle, from data preprocessing and model
development to deployment and monitoring, making ML projects more efficient, scalable, and accessible
2.6 Flask
Flask is a lightweight, open-source web framework for Python, designed for building web applications
and APIs. Known for its simplicity and flexibility, Flask provides only the essentials, enabling
developers to create web services quickly without unnecessary overhead. This "microframework"
8
approach means it lacks built-in tools like form validation or database abstraction, allowing developers
to integrate only the extensions they need, making it versatile for small to large applications.
Flask is widely used in machine learning projects to serve models as RESTful APIs, enabling models to
accept data input, make predictions, and return results to the client application. It’s compatible with
numerous libraries and works well with HTML templates (via Jinja2) and JSON data, which is essential
for modern web applications.
Flask’s ease of setup, extensive community support, and scalability make it popular for prototyping and
deploying applications, especially for data science, machine learning, and full-stack web development
projects.[3] http://en.wikipedia.org/wiki/Flask.
1. Install Python
Ensure Python is installed on your system. You can check by running:
python --version
On Windows:
myenv\Scripts\activate
On macOS/Linux:
source myenv/bin/activate
Using a virtual environment ensures each project has isolated dependencies, preventing conflicts across
projects.
10
CHAPTER 3
PROJECT IN DETAIL
3.1 Introduction
The Fire Weather Index (FWI) is a critical metric used to assess wildfire risk based on weather and
environmental factors. Developed as part of the Canadian Forest Fire Weather Index System, FWI
combines various weather elements—such as temperature, humidity, wind speed, and rainfall—to
produce a single value representing the fire risk level. High FWI values indicate dry and windy conditions
favourable to fire ignition and spread, while lower values represent less risky weather conditions. For
regions like Algeria, where wildfires pose severe threats to forests, biodiversity, and local communities,
accurately predicting the FWI can significantly enhance wildfire prevention and management efforts.
This project focuses on developing a machine learning model tailored to predict FWI in Algerian forests.
By leveraging historical weather data and exploring patterns in meteorological conditions, the model
aims to deliver reliable FWI predictions specific to Algeria's climate. This project involves data
collection, preprocessing, feature engineering, and model training, enabling accurate predictions that can
be used in real-time.
The implementation of this FWI prediction model can transform forest management practices by
enabling authorities to monitor fire risk levels proactively. With timely warnings, forest management
agencies can take preventive actions, allocate resources effectively, and respond swiftly to potential
wildfire outbreaks. Ultimately, this project supports efforts to protect natural landscapes, wildlife, and
communities, contributing to sustainable and resilient forest ecosystems in Algeria. The project also
provides a foundation for applying similar models in other fire-prone regions, highlighting the role of
machine learning in environmental management
FWI is widely used by forest fire management agencies to predict and monitor fire hazards, guiding
decisions on resource allocation, fire prevention, and control efforts. It helps authorities identify
periods of elevated fire risk, allowing for early intervention and strategic planning. Accurate FWI
forecasting plays a vital role in reducing wildfire damage to ecosystems, property, and human lives
by enabling timely and proactive responses.
11
3.3 Purpose:
The purpose of Fire Weather Index (FWI) prediction is to assess and predict the risk of wildfires based
on weather and environmental conditions. By accurately forecasting FWI values, authorities can
anticipate periods of high fire risk and take proactive measures to reduce the impact of wildfires. The
key purposes of FWI prediction include:
1. Early Warning: Provide early alerts on high fire-risk conditions, allowing authorities and fire
management teams to prepare, deploy resources, and implement preventive measures.
2. Resource Allocation: Help allocate firefighting resources efficiently, ensuring that areas at higher
risk receive the attention and support they need.
3. Fire Prevention: Support fire prevention strategies by identifying dangerous weather patterns that
increase the likelihood of fire ignition and spread.
4. Forest and Ecosystem Protection: Protect forests, biodiversity, and local communities by predicting
and mitigating wildfire risks, reducing the destruction caused by uncontrolled fires.
5. Improved Decision-Making: Aid decision-makers in government, forestry, and emergency services
in planning and managing wildfire response strategies based on accurate predictions.
In essence, FWI prediction helps mitigate the destructive effects of wildfires by offering timely and
reliable data for decision-making and resource management.
12
warning system helps in:
4. Preventive Measures
FWI helps governments, fire departments, and forestry agencies implement preventive measures such as
controlled burns, fire bans, and forest management activities when FWI levels are high. This reduces the
overall frequency and severity of wildfires.
5. Global Applicability
FWI systems are widely used across the world, not just in specific regions. It is adaptable to different
climates and geographic areas, making it an internationally recognized tool for wildfire risk prediction.
This has helped create global cooperation in wildfire monitoring and prevention.
7. Resource Optimization
FWI prediction systems help optimize resource management, from allocating fire crews to scheduling
preventative maintenance and monitoring equipment. This not only saves resources but also helps reduce
the economic impact of wildfires.
13
8. Public Safety
In addition to helping firefighting authorities, FWI also contributes to public safety by providing real-
time risk alerts to the general public through various platforms, such as mobile apps and websites,
ensuring that citizens are informed and can take the necessary precautions.
14
CHAPTER-4
RESULTS AND OUTPUTS
4.1 Main Output
4.2 Dataset
15
4.3 FE and EDA (Feature Engineering and Exploratory Data Analysis)
FE (Feature Engineering) and EDA (Exploratory Data Analysis) are crucial steps in data science and
machine learning.
- Feature Engineering (FE) involves creating new features or modifying existing ones to improve model
performance. It includes techniques like encoding categorical variables, scaling data, or combining
features to capture essential patterns.
- Exploratory Data Analysis (EDA) is the process of analysing and visualizing data to understand its
structure, patterns, and relationships before modelling. EDA involves summary statistics, data
visualization (e.g., histograms, scatter plots), and identifying data issues like missing values or outliers.
Both FE and EDA are essential for building accurate, reliable models.
16
Fig.4.4 Heatmap
4.5 Training and Testing Dataset
Training Data: This portion of the dataset is used to train the model, allowing it to learn patterns,
relationships, and associations within the data. The model adjusts its parameters based on the training
data to make predictions.
Test Data: After training, the test data is used to evaluate the model's performance. The test data is
separate from the training data, ensuring the model's accuracy and generalization ability on unseen data.
17
Fig.4.6 Box plots
4.7 Modelling
Modelling in data science is creating algorithms that learn patterns from data to make predictions,
classify, or analyse outcomes.
4.7.1 Linear Regression
Linear regression is a statistical method for modelling the relationship between a dependent variable
and one or more independent variables. By fitting a linear equation to observed data, it estimates how
changes in the predictors influence the target. It's widely used for its simplicity and interpretability,
especially in straightforward datasets.
18
Fig.4.8 Lasso Regression
4.7.3 Ridge Regression
Ridge regression is a linear regression technique that adds an L2 penalty to the loss function, shrinking
coefficients to reduce model complexity and multicollinearity issues. This penalty term discourages
large coefficient values, leading to a more stable and less overfit model, especially useful when
predictors are highly correlated.
19
Fig.4.10 ElasticNet Regression
20
CHAPTER-5
CONCLUSION & FUTURE SCOPE
5.1 Conclusion
The Fire Weather Index (FWI) prediction project has demonstrated the effectiveness of using weather
data to predict the risk of wildfires. By analysing key meteorological factors such as temperature,
humidity, wind speed, and rainfall, this project has successfully modelled and predicted fire risk with
significant accuracy, which is vital for wildfire management and prevention strategies.
The project utilized machine learning models, including Random Forest, to predict the FWI based on
historical weather data from the Algerian Forest dataset. By training and evaluating the model, we have
been able to showcase the practical application of these models in real-world scenarios. The use of data
preprocessing techniques, such as handling missing values and feature engineering, was essential in
optimizing the input data for better model performance.
One of the key findings of this project is that the FWI prediction model plays a critical role in early
detection and prevention of wildfires. Accurate predictions of fire risks allow forestry agencies, fire
departments, and local governments to take timely actions, such as deploying firefighting resources,
issuing warnings to the public, and implementing preventive measures. This can significantly reduce the
devastation caused by wildfires, both in terms of environmental damage and human lives.
Furthermore, the project integrated a Flask API to serve the trained model, allowing real-time predictions
via a web interface. This deployment strategy ensures that the model can be easily accessed and utilized
in various operational settings, whether for daily monitoring or emergency responses.
In conclusion, this project highlights the importance of predictive modelling in wildfire risk management.
By leveraging weather data and machine learning, we have demonstrated how technology can improve
decision-making, optimize resource allocation, and enhance public safety. As wildfires become
increasingly frequent due to climate change, predictive systems like FWI models will continue to play
an indispensable role in mitigating the impact of these natural disasters. The successful implementation
of this project also opens doors to further research, exploring the integration of more advanced models
and data sources to improve the accuracy and efficiency of wildfire prediction systems.
The future scope of the FWI Prediction project includes enhancing model accuracy by integrating
advanced machine learning techniques and real-time data sources such as satellite images and IoT
sensors. Further, expanding the model to predict across diverse geographic regions can make it
universally applicable, aiding global fire management efforts. Leveraging AI for anomaly detection and
incorporating climate change projections could also improve long-term predictions. Adding user-friendly
dashboards and mobile apps could increase accessibility, allowing fire management teams and the public
to receive instant alerts and insights, making wildfire prevention and mitigation more effective .
21
REFERENCES
[1] Flask homepage. http://www.flaskproject.com/.
[2] Python documentation. http://www.python.org/doc.
[3] Flask (web framework). http://en.wikipedia.org/wiki/Flask.
[4] Flask documentation. https://en.wikipedia.org/wiki/Flask_(web_framework)
[5] https://pwskills.com/
22