Indoor Radio Map Construction Based on Position Adjustment and Equipment Calibration

The crowdsourcing-based wireless local area network (WLAN) indoor localization system has been widely promoted for the effective reduction of the workload from the offline phase data collection while constructing radio maps. Aiming at the problem of the diverse terminal devices and the inaccurate location annotation of the crowdsourced samples, which will result in the construction of the wrong radio map, an effective indoor radio map construction scheme (RMPAEC) is proposed based on position adjustment and equipment calibration. The RMPAEC consists of three main modules: terminal equipment calibration, pedestrian dead reckoning (PDR) estimated position adjustment, and fingerprint amendment. A position adjustment algorithm based on selective particle filtering is used by RMPAEC to reduce the cumulative error in PDR tracking. Moreover, an inter-device calibration algorithm is put forward based on receiver pattern analysis to obtain a device-independent grid fingerprint. The experimental results demonstrate that the proposed solution achieves higher localization accuracy than the peer schemes, and it possesses good effectiveness at the same time.


Introduction
With the large-scale deployment of the Internet and the proliferation of mobile computing, Location Based Service (LBS) [1][2][3] has permeated into various fields of modern life, such as map navigation and location acquisition. The Global Positioning System (GPS) can complete tracking for most outdoor LBS successfully, but, in indoor scenes, it does not work as well as outdoors due to factors such as signal attenuation and multipath effect. Since Wireless Local Area Networks (WLANs) have been deployed on a large scale in public places such as schools, hospitals, shopping malls, etc., it is possible to estimate the location of users by relying solely on software development without using any additional hardware facilities.
At present, the most widely used Wi-Fi-based indoor positioning algorithm is a position fingerprint localization algorithm based on crowdsourced samples, where the position fingerprint [4] sets up a mapping from the location in the physical environment to a single-or multi-dimensional fingerprint of some kind to ensure one location for each unique fingerprint. The fingerprint in the Wi-Fi position fingerprint localization algorithm refers to the received signal strength (RSS) of the access point (AP) [5]. Crowdsourcing technology [6][7][8][9][10] can reduce or even eliminate the huge workload of site surveying, which will hand over the construction of radio map to a large number of users and integrate a small amount of RSS data collected by each user to obtain the radio map data for a large area.
In the offline phase of the traditional WLAN fingerprint localization system, the target environment is zoned as non-overlapping grid cells uniformly. The RSS samples are collected by crowdsourcing users at the center of each grid, and the user's position coordinates are recorded in the fingerprint database along with the corresponding RSS values. In the online positioning phase, a test fingerprint can be positioned to a grid center with the minimal fingerprint distance. The crowdsourced samples, however, may not be acquired at the specified reference point, which may cause incorrect location annotation of the sample as well as constructing the wrong radio map. To solve this problem, a widely used pedestrian dead reckoning (PDR) [11][12][13][14] method utilizing inertial sensor has been proposed, which can sense the acceleration and direction angle of pedestrians during the travel process through the Inertial Measurement Unit (IMU) [15] without beacons, so as to achieve the aim of pedestrian positioning. However, the original values of the triaxial acceleration, triaxial angular velocity, and triaxial magnetometer will have a fixed deviation from the real value [16]. Moreover, the different mobile terminals used to collect fingerprint data may cause serious device diversity problems, no matter in online phase or offline phase.
Aiming at the problems discussed above, an indoor radio map construction scheme (RMPAEC) is proposed based on position adjustment and equipment calibration in this paper. The inter-device calibration algorithm is optimized based on receiver pattern analysis, which can help achieve high-precision radio map construction. Moreover, on the basis of a proposed weighted signal distance calculation method, the PDR estimated position is adjusted by using particle filter. Finally, a fingerprint amendment method based on kernel density estimation is put forward to update the offline radio map constructed using the proposed scheme.
The subsequent sections are arranged as follows. Section 2 briefly reviews the related work. Section 3 introduces the detailed system design and the three modules of RMPAEC. The simulating results are analyzed and the conclusion discussed in Sections 4 and 5, respectively.

