0% found this document useful (0 votes)
81 views5 pages

Fire & Gun Detection Using Machine Learning

Accidental fire is a natural disaster which threatens the public safety in a huge manner. In the past few years, accidental fire has occurred very frequently in many places
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)
81 views5 pages

Fire & Gun Detection Using Machine Learning

Accidental fire is a natural disaster which threatens the public safety in a huge manner. In the past few years, accidental fire has occurred very frequently in many places
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/ 5

Volume 7, Issue 6, June – 2022 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Fire & Gun Detection using Machine Learning


Karthik R, Ashwin S B Haripriya C
Department of Computer Science and Engineering Assistant Professor, Department of Computer Science and
Global Academy of Technology Engineering, Global Academy of Technology
Bangalore, Karnataka, India Bangalore, Karnataka, India

Abstract:- Accidental fire is a natural disaster which B. YOLO Algorithm


threatens the public safety in a huge manner. In the past You Only Look Once (YOLO) is an object detection
few years, accidental fire has occurred very frequently in algorithm, and it is faster than other object detection
many places, including forests, shopping malls and algorithms. In the initial detection systems, localizers or
industries, which in turn yields to the huge loss of human classifiers were used to perform detection. The algorithm
lives and capital. By paying attention to simple steps and applies a single neural network to the complete image. The
being familiar with obvious dangers, one can help to lower algorithm looks into particular parts of the image and not the
the likelihood of accidental fires and hinder damage complete image. Hence, this algorithm is fast and more
caused to the property or even worse, loss of property. It effective.
mainly reduces the risk of potential loss of lives.
Possession of fire arms without a license is an offence and C. Prediction and forecasting
even if someone does have a license for it, bringing it to Predicting the cause of fire and possession of guns help
certain places is restricted. Though there is rigorous in decreasing the loss of life and property. Prediction is based
checking in the entrance of every place, there are on the previous data and the features extracted from them.
possibilities of a mishap. Instead of looking at the whole The new data captured from the video is compared to the pre-
network, the YOLO algorithm looks into the parts of the existing data. Later, the danger is predicted based on that.
image which has high possibilities of containing the
object. You Only Look Once (YOLO) is an object III. MOTIVATION
detection algorithm, and it is faster than other object
detection algorithms. Thousands of trees are lost during forest fires and
hundreds of people die every year due to fire accidents at
Keywords:- Fire detection, Gun detection, YOLO algorithm home, work place and community areas. A considerable
amount of people lose their lives through gunshots. These
I. INTRODUCTION situations can be avoided by predicting the disasters early.

Accidental fire threatens public safety and as it is a IV. EXISTING SYSTEM


natural disaster, controlling that is a very difficult task. Over
the last few years, accidental fire has frequently occurred in The current system includes using fire alarms as the
many places, including forests, shopping malls and industries, main method to detect fire and alert the supervisor. Fire
which has resulted in great losses to human life and finances. alarms use smoke as its main input, and sometimes it can be
In the wake of years of development, Virtual Reality (VR) deceiving. For example, smoke from incense sticks or
has evolved rapidly and has converted people’s lives by camphor. As of now, guns are detected by using metal
making it easier and simpler than before. Due to the detectors or by manually checking for guns and the results are
continuous evolvement, virtual reality has become an integral not always accurate.
part of the future of the fire detection technology. Currently,
we have traditional fire detectors, which include smog V. PROPOSED SYSTEM
detectors, optical detectors, and temperature detectors, which
usually have certain defects or restrictions. Smog and flames Fire detection by using live camera feed, plays an
have specific shapes, textures, colors and other similar important role in reducing losses caused by fire, as it alarms
features. Hence, people have started to consider the use of the user before in hand, and in turn reduces the risks caused
computer-based image processing for fire detection.[1] by fire. Image based fire detection is established by analysis
of the images algorithmically. The live video is passed
II. DEFINITIONS through the algorithm and then the YOLO algorithm
processes the input data. The system searches for the presence
A. Fire and gun detection of gun or fire and then detects the same.
Fire and gun detection basically means detecting
dangers before they occur. Tools are a great necessity to If fire or gun is present in the particular video, it will
predict danger before it occurs. Currently, tools like fire alert the supervisor through SMS. You Only Look Once
alarms and smoke detectors are used by people to detect fire. (YOLO) algorithm is an object detection algorithm which
helps to detect fire and gun more efficiently and also in a
faster way.

IJISRT22JUN1219 www.ijisrt.com 1499


Volume 7, Issue 6, June – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
VI. OBJECTIVE OF THE PROJECT VIII. OBJECTIVES OF LITERATURE SURVEY

The video captured by the live camera is traversed  Accidental fire is one among the main causes for the loss
through the YOLO algorithm and the algorithm examines the of human and animal life globally
video thoroughly for traces of fire or gun. The extracted  By alarming users before in hand, we can minimize the
features of the video are compared to the pre-existing dataset consequences of fire hazards
and the similarities between them is established. If there are  If fire can be contained in the early stages, loss of lives
any similarities, an alert message about the fire or gun is and property can be avoided
displayed on the screen.  Early warning systems are the future and they need to be
researched well to provide a fool proof security
VII. LITERATURE SURVEY
IX. SCOPE OF THE PROJECT
 Image fire detection algorithms based on convolutional
