0% found this document useful (0 votes)
96 views10 pages

Forest Fire Detection Using CNN

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views10 pages

Forest Fire Detection Using CNN

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

International Journal of Scientific Research in Engineering and Management (IJSREM)

Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

FOREST FIRE DETECTION USING CONVOLUTIONAL


NEURAL NETWORK
Submitted by Dr.B.Premamayudu(Professor),T.Gayathri(Student) , M.Bhargavi(Student)

Dept of Information Technology,Vignan Foundation For Science ,Technology and Research

ABSTRACT:
Fire outbreaks are a typical occurrence all throughout the world, and the harm they bring to both nature and
humans is enormous. In comparison to classic sensor-based fire detection systems, vision-based fire detection
systems have recently gained favour. The detection process using image processing techniques, on the other hand,
is extremely time consuming. We designed a Convolutional Neural Network-based fire detection technique.
Through training with datasets, obtain high-accuracy fire image detection that is consistent with fire detection. In
this paper, we propose a system for detecting fire using Convolutional Neural Networks (CNN). This paper
critically analyzes the scope of Artificial intelligence for detection with video from CCTV footages. This project
uses dataset containing video frames with fire. The data is then preprocessed and use the CNN to build a model
to detect fire. The dataset is given as input for validating the algorithm and experiments are noted.
This project focus on building high accuracy and cost efficient machine that can be used for fire detection.There
are 755 and 244 images in the datasets for fire and non-fire, respectively. There are 999 photos in all. These
images were created using fire-related video and some images found on the internet. There are 999 images that
have been scaled and reshaped to convert to a training dataset and 999 images that have been resized and reshaped
to convert to a testing dataset. Convolution, activation functions, and the max pooling technique are used to train
the model. The model is trained by varying batch sizes and epoch values. As a result, we obtain a high accuracy
and detection rate.

Key words: CNN,fire detection,machine learning.

INTRODUCTION:
The function of fire detection is crucial for people's safety. Several fire detection techniques have been created to
prevent fire-related harm. Various technical solutions are available. The majority of them rely on sensors, which
are mainly limited to indoor use. However, those approaches have a fatal fault in that they will only work if a
specific condition is met. In the worst-case scenario, the sensors are broken or improperly configured, resulting
in significant casualties in the event of a genuine fire. These sensors use ionisation to detect particles created by
smoke and fire, which requires close proximity to the fire. As a result, they can't be used to cover big areas. Video
fire detection systems are used to overcome such limitations. As digital cameras and video processing technology
advance,there is a substantial tendency to move to new technologies.

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 1


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