Related Work
In this section, we briefly review the related work focusing on fingerprinting-based position adjustment and trajectory-based fingerprint crowdsourcing. The localization error shows randomness within a certain range, due to the low positioning accuracy of the method using WLAN fingerprint database alone [17], which may make the located pedestrian trajectory inconsistent. The PDR positioning system can provide coherent and accurate relative motion information in a short time, but the long-term movement makes the cumulative error serious [18]. Considering the complementary features of Wi-Fi and PDR system, researchers have tried to fuse together the two technologies to adjust PDR offset using the absolute position provided by Wi-Fi fingerprint.
A localization algorithm that fuses PDR and Wi-Fi fingerprint on the Android platform was presented by Zhou and Xu [19], who mainly studied the two aspects of step detection and course angle estimation and obtained relatively optimal positioning results. However, the step recognition algorithm proposed in this paper only roughly summarizes the biological characteristics of pedestrian steps, and, at the same time, the starting and ending time point of the steps are roughly estimated, which adversely affects the later estimation accuracy. Two-band Wi-Fi signals of 2.4 G and 5.0 G were combined with PDR to achieve fusion positioning by Karlsson et al. [20]. However, the Wi-Fi signal propagation models in different indoor scenes, and the initial orientation and position of the built-in sensors in smartphones were ignored by this hybrid system. In addition, some researchers have used Kalman filter to optimize the positioning effect of Wi-Fi and PDR hybrid systems [21]. For example, a Kalman filter was constructed to integrate Wi-Fi and PDR, and incorporate indoor landmarks into the positioning algorithm by Chen et al. [22]. Li et al. [23] proposed a combined pedestrian tracking based on Wi-Fi, geomagnetic, and PDR under the attitudes of four devices. Furthermore, Kalman filter was adopted to improve the reliability of positioning navigation and reduce the dependence on navigation environment and movement. To improve localization error, some authors have applied the Wi-Fi and PDR fusion method utilizing extended Kalman filter, together with indoor landmark recognition and calibration [24]. Similarly, Min et al. [25] used indoor maps to constrain pedestrian track estimation, and adopted extended Kalman filter to combine Wi-Fi positioning with its positioning results, so as to obtain improved positioning estimation. Moreover, particle filter is also used as a fusion algorithm to establish indoor localization structure based on Wi-Fi and PDR [26]. In addition, Li et al. [27] proposed the utilization of adaptive and Luban Kalman filters to attenuate the impact of environmental noise in Wi-Fi and PDR fusion positioning technology.
For trajectory-based fingerprint crowdsourcing, Zee [28] used an inertial sensor to track the user's trajectory, and the initial position was set as a uniform distribution in the space. Then, the predicted position was converged to the real position according to the map constraints and trajectory shape, and further used backward belief transfer to obtain the trajectory of the entire path forward. The resulting trajectory was used to label the signal fingerprint during the process of generating the trajectory and generate the fingerprint database. LiFS [29] proposed a new framework for constructing the signal fingerprint database of an implicit crowdsourcing concept. By using multi-dimensional scaling (MDS) twice, the Wi-Fi signals detected by mobile device holders are mapped to the tracks; in terms of action model, it only needs to measure the number of steps between two fingerprint signals. FreeLoc [30] mainly studied how to carry out effective indoor positioning based on Wi-Fi in an environment with device differences and data contributed by multiple people. RCILS [31] abstracted the indoor layout into a semantic graph to map with activity sequences contained within the trajectories.

System Model
The target environment is divided into different sub-regions according to the functional layout of the indoor environment and wall partitions, such as classrooms, corridors, etc. Each sub-region is then further zoned as grid cells of the same size. Users participating in crowdsourcing collect step RSS samples from walking trajectories, and each sample has a location annotation in the grid. Finally, these samples are represented in the form of data cubes, that is, each grid has a data cube to form a grid fingerprint, thereby constructing an offline radio map M for each sub-region.
Let S and F represent the sample set of a grid and its fingerprint, respectively. The sample set S is represented by a data cube, where each vertical slice of the data cube represents a sample acquired by a different device D, and each row vector in the slice represents a sample consisting of collected RSS values from different APs. Taking a sample collected by a device as an example, each color unit of a data cube is a tuple (r ij , ρ i ), where r ij denotes the RSS value received from the jth AP by the ith sample, and each r ij is assigned a credibility coefficient ρ i to denote the confidence level. The missing tuple in samples shows that the corresponding AP in this sample is undetectable, for example, (r 23 , ρ 2 ) is lost in s 2 . F is the grid fingerprint vector, whose structure is defined as where M is the number of all detectable APs and R j represents the weighted average RSS value of the jth detectable AP. Assign a reliability coefficient ϕ j to each R j to define the importance of each element in the fingerprint. An N × M RSS matrix R (0) is constructed for each device, where N is the total number of samples collected in each grid. The common RSS average method is used to construct a device-specific fingerprint f for each grid. The average RSS of the jth AP is defined as r j = 1 |r ·j | ∑ N i=1 r ij , where r ·j is the vector in the jth column of R (0) .
The proposed system consists of three modules: (1) Terminal Equipment Calibration (TEC); (2) PDR Estimated Position Adjustment (PEPA); and (3) Fingerprint Amendment (FA), with the help of which the proposed scheme RMPAEC can solve the two core problems and update offline radio map. Each grid fingerprint is constructed by the corresponding process on the original data cube. The system architecture and data processing flow of the proposed RMPAEC are shown in Figures 1 and 2, respectively. The three modules of the proposed scheme are introduced below.

