0% found this document useful (0 votes)
215 views6 pages

Early Detection System For Gas Leakage and Fire in Smart Home Using Machine Learning

This document proposes a system to detect gas leaks and fires in smart homes using machine learning. The system collects sensor data through a wireless sensor network and gateway. It then analyzes the data using machine learning methods to correlate patterns between sensors and predict risks. If risks are detected, the system can automatically notify relevant people and emergency services. The goal is to provide early detection of gas leaks and fires to enhance safety.

Uploaded by

Sourav Debnath
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)
215 views6 pages

Early Detection System For Gas Leakage and Fire in Smart Home Using Machine Learning

This document proposes a system to detect gas leaks and fires in smart homes using machine learning. The system collects sensor data through a wireless sensor network and gateway. It then analyzes the data using machine learning methods to correlate patterns between sensors and predict risks. If risks are detected, the system can automatically notify relevant people and emergency services. The goal is to provide early detection of gas leaks and fires to enhance safety.

Uploaded by

Sourav Debnath
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/ 6

Early Detection System for Gas Leakage and Fire in

Smart Home Using Machine Learning


Lamine Salhi†, Thomas Silverston††, Taku Yamazaki†††, and Takumi Miyoshi†††, †
† Graduate School of Engineering and Science, Shibaura Institute of Technology, Saitama, Japan
†† SIT Research Laboratories, Shibaura Institute of Technology, Saitama, Japan
††† College of Systems Engineering and Science, Shibaura Institute of Technology, Saitama, Japan

Email: {mf17073, thomas, taku, miyoshi}@shibaura-it.ac.jp

Abstract — Making houses more inclusive, safer, resilient and local warning to anyone in the nearby place, with the
sustainable is an important requirement that must be achieved in assumption that someone will be around and can hear the
every society. Gas leakage and fires in smart houses are serious sound of the alarm [3]. However, with many residential
issues that are causing people’s death and properties losses. housing life style cases such as for couples and single
Currently, preventing and alerting systems are widely available.
residents who are almost outside home in work or in travel, as
However, they are generally individual units having elementary
functions without adequate capabilities of multi-sensing and well as, for people with special needs and elder people, a
interaction with the existing Machine-to-Machine (M2M) home remote notification system must be implemented to
network along with the outside networks such as Internet. Indeed, automatically alert the relevant persons, such as the
this communication paradigm will be clearly the most dominant in householder, his neighbors and the necessary emergency
the near future for M2M home networks. In this paper, we are services. Indeed, it should be great to have gas leakage and
proposing an efficient system model to integrate the gas leakage fire detection systems connected to Machine-to-Machine
and fire detection system into a centralized M2M home network (M2M) home networks as we can obtain more additional
using low cost devices. Then, through machine learning approach, services such as having automated pre-planned action and
we are involving a data mining method with the sensed information
remote warning systems.
and detect the abnormal air state changes in hidden patterns for
early prediction of the risk incidences. This work will help to Opportunely, with the drastic penetration of low cost
enhance safety and protect property in smart houses. embedded devices and Wireless Sensor Networks (WSN)
Keywords — smart home, gas leakage detection, fire detection, technologies, M2M communications may play a key role that
machine-to-machine, wireless sensor network, machine learning. can handle the previous cases preventing many incidences.
WSN is a current trend which is deployed to control and
monitor the physical environment by using sensor nodes [4].
I. INTRODUCTION
M2M connects between devices through WSN without (or
Gas leakage and fires in houses are causing many victims with minimum) human intervention. The devices collect
and property damages. For example, the natural gas leaks, useful information and then autonomously flow the data
which is highly flammable, increase the risk of fire and can between other devices up to the gateway. This can offer a
even provoke explosion. Furthermore, exposure to gas leak in panoply of new innovative services through the interaction
home or smoke inhalation can cause very serious respiratory with other smart home systems (e.g. aeration system, smart
complications. Indeed, the use of an early warning system gas, etc.), and furthermore provides Internet of Things (IoT)
results in significant reduction in losses. The sooner a gas or for wide range of services.
smoke is detected, the better the outcome for saving lives and
properties. Practically, smoke and fire detection devices are In this paper, we propose a novel approach in which we
considered the first line of defense against these issues. On the first deploy an M2M system prototype and collect the data
current market, most of these devices are standalone from devices. We then apply machine learning methods in
(individual units) and typically used as an immediate indicator order to correlate data between them and propose methods to
of fire incidence that generally issues a local audible or early detect disaster scenario with imminent fire or gas
visual alarm from the detector itself announcing that there is leakage, etc.
an emergency for evacuation [1,2].
The rest of the paper is organized as follows. In Section
Comparing to industrial domains where usually the gas II, we introduce our Architecture and describe the dataflow
leakage and fire detectors are permanently monitored and structure. Section III describes our experimental set up and
connected to local fire station, the current solutions in scenario, while Section IV presents the results of our
residential houses are very basic and work separately from any experiments. Section V surveys the related work, and finally,
communication to other systems, and satisfied only giving a Section VI conclude the paper and present some perspectives.
II. SYSTEM OVERVIEW
A. Architecture
In our system proposal, we considered that smart home
architecture (or home automation and control) includes pre-
integrated M2M solutions such as smart metering, lightning
control, door openers for example [5,6,7]. Furthermore, an
M2M data exchange among smart devices is guaranteed
without human intervention.

