Traditionally, indoor positioning systems based on WiFi fingerprinting have relied on k-NN algorithms and, more recently, on deep learning models.
This repository contains the code for a framework developed to use Graph Neural Networks (GNNs) with both inductive and transductive learning schemes.
Transductive and inductive learning schemes for WiFi fingerprinting-based indoor positioning systems
In the transductive scheme, a single graph is created that includes all dataset splits (train, validation, and test), whereas in the inductive scheme, separate graphs are constructed for each split to prevent phenomena such as data leakage and to enable evaluation on unseen graphs without retraining the model each time.
The framework supports preprocessing of the original datasets using linear and power normalization, as well as dimensionality reduction via PCA. It also provides flexibility in constructing k-NN graphs, allowing selection of different distance metrics (Manhattan and Cosine) and the number of nearest neighbors k.
|
|
*The graphs were generated from the TUT5 dataset.
|
*The graphs were generated from the TUT5 dataset.
|
Results obtained after 10 runs using a random split of the training dataset each time (80/20).
| Mean Position Error (m) | |||
|---|---|---|---|
| Dataset | Best k-NN (Optimized) |
GraphSAGE (Transductive) |
GraphSAGE (Inductive) |
| UJI1 | 7.33 | 7.36 ± 0.12 | 8.72 ± 0.20 |
| UTS1 | 6.50 | 7.10 ± 0.12 | 7.39 ± 0.23 |
| SAH1 | 5.93 | 5.85 ± 0.56 | 5.79 ± 0.97 |
| TIE1 | 2.36 | 3.14 ± 0.85 | 3.34 ± 0.63 |
| TUT1 | 4.43 | 6.46 ± 0.19 | 6.80 ± 0.21 |
| TUT2 | 8.37 | 9.46 ± 0.62 | 9.46 ± 0.39 |
| TUT3 | 7.76 | 7.65 ± 0.13 | 7.71 ± 0.25 |
| TUT4 | 5.20 | 5.38 ± 0.09 | 5.71 ± 0.09 |
| TUT5 | 5.22 | 6.19 ± 0.22 | 6.43 ± 0.26 |
| SOD1 | 2.43 | 2.56 ± 0.10 | 2.59 ± 0.07 |
| SOD2 | 1.54 | 1.62 ± 0.08 | 1.60 ± 0.11 |
| SOD6 | 3.47 | 3.52 ± 0.11 | 3.32 ± 0.13 |
| Accuracy (%) | |||
|---|---|---|---|
| Dataset | GraphSAGE (Transductive) |
GraphSAGE (Inductive) |
|
| UJI1 | 95.28 ± 0.80 | 94.96 ± 0.39 | |
| UTS1 | 95.90 ± 0.35 | 95.59 ± 0.52 | |
| SAH1 | 88.40 ± 6.92 | 81.60 ± 4.54 | |
| TIE1 | 6.60 ± 18.48 | 2.40 ± 3.75 | |
| TUT1 | 91.41 ± 0.82 | 90.43 ± 0.41 | |
| TUT2 | 92.78 ± 0.92 | 92.78 ± 2.23 | |
| TUT3 | 93.76 ± 0.34 | 95.07 ± 0.24 | |
| TUT4 | 95.55 ± 0.42 | 95.34 ± 0.50 | |
| TUT5 | 98.70 ± 0.55 | 98.66 ± 0.80 | |
| SOD1 | 100.00 ± 0.00 | 100.00 ± 0.00 | |
-
notebooks/:
Jupyter notebooks used as the working environment.evaluation.ipynb: Optimization, training and evaluation of graph neural networks.
-
src/:
Python modules containing the core classes and functions used throughout the notebooks.indoorloc_data.py: Manages data loading and processing, including graph construction.indoorloc_optimizer.py: Manages model optimization.indoorloc_trainer.py: Manages model training and evaluation.indoorloc_models.py: Contains the GNN models.indoorloc_viz.py: Manages the generation of plots.indoorloc_enums.py: Contains constants and enums used in the other modules.
Install all dependencies listed in requirements.txt:
pip install -r requirements.txt


