# A Generative Method for Indoor Localization Using Wi-Fi Fingerprinting

^{*}

## Abstract

**:**

## 1. Introduction

- To model the Wi-Fi signal received from a WAP by means of an HMM to preserve the temporal autocorrelation present in real data.
- To estimate indoor user’s location by means of the forward algorithm for HMM.
- To compare the performance of the proposed method with the performances of other well-known Machine Learning algorithms used for indoor localization through extensive experiments.

## 2. Previous Work

## 3. Background

#### 3.1. Wi-Fi Received Signal Strength Indicator Modeling

#### 3.2. Wi-Fi Fingerprinting for Indoor Localization

#### 3.3. Machine Learning for Indoor Localization

#### 3.4. Hidden Markov Models

- The number of hidden states H. An individual state is denoted as:$$S\in \{{S}_{1},{S}_{2},\dots ,{S}_{H}\}$$
- The number of different observation symbols M. An individual symbol is denoted as:$$V\in \{{V}_{1},{V}_{2},\dots {V}_{M}\}$$
- The probability distributions for transitions between two states:$$A=\left\{{a}_{ij}\right\}\phantom{\rule{4.pt}{0ex}}\mathrm{where}:\phantom{\rule{4.pt}{0ex}}{a}_{ij}=P[{q}_{t+1}={S}_{j}|{q}_{t}={S}_{i}],\phantom{\rule{1.em}{0ex}}1\le i,j\le H$$
- The probability distribution for observing a symbol in state j:$$B=\left\{{b}_{j}\left(k\right)\right\}\phantom{\rule{4.pt}{0ex}}\mathrm{where}:\phantom{\rule{4.pt}{0ex}}{b}_{j}\left(k\right)=P\left[{v}_{k}\phantom{\rule{4pt}{0ex}}at\phantom{\rule{4pt}{0ex}}t\right|{q}_{t}={S}_{j}],\phantom{\rule{1.em}{0ex}}1\le j\le N,\phantom{\rule{0.277778em}{0ex}}1\le k\le M$$
- The probability distributions for initial states:$${\pi}_{i}=P[{q}_{1}={S}_{i}],\phantom{\rule{1.em}{0ex}}1\le i\le H$$

## 4. Methods

#### 4.1. Wi-Fi Received Signal Strength Indicator Modeling

#### 4.2. Location Algorithm

#### 4.2.1. Offline Phase

#### 4.2.2. Online Phase

## 5. Experiments and Results

#### 5.1. Data Acquisition and Preparation

#### 5.2. Performance Comparison

## 6. Discussion

