# Machine Learning Approach towards LoRaWAN Indoor Localization

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

^{2}, using a fingerprinting map based on extreme RSSI and a Boundary Autocorrelation method for comparing online data to stored data.

## 3. Research Methodology

#### 3.1. LoRa/LoRaWAN Message Transmission

#### 3.1.1. LoRa

#### 3.1.2. LoRaWAN

#### 3.1.3. LoRaWAN Architecture

#### 3.1.4. End Devices

#### 3.2. Experimental Setup

#### 3.3. Realization of LoRaWAN-Based Device

#### 3.4. Data Analyses

#### LoRa Data Analyses

- More data was sent from location point 9 in contrast to location point 11. What is more, far more non-NaN data values have been sent from location 9 in contrast to location 11, which can also serve as a distinguishing feature.
- The overlapping is borderline for RSSI values $-118,-117$ and $-116$ in dBm.
- The overlapping occurs for values $-119,-115$ and $-114$ in dBm.

## 4. Machine Learning: A General Overview

- Supervised learning algorithms require external supervision in order to learn how to map input values to output values, where the correct values are provided by the supervisor [47].
- In contrast, unsupervised learning algorithms allow computers to learn how to perform a task using only unlabeled data. These algorithms must be able to identify connections, anomalies, and similarities in the input data, and recognize patterns without any guidance [48].
- Semi-supervised learning is a combination of the two approaches, using both labeled and unlabeled data. These algorithms typically behave like unsupervised learning algorithms, but can be improved by the addition of labeled data [49].
- Reinforcement learning algorithms operate with limited information about the environment and only receive feedback on the quality of their decisions. These algorithms are able to ignore irrelevant details in order to perform effectively and maximize their performance [50].

#### Neural Networks Model

_{i}. Weights are determined according to the relative importance of the inputs in relation to the remaining inputs, while the bias will provide a constant value to the mapping, that can be critical for successful learning [59]. The activation (or transfer) function is the non-linear mapping denoted as $\sigma (.)$ controls the neuron’s output by maintaining it in acceptable range, usually between $[0,1]$ or $[-1,1]$ [60]. Activation functions are classified as linear or non-linear, with non-linear being the most common. Non-linear functions that are frequently used include (ReLU) $\psi \left(x\right)=max(0,x)$, often used in recent years, which has become popular in recent years, as well as more traditional sigmoids functions such as logistic function logistic, $S\left(x\right)=\frac{1}{1+{e}^{-x}}$ and the hyperbolic tangent $\mathsf{\Phi}\left(x\right)=\frac{{e}^{x}-{e}^{-x}}{{e}^{x}+{e}^{-x}}$ [58]. ReLU is typically used in the hidden layer, whilst Sigmoid is generally used in the output layer [61] due to the fact that the Sigmoid function suffers from gradient vanishing, which can substantially slow down the learning process.

#### Algorithm Evaluation Techniques

- Confusion Matrix—A confusion matrix is a tool used to evaluate the performance of a classification model. It is a $N\times N$ matrix, where N is the number of target classes, and compares the actual target values with those predicted by the model. This allows us to see how well the classification model is performing and what types of errors it is making.
- Accuracy—It is defined as the model’s overall accuracy or amount of accurate predictions, and it is given using the formula:$$Accuracy=\frac{TP+TN}{TP+FP+TN+FN},$$
- F1-score—The F1-score is a metric used to evaluate the performance of a classification model. It is calculated by taking the harmonic mean of Precision and Recall. Precision is the number of accurate positive predictions divided by the total number of positive predictions, and Recall is the number of accurate positive predictions divided by the total number of actual positive instances. The F1-score is calculated using the following formula:$$F1=2\xb7\frac{Precision\xb7Recall}{Precision+Recall}$$This metric provides a balanced measure of the model’s performance, considering both precision and recall [45]. The F1-score will take values within the $[0,1]$ range, achieving the minimum for $TP=0$, that is, when all positive samples are misclassified, and the maximum for $FN=FP=0$, which is for perfect classification [63]. When dealing with multi-class cases, F1-Score should include all classes. To do so, we need to incorporate a multi-class measure of Precision and Recall into the harmonic mean. These metrics may have two distinct specifications, resulting in two distinct metrics: Micro F1-Score and Macro F1-Score.
- Average Precision—It is the measure that takes into account both Recall and Precision and can be expressed as a function of recall $p\left(r\right)$ [64]:$$Average\phantom{\rule{4.pt}{0ex}}Precision=\underset{0}{\stackrel{1}{\int}}p\left(r\right)dr.$$

