An alternative approach to monitor occupancy using bluetooth low energy technology in an office environment

In this study, we proposed a non-intrusive occupancy monitoring approach which leverages on existing BLE technologies found in smartphone devices to track the occupants’ movement patterns using BLE beacons. Unlike existing methods, the proposed approach does not require the installation of a mobile application and only requires the occupants to provide the MAC address of their Bluetooth-enabled smartphone devices. The feasibility of the proposed approach was demonstrated by conducting a two-week data collection effort in a university office environment where the occupancy patterns identified are used to develop various occupancy profiles for different types of occupants.


Introduction
The building sector contributes up to 40% of the primary energy use in many developed countries [1]. In the United States alone, half of this energy consumption comes from commercial buildings, with office buildings being one of the highest energy consumers in this category [2]. Based on a report published by the International Energy Agency (IEA), occupant behaviour (OB) is identified as one of the major factors contributing to building energy use. However, past attempts to objectively quantify the impacts of OB using building simulation remains challenging due to the stochastic nature of OB.
In current building performance simulation (BPS) programs, occupants are often assumed to exhibit deterministic behaviours and follow regular movement schedules. As the occupants' interaction with various appliances and lighting systems is largely dependent on the occupants' presence and movement patterns, these simplistic assumptions lead to a wide discrepancy between the simulated and actual building energy consumption. To adequately address this energy performance gap, it is vital to accurately capture the dynamic movement behaviours of the building occupants.
Past occupancy detection systems follow either a terminal or non-terminal approach. The terminal approach involves attaching a smartphone device or wearable sensor on the occupant to track his movement patterns within the indoor environment. On the other hand, the non-terminal approach focuses on monitoring a particular area for its occupancy levels. Given that these non-terminal approaches do not allow us to track the occupant's movement between different zones, the main focus of this study will be on terminal approaches.
Terminal-based occupancy detection systems have been shown in previous studies to provide detailed information on the occupants' presence and movement patterns within an indoor environment [3]. While various wireless technologies, such as Radio-frequency Identification (RFID) [4], Wi-Fi [5], and Ultra-wide Band (UWB) [6], have been proposed in the past, the Bluetooth Low Energy (BLE) technology remained widely used due to its affordability and low power consumption [7]. with the occupant's smartphone device through a mobile application to infer the occupant's location. The approach has been proposed in the context of emergencies where first responders will be able to use the location information to plan their intervention route [8]. Similarly, using a configuration of BLE beacons, smartphone devices, and a mobile application, Choi et al. proposed a smart office energy management system that activates the power saving mode of the occupant's plug-in appliances when the occupant is detected to have left the office [9]. In many other similar occupancy detection systems, the occupants are either required to carry around a wearable sensor or install a mobile application on their smartphone devices. These approaches intrude upon the occupants' routine and impact their natural behaviours. This phenomenon is known as the Hawthorne effect as it describes the change in the occupants' behaviour towards social acceptability due to their awareness of being studied [10]. Furthermore, the increased power consumption on the occupants' smartphone device due to the mobile application may also deter other interested participants. Based on the limitations highlighted, past occupancy monitoring studies are often limited in its participation rates, thus impacting the reliability and validity of the data collected.
Given these challenges, we propose a non-intrusive occupancy monitoring approach which leverages on existing BLE technologies found in smartphone devices to accurately track the occupant's indoor location using BLE beacons. The proposed approach does not require the installation of a mobile application but only requires the occupants to provide their devices' Bluetooth MAC address and enable its Bluetooth mode during the monitoring period. The feasibility of the proposed approach was demonstrated during a two-week data collection effort in a university office environment where various occupancy profiles were identified for different occupant types.