The objective of our system is to collect efficiently the


useful data and save it in a central point for farther prediction
analysis. As shown in Fig.1, the general system architecture in
our methodology consists of three main logical parts: node
layer, gateway layer, and application layer.
 Node layer: Two basic operations are provided in this
layer. First, sensors measure physical data in their indoor
environment, and send the various inputs data for
aggregation. The aggregation node combines the data into
a unique entity then send it through a low-power wireless Fig. 1. General System Overview
network (LPWN) such as ZigBee, Z-Wave, and
Bluetooth. This will help for minimizing the number of among the three layers of our architecture as well as with
transmissions and optimizing the energy consumption [8]. remote entities. The parameters for data acquisition step that
we considered in our study are: Air Temperature, Air
 Gateway layer: The gateway plays an important role in Humidity, Liquefied Petroleum Gas (LPG), Smoke, Carbon
the system. First, it collects the data from sensor devices monoxide (CO), Flame, and Carbone dioxide (CO2). After
(node layer); Second, the Gateway can be accessed sequentially receiving the sensed data, the aggregation node
remotely by end-user as control and monitoring system. merges the data and transmits them to the Gateway. Getting
Data is then analyzed by application layer. multi-sensing information at each period of time about the
environment is very important for an efficient analysis.
 Application layer: This layer serves as the interface
Afterward, we will proceed to the data analytics for
between M2M home network and M2M devices. The
predicting change of environment and anomalous scenarios.
main functionality of this layer is to analyze and correlate
One straightforward method for detecting incidences is to rely
data received from Gateway layer in order to detect
on predefined threshold values for our considered parameters.
anomalous pattern and to predict gas leakage and fire
However, in real-world environment, samples are often
incidences in smart home environment. Application layer
incomplete data set and some attribute values can be missing
can provide additional services such as local remote
or inconsistent because of data collection process issues
notification.
(packet lost, noise, etc.). Note that there is also a data
Several applications can be included offering a user- preprocessing step to improve its quality, and we will discuss
friendly interface with some typical services such as further this point in the Discussion Section. For being more
monitoring, local alerting and remote notification. An efficient and improve the performances over time, we are
emergency operations plan implement is required to prevent going to use a supervised machine learning for patterns
disasters and maintain safety in house. This will involve the recognition [9-11]. Then, our main objective consists of
autonomous interaction with: (1) local systems such as smart predicting unseen information and deciding the level of risks.
aeration and smart gas, (2) the relevant persons such as the In order to achieve the next logical step in case of
householders and the neighbors, (3) the emergency services
predicting any irregular pattern, a warning system must be
such as local fire station and hospitals in case of imminent activated to notify the relevant persons that some actions are
incidents.
advised. In case of estimating a high risk of incidence or an
imminent disaster the level of alert became more important.
B. Data flow system As result, an action plan will be immediately initiated and
We are going to focus on the trend of the relevant factors M2M local systems will be trigged. It will be time to notify
related to gas leakage and fire incidences in smart home. In the necessary relevant persons and emergency services for
the figure below (Fig. 2), we are detailing the dataflow model evacuation.
Fig. 3. The devices and steps of our prototype system during experiment

