AP Detector: Crowdsourcing-based Approach for Self-localization of Wi-Fi FTM Stations

: The acquisition of locations of Wi-Fi access points (APs) in urban buildings plays an important role in smart city applications, such as indoor navigation and social media data mining. This paper proposes a crowdsourcing-based approach for self-localization of WiFi APs with the assistance of indoor pedestrian network (AP Detector). The features extracted from local opportunity signals are adopted for floor identification, and the crowdsourced indoor trajectories are segmented and matched with extracted indoor pedestrian network for the further trajectory calibration. In addition, the iteration unscented Kalman filter is applied for the location and bias estimation of local Wi-Fi FTM stations using the constructed Wi-Fi ranging model. The experimental results indicate that the proposed AP Detector can realize accurate location estimation of Wi-Fi APs, which also provides an effective way for autonomous construction of indoor navigation database and hybrid localization.


INTRODUCTION
The Wi-Fi based indoor localization has attracted attentions of many researchers because of its low cost and wide coverage characteristics.Various characteristics extracted from the Wi-Fi signals can be applied for indoor positioning purpose, for instance, received signal strength indication (RSSI) (Zhuang et al. 2015), channel impulse response (CIR) (Zhang et al. 2012), time of arrival (TOA) (He et al. 2013), time difference of arrival (TDOA) (Suraweera et al. 2020), angle of arrival (AOA) (Zafari et al. 2019), and channel state information (CSI) (Wang et al. 2016).
Aiming at the smartphone based indoor localization, most of above extracted characteristics are not supported due to the hardware or time synchronization based limitations.The Wi-Fi RSSI is the most commonly used wireless indoor positioning source, which usually contains two approaches: Wi-Fi ranging (Zhuang et al. 2015) and fingerprinting (Yu et al. 2021).
It can be found from state-of-art literatures that the smartphone Wi-Fi RSSI based ranging and fingerprinting methods are difficult to meet the requirements of meter-level indoor localization due to the changeable indoor environments and artificial interference.In order to improve the robustness of the Wi-Fi based positioning system (WPS), IEEE 802.11 standardized the Wi-Fi FTM protocol in 2016, which is hope to realize meter-lever round-trip-time (RTT) based ranging results between smartphones and Wi-Fi access points (APs) (IEEE, 2016).(Choi et al. 2020) proposed a calibration-free system which integrates the RSS/FTM based ranging and PDR by the EKF algorithm, and the related parameters such as distortions in raw RTT, step-length, initial position and reference heading are optimized in real-time.The final integrated positioning accuracy is within 1.28 m in 75% in case of 40-MHz bandwidth.In a large-scaled indoor area, the locations of local Wi-Fi APs are always unknown or changeable because of the artificial interference, which leads to the difficulty of Wi-Fi ranging based localization (Nam et al. 2014).In addition, the initial ranging bias exists during the distance measurement procedure between different mobile terminals and Wi-Fi APs, which should also be detected and eliminated before localization phase (Yu et al. 2021).
This paper focuses on detecting the locations of local Wi-Fi APs which support the Wi-Fi FTM protocol and simultaneously calibrating the Wi-Fi FTM ranging bias.The contributions of this work are summarized as follows: 1) This paper proposes a crowdsourced trajectory estimation and optimization solution, which can realize accurate relative location and heading calculation results under magnetic interference and external acceleration contained environment.
2) This paper proposes a Long Short Term Memory network (LSTM) based floor identification algorithm, by extracting features from local opportunity signals and provides real-time floor indexes for crowdsourced trajectories.
3) This paper proposes trajectory partition and matching algorithm, which divides the crowdsourced trajectories into the combination of straight line and turning points, which can be further matched with extracted indoor pedestrian network to get the calibrated trajectory with high-precision.4) This paper presents the hybrid Wi-Fi ranging model and iteration Uncented Kalman filter (iUKF) for Wi-Fi APs locations estimation and ranging bias calibration.The final experiments prove the precision and effectivity of proposed AP Detector framework.This paper is organized as follows.Section Ⅱ introduces the trajectory estimation, partition, matching, and calibration approach.Section Ⅲ details the LSTM based floor identification and iUKF based Wi-Fi AP self-localization and ranging bias calibration.Section Ⅳ describes the experimental results.Section Ⅴ concludes this paper.

CROWDSOURCED TRAJECTORIES PRE-PROCESS
In this part, a comprehensive crowdsourced trajectories preprocessing framework which contains trajectory modelling, partition, matching, and calibration is proposed to provide highprecision reference trajectory.