## 5. Results

#### Neural Network Model for Localization

## 6. Discussion

## 7. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

IoT | Internet of Things |

RSSI | Received Signal Strength Indication |

SNR | Signal-to-noise ratio |

LPWA | Low Power Wide Area |

LoRa | Long Range |

LoRaWAN | Long Range Wide Area Network |

TTN | The Things Network |

CF | Carrier Frequency |

CR | Coding Rate |

SF | Spreading Factor |

BW | Bandwidth |

CRC | Cyclic Redundancy Check |

CSS | Chrip Spread Spectrum |

CAD | Channel Activity Detection |

EDA | Energy Depletion Attack |

ISM | Industrial, Scientific and Medical |

NB-IoT | NarrowBand-Internet of Things |

## References

- Qin, J. Process Data Analytics in the Era of Big Data. AIChE J.
**2014**, 60, 3092–3100. [Google Scholar] [CrossRef] - Dezfouli, B.; Esmaeelzadeh, V.; Sheth, J.; Radi, M. A Review of Software-Defined WLANs: Architectures and Central Control Mechanisms. IEEE Commun. Surv. Tutor.
**2018**, 21, 431–463. [Google Scholar] [CrossRef][Green Version] - Sain, M.; Kang, Y.J.; Lee, H.J. Survey on security in Internet of Things: State of the art and challenges. In Proceedings of the 2017 19th International Conference on Advanced Communication Technology (ICACT), Pyeongchang, Repblic of Korea, 19–22 February 2017; pp. 699–704. [Google Scholar] [CrossRef]
- Sanchez-Iborra, R.; Cano, M.D. State of the Art in LP-WAN Solutions for Industrial IoT Services. Sensors
**2016**, 16, 708. [Google Scholar] [CrossRef] [PubMed] - Centenaro, M.; Vangelista, L.; Zanella, A.; Zorzi, M. Long-range communications in unlicensed bands: The rising stars in the IoT and smart city scenarios. IEEE Wirel. Commun.
**2016**, 23, 60–67. [Google Scholar] [CrossRef][Green Version] - Mangalvedhe, N.; Ratasuk, R.; Ghosh, A. NB-IoT deployment study for low power wide area cellular IoT. In Proceedings of the 2016 IEEE 27th Annual International Symposium on Personal, Indoor, and Mobile Radio Communications (PIMRC), Valencia, Spain, 4–8 September 2016; pp. 1–6. [Google Scholar] [CrossRef]
- SubPos—Open Source WiFi Positioning System. Available online: http://www.subpos.org (accessed on 21 May 2017).
- John Dian, F.; Vahidnia, R.; Rahmati, A. Wearables and the Internet of Things (IoT), Applications, Opportunities, and Challenges: A Survey. IEEE Access
**2020**, 8, 69200–69211. [Google Scholar] [CrossRef] - Awolusi, I.; Marks, E.; Hallowell, M. Wearable technology for personalized construction safety monitoring and trending: Review of applicable devices. Autom. Constr.
**2018**, 85, 96–106. [Google Scholar] [CrossRef] - Asaad, S.M.; Maghdid, H.S. A Comprehensive Review of Indoor/Outdoor Localization Solutions in IoT Era: Research Challenges and Future Perspectives. Comput. Netw.
**2022**, 212, 109041. [Google Scholar] [CrossRef] - Ometov, A.; Shubina, V.; Klus, L.; SkibiÅska, J.; Saafi, S.; Pascacio, P.; Flueratoru, L.; Gaibor, D.Q.; Chukhno, N.; Chukhno, O.; et al. A Survey on Wearable Technology: History, State-of-the-Art and CurrentÂ Challenges. Comput. Netw.
**2021**, 193, 108074. [Google Scholar] [CrossRef] - Yang, C.; Shao, H. WiFi-based indoor positioning. IEEE Commun. Mag.
**2015**, 53, 150–157. [Google Scholar] [CrossRef] - Hsieh, H.Y.; Prakosa, S.W.; Leu, J.Š. Towards the Implementation of Recurrent Neural Network Schemes for WiFi Fingerprint-Based Indoor Positioning. In Proceedings of the 2018 IEEE 88th Vehicular Technology Conference (VTC-Fall), Chicago, IL, USA, 27–30 August 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–5. [Google Scholar]
- Liedmann, F.; Holewa, C.; Wietfeld, C. The radio field as a sensor—A segmentation based soil moisture sensing approach. In Proceedings of the 2018 IEEE Sensors Applications Symposium, SAS 2018, Seoul, South Korea, 12–14 March 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–6. [Google Scholar]
- Liedmann, F.; Wietfeld, C. SoMoS—A Multidimensional Radio Field Based Soil Moisture Sensing System. In Proceedings of the IEEE Sensors, Glasgow, UK, 29 October–1 November 2017. [Google Scholar]
- Anagnostopoulos, G.G.; Kalousis, A. A Reproducible Comparison of RSSI Fingerprinting Localization Methods Using LoRaWAN. In Proceedings of the 2019 16th Workshop on Positioning, Navigation and Communications (WPNC), Bremen, Germany, 23–24 October 2019; pp. 1–6. [Google Scholar] [CrossRef][Green Version]
- Kotaru, M.; Joshi, K.; Bharadia, D.; Katti, S. SpotFi: Decimeter Level Localization Using WiFi. In Proceedings of the 2015 ACM Conference on Special Interest Group on Data Communication, London, UK, 17–21 August 2015; Association for Computing Machinery: New York, NY, USA, 2015; pp. 269–282. [Google Scholar] [CrossRef]
- Soltanaghaei, E.; Kalyanaraman, A.; Whitehouse, K. Multipath Triangulation: Decimeter-Level WiFi Localization and Orientation with a Single Unaided Receiver. In Proceedings of the 16th Annual International Conference on Mobile Systems, Applications, and Services, Munich, Germany, 10–15 June 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 376–388. [Google Scholar] [CrossRef]
- Vasisht, D.; Kumar, S.; Katabi, D. Decimeter-Level Localization with a Single WiFi Access Point. In Proceedings of the 13th Usenix Conference on Networked Systems Design and Implementation, Santa Clara, CA, USA, 16–18 March 2016; USENIX Association: Santa Clara, CA, USA, 2016; pp. 165–178. [Google Scholar]
- Xiong, J.; Sundaresan, K.; Jamieson, K. ToneTrack: Leveraging Frequency-Agile Radios for Time-Based Indoor Wireless Localization. In Proceedings of the 21st Annual International Conference on Mobile Computing and Networking, Paris, France, 7–11 September 2015; Association for Computing Machinery: New York, NY, USA, 2015; pp. 537–549. [Google Scholar] [CrossRef][Green Version]
- Bargh, M.S.; de Groote, R. Indoor Localization Based on Response Rate of Bluetooth Inquiries. In Proceedings of the First ACM International Workshop on Mobile Entity Localization and Tracking in GPS-Less Environments, San Francisco, CA, USA, 14–19 September 2008; Association for Computing Machinery: New York, NY, USA, 2008; pp. 49–54. [Google Scholar] [CrossRef]
- Hou, X.; Arslan, T. Monte Carlo localization algorithm for indoor positioning using Bluetooth low energy devices. In Proceedings of the 2017 International Conference on Localization and GNSS (ICL-GNSS), Nottingham, UK, 27–29 June 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Lazik, P.; Rajagopal, N.; Shih, O.; Sinopoli, B.; Rowe, A. ALPS: A Bluetooth and Ultrasound Platform for Mapping and Localization. In Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems, Seoul, Republic of Korea, 1–4 November 2015; Association for Computing Machinery: New York, NY, USA, 2015; pp. 73–84. [Google Scholar] [CrossRef]
- Kumar, S.; Hamed, E.; Katabi, D.; Erran Li, L. LTE Radio Analytics Made Easy and Accessible. In Proceedings of the 2014 ACM Conference on SIGCOMM, Chicago, IL, USA, 17–22 August 2014; Association for Computing Machinery: New York, NY, USA, 2014; pp. 211–222. [Google Scholar] [CrossRef]
- Sun, G.; Chen, J.; Guo, W.; Liu, K.R. Signal processing techniques in network-aided positioning: A survey of state-of-the-art positioning designs. IEEE Signal Process. Mag.
**2005**, 22, 12–23. [Google Scholar] [CrossRef] - Ma, Y.; Selby, N.; Adib, F. Minding the Billions: Ultra-Wideband Localization for Deployed RFID Tags. In Proceedings of the 23rd Annual International Conference on Mobile Computing and Networking, Snowbird, UT, USA, 16–20 October 2017; Association for Computing Machinery: New York, NY, USA, 2017; pp. 248–260. [Google Scholar] [CrossRef]
- Nandakumar, R.; Iyer, V.; Gollakota, S. 3D Localization for Sub-Centimeter Sized Devices. In Proceedings of the 16th ACM Conference on Embedded Networked Sensor Systems, Shenzhen, China, 4–7 November 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 108–119. [Google Scholar] [CrossRef]
- Vasisht, D.; Zhang, G.; Abari, O.; Lu, H.M.; Flanz, J.; Katabi, D. In-Body Backscatter Communication and Localization. In Proceedings of the 2018 Conference of the ACM Special Interest Group on Data Communication, Budapest, Hungary, 20–25 August 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 132–146. [Google Scholar] [CrossRef][Green Version]
- Chen, L.; Xiong, J.; Chen, X.; Lee, S.I.; Chen, K.; Han, D.; Fang, D.; Tang, Z.; Wang, Z. WideSee: Towards Wide-Area Contactless Wireless Sensing. In Proceedings of the 17th Conference on Embedded Networked Sensor Systems, New York, NY, USA, 10–13 November 2019; Association for Computing Machinery: New York, NY, USA, 2019; pp. 258–270. [Google Scholar] [CrossRef]
- Sadowski, S.; Spachos, P. RSSI-Based Indoor Localization With the Internet of Things. IEEE Access
**2018**, 6, 30149–30161. [Google Scholar] [CrossRef] - Anjum, M.; Khan, M.A.; Ali Hassan, S.; Mahmood, A.; Gidlund, M. Analysis of RSSI Fingerprinting in LoRa Networks. In Proceedings of the 2019 15th International Wireless Communications & Mobile Computing Conference (IWCMC), Tangier, Morocco, 24–28 June 2019; pp. 1178–1183. [Google Scholar] [CrossRef][Green Version]
- Zhu, H.; Tsang, K.F.; Liu, Y.; Wei, Y.; Wang, H.; Wu, C.K.; Chi, H.R. Extreme RSS Based Indoor Localization for LoRaWAN With Boundary Autocorrelation. IEEE Trans. Ind. Inform.
**2021**, 17, 4458–4468. [Google Scholar] [CrossRef] - Kim, K.; Li, S.; Heydariaan, M.; Smaoui, N.; Gnawali, O.; Suh, W.; Suh, M.J.; Kim, J.I. Feasibility of LoRa for Smart Home Indoor Localization. Appl. Sci.
**2021**, 11, 415. [Google Scholar] [CrossRef] - Fernandes, C.D.; Depari, A.; Sisinni, E.; Ferrari, P.; Flammini, A.; Rinaldi, S.; Pasetti, M. Hybrid indoor and outdoor localization for elderly care applications with LoRaWAN. In Proceedings of the 2020 IEEE International Symposium on Medical Measurements and Applications (MeMeA), Bari, Italy, 1 June–1 July 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Lu, K.; Yue, Y.; Ma, J. Enhanced LoRaWAN RSSI Indoor Localization Based on BP Neural Network. In Proceedings of the 2021 IEEE 4th International Conference on Information Systems and Computer Aided Education (ICISCAE), Dalian, China, 24–26 September 2021; pp. 190–195. [Google Scholar] [CrossRef]
- Liu, J.; Gao, J.; Jha, S.; Hu, W. Seirios: Leveraging Multiple Channels for LoRaWAN Indoor and Outdoor Localization. In Proceedings of the 27th Annual International Conference on Mobile Computing and Networking, New Orleans, LA, USA, 25–29 October 2021; Association for Computing Machinery: New York, NY, USA, 2021; pp. 656–669. [Google Scholar] [CrossRef]
- Bansal, A.; Gadre, A.; Singh, V.; Rowe, A.; Iannucci, B.; Kumar, S. OwLL: Accurate LoRa Localization Using the TV Whitespaces. In Proceedings of the 20th International Conference on Information Processing in Sensor Networks (Co-Located with CPS-IoT Week 18–21 May, 2021); Association for Computing Machinery: New York, NY, USA, 2021; pp. 148–162. [Google Scholar] [CrossRef]
- Guo, D.; Gu, C.; Jiang, L.; Luo, W.; Tan, R. ILLOC: In-Hall Localization with Standard LoRaWAN Uplink Frames. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol.
**2022**, 6, 1–26. [Google Scholar] [CrossRef] - Svertoka, E.; Rusu-Casandra, A.; Burget, R.; Marghescu, I.; Hosek, J.; Ometov, A. LoRaWAN: Lost for Localization? IEEE Sens. J.
**2022**, 22, 23307–23319. [Google Scholar] [CrossRef] - Lora Alliance. LoRaWAN 1.1 Specification, October 2017. Available online: http://lora-alliance.org/lorawan-for-developers (accessed on 28 February 2021).
- Goursaud, C.; Gorce, J.M. Dedicated networks for IoT: PHY/MAC state of the art and challenges. EAI Endorsed Trans. Internet Things
**2015**, 1–11. [Google Scholar] [CrossRef] - LoRa Alliance Technical Committee. Available online: https://lora-alliance.org/resource_hub/lorawan-specification-v1-0-3/ (accessed on 28 February 2021).
- Mitchell, T.M. Machine Learning; McGraw-Hill: New York, NY, USA, 1997. [Google Scholar]
- Turing, A.M. Computing Machinery and Intelligence. Mind
**1950**, 59, 433–460. [Google Scholar] [CrossRef] - Sarkar, D.; Bali, R.; Sharma, T. Practical Machine Learning with Python: A Problem-Solver’s Guide to Building Real-World Intelligent Systems, 1st ed.; Apress: Berkely, CA, USA, 2017. [Google Scholar]
- Zantalis, F.; Koulouras, G.; Karabetsos, S.; Kandris, D. A Review of Machine Learning and IoT in Smart Transportation. Future Internet
**2019**, 11, 94. [Google Scholar] [CrossRef][Green Version] - Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
- Garca, S.; Luengo, J.; Herrera, F. Data Preprocessing in Data Mining; Springer Publishing Company, Incorporated: Berlin/Heidelberg, Germany, 2014. [Google Scholar]
- Mohammed, M.; Khan, M.; Bashier, E. Machine Learning: Algorithms and Applications; Taylor & Francis: Abingdon, UK, 2016. [Google Scholar]
- Ravindran, B. Chapter 23—Relativized hierarchical decomposition of Markov decision processes. In Decision Making; Progress in Brain Research; Elsevier: Amsterdam, The Netherlands, 2013; Volume 202, pp. 465–488. [Google Scholar] [CrossRef]
- Bhattacharya, S.; Somayaji, S.; Gadekallu, T.; Maddikunta, M.A.P. A Review on Deep Learning for Future Smart Cities. Internet Technol. Lett.
**2020**, 5, e187. [Google Scholar] [CrossRef] - Zhu, X.X.; Tuia, D.; Mou, L.; Xia, G.; Zhang, L.; Xu, F.; Fraundorfer, F. Deep Learning in Remote Sensing: A Comprehensive Review and List of Resources. IEEE Geosci. Remote Sens. Mag.
**2017**, 5, 8–36. [Google Scholar] [CrossRef] - Shinde, P.P.; Shah, S. A Review of Machine Learning and Deep Learning Applications. In Proceedings of the 2018 Fourth International Conference on Computing Communication Control and Automation (ICCUBEA), Pune, India, 16–18 August 2018; pp. 1–6. [Google Scholar] [CrossRef]
- Sarkar, D.; Bali, R.; Sharma, T. Practical Machine Learning with Python; Apress: Berkely, CA, USA, 2018. [Google Scholar]
- Abiodun, O.I.; Kiru, M.U.; Jantan, A.; Omolara, A.E.; Dada, K.V.; Umar, A.M.; Linus, O.U.; Arshad, H.; Kazaure, A.A.; Gana, U. Comprehensive Review of Artificial Neural Network Applications to Pattern Recognition. IEEE Access
**2019**, 7, 158820–158846. [Google Scholar] [CrossRef] - Zhou, Y.T.; Chellappa, R. Artificial Neural Networks for Computer Vision/Yi-Tong Zhou, Rama Chellappa; Springer-Verlag: New York, NY, USA, 1992; 170p. [Google Scholar]
- Hewamalage, H.; Bergmeir, C.; Bandara, K. Recurrent Neural Networks for Time Series Forecasting: Current Status and Future Directions. arXiv
**2019**, arXiv:1909.00590. [Google Scholar] [CrossRef] - Dujić Rodić, L.; Perković, T.; Škiljo, M.; Šolić, P. Privacy leakage of LoRaWAN smart parking occupancy sensors. Future Gener. Comput. Syst.
**2023**, 138, 142–159. [Google Scholar] [CrossRef] - Provoost, J.; Wismans, L.; der Drift, S.V.; Kamilaris, A.; Keulen, M.V. Short Term Prediction of Parking Area states Using Real Time Data and Machine Learning Techniques. arXiv
**2019**, arXiv:1911.13178. [Google Scholar] - Hagan, M.T.; Demuth, H.B.; Beale, M. Neural Network Design, 2nd ed.; Oklahoma State University: Stillwater, OK, USA, 2014. [Google Scholar]
- Hayou, S.; Doucet, A.; Rousseau, J. On the Impact of the Activation function on Deep Neural Networks Training. In Proceedings of the 36th International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; Chaudhuri, K., Salakhutdinov, R., Eds.; PMLR: Long Beach, CA, USA, 2019; Volume 97, pp. 2672–2680. [Google Scholar]
- Ho, Y.; Wookey, S. The Real-World-Weight Cross-Entropy Loss Function: Modeling the Costs of Mislabeling. IEEE Access
**2020**, 8, 4806–4813. [Google Scholar] [CrossRef] - Chicco, D.; Jurman, G. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genom.
**2020**, 21, 6. [Google Scholar] [CrossRef][Green Version] - Martin-Abadal, M.; Ruiz-Frau, A.; Hinz, H.; Gonzalez-Cid, Y. Jellytoring: Real-Time Jellyfish Monitoring Based on Deep Learning Object Detection. Sensors
**2020**, 20, 1708. [Google Scholar] [CrossRef][Green Version] - Zeng, X.; Martinez, T. Distribution-Balanced Stratified Cross-Validation for Accuracy Estimation. J. Exp. Theor. Artif. Intell.
**2001**, 12, 1–12. [Google Scholar] [CrossRef] - Dongare, A.; Narayanan, R.; Gadre, A.; Luong, A.; Balanuta, A.; Kumar, S.; Iannucci, B.; Rowe, A. Charm: Exploiting Geographical Diversity through Coherent Combining in Low-Power Wide-Area Networks. In Proceedings of the 2018 17th ACM/IEEE International Conference on Information Processing in Sensor Networks (IPSN), Porto, Portugal, 11–13 April 2018; pp. 60–71. [Google Scholar] [CrossRef]
- Liu, J.; Xu, W.; Jha, S.; Hu, W. Nephalai: Towards LPWAN C-RAN with Physical Layer Compression. In Proceedings of the 26th Annual International Conference on Mobile Computing and Networking, London, UK, 21–25 September 2020; Association for Computing Machinery: New York, NY, USA, 2020. [Google Scholar] [CrossRef]