## 7. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Maskeliūnas, R.; Damaševičius, R.; Segal, S. A Review of Internet of Things Technologies for Ambient Assisted Living Environments. Future Internet
**2019**, 11, 259. [Google Scholar] [CrossRef] [Green Version] - Nižetić, S.; Šolić, P.; López-de-Ipiña González-de-Artaza, D.; Patrono, L. Internet of Things (IoT): Opportunities, issues and challenges towards a smart and sustainable future. J. Clean. Prod.
**2020**, 274, 122877. [Google Scholar] [CrossRef] - Zhuang, Y.; Yang, J.; Li, Y.; Qi, L.; El-Sheimy, N. Smartphone-Based Indoor Localization with Bluetooth Low Energy Beacons. Sensors
**2016**, 16, 596. [Google Scholar] [CrossRef] [Green Version] - Cobos, M.; Perez-Solano, J.J.; Belmonte, O.; Ramos, G.; Torres, A.M. Simultaneous ranging and self-positioning in unsynchronized wireless acoustic sensor networks. IEEE Trans. Signal Process.
**2016**, 64, 5993–6004. [Google Scholar] [CrossRef] [Green Version] - Dawes, B.; Chin, K.W. A comparison of deterministic and probabilistic methods for indoor localization. J. Syst. Softw.
**2010**, 84, 442–451. [Google Scholar] [CrossRef] - Li, M.; Liu, N.; Niu, Q.; Liu, C.; Chan, S.H.G.; Gao, C. SweepLoc: Automatic Video-Based Indoor Localization by Camera Sweeping. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol.
**2018**, 2. [Google Scholar] [CrossRef] - Pirzada, N.; Nayan, M.Y.; Subhan, F.; Hassan, M.F.; Khan, M.A. Comparative Analysis of Active and Passive Indoor Localization Systems. AASRI Procedia
**2013**, 5, 92–97. [Google Scholar] [CrossRef] - Alarifi, A.; Al-Salman, A.; Alsaleh, M.; Alnafessah, A.; Al-Hadhrami, S.; Al-Ammar, M.A.; Al-Khalifa, H.S. Ultra Wideband Indoor Positioning Technologies: Analysis and Recent Advances. Sensors
**2016**, 16, 707. [Google Scholar] [CrossRef] [PubMed] - Huang, X.; Guo, S.; Wu, Y.; Yang, Y. A fine-grained indoor fingerprinting localization based on magnetic field strength and channel state information. Pervasive Mob. Comput.
**2017**, 41, 150–165. [Google Scholar] [CrossRef] - Ni, L.M.; Liu, L.; Lau, Y.C.; Patil, A.P. LANDMARC: Indoor location sensing using active RFID. In Proceedings of the First IEEE International Conference on Pervasive Computing and Communications, (PerCom 2003), Fort Worth, TX, USA, 23–26 March 2003; pp. 407–415. [Google Scholar] [CrossRef]
- Belmonte-Fernández, O.; Puertas-Cabedo, A.; Torres-Sospedra, J.; Montoliu-Colás, R.; Trilles-Oliver, S. An Indoor Positioning System Based on Wearables for Ambient-Assisted Living. Sensors
**2017**, 17, 36. [Google Scholar] [CrossRef] - He, S.; Chan, S.H.H. Wi-Fi fingerprint-based indoor positioning: Recent advances and comparisons. IEEE Commun. Surv. Tutorials
**2016**, 18, 466–490. [Google Scholar] [CrossRef] - Mohamed, E.M.; Sakaguchi, K.; Sampei, S. Millimeter wave beamforming based on WiFi fingerprinting in indoor environment. In Proceedings of the 2015 IEEE International Conference on Communication Workshop (ICCW), London, UK, 8–12 June 2015; pp. 1155–1160. [Google Scholar] [CrossRef] [Green Version]
- Makki, A.; Siddig, A.; Saad, M.; Bleakley, C. Survey of WiFi positioning using time-based techniques. Comput. Netw.
**2015**, 88, 218–233. [Google Scholar] [CrossRef] [Green Version] - Youssef, M.; Agrawala, A. The Horus location determination system. Wirel. Netw.
**2008**, 14, 357–374. [Google Scholar] [CrossRef] - Kotaru, M.; Joshi, K.; Bharadia, D.; Katti, S. SpotFi: Decimeter Level Localization Using WiFi. SIGCOMM Comput. Commun. Rev.
**2015**, 45, 269–282. [Google Scholar] [CrossRef] - Zucchini, W.; MacDonald, I.L.; Langrock, R. Hidden Markov Models for Time Series: An Introduction Using R; Chapman and Hall/CRC: Boca Raton, FL, USA, 2016. [Google Scholar]
- Baum, L.E.; Petrie, T.; Soules, G.; Weiss, N. A maximization technique occurring in the statistical analysis of probabilistic functions of Markov chains. Ann. Math. Stat.
**1970**, 41, 164–171. [Google Scholar] [CrossRef] - Obeidat, H.; Shuaieb, W.; Obeidat, O.; Abd-Alhameed, R. A Review of Indoor Localization Techniques and Wireless Technologies. Wirel. Pers. Commun.
**2021**, 1–39. [Google Scholar] [CrossRef] - Dang, X.; Si, X.; Hao, Z.; Huang, Y. A Novel Passive Indoor Localization Method by Fusion CSI Amplitude and Phase Information. Sensors
**2019**, 19, 875. [Google Scholar] [CrossRef] [Green Version] - Bahl, P.; Padmanabhan, V.N. RADAR: An in-building RF-based user location and tracking system. In Proceedings of the IEEE INFOCOM 2000, Conference on Computer Communications, Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies (Cat. No.00CH37064), Tel Aviv, Israel, 26–30 March 2000; Volume 2, pp. 775–784. [Google Scholar] [CrossRef]
- Roos, T.; Myllymäki, P.; Tirri, H.; Misikangas, P.; Sievänen, J. A Probabilistic Approach to WLAN User Location Estimation. Int. J. Wirel. Inf. Netw.
**2002**, 9. [Google Scholar] [CrossRef] - Kushki, A.; Plataniotis, K.N.; Venetsanopoulos, A.N. Kernel-Based Positioning in Wireless Local Area Networks. IEEE Trans. Mob. Comput.
**2007**, 6, 689–705. [Google Scholar] [CrossRef] [Green Version] - Qi, C.; Gaoming, H.; Shiqiong, S. WLAN user location estimation based on receiving signal strength indicator. In Proceedings of the 5th International Conference on Wireless Communications, Networking and Mobile Computing, WiCOM 2009, Beijing, China, 24–26 September 2009; IEEE: Piscataway, NJ, USA, 2009; pp. 1–4. [Google Scholar] [CrossRef]
- Bisio, I.; Lavagetto, F.; Marchese, M.; Sciarrone, A. Smart probabilistic fingerprinting for WiFi-based indoor positioning with mobile devices. Pervasive Mob. Comput.
**2016**, 31, 107–123. [Google Scholar] [CrossRef] - Carrera, V.J.L.; Zhao, Z.; Braun, T. Room Recognition Using Discriminative Ensemble Learning with Hidden Markov Models for Smartphones. In Proceedings of the 2018 IEEE 29th Annual International Symposium on Personal, Indoor and Mobile Radio Communications (PIMRC), Bologna, Italy, 9–12 September 2018; pp. 1–7. [Google Scholar] [CrossRef]
- Roy, P.; Chowdhury, C.; Kundu, M.; Ghosh, D.; Bandyopadhyay, S. Novel weighted ensemble classifier for smartphone based indoor localization. Expert Syst. Appl.
**2021**, 164, 113758. [Google Scholar] [CrossRef] - Wang, Y.; Gao, J.; Li, Z.; Zhao, L. Robust and Accurate Wi-Fi Fingerprint Location Recognition Method Based on Deep Neural Network. Appl. Sci.
**2020**, 10, 321. [Google Scholar] [CrossRef] [Green Version] - Zhang, L.; Tan, T.; Gong, Y.; Yang, W. Fingerprint Database Reconstruction Based on Robust PCA for Indoor Localization. Sensors
**2019**, 19, 2537. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Belmonte-Fernández, O.; Montoliu, R.; Torres-Sospedra, J.; Sansano-Sansano, E.; Chia-Aguilar, D. A radiosity-based method to avoid calibration for indoor positioning systems. Expert Syst. Appl.
**2018**, 105, 89–101. [Google Scholar] [CrossRef] - Kaemarungsi, K.; Krishnamurthy, P. Properties of indoor received signal strength for WLAN location fingerprinting. In Proceedings of the First Annual International Conference on Mobile and Ubiquitous Systems: Networking and Services, MOBIQUITOUS 2004, Boston, MA, USA, 22–26 August 2004; IEEE: Piscataway, NJ, USA, 2004; pp. 14–23. [Google Scholar]
- Kaemarungsi, K.; Krishnamurthy, P. Analysis of WLAN’s received signal strength indication for indoor location fingerprinting. Pervasive Mob. Comput.
**2012**, 8, 292–316. [Google Scholar] [CrossRef] - Bose, A.; Foh, C.H. A practical path loss model for indoor WiFi positioning enhancement. In Proceedings of the Information, Communications & Signal Processing, 2007 6th International Conference on IEEE, Minneapolis, MN, USA, 28–30 June 2007; pp. 1–5. [Google Scholar]
- Liu, H.; Darabi, H.; Banerjee, P.; Liu, J. Survey of wireless indoor positioning techniques and systems. IEEE Trans. Syst. Man Cybern. Part C (Appl. Rev.)
**2007**, 37, 1067–1080. [Google Scholar] [CrossRef] - Yiu, S.; Dashti, M.; Claussen, H.; Perez-Cruz, F. Wireless RSSI fingerprinting localization. Signal Process.
**2017**, 131, 235–244. [Google Scholar] [CrossRef] - Rumelhart, D.E.; Hinton, G.E.; Williams, R.J. Learning Internal Representations by Error Propagation; Technical Report; California Univ San Diego La Jolla Inst for Cognitive Science: La Jolla, CA, USA, 1985. [Google Scholar]
- Saleem, F.; Wyne, S. Wlan–Based Indoor Localization Using Neural Networks. J. Electr. Eng.
**2016**, 67. [Google Scholar] [CrossRef] [Green Version] - Zhang, W.; Wang, L.; Qin, Z.; Zheng, X.; Sun, L.; Jin, N.; Shu, L. INBS: An Improved Naive Bayes Simple learning approach for accurate indoor localization. In Proceedings of the 2014 IEEE International Conference on Communications (ICC), Sydney, Australia, 10–14 June 2014; pp. 148–153. [Google Scholar] [CrossRef]
- Breiman, L. Random forests. Mach. Learn.
**2001**, 45, 5–32. [Google Scholar] [CrossRef] [Green Version] - Jedari, E.; Zheng, W.; Rashidzadeh, R.; Saif, M. Wi-Fi based indoor location positioning employing random forest classifier. In Proceedings of the 2015 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Banff, AB, Canada, 13–16 October 2015; pp. 1–5. [Google Scholar] [CrossRef]
- Calderoni, L.; Ferrara, M.; Franco, A.; Maio, D. Indoor localization in a hospital environment using Random Forest classifiers. Expert Syst. Appl.
**2015**, 42, 125–134. [Google Scholar] [CrossRef] - Wang, Y.; Xiu, C.; Zhang, X.; Yang, D. WiFi Indoor Localization with CSI Fingerprinting-Based Random Forest. Sensors
**2018**, 18, 2869. [Google Scholar] [CrossRef] [Green Version] - Rabiner, L.R. A tutorial on hidden Markov models and selected applications in speech recognition. Proc. IEEE
**1989**, 77, 257–286. [Google Scholar] [CrossRef] - Jurafsky, D. Speech & Language Processing; Pearson Education India: Chennai, India, 2000. [Google Scholar]
- Brockwell, P.J.; Davis, R.A.; Fienberg, S.E. Time Series: Theory and Methods; Springer Science & Business Media: New York, NY, USA, 1991. [Google Scholar]
- McElreath, R. Statistical Rethinking: A Bayesian Course with Examples in R and Stan; CRC Press: Boca Raton, FL, USA, 2016; Volume 122. [Google Scholar]
- Kullback, S.; Leibler, R.A. On Information and Sufficiency. Ann. Math. Statist.
**1951**, 22, 79–86. [Google Scholar] [CrossRef] - Sabanci, K.; Yigit, E.; Ustun, D.; Toktas, A.; Aslan, M.F. WiFi Based Indoor Localization: Application and Comparison of Machine Learning Algorithms. In Proceedings of the 2018 XXIIIrd International Seminar/Workshop on Direct and Inverse Problems of Electromagnetic and Acoustic Wave Theory (DIPED), Tbilisi, Georgia, 24–27 September 2018; pp. 246–251. [Google Scholar] [CrossRef]
- Hall, M.; Frank, E.; Holmes, G.; Pfahringer, B.; Reutemann, P.; Witten, I.H. The WEKA data mining software: An update. SIGKDD Explor.
**2009**, 11, 10–18. [Google Scholar] [CrossRef] - Demšar, J. Statistical Comparisons of Classifiers over Multiple Data Sets. J. Mach. Learn. Res.
**2006**, 7, 1–30. [Google Scholar] - Nemenyi, P. Distribution-free multiple comparisons. In Biometrics. International Biometric Soc 1441 I ST, NW, SUITE 700, WASHINGTON, DC 20005-2210; John Wiley & Sons Inc.: Hoboken, NJ, USA, 1962; Volume 18, p. 263. [Google Scholar]
- Leng, Y.; Musiek, E.S.; Hu, K.; Cappuccio, F.P.; Yaffe, K. Association between circadian rhythms and neurodegenerative diseases. Lancet Neurol.
**2019**, 18, 307–318. [Google Scholar] [CrossRef] - Dawadi, P.N.; Cook, D.J.; Schmitter-Edgecombe, M. Automated cognitive health assessment from smart home-based behavior data. IEEE J. Biomed. Health Inform.
**2015**, 20, 1188–1194. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Harada, K.; Lee, S.; Lee, S.; Bae, S.; Harada, K.; Suzuki, T.; Shimada, H. Objectively-measured outdoor time and physical and psychological function among older adults. Geriatr. Gerontol. Int.
**2016**, 17, 1455–1462. [Google Scholar] [CrossRef] [Green Version] - Alberdi, A.; Weakley, A.; Schmitter-Edgecombe, M.; Cook, D.J.; Aztiria, A.; Basarab, A.; Barrenechea, M. Smart Home-Based Prediction of Multidomain Symptoms Related to Alzheimer’s Disease. IEEE J. Biomed. Health Inform.
**2018**, 22, 1720–1731. [Google Scholar] [CrossRef] [Green Version] - Galambos, C.; Skubic, M.; Wang, S.; Rantz, M. Management of dementia and depression utilizing in-home passive sensor data. Gerontechnol. Int. J. Fundam. Asp. Technol. Serve Ageing Soc.
**2013**, 11, 457. [Google Scholar] [CrossRef] [Green Version]