Computer vision-based technologies replace traditional fire detection methods. Techniques for detecting fires
using video are becoming more popular. It's ideal for detecting fire in vast, open areas .Closed-circuit television
surveillance systems are now popular are deployed in the majority of sites to keep an eye on what's going on
inside and outside. It would be an exception in this case.A competitive advantage in developing a video-based
fire detection system ,This could make advantage of the surveillance cameras already in place without paying
additional costs. Compared to traditional detection approaches, this type of technology has several advantages.
For example, compared to old methods, employing this type of detection is less expensive, and implementing this
type of system is more easier. Second, compared to other traditional detection systems, a vision based fire
detection system responds faster because it does not require any form of circumstance to trigger the devices and
can monitor a vast area.
Fire can make major hazards in this world. It is very harmful when a fire occurs in a forest. Sometimes, it could
not be possible to stop the fire. Forests are one of the main factors in balancing the ecology. The forest is a large
surface of area filled with trees, lots of dried leaves, woods and so on. These elements encourage the fire when it
starts. Once fire starts, it will remain until it distinguished completely. The damage and the cost for distinguish
fire because of forest fire can be reduced when the fire detected early as possible. But most of the time, the
detection of forest fire happens when it spread over a wide region. The emission of large amount of carbon dioxide
(CO2) from the forest fire damages the environment .Also, it can make an impact on the weather, and this make
major issues like earthquakes, heavy rains, floods and so on. So, the fire detection is important in this scenario.
Finding of the exact location of the fire and sending notification to the fire authorities soon after the occurrence
of fire can make a positive impact.
There are different types of fire detection methods used by the Government authorities such as satellite
monitoring, tower monitoring, using sensors, optical cameras and so on. But these mechanisms still have some
drawbacks in detecting the early stage of the fire. So that, it is highly important to introduce a system to detect
the fire early as possible.Several data augmentation techniques were used on photos to make the dataset resistant
to overfitting, including flipping, 300-degree rotation, brightness enhancement through various scales,
magnification, and shearing.Occlusion, noise, clutter, flame smoke variation, illumination variance, and view-
point difficulties are all effectively dealt with by many deep learning models in computer vision.
The CNN model was fed with the training data at first.Artificial intelligence's potential to bridge the gap between
human and computer skills has skyrocketed in recent years.To obtain exceptional outcomes, researchers and
hobbyists alike focus on many aspects of the field. One of these subjects is machine vision . A Convolutional
Neural Network (ConvNet/CNN) is a Deep Learning system that can take an input image and assign relevance
(learnable weights and biases) to various aspects/objects in the image, as well as differentiate between them.
When compared to other classification methods, a ConvNet requires substantially less pre-processing. With
enough training, ConvNetscan can learn these filters/characteristics, however rudimentary techniques require
filter engineering by hand.
Order, object identification, acknowledgement, and depiction are only a few of the challenges in image analysis.
If a picture classifier is to be created, for example, it should be able to perform with high precision even when
faced with a variety of obstacles, such as obstruction, illumination variations, and viewing points. The traditional
picture-arrangement pipeline, with its principal benefit of component design, is unsuitable for dealing with
complex environments. Even experts in the field will not be able to provide a single or a collection of highlights
© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 2
International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

that can reach high levels of excellence. Even experts in the field will be unable to provide a single or a collection
of highlights with great precision under a variety of conditions. Highlight learning emerged as a result of this
issue. The necessary pieces for working with images are naturally advanced.

RELATED WORK:
A paper titled Fire Detection in Buildings Using Image Processing was proposed by Jareerat Seebamrungsat, et
al., (2014). Color Segmentation was proposed as a way to separate fire from its surroundings. The HSV and
YCbCr colour models' features are employed to distinguish the flame colours from the background. To detect
information about colour and brightness, the HSV colour model is employed. Then they count the amount of
white frames by subtracting the difference between the previous and current frames for five frames in a row[1].
Punam Patel and coworkers (2016) proposed Flame Detection Using Image Processing Techniques. Image-based
fire detection, it is proposed, requires a number of sequential frames from original video, which includes both fire
and non-fire images. Fire pixel detection using the RGB and YCbCr colour models, moving pixel detection, and
assessing the form of fire coloured pixels in frames are the three key phases. Fire is identified after this method
is applied to video sequences[2].
Qingjie Zhang et al. (2016) presented a paper titled Deep Convolutional Neural Networks for Forest Fire
Detection at the Aviation University of Air Force, Changchun's International Forum on Management, Education,
and Information Technology Application. They build and test the algorithm on a small specific subgroup. Due to
the short size of our annotated dataset, they studied two types of classifiers in this study: linear and non-linear.
For our binary classification, they reduced the number of outputs in the last fully connected layer to two. They
also decreased overfitting in this network, which is trained in just a few hundred iterations and achieves
unexpectedly high training and testing accuracy[3].
In IEEE Transactions, Sebastien Frizzi1, et al., (2017) proposed a paper titled Convolutional Neural Network for
Video Fire and Smoke Detection. Their primary goal in classifying images is to determine whether they include
fire or smoke. They divided the images into three subsets: training (60%), validation (20%), and test (20%). We
need to increase our training set to improve fire detection and localisation on video. The training data was created
using a machine with an Intel Xeon cpu (3.01 GHz, 16 GB RAM) and a GTX 980 Ti graphic card (2816 cores, 6
GB memory)[4].
Khan Muhammad, et.al., (2018) proposed a paper entitled efficient deep CNN based fire detection system and
localization in video surveillance system. This system proposed the intelligent feature map selection algorithm is
proposed for choose appropriate feature maps from the convolutional layers of the trained CNN, which are
sensitive to fire regions.These feature maps allow a more accurate segmentation of fire compared to other
handcrafted methods. Using this the size of the model was reduced from 238 MB to 3 MB, thus minimizing the
cost and making its implementation Another feature of this system is the ability to identify the object which is on
fire, using a pre-trained model[5].

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 3


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

