# Research on a Wi-Fi RSSI Calibration Algorithm Based on WOA-BPNN for Indoor Positioning
###### Abstract
In the online phase, if the positioning area is large and the spacing of the fingerprint reference points is dense, then matching the RSSI data collected from a real-time location to each fingerprint data in the fingerprint database will lead to a large number of calculations and will be unable to obtain the positioning results immediately. To reduce the fingerprint point matching calculation and determine the current position in a certain area quickly, some scholars used a clustering algorithm in the indoor positioning process to roughly realise the location. [PERSON] et al. [7] applied a K-nearest neighbour (KNN) classification method to improve the performance of indoor localization. [PERSON] et al. [8] utilised a K-means clustering algorithm to analyse the geometric proximity between the reference point and test point in the online phase. [PERSON] et al. [9] combined naive Bayes classifier (NBC) and weighted KNN (WKNN) to achieve indoor positioning, which obtained a better result than the traditional indoor positioning systems (IPSs). However, these methods must set the appropriate value of \(K\) in advance. If the value of \(K\) is not set properly, it will have a certain negative impact on the subsequent positioning results. [PERSON] et al. [10] proposed the improved fuzzy c-means algorithm for regional division in the offline training phase, which introduces the K-means clustering algorithm and between-within proportion (BWP)  
Figure 1: RSSI received by different mobile terminals in the same direction at the same position at the same time. index to select the optimal initial clustering centre and number of clusters. [PERSON] et al. (2011) proposed a regional division method based on a Voronoi graph that is constructed with the initial reference points as the generating points, and the virtual reference points are partitioned into the nearest Voronoi region. To effectively solve the above problems, the main work of this paper is as follows:  
1. Firstly, we propose a Wi-Fi RSSI calibration algorithm based on a whale optimisation algorithm (WOA)-BPNN and use the WOA to find the optimal initial weights and thresholds of the BPNN model. The proposed algorithm has a simple process and few parameters to adjust. Secondly, to speed up the establishment and optimisation of the calibration algorithm and upgrade the updating and iterating speed, we propose a nonlinear convergence factor \(a\) to simulate the shrinking behaviour of the surrounding prey of the whales and obtain an improved WOA-BPNN calibration algorithm. The convergence factor \(a\) changes dynamically only with the current iterations \(t\) and effectively prevents the algorithm from falling into the local optimum. We use the calibration algorithm to calibrate the Wi-Fi RSSI data received by the different mobile terminals at the same position to make the Wi-Fi RSSI consistent. Finally, by changing the hidden layer structure of the BPNN model, we compare the performance of different BPNN models on the calibration results. 2. Focusing on the problem of the low positioning accuracy of location fingerprint indoor positioning algorithms based on the Wi-Fi RSSI, we propose a region-adaptive weighted KNN (WKNN) positioning algorithm based on hierarchical clustering. Firstly, we employ the BWP index to evaluate the clustering results and find the optimal number of clustering regions, which can help narrow the online matching positioning range and improve the positioning speed. Secondly, this algorithm adaptively determines the \(K\) fingerprint data in the fingerprint database of its attribution area, which is similar to the RSSI values received by the mobile terminals at a real-time position, then uses the WKNN algorithm to calculate the final position results comprehensively.