Table I summarizes the low cost and low energy


consumption sensors used during our experiments.
TABLE I. THE USED DEVICES AND PROTOCOLS
N⁰ Measurements Sensors Units
1 Temperature ⁰C
DHT-11
2 Humidity %
3 Smoke PPM (Parts per million)
4 LPG MQ-2 PPM (Parts per million)
5 CO PPM (Parts per million)
Fig.2. Data flow model for our experimental study
6 Flame LM35 Flame level
III. EXPERIMENT 7 CO2 MG-811 PPM (Parts per Million)

We implemented a prototype for our early-detection In order to collect pertaining data, our experiments have
system in smart-home environment. Our prototype collects been conducted during a couple of days. The sensors have
data through four sensors. This included air temperature, air been exposed to different conditions, sensing data from
humidity, smoke, LPG, CO, flame and CO2. regular ambient condition to more extreme conditions with gas
and fire. The aggregation node transmitted continuously and
 As shown in Fig.3(a), an Arduino Uno R3 device [12] is periodically data every 5 seconds. The sensors have been
used to aggregate the data from sensors. The Zigbee configured with their default parameter values that served as a
protocol [13] is also used for communications among baseline for comparisons with different conditions.
devices. We also have tested the efficiency of our prototype, and
implemented a notification service through emails and Line
 Then, a Raspberry Pi 3 Model B device [14] is used as Messaging API for alerting pertaining persons.
M2M gateway to receive the sensed information as
depicted in Fig.3(b). Zigbee interface is used for joining Furthermore, the interaction with other systems such as
the corresponding WSN nodes. The data received is smart aeration and smart gas systems was presented through
handled by creating topics and using publish/subscribe the second edge node containing some actuators as output in
methods through Message Queuing Telemetry Transport case of incidence (e.g. Fans, LEDs).
(MQTT) protocol [15]. A graphical user interface (GUI) IV. RESULTS
for monitoring as well as a (local/remote) notification A. Data acquisition
systems are built. During data acquisition, we collected during 1.5 days
21,146 sample measures from the sensors. Each sample counts
 Finally, a second Arduino Uno R3 device, as shown in
7 values, i.e., one value by sensor. Every sample have been
Fig.3(c), is used for emulating the triggered functions
collected periodically every 5s. The data have been collected
ordered by the gateway in case of incidence.
under usual and extreme conditions engendering risks.
Fig. 4 presents our experiment in regular conditions. All Table II provides a comparison between the range of
the sensed data was relatively stable over time. For instance, values under normal and extreme conditions.
Temperature presents a typical day/night pattern with peak
TABLE II. THE RANGE OF VALUES UNDER REGULAR AND EXTREME
above 30°C as it is commonly the case in Japan in summer. CONDITIONS
This experiment is to serve as a comparison baseline to predict
anomalous pattern during extreme conditions. The range Ranges in Min/Max values in Tendency in
Parameters
Regular conditions Extreme conditions Extreme conditions
values for regular conditions are presented in Table II.
Temperature 25-35 C⁰ 60 °C (*) Increase
Humidity 60-70 % 0% Decrease
LPG 0-30 PPM 63,898 PPM Increase
CO 0-50 PPM 65,280 PPM Increase
Smoke 0-100 PPM 65,395 PPM Increase
Flame 400-500 65,835 Increase
CO2 400-500 PPM 38 PPM Decrease
(*)
Maximal value allowed by DHT-11 sensor

B. Machine Learning Classification