Data Collection Methodology
The BLE beacons are programmed to continually scan the vicinity for the occupants' Bluetooth-enabled smartphone devices based on their MAC addresses. When a particular device is detected in the vicinity, the MAC address and Received Signal Strength Indicator (RSSI) value of the device will be recorded by the BLE beacon together with a timestamp. The RSSI value indicates the signal power level that is received by the BLE beacon, and its value is affected by the distance between both devices. To accurately identify the location of an occupant based on his Bluetooth-enabled smartphone device, the following steps are taken: Step 1: Retrieve the RSSI values recorded by all of the BLE beacons deployed in the study area.
Step 2: Extract the RSSI values for the occupant using the Bluetooth MAC address provided.
Step 3: Sort the extracted RSSI values by their timestamps (or UNIX time).
Step 4: For each RSSI entry, convert it into an RSSI tuple which will store an RSSI value for each BLE beacon deployed (refer to figure 1).
Step 5: Perform imputation for the missing entries in each RSSI tuple by using the last recorded RSSI value from the corresponding BLE beacon (figure 1). If the RSSI value was recorded beyond a user-defined time window, fill the missing entry with an arbitrarily large RSSI value.
Step 6: Pass the RSSI tuples through a machine learning model to infer the occupant's location.  The approach of using an RSSI tuple to infer the occupant's location is commonly known as the Bluetooth Fingerprinting method. Therefore, the machine learning model mentioned in Step 6 will be known as the Bluetooth Fingerprinting model. To train the Bluetooth Fingerprinting model to accurately infer the occupant's location, several Bluetooth-enabled smartphone devices, based on different operating systems, will be placed at different spots within the study area. Based on the RSSI tuples obtained for these devices, each tuple will be labelled with the device's actual location and used to train the Bluetooth Fingerprinting model based on a supervised machine learning approach.

Study Area
We demonstrated the feasibility of the proposed methodology by conducting a two-week data collection effort at a university office environment. The study area spans approximately 650 square meters and houses a facilities management office, open spaces for group meetings, a pantry, an open-concept office area for in-house researchers, as well as several research facilities. In this study, we are interested in the occupants' movement between the different zones, as well as their movement within each zone. Therefore, several zones are further divided into sub-zones. As a result, we have demarcated a total of 8 zones and 11 sub-zones in the study area as depicted in figure 2. In this study, the occupants that visit the study area can be categorised into temporary occupants and permanent occupants. Temporary occupants are users who visit the study area for work-related purposes but do not have an assigned workspace while permanent occupants are users who have an assigned workspace in the study area.

BLE Beacon Deployment
A total of 21 BLE beacons were deployed at various locations within the study area as depicted in figure  2. These deployment locations were selected to ensure a complete signal coverage as occupants transit in and out of the study area, as well as within the different zones. The BLE beacons are built using Raspberry Pi 3 Model B, which comes with its own inbuilt BLE module.

Bluetooth Fingerprinting Model
During the development of the Bluetooth Fingerprinting model, three model architectures have been evaluated to identify the best performing model. Using the RSSI tuple as an input feature, the first model formulates the problem as a multi-class classification problem whereby the model outputs the occupant's predicted location based on one of the 11 sub-zones in the study area. The second model follows a hierarchical classification approach whereby the initial classification first predicts the occupant's location on the zonal level. Following which, a subsequent round of classification will identify the occupant's location on the sub-zonal level based on the initial zone prediction. The final model follows an ensemble 1-vs-all architecture whereby a binary classifier is developed for each of the 11 sub-zones in the study area. By comparing the probabilistic outputs of each classifier, which indicates the likelihood that an occupant is currently in that sub-zone, we will select the sub-zone corresponding to the classifier with the highest probability as the final predicted location.
By comparing the performance of all three models, the ensemble 1-vs-all architecture was found to outperform the other model architectures and report an accuracy rate of up to 80% on the crossvalidation set. The performance of the ensemble 1-vs-all architecture is further validated by plotting its predicted occupancy level against the actual occupancy level of the study area over five working days. The latter was obtained via a manual observation of the occupants' movement patterns during the twoweek data collection period in the study area. It can be observed from figure 3 that the predicted occupancy level closely matches the actual occupancy levels recorded over the five workdays.

