An indoor fusion navigation algorithm using HV-derivative dynamic time warping and the chicken particle filter

The use of dead reckoning and fingerprint matching for navigation is a widespread technical method. However, fingerprint mismatching and low fusion accuracy are prevalent issues in indoor navigation systems. This work presents an improved dynamic time warping and a chicken particle filter to handle these two challenges. To generate the Horizontal and Vertical (HV) fingerprint, the pitch and roll are employed instead of the original fingerprint intensity to extract the horizontal and vertical components of the magnetic field fingerprint. Derivative dynamic time warping employs the HV fingerprint in its derivative form, which receives higher-level features because of the consideration of fingerprint shape information. Chicken Swarm Optimization (CSO) is used to enhance particle weights, which minimizes position error to tackle the particle impoverishment problem for a fusion navigation system. The results of the experiments suggest that the enhanced algorithm can improve indoor navigation accuracy significantly.


Introduction
Location-based services such as pedestrian navigation, fire rescue, and intelligent commodity storage are in high demand. Navigation is one of the most important technologies in location services. BeiDou Navigation Satellite System (BDS), Global Positioning System (GPS), GLObal NAvigation Satellite System (GLONASS), and Galileo navigation satellite system (Galileo) are the global satellite navigation systems that have been successfully employed (Chen & Chang, 2021;Mosavi et al., 2017;Wang, Zhang, et al., 2021). Many scholars have conducted extensive research on Global Navigation Satellite System (GNSS). Buildings impede or weak satellite signals, making it impossible to utilize a satellite system for indoor navigation. Other techniques are used, such as accelerometer (Jiménez et al., 2010), gyroscope (El-Sheimy & Youssef, 2020), geomagnetism (Zhang et al., 2014), Wireless Fidelity (WiFi) (Biswas & Veloso, 2010), vision (Möller et al., 2012), Radio Frequency Identification (RFID) (Xu et al., 2017), and so on. As a means of communication, smartphones have gained popularity. One of the most common approaches is to utilize a smartphone as a navigation device.
Smartphones are successfully integrated with Micro-Electro-Mechanical Systems (MEMS) accelerometers and gyroscopes. By integrating with acceleration and angular velocity, the smartphone's position, speed, and attitude are calculated. Although many studies (Shin & El-Sheimy, 2002;Syed et al., 2007) used mathematical modeling or a turntable calibration platform to eliminate various inertial sensor errors, the position error caused by the integration remains divergent. Another method is to use gait Dead Reckoning (DR) to estimate position in two dimensions (Chen et al., 2018a). The most significant features of a gait-based DR are attitude angles, step length, and step counting. The inverted pendulum model is used to compute the pedestrian

Open Access
Satellite Navigation https://satellite-navigation.springeropen.com/ *Correspondence: jchen@sspu.edu.cn step length after segmenting the vertical acceleration . Although DR can reduce the error caused by an integral operation, the cumulative error still exists. The greater the walking time, the larger the position error is. The position error is proportional to the cubic power of walking time (Ali & El-Sheimy, 2013). Yu et al. used the Particle Filter (PF) to successfully reduce pedestrian position error after introducing the map's new information (Yu et al., 2016).
The use of fingerprints for navigation is becoming popular. Fingerprint intensity is influenced by the spatial environment, resulting in variable fingerprint intensities in different locations. In other word, the fingerprints in adjacent locations are similar, whereas fingerprints from far away locations are different. In the offline phase, the fingerprints and their associated spatial positions are used to establish a reference fingerprint database. In the online phase, a smartphone measures the fingerprints. The matching approach is used to estimate the relevant position. Mismatching of fingerprints is unavoidable in the matching process. By constructing multidimensional fingerprints, Wang et al. effectively reduced fingerprint mismatching (Wang et al., 2020).
To further solve the low accuracy problem of a fusion system, a number of fusion approaches incorporating DR and fingerprint matching have been developed (Chen et al., 2015). Li et al. used the DR navigation results to restrict the fingerprint matching scope, and the Multi-Dimensional Dynamic Time Warping (MD-DTW) algorithm to calculate the distance between online and reference fingerprints (Li et al., 2016a). The performance of the fusion method is determined by the DR results. Chen et al. and Li et al. introduced the Extended Kalman Filter (EKF) and the unscented Kalman filter, respectively (Chen, et al., 2015;Li et al., 2016b). Because the Kalman filter is only applicable for linear systems, fusion algorithms' ability to improve their navigation performance is severely limited. Xie et al. used an improved PF, but cannot solved the particle impoverishment problem (Xie et al., 2014). To overcome the aforementioned difficulties, this research proposes an effective indoor navigation technique. The innovative work is as follows.
The pitch and roll are used to extract the horizontal and vertical components of the magnetic field fingerprint to construct the HV fingerprint. The derivative of the HV fingerprint is employed, which possesses higher-level properties. The HV-Derivative Dynamic Time Warping (HV-DDTW) is proposed to reduce magnetic fingerprint mismatching.
To tackle the particle impoverishment problem, a CSO technique is proposed to improve the particle weights. An improved PF, or a Chicken PF (CPF), can increase the position accuracy of an indoor navigation system. The experiments show the position accuracy for a laboratory and an office building achieved 0.88 m and 1.1 m, respectively, with four different motion modes.
In this paper, the second section discusses the related work; the third section delves into the algorithm model; the fourth section describes the experiments in various scenarios; and the fifth section summarizes the study and gives the recommendations for future work.

