Machine Learning-based Occupancy Estimation Using Multivariate Sensor Nodes Adarsh Pal Singh * , Vivek Jain * , Sachin Chaudhari * , Frank Alexander Kraemer † , Stefan Werner † and Vishal Garg * * International Institute of Information Technology (IIIT), Hyderabad, India † Norwegian University of Science and Technology (NTNU), Norway Email: adarshpal.singh@research.iiit.ac.in, jain.vivek@students.iiit.ac.in, sachin.c@iiit.ac.in, vishal@iiit.ac.in, kraemer@ntnu.no, stefan.werner@ntnu.no Abstract—In buildings, a large chunk of energy is spent on heating, ventilation and air conditioning systems. One way to optimize their usage is to make them demand- driven depending on human occupancy. This paper focuses on accurately estimating the number of occupants in a room by leveraging multiple heterogeneous sensor nodes and machine learning models. For this purpose, low- cost and non-intrusive sensors such as CO2, temperature, illumination, sound and motion were used. The sensor nodes were deployed in a room in star configuration and measurements were recorded for a period of four days. A regression based method is proposed for calculating the slope of CO2, a new feature derived from real-time CO2 values. Supervised learning algorithms such as linear discriminant analysis (LDA), quadratic discriminant anal- ysis (QDA), support vector machine (SVM) and random forest (RF) were used on several different combinations of feature sets. Moreover, multiple performance metrics such as accuracy, F1 score and confusion matrix were used to evaluate the performance of our models. Experimental results demonstrate a maximum accuracy of 98.4% and a high F1 score of 0.953 for estimating the number of occupants in the room. Principal component analysis (PCA) was also applied to evaluate the performance of a reduced dimensional dataset. Index Terms—Internet of Things, Machine Learning, Occupancy Estimation, Wireless Sensor Network. I. I NTRODUCTION Real-time occupancy information can give rise to intelligent heating, ventilation and air conditioning (HVAC) and lighting systems in buildings which would not only conserve energy, but also provide better comfort to the occupants. With the advent of Internet of Things (IoT), there are readily available sensors which can measure the environmental parameters and this data can be analyzed using machine learning (ML) to determine human occupancy without video based systems. Recent studies have demonstrated energy savings up to 30% in buildings where the occupancy pattern was known [1]. Early approaches for occupancy detection and esti- mation resulted in the use of intrusive systems such as camera [2], WiFi [3], wearables and RFID [4], [5]. With the rise in concern regarding privacy, the research in recent years has moved towards the use of non-intrusive environmental sensors for occupancy detection and esti- mation such as CO 2 [6]–[14], temperature [6], [7], [9]– [14], CO [9], [10], total volatile organic compounds [9], [10], light [6]–[8], [10], [11] motion [7]–[11], sound [6], [8]–[11], humidity [6], [7], [9]–[13], pressure [6], [12], [13] and air-volume [14]. As the focus of this paper is also on the use of non-intrusive sensors, we have used the following five readily available low cost sensors: CO 2 , temperature, light, motion and sound for occupancy estimation. A lot of research has been carried out in the literature for occupancy detection, i.e., if the room is occupied or not [6]–[8]. Although detection alone can help in improving energy savings, estimating also the precise number of occupants can make the system even more adaptive and energy-efficient. Therefore, the focus of this paper is on occupancy estimation. There are quite a few papers on ML based occu- pancy estimation [10]–[14]. In [10], three ML techniques namely Hidden Markov model (HMM), artificial neural network (ANN) and support vector machine (SVM) were used on a distributed sensor network. It was shown that HMM gives the best performance with 75% accuracy. However, as stated by them, the occupancy levels were very dynamic indicating that all labels may not have equal number of data points. As such, F1 score and confusion matrix are more suitable performance metrics for such studies as compared to only accuracy metric used in [10]. In [11], an ambient sensor system was deployed in two labs and radial basis function (RBF) neural network was used for classification. They, how- ever, did not do cross validation and their model may fail for large spaces wherein a single node will not be effective. In [14], another set of sensors comprising of CO 2 , air volume, auxiliary and room temperature were used. However, the paper binned occupancy levels instead of giving a point estimate. A similar approach of binning was used in [13], which achieved a high accuracy using a convolutional deep bidirectional long short-term memory approach. The work in [12] used a network of three sensor nodes with multiple sensors and