METHODOLOGY:
The CNN (Convolutional Neural Networks) model is the methodology used in this fire detection system. The
image datasets are built by transforming fire images collected by videos into frames. Some images from the
dataset have been added to it.These are copied from kaggle and GitHub. Images must be classified as fire as
well as non-fire. The number of images in the fire and non-fire has a value of 755 and 244. There are 999 in total
images. These images are resized to (300,300) before being processed.(-1,300,300,1) was reshaped and saved as
a linear array.This is fed into the convolutional layer as an input. In these instances,Several kernels of various
sizes are used in operations.the data used to create feature maps The concept of the model consists of 64
convolution filters, each measuring 3x3.
The feature maps are activated using the ReLU activation function. This function updates the positive section of
the feature map quickly. These feature maps are fed into the next phase, known as max pooling. A 3x3 kernel
size convolution layer and a pooling layer are then applied to these feature maps. The flatten layer converts 2D
feature maps into vectors that can then be used in a fully linked layer. For example, the convolution and fully
connected layers contain neurons whose weights are learned and altered throughout the training process in order
to better reflect the input data. A dense layer represents matrix vector multiplication. The values in the matrix,
which are updated during back propagation, are used to represent the trainable parameters. As a result, an m-
dimensional vector is produced as the output. To discriminate between fire and non-fire outputs, we employ an
activation function like Soft max. The Soft max function creates a probability distribution that maps output to a
scale of 0–1. As a result, it's often used as the last layer in a classification model. The model is constructed using
an Adam optimizer, which determines each parameter's own learning rate using an adaptive learning rate. Because
only one result may be legitimate in this categorization, the categorical cross entropy loss function is used.

CNN model

Connected layers in CNN

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 4


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

FLOW CHART:

ARCHITECTURE :

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 5


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

RESULTS:
There are 755 and 244 images in the testing collection for fire and non-fire, respectively. There are 999 images
in all. These images were created from fire-related video and a small number of images from the internet .Using
OpenCV, images from the dataset's two folders, 'Fire' and 'Non -Fire,' are read from the folders. Images are stored
as NumPy arrays and have been resized to save space. The image array and class number are merged into a single
list, which is then appended to a new list termed 'training data. 'The 'training data' has been mixed up. Separately,
the image array and its classes are appended to two new lists. The image array is reshaped into a linear array from
the list.
The batch size refers to the amount of samples that must be processed before moving on to the next step .changing
the model's internal parameters One or more batches can be created from a training dataset. The number of times
the learning algorithm is run is measured in epochs will go over all of the training data. The precision is excellent
while the cost is inexpensive. Because of this, when the loss is reduced as the batch size is increased.

CONFUSION MATRIX:
The number of right and unsuccessful predictions is totaled and broken down by class using count values. When
your classification model generates predictions, the confusion matrix displays how it gets confused. It reveals not
just the number of errors made by a model, but also the sorts of faults made. The confusion matrix is computed
using actual labels (Y) and predicted labels (Z).

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 6


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

CLASS-1 CLASS-2
PREDICTED PREDICTED

CLASS-1 ACTUAL TP FN

CLASS-2 ACTUAL FP TN

General Confusion Matrix

Here,
• Class-1 : Positive (Fire)
• Class-2 : Negative (Non-Fire)
• True Positive: Actual is positive, and is predicted to be positive.
• False Negative: Actual is positive, but is predicted negative.
• True Negative : Actual is negative, and is predicted to be negative.
• False Positive (FP): Actual is negative, but is predicted positive.

CLASS-1 CLASS-2
(POSITIVE) (NEGATIVE)
PREDICTED PREDICTED

