1. Introduction
The expansion and continuous improvement of smartphones and personal electronic devices have resulted in the remarkable development and growth of many Information and Communications Technology (ICT) industries. Indoor positioning technology has developed to support a variety of services making use of the sensors and protocols embedded in mobile devices. After the emergence of iBeacon [
1] and Eddystone [
2], attempts to detect position in indoor environments using Bluetooth have increased compared to WiFi-based techniques, mainly because Bluetooth is designed to operate with low power consumption [
3,
4,
5,
6].
Indoor positioning has multiple applications, and has been the subject of study in different industries, location-based marketing being one of the areas that has led to the most research on these systems. The goal of location-based marketing is to provide customers with a personalized experience and to provide special offers depending on their location as well as information about products or services. This type of solution, along with payment integration through notifications or tracking of consumer behavior, provides information that can improve the end customer experience [
7].
In this work, an IoT-based system was realized and Machine Learning (ML) was used to estimate the position of assets, objects, people, or animals carrying a TAG device in indoor spaces. For such a system, different methodologies, architectures, and frameworks must be considered in order to propose an optimal solution for such an application [
8]. As trilateration is not quite suitable for indoor location estimation, this project considers the fingerprinting technique, in which an intelligent system collects information from RSSI (Received Signal Strength Indicator) levels from the wireless communication between the object to be located and different access points, then associates these collections of RSSIs (fingerprints) to a certain location in space [
9,
10,
11]. Through Bluetooth Low Energy (BLE) technology, a TAG attached to the object to be located sends periodic beacon messages, which are scanned in a fixed time window by
Scanning Stations deployed in the environment under study. The scanning stations consolidate and send the information to a server, where a previously trained Deep Learning (DL) model estimates the position of the object utilizing the fingerprinting approach.
The main objective of the IoT indoor positioning system is to allow the identification and tracking of assets in such a way that it is possible to generate presence or absence alerts. This goal is achieved with the development of different elements of an IoT architecture, involving: the (i) implementation of fully customized electronic devices (hardware and firmware) for the scanning stations and mobile TAGs; (ii) a Bluetooth communication layer between the TAGs and the scanning stations; (iii) the centralization of the information to a local MQTT broker; and (iv) the storage and edge computing layers. The project first included a training stage, during which a location dataset was acquired and labeled for later use as the input for training the neural network, followed by a second deployment and operation stage.
Despite many different efforts for indoor positioning, there is no established standard for these techniques. Important efforts have been made to propose a general simulation-driven methodology for IoT systems to enable data mining and machine learning applications, with particular focus on the edge, for taking effective actions in constrained and dynamic IoT scenarios [
12]. The work in [
13] presents a patent that is specifically oriented in the field of radio frequency and the deployment of multiple devices in an indoor environment, aiming to create a navigation infrastructure for marketing, consumer analysis, emergency situations, transportation, and parking purposes, among others. The proposed solution is based on the application of ML techniques that can infer the status and positioning of the user depending on the input flow of information from the TAGs, which are electronic devices that are installed in the local area, either indoors, outdoors, or at points of interest, and that emit a unique identifier via Bluetooth. The work presented in [
14] proposes the K-Nearest Neighbor (KNN) algorithm to study the accuracy of fingerprinting positioning and compares its performance with other approaches such as Support Vector Machines (SVM), Random Forest (RF), and Multi-layer Perceptron (MLP).
The authors in [
15] designed an ML method to reduce the standard deviation of the positioning estimation error and increase the probability that the estimated distance is within 2.5 m of the actual distance. The application of RSSI methods addresses the difficulties in localization in environments with obstacles. While significant improvement in accuracy can be achieved by ML techniques, the computational cost is controllable with customization in environmental and device setup [
16]. In a three-dimensional space, BLE-based spaces can provide accurate location as long as the boundaries of each of the devices are predefined to infer the location from the highest signal strength in the coordinates. Lin et al. proposed the LNM scheme, an approach that utilizes the neighbor relative received signal strength to build a fingerprint database, and adopted a Markov-chain prediction model to assist positioning [
17].
Proximity Beacon is a proximity device designed to be detected by BLE-compatible devices such as Android and IOS smartphones when they are in range of the device. LTE Beacon is a device designed for tracking assets, vehicles, and people both indoors and outdoors; it has the ability to detect nearby assets via Bluetooth, and can be programmed via Javascript [
18]. One of the most popular devices on the market is Apple’s AirTag, with a value proposition to prevent personal items from getting lost; however, being part of the Apple ecosystem it only has full compatibility with IOS.
Experimental developments were presented in [
19] for pebBLE and Estimote BLE devices, both battery-powered and with a transmit power of 4 dBm, and were subjected to attenuation comparisons for WiFi and BLE. Each signal was measured for one minute at reference distances from 1 m to 13 m with 2 m intervals [
19]. Although WiFi has superior overall received signal strength, the attenuation coefficient for BLE is smaller, making it suitable for indoor positioning applications
Phutcharoen et al. concluded in [
20] that although BLE technology is widely used for positioning in indoor environments, there is a high error due to the multipath fading that frequently occurs in these scenarios. Their paper presents the study of indoor positioning accuracy in a 91.8 m
space with three BLE beacons. The fingerprinting technique with root mean square error (RMSE) matching is used to estimate the position of the user equipment. From the results, the average of the measurements can reduce the average distance error to 0.86 m.
The work of Khattak et al. in [
21] has tackled the vulnerability problem of fingerprinting frameworks, transforming raw data into a high-dimensional form to better match the existing classification models by utilizing a Bag-of-Features approach. In their work, the cumulative distribution function (CDF) is used in order to better select the proper features based on the positioning distance error [
22]. Similarly, Ng et al. proposed a fingerprint database in order to estimate the location of a smartphone user based on a kernel method to define a top-k similarity [
23], although in this case the beacons were static and the moving object was in charge of making the estimation. The authors used the CDF to measure the quality of the system.
Table 1 shows a comparison of multiple devices, both commercial and academic, in terms of integrated communications technologies, battery lifetime, use case, SDK, integrated protocols, and integrated sensors.
This work is an extended version of the preliminary results presented in [
24], and the contributions can be summarized as follows:
A complete Hardware–Software architecture for indoor positioning based on fingerprinting is proposed, implemented, and tested.
An incremental methodology (independent of the deployment scenario) is followed to build a complete dataset for ML-based indoor positioning systems.
A highly flexible and accurate indoor positioning system is achieved, which can be easily reproduced after being re-trained with the corresponding new dataset.
The rest of this paper is structured as follows:
Section 2 presents the proposed general architecture, the development of the scanning stations and TAG devices, and the data classification mechanisms;
Section 3 presents the experiments executed in the systems;
Section 4 discusses the achieved results; and
Section 5 concludes the paper and presents possible future work.
4. Discussion
An accuracy of could be interpreted as having almost 9 correct estimations out of 10 measurements. Even when the TAGs were not moving at all, the system tended to fail in the estimation (1 out of 10 times) because of the highly volatile RF environment. However, considering that the application scenario was that of a tracking system of objects in an indoor environment, it is safe to assume that in a real scenario the objects would not be moving very fast.
With this in mind, a post-processing stage was proposed and implemented which applied a median filter in a window of five datapoints; with this post-processing stage, an increase in the estimation accuracy can be expected.
Table 11 presents the accuracy of the classifier with the post-processing stage, achieving
on average, though with the disadvantage that it takes more time for the corresponding estimation to be generated.
Within the objectives we set, the system had to be able to send an alert about the presence or absence of targets with a TAG installed. After testing, the solution provides much more information than this, as it is possible to tag many different spaces and know precisely where the object is located.
The use of ML techniques for position estimation solutions provides a great advantage compared to traditional trilateration algorithms, as multiple scenarios and external variables that affect the quality of the estimation can be identified as noise after the corresponding training stage. A relevant point to take into account is that the space in which the system is installed must be previously analyzed, as sometimes locating the stations in the wrong places can affect the estimation process, reducing its final accuracy.
In its current form, the system is trained offline in the Edge Impulse web platform, which in turns generates a static model that can be downloaded (programmed) into the edge device, in this case a Raspberry Pi Zero W. The edge device consolidates the RSSI information from the scanning stations and classifies it accordingly. However, because the neural network model is static, it cannot learn on new labeled data without the need to upload all the data (old and new) and train the model again on Edge Impulse.
For this specific deployment, the above limitation is not a major issue. However, to scale this system it would be preferable to have a base model that can be deployed and a platform that can be retrained based on user feedback, e.g., to correct wrongly classified data, relocate the scanning stations, etc. The development of such a system is part of our future work.
5. Conclusions
An IoT System for indoor asset tracking and identification has been designed, implemented, and deployed utilizing a TinyML approach and DL techniques on the edge. We have presented the activities carried out to achieve the different proposed objectives during the development and test stages. In this project, the hardware and firmware for both the scanning stations and the TAG devices were realized. Creative methodologies applied to prior development were used, performing a divergence of ideas and later convergence that led to an optimal development process. System integration was performed as well, involving the scanning of the TAGs by the stations, consolidation of the TAG information in each of the stations, transmission to the MQTT broker, computation at the edge with ML algorithms for position estimation, and finally consolidation to the non-relational database where the data can be consulted by the users.
In this solution, the complete architecture of an IoT solution was developed in which embedded systems concepts were used for the construction of both the scanning stations and the TAGs, which together correspond to the physical layer of the system. In this layer, different M2M and wireless communication protocols such as I2C, UART, and BLE were used. The connectivity layer was designed and implemented for the consolidation of information, in which the MQTT protocol was used to obtain the messages from the broker of each of the stations. The concepts of edge computing and ML were applied to execute a DL model in the embedded system; a storage layer was implemented to ensure remote persistence of the information, and an application was developed that allows visualization of the data.
The cybersecurity in this device contemplates multiple layers that must be taken into account for manufacturing and deployment. Although the architecture was designed to ensure that the information traffic protects the integrity of the data by having only one access point connected to the internet (the broker), the availability and confidentiality of the information could nonetheless be violated. Scenarios of access to the broker and change of data from the payload were considered and basic defense maneuvers were generated, although this is a point to be studied in depth in the future.
The system developed in this project opens up the possibility of continuing the training process after generation of a basic model, making it possible to continue with labeling during the operation of the system through interaction with the user and thereby improving the experience by providing a unique solution tailored to each user.