We obtained from previous experiments a data set
measuring environment under regular or extreme conditions.
We therefore aim at correlating these data in order to detect
specific pattern. This will help inferring abnormal pattern in
Fig.4. Measurments taken in usual conditions
the data and predict disasters such as fire or gas leakage. To
The Figure 5 presents our experiment under extreme this end, we will rely on Machine Learning methods and
conditions (Fire). The experiment starts from regular applied different algorithms to our data set.
conditions (no fire), and then at 23:58, we can observe a
dramatic increase of CO, LPG, and smoke, along with a slight Supervised learning method will be used to build a model
decrease of CO2 (38 PPM). In the meantime, Temperature from the training data. Our data set will be labelled and when
increases progressively and reach up to 60°C. The temperature similar condition occurs again, one can set the level of risks
then stabilizes at 00:34 as it reaches the physical limit of the and prevent disaster. We then will classify our data set
sensor. Conversely, Humidity increases first and reaches up to according to four level risks: (0) no risk, (1) moderate risk, (2)
85%, and then it decreases drastically up to 0% when risk, and (3) high risk). We then separate our Data set into two
Temperature was maximal. From now, the presence of flames parts: 80% for training and the remaining 20% for validation.
has also been detected. At 00:34, Gas and Smoke become too In order to obtain better accuracy score, we also used a 10-fold
low to be detected by sensors. Finally, from 00:48, the fire cross validation. In this case, the training dataset is divided
ended and all the metrics return to the regular ranges as again into 10 equal parts: nine for training and one for testing.
observed in Fig. 4.
It is important to compare the performance of multiple
different machine learning algorithms consistently. In this
study, 6 classification algorithms have been evaluated with
our Data Set: Logistic Regression (LR), Linear Discriminant
Analysis (LDA), K-Nearest Neighbors (KNN), Classification
and Regression Trees (CART), Gaussian Naive Bayes (NB),
and Support Vector Machines (SVM).

Fig.6 gives a box and whisker plot showing the spread of


the accuracy scores across each cross validation fold for each
algorithm. We can observe from these results that CART has
the largest estimated score for our data set with more than
99.93% of accuracy. Which means that CART is worthy of
further study on our problem. It indicates also that KNN with
99.71% of accuracy can be a good candidate for our study
comparing to the rest of algorithms
Fig.5. Measurments taken under extreme conditions
positive with regards to predicted level of risks. In Fig.8, the
confusion matrix shows that there is a limited number of false
positive in the evaluation except the 4 errors (True Label 1 –
Predicted Label 0 and Predicted label 2). This means for our
results that they are inaccurately classified and can be source
of wrong prediction of risk.
3964 0 0 0
0
100% 0% 0% 0% True Positive (TP)
1 117 3 0
1