Trajectory Modelling and Segmentation
In this case, the state vector of trajectory estimation is modeled as follow: where the heading bias bk is regarded as a first-order Markov process, T  indicates the time interval between the adjacent steps, Tc is the correlation time, k L indicates the real-time step- length, which is calculated by: In which the 1  , 2  , 3  indicate the scale related parameters, k  indicates the step frequency and H represents the pedestrian's height.The altitude information is provided by the integrated barometer sensor: 1.0 5.255 0 100 44330 (1.0 ( ) ) where k h  represents the calculated altitude change information, pt and p0 indicate the measured pressure at timestamp t and the basic pressure reference.In addition, the relative heading change information provided by the magnetometer during quasi-static magnetic field (QSMF) periods is adopted as the observation equation: where 0  and t  indicate the extracted magnetic heading at the first timestamp of the detected QSMF period and the magnetic heading at other QSMF epochs, n  is the measured noise.
After the estimation of raw trajectory, the collected crowdsourced trajectories are segmented and divided into the combination of straight line and turning points.In this case, the modulus of gyroscope output is extracted: where gx, gy, and gz indicate the collected angular velocity of each axis.The turning point is detected based on the peak detection of modulus of gyroscope output, similar to the step detection procedure (Yu et al. 2019).
After detecting the turning points, the raw trajectory can be described as the combination of several segmentations:

Trajectory Matching and Calibration
In our work, the indoor pedestrian network extracted from indoor map is applied as the prior knowledge of scenario, which also contains the combination of straight line and turning points: For j=1:N st (Turning points): Calibrate each segmentation of the raw trajectory according to the reference turning points, by rotating and scaling based on the comparison of the raw vector and the reference vector 0 cos( ) sin( ) 0 sin( ) cos( ) where i AB indicates the 2D location coordinates extracted from raw trajectory and i AC is the pre-calibrated 2D location coordinates. represents the rotation angle,

WI-FI FTM STATIONS SELF-LOCALIZATION AND RANGING BIAS CALIBRATION
In order to provide an accurate performance of Wi-Fi FTM stations detection, the floor identification is required, and a comprehensive ranging and localization model is also needed for the final self-localization and bias calibration.

LSTM Based Floor Identification
To provide an autonomous floor identification function without any assist of additional facilities, the LSTM network is applied for floor identification using the features extracted from local opportunity signals, which can effectively decrease the effects of environmental interference in complex indoor areas.The extracted input features of the LSTM network are described as follows: 1) Number of effective Wi-Fi APs scanned from local environments: According to propagation characteristics of RSSI, the rate of change of signal attenuation gradually becomes less pronounced as the distance increases.Thus, in this part, the acquired RSSI values that larger than the set threshold would be regarded as the effective Wi-Fi APs:  is corresponding threshold.
2) The most representative Wi-Fi APs: In this part, to describe the wireless characteristics of the specific indoor floor in detail, the RSSI vector acquired from the most representative Wi-Fi APs are modelled as the part of input value of LSTM network: where 2  is corresponding threshold.
3) Average RSSI index of representative Wi-Fi APs: In this part, the average RSSI value of selected Wi-Fi APs is calculated as one of the input value of LSTM network: where RSSI Ave V indicates the calculated average RSSI index.
4) RSSI differences of representative Wi-Fi APs: In this part, the differences RSSI vector of selected Wi-Fi APs is also applied as input values of LSTM network:

System Model and Observation of AP Detector
In the proposed iUKF based AP detector, the state value contains two parts.The first part is the location of required Wi-Fi APs which need to be detected: where s  X is consist of the 2D locations of Wi-Fi APs which need to be detected, The second part is the Wi-Fi FTM bias based error model.In our work, the bias of Wi-Fi FTM is applied to compensate the differences between different kinds of smartphones and Wi-Fi APs, which is modeled as the random walk process:  is the white noise.The RTT bias based error model is described as: As discussed in (Yu et al. 2020), the measured bias of Wi-Fi FTM depends on the types of smartphones and Wi-Fi APs.In addition, the measured RTT based distance is affected by both initial bias and environmental factors such as multipath propagation, NLOS, and random error.Thus, the raw ranging result can be modelled as follow: where Lraw indicates the smartphone reported distance; LRTT represents; dbias is the bias of Wi-Fi FTM which will be addressed in our paper; dE is the environment related error; drandom represents the measured random error which is subjected to the Gaussian distribution.
The augmented form of Wi-Fi ranging bias calibration and self-localization state model is presented as: 00 = 00 The observed model is described as: After completing each round of iUKF iteration, the calculated Kalman gain is extracted to evaluate the degree of convergence, if the value of Kalman gain reaches the convergence status, the whole procedure of iUKF will stop.

EXPERIMENTAL RESULTS
In this section, a series of experiments are designed to verify the robustness of the proposed AP detector framework.One typical office environment is selected as the experimental site.4 Google Wi-Fi are deployed among different locations of one floor, which is shown in Figure 2. Google Pixel 3 and Google Pixel 4 are applied as the crowdsourced terminals to provide daily-life trajectories.The sampling rates of built-in sensors and Wi-Fi FTM are 50 Hz and 5 Hz.In this work, trajectory matching algorithm is proposed for provide absolute reference of crowdsourced trajectories according to the fitted heading and length of trajectory segmentations.After the reference turning points are matched, the raw trajectories are calibrated and the corresponding floor plan can be constructed as: 114.1788 114.1789 114.179 114.1791 114.1792 114.1793It can be found from Figure 5 that the calibrated trajectories prove high-precision, and the overall trajectory error is within 0.47 m in 75%, which can further be applied for selflocalization and bias estimation of local APs.