Occupancy Results and Discussion 3.4.1. Occupant Presence and Movement
Patterns. Based on the occupants' presence and movement information collected using the Bluetooth Fingerprinting approach, we can observe, from figure 4, two distinct peaks representing the permanent occupants' first arrival and last departure times on an average day. On the other hand, temporary occupants tend to arrive after lunch and depart evenly throughout the rest of the day. Through an examination of the weekly visiting frequencies of both the temporary and permanent occupants, it is inferred from the low visiting frequency of several of the permanent occupants that they tend to work remotely from their assigned desks. Similarly, in the case of a small group of temporary occupants, the high visiting frequencies can be explained by their dependency on certain facilities that can be found in the study area, leading them to work remotely from their own desks.

Occupancy Profiles.
Based on the occupants' presence and movement information collected using the Bluetooth Fingerprinting approach, the next output of this study is to identify two sets of occupancy profiles, one for each occupant type, that adequately represents the occupancy patterns of the study population. In this study, we will be applying the K-Means clustering algorithm [11] to generate our occupancy profiles; and the input features include the first arrival and last departure time, total duration spent in the office, visiting frequency per week, duration of long and short term absence from the office, and fraction of time spent at each zone.
When applying the K-means clustering algorithm, we are first required to define the appropriate number of clusters (K) in the dataset. In this study, the number of clusters (K) will be identified by using the elbow method [12]. This approach involves running the clustering algorithm over a range of K values and plotting the resulting sum of squared error (SSE) between each sample and its assigned centroid. The most appropriate K value can be identified by searching for the point where we start getting diminishing returns as K increases further (i.e., an "elbow" on the graph). Based on this method, figure  5 shows that both permanent and temporary occupants have three distinct profiles each.  Table 1 depicts the descriptive statistics (i.e., 25th quantile, 75th quantile, mean, and standard deviation) for the first arrival time, last departure time, and visiting frequency of the permanent occupants grouped according to their respective occupancy profiles. A comparison of the first arrival time and last departure time of the occupants in all three profiles shows the occupants in Profile 1 having a much wider range for both factors as compared to their peers in Profile 2 and 3. These observations led us to conclude that the occupants in Profile 1 tend to follow more flexible working hours as compared to their peers. Furthermore, a comparison of the visiting frequencies of the occupants in different profiles shows that the occupants in Profiles 1 and 2 more frequently visit the study area (>4 times per week) as compared to the occupants in Profile 3 (<3 times per week). This observation indicates that the occupants in Profile 3 tend to work remotely from their assigned workstations. Based on these insights, we will label the occupants from Profile 1 as Flexi-Timers, the occupants from Profile 2 as Regulars, and the occupants from Profile 3 as Remote Workers.
Similarly, we are interested in comparing the occupancy information of the temporary occupants grouped according to their profiles in table 2. As the temporary occupants tend to visit the study area for work-related purposes, table 2 shows several of the temporary occupants in Profiles 1 and 3 spending a significant portion of their time in the Laser Cutting Room as well as the Assembly Space. On the other hand, the temporary occupants in Profile 2 spend a significant portion of their time in the Meeting Area. Therefore, we can infer that the occupants in Profiles 1 and 3 tend to visit the study area to utilise the facilities in the Laser Cutting Room and Assembly Space, while the occupants in Profile 2 visit the study area for group meetings. Based on the visiting frequencies of the different profiles, it was also

Conclusion
In this study, we proposed a non-intrusive occupancy monitoring approach which leverages on existing BLE technologies found in smartphone devices to track the occupant's movement patterns, without the installation of a mobile application. The feasibility of the proposed approach was demonstrated during a two-week data collection effort in a university office environment where the occupancy patterns identified were used to develop various occupancy profiles. These profiles can be used as input to simulate the movement patterns of different occupants in future studies.