neural networks The video captured from the camera is passed through
Authors: Author: Pu Li, Wangda Zhao the YOLO algorithm and the algorithm looks through the
Abstract: Fire hazards are becoming more frequent in video for traces of fire or gun. The extracted features from the
recent years. Hence, reducing losses caused by fire is a dire video are compared to the pre-existing dataset and the
necessity. Alarming users before in hand is one of the main similarities between them is established. If there are any
things to do, to reduce risks. By spontaneously extracting similarities, an alert message about the fire or the gun is
image features, the comparison becomes easy. CNN displayed on the screen.
algorithm-based fire detection reports that the accuracy of it
is higher than all other algorithms. YOLO v3 gives 83.7% X. SYSTEM ARCHITECTURE
precision which is higher than all proposed algorithms. It also
has a great detection performance and the detection speed is
around 28 FPS. This enables real-time detection in an easier
way.[2]

 An Early Flame Detection Based on Image Block


Threshold Selection Using Knowledge of Local and
Global feature Analysis
Authors: Ting Hsu, Shreya Pare, Dong Lin Li.
Abstract: Fire is one among the uncontainable events
that occur in our day-to-day life. Every year, it is responsible
for innumerable human life, flora and fauna. Hence, many
researchers have associated themselves with early warning
systems to minimize the fire damage and the resulting
consequences. In this paper, the occurrence of fire is
classified into four periods, namely, inception, fire growth
Fig 1: System Architecture
period, fully developed period and decay period. The flame
detection is done by considering four categories, namely,
The fire and gun detection system considers the live
shape, color, motion and texture. The system has 97%
video as input data, then it preprocesses the data and extract
detection rate and about 3.5% false alarm rate. The processing
the features. Later, YOLO algorithm is applied to compare
time is 5 ms per frame. [3]
between the new data and the pre-existing data and then, the
system predicts the presence of fire or gun in the live video.
 Batik Image Classification Using SIFT Feature
Extraction, Bag of Features and Support Vector Machine
XI. DATAFLOW DIAGRAMS
Authors: Ryfial Azhar, Desmin T uwohingide, Dasrit
Kamudi
A dataflow diagram or DFD gives a detail approach of
Abstract: Batik is an Indonesian traditional fabric which
the inputs and the outputs of each process. It specifies the
is also its cultural heritage since 2009 [4]. Batik image sorting
flow of data without any particular kind of loops or rules.
and grouping is required to protect the resources of traditional
DFD mainly focuses on expressing data by the flowchart. It
art of Indonesia. Hence, a feasible technique is important to
consists of different steps of a process in systematic order.
extract the distinctive characteristics of batik image. Bag of
Features (BOF) is used in the image classification along with
Scale-Invariant Feature Transform (SIFT) and Support
Vector Machine (SVM) classifier [5][6]. The observation
results show that the mean accuracy of this reaches 97.67%
for normal image, 95.47% for rotated image and 79% in
scaled image. [7]

IJISRT22JUN1219 www.ijisrt.com 1500


Volume 7, Issue 6, June – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
DATA FLOW DIAGRAM - LEVEL 0 Level 2 DFD goes one step deeper into parts of level-1
DFD. It can be used to plan or record the necessary details of
the system’s functioning. It describes the final stage of the
project. In Fig 4, we are passing extracted features from level
1 and the trained data as input, the system compares both of
them using YOLO algorithm and predicts the existence of fire
or gun in the live video.

XII. USE CASE DIAGRAM


Fig 2: Data Flow Diagram – level 0
Use case diagram is an illustrative representation of all
the possible interactions with the system. It is basically the
LEVEL 0 Data flow diagram is an aerial view of the communication between the user and the system. The use
entire system in a single process along with its external case diagram is drawn for revealing the functionality of the
entities and the relationship between them. It is also known
system. The actors are displayed using stick figures and the
as Context Schema. It describes the overall process of a
rest of it by using either ellipses or circles. It includes
project. The live camera feed is passed as input to the system everything from loading the dataset to alerting the supervisor.
and the system uses YOLO algorithm to detect the presence
of fire and gun. It displays the result at the end.

DATA FLOW DIAGRAM – LEVEL 1

Fig 3: Data Flow Diagram – level 1

LEVEL 1 DFD is a LEVEL 0 diagram split into


different processes. It highlights the main function of the Fig 5: Use Case Diagram
system. In this level, the high-level process of 0-level DFD is
divided into sub processes by identifying the important XIII. CLASS DIAGRAM
features of the system. We pass live video as input to the
system. It preprocesses the input data and extracts all the
important features in them. Later, the result is displayed.

DATA FLOW DIAGRAM – LEVEL 2

Fig 6: Class Diagram

This schema represents the class diagram of the project.


