# Passive Indoor People Counting by Bluetooth Signal Deformation Analysis with Deep Learning
## 1 Introduction
The application of Bluetooth Low Energy (BLE) to passive sensing has also been investigated as a convenient alternative to WiFi for several reasons, ranging from its lower power consumption to lower costs, easier deployment, and lower impact on existing wireless communication infrastructure [6; 20]. However, the BLE protocol still retains some features that make it less flexible for passive human sensing, compared to WiFi:  
* The passive human sensing application cannot extract from the received message the BLE frequency information, which would be needed to better cope with the variation in RSSI according to the transmission channel. Specifically, the application layer does not provide access to the frequency (that is, the channel) chosen by the Adaptive  
Figure 1: Passive human sensing through the analysis of RF signals traversing a human body. Frequency Hopping (AFH) mechanism of the BLE protocol to send a message. This constraint is related to security and is not expected to be relaxed in the near future. * WiFi Channel State Information (CSI) can be directly acquired from certain devices using the WiFi multicarrier encoding mechanism, whereas BLE does not support this type of measurement. * Acquiring RSSI samples at high rates from BLE-based devices is a challenge. Consequently, collecting the substantial amount of data necessary to train a machine learning model requires a sensibly long \"idle\" period before the model can be deployed, which may not be feasible for many practical applications [21]. Due to the above issues, the literature reports mainly on applications of BLE to simple passive human detection [20; 22; 23] and only a few research works deal with approximate people counting [24; 25]. Conversely, in this paper, we present an approach to passive people counting in indoor environments, based on BLE and a deep learning model, which to our knowledge is the first in the literature that features an accuracy similar to those based on WiFi, while only requiring a quick fine-tuning session to adapt to a new environment and relying both on LoS and non-LoS (reflected) propagation. The main contributions of this work are the following. * We tested and compared five different deep learning architectures on a large dataset, in order to select the one that performs best. * **Model fine-tuning. ** Instead of retraining the model from scratch for each deployment, we collected a large and heterogeneous dataset and used it to pre-train and validate the model. For each new deployment, we then acquire a small dataset from the unknown environment and use it to fine-tune the model. The procedure is quick and accurate, since only about 4000 samples are used. * **High accuracy. ** The proposed approach can obtain a people count accuracy higher than 99% (according to the accuracy metrics used in the literature) or 96% (according to the more strict metric we adopted) with only a few minutes of training data acquisition in a completely unknown indoor environment, provided that a sufficient number of people can be asked to enter and exit the room during a few minutes interval. The appropriate number of people to involve is equal to, or greater than, the largest number of occupants expected to be counted by the model in the specific environment where it is being fine-tuned. * **High resolution of the people count. ** If we define the resolution of the people count as the minimum difference between two measurements that can be discriminated by the proposed system, we can consider as optimal a resolution equal to 1. The proposed approach has been evaluated and validated by setting the resolution to 1, that is, to the optimal resolution. * **Interpolation ability. ** At the cost of a reasonable accuracy degradation, the proposed approach can be easily fine-tuned based only on a suboptimal number of cases, that is, for example, by acquiring samples only with 1-5-9 persons in a room and still being able to count from 0 to 10 occupants.