**Figure 1.**A graphical representation of an HMM with two hidden states on the left. On the right are transitions between a series of states and the observations emitted in each state.

**Figure 2.**An example of an Received Signal Strength Indicator (RSSI) time series for a Wireless Access Point (WAP) (

**left**column), its histogram (

**middle**column), and its autocorrelation (

**right**column), with real data on the top row, Gaussian simulated data in the middle row, and HMM simulated data along the bottom row.

**Figure 3.**On the left, how most indoor localization methods perform location estimation: a single vector of RSSI samples received from different WAPs is used to estimate the location (horizontal grouping); then several estimations are combined to generate the final estimation. In the method presented in this paper (

**right**), a vector of RSSI samples received from the same WAP is used to estimate the location (vertical grouping); then several estimations are combined to generate the final estimation. A sample size of 5 is given as an example. Colors have been used to show the different paths through which the data are processed in both approximations.

**Figure 4.**Offline phase. For each room (R) and for each time series received from a WAP present in the Wi-Fi fingerprint database, an HMM was built. Different rooms will have different parameters in their HMMs for the same WAP. Common rooms in an apartment are used in this particular example: $K,$$B,$ and L stand for kitchen, bedroom, and living room.

**Figure 5.**An example of an offline phase. For each room (bedroom, kitchen, and living room), and for each time series received from a WAP present in the environment (10 in this example), an HMM was built. Note that the set of training samples is different for the three locations: bedroom, kitchen, and living room.