Related work
Indoor navigation algorithms can be divided into two groups: the single-sensor navigation algorithms and the multi-sensor navigation algorithms. A single-sensor navigation algorithm uses only the data of one sensor, and the positioning performance is improved primarily by dealing with a data source. It is simple and straightforward to use, but has limited applications. A multi-sensor navigation algorithm combines the data from numerous sensors to better positioning performance by coping with the data sources. The navigation algorithm is relatively complex, but widely used.

The single-sensor navigation algorithms
The single-sensor navigation has been studied extensively. Park and Suh provided a new zero velocity detection approach using the Markov model by segmenting the angular velocity (Park & Suh, 2010). To correct the lower-frequency biases in the accelerations and angles, Yan et al. merged sophisticated machine learning algorithms with inertial navigation system (Yan et al., 2018). To improve the accuracy of WiFi fingerprint matching, some researchers have used an indoor WiFi attenuation model to update fingerprint databases (Sun et al., 2018). Li et al. described the method to use the magnetic field value as a fingerprint for indoor localization (Li et al., 2012). A robust Ultra-Wide Band (UWB) indoor positioning system was proposed based on the skewness of the estimated channel impulse response (García et al., 2015). It can accurately operate in a very complex indoor scenario. Indoor localization is accomplished using a RFID signal propagation model based on the weightedleast square approach (Wang, Zhang, et al., 2021).

The multi-sensor navigation algorithms
The multi-sensor fusion algorithms have been widely researched because they take advantage of the complementing qualities of sensor data. Li et al. used a multilayer quality control strategy to reduce the positioning error of the fusion algorithm, which is based on the interaction of different technologies such as Pedestrian Dead Reckoning (PDR), magnetic field, and WiFi . To incorporate PDR, magnetic field, and floor plan, Wang et al. employed an adaptive unscented Kalman filter . To combine LiDAR, cameras, and inertial sensors, Li et al. employs the federated filters (Li et al., 2020). However, the Kalman filter cannot improve dramatically performance for nonlinear indoor navigation systems. The fusion navigation system based on magnetic/WiFi/ PDR selects the fusion strategy to combine the positioning results based on the PF framework (Guo et al., 2016). To combine MEMS sensor and indoor map data, Yu et al. employs an auxiliary PF (Yu et al., 2017). The weight is set to zero when the particles cross the wall. The auxiliary PF increases positioning precision by removing invalid particles. However, the particle impoverishment problem, is more serious and affects the algorithm's stability.

Methodology
As illustrated in the indoor fusion technique is made up of four parts: the gait-based DR, magnetic field fingerprint matching, WiFi fingerprint matching, and a fusion algorithm. The gait-based DR module uses heading, step length, and step counting to estimate pedestrian position. Zero velocity UPdaTe (ZUPT) and EKF are used to eliminate noise. HV-DDTW employs the derivative of the fingerprint instead of the original one in the magnetic field fingerprint matching module, which obtains higher-level features due to considering the fingerprint shape information. The pedestrian position is estimated using the Weighted K-Nearest Neighbor (WKNN) technique. The WiFi fingerprint matching module uses the MD-DTW approach to determine the fingerprint distance (Li, et al., 2016a). The revised PF algorithm in the indoor fusion algorithm effectively increases the accuracy of pedestrian navigation following the introduction of the CSO algorithm (Fig. 1).

The gait-based DR
EKF, step length, step counting, and heading estimation are all parts of the technology. EKF is used to filter out vertical velocity noise when zero velocity is detected. DR is used to estimate the position of a pedestrian after computing the heading, step length, and step counting.