Terminal Equipment Calibration (TEC)
Different types of mobile phones participating in crowdsourced fingerprint collection have different antennas and receiver gains [32], which may cause at least two problems: (1) sample measurements from the same source may be different even at the same place; and (2) much storage space and computing time may be taken to create multiple grid fingerprints for one specific equipment. Therefore, a new inter-device calibration algorithm is proposed to calibrate specific fingerprints for different devices and combine the fingerprints collected by multiple devices into an equipmentindependent grid fingerprint. Figure 3 gives the comparisons of the RSS values at the same measuring locations using four different devices, which shows that there are similar differences between different APs. Let  (1): The fingerprint calibration process between equipment is performed for each AP j in set A uni − A int . Let D j denote the device set with corresponding r d j missed, which lies in the complement D j . The value ofr d j (calibration value) of all d ∈ D j can be obtained according to Equation (2): Therefore, it is always possible to calculate a unique solutionr d j to fill the missing value r d j for each device d ∈ D j .
After the missing RSS values are populated, an N d × M (1) RSS matrix R (1) can be constructed for each grid with the element r d j representing the original/calibrated RSS value from the jth AP of device d. Finally, a column-by-column averaging calculation is performed to obtain an independent device (1) . Generally speaking, the proposed method is used to calibrate the data cube of each grid once to obtain the device-independent grid fingerprint, so as to solve the problem of equipment diversity. However, with the increase of crowdsourcing users, the RSS data collected by users will be more comprehensive, and the data cube of each grid will be updated. Meanwhile, multiple recalibration processes will be performed to achieve the constructed indoor radio map update process.