True label
0.8% %97 2.5% 0% Correct predictions
Fig.6. The different algorithms score comparison. 0 0 157 0
2
0% 0% 100% % Erroneous predictions
C. Discussion 3
0 0 0 18
0% 0% 0% 100%
Sensors can measure wrong information or miss
0 1 2 3
collecting the information due to the extreme conditions or Predicted label
data losses. For instance, when sensors are exposed to high Fig.8. The confusion matrix of the model.
temperature or flame. These loss of information can be critical The classification report given in the following table
for the accuracy of our system. We then provide an analysis to (Table III) provides more details of each class by precision,
minimize the impact of false values. recall, f1-score and support showing excellent results.
As a first solution, one can delete entries from our dataset TABLE III. THE CLASSIFICATION REPORT
corresponding to any missing or wrong values (sample with Risk Precision Recall f1-score Support
missing values). Figure 7 presents the accuracy of evaluated 0 1.00 1.00 1.00 3964
algorithms with the initial data set and the data set whose 1 1.00 0.97 0.98 121
missing values have been deleted. Deleting missing data helps 2 0.98 1.00 0.99 157
indeed increasing the accuracy score. However, there is a risk 3 1.00 1.00 1.00 18
to remove too many samples and therefore losing valuable Avg. / Total 1.00 1.00 1.00 4260
information that our classifier needs to differentiate between V. RELATED WORK
classes of risks and can lead to a non-reliable analysis. Thus, Some efforts have been conducted in terms of detecting
as another solution, the mean imputation technique can be and preventing smoke and fire in smart-home environment. In
used to estimate the values of each missing data. The mean particular, Chen et al. [1] have presented a fire sensor system
values are computed in the training data set and missing data based on the simultaneous detection of CO, CO2, and smoke
is replaced by this computed mean value. As shown in Fig.7, concentrations. Islam et al. [2] proposed an application for
the accuracy score is improved compared with initial data set automating standalone smoke alarms for remote notifications.
and the entire data set is maintained, which means that our This decreases the time delay between a fire incidence and the
classifier still has sufficient amount of data to learn classify notification to relevant persons or emergency services. Ayyubi
our data set. et al. [3] proposed an enhanced design of a wireless control
system for smoke and fire detection with alarming provision
and messages notification systems. A home based fire
monitoring and warning system for home owners primarily
has also been implemented [16]. Tao et al. [17] proposed a
smoke detection based on deep convolutional neural networks
from visual scenes. In [18], an adaptive threshold deep
learning method for fire and smoke detection was proposed, in
which authors has proposed a novel method for fire and smoke
detection using video images. Solorzano et al. [19] proposed a
fire detection using a gas sensor array with sensor fusion
algorithms. A fuzzy logic approach for event detection using
Fig.7. Handling the missing values. wireless sensor network was proposed by [20]. Similarly, [21-
From previous evaluations, CART algorithm is the most 23] have also used the same logic to combine data coming
accurate for our data set. Then, we evaluate the accuracy of from many sensors for getting the probability for fire occur-
the CART algorithm more precisely. Confusion matrix is a rences. Finally, Yan-Hua et al. [24] adopted the back
way to present in a table different predictions and test results propagation neural network algorithm of multi-sensor data
and contrasts them with real-world values. It outlines the true fusion approach for fire alarm.
Our work differs from previous ones as we are proposing [5] D. Boswarthick, O. Elloumi and O. Hersent; “M2M
an effective implementation of a preventive system for gas Communications: A Systems Approach,” Published by John
leakage and fire incidences in smart home environment which Wiley & Sons Ltd, April 30, 2012
is natively including an improved monitoring and warning [6] ETSI, “Machine-to-Machine Communications (M2M); M2M
system comparing to [1-3] and [16]. Then, instead of focusing service requirements,” ETSI TS 102 689 V2.1.1 (2013-07)
on visual scenes to detect smoke and fire, we are looking in [7] M. Chen, J. Wan, S. Gonzalez, X. Liao and V. Leung, “A sur-
our study for detecting these incidences in earlier stages as an vey of recent developments in home M2M networks,” IEEE
assertive method using other data inputs such as gas and Communications Surveys & Tutorials (Vol. 16, Issue: 1, First
temperature which are not considered in [17] and [18]. Quarter 2014)
Furthermore, comparing to [19-24] we are using additional [8] B. Krishnamachari, D. Estrin, and S.B. Wicker, “Modeling
sensors for obtaining more precise condition and from many data-centric routing in wireless sensor networks,” USC
vantage points. Finally, although we are involving machine Comput. Eng. Tech. Rep. CENG 02-14, Oct. 2002
learning methods for combining the multi-sensed data [9] A. Smola and S.V.N. Vishwanathan, “Introduction to Machine
Learning,” Cambridge University Press 2008
similarly to these studies, this work presents the particularity
[10] C.M. Bishop, “Pattern recognition and machine learning,”
of treating the missing values for reducing the false alerts and
Information Science and Statistics, Springer, 2006
improving the prediction performance.
[11] S. Raschka, and V. Mirjalili, “Python Machine Learning,
VI. CONCLUSION Second Edition,”, Pub. by Packt Publishing Ltd. Sep. 2017
[12] Arduino, https://www.arduino.cc
In this paper, we have contributed in the way of
[13] Zigbee Alliance, http://www.zigbee.org
integrating gas leakage and fire systems within smart home
[14] Raspberry Pi, https://www.raspberrypi.org
environment in order to enhance safety using low-cost and
[15] MQTT.org, http://mqtt.org
less-energy consumption devices through M2M standard
[16] S. Suresh, S. Yuthika, and G.A. Vardhini, “Home based fire
communication protocols. We proposed an effective dataflow monitoring and warning system,” 2016 Int. Conf. ICT in
system for gathering useful information to a central point in Business Ind. & Gov. (ICTBIG), Indore, India, April 2016
M2M home network. We deployed our system prototype with [17] C. Tao, J. Zhang, and P. Wang, “Smoke detection based on
sensors and perform experiments under different conditions. deep convolutional neural networks,” Int. Conf. Ind. Inform. –
From our data set, we applied a supervised machine learning Comput. Technol., Intell. Technol., Ind. Inf. Integration
process on several algorithms for observing events which are (ICIICII), pp.150-153, Wuhan, China, Dec. 2016
not conform to the expected pattern, and predicting the level [18] X. Wu, X. Lu, and H. Leung, “An adaptive threshold deep
of risks of danger. Our system is also able to send a learning method for fire and smoke Detection,” 2017 IEEE Int.
notification to alert relevant persons and proceed accordingly. Conf. Syst., Man, and Cybern. (SMC), pp.1954-1959, Banff,
In future, we will collect more additional data and apply Canada, Oct. 2017
other machine learning algorithms to improve the accurate of [19] A. Solórzano, J. Fonollosa, L. Fernández, J. Eichmann, and S.
the model to reduce the false positive. We have also the trend Marco, “Fire detection using a gas sensor array with sensor
toward real-time analysis using cloud services. fusion algorithms,” 2017 ISOCS/IEEE Int. Symp. Olfaction
and Electron. Nose (ISOEN), Montreal, Canada, May 2017.
ACKNOWLEDGMENT [20] P. Manjunatha, A.K. Verma, and A. Srividya, “Multi-sensor
I would like to express my special thanks of gratitude to data fusion in cluster based wireless sensor networks using
my MINET Laboratory’s colleagues who gave me a great and fuzzy logic method,” IEEE R10 and 3rd Int. Conf. Ind. Inf.
Syst., Kharagpur, India, Dec. 2008
considerable support.
[21] V. Khanna and R.K. Cheema, “Fire detection mechanism using
REFERENCES fuzzy logic,” Int. J. Comput. Appl., vol.65, no.12, pp.5-9,
[1] S.J. Chen, D.C. Hovde, K.A. Peterson, and A.W. Marshall March 2013
“Fire detection using smoke and gas sensors,” Fire Safety J., [22] K. Kumar, N. Sen, S. Azid, and U. Mehta, “A fuzzy decision in
vol.42, issue 8, pp.507-515, Nov. 2007 smart fire and home security system,” in Proc. Of Comput. Sci.,
[2] T. Islam, S. A. Abdullah, and G. Sarowar, “Enhanced Wireless vol.105, pp.93-98, 2017
Control System for Smoke and Fire Detection,” Int. J. Comput. [23] F.A. Saputra, M.U.H.A. Rasyid, and B.A. Abiantoro,
and Electr. Eng., vol.5, no.2, pp.233-236, April 2013 “Prototype of early fire detection system for home monitoring
[3] S. Ayyubi, Y. Miao, and H. Shi, “Automating standalone based on wireless sensor network,” Int. Elec. Symp. Eng. Tech.
smoke alarms for early remote notifications,” 13th Int. Conf. and Appl. (IES-ETA), pp.39-44, Surabaya, Indonesia, Sept.
Control, Autom., Robot., and Vision (ICARCV), pp.675-680, 2017
Marina Bay Sands, Singapore, Dec. 2014 [24] L. Yan-hua, and T. Wei-min, “Multi-Sensor Fusion Approach
[4] R. Faludi, “Building Wireless Sensor Networks,” Published by for Fire Alarm using BP Neural Network,” Int. Conf. on
O’Reilly Media, 2011 Intelligent Net. & Collaborative Sys. (INCoS), pp.99-102, 2016

You might also like