EKF
To determine if a pedestrian is static, the ZUPT algorithm is used. The EKF is triggered to filter out noise when a pedestrian is detected to be stationary. The following is a 9-element state vector.
where r z and v z denote the vertical displacement and vertical velocity, respectively; S roll , S pitch , and S yaw denote the user's attitude angles; ∈ v z denotes the bias of the vertical velocity; ∈ roll , ∈ pitch ., and ∈ yaw denote the biases of the attitude angles.
The EKF system equation reads Step counting

Fig. 1 The indoor fusion navigation algorithm framework
where F k−1 denotes the state transition matrix; H k denotes the observation matrix; ω K −1 and v k denote the state transition noise and the observation noise. Refer to reference (Chen et al., 2018b) for the determination of the four parameter values ( Step length The pedestrian step length is calculated using the inverted pendulum model. The vertical acceleration is determined as follows when the accelerometer collects the acceleration. where a z (t) is the vertical acceleration; the acceleration and gravity at the t-th epoch are represented by a(t) and g(t) , respectively; and | * | denotes the norm of a vector. The vertical displacement can be calculated using the double integral method.
where t 1 and t 2 are the beginning and ending times of the vertical acceleration, respectively; and S VD is the vertical displacement.
The step length is calculated using the inverted pendulum model as follows.
where D SL denotes the length of one step and L denotes the distance between the smartphone and the ground while the walker is static.

Step counting
When a pedestrian is walking, the smartphone moves up and down, forming peaks and troughs. The two adjacent troughs are taken as one step for the pedestrian. (2) where the trough point of the vertical acceleration is represented by t trough ; two epochs are represented by t 1 and t 2 ; and the vertical acceleration threshold is represented by a thd . The pedestrian step counting is depicted in Fig. 2.

Heading
The quaternion approach is used to update the angle increment when the angular velocity is collected by the gyroscope. The quaternion vector at the (k + 1)-th epoch reads where q k+1 = q 1 q 2 q 3 q 4 k+1 ; I is a 3 identity matrix; and �θ k is the angle increment. is calculated as follows.
where �θ x k , �θ y k , and �θ z k represent x, y, z triaxial angle increments at the k-th epoch, respectively.
The directional cosine matrix is calculated as follows after the quaternion vector has been updated.

DR
The DR algorithm determines the pedestrian position based on its previous position x k y k T and the current step length D SL and heading ϕ.

Fingerprint matching Database training in the offline phase
The databases < location, RSS > and < location, magnetic feature > are both created in the offline phase. The walk-survey approach is a time and cost-effective way of constructing a fingerprint database (Li et al., 2015b). As illustrated in Fig. 3, the reference points in a test area are first marked. Then a laser rangefinder is used to get their two-dimensional coordinates. When a reference point is reached while walking, the walking time and fingerprints including Received Signal Strength (RSS) and magnetic field are recorded. Finally, interpolation is used to acquire the fingerprints for other locations.

WiFi fingerprint
Android smartphones usually have low WiFi RSS update rates, such as 0.2 Hz for Nexus 5X. When the surveyor arrives at a reference point, he or she presses the button to record the time, and the WiFi fingerprint that is closest to the time of recording is used as the reference point fingerprint. The following is the WiFi fingerprint of the j-th reference point.
where pos i is the i-th reference point's two-dimensional coordinate; the media access control address and RSS of the j-th AP at the i-th reference point are mac i,j and (10) The triaxial magnetic field RSS i,j , respectively; and m is the number of available APs at the i-th reference point.

Magnetic fingerprint
As shown in Fig. 4, the magnetometer collects the threeaxis magnetic field ( B x ,B y ,B z ). The following is the magnetic intensity fingerprint at the k-th epoch of the i-th reference point. where represent the i-th reference point's two-dimensional coordinate and magnetic intensity at the k-th epoch of the i-th reference point, respectively. Constructing two-dimensional magnetic fingerprints is another method. The horizontal and vertical components of the magnetic field can be calculated using the attitude angles (Chen, et al., 2018a). The following is the definition of a two-dimensional magnetic fingerprint.
The vertical component of the magnetic field is calculated as follows (Li et al., 2015a).
where the horizontal magnetic field is denoted by B H . Figure 5 depicts the magnetic field's horizontal and vertical components, commonly known as HV magnetic fingerprints.

WiFi matching
The goal of WiFi fingerprint matching is to find the most similar reference fingerprint in the database using the acquired WiFi fingerprint. The position corresponding to the most similar reference fingerprint is the matching result. Multi-dimensional WiFi fingerprints are also used in the matching process to solve the mismatching of WiFi fingerprints. MD-DTW is the corresponding algorithm.

The improved magnetic matching
To determine the distance between online fingerprints and the fingerprints in a database, the DTW method is commonly employed. The shorter the distance, the higher the similarity is. The HV fingerprint is directly engaged in fingerprint matching in the classic fingerprint matching process. However, the impact of magnetic field shape information on the fingerprint matching method is ignored. According to reference (Keogh & Pazzani, 2001), the derivative method is introduced, and the HV-DDTW algorithm is proposed. Figure 6 shows the HV magnetic field fingerprint in its derivative form, which is calculated as.  The new fingerprint is used as input information, and Algorithm 1 HV-DDTW shows the calculation process.
The WKNN method is utilized to produce genetic field matching results, which involves calculating the weighted average of the k selected reference locations with the minimum Euclidean distance. The weighted average formula is as follows.
x i y i is the position of the i-th selected reference point; x y is the estimated position.

An improved indoor fusion positioning algorithm
The PF, unlike the Kalman filter, can be used to analyze nonlinear systems and is frequently used in indoor navigation applications. But the particle impoverishment problem is always of main concern. Different PF variants have been proposed to solve the particle impoverishment problem. Although revised algorithms improve navigation performance in various ways, there are still some drawbacks, such as low positioning precision.

Chicken swarm optimization
Chickens like roosters, hens, and chicks have a hierarchical structure and foraging activity that the CSO algorithm resembles. The CSO algorithm can quickly and easily solve all types of numerical problems in scientific research, and has the advantages of high convergence efficiency and fast convergence speed.

Update the position of the rooster
The rooster with a higher fitness value and a wider range of food searching has an advantage over the rooster with a lower fitness value and a smaller range of food searching during the food competition phase. Individual location i in the t-th iteration is indicated by X t i,j , where i ∈ [1, 2, 3, . . . , N ], j ∈ [1, 2, 3, . . . , Q] . The letters N and Q stand for chickens and dimensional space, respectively. The following is a new position for the rooster.
where randn represents a normal distribution with a mean of 0 and a variance of σ 2 ; f i denotes the fitness value of the i-th rooster; except for f i , f k represents any fitness value of a rooster; ε denotes a small constant.

Update the position of the hen
The hens usually look for the food near the roosters in their offspring, and they can prevent other individuals from stealing the food they have found. The hens with high fitness values are more likely to win the feeding competition than the hens with low fitness values. The position of the hen has been updated as follows.
where rand represents a random number between 0 to 1. The subscript r1 represents the rooster corresponding to the i-th hen; r2 represents any individual of the hen.

Update the position of the chick
A chick chooses a hen at randomly as its mother to establish the link between mother and son, and searches for food under the hen's direction. The chick's position has been updated as follows.
where X t−1 m,j represents the hen, followed by the jth chick, and F FL is the following coefficient.

The improved particle filter
The following are the improved PF system equations where ϕ is the pedestrian heading; the symbol for a change in pedestrian direction is �ϕ ; the pedestrian position is represented by x(k) y(k) T ; and the comparable noise is represented by G ϕ , G x and G y . The modified PF observation equations include WiFi and magnetic field fingerprint matching results, i.e. The steps k = 300 The steps k = 300 respectively. The weights for the WiFi and MM are defined as.
where R is the noise of the observation equation and �·� denotes modular operation; x y est represents the particle position estimated by the motion equation; x y WiFi and x y MM represent the results of WiFi and magnetic fingerprint matching. The particle weight of the improved PF is calculated as.
To solve the particle impoverishment problem, we modify the standard PF. Based on the chicken flock categorization method, all particles are divided into three groups. The categorization standard is determined by the total weight produced by the observation equation. The chicken swarm algorithm is separated into three levels based on the type of a chicken, i.e., a rooster, a hen, or a chick. The fitness of roosters is the highest, that of hens is the second, and that of chicks is the lowest, according to the fitness relationship. The particles are split into three levels as a result. The particles are separated into flocks of chicks if they cross through the wall. The particles are split into flocks of roosters if they do not pass the wall and their weights above the set threshold. If not, they are divided into hen flocks. The following formula is used to establish the threshold.
For the particles divided into a flock of rooste, formula (22) is modified as follows.
where q mea represents the average weight.
For the particles divided into a flock of hens, formula (23) is modified as where X mea1,j represents the average value of roosters, and X mea2,j represents the average value of hens.

Experimental scenarios
Two typical indoor environments were chosen for the tests, as shown in Fig. 7. A smartphone Honor 50 was utilized to acquire fingerprints in the offline phase. In the online phase, the data of acceleration, angular velocity, WiFi, and magnetic field were collected using a smartphone Nexus 5X. The walking speed was from 1 m/s to 1.5 m/s. Smartphone posture included four modes: calling, dangling, handheld, and pocketed.

Comparison of HV-DDTW and MD-DTW
Many studies employ the HV fingerprints to reduce fingerprint mismatching (Li, et al., 2015b). The higher-level feature fingerprint is built using the fingerprint shape (31a)  information. MD-DTW was proposed in (Li, et al., 2016b). The cumulative distribution functions (CDFs) of MD-DTW and HV-DDTW are shown in Fig. 8. The higher-level feature fingerprints-based HV-DDTW algorithm is clearly superior to the traditional MD-DTW algorithm.

Comparison of PF and CPF
Compared to PF, the effective improvement of CPF is illustrated in Fig. 9. It is selected as an example when the number of pedestrian steps k is equal to 200 and 300. The blue and red asterisks represent the posterior distribution of PF and CPF, respectively. The weights of many particles are so small that they contribute little to the posterior distribution, especially those in the ellipse. CPF, on the other hand, removes most of the small-weight particles. This is mainly due to the operation of the chicken swarm algorithm. On this basis, a lot of high-quality pedestrian position information is transferred from highquality particles to small-weight ones, and the chicken swarm algorithm is operated to increase the weights of particles and make them more uniform. PF is prone to suffer from the particle impoverishment problem during the resampling process, making it difficult to accurately estimate pedestrian positions. CPF generates new particles using three mechanisms, effectively increasing particle diversity. The position error of CPF is reduced compared to PF, as illustrated in Fig. 10. CSO is used to generate new particles when the particles cross the wall. The particle impoverishment problem is alleviated, and the diversity of particles is improved, thus reducing the position error of indoor pedestrian navigation.

Laboratory experiment
Students can conduct experiments in the laboratory, which features desks, windows, pillars, and walls. From Figs.11,12,13,14,15,16 illustrate the positioning trajectories, position errors, and CDFs for DR + WiFi, DR + MM, EDTW + REKF , and HV-DDTW + CPF in the calling, dangling, handheld, and pocketed modes. Compared to the traditional magnetic field fingerprint matching, HV-DDTW can significantly reduce magnetic field fingerprint mismatching by introducing higher-level fingerprints. The CSO algorithm is used to overcome the particle impoverishment problem by effectively improving particle weights. As a result, CPF can improve the accuracy of indoor navigation significantly.

Office building experiment
One of the iconic indoor scenes is the office building's corridor. There are classrooms, doors and windows, and numerous square columns along the corridor's edge. In the calling, dangling, handheld, and pocketed modes, the positioning trajectories, position errors, and CDFs for Adaptive Particle Filter (APF) (Hu et al., 2021), WiMag (Guo, et al., 2016), and HV-DDTW + CPF are shown in   . 17, 18, 19, 20, 21. Figure 22 depicts the position errors of four walking experiments using the handheld mode as an example. In

Evaluation of the effectiveness of different smartphones
Two commonly used smartphones (i.e., Nexus 5X and Honor 50) were used for fingerprint collection. We assume that H-N represents the reference fingerprint collected using the smartphone Honor 50 and the measured fingerprint collected using the smartphone Nexus 5. The effectiveness of different smartphones is evaluated as shown in Fig. 23. It can be seen in the figure that the different smartphones used to collect fingerprints give similar position errors, except for the maximum error.

Conclusion
To tackle the challenges of fingerprint mismatching and low fusion accuracy, an indoor fusion navigation solution is given. The attitude angles are utilized to extract the horizontal and vertical components of the magnetic field, and the HV fingerprint for magnetic fingerprint matching is created. The HV-DDTW algorithm for computing magnetic fingerprint distance is suggested, which takes into account the fingerprint shape information and matches fingerprints using higher-level features. The chicken swarm algorithm is used to overcome the impoverishment problem of particles in the classical PF. The multi-sensor positioning data is fused using CPF. The algorithm's superiority is demonstrated by the experimental findings. The other merits of the indoor navigation algorithm include no need for a new infrastructure, inexpensive, and dependable. Because smartphones will have more and more sensors, indoor navigation solutions should include as more sensors as possible. The indoor navigation algorithm should be also integrated with machine learning to create a mathematical model through multiple training to improve positioning accuracy.