Maximum convergence algorithm for WiFi based indoor positioning system

WiFi-based indoor positioning is widely exploited thanks to the existing WiFi infrastructure in buildings and built-in sensors in smartphones. The techniques for indoor positioning require the high-density training data to archive high accuracy with high computation complexity. In this paper, the approach for indoor positioning systems which is called the maximum convergence algorithm is proposed to find the accurate location by the strongest receiver signal in the small cluster and K nearest neighbours (KNN) of other clusters. Also, the K-mean clustering is deployed for each access point to reduce the computation complexity of the offline databases. Moreover, the pedestrian dead reckoning (PDR) method and Kalman filter with the information from the received signal strength (RSS) and inertial sensors are applied to the WiFi fingerprinting to increase the efficiency of the mobile object's position. The different experiments are performed to compare the proposed algorithm with the others using KNN and PDR. The recommended framework demonstrates significant proceed based on the results. The average precision of this system can be lower than 1.02 meters when testing in the laboratory environment with an area of 7x7 m using three access points.


INTRODUCTION
For tracking people or objects' location in indoor environments, a network of devices is suggested which is known as an indoor positioning system (IPS). There is a variety of field exploits this technology for supervising the health, position guiding in universities, museums, airports, hospitals, and warehouses. Because the global positioning system (GPS) is lacking precision or crashing in indoor circumstances, many approaches to indoor positioning technologies have been suggested including ultrasound [1], ultra wide band (UWB) [2], wireless fidelity (WiFi) [3], bluetooth low energy (BLE) [4], radio frequency identification tags (RFID) [5], visible LED light [6], [7], FM radio signals [8], pedestrian dead reckoning (PDR) [9]. Among them, WiFi technology is standing out as an general approach for indoor navigation and positioning due to available WiFi infrastructures situated almost everywhere.
Wireless indoor positioning has two approaches: geometrical-calculation based and fingerprinting based (or scene-analysis based) [10]. The former approach relies on measurement of geometrical parameters (i.e. distance, angle) by using a variety of radio signals physical characteristics, such as time of arrival (TOA) [11], angle of arrival (AOA) [12], time difference of arrival (TDOA) [13], received signal strength (RSS) [14]. AOA, TOA, or TDOA techniques can achieve high localization accuracy with less than 1-meter error. Nevertheless, they are complicated to synchronize between transmitters and receivers [15]. RSS is the parameter used in most of these studies, however, achieving robustness and accuracy is a challenge for most of these studies because various factors of indoor environment such as shadowing, reflection, scattering, and refraction can affect the radio signal.
Fingerprinting is a positioning method using scene analysis [16]. This approach can instantly exploit available infrastructures to evaluate the user's location at an affordable price. WiFi fingerprinting technique takes advantage of the similarities between the RSS. It is usually conducted in two phases [16]: Offline phase and online phase. During the offline phase, the "radio map" is set up with observed RSSs of all the discovery WiFi Signals from distinct access points (APs) at many reference points (RPs) of spotted locations and stored in the database. In term of online phase, a mobile device (or target) measures the RSS vector from available APs and estimates its position by using the fingerprinting database and positioning algorithms. Rely on the available information contained in the database regarding the "radio map", several results have been given to exhibit the indoor positioning system. The deterministic approaches usually estimate the position based on the closest RSS in the pre-stored radio map with currently observed measurements. The typical algorithms for this approach are K-nearest neighborhood (KNN) [17], nearest-neighbour [18], weight k-nearest neighborhood [19], and median filtering [20]. Euclidean distance is regularly applied to calculate the minimum distance between the supervise RSA and the mean of the fingerprints collected in deterministic approaches. The major drawbacks of the fingerprinting method are the heavy training coverage and the poor extrapolation to areas not covered during training [21]. This method requires a large expenditure of labor to create remarkably fingerprinting databases in the offline phase [15], [22]. The parameters of the path loss model which are linked with each access point can not entirely clear up this problem [23]. In the online phase, the currently supervise RSS compare to all RSS in the fingerprinting database. Then the spot associated with the best RSS pattern is chosen as the predicted location of the object. The huge amount of locations in the fingerprinting trained database can help better positioning accuracy, but the searching overhead in this phase is increased [24]. To deal with data size reduction in the fingerprinting database, several researchers have proposed some clustering techniques to separate the larger set of training data into small groups of minor subsets as clusters to decrease the searching time [23]- [26]. In this work, the path loss model and clustering-based techniques are deployed to compute cost.
PDR is a generally used approach to adopt for localization [27], [28]. This method utilizes inertial sensors to approximate the movement of pedestrians relative to their prior location. Currently, step counting is the main solution to detect the walking pathway and the pedestrian's movement [27]. A problem with this method is that the inertial sensors in smartphones sometimes are imperfectly calibrated and noisily measured [18]. Therefore, when a person moves a long distance the determined spot of PDR is regularly drifted. However, the drift problem of PDR can be solved to gain high precision by coordinated WiFi fingerprint-based indoor localization modes. The cooperative technologies in wireless communication [29,30] and emerging different technologies are receiving increasing attention. The combination of spatial and temporal network localization and navigation can significantly enhance the localization efficiency [31]. In [32], the cooperative fingerprintbased algorithm utilizes the WiFi RSS database and the pairwise distance measurements by mobile users for multiple location estimations simultaneously. However, the approach using a combination of spatial and temporal can take associated costs which may combine additional communication and complicated algorithms over the network [31]. Previous research works [5], [17], [33], [34] primarily paid attention to applying a particle filter, which is extremely time-consuming and incompatible for real-time applications. Therefore, a Kalman filter can be deployed to solve this fusion problem effectively [9].
Although a lot of researches has been accomplished in this field, some essential problems still need to be explored and resolved to enhance effectiveness and accuracy. In order to take the advantage of previous researches, in this case, we proposed a new algorithm for PDR and a WiFi fingerprinting approach as displayed in Figure 1 and fingerprinting based (or scene-analysis based) [10]. The proposed scheme focus on gaining location efficiency and accuracy by a number of novel approaches:  The Path-loss model is adopted for WiFi fingerprinting techniques are applied to reduce the time needed for data training.  In the large space with several reference points (RPs), the fingerprint database can be large. To narrow the search space and improve computation efficiency, a K-mean clustering using an Euclidean distanceis adopted.  The maximum convergence method is proposed to reduce the fluctuation of the RSS because it relies on the strongest access point of the clusters in the offline databases. That improves the location accuracy of WiFi fingerprinting. The fusing method between WiFi fingerprinting and PDR using Kalman filter to assess the user's position by real-time RSS measurements. This combination makes the indoor positioning system capable to archive high efficiency and robustness. The remaining part of the paper is structured as follows: Section 2 represents the proposed method. Section 3 consists of the experimental setup and results. Lastly, conclusions are given in Section 4.

