An IoT Based Fire Image Recognition for Home Industry Security Using Machine Learning
An IoT Based Fire Image Recognition for Home Industry Security Using Machine Learning
---------------------------------------------------------------------------------------------------------------------------------------
Submitted: 05-02-2022 Revised: 14-02-2022 Accepted: 17-02-2022
----------------------------------------------------------------------------------------------------------------
ABSTRACT - This paper presents the development tremendously improved on the intelligence of smart
of Internet of Things (IoT) based fire image security systems in recent times [4].Most of the
recognition for home/industry security using Machine security problems that require machines are now
learning. Fireoutbreaks have ravaged homes, solved easily by applying IoT and machine learning
industries, banks, hospitals, organizations etc., and together. Security has become the talk of the day in
kept a lot of people homeless. Government agencies, every field of life. People have been recruited to
security agencies, and even private organizations seek monitor and raise alarm but to no avail. Most
to make their assets safe and to restrictaccess to areas companies have also used fire detectors which
that could pose dangers. In the same vein, individuals basically detects the presence of carbon II oxide or
have also sought reliable ways to keep their homes increase in temperature and send an alert when set
safe and alert themselves of any impending danger. limits are exceeded.
Hence, this work is aimed to address the challenges
posed by fire outbreaks using IoT-based Machine II. REVIEW OF RELATED WORKS
learning techniques. The IoT system comprises both The authors in [5], presented a computer
hardware and software. Raspberry Pi and other vision-based fire detection algorithm. Fire
components were selected to handle the detecting and colourmodelling and motion detection were used for
capturing part of the fire images. For fire image thefire detection algorithm.TheFire colour model was
recognition,Raspberry Pi sends captures the fire tested with ten diverse video sequences including
imagesand sends them to the Google Cloud Vision different types of fire. The experimental results
APIwhich calls a pre-trained model to recognize any showed correct classification of fire pixels according
hazard in the image. The pre-trained model predicts to colour information only.In [6, 7],Convolutional
with high percentage confidence and sendsto the Neural Networks Based Fire Detection in
mobile phone of the homeowner/personnel on duty Surveillance Videos was implemented. They
for necessary action. deployed Google Net and fine-tuned it according to
Keywords— Home Security,IoT, Machine Learning, the targeted problem with fire data. Experimental
Raspberry PI, Google cloud, Image Recognition results revealed the effectiveness of the chosen
framework and its suitability for fire detection in
I. INTRODUCTION CCTV surveillance systems.
Fire outbreak is a common issue happening A wireless sensor network using multiple
everywhere and the damage caused by this type of sensors for early detection of house fires wasdesigned
incidence is tremendous [1]. Homes, Industries, and simulated by the authors in [8]. They used Global
Organizations, Hospitals, Banks etc. have been System for Mobile Communications (GSM) to alert
experiencing fire outbreak times without numbers. personnel on duty to avoid false alarms. Fire
Many researchers are involved in early warning Dynamics Simulator was used to simulate the fire in a
systems, which considerably minimize the smart home to test the results. The simulation results
consequences of fire damage [2]. It is important for showed that the system is able to detect early fire,
fire detectors to operate quickly in the event of a fire, even when a sensor is not working while keeping the
but existing conventional fire detectors sometimes do energy consumption of the sensors at an acceptable
not work properly or there are problems where non- level
fire or false reporting occurs frequently [3]. Machine The work in [9], is on a dependable Fire
Learning, a subset ofArtificial Intelligence (AI)has Detection System with Multifunctional Artificial
DOI: 10.35629/5252-0402834842 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 834
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
Intelligence Framework. The framework includes a RCNN, R–FCN, SSD, and YOLO v3) [14-16].
set of multiple machine learning algorithms and an YOLO v3 achieved 83.7% accuracy which
adaptive fuzzy algorithm. They introduced Direct- outperformed other models when compared. The
MQTT based on SDN to solve the traffic authors in [17-19] worked on the extraction and
concentration problems of the traditional MQTT. The classification of image features for fire recognition
system performance on fire detection accuracy and based on a convolutional neural network (CNN). A
delay time was over 95%. The transfer and decision Gaussian mixture model was used to extract features
delays between devices were reduced by an average from the fire smoke movement areas to improve the
of 72%.In [10], a machine learning techniques efficiency of image analysis. Experiments results
method for Multimedia Surveillance during fire proved that the system was feasible and effective.
emergencies was proposed. They used a hybrid model The works, [20-23], were on real-time video-based
made of Adaboost and many Multi-layer perceptron fire and smoke detection using CNN YOLO v2 in
(MLP) neural networks in their work. The hybrid anti-fire surveillance systems. The training stage was
Adaboost-MLP model was used to predict fire processed off-line with indoor and outdoor fire and
efficiently. This model used different sensors data smoke image sets in different indoor and outdoor.
like smoke, heat, and gas for training. After The trained model was deployed in a low-cost
predicting the fire, the CNN model was called to embedded device (Jetson Nano). The experimental
detect the fire immediately. The test results show that results showed that the model is suitable for creating
the trained model has near 91% fire detection a smart and real-time video-surveillance system for
accuracy while false-positive results were quite low. fire/smoke detection. Deep –Learning (YOLOv4)
The authors in [11] presented forest fire Based Approach was developed for Smart City
image recognition based on convolutional neural Environment in [24, 25]. The method successfully
networks. An adaptive pooling approach was detected and notified the incidence of disastrous fires
introduced in their work. Experiments show that the with a high speed and accuracy in different weather
convolutional neural network method based on the environments—sunny or cloudy, day or night.
adaptive pooling method has better performance and Experimental results revealed that the method can be
has higher recognition rate.In [12,13], an Integrated used successfully for the protection of smart cities
Fire Detection System using IoT and Image and in monitoring fires in urban areas.
Processing Technique for Smart Cities was designed.
Their system combined wireless sensor technologies, III. SYSTEM DESIGN METHODOLOGY
UAVs, and cloud computing to achieve its aim. Some The system is made up of hardware and software. The
image processing techniques and rules were design method adopted for hardware is prototyping
integrated into the fire detection system to identify while agile methodology for software designs.
the fire event with better results. The simulation A. IoT Hardware
results of the fire detection system were compared The IoT hardware comprises of Raspberry Pi 3, IP
with several existing methods and observed a higher camera, Wireless Router, Speaker, +5v power supply,
fire detection rate from 95 to 98 percent. Wi-Fi adapter, OTG cable, memory SD card and 5V
Image fire detection algorithms based on DC infrared lightas shown in figure 1.
Convolution neural network was developed using
four advanced object detection CNN models (Faster-
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 835
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
IP camera is used for fire image capturing. speaker is used to alert the user before sendinga
The wireless Router provides the internet message to the user’s mobile phone. 5V DC power
connectivity and Wi-Fi adapter used to connect the adapter provides 5V Dc voltage to the system to
raspberry pi to the wireless router for internet access. function. The block diagram of the IoT system is
SD card is used to store the captured fire images. The shown in figure 2.
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 836
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
Figure 2: Block diagram of the IoT system for fire detection and capturing
B. System Implementation Tools Used library used to address the GPIO (General
The Raspbian JessiePixel is used to provide Purpose Input Output) pins of the raspberry pi.
desktop view and command-line interface. C. Algorithm and Flow Chart of Fire Image
The SD Card Formatter is used to format the Recognition
microSD card on which the Raspbian image is The step-by-stepprocesses used to achieve the image
mounted on. recognition via the raspberry pi are written below
Etcher software is used to write the Raspbian and flow chart diagram shown in figure 3.
image to the Raspberry Pi microSD card. Raspbian OS image isdownloaded from internet
Putty is a tool used to connect to the command- SD Card formatter is used to format the microSD
line interface (CLI) of the raspberry pi through a Card in order to prepare it for the mounting of
protocol known as SSH (Secure Shell). the Raspbian OS image.
VNC Viewer is a Windows-based application Etcher Software is used to burn the image file to
used to provide system developer access for the microSD Card
viewing the X windows of the raspberry pi After the image has been burnt into the microSD
Google Cloud Vision API is a Computer vision Card, it is then mounted into the Raspberry Pi
cloud-based machine learning resource provided and the Pi is powered up.
by Google for machine learning activities. It was All the peripherals are then attached to the USB
chosen because the model was trained using a hub
very robust data set provided by Google with After the raspberry pi zero is connected to a
high accuracy. wireless network, the firmware is updated and
BASHis a shell scripting language used to upgraded.
automate tasks in the host computer. BASH The Google Cloud Vision API is downloaded
script is used to actuate the Python program as from gitHub.
soon as the Raspberry Pi boots up. All the source files are built using the Cmake
Python is the main programming language used tool
in this research work because of its rich libraries Thereafter, the training phase is launched. Here a
for image processing and machine language. user captures as many images as possible into a
GPIO libraryis an open-source Python based folder.
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 837
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
The folder is then used to train the controller and The enrolment phase is complete
various parameters are assigned to a file that is Finally, a python script is written to integrate the
generated. This file contains all the features of whole system and trigger the speaker when it
the images which have just been trained recognizes a security-threatening image.
D. IoT System operations The camera captures real-time video stream but
The following steps are used by the system to detect does not saveit
the fire, capture the image and send it to the Google The infra-red light automatically gets activated
cloud server for recognition: on sensing low light
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 838
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
The python script processes the video frame by registered email address on the system.
frame to determine if there is motion The process repeats till the system is deactivated.
If motion is detected, the camera captures a E. IoT System Test Conducted
frame and saves it as an image locally then sends The prototype of the image recognition
this image to Google cloud servers for system designed was first setup on a bread board. The
processing. microSDcard contains the Rasbian OS and all the
The result is returned from the servers within necessary software for image recognition. A power
seconds and the program parses this result to bank was used to supply power to the raspberry pi
search for labels that have been pre-enrolled as and mobilehotspot configured to provides internet
threats. connectivity to the raspberry pi. The Raspberry Pi
The program returns these labels with a degree of Camera was connected properly as an image input
certainty expressed in percentage. device. Before the system is powered up, all the
If the returned percentage reaches the threshold connections were made and all the peripherals
percentage already set, the speaker is triggered to attached appropriately. The system powered up and
sound an alarm. An email is also sent to the tests carriedout as shown in the setup of figure 4.
After system setup was successfully done, the would recognize them. Other objects were also
following tests were conducted: brought to the camera to see if the system would give
Hardware Tests false positives.
Vout pin was tested to ensure that it supplies
the power required; i.e., 5V for its functionality. The IV. RESULTS OBTAINED
ground pin was tested to ensure that it is at zero Various experiments were performed to test
potential.After the components were soldered to the the robustness of the developed system in order to
Vero board, a meter was used to check for continuity measure its accuracy. A paper was set on fire close to
to avoid a short circuit. The brightness and quality of the IP camerato simulate a fire outbreak. Also, a
the raspberry camera were tested in various rooms lighter was used to ignite the fire to cause an
light conditions to ensure that itsfunction optimally outbreak. Here are various conditions by which the
for hazard detection. The results varied in different hazard detection system was tested:
brightness levels and an infra-red was mounted on the Recognition in a well-lit environment when the
system to improve on the brightness conditions of object is at a close distance (<100cm)
rooms that are poorly lighted. Recognition in a well-lit environment when the
Software Tests object is at mid-distance (100cm<x<500cm)
Image Detection Test: After the application Recognition in a well-lit environment when the
was launched, the ―activate‖ command was entered. object is at a far distance (>500cm)
This results in the system detecting an object in front Recognition in a dark environment when the
of it and immediately startingthe required analysis. object is at a close distance (<100cm)
Enrollment: The characteristics of the hazards Recognition in a dark environment when
captured by the system using the camera were saved object is at a mid-distance (100cm<x<500cm)
in a folder. This was used to train the raspberry pi. Recognition in a dark environment when the
Recognition Test: The previously enrolled threats object is at a far distance (>500cm)
were simulated and observed to see if the system
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 839
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
Figure5 represents the results of how well the IoT system could perform on 150 test samples under different
conditions. Table 1 shows the statistics of the success rate of hazard detection.
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 840
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 841
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 2 Feb 2022, pp: 834-842 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-0402790802 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 842