PDR Estimated Position Adjustment (PEPA)
The general crowdsourcing sample collection process uses volunteers to collect samples at the center of each grid. Some samples, however, may not be acquired at the specified reference point, making the annotations inaccurate, which may cause wrong constructions of the training fingerprint and the radio map.
To solve this issue, the PDR estimated position adjustment algorithm based on selective particle filtering is adopted to adjust the estimated position of crowdsourced samples, which is mainly used to calibrate PDR-based user position by performing progressive selective particle filtering [33][34][35][36] and using the estimated position based on fingerprint. The step lengths, steps, and orientations of pedestrians are measured and counted [37] to calculate their walking trajectories and current positions.
Let (x m , y m ) and (x m−1 , y m−1 ) denote the current and last step locations of the pedestrian, respectively. The estimated pedestrian step size and orientation are represented as l m and θ m . The pedestrian position estimated by PDR can be calculated by Equation (3): According to the defined grid fingerprint structure, a new weighted signal distance calculation method is proposed. Let F g and F t denote the offline grid fingerprint and the online test fingerprint. A g and A t represent the set of detectable APs of fingerprints F g and F t , respectively. The AP intersection of the two fingerprints is A int = A g A t . The weighted signal distance between F g and F t can be obtained by Equation (4): The signal distance between each grid fingerprint and the online test fingerprint collected by the pedestrian during the mth step can be calculated by Equation (4). Furthermore, the geometric center of the grid centers with the minimum signal distance is used as the position (x Next, we generate Z particles (x z m , y z m ) representing the PDR-based estimated step position, which can be calculated by Equation (5): where (x z m−1 , y z m−1 ) represents the zth particle near the position of the last step and (δ x , δ y ) stands for the zero-mean Gaussian noise with variance ε 2 p in each process. The Z particles' initialization process takes place at the starting position of the pedestrian trajectory. First, the weight µ z representing the importance of each particle is assigned to µ z = 1 Z , z = 1, ..., Z. After calculating the RSS fingerprint estimation (x f m , y f m ), the weight µ z is updated by Equation (6): where ε 2 p is the variance of the noise, and d z f is the Euclidean metric between the particle position (x z m , y z m ) and the RSS fingerprint estimation (x f m , y f m ). It can be seen from Equation (6) that the smaller the Euclidean metric d z f is, the greater the weight assigned to the particle will be. After updating weight µ z , the weight of all new particles is normalized. Particle resampling is carried out according to the new normalized weight [38], which ensures that the number of particles is kept unchanged, the high-weight particles are copied while the low-weight particles are discarded. In this way, the estimated PDR position can be corrected by using the RSS-fingerprinting estimation through selective particle filtering, as shown in Figure 4.  (6) after calculating the position (the triangle) of the RSS fingerprint estimation. s z represents the zth sampled particle and r z denotes the particle obtained after the resampling of the zth particle. Finally, the geometric center of the particle (the star) can be obtained.
Meanwhile, it is worth noting that the geometric center (x m ,ŷ m ) of the particle cannot be used as the current step position directly, and the following checks are required to determine whether the center is available. Letl andθ represent the Euclidean metric and orientation between the last step position (x m−1 , y m−1 ) and the particle's geometric center (x m ,ŷ m ), respectively. Moreover, l m is the step length estimated by PDR. The current step position is the particle's geometric center (x m ,ŷ m ), if |l m − l m | ≤ λl m (0 < λ < 1) is satisfied. Otherwise, the current step position is obtained by Equation (7): In conclusion, the adjusted position coordinates of users participating in crowdsourcing will be stored in the fingerprint database along with the corresponding RSS values to build the offline radio map.

Fingerprint Amendment (FA)
The step RSS samples of walking trajectories will be used to update the radio map by the proposed scheme after constructing the offline radio map with the specific update processing as follows. When a new RSS sample is included, the candidate grid assigned to it is found and its credibility coefficient is calculated. Then, the fingerprint of each grid is modified and the reliability coefficient is calculated.
Let s m represent the RSS sample collected by the users participating in crowdsourcing in mth step. The current location of the pedestrian is (x m , y m ) (denoted as L m ), while the center location of the gth grid is set to (x g , y g ) (denoted as L g ). The Euclidean distance between the two can be calculated by Equation (8): The target grid should be the grid with the minimum Euclidean distance from the pedestrian's current position (x m , y m ), which can be obtained by Equation (9): Therefore, the target grid g tgt and its neighboring grids are used as candidate grids allocated for the sample s m . The credibility coefficient ρ g can be obtained by calculating the weighted distance between the two spaces when the gth grid is assigned to sample s m . For each candidate grid, we first compute χ sig g and χ phy g to represent their normalized distances in the signal space and physical space, respectively, which can be calculated by Equation (10), where F g and F m denote the RSS fingerprint of the gth grid and sample s m , respectively, and then the credibility coefficient ρ g can be obtained according to Equation (11): It can be observed from Equation (11) that the distance difference between sample and grid is inversely proportional to the credibility value ρ g .
Finally, a new RSS sample is used to modify the fingerprint structure F of each grid, and its reliability coefficient ϕ j will be calculated. For each grid, the average RSS value r ij of each detectable AP is first updated according to the Gaussian kernel density estimation. For the jth detectable AP, let r ij and ρ i represent the RSS value of the ith sample and its credibility coefficient, respectively. Furthermore, for a grid, a r ij -mean Gaussian kernel density curve with kernel width c(1 − ρ i ) is generated, where c is a constant. Note that the credibility value ρ i is proportional to the density of the curve at r ij . That is, the size of ρ i implies the credibility of the sample in this grid in the actual situation. Therefore, the grid fingerprint value is largely around r ij , which means that the RSS distribution is more concentrated at the sharper curve. We take the average of the gaussian curves of all the samples as the final curve. The x-coordinate and the y-coordinate of the maximum point of the final curve represent R j and σ j , respectively, where R j is defined as the average RSS value collected by the jth AP, while σ j is used to calculate its reliability level. Finally, for each detectable AP, its reliability coefficient can be updated by Equation (12): where σ j = σ j ∑ j∈A g σ j , n j denotes the sample size of the jth detectable AP and A g represents the samples number of the set of all detectable APs in the grid. Therefore, the radio map can be updated in this way when new RSS samples are included.

Experiment Setup
To evaluate the proposed indoor radio map construction scheme, the field measurement was performed on the seventh-floor corridor of the Experimental Building of Electronic Engineering shown in Figure 5.
Furthermore, the experiments were conducted both in 332.2 m 2 Corridor A and 218 m 2 Corridor B, where Area B is part of Area A. As shown in Figure 5a, we used clathrate structures to get 923 grids each about 0.5 × 0.5 m 2 in Area A. In this area, the experiment did not deploy our own APs at all, but utilized the environment's existing Wi-Fi infrastructure. A student holding a Huawei Mate20 smartphone walked along Routes I-III shown in Figure 5a at a constant speed in Area A. Figure 5b describes the Experimental Area B of 606 grids each about 0.5 × 0.5 m 2 where four Wi-Fi APs are installed. In Experimental Area B, a student holding a Xiaomi 9Pro smartphone walked along the five routes shown in Figure 5b. Specially, compared to the experimental process in Area A, the walking process only specified the starting point and ending point of the route, so the walking process was free. Moreover, the sampling rate of the radio transceiver and inertial sensor are both set to 20 Hz.
The following techniques were used to deal with the trajectory tracking process based on PDR. An accelerator based on three axes and a bandpass filter were used for step detection and noise removal, respectively, while the peak detection method [39] was used for step detection. Besides, Weinberg algorithm [40] was applied to calculate the step length. For step orientation estimation, the experiment converted the azimuth range from (−π, π) to (0, 2π) to simplify the computing process. The experiment compared the proposed RMPAEC scheme with the peer scheme RMPA, which also uses pedestrian trajectories to construct radio maps. Table 1 illustrates the comparison schemes. Table 1. Key comparison schemes.

RMPAEC
The proposed scheme that uses the position adjustment and equipment calibration RMPA The process that only the position adjustment is applied, not the fingerprint amendment method PDR-Only The process that only performs PDR to form the pedestrian track PDR-RMPAEC The proposed scheme that performs position adjustment for the tth one (t > 1) by exploiting the intermediate RMPAEC radio

Performance Analysis of PDR Estimated Position Adjustment
Firstly, the performance of PDR estimated position adjustment was compared by using Routes I and II in Area A. Ten different crowdsourcing user trajectories were acquired for each route as training trajectories, and the best and worst trajectories were selected on the basis of the trajectory average localization error (ALE). Figures 6 and 7 compare the PDR estimated position adjustment and localization performance of Routes I and II, respectively. For Route I, Figure 6a,b show the best No. 9 track with ALE of 0.86 m and the worst No. 5 trajectory with ALE of 2.41 m of the proposed PDR-RMPAEC scheme, respectively. Figure 6c,d are the cumulative distributions of positioning error between different methods corresponding to Figure 6a,b, respectively. It can be seen from the trajectory diagrams in Figure 6a,b that the trajectory generated by the PDR-Only scheme has the largest deviation from the actual walking route, which can be identified as the result of the accumulate error of PDR.  Figure 6a shows that the trajectory of PDR-RMPA is closer to PDR-Only than PDR-RMPAEC, indicating that the constructed intermediate RMPAEC radio map has better positioning performance than the intermediate RMPA radio map. The best PDR-RMPAEC positioning effect is mainly attributed to the proposed fingerprint correction algorithm in this case, which can be verified in Figure 6c. Comparing PDR-RMPA and FL-RMPA, it is noteworthy that the positioning performance of FL-RMPA is better than PDR-RMPA, which is attributed to the implementation of the proposed fingerprint correction algorithm on the intermediate RMPA radio map. The effectiveness of the proposed fingerprint correction algorithm is verified. On the other hand, comparing PDR-RMPAEC and FL-RMPAEC in Figure 6c, it can be found that the positioning performance of PDR-RMPAEC is better than FL-RMPAEC. In other words, the PDR estimated position adjustment and fingerprint amendment algorithms are performed on the intermediate RMPAEC radio map, and the positioning performance after performing the trajectory adjustment is better. The effectiveness of the proposed PDR estimation position adjustment algorithm based on selective particle filtering is verified. Figure 6b shows that the trajectories of PDR-RMPAEC and PDR-RMPA are closer to the ground truth, which should be attributed to the proposed fingerprint amendment algorithm. Moreover, Figure 6d shows that the ALEs of PDR-RMPAEC and PDR-RMPA are relatively low, whether comparing the positioning performances of PDR-RMPAEC and FL-RMPAEC or PDR-RMPA and FL-RMPA, which can prove the effectiveness of the proposed fingerprint amendment algorithm.
For Route II, as shown in Figure 7, observation results similar to those in Figure 6 can be obtained. In particular, the proposed PDR-RMPAEC scheme can reduce ALE by 1.9 and 4.62 m, respectively, compared to the PDR-Only with the worst positioning effect on the optimal trajectories of Routes I and II. Since the step RSS samples of a trajectory used for radio map construction are indeed distinguished, the effectiveness of fingerprint amendment method can be verified.

Performance Analysis of the Constructed Radio Map
The positioning performance of the constructed radio map is checked below. For Area A, a radio map was constructed according to the 20 training tracks obtained from Routes I and II, and its positioning performance on Route III trajectory was checked. For Experimental Area B, the radio map was composed of 20 training tracks of four types, while the positioning performance of the testing tracks of three types was examined. Figures 8 and 9a plot the ALE for each test trajectory in the experimental environment. Firstly, it can be seen in the figures that the ALEs of PDR-RMPAEC and PDR-RMPA are relatively low, whether comparing the positioning performances of PDR-RMPAEC and FL-RMPAEC or PDR-RMPA and FL-RMPA, which can prove the effectiveness of the proposed PDR estimated position adjustment algorithm. Then, it is worth noting that PDR-RMPAEC can achieve smaller ALE than PDR-RMPA scheme, which can reduce ALE by up to 3.4 m. The results indicate that the localization performance of the radio map constructed by the proposed RMPAEC is better than that of the RMPA scheme, and can further prove the effectiveness of the fingerprint amendment algorithm in the proposed RMPAEC.  By comparing the ALE of the proposed PDR-RMPAEC scheme drawn in Figure 9a, the two cases where the ALE with the best localization performance is 0.66 m and the ALE with the worst positioning performance is 2.38 m are selected. The pedestrian path drawing of these two cases are depicted in Figure 11a,b. In comparison with the other two schemes, the adjustment trajectory produced by the proposed scheme is closer to the real pedestrian path, which proves the effectiveness of the proposed fingerprint amendment algorithm. However, the trajectory generated by the PDR-Only scheme has the largest deviation from the actual walking route, which can be known as the result of the accumulate error of PDR. In addition, the proposed PDR-RMPAEC scheme can work well even in the case where the test trajectory of Figure 11b is more complicated. When comparing the CDF of the localization errors between PDR-RMPA and FL-RMPA in Figure 11c,d, it can be observed that the positioning performance of PDR-RMPA is better, that is, the scheme of executing the position adjustment algorithm is better than that using RSS fingerprint recognition alone, which confirms the effectiveness of the proposed position adjustment algorithm.

Conclusions
Aiming at the problems of the diverse terminal equipment and inaccurate location annotation of samples when using crowdsourced samples to construct indoor radio maps, a RMPAEC scheme based on position adjustment and equipment calibration is proposed in this paper. The proposed scheme uses particle filtering to adjust the positions of crowdsourcing users based on PDR estimation, and constructs an RSS data cube. Through an inter-device calibration algorithm, the fingerprints collected by multiple devices are fused into a device-independent grid fingerprint. Then, the coordinates of the calibrated user's position and the corresponding grid fingerprints are stored in the fingerprint database together to form an offline indoor radio map. Finally, when new RSS samples are included, a fingerprint amendment algorithm is used to update the offline radio map. Simulation results reveal that the proposed solution achieves lower ALE than other peer schemes, thus verifying the effectiveness of RMPAEC in improving PDR estimated position and localization performance. For future work, we plan to consider the influence of factors such as floors on positioning, and study the multi-floor indoor localization technology in three-dimensional space.