**Figure 6.**An example of the offline phase. For each room (bedroom, kitchen, and living room) and for each time series received from a WAP present in the environment (10 in this example), an HMM was built. Note that for each sequence of 5 samples arriving from a WAP (same color), each of the 10 HMMs provides a probability using the forward algorithm. The probability of being at rooms {bedroom, kitchen, living room} is evaluated as the product of the 10 previous probabilities. Finally, the estimated room $\widehat{R}$ is such that it provides the maximum product.

**Figure 7.**Performance comparison for user 1. Each curve plots the successful rate (percentage) as a function of the number of consecutive samples used for classification (sample size). Each Wi-Fi database contained 100 samples per room for building the model.

**Figure 8.**Performance comparison for user 2. Each curve plots the successful rate (percentage) as a function of the number of consecutive samples used for classification (sample size). Each Wi-Fi database contained 100 samples per room for building the model.

**Figure 9.**Performance comparison for user 3. Each curve plots the successful rate (percentage) as a function of the number of consecutive samples used for classification (sample size). Each Wi-Fi database contained 100 samples per room for building the model.

**Figure 10.**Performance comparison. Each curve plots the successful rate (percentage) as a function of the number of consecutive samples used for classification (sample size). Each Wi-Fi database contained 300 samples per room for building the model (100 at the center of the room, 100 from random walking, and 100 in the most common location in the room).