It is constituted by the type of objects present in the system
and the relationship between them. The four classes we see
here are, dataset, algorithm, preprocessing and prediction.
There is a relationship between the classes and the classifiers.
Fig 4: Data Flow Diagram – level 2
The arrow mark shows the dependency of classes on one
another.

IJISRT22JUN1219 www.ijisrt.com 1501


Volume 7, Issue 6, June – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
XIV. SEQUENCE DIAGRAM processes it and extract the necessary features. After the
comparison is done, the presence or absence of fire and gun
is established. The result is displayed on the screen. If there
is any danger, a SMS will be sent to the supervisor.

XVI. CONCLUSION

Fire hazards are very common in our day-to-day life and


the losses caused by them are quite high. Smoke detectors and
fire alarms are some of the methods used to notify people of
the disasters that are yet to occur. But, one drawback of these
things is, they sense danger only after it has spread to some
extent.

By paying attention to simple steps and being familiar


with obvious dangers, one can help to lower the likelihood of
accidental fires and hinder damage caused to the property or
even worse, loss of property. It mainly reduces the risk of
potential loss of life. Possession of fire arms is an offence and
this method helps us to detect it by minimizing the
Fig 7: Sequence Diagram
consequences.
This model represents the sequence diagram of the
Using this system will help us detect danger in the early
project. A sequence diagram is a kind of interaction schema
stages, which in turn reduces the loss of lives and property.
because it represents how and what type of objects work
together. Sequence diagrams are sometimes called as even
REFERENCES
diagrams or even scenarios. It represents the data exchange
between the user and the system.
[1]. Xinchu Huang, Lin Du. "Fire Detection and
Recognition Optimization Based on Virtual Reality
XV. ACTIVITY DIAGRAM
Video Image”, IEEE Access, 2020
[2]. P. Li and W. Zhao, ‘‘Image fire detection algorithms
based on convolutional neural networks,’’ Case Stud.
Thermal Eng., vol. 19, Jun. 2020, Art. no. 100625.
[3]. Ting Wei Hsu, Shreya Pare, Mahindra Singh Meena,
Deepak Kumar Jain, Dong Lin Li, Amit Saxena,
Mukesh Prasad and Chin Teng Lin “An Early Flame
Detection System Based on Image Block Threshold
Selection Using Knowledge of Local and Global
Feature Analysis” Optik, vol.158, pp. 127-141, Oct.
2020
[4]. R.Azhar, D.Tuwohingide, D.Kamudi, Sarimuddin, and
N.Suciati,‘‘Batik image classification using SIFT
feature extraction, bag of features and up port vector
machine’’ Procedia Comput. Sci., vol.72, no.1, pp. 24–
30, 2015.
[5]. Huanjie Tao, Xiaobo Lu. "Smoke Vehicle Detection
Based on Spatiotemporal Bag-Of-Features and
Professional Convolutional Neural Network”, IEEE
Transactions on Circuits and Systems for Video
Technology, 2020
[6]. Muhammad Alkaff, Husnul Khatimi, Nur Lathifah,
Yuslena Sari. "Sasirangan Motifs Classification using
Scale- Invariant Feature Transform (SIFT) and Support
Vector Machine (SVM)”, MATEC Web of
Conferences, 2019
[7]. Anita Ahmad Kasim, Retantyo Wardoyo, Agus
Fig 8: Activity Diagram
Harjoko. "Batik Classification with Artificial Neural
The activity diagram is an illustration of stage-by-stage Network Based on Texture-Shape Feature of Main
activities of the project. It shows the workflow from one Ornament”, International Journal of Intelligent Systems
activity to another. It loads the data from the camera, pre- and Applications, 2017

IJISRT22JUN1219 www.ijisrt.com 1502


Volume 7, Issue 6, June – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
[8]. S. M. Nemalidinne and D. Gupta, ‘‘Nonsubsampled
contourlet domain visible and infrared imagefusion
framework for fire detection using pulse coupled neural
network and spatial fuzzy clustering,’’FireSaf.J,
vol.101, pp. 84–101, Oct. 2018.
[9]. Q.-X. Zhang, G.-H. Lin, Y.-M. Zhang, G. Xu, and J.-J.
Wang, ‘‘Wild and forest fire smoke detection based on
faster R-CNN using synthetic smoke images,’’ Procedia
Eng., vol. 211, pp. 441–446, Jan. 2018.
[10]. P. Coppo, ‘‘Simulation of fire detection by infrared
imagers from geostationary satellites,’’ Remote Sens.
Environ., vol. 162, pp. 84–98, Jun. 2015.
[11]. C. Singh, E. Walia, and K. P. Kaur, ‘‘Enhancing color
image retrieval performance with feature fusion and
non-linear support vector machine classifier,’’ Optik,
vol. 158, pp. 127–141, Apr. 2018.
[12]. Y. Sun, C.Xu, G.Li, W.Xu, J.Kong, D.Jiang, B.Tao, and
D.Chen, ‘‘Intelligent human computer interaction based
on non-redundant EMG signal,’’ Alexandria Eng. J

IJISRT22JUN1219 www.ijisrt.com 1503

You might also like