You are on page 1of 7

Available online at www.sciencedirect.

com

ScienceDirect
Procedia Computer Science 134 (2018) 114–120

The 15th International Conference on Mobile Systems and Pervasive Computing


(MobiSPC 2018)

Towards a Real-time Occupancy Detection Approach for Smart


Buildings
H. Elkhoukhia,b,*, Y. NaitMaleka,c, A. Berouinea,c, M. Bakhouyaa, D. Elouadghirib,
M. Essaaidic
a
International University of Rabat
Faculty of Computing and Logistics, TICLab, Sala El Jadida, Morocco
{hamza.elkhoukhi, youssef.nait-malek anass.berouine,
mohamed.bakhouya}@uir.ac.ma bUniversité My Ismail, Faculté des sciences, 11201
Zitoune, Meknès – Morocco cENSIAS, Mohamed V University,Rabat, Morocco
essaaidi@ieee.org

Abstract

Context-awareness has been considered as a crucial fact for developing context-driven control approaches in which sensing, and
actuation tasks are performed according to the contextual changes. This could be done by including the occupants’ presence,
number, actions and behaviours in up-to-date context taking into account the complex interlinked elements, situations, processes,
and their dynamics. Many recent studies have shown that occupants’ information is a major leading source of uncertainty when
developing occupancy-driven control approaches for energy efficient buildings. Comprehensive and real-time fine-grained
occupancy information has to be, therefore, integrated in order to improve the performance of these control approaches. The work
presented in this paper is towards the development of a holistic platform that combines recent IoT and Big data technologies for
real-time occupancy detection. We focus mainly on occupants’ presence by comparing static and dynamic machine learning
techniques. Experiments have been conducted and results are presented to assess the usefulness of the platform and the
effectiveness of real-time machine learning strategies for data streams processing.
© 2018 The Authors. Published by Elsevier Ltd.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/)
Peer-review under responsibility of the scientific committee of the 13th International Conference on Future Networks and
Communications, FNC-2018 and the 15th International Conference on Mobile Systems and Pervasive Computing, MobiSPC 2018.
Keywords: IoT, Big Data, Context-awareness, smart buildings, machine learning;

* Corresponding author. Tel.: +212-605-537-314.


E-mail address: hamza.elkhoukhi@gmail.com

1877-0509 © 2018 The Authors. Published by Elsevier Ltd.


This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/)
Peer-review under responsibility of the scientific committee of the 13th International Conference on Future Networks and
Communications, FNC-2018 and the 15th International Conference on Mobile Systems and Pervasive Computing, MobiSPC 2018.
10.1016/j.procs.2018.07.151
H. Elkhoukhi et al. / Procedia Computer Science 134 (2018) 114–120 11

1. Introduction