Performance Evaluation of Wi-Fi AP Self-localization and Calibration
After the calibration of crowdsourced trajectories, the selflocalization and calibration solution is proposed for detecting the accurate locations of local APs which support the Wi-Fi FTM protocol.In this case, the crowdsourced points are selected according to the estimated accuracy of crowdsourced trajectories.The detection error of four Wi-Fi APs is described in Figure 6, and the estimated bias of Wi-Fi FTM is shown in Figure 7: It can be found from Figure 6 and Figure 7 that the accuracy of Wi-Fi AP detection reaches 1.12 m in 75%, and the estimated Wi-Fi ranging bias also reaches a state of convergence.

Performance Evaluation of Floor Identification and Multi-source Fusion Based Localization
In this work, the LSTM based floor detection algorithm is proposed to provide floor index for crowdsourced trajectories before trajectory matching procedure.To cover the required indoor areas, 30 different trajectories collected from 4 different floors are applied for training phase, and 20 trajectories are applied as the test dataset, and the overall detection accuracy of different floors are described as: It can be found from Figure 8 that the proposed LSTM based floor detection algorithm proves high precision, which reaches an average accuracy of more than 98% according to the test dataset on different floors.
Finally, the detected locations and bias of Wi-Fi FTM stations are used for real-time indoor localization, in this case, the tester started from the point A, passed by the points C, J, F, G, H, I, F, E, and returned to the point A. To evaluate the positioning error using different approach, the absolute location is provided for the sensors based localization approach, the overall trajectory comparison between sensors approach by trajectory modelling, and the UKF based multi-source fusion model (Yu et al. 2019) is shown in Figure 9:  It can be found from Figure 10 that the proposed Wi-Fi AP detection framework can finally realize the autonomous indoor localization by detecting the locations and biases of Wi-Fi APs and providing absolute reference to built-in sensors.The estimated positioning accuracy reaches 1.67 m in 75%, compared with the raw built-in sensors within 2.85 m in 75%.Thus, the proposed AP detector provides an autonomous approach for self-localization and bias calibration of local Wi-Fi FTM stations using crowdsourced trajectories and indoor pedestrian network, which can further be applied for universal indoor localization.

CONCLUSION
In order to realize the self-localization and bias estimation of Wi-Fi APs which support the FTM protocol, this paper proposes the AP Detector framework, which contains three main parts: (1) Crowdsourced trajectory modeling and optimization, which can be applied under the magnetic interference and external acceleration contained indoor environments; (2) Crowdsourced trajectories matching and calibration with the assist of the extracted indoor pedestrian network, which can realize an overall floor plan construction accuracy of 0.47 m in 75%; (3) LSTM based floor identification and iUKF based APs self-localization and bias calibration, which finally realize the an average floor detection precision of more than 98% and AP self-localization accuracy of 1.12 m in 75%, the final real-time positioning error using detected APs and bias reaches 1.67 m in 75%.
location coordinates contained in each trajectory segment, Dn represents the total distance of each trajectory segment, and n  indicates the estimated the fitted angle of each trajectory segment.
intersection coordinates contained in each trajectory segment, Dn represents the total distance of each trajectory segment, and n  indicates the estimated the fitted angle of each trajectory segment.Since the raw calculated trajectory contains only relative locations, thus the distance and fitted angle of each trajectory segment are selected for trajectory matching with the extracted indoor pedestrian network: Table1.Procedure of Crowdsourced Trajectory Matching 1) Extracting the adjacent points from the indoor pedestrian network and constructed the prior knowledge of scenario;2) For i=1:M st (Number of crowdsourced trajectories):For j=1:N st (Turning points): Compare the similarity between crowdsourced trajectory segmentation and reference segmentationIf: the Th01 and Th02 satisfy the set threshold, then search the next adjacent reference segmentation and record the reference turning point, total distance and fitted angle of each trajectory segment.end end 3) While: one reference Trajectory is successfully detected: the scale parameters of x and y axis.
received RSSI value of j st Wi- Fi AP, and 1
difference between Wi-Fi FTM and MEMS sensors based ranging estimation; The Wi-Fi FTM ranging model is defined in (18), and the MEMS sensors based MEMS) indicates the MEMS sensors based localization result, (Pm E , Pm N ) represents the location of the m st Wi-Fi AP.

Figure 2 .Figure 3 .
Figure 2. Walking Route and Deployment of Wi-Fi APs4.1 Performance Evaluation of Trajectory MatchingIn the procedure of crowdsourced trajectory modelling, the absolute location of the pedestrian is unknown because of the reference points are missing.In this case, a number of 45 initial daily-life trajectories are collected and only 25 trajectories are eligible, which contain at least three turning points and can be successfully matched with indoor pedestrian network.The raw collected crowdsourced trajectories are shown as:

Figure 4 .Figure 5 .
Figure 4. Matched and Calibrated Crowdsourced TrajectoriesIn addition, the accuracy of calibrated trajectories are compared with ground-truth indoor network, and the evaluated precision of calibrated trajectories is calculated as:

Figure 7 .
Figure 6.Detection Error of Wi-Fi APs

Figure 8 .
Figure 8. Accuracy of Floor Identification