{'fraction_non_alphanumeric': 0.0293153232516028, 'fraction_numerical': 0.008270934272989772, 'mean_word_length': 4.567847411444141, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Assistive Approach for Pedestrian Dead Reckoning Based on RSSI Using Access Point Selection Method

Since smartphones have been widely adopted by the general public and wireless fundamental infrastructure has been changed greatly, indoor positioning and location tracking methods have been applied to various kinds of service and applications. Pedestrian dead-reckoning (PDR) and a received signal strength indicator (RSSI)-based positioning method are widely used since they can be easily utilized by smartphone with build-in sensors such as accelerometer and gyroscope. However, estimation error would occur to PDR which caused by environmental interference and accumulation error in angular calculation. Moreover, RSSI measurements fluctuate according to external effects. In this paper, a novel indoor localization method based on access point (AP) selection is proposed. By assisting PDR with RSSI from stable APs, the heading angle can be updated periodically to reduce the error. Furthermore, in order to enhance the accuracy, the angle is calculated using quaternion. The experimental results show that the suitable APs selection can improve the accuracy effectively.


Introduction
Recently, with the development of wireless network and mobile technologies, location based services (LBS) become more and more popular. They have already been used in many indoor positioning systems (IPS) such as health care, social network, monitoring, and emergency rescue. There are many technologies about IPS, such as global positioning system (GPS), Wi-Fi, micro electro mechanical systems (MEMS) sensors, Bluetooth, and radio frequency identification (RFID) [1]. Although GPS can be used in outdoor environments with sufficient accuracy, it cannot keep high accuracy in indoor environments due to a big challenge for the signal to reach certain positions in complex building structures.
Indoor localization based on received signal strength indicator (RSSI) is widely used since Wi-Fi network infrastructures have already been deployed. However, some Wi-Fi access points (APs) cannot be used directly since RSSI is easily affected by external factors such as people's movement, reflection from the wall, and so on. The unsuitable APs may decrease the accuracy of localization.
Besides, pedestrian dead-reckoning (PDR) is also another popular low-cost localization method which can be realized by using smart-devices with integrated sensors such as accelerometers, gyroscopes, and magnetometers.
Usually, compass data is used to estimate the heading angle in the PDR method. However, the compass data is easily affected by external environment such as electronic devices and iron-based material. Therefore, it has been considered not realistic to use data obtained from compass as heading angle in real world applications. On the other hand, the obtained data of acceleration and gyro have accumulation error with time.
When the time comes longer, the bigger error appears. Therefore, PDR is not adequate enough to obtain locations with high accuracy for a long term.
In this paper, a novel method based on RSSI using an APs selection method fused with PDR is proposed to improve indoor localization. In this method, heading angle is estimated by calculating the yaw angle with quaternion from acceleration and gyro data, and a suitable APs selection strategy is conducted. Experimental results demonstrate the feasibility of the proposed method.
The process of the proposed method in this paper has been partially described in the prior conference publication [2]. The new analysis results are added to the present paper that evaluates the proposed method by comparing the performances between different methods.

Trilateration
Trilateration is one of the most widely used algorithms in localization [3]- [5] since it can be easily realized by the existing wireless infrastructures. The location of a target can be determined by finding the point of intersection formed by three circles, radial distances of which are converted from RSSI from each APs by using log-distance path loss model [1], as shown in Eq. (1): where the received RSSI data are recorded as R i,t , n AP is the total number of visible APs and i ∈ {1, 2, . . . , n AP }, d i denotes the distance between the target and the ith AP, N i represents the path loss exponent, and A i represents the path loss at the ref-  affected by environment critically. Hence, a method of determining which RSSI should be used is needed.

Pedestrian Dead-Reckoning
Pedestrian dead-reckoning (PDR) [6] is another promising solution for indoor positioning. PDR needs to get data from some hardware devices, such as smart-device or an inertial measurement unit (IMU) that can be carried by the target. Then the advancing position of the target L t at time t can be simply calculated by Eq. (2): where t represents the step, X t and Y t represents the Cartesian coordinates of the target, D represents the step length, and θ t represents the heading angle. The concept of PDR is shown as Fig. 1.
It is often assumed that the step length D and the starting position are known. In ideal situation, using the known heading angle at following time intervals and the travelled distance, the consecutive positions can be obtained. There are two kinds of methods to calculate the distance; the first one, the number of steps can be detected by using observing peaks in acceleration measurements; then it is assumed that the length of each step is stable [7] or rely on some parameters, for instance, acceleration variance or step frequency. The second one, the distance can be calculated by integrating continuous acceleration measurements twice. As for the heading angle, it is decided by the data taken by sensors like magnetometers, gyroscopes, and accelerometers. However, calculations based on such unreliable measurements are easy to obtain errors because these sensors suffer from non-Gaussian and non-zero noises [8]. In addition, if the sensors are used in some particular situations such as swinging hands or a pocket of a walker, the measurements will be more complicated due to random body movement.

Step estimation and turning detection
The travelled distance can be calculated by the walking length and the number of steps. In order to obtain the number of walking steps, firstly, the norm of accelerations of 3-axis [9] is calculated by Eq. (3): After using moving average and a low pass filter to remove the noise, the difference between each step and the previous step is calculated. A step can be identified in the waveform when finding a peak followed by a trough as shown in Fig. 2 (a). The number of steps are determined by the number of peaks. On the other hand, by using the norm of angle velocities for 3axis in Eq. (4) and calculating the difference between each step and the previous step, a turning is detected by setting a threshold [10]. An example of turning detection is shown in Fig. 2 The length of each step is often assumed as a constant value since the variance of walking length between each step is considered to be small. It is possible to calculate a step length from height and gender [11] using Eq. (5): where H represents the height of the target. However, the small difference between each walking length will cause accumulated errors in calculating distance. Therefore, the inverted pendulum model is proposed to represent the phase of human walking [12]. The walking length can be calculated by an approximated equation expressed as Eq. (6) and Eq. (7): where D t is the walking length at step t, which can be calculated from S a max t and S a min t that represent the maximum and minimum values of norm of acceleration, respectively. The coefficient E is the ratio of the real and estimated distance of a reference path d. In this research, the approximated inverted pendulum model is used to calculate the walking length.

Heading angle estimation
The expression of the heading angle θ t as shown below: where θ represents the change of the angle in each step. The heading angle θ t will be updated in every step or whenever the turning event happens. There are many methods to estimate the heading angle. Among them, some methods use compass data; however, they are easily affected by external environment such as electrical devices. Therefore, in this research the attitude and heading reference system (AHRS) algorithm is used to calculate the angle by using quaternion [13]. The AHRS algorithm uses the data from sensors on 3-axis that provide attitude information for the target, including roll, pitch, and yaw.
IMU MPU9250 supports digital motion process (DMP) which can obtain quaternion directly with high accuracy. For estimating, it is necessary to convert quaternion to Euler angles (roll, pitch, and yaw) [14] by where quaternion includes four scalar elements, w, x, y, and z. However, when using quaternion method, the accumulated error is caused by integrating the angle velocity with time. In a long term estimation, the bigger error might present. Therefore, finding an effective correction method to update the heading angle is necessary.

Proposed Method
Some researchers use Wi-Fi based on received signal strength indicator (RSSI) to assist PDR for correction [10]. However, some Wi-Fi access points (APs) cannot be used because RSSI is easily affected by external factors such as people's movement and reflection on the wall. In this research, a new method is proposed by using an APs selection method to improve the heading angle correction.

Access Points Selection Method
Many existing AP selection methods normally select APs in a sampling stage or location stage [15]. In this paper, the APs selection method [16], [17] is used. In this method, an index for selecting the APs that can be used for positioning effectively is calculated. The discrimination index for each AP based on the sampled RSSI is shown in Eq. (10): where R j i denotes the mean value of the RSSI that comes from the jth AP, Ds(AP j ) denotes the discrimination of the jth AP, m is the total number of the reference points, and R j SD i denotes the moving standard deviation of the RSSI sampled by the jth AP in several time steps. For the jth AP, the index Ds(AP j ) indicates the discrimination of the received RSSI. The index of discrimination is used for the weight to corresponding RSSI. The selection index of APs Rk j is calculated by where R j * represents the value after normalization. Then the index Rk from maximum to minimum is ranked. In the end, the first l access points are chosen by using the ranking score or directly adapting an adequate threshold to the moving standard deviations for each AP.

Particle Filter
Thirdly, the sampling importance resampling particle filter (PF) [10], [18] is used based on the selected RSSI to estimate the position. Here, L t = [x t , y t ] T is calculated as where k is number of particles, k ∈ {1, 2, . . . , N s }, and N s is total number of particles. Both ε x and ε y are distributed as N(0, δ 2 q ), where δ q represents the standard deviation of the process noise. The weight w k of each sample can be calculated by Eq. (13) [10]: where N A is total number of selected AP, and σ r represents the standard deviation of measurement noise, g k i , which represents the distance between the ith AP and the sample L k t , can be calculated by where P i represents the location of the ith AP selected from the list in Section 3.1. After that, the weights are normalizing by In the end, by using the N s samples to obtain the sample set {L k t } N s k=1 , the position L t is computed by

Heading by Linear Regression
The correction of the target's heading angle is performed only when the target walks in a long straight way. It is considered to be adequate to update the heading angle only when the target walks in a long straight line since in the most of indoor environments, such as in the large-scale shopping complexes and office building, people often walk through long straight corridors. Here, the detected long straight line is termed as series. After computing the position of whole series, linear regression line is obtained from the positions [10]. During series, each position has two values named x t and y t in coordinate. It is chosen from regression of y t on x t or regression of x t on y t . For the series, using x F and y F at the first position and x L and y L at the last position, when x F − x L ≥ y F − y L , the regression line will be calculated as regression of y t on x t . Otherwise, the regression line will be calculated as regression of x t on y t . At last, the estimating route can be represented by the regression line, and the heading angle θ of route can be denoted by the direction of this line [10].
After obtaining the new heading angle θ, it is possible to re-calculate all the previous calculated angles and positions by Eq. (2).

Experimental Setting
The experiment environment is shown in Fig. 3. The total distance of all route is 151.7 m. The whole route can be separated to four straight routes, and the heading angle between two connected routes is 90 • . In the area, 15 access points are deployed as the anchor nodes, the frequency of which is 5 Hz. RSSI data is collected from active APs during walking by using the laptop held by the target. An IMU sensor with sampling rate 50 Hz is used to obtain the acceleration and gyro data, which  is attached to chest of the target's body as shown in Fig. 4. The target whose body height is 1.57 m, who goes and returns through whole route several times from a start point to an end point with normal walking speed.

Comparison of angle calculation
Compass data is very popular in a number of researches to detect the angle of a target's movement; however, it is easily affected by environment. In this experimental field, the PDR result with compass data is shown in Fig. 5 (a). The estimated angle is updated in each time. It indicates that it is difficult to use compass data in this area because the estimated route is apparently unstable.
The experiment of PDR estimating heading angle by quaternion is conducted with three paths to present the accumulated error as shown in Fig. 5 (b). Firstly, the target travels through the actual route from the start point to the end point. Afterward, the target returns to the start point by the way the target came from, and then travels again to the end point through the same way. Even if the calculation of quaternion can obtain angles with high accuracy in first path, the accumulated error still occurred as traveling distance getting longer and longer.

Utilization of AP selection
In order to reduce the accumulated error, the method using RSSI to correct angle after traveling thought long distance has been proposed [10]. Furthermore, in our proposed APs selection method, appropriate APs will be selected before converting it to distance, since some RSSIs could be unstable while interfering by external factor. In the APs selection method, the moving standard deviations of RSSI are calculated every three steps, which is used as a filter to process the received RSSI value from active APs. As examples, the moving standard deviations for each steps in route 1 and part of route 2 are shown in Fig. 6 (a) and Fig. 6 (b), respectively. In these cases, the number of active APs is often less than four; therefore, the threshold value set to 5 dB (mW) is used to select APs. In some steps, one or more APs have a large standard deviation. As a result, it could make the accuracy of estimation result worse. The proposed method is successfully able to remove such unnecessary APs from the calculation of the positon estimation.

Comparison of trilateration method
In this part, the trilateration is conducted to detect the moving target. Since RSSI values are often influenced by environmental factors, the APs with fluctuating RSSI values are removed, and comparative stable APs are chosen by the selection method for performing the trilateration method. The comparison result of the position estimation in route 2 with and without the APs selection is shown in Fig. 7. The result shows that the estimations of trilateration with selecting suitable APs have better performance on estimating both heading angle and position than those without selection.

Evaluation of estimation results
The estimated results of the previous RSSI-based heading correction method [10] and the proposed method in route 2 of the third traveling path are shown in Fig. 8. Comparing to the previous method which estimated positions without APs selection, the proposed method is comparatively stable and reliable rather than using all of active APs. They illustrate the location estimation for different APs selection. For estimation without APs selection method, the heading angle error reaches 1.9 • , while it values 0.1 • for the proposed method.
In order to confirm the reproducibility of the proposed method, the same condition of experiment is conducted. The results of estimated angle in route1 are 5.3 • , 3.9 • , and 5.6 • in experiment 1, experiment 2, and experiment 3, respectively. The result shows that the approximate estimated heading angle can be obtained repeatedly, which indicates that the reproducibility of the proposed method is proved as example of route 1 shown in Fig. 9.
The trajectories of all routes from the start point to the end point in both methods are shown in Fig. 10. Although there is about 5 m error at the last point in the route 3 on the trajectory of proposed method, the errors in the other routes are small enough. It could be said that the accuracy of estimation for the total routes is adequately high. Furthermore, Fig. 10 shows that the proposed method can increase the accuracy of estimation effectively even if the accumulated error occurred in angle calculation from quaternion with time.    Table 1 The angle error and the average error of each position.
The performance comparison between proposed method and estimation without APs selection method are summarized in Table 1. For the proposed method, the average error of heading angle is only 1.4 • , and the average error of position is only 2.1 m. In almost all points, the proposed method outperforms the other method. Figure 11 also shows that the proposed method not only surpasses the other method but also reduces the error caused by accumulated error, and it can correct the heading angle and the position more effectively.

Conclusion
In this paper, a novel localization method that can improve PDR estimation based on RSSI using APs selection is proposed. The experimental result shows that the estimated heading angle by calculating the yaw angle with quaternion from acceleration and gyro data can reduce the error of angle. Additionally, by assisting PDR with the RSSI-based localization method cooperativity, the accumulated error can be corrected effectively. Furthermore, by using the APs selection method to select suitable RSSI, it can achieve higher accuracy than using all APs directly. Future work intends to improve the method in order to adapt to different environment. Moreover, complicated scenario such as the effect of body compensation should be considered in the future.

Shigeyuki TATENO (Member)
He received his B.S., M.S., and Ph.D. degrees from Kyushu University, Japan, in 1990, 1992, and 2001, respectively. In 2003, he joined Waseda University, where he is currently an Associate Professor of Graduate School of Information, Production and Systems. His research interests include wireless network systems.

YiTong CHO
She received her B.A. degree from National TsingHua University, Taiwan, in 2010. In 2016, she joined Waseda University, Japan, where she is currently a student of Graduate School of Information, Production and Systems. Her research interests include wireless network systems.

DungHan LI
He received his B.S. degree from I-Shou University, Taiwan, in 2014. In 2016, he joined Waseda University, where he is currently a student of Graduate School of Information, Production and Systems. His research interests include wireless network systems.

Hao TIAN
He received his B.S degree from Hubei Engineering University, China, in 2010. In 2015, he joined Waseda University, where he is currently a student of Graduate School of Information, Production and Systems. His research interests include intelligent systems.