Recent studies have shown that occupant information (e.g., number, presence, behavior, activities) is a major
input for control approaches in energy efficient buildings [1,2,3]. In fact, comprehensive fine-grained occupancy
information could be integrated to improve the performance of occupancy-driven control of HVAC, lighting, and
ventilation systems. Occupancy information can be classified into two main categories as follows. Spatial and
temporal properties provide information about occupants’ physical information, while the behavioral properties
provide information about occupants’ activities [4]. For instance, carbon dioxide devices sensors are commonly used
in buildings for demand-driven control of ventilation systems because they can infer an estimate of space occupancy.
Furthermore, the carbon dioxide (CO2) concentration is often available in monitored indoor environment in order to
assess the indoor air quality. Mainly, the measurement of the amount of CO2 in a space was considered as a main
indicator for occupancy prediction [5].
Many research works have stated that accurate occupancy detection can be achieved by fusing a multi-sensor
data, such as CO2, temperature, humidity, sound, motion sensors [1, 6, 7]. In fact, accurate detection of the actual
occupancy could help in developing context-driven control approaches in which sensing, and actuation tasks are
performed according to the contextual changes. Furthermore, with recent advances in wireless sensors networks,
many industries and researchers have confirmed the potential of IoT as an enabler to the development of intelligent
and context-aware services and applications [8,9,10]. These services could dynamically react to the environment
changes and users’ preferences. For instance, in the context of smart buildings, occupancy information could be used
for controlling window opening and shading, HVAC [11,12], and Lighting [13] with the aim is to decrease energy
consumption while maintaining visual, air quality and thermal comfort of buildings’ occupants. However, handling
dynamic and frequent context changes is a difficult task without real-time event/data acquisition and processing
platforms [14].
In this work, we investigate the integration of machine learning algorithms for occupancy detection, mainly the
occupants’ presence, which we have used for controlling ventilation systems. We have integrated SAMOA platform
(Scalable Advanced Massive Online Analysis), which was developed mainly for mining big data streams [15]. It’s
worth noting that, to the best of our knowledge, the work presented in [15] is considered as a pioneering work in the
domain of distributed and real-time machine learning on streaming data. The focus of our work is to shed more light
on the usefulness of integrating recent IoT, Big Data technologies, and real-time machine learning algorithms for
occupant’s presence detection.
The remainder of this paper is structured as follows. Section 2 presents recent work related to occupancy
detection algorithms. In Section 3, the architecture of the holistic platform is introduced. Section 4 shows the
efficiency of dynamic detection of occupants’ presence when using real-time machine learning compared to static
approaches. Conclusions and some perspectives are given in Section 5.

2. Related work

IoT technologies have been recently developed in order to connect a variety of building sub-systems along with
other environmental & contextual sensors, such as CO2, temperature, humidity and motion sensors. This will allow
monitoring and collecting useful building’s information that could be used for occupancy detection purposes [16,
17]. In fact, instantaneous indoor occupancy information in buildings becomes a major factor to improve occupants’
comfort and to greatly save and reduce energy consumption by developing optimal control approaches of HVAC
and lighting systems [18].
Recent studies show that combining these technologies with a various existing machine learning approaches (e.g.,
classification algorithms) can significantly improve occupancy detection accuracy by making data-driven prediction
through establishing an occupancy model from a sample inputs [19,20,21] (i.e. CO2, Temperature, Humidity, Light).
For example, authors in [7] used electricity consumption data sets gathered from smart electricity meters in five
households to train classification models based on support vector machines (SVM), K-nearest neighbor (KNN),
thresholding (THR) and hidden markov model (HMM) in order to detect the presence of occupants. The reported
accuracy was above 80% compared to the truth occupancy, which was obtained using a tablet computer installed in
the main entrance in order to record the true values of occupants’ presence.
In [22], authors applied different statistical classification models, mainly LDA (Linear Discriminant Analysis),
CART (Classification And Regression Trees) and RF (Random Forest) on the dataset that contains light,
temperature, humidity, CO2 values. They have shown that including information related to the time of the day and
week status (weekend, weekdays) increased the accuracy of occupancy detection by 32% with high accuracies
(around 97%) by using only two predictors. However, the ground truth was obtained by using a digital camera for
supervised classification model training. Authors in [23] applied seven different Artificial Neural Network
algorithms on the same dataset used in [22] to train the classifiers model. The result showed that the Limited
Memory Quasi-Newton algorithm has the highest accuracy rate with 99.061%. In the work presented in [24],
authors proposed an approach for accurate occupancy estimation based on a wireless sensor network, which
combines environmental sensors with uncertain contextual information. The study also used SVM and K-nearest
neighbor to train the classifiers models.
In [25], a model of occupancy detection was evaluated in a single occupancy room using twelve ambient sensors
variables to train six machine learning classification algorithms: SVM, KNN, Artificial Neural network (ANN),
Naõve Bayesian (NB), Tree Augmented Naõve Bayes Network (TAN), and Decision Tree (DT). The authors found
that CO2, door status and light variables have important contributions to the final modeling results. The model
accuracy ranged from 92.2% to 98.2% according to the used classifier algorithm. A predictive model from electricity
and water consumption data was evaluated using Monte Carlo simulations [26]. Authors found that the Random
Forest and Decision Tree classifiers model under their boosting version had the best classification performance with
an F-measure of 83.37% and 82.79%, respectively. The truth occupancy was found using a door counter sensor. In
[27], authors proposed an approach based on data from thermal energy storage of electric water heaters to train
classifiers model.
However, despite the importance of these algorithms in detecting occupancy from both static and stream data,
dynamic and real-time detection approaches are required to be applied in near real-time, for example in HVAC and
ventilation control. The integration of IoT and Big data technologies into a holistic platform together with machine
learning algorithms could enable new potentials in smart buildings for real-time occupancy detection. The work
presented in this paper investigates this research direction by integrating recent IoT and Big Data technologies for
occupancy detection, mainly the occupants’ presence. The architecture of the platform prototype is introduced in
next section.

