This is the document for the code used in the following paper:
Xuanshu Luo and Nirvana Meratnia. "A Geometric Deep Learning Framework for Accurate Indoor Localization" 2022 International Conference on Indoor Positioning and Indoor Navigation (IPIN). IEEE, 2022.
The code is fully tested in CPU-only environment running Windows 11 Pro 22H2. The following steps should also be applicable in Linux environments.
-
Install
miniconda
. Please see Miniconda — Conda documentation -
Setup the environment.
conda env create -f env.yaml
Note that the environment name is
ipin2022
by default. You can edit thename
field in theenv.yaml
file to specify the env name. -
Activate the environment.
conda activate ipin2022
If you have changed the env name to
your_env_name
, thenconda activate your_env_name
In this paper, two datasets are considered.
-
SoLoc
: https://www.utwente.nl/en/eemcs/ps/dataset-folder/soloc-ipin2017-dataset.zipPaper: Le, Duc V., and Paul JM Havinga. "SoLoc: Self-organizing indoor localization for unstructured and dynamic environments." 2017 International Conference on Indoor Positioning and Indoor Navigation (IPIN). IEEE, 2017.
-
Paper: S. Sadowski, P. Spachos, K. Plataniotis, "Memoryless Techniques and Wireless Technologies for Indoor Localization with the Internet of Things", IEEE Internet of Things Journal.
To run the code, please unzip the datasets above and specify the directories in _config.py
First go to the code directory for the SoLoc
dataset.
cd ./code/SoLoc
Then load the dataset
python 0_load.py
First, please ensure that in ./SoLoc/_config.py
, we keep the setting of WiFi only senario and comment out the setting for the other case
# WiFi only
EDGE_TYPES = ['bidirectWF']
N_AP = N_WIFI
# WiFi + Bluetooth
# EDGE_TYPES = ['bidirectWF', 'bidirectBT']
# N_AP = N_WIFI + N_BLUE
In the WiFi only senario, you can generate two kinds of data, i.e., images and graphs using different command line options.
python 1_preprocess_wf.py i (for images)
python 1_preprocess_wf.py g (for graphs)
We can get seven results here. The w
option means the scripts will consider the WiFi only data.
python 2_knn.py w (wkNN)
python 2_svm.py w (SVM)
python 2_mlp.py w (MLP)
python 2_cnn.py w (CNN)
python 2_hegcn.py --data w --aggr p (GraphSAGE-pool)
python 2_hegcn.py --data w --aggr p --edge (GraphSAGE-pool-edge)
python 2_hegcn.py --data w --aggr l --edge (GraphSAGE-lstm-edge)
First, please ensure that in ./SoLoc/_config.py
, we keep the setting of WiFi+Bluetooth senario and comment out the setting for the WiFi only case.
# WiFi only
# EDGE_TYPES = ['bidirectWF']
# N_AP = N_WIFI
# WiFi + Bluetooth
EDGE_TYPES = ['bidirectWF', 'bidirectBT']
N_AP = N_WIFI + N_BLUE
In this senario, you can generate three kinds of data, i.e., images and homogeneous graphs and heterogeneous graphs using different command line options.
python 1_preprocess_all.py i (for images)
python 1_preprocess_all.py ho (for homo. graphs)
python 1_preprocess_all.py he (for hetero. graphs)
We can get eight results here. The a
option means the scripts will consider data using WiFi and Bluetooth together.
python 2_knn.py a (wkNN)
python 2_svm.py a (SVM)
python 2_mlp.py a (MLP)
python 2_cnn.py a (CNN)
python 2_hogcn.py (HomoGraphSAGE-pool)
python 2_hegcn.py --data a --aggr p (HeteroGraphSAGE-pool)
python 2_hegcn.py --data a --aggr p --edge (HeteroGraphSAGE-pool-edge)
python 2_hegcn.py --data a --aggr l --edge (HeteroGraphSAGE-lstm-edge)
First go to the code directory for the Petros
dataset.
cd ./code/Petros
Note that we only consider the Scenario 1 and 3 in this project.
To load the data in Scenario 1, for example, please run
python 0_load.py 1
First, please ensure that in ./Petros/_config.py
, we keep the setting of Bluetooth only senario and comment out the setting for other cases.
# Bluetooth only
EDGE_TYPES = ['bidirectBT']
N_TOTAL_AP = N_BT
# WiFi only
# EDGE_TYPES = ['bidirectWF']
# N_TOTAL_AP = N_WF
# all together
# EDGE_TYPES = ['bidirectZB', 'bidirectBT', 'bidirectWF']
# N_TOTAL_AP = N_ZB + N_BT + N_WF
In this senario, you can generate two kinds of data, i.e., images and graphs using different command line options.
python 1_preprocess_bt.py 1 i (Scenario 1, images)
python 1_preprocess_bt.py 1 g (Scenario 1, graphs)
We can get seven results here. The 1
and b
option means the scripts will consider the Bluetooth only data in Scenario 1.
python 2_knn.py 1 b (wkNN)
python 2_svm.py 1 b (SVM)
python 2_mlp.py 1 b (MLP)
python 2_cnn.py 1 b (CNN)
python 2_hegcn.py 1 --data b --aggr p (GraphSAGE-pool)
python 2_hegcn.py 1 --data b --aggr p --edge (GraphSAGE-pool-edge)
python 2_hegcn.py 1 --data b --aggr l --edge (GraphSAGE-lstm-edge)
First, please ensure that in ./Petros/_config.py
, we keep the setting of all three RF signals and comment out the setting for other cases.
# Bluetooth only
# EDGE_TYPES = ['bidirectBT']
# N_TOTAL_AP = N_BT
# WiFi only
# EDGE_TYPES = ['bidirectWF']
# N_TOTAL_AP = N_WF
# all together
EDGE_TYPES = ['bidirectZB', 'bidirectBT', 'bidirectWF']
N_TOTAL_AP = N_ZB + N_BT + N_WF
In this senario, you can generate three kinds of data, i.e., images and homogeneous graphs and heterogeneous graphs using different command line options.
python 1_preprocess_all.py 1 i (Scenario 1, images)
python 1_preprocess_all.py 1 ho (Scenario 1, homo. graphs)
python 1_preprocess_all.py 1 he (Scenario 1, hetero. graphs)
We can get eight results here. The 1
and a
option means the scripts will consider the data using all kinds of RF in Scenario 1.
python 2_knn.py 1 a (wkNN)
python 2_svm.py 1 a (SVM)
python 2_mlp.py 1 a (MLP)
python 2_cnn.py 1 a (CNN)
python 2_hogcn.py 1 (HomoGraphSAGE-pool)
python 2_hegcn.py 1 --data a --aggr p (HeteroGraphSAGE-pool)
python 2_hegcn.py 1 --data a --aggr p --edge (HeteroGraphSAGE-pool-edge)
python 2_hegcn.py 1 --data a --aggr l --edge (HeteroGraphSAGE-lstm-edge)
Similarly, for the Scenario 3, please run
python 0_load.py 3
Note that when generating new data, the existing data will be overwritten.
First, please ensure that in ./Petros/_config.py
, we keep the setting of WiFi only senario and comment out the setting for other cases.
# Bluetooth only
# EDGE_TYPES = ['bidirectBT']
# N_TOTAL_AP = N_BT
# WiFi only
EDGE_TYPES = ['bidirectWF']
N_TOTAL_AP = N_WF
# all together
# EDGE_TYPES = ['bidirectZB', 'bidirectBT', 'bidirectWF']
# N_TOTAL_AP = N_ZB + N_BT + N_WF
In this only senario, you can generate two kinds of data, i.e., images and graphs using different command line options.
python 1_preprocess_wf.py 3 i (Scenario 3, images)
python 1_preprocess_wf.py 3 g (Scenario 3, graphs)
We can get seven results here. The 3
and w
option means the scripts will consider the WiFi only data in Scenario 3.
python 2_knn.py 3 w (wkNN)
python 2_svm.py 3 w (SVM)
python 2_mlp.py 3 w (MLP)
python 2_cnn.py 3 w (CNN)
python 2_hegcn.py 3 --data w --aggr p (GraphSAGE-pool)
python 2_hegcn.py 3 --data w --aggr p --edge (GraphSAGE-pool-edge)
python 2_hegcn.py 3 --data w --aggr l --edge (GraphSAGE-lstm-edge)
First, please ensure that in ./Petros/_config.py
, we keep the setting of all three RF signals and comment out the setting for other cases.
# Bluetooth only
# EDGE_TYPES = ['bidirectBT']
# N_TOTAL_AP = N_BT
# WiFi only
# EDGE_TYPES = ['bidirectWF']
# N_TOTAL_AP = N_WF
# all together
EDGE_TYPES = ['bidirectZB', 'bidirectBT', 'bidirectWF']
N_TOTAL_AP = N_ZB + N_BT + N_WF
In this senario, you can generate three kinds of data, i.e., images and homogeneous graphs and heterogeneous graphs using different command line options.
python 1_preprocess_all.py 3 i (Scenario 3, images)
python 1_preprocess_all.py 3 ho (Scenario 3, homo. graphs)
python 1_preprocess_all.py 3 he (Scenario 3, hetero. graphs)
We can get eight results here. The 3
and a
option means the scripts will consider the data using all kinds of RF in Scenario 3.
python 2_knn.py 3 a (wkNN)
python 2_svm.py 3 a (SVM)
python 2_mlp.py 3 a (MLP)
python 2_cnn.py 3 a (CNN)
python 2_hogcn.py 3 (HomoGraphSAGE-pool)
python 2_hegcn.py 3 --data a --aggr p (HeteroGraphSAGE-pool)
python 2_hegcn.py 3 --data a --aggr p --edge (HeteroGraphSAGE-pool-edge)
python 2_hegcn.py 3 --data a --aggr l --edge (HeteroGraphSAGE-lstm-edge)