METHOD
In this part of the research, the WiFi fingerprinting method using maximum convergence algorithm is proposed. And, the hybrid algorithm which are combination of the maximum convergence algorithm and PDR using Kalman filter is presented.

WiFi fingerprinting using nearest neighbor clustering
The fingerprinting method requires intensive training data to obtain high exactness. However, collecting data is labour-intensive. In order to reduce this factor, in this paper, the propagation signal model in (1) is deployed to analyze the collected RSS data and the position of WiFi access points to construct "radio map" in thedatabase. During the offline phase, the path loss model is applied to train the database. Then, K-mean clustering isto classify these "radio map". In the online phase, the user's location is determined by the maximum convergence algorithm.

Path loss model
In the offline phase of the fingerprinting technique, RSS samples are gathered at various known areas from different access points and distances are determined from the realized location to access points. These RSS values and distances are applied to fit the signal propagation model. Also, the relationship between the signal and the distance is derived by (1) in [22].
Where is the signal strength value which is shown as a logarithm, 0 represents the signal strength value under the condition that the distance between the receiver and sender equals reference distance d0, and γ represents the path fading index. Based on that equation, the distance for each access point i is identified by the (2). Path-loss exponent γ, 0 , and ( 0 ) have been collected from the environments. Each reference point can be collected by mean RSS at a fixed position as equation.
Where, is average RSS values with samples from access point i. From the collected RSS, we can choose the best-fit parameters for (2). Figure 2 displays the correlation between RSS and distance values after conducting the training phase. From this model, instead of measuring all points for training parameters, we collect RSS at some reference points and determine the correlation between RSS and distance by using the predicted parameters of the path loss model. Then, the radio map of fingerprinting has been built based on the map information of each area, even at sparse points. Consequently, this method can reduce time-consuming in the offline phase.