3. The platform prototype architecture

This section presents the architecture of the platform prototype we have deployed for real-time detection of
occupants’ presence. As shown in Fig.1, it was designed as generic as possible to be applied in different smart
environments that require real-time monitoring and processing, such as in intelligent transportation [28, 29] and
health-care [14,30]. As illustrated in this figure, the platform is composed of three main layers, sensors and actuators
layer, processing layer, and services layer. The first layer is composed of different sensors and actuators that, when
deployed, could configured and remotely controlled through the Net. In fact, sensors are used to gather indoor data
such as CO2, humidity and temperature, which are submitted to the processing layer. This layer is composed of a
pre- processing unit to make sure that data to be submitted and stored is clean, and a real-time processing unit, in
which, IoT and Big Data tools are deployed to process data streams (e.g., Storm, Kaa). It includes so far, a machine
learning algorithm for occupants’ presence detection based on streaming data.
In this work, we placed a great emphasis on Vertical hoeffding tree algorithm for occupancy detection, which is
considered as an input for the services’ layer, such as HVAC system, lighting, and ventilation. We show how this
algorithm could be used with deployed IoT and Big data technologies for real-time occupancy detection. Regarding
data processing, as illustrated in Fig. 2, we have used the prequential evaluation, which uses each data instance first
to test and then train the model. In fact, it consists of three processing units, the source processor, the classifier and
the evaluator processor. The source processor reads data streams using apache Kafka (a publish/subscribe messaging
system) and sends them to the classifier. This later sends the results to the evaluator processor, which is designed to
evaluate the performance of the classifier by supporting the basic classification performance evaluators. It mainly
measures the accuracy of the classifier model since the beginning of the evaluation.
Fig. 1. Architecture of the platform prototype for real-time machine learning using IoT and Big Data technologies

Fig. 2. Prequential evaluation task topology

4. Experimental results

The main purpose of this study is to analyze and explore the occupancy information in buildings by integrating
recent IoT and Big Data technologies. We have used an occupancy detection dataset that includes indoor sensors
data, mainly light, temperature, humidity, and CO2 [22]. A platform prototype was developed and used to predict
the status of occupants’ presence (i.e., 0 for not occupied, 1 for occupied). We have compared both offline and
online machine learning techniques for occupants’ presence detection. In fact, offline machine learning or batch
learning is a technique that generates at once the best predictor by learning on the entire training data, while online
machine learning updates the best predictor at each time future data streams arrives. For offline machine learning,
we have used LDA, which showed better accuracy in the training and the test sets evaluation compared to RF and
CART. Regarding online machine learning, we have integrated the Vertical Hoeffding Tree, which showed its
potential for analyzing data streams [15].
Experiments have been first conducted using offline machine learning in order to figure out its potential in
detecting the occupants’ presence. As shown in Fig. 3, this algorithm has the ability to estimate the occupancy with
high accuracies. However, the LDA is used for batch analysis. In fact, it needs samples of cleaned sensors data
together with a model, which is trained either manually or automatically using additional sensors, in order to be used
for context’s detection and prediction. More precisely, offline machine learning is almost used by the community to
study the accuracy of machine learning algorithms (e.g., SVM, NN), and are not directly suitable for real-time
processing of data streams.
Online occupancy detection is, however, a potential technique that could be used to extract new insights from
sensors data streams. For instance, its main aim is to select the best suitable action (e.g., HVAC, ventilation control)
according to the contexts’ changes. Fig. 4 shows the usefulness of online machine learning for presence detection.
We choose to read data from dataset as data streams with a fixed frequency (e.g. 1, 10, 50 samples). These streams
are
then transmitted to the platform for processing and classification. As shown in Fig.4, the algorithm detects
accurately the occupants’ presence. It’s worth noting that we have conducted similar experiments with several data
streaming frequencies, but we did not include them since they showed similar behavior. Furthermore, we have
evaluated the accuracy of the online machine learning technique. As shown in Fig. 5, a sudden decrease of the
classification correct for the first 10 instances was detected, and improved quickly to reach 95%, but during the first
50 samples.