**Figure 11.**Comparison of the performances of methods using the Nemenyi test. CD is critical distance.

**Table 1.**Entropy $H\left(P\right)$, Kullback–Leibler divergence ${D}_{KL}\left(P\right|Q)$, and cross-entropy $H(P,Q)$ for the empirical probability distribution functions of real data P and simulated data generated with a Gaussian probability distribution function and an HMM model with 2, 3, and 4 states Q. Fifty iterations were performed to build the HMM models; 10,000 experiments with 1000 samples each were done.

Entropy | ||
---|---|---|

Real data | 2.633 | |

KL-divergence | Cross-Entropy | |

Gaussian simulated | 0.121 ± 0.018 | 2.752 ± 0.018 |

HMM (2 states) simulated | 0.023 ± 0.001 | 2.655 ± 0.024 |

HMM (3 states) simulated | 0.023 ± 0.001 | 2.656 ± 0.022 |

HMM (4 states) simulated | 0.024 ± 0.001 | 2.658 ± 0.024 |

**Table 2.**Total number of different WAPs detected at each environment, and the number of samples taken in different rooms.

Environment | Number of | Total | Test Samples at | |||||
---|---|---|---|---|---|---|---|---|

Code Name | WAPs | Test Samples | Bathroom | Kitchen | Dining Room | Office | Bedroom | Living Room |