**Figure 4.**Glamos devices that implement ESP32 microcontroller with WiFi along with RFM95 module with for LoRa communication.

**Figure 11.**Data correlation for RSSI and SNR values for ROOM A509 and location points 9 and 10 for SF 9.

**Figure 12.**Data correlation for RSSI and SNR values for ROOM A509 and location points 9 and 11 for SF 9.

**Figure 14.**Data correlation for RSSI and SNR values for ROOM A507 and location points 9 and 11 for SF 11.

**Figure 15.**Data correlation for RSSI and SNR values for ROOM A507 and location points 10 and 11 for SF11.

**Figure 16.**Data correlation for RSSI and SNR values for ROOM A507 and location points 11 and 12 for SF 11.

Hardware | Software | |
---|---|---|

LoRaWAN GW | ML Machine | |

3 × RPi with iC880A and 10 dBi ant. | Intel [email protected] GHz | Keras2.3.1. |

2 × RPi with RAK831 and 8 dBi ant. | 16 GB of RAM | cuDNN |

NVIDIA GeForce GTX 1050 |

Hyper Parameter | Values |
---|---|

Number of neurons | Layer1—192, Layer2—96, Layer3—24 |

Learning rate | 0.001, 0.01 |

Number of epochs | 50, 100, 150 |