Fig. 3. Offline detection of occupants’ presence using LDA

Fig. 4. Online detection of occupants’ presence using VHT.

Fig. 5. The classification corrects for online machine learning

These preliminary results show the efficiency of online occupancy detection when integrated with IoT and Big
Data technologies into a holistic platform. In fact, these experiments were first conducted to study and analyze the
effectiveness of the platform for data processing using real-time machine learning for occupancy presence
detection. Further experiments have been conducted in a real sitting scenario using the equipment that we have
deployed in our EEBLab. Experiments were taken place on 17th May starting from 9:25am to 4:00pm. The
preliminary results, depicted in Fig. 6, show that the platform is able to detect occupants’ presence with high
accuracy (i.e., around 80%
in average). However, while these preliminary results are promising, more experiments are ongoing and new
results will be reported to show the effectiveness of the platform for occupancy detection (e.g., number), which is
required to deploy context-aware applications, such as for smart HVAC, lighting, and ventilation system control.

Fig. 6. The true and estimated values of occupants’ presence

5. Conclusions and perspectives

In this paper, we have presented a first prototype platform towards real-time machine learning integration with
recent IoT and Big data technologies. We compared both offline and online prediction for occupants’ presence
detection in smart buildings and preliminary results showed the potential and accuracy of real-time machine
learning. Ongoing work focuses on refining the platform prototype by using it in our EEBLab for occupants’
presence detection including other parameters, such as the occupants’ number and their activities. More experiments
will be also conducted to show the usefulness of online machine learning in real sitting using the developed context-
driven approaches for ventilation, lighting, shading and HVAC control [31, 32].

Acknowledgements

This work is supported by CASANET (Context-Aware Sensor-Actuator Networks for Energy-Efficient


Buildings) project (2016-2019), which is funded by «le Ministere de l’Enseignement Superieur, de la Recherche
Scientifique et de la Formation des Cadres (MESRSFC)» and «le Centre National pour la Recherche Scientifique et
Technique (CNRST)», and partially supported by MIGRID project (grant 5-398,2017-2019), which is funded by
USAID under the PEER program.

References