User1 | 34 | 17,410 | 480 (2.76%) | 995 (5.76%) | 1261 (7.23%) | 1214 (6.93%) | 6570 (37.72%) | 6890 (39.57%) |

User2 | 74 | 17,953 | 325 (1.81%) | 907 (5.05%) | 1493 (8.32%) | 7709 (42.94%) | 7519 (41.88%) | - |

User3 | 88 | 17,022 | - | 360 (2.11%) | 1035 (6.08%) | 14202 (83.43%) | 1425 (8.37%) | - |

**Table 3.**Summary of the data shown in Figure 7. The rows for minimum (min.), maximum (max.), average (avg.), and difference (diff.) are given in percentages of successful classification experiments. The row labeled as size is for the corresponding sample size. The row labeled as #best is for the number of times the corresponding algorithm provided the best results.

User1_Centre | User1_Walking | User1_Common | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | |

min. (%) | 43.09 | 53.77 | 70.20 | 45.51 | 57.50 | 42.61 | 58.24 | 64.01 | 61.05 | 54.14 | 35.60 | 52.03 | 73.46 | 47.37 | 66.39 |

sample size | 20 | 2 | 1 | 2 | 1 | 19 | 2 | 1 | 1 | 1 | 20 | 2 | 1 | 5 | 1 |

max. (%) | 55.28 | 64.29 | 77.88 | 51.61 | 64.98 | 50.74 | 67.63 | 70.62 | 67.42 | 57.50 | 44.81 | 64.62 | 82.15 | 53.06 | 76.01 |