Clustering approaches in fingerprinting
After building the radio map, we implement a K-mean clustering method on RSSI vectors to partition the whole survey site into smaller regions. Physically close RPs usually have similar vectors and thus they are clustered into the same group. The Euclidean distance is used in 2D coordinates to estimate the similarity among RSS signals.
Donate the cluster as . We implement the K-means clustering in order to minimize the within-cluster sum of dissimilarity of K clusters, i.e.

The maximum convergence algorithm in the online phase
After clusters of offline fingerprinting are obtained to distinguish among RSSs which are also have different distances for each AP, we try to find the convergent points of all clusters, and then compute the estimated position based on these points. The process of proposed algorithm on the online phase is described in the following steps: Input: A set of RSS measurements is collected from N APs. By using the trained database, each AP has its own cluster. Cluster is a set of points that are determined by the RSS values. Step 1: Based on the currently observed RSS measurements in online phase, the clusters are detected in stored database by computing the Euclidean distance between the RSSs and centroids of each cluster. Then, the closest cluster of each AP that is measurable at the same moment is chosen.
Step 2: When object positioning by WiFi is estimated, the closer it is, the more reliable the RSS data will be. As the path loss model in Figure 2, the number of RSS points in each cluster is proportional to the distance. Search the cluster that has the smallest number of RSS points as (5).
where N represents the number of setup APs in the indoor positioning system, and ̅̅̅ is the number of spots in the cluster of the k th AP.
Step 3: With every point i of the set S, find the set of N -1 points respectively in the remained APs at which it is closest. where is the AP which has the set of clusters , ∈ [1: ].
Step 4: In the set of , find out the set which has the maximum convergence of RSS points by; where = 1: ̅ , ̅ = ( ̅̅̅ ) , ∈ [1: ] Step 5: Compute the center of a polygon which is created by N points in set as (8).
Output: The estimated position is the coordinate of the user after step 5.

Hybrid algorithm
The RSS signal are often fluctuated in indoor environments and thus we need to use the extra information from built-in sensors in smartphones to improve the performance. Besides, the time delay to get RSS measurements is significant. The RSS values are updated every 2 seconds when we conduct our experiment. It points out that if pedestrians move rapidly, the indoor positioning system using only WiFi can get low responding in real-time navigation. In contrast, PDR can afford a high position efficiency in a small area, then slowly drifts walking distance. These drifts can be modified by position from WiFi fingerprinting. In this supposed method, we combine the value reaching from WiFi fingerprinting by using a Kalman filter based fusion algorithm.

Pedestrian dead reckoning
PDR technique determines the movement of a person by estimating stride lengths, tracking steps, and the directions of motions by using utilizes inertial measurement units (IMU). An IMU, which is available in a large number of the smartphone, use a combination of accelerometers, gyroscopes, and magnetometers. PDR calculates the after location using the prior location, walking direction, and step length as (9).
At step K the parameters include xk is the device state, Lk is the step length, and θk is the direction. Some calculations are performed to estimate step length, step tracking, and direction of the user.


Step detection: This factor is calculated by using accelerometers [9], [34] or gyroscopes. In this work, we apply the techniques in [27], [33], which uses normalized auto-correlation based step counting with an accelerometer.
 Stride length (SL) Estimation: When the person is walking, the moving distance is characterized by the SL at every detected step. The SL can be considered as an unchanged value [17], [34]. Nevertheless, it mainly depends on the walking person, such as the legs length, frequency as well as speed while walking. In order to achieve more accuracy, in our research, we apply the technique recommended by Weinberg using the PDR technique [27] for dynamic walking.  Walking direction estimation: For following the user's path in PDR, the pedestrian walking direction is the most important factor. It is calculated from gyroscopes and magnetometers which are orientation sensors. The compass computes the phone orientation relative to the perceived magnetic north [33]. In this paper, the angle between the smartphone pointing direction and the geographical north is calculated from measurements of magnetometers and gyroscopes.