CLASS-1
(POSITIVE) ACTUAL
78 2

CLASS-2
(POSITIVE) ACTUAL
5 63

Predicted confusion matrix

80 images were initially positive, with 78 images anticipated to be true positives (TP). 68 images were originally
negative, and 63 are predicted to be true negatives (TN). There are 68 images that were previously negative and
5 of them are anticipated to be false positives (FP). There are 80 images that were originally positive, and 2
images that are anticipated to be false negatives (FN). As a result, 141 images are successfully predicted and 7
images are incorrectly forecasted.
Accuracy = (78+63/78+63+5+2) x 100 = 95.27%, 6% of the images are falsely predicted.
False negative (%) = (2/148) x 100 = 1.351%
© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 7
International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

False positive (%) = (5/148) x 100 = 3.378%


Total Falsely predicted = False negative + False positive
= 1.351% + 3.378% = 4.729%

 Accuracy is given by the relation:

Accuracy obtained is 0.957.

 Recall is given by the relation: 𝑻𝑷

Recall value obtained is 0.975. Class is correctly recognized (small number of FN) when recall value is high.

 Precision is given by the relation:


𝑻𝑷

Precision obtained is 0.939.

Obtained Confusion matrix

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 8


International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

OUTPUT:

Output of predicted images

CONCLUSION AND FUTURE SCOPE:


Fire is the most dangerous abnormal event because it can cause massive disasters, resulting in human, ecological,
and economic losses, if it is not controlled quickly. Accidents involving fire can be discovered utilising the
cameras. As a result, we suggested a CNN approach for camera-based fire detection. Under the supervision of
cameras, our method can detect the fire. Furthermore, by fine-tuning datasets, our suggested approach balances
the accuracy of fire detection with the size of the model. We were able to achieve a 95 percent accuracy rate.
These figures indicate that the model provides a more accurate prediction. We conducted trials with datasets
gathered from fire recordings and compared them to our suggested method.
Because of the CNN model's reasonable accuracy for fire detection, size, and rate of false alarms, the system can
assist crisis management teams in quickly controlling fire disasters. As a result, substantial losses are avoided.This
project is primarily concerned with the detection of fire scenarios that are being observed. Future research could
concentrate on putting the model on a Raspberry Pi and employing the appropriate support packages to identify
real-time fires by creating challenging and particular scene understanding datasets for fire detection methods and
extensive trials.

REFERENCES:

[1] Punam Patel and Shamik Tiwari published a paper titled Flame Detection Using Image Processing
Techniquesin International Journal of Image Processing in 2016.Volume 58 of the Journal of Computer
Applications No.18.
[2] Jareerat Seebamrungsat, Suphachai Praising, and Jareerat Seebamrungsat Panomkhawn Riyamongkol
proposeda in 2014.Fire Detection in Buildings Using Wireless SensorsThird ICT International Conference on
Image Processing IEEE Access Journal in Electrical Engineering Department Computer Science and Engineering.
[3] Khan Muhammad and Jamil Ahmad published a paper in IEEE Transactions on Systems, Man, and
© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 9
International Journal of Scientific Research in Engineering and Management (IJSREM)
Volume: 06 Issue: 06 | June - 2022 Impact Factor: 7.185 ISSN: 2582-3930

Cybernetics Systems in 2018 titled Efficient deep CNN based fire detection system and localization in video
surveillance system.
[4]. In IEEE Explore Advances in Electrical and Computer Engineering, Abdulaziz and Young Im CHO proposed
a paper titled An Efficient Deep Learning Algorithm for Fire and Smoke Detection with Limited Data.
[5] In 2016, Qingjie Zhang, Jiaolong Xu, Liang Xu, and Haifeng Guo presented a paper titled Deep Convolutional
Neural Networks for Forest Fire Detection at the Aviation University of Air Force, Changchun's International
Forum on Management, Education, and Information Technology Application.

© 2022, IJSREM | www.ijsrem.com DOI: 10.55041/IJSREM14497 | Page 10

You might also like