Batch size | 64 |

**Table 3.**Results of first Neural Network model for Adaptive Moment Optimization (Adam) optimizer using signal strength data from LoRa.

Learn. Rate | Epochs | Acc. | Macro Avg | Weighted Avg | |||||
---|---|---|---|---|---|---|---|---|---|

Precision | Recall | F-Score | Precision | Recall | F-Score | ||||

train | 0.01 | 50 | 0.9428 | 0.9467 | 0.9345 | 0.9339 | 0.9523 | 0.9428 | 0.9419 |

val | 0.01 | 50 | 0.9375 | 0.9432 | 0.9280 | 0.9263 | 0.9502 | 0.9375 | 0.9361 |

test | 0.01 | 50 | 0.9413 | 0.9450 | 0.9336 | 0.9337 | 0.9494 | 0.9413 | 0.9406 |

train | 0.001 | 50 | 0.9341 | 0.9521 | 0.9232 | 0.9140 | 0.9577 | 0.9341 | 0.9257 |

val | 0.001 | 50 | 0.9303 | 0.9496 | 0.9188 | 0.9079 | 0.9558 | 0.9303 | 0.9208 |

test | 0.001 | 50 | 0.9330 | 0.9509 | 0.9162 | 0.9096 | 0.9540 | 0.9330 | 0.9243 |

