# Passive Indoor People Counting by Bluetooth Signal Deformation Analysis with Deep Learning
## 4 Experimental Setup  
The pre-training and validation dataset used for this paper was built by gathering data during several hours in 3 different rooms of about 50 square meters each, with different dispositions of the workstations and different numbers of occupants, ranging from 1 to 11.  
In all rooms, 5 transmitters and 2 receivers were deployed. The collected samples were grouped into a single large dataset and then processed according to the procedure described in Section 3.1, thus producing a dataset of approximately 20,000 samples. The actual occupancy information was manually added by an operator who attended each data acquisition session. This dataset was used to pre-train the model, validate it, and preliminarily test it. To this end, the dataset was partitioned into three subsets (namely, the Pre-Training, Pre-Training Validation, and Pre-Training Test datasets).  
For the sake of generality of the pre-trained model, any bias and information on the prior probability distribution of the elements in each class (one class per each integer number of occupants in the range \([0,11]\)), must be canceled; therefore, we randomized the samples in each dataset (that is, randomly re-sampled the datasets) in order to remove their original ordering information and balanced the number of elements in each class as follows:  
1. Set the target per-class cardinality (PCC) as the median number of elements across the classes.
2. Subsample all the classes that have a number of elements larger than PCC, so that all classes have at most PCC elements.
3. Augment the classes that have fewer than PCC elements.  
Data augmentation requires that, in those classes that do not contain a sufficient number of samples (weak classes), new samples are generated based on existing ones, by duplicating and slightly transforming them, for example, with additive noise (jitter), randomly distributed translations, and magnitude warping [45]. In our experimental setup, we adopted the data augmentation procedure described in [46] to balance the classes in our datasets. Figure 5a shows an example of an unbalanced dataset used in our experiments, and Figure 5b shows the effects of augmenting the weak classes in the same dataset.  
After the above procedure, the datasets contain the same number of samples per class, thus reducing the risk of bias. Moreover, the uniform Per-Class Cardinality (PCC) of the datasets, i.e., the fact that all classes in a dataset have the same number of elements, is also maintained in the Pre-Training Test dataset, thus allowing us to use accuracy as a reliable classification performance metrics [47].  
A separate dataset for testing the fine-tuning approach was collected from a different room, a 60 square meter laboratory equipped with the same number of transmitters and receivers as in the rooms mentioned above. The occupants entered and left the room during the data acquisition session, and their number (ranging from 0 to 10) was manually annotated with a dedicated application at each change. This dataset contains about 15,000 samples evenly distributed among the 11 classes and was also partitioned into a Fine-Tuning Training, a Fine-Tuning Validation, and a Fine-Tuning Test dataset.  
Both the transmitting and receiving devices were developed using the standard BLE application interface available on the low-cost, low-power Banana PI M5 single-board computer, running the Linux Operating System, and equipped with 4 GB RAM memory, Amlogic S905X3 64-bit quad-core Cortex A55 processor, Mali G31 GPU, and a BL-M8821 CU1 Wifi and BLE 4.2 expansion board. The transmitting devices duly emulated the behavior of commercial BLE 4.2 beacons.  
The datasets collected and employed in the experiments are included as supplementary material associated with the article.  
Training and fine-tuning were carried out on a notebook computer running the Linux operating system and equipped with an Nvidia GTX 1650 Ti GPU.