Kalman filter
The potential sensor fusion techniques for WiFi and PDR approaches include the particle filter [5], [17], [33], Kalman filter [9], in a practical environment, constant updating current location is essential to meet the user need. For this reason, the system should be launched on smartphones devices with a light computation algorithm. In this work, instead of using a particle filter, the Kalman filter can be applied. Based on PRD method from the (9), the state transition function of the sensor fusion framework is shown as (10).
With measurement z that is; where F, G indicates identity matrices; vk, wk is the process and measurement noise at the time step k, respectively. These parameters are required to be independent and have normal probability distributions.
v k = N(0, Q) where , R is the process noise covariance and measurement noise covariance matrices, respectively. The Kalman filter is the solution for the linear problem with the assumption of Gaussian noises. The algorithm consists of two phases: prediction and observation phases [9]. The WiFi estimations are updated every 1 second to synchronize these phases. In our experiments, the measurement noise covariance and process noise covariance matrix are chosen based on the estimated location errors of WiFi and PDR methods as (14), (15).
In the application for the pedestrian, a movement can be changed unpredictably. Therefore, the Kalman filter will be updated based on step detection. While a pedestrian is moving, Kalman filter will be updated regularly in two phases. The prediction phases relied on the stride length and walking direction estimation. In the observation phase, different parameters will be updated according to WiFi estimation results. When pedestrian is standing, a Median filter will be applied to update the user's locations.

EXPERIMENTAL RESULTS
In this part of the research, we assess the performance of our proposed algorithm in two distinct testbeds. In the experiment, we evaluate the effectiveness of different WiFi techniques (Trilateration [22] and KNN in [17]) and compare the effectiveness of the suggested algorithm with WiFi fingerprinting and PDR, respectively.

Experimental setup
A 7×7 m laboratory was chosen to assess the first test-best. We installed three WiFi access points which can broadcast every 500 miliseconds. A Samsung SG-G395F smartphone device is utilized to set up an application that collects the training positions as testing data. In the room, the training data was established 1.0 meters away from others as the moving on a certain trajectory. After that, a CSV file stores the collected data which serving for experimental assessment. The IPS architecture was illustrated in Figure 5. An application on smartphone access to the server using a specific account. The RSS is measured via the smartphone then sent to the server.

Experimental evaluation
Our framework uses two metrics for assessment, which are:  Exactness: use the root mean square errors of the determined location and real position.
where ( , ) represents for the true physical position, and (̂,̂) represents the estimated position.
where n is the number of test points.  Precision: it is represented the consistency of the system works, i.e. the robustness of position techniques. To calculate the system precision [18], a cumulative probability function (CDF) of the distance error is applied.

Test-bed 1: Evaluation of the maximum convergence algorithm for WiFi fingerprint
A map illustrates our laboratory is used to experiment with a set of trained points. Grids with 1mx1m spacing are used for the distribution of 43 samples of data spatially. The consequences of three experiments with 22 testing samples are displayed in Table 1. The mean error of the maximum convergence method is 1.18 m which is lower than the KNN and Trilateration method at 1.86 m and 1.74 m, respectively. Furthermore, the probability of position error confidence within 80% is about 1.4 m for the proposed WiFi method, as shown in Figure 6(a). That is much better than KNN and Trilateration about 3.4 m and 2.7 m, respectively. These results show that the maximum convergence method is able to reduce the fluctuations of the signal strength model based on the strongest access points in clusters.

Test-bed 2: Evaluation of the hybrid method
In this test-bed, we evaluation the hybrid method and compare the proposed method with two others including WiFi fingerprinting and PDF method. Because of the sparse training data, the mean error of WiFi fingerprinting is much higher than Test-best 1 about 1.81 m that is shown in Table 2. The mean errors the PDR method is 3.2 m because of the drift of location errors along the long period. While with an initialized start point, the hybrid approach can have a mean error of 1.02 m. Compare with the PDR method and WIFI fingerprinting the average positioning exactness of the hybrid framework was reduced by 44% and 68% respectively. The corresponding accumulative distribution functions of the errors are performed in Figure 6(b). The position error of the confidence probability within 80% is about 1.2 m for the hybrid method, which remarkably enhances the precision of the indoor positioning system. The demo video of the proposed method has been uploaded toYouTube at https://youtu.be/lwefRLmjlOE.

CONCLUSION
In this article, we have recommended a WiFi-based maximum convergence algorithm that can achieve high accuracy and low computation complexity. The WiFi fingerprinting using path loss model and nearest neighbor clustering is applied to reduce time labor and computational cost. The maximum convergence algorithm for the online phase can reduce the fluctuation of the RSS signals. In order to improve more accuracy, the PDR method and IMU sensors in smartphones are utilized to estimate the movement of a person. In addition, the Kalman filter is employed to correct the drift problem of the PDR approach. A building without any additional infrastructures is utilized to conduct our experiments. As the result, the effectiveness of the suggested algorithm is proved by our experimental results.