train | 0.01 | 100 | 0.9906 | 0.9904 | 0.9897 | 0.9898 | 0.9910 | 0.9906 | 0.9905 |

val | 0.01 | 100 | 0.9840 | 0.9835 | 0.9818 | 0.9823 | 0.9845 | 0.9840 | 0.9839 |

test | 0.01 | 100 | 0.9880 | 0.9880 | 0.9872 | 0.9875 | 0.9882 | 0.9880 | 0.9880 |

train | 0.001 | 100 | 0.9289 | 0.9462 | 0.9167 | 0.9066 | 0.9529 | 0.9289 | 0.9196 |

val | 0.001 | 100 | 0.9205 | 0.94102 | 0.9077 | 0.8965 | 0.9477 | 0.9205 | 0.9109 |

test | 0.001 | 100 | 0.9263 | 0.9446 | 0.9080 | 0.9008 | 0.9485 | 0.9263 | 0.9166 |

train | 0.01 | 150 | 0.9617 | 0.9666 | 0.9556 | 0.9545 | 0.9705 | 0.9617 | 0.9606 |

val | 0.01 | 150 | 0.9524 | 0.9594 | 0.94777 | 0.9438 | 0.96557 | 0.9524 | 0.95053 |

test | 0.01 | 150 | 0.9590 | 0.9645 | 0.9532 | 0.9533 | 0.9669 | 0.9590 | 0.9583 |

train | 0.001 | 150 | 0.9359 | 0.9510 | 0.9246 | 0.9042 | 0.9585 | 0.9359 | 0.9188 |

val | 0.001 | 150 | 0.9252 | 0.9419 | 0.9209 | 0.8992 | 0.9500 | 0.9252 | 0.9084 |

test | 0.001 | 150 | 0.9391 | 0.95427 | 0.9217 | 0.9050 | 0.9595 | 0.9391 | 0.9237 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 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 (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Perković, T.; Dujić Rodić, L.; Šabić, J.; Šolić, P. Machine Learning Approach towards LoRaWAN Indoor Localization. *Electronics* **2023**, *12*, 457.
https://doi.org/10.3390/electronics12020457

**AMA Style**

Perković T, Dujić Rodić L, Šabić J, Šolić P. Machine Learning Approach towards LoRaWAN Indoor Localization. *Electronics*. 2023; 12(2):457.
https://doi.org/10.3390/electronics12020457

**Chicago/Turabian Style**

Perković, Toni, Lea Dujić Rodić, Josip Šabić, and Petar Šolić. 2023. "Machine Learning Approach towards LoRaWAN Indoor Localization" *Electronics* 12, no. 2: 457.
https://doi.org/10.3390/electronics12020457