[1] AN. Tuan, A. Marco, “Energy intelligent buildings based on user activity: a survey,” Energy Build 2013;56:244–57.
[2] A. Akbar, M. Nati, F. Carrez, and K. Moessner, “Contextual Occupancy Detection for Smart Office by Pattern Recognition of Electricity
Consumption Data,” http://iot-cosmos.eu/node/1566, 2014.
[3] H.-C. Shih, “A robust occupancy detection and tracking algorithm for the automatic monitoring and commissioning of a building,” Energy
and Buildings 77 (0) (2014) 270–280.
[4] F. Lachhab, M. Bakhouya, R. Ouladsine, M. Essaaidi, “Monitoring and Controlling Buildings Indoor Air Quality Using WSN-based
technologies,” in the 4th International Conference on Control, Decision and Information Technologies, April 5-7, 2017, Barcelona.
[5] D. Calì, P. Matthes, K. Huchtemann, R. Streblow, D. Müller, “CO2 based occupancy detection algorithm: experimental analysis and
validation for office and residential buildings,” Build. Environ. 86 (2015) 39–49.
[6] Z. Yang, N. Li, B. Becerik-Gerber, M. Orosz, “A multi-sensor based occupancy estimation model for supporting demand driven HVAC
operations,” in: Proceedings of the 2012 Symposium on Simulation for Architecture and Urban Design, Society for Computer Simulation
International, San Diego, CA, USA, 542 2012, pp. 49-56.
[7] W. Kleiminger, C. Beckel, T. Staake, and S. Santini, “Occupancy detection from electricity consumption data,” BuildSys. ACM, 2013.
[8] K. Akkaya, I. Guvenc, R. Aygun, N. Pala, A. Kadri, “IoT-based Occupancy Monitoring Techniques for Energy-Efficient Smart Buildings,”
IEEE Wireless Commun. and Networking Conf. Wksps., 2015, pp. 58–63
[9] F. Lachhab, M .Bakhouya, R .Ouladsine and M. Essaaidi. “Towards a context-aware platform for complex and stream event processing”.
In High Performance Computing & Simulation (HPCS), 2016 International Conference on (pp. 961-966), July 2016.
[10] F. Lachhab, M. Bakhouya, R. Ouladsine, M. Essaaidi, “Performance Evaluation of Linked Stream Data Processing Engines for Situational
Awareness Applications”, in Concurrency and Computation: Practice and Experience Journal, 30 (12), 2018, DOI: 10.1002/cpe.4380.
[11] S.W. Wang, J. Burnett, H. Chong, “Experimental validation of CO2- based occupancy detection for demand-controlled ventilation, Indoor
Built Environ,” 8 (6) (1999) 377–391.
[12] F. Oldewurtel, D. Sturzenegger, M. Morari, “Importance of occupancy information for building climate control,” Applied Energy, 101
(2013) 521-532
[13] C. de Bakker, M. Aries, H. Kort, A. Rosemann, “Occupancy-based lighting control in open-plan office spaces: A state-of-the-art review,
“Build Environ, 112 (2017) 308-321.
[14] Y. Nait Malek, A. Kharbouch, H. El Khoukhi, M. Bakhouya, V. Deflorio, D. Elouadghiri, S. Latre, C. Blondia., “On the use of IoT and Big
Data Technologies for Real-time Monitoring and Data Processing,” proc. of the 7th International Conference on Current and Future Trends of
Information and Communication Technologies in Healthcare (ICTH2017), Volume 113, pp. 429-434, Lund, Sweden.
[15] G. D. F. Morales and A. Bifet, “SAMOA: Scalable advanced massive online analysis,” J. Mach. Learn. Res., vol. 16, pp. 149–153, Jan. 2015.
[16] J. Pan, R. Jain, S. Paul, T. Vu, A. Saifullah, M. Sha, “An Internet of Things Framework for Smart Energy in Buildings: Designs, Prototype,
and Experiments”, IEEE Internet of Things Journal, Vol. 2, Issue 6, pp. 527-537, Dec. 2015.
[17] C. Marche, M. Nitti, V. Pilloni, “Energy efficiency in smart building: a comfort aware approach based on Social Internet of Things”, Global
Internet of Things Summit (GIoTS), 6-9 June 2017, Geneva, Switzerland.
[18] T. Labeodan, W. Zeiler, G. Boxem, Y. Zhao, “Occupancy measurement in commercial office buildings for demand-driven control
applications: A survey and detection system evaluation,” Energy and Buildings, 93 (2015) 303-314.
[19] A. Ebadat, G. Bottegal, D. Varagnolo, B. Wahlberg, K.H. Johansson, “Estimation of building occupancy levels through environmental
signals deconvolution,” in: Proceedings of the 5th ACM Workshop on Embedded Systems For Energy-Efficient Buildings, ACM, Rome,
Italy, 2013,pp. 1-8.
[20] B. Dong, B. Andrews, K.P. Lam, M. Höynck, R. Zhang, Y.-S. Chiou, D. Benitez, “An information technology enabled sustainability test-
bed (ITEST) for occupancy detection through an environmental sensing network,” Energy and Buildings, 42 (7) (2010) 1038-1046.
[21] M. Jin, N. Bekiaris-Liberis, K. Weekly, CJ. Spanos, AM. Bayen, “Occupancy detection via environmental sensing,” IEEE Trans. Autom. Sci.
Eng, 2016, no. 99, pp. 1-13.s
[22] L.M. Candanedo, V. Feldheim, “Accurate occupancy detection of an office room from light, temperature, humidity and CO2 measurements
using statistical learning models,” Energy Build. 112 (2016) 28–39.
[23] K. Tutuncu, O. Cataltas, M. Koklu, “OCCUPANCY DETECTION THROUGH LIGHT, TEMPERATURE, HUMIDITY AND CO2
SENSORS USING ANN,” Proceedings of ISER 45th International Conference, Rabat, Morocco, 8th -9th December 2016, ISBN: 978-93-
86291-60-8
[24] A. Khan, J. Nicholson, S. mellor, T.Ploetz, “Occupancy monitoring using environmental & context sensors and a hierarchical analysis
framework. Embedded Systems for Energy-Efficient Buildings,” BuildSys. ACM (2014). p. 90–9. doi:10.1145/2674061.2674080.
[25] Z. Yang, N. Li, B. Becerik-Gerber, M. Orosz, “A systematic approach to occupancy modeling in ambient sensor-rich buildings,” Simulation,
90 (8) (2014) 960-977.
[26] T. Vafeiadis, et al., “Machine Learning Based Occupancy Detection Via The Use of Smart Meters,” ISCSIC. International symposium, pp.
6- 12, 2017.
[27] D. Chen, S. Kalra, D. Irwin, P. Shenoy, and J. Albrecht, “Preventing occupancy detection from smart meters,” IEEE Trans. Smart Grid, vol.
6, no. 5, pp. 2426–2434, Sep. 2015.
[28] A. Lahlou1, F. Ossart, E. Boudard, F. Roy, M. Bakhouya, “A Dynamic Programming Approach for Thermal Comfort Control in Electric
Vehicles, ” in the 2018 Vehicle Power and Propulsion Conference (VPPC), Chicago, Illinois, USA, 2018.
[29] I. Amezzane, Y. Fakhri, M. El Aroussi, M. Bakhouya, “Towards an Efficient Implementation of Human Activity Recognition for Mobile
Devices, ” in EAI Endorsed Trans. Context-aware Syst. & Appl. 4(13), 2018.
[30] A.Kharbouch, H. El Khoukhi, Y. Nait Malek, M. Bakhouya, V. De Florioa,, D. El Ouadghiri, S. Latre, C. Blondia , “Towards an IoT and
Big Data Analytics Platform for the Definition of Diabetes Telecare Services“, The 2nd International Conference Onsmart Applications And
Data Analysis For Smart Cities (SADASC’18), Casablanca, Morocco.
[31] F. Lachhab, M. Bakhouya, R. Ouladsine, M. Essaaidi, “Towards an Intelligent Approach for Ventilation Systems Control using IoT and Big
Data Technologies, ” in The 9th International Conference on Ambient Systems, Networks and Technologies (ANT 2018), Porto, Portugal,
Procedia Computer Science, Elsevier, Volume 130, pp. 926-931.
[32] F. Lachhab, Y. Nait Malek, M. Bakhouya, R. Ouladsine, M. Essaaidi, “A Context-Driven Approach using IoT and Big Data Technologies
for Controlling HVAC Systems, ” in the 5th International Conference on Control, Decision and Information Technologies, CoDIT’2018,
Thessaloniki, Greece, pp. 1-6, 2018.

You might also like