sample size | 12 | 19 | 19 | 20 | 20 | 1 | 14 | 20 | 17 | 19 | 11 | 19 | 19 | 18 | 19 |

avg. (%) | 51.74 | 61.02 | 75.61 | 48.76 | 62.13 | 45.76 | 64.36 | 68.07 | 65.01 | 56.01 | 42.14 | 59.33 | 79.16 | 50.82 | 72.76 |

diff. (%) | 23.87 | 14.59 | 0.00 | 26.85 | 13.49 | 22.31 | 3.71 | 0.00 | 3.06 | 12.05 | 37.03 | 19.84 | 0.00 | 28.34 | 6.41 |

#best | 0 | 0 | 20 | 0 | 0 | 0 | 0 | 20 | 0 | 0 | 0 | 0 | 20 | 0 | 0 |

**Table 4.**Summary of the data shown in Figure 8. The rows for minimum (min.), maximum (max.), average (avg.), and difference (diff.) are given in percentages of successful classification experiments. The row labeled as size is for the corresponding sample size. The row labeled as #best is for the number of times the corresponding algorithm provided the best results.

User2_Centre | User2_Walking | User2_Common | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | |

min. (%) | 42.93 | 69.90 | 75.04 | 68.81 | 73.45 | 48.04 | 71.58 | 77.11 | 68.95 | 75.73 | 42.21 | 77.33 | 82.70 | 78.54 | 73.19 |

sample size | 13 | 2 | 1 | 1 | 1 | 20 | 2 | 1 | 1 | 1 | 18 | 2 | 1 | 1 | 1 |

max. (%) | 49.90 | 78.81 | 80.20 | 75.27 | 80.04 | 57.44 | 80.65 | 87.60 | 78.39 | 81.31 | 55.29 | 88.38 | 90.02 | 86.48 | 81.01 |

sample size | 1 | 15 | 18 | 19 | 19 | 1 | 17 | 20 | 18 | 18 | 1 | 20 | 19 | 20 | 20 |

avg. (%) | 45.11 | 75.85 | 78.26 | 72.82 | 77.91 | 51.02 | 77.36 | 84.02 | 74.76 | 79.36 | 44.97 | 83.55 | 87.44 | 83.14 | 78.06 |

diff. (%) | 33.29 | 2.55 | 0.14 | 5.58 | 0.49 | 32.99 | 6.66 | 0.00 | 9.25 | 4.65 | 42.47 | 3.89 | 0.00 | 4.30 | 9.38 |

#best | 0 | 0 | 12 | 0 | 8 | 0 | 0 | 20 | 0 | 0 | 0 | 0 | 20 | 0 | 0 |

**Table 5.**Summary of the data shown in Figure 9. The rows for minimum (min.), maximum (max.), average (avg.), and difference (diff.) are given in percentages of successful classification experiments. The row labeled as size is for the corresponding sample size. The row labeled as #best is for the number of times the corresponding algorithm provided the best results.

User3_Centre | User3_Walking | User3_Common | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | |

min. (%) | 71.19 | 14.77 | 63.28 | 58.98 | 24.50 | 41.80 | 35.93 | 77.71 | 51.70 | 58.20 | 66.18 | 47.24 | 71.09 | 62.64 | 59.67 |

sample size | 1 | 19 | 1 | 1 | 19 | 1 | 2 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | 2 |

max. (%) | 84.79 | 21.00 | 74.59 | 63.56 | 26.67 | 83.18 | 48.10 | 85.57 | 59.28 | 65.43 | 87.83 | 64.26 | 79.31 | 72.37 | 68.47 |

sample size | 19 | 5 | 20 | 4 | 1 | 20 | 19 | 19 | 19 | 15 | 15 | 17 | 19 | 17 | 20 |

avg. (%) | 79.79 | 17.29 | 71.56 | 61.90 | 25.64 | 58.76 | 45.05 | 83.30 | 56.54 | 62.82 | 80.01 | 59.64 | 77.16 | 69.11 | 65.32 |

diff. (%) | 0.00 | 62.50 | 8.23 | 17.88 | 54.15 | 24.54 | 38.25 | 0.00 | 26.76 | 20.48 | 1.05 | 21.42 | 3.90 | 11.95 | 15.74 |

#best | 20 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0 | 0 | 12 | 0 | 8 | 0 | 0 |

**Table 6.**Summary of the data shown in Figure 10. The rows for minimum (min.), maximum (max.), average (avg.), and difference (diff.) are given in percentages of successful classification experiments. The row labeled as size is for the corresponding sample size. The row labeled as #best is for the number of times the corresponding algorithm provided the best results.

User1_All | User2_All | User3_All | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | HMM | KNN | RF | NB | MLP | |

min. (%) | 75.20 | 69.52 | 76.14 | 46.69 | 74.13 | 72.86 | 83.79 | 86.71 | 70.57 | 80.08 | 66.18 | 47.24 | 71.09 | 62.64 | 59.67 |

sample size | 1 | 2 | 1 | 2 | 1 | 18 | 2 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | 2 |

max. (%) | 82.12 | 82.49 | 82.60 | 52.03 | 82.58 | 75.30 | 93.41 | 92.46 | 78.77 | 88.16 | 87.83 | 64.26 | 79.31 | 72.37 | 68.47 |

sample size | 14 | 20 | 20 | 19 | 19 | 7 | 20 | 19 | 20 | 20 | 15 | 17 | 19 | 17 | 20 |

avg. (%) | 79.30 | 77.76 | 80.66 | 49.82 | 79.81 | 74.47 | 89.88 | 90.38 | 75.39 | 85.11 | 80.01 | 59.64 | 77.16 | 69.11 | 65.32 |

diff. (%) | 1.49 | 3.03 | 0.13 | 30.97 | 0.98 | 16.16 | 0.75 | 0.25 | 15.24 | 5.52 | 1.05 | 21.42 | 3.90 | 11.95 | 15.74 |

best | 5 | 0 | 14 | 0 | 1 | 0 | 10 | 10 | 0 | 0 | 12 | 0 | 8 | 0 | 0 |

**Table 7.**Results of z-test for comparison of the proposed method (HMM) against the other methods. NS stands for not significant.

Method | z-Value | Significance |
---|---|---|

KNN | 0.0 | NS |

RF | −4.174 | p < 0.01 |

NV | 0.149 | NS |

MLP | −1.192 | NS |

**Table 8.**Mean computational time (miliseconds) and the mean squared for classifying a measure of five consecutive samples for all algorithms. The database used was user2_centre. Each experiment was repeated 100 times.

HMM | KNN | RF | NB | MLP |
---|---|---|---|---|

$0.562\pm 0.012$ | $0.426\pm 0.047$ | $0.111\pm 0.005$ | $0.378\pm 0.007$ | $0.166\pm 0.001$ |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Belmonte-Fernández, Ó.; Sansano-Sansano, E.; Caballer-Miedes, A.; Montoliu, R.; García-Vidal, R.; Gascó-Compte, A.
A Generative Method for Indoor Localization Using Wi-Fi Fingerprinting. *Sensors* **2021**, *21*, 2392.
https://doi.org/10.3390/s21072392

**AMA Style**

Belmonte-Fernández Ó, Sansano-Sansano E, Caballer-Miedes A, Montoliu R, García-Vidal R, Gascó-Compte A.
A Generative Method for Indoor Localization Using Wi-Fi Fingerprinting. *Sensors*. 2021; 21(7):2392.
https://doi.org/10.3390/s21072392

**Chicago/Turabian Style**

Belmonte-Fernández, Óscar, Emilio Sansano-Sansano, Antonio Caballer-Miedes, Raúl Montoliu, Rubén García-Vidal, and Arturo Gascó-Compte.
2021. "A Generative Method for Indoor Localization Using Wi-Fi Fingerprinting" *Sensors* 21, no. 7: 2392.
https://doi.org/10.3390/s21072392