1. Introduction
Location-based services (LBSs) have received increased attention because of their high social requirements. Accurate location in intelligent navigation positioning systems can provide effective support for optimizing travel routes, improving traffic efficiency, and so on. Merchants can supply precise marketing and push personalized promotional activities according to location services. LBSs are also the core part of the development of smart cities and have broad development prospects [
1]. However, satellite signals cannot penetrate indoor environments because of building obstructions; consequently, the global navigation satellite system (GNSS) cannot be engaged [
2]. Therefore, indoor positioning technology research has become an extremely important research hotspot.
Researchers and scholars have conducted a series of studies on indoor positioning techniques and have made great achievements. However, indoor positioning technology still faces challenges. Among the available technologies. Among the existing technologies, such as Wi-Fi positioning [
3], Bluetooth positioning [
4], ultra-wideband (UWB) positioning [
5], and pseudo-satellite positioning [
6]. These techniques, while highlighting the advantages of relatively good positioning, also have drawbacks that are hard to ignore. In Wi-Fi positioning, its signal is easily interrupted by the complex indoor environment, with obvious multipath effects, and when the environment changes dynamically, such as intensive indoor personnel movement or layout changes, the positioning accuracy will drop drastically. In Bluetooth positioning, signal coverage is limited, generally only within a few tens of meters, and a large scene deployment of Bluetooth beacons will be costly. In UWB positioning, accuracy can reach a centimeter level, but the serious signal delay and distortion in non-line-of-sight propagation, the high cost of equipment, and the poor compatibility of equipment from different manufacturers limit large-scale applications. Pseudo-satellite positioning faces the problem of difficult signal synchronization and the difficulty and high cost of deployment and commissioning. There are still no unified technical specifications or mature applications for indoor positioning technologies. Geomagnetic signals are very pervasive and stable, and they are able to penetrate a wide range of building materials without the need for additional infrastructure, so low-cost positioning can be realized based on geomagnetic positioning technology.
Geomagnetism is a natural phenomenon that occurs within the Earth’s interior. In addition, many iron-containing materials cause geomagnetic anomalies in indoor buildings, and anomalous geomagnetism with more features is beneficial for positioning. Moreover, geomagnetic positioning can achieve low cost and consumer-level accuracy. It has broad application prospects. In geomagnetic positioning methods, dynamic time warping (DTW) [
7] is the classic algorithm. Geomagnetic positioning based on DTW seeks geomagnetic similarity by finding the minimum cumulative distance between the geomagnetic sequence to be located and the geomagnetic fingerprint database, and the target location can be determined. Subbu et al. [
8] adopted the DTW algorithm to achieve target localization of different motion speeds, which can effectively mitigate the impact of different states and achieve a positioning accuracy of 2–6 m. Gong et al. [
9] proposed a geomagnetic localization algorithm using PDR-assisted DTW. The presented method can achieve reliable and continuous positioning and meet consumer-level positioning requirements. Qiu et al. [
10] combined DTW with the Spearman correlation coefficient algorithm to achieve target positioning and reached a positioning accuracy of approximately 1 m. Another widely used geomagnetic-based localization method is the particle filter. It can be used in nonlinear and non-Gaussian distribution states and has strong generalizability. Xie et al. [
11] presented a geomagnetic positioning method with an improved particle filter and achieved an average positioning accuracy of 1~2.8 m. Shu et al. [
12] developed a bidirectional particle filter to fuse indoor geomagnetic and Wi-Fi signals. It can reach a positioning error of 3.5 m in indoor environments and effectively improve positioning accuracy.
Inertial sensor-based dead recognition can achieve accurate positioning in a short time. However, cumulative errors may occur over time. Pedestrian dead reckoning (PDR) is a relative positioning algorithm that is often combined with other algorithms in positioning. The PDR method includes step detection, step length estimation, heading angle estimation, and dead reckoning. Khedr et al. [
13] proposed a step correction method that can increase PDR reliability in the long term. Gusenbauer et al. [
14] proposed a localization method that combines PDR based on a linear step model with map matching, and its positioning performance can reach 3.6 m. Wang et al. [
15] proposed a positioning method that adopts a floor plan to assist in identifying headings. It can achieve a positioning accuracy of 2.5 m.
Overall, DTW is a commonly used geomagnetic localization algorithm. It can achieve signal analysis at different speeds, ensure the acquisition of a global optimal solution, and improve the accuracy of geomagnetic similarity calculations. In addition, DTW handles nonlinear, related time sequences without specific data distributions or model assumptions. However, DTW has high time and space computational costs and is not suitable for real-time applications or large-scale datasets. Insufficient boundary conditions may lead to overfitting. In symmetrical and approximate indoor environments, due to the small difference in the geomagnetic field, significant positioning errors resulting from the adoption of DTW may occur due to geomagnetic blurring. Indoor geomagnetic fields are usually characterized by nonlinear and non-Gaussian distributions, and particle filtering can effectively address this complex state space, making it a commonly used localization method. It has wide applicability, multimodal processing ability, and strong flexibility. However, high computational complexity, particle degradation, and strong initial state dependence occur in positioning processing. Even when resampling techniques are used, some particles with small weights are generated, which can affect the localization performance. Using only geomagnetic positioning may result in positional ambiguity, which can lead to lower positioning accuracy. Therefore, a single indoor positioning technology cannot achieve high precision.
To address these issues, a positioning method, PSO-5DHLSTM-IPDR, is proposed. In this method, the particle swarm optimization algorithm is used to optimize the parameters in the 5DHLSTM model, and the stability and accuracy of the 5DHLSTM model can be improved. For PDR positioning, an 8DBiLSTM is proposed for heading estimation, in which the model uses eight-dimensional feature data for training and prediction to improve the heading accuracy. Because PDR can obtain reliable location information in a short time, while geomagnetic positioning can maintain relatively stable accuracy over a long period of time, combining geomagnetic positioning and PDR creates a complementary advantage, thus providing more accurate and reliable positioning for smartphones. The main contributions of this paper are as follows:
PSO-5DHLSTM neural network model: We propose a PSO-5DHLSTM neural network model for geomagnetic localization. First, the structure of the 5DHLSTM network is constructed, and the particle swarm is iteratively optimized according to the value of the fitness function. Afterward, the optimal parameters are used as the parameters of the 5DHLSTM network. Finally, the PSO-5DHLSTM neural network model can achieve target location prediction on the basis of geomagnetic sequences. The experimental results show that the geomagnetic positioning accuracy is improved and that the influence of different devices on the positioning accuracy is reduced.
Heading angle estimation based on 8DBiLSTM: To extract more accurate features, we constructed an eight-dimensional dataset. A hierarchical BiLSTM model is designed in this paper. Experiments show that the proposed 8DBiLSTM neural network can achieve more accurate heading estimation.
A PSO-5DHLSTM-IPDR fusion localization method: A PSO-5DHLSTM-IPDR fused localization system is proposed. An extended Kalman filter (EKF) is adopted to achieve fusion localization. The magnetic estimation is used as the measurement vector, and the dead reckoning estimation is used as the state vector. Two scenarios were subjected to experimental investigation, the results of which indicate that the proposed localization system is more accurate than the comparison algorithms are.
The rest of the paper is constructed as follows: Related works are introduced in
Section 2. In
Section 3, the materials and methodology are presented.
Section 4 describes the experimental results. Finally, the paper is concluded in
Section 5.
2. Related Works
A series of geomagnetic positioning studies have been carried out. Han et al. [
16] constructed a fingerprint library with magnetic sequences and employed a recurrent neural network (RNN) to achieve indoor localization via geomagnetism. Bhattarai et al. [
17] proposed a deep recursive neural network (DRNN) for geomagnetic localization, which can extract features of variable-length input sequences. Lee et al. [
18] proposed accurate magnetic indoor localization (AMID) via deep learning, which effectively identifies magnetic sequence features. Ashraf et al. [
19] proposed the use of a convolutional neural network (CNN) for indoor localization. Zhang et al. [
20] presented indoor geomagnetic localization based on a long short-term memory (LSTM) network model. Yang et al. [
21] presented a localization method that integrates 5G wireless signals and geomagnetic sequences. An error backpropagation neural network (BPNN) model was adopted to achieve more reliable localization performances. Shu et al. [
22] presented a multiscale recurrent neural network (DM-RNN) to achieve indoor localization. Ding et al. [
23] designed a CNN-LSTM neural network model for indoor localization. This model can automatically learn and match magnetic sequences with fingerprint databases. He et al. [
24] proposed the ST-Loc geomagnetic localization system. Wang et al. [
25] proposed a novel deep learning and data-feature augmentation-based magnetic localization framework (DarLoc). Ni et al. [
26] proposed a geomagnetic indoor localization-based dilated convolution neural network (DCGIL). The accuracy of the DCGIL method was improved by using an expanded convolutional neural network for fingerprint segmentation classification.
Some researchers have used machine learning or deep learning methods to gain heading estimation in dead recognition. Liu et al. [
27] proposed an LSTM neural network model to estimate the heading angle. Wang et al. [
28] proposed a new type of heading estimation method based on spatial Transformer networks (STNs) and LSTM. Zhang et al. [
29] presented a novel online extreme learning machine (OS-ELM) method. Huang et al. [
30] proposed an LSTM-based heading error compensation model to effectively mitigate the heading error caused by gyroscope drift. Im et al. [
31] utilized a multiple-layer neural network model to regress pedestrian headings.
Single-source positioning systems cannot balance various performance requirements, and multisource fusion localization has become a popular research topic. Ma et al. [
32] proposed a basic positioning system that adopted a hidden Markov model (HMM) that combines geomagnetic positioning with PDR. Kuang et al. [
33] proposed a localization method that fuses inertial sensors and geomagnetic sequences. Hang et al. [
34] adopted a conditional random field (CRF) model to fuse the PDR and geomagnetic information and achieve trajectory prediction via the Viterbi algorithm. The method improves the convergence time in the localization process and the positioning accuracy. Deng et al. [
35] presented a fusion localization algorithm based on the EKF, which combines Wi-Fi and PDR localization. The experiments show that the algorithm improves the localization performance without increasing algorithm complexity. Karamat et al. [
36] proposed a positioning method that combines computer vision and unmanned vehicle-guided inertial sensors. Sun et al. [
37] proposed a fusion localization algorithm that combines Wi-Fi and PDR. Schatzberg et al. [
38] proposed a fusion positioning algorithm that combines Wi-Fi with dead reckoning, which effectively suppresses the cumulative errors caused by inertial navigation and improves positioning performance. Wang et al. [
39] presented an improved EKF algorithm using sigma points, which can significantly increase the localization accuracy.
Motivation by deep learning, a PSO-5DHLSTM-IPDR fusion localization method that utilizes deep learning is proposed. A PSO-5DHLSTM network model is constructed for geomagnetic localization. The particle swarm algorithm is used to optimize the 5DHLSTM model and select suitable parameters to construct the 5DHLSTM model to improve the performance of the 5DHLSTM model and improve the geomagnetic positioning accuracy. For PDR localization, 8DBiLSTM is proposed for heading estimation. This improves the accuracy of heading estimation. Finally, geomagnetic and PDR fusion uses the EKF for localization to improve the positioning accuracy.
3. Materials and Methodology
3.1. Overview
The general structure of the proposed PSO-5DHLSTM-IPDR localization method is shown in
Figure 1. In this proposed framework, there are four models: data preprocessing, the PSO-5DHLSTM network, dead reckoning estimation, and fusion localization.
Data preprocessing model: Due to the interference of noise during magnetic sequences and IMU data collection processing, data preprocessing reduces the interference of noise with the data.
PSO-5DHLSTM model: The particle swarm parameters are first initialized, and the particles are randomly generated. Moreover, we construct the 5DHLSTM network model. Let the particle swarm initialize values as the neural network’s initial parameters; the fitness function value of each particle can be achieved through iterative optimization. Finally, the determined optimal parameters are fed into the trained 5DHLSTM model, and the location prediction based on magnetic sequences can be completed.
Dead reckoning estimation: Dead reckoning based on an inertial measurement unit includes step length estimation, heading angle estimation, and location updates. For dead reckoning estimation, an 8DBiLSTM network model is proposed to predict the heading angle.
Fusion localization model: In this model, the dead reckoning estimation is used as the state variable, and the PSO-5DHLSTM estimation is used as the measurement variable. Finally, fusion localization is achieved through an extended Kalman filter.
The flow of the proposed PSO-5DHLSTM-IPDR fusion positioning method is depicted in Algorithm 1.
Algorithm 1: A PSO-5DHLSTM-IPDR fusion localization method |
Input: Geomagnetic and inertial measurement unit data. |
Output: Target location prediction. 1: Data collection from cell phones. 2: Geomagnetic data preprocessing in Section 3.2. 3: //Geomagnetic localization estimation process. 4: Setting the Particle Swarm Parameters in Section 3.3. 5: Constructing the 5DHLSTM model in Section 3.3. 6: Calculating per-particle fitness values in Section 3.3. 7: Optimization of the model parameters in Section 3.3. 8: Geomagnetic localization using PSO-5DHLSTM models in Section 3.3. 9: // Dead reckoning estimation process. 10: Step length estimation in Section 3.4. 11:// Heading angle estimation process. 12: Heading angle data preprocessing in Section 3.4. 13: Constructing an 8DBiLSTM heading estimation model in Section 3.4. 14: Heading angle estimation using the 8DBiLSTM model in Section 3.4. 15: Dead reckoning estimation. 16: EKF algorithm parameter initialization. 17: for each step do. 18: Initializing the equation of state and observation equations by Equation (25). 19: The forecast covariance is obtained by Equation (33) 20: Obtaining the Kalman gain by Equation (34). 21: Updating the state equation by Equation (35). 22: Updating the covariance equation through Equation (36). 23: Saving the value of each status update. 24: end for 25: Getting the predicted location. |
3.2. Data Preprocessing
Geomagnetic fields are widespread in nature. Moreover, in indoor environments, geomagnetic anomalies occur due to reinforced concrete, electrical wiring, iron furniture, electronic equipment, etc., in buildings. Anomalies generated by structural disturbances in indoor buildings can constitute special geomagnetic fingerprint features that make the location recognizable.
Geomagnetic positioning reliability depends on a stable indoor magnetic field. To verify the stability of the indoor magnetic field, experiments were carried out in a 32 m corridor that has several fire hydrants and other ferrous materials.
Figure 2 shows the triaxial geomagnetic components at different times. The results demonstrate that the amplitudes of the geomagnetic sequences at different times are basically consistent. Therefore, the geomagnetic field has good stability.
Owing to inconsistencies in the carrier and navigation coordinate systems, different acquisition attitudes can have an impact on the acquired magnetic field.
Figure 3 shows the triaxial geomagnetic components acquired with different mobile phone postures in the 32 m corridor. The cell phone in
Figure 3a is placed horizontally facing north (Pose 1). In
Figure 3b, the cell phone is placed vertically with the screen facing north (Pose 2).
Figure 3 shows that the variation in the mobile phone orientation affects the geomagnetic distribution. Large deviations exist in the geomagnetic sequences acquired at different attitudes. Therefore, the geomagnetic modulus is calculated as
where
,
, and
denote the triaxial magnetic values, and
is the geomagnetic magnitude.
Figure 4 shows the geomagnetic magnitude calculated with Equation (1) for Poses 1 and 2. The geomagnetic sequences of the two different attitudes have similar magnitudes. Therefore, the geomagnetic magnitude can be used as a geomagnetic eigen to eliminate the effects caused by different postures.
Geomagnetic data are disturbed by noise during the acquisition process. The empirical mode decomposition (EMD) [
40,
41] method is adopted to eliminate noise.
Specifically, the upper and lower envelopes of the original sequence are calculated via cubic spline interpolation after all local extrema from each magnetic sequence are obtained. The first new sequence
is obtained by subtracting the average
of the upper and lower envelopes from the original sequence
. The formula is depicted as follows:
The standard deviation (SD) is used to determine if the sequence
is an intrinsic mode function (IMF). If not, it will continue as a new input sequence until
is an intrinsic mode function.
where
is an IMF, such that
,
is the first IMF. We can separate
from the sequence
, as shown in Equation (5). Because residue
still contains information on the longer period component, it is viewed as new data and selected in the same way as above. The result is shown in Equation (6).
The decomposition is completed until the last remaining residue
rn is a monotonic function, a trend, or a constant function with an extreme value number less than 2. Finally, a residual component is obtained with a set of IMF data. From Equations (5) and (6), the following equations can be derived.
where N is the number of IMFs,
is the
i-th IMF, and
is the nonzero-mean residual sequence.
For a uniform scale and range of magnitude sequences, Z score normalization is used to process the magnetic data as follows:
where
is the average of the geomagnetic sequence,
is the standard deviation of the geomagnetic sequence, and
represents normalized geomagnetism.
To improve the recognizability of geomagnetism, we utilize multi-dimensional features for geomagnetic positioning. Three-axis geomagnetic data can be collected by a smartphone, and in addition, richer magnetic feature information can be synthesized using three-axis magnetic fields such as magnetic field strength and horizontal components. They are relatively stable and directionally independent of the smartphone, thus effectively eliminating device heterogeneity. The gradient and horizontal magnetic strengths are as follows:
where
,
,
are the gradients of the geomagnetic field along the x-, y-, and z-axes, and
,
,
are the unit vectors on each of the three axes.
We construct six-dimensional geomagnetic data for geomagnetic localization.
where
is gradient, and
are six-dimensional geomagnetic data.
Finally, a uniformly sized sliding window is used to segment the geomagnetic sequence into several consecutive sub-sequences. The proposed localization method predicts the position of the target by matching the corresponding position of each frame in the sub-sequence.
3.3. PSO-5DHLSTM Model
In existing deep learning research, network structure parameters such as the initial learning rate, number of hidden layer units, and regularization factor play key roles in localization performance. Empirical values or multiple trial values are adopted to initialize the neural network parameters. However, it is difficult to achieve optimal performance for different scenarios. To address this issue, we propose a novel particle optimization hybrid neural network model, as shown in
Figure 5. This algorithm first calculates the fitness function through multiple iterations of particle swarm optimization training to achieve the optimal neural network parameters.
In the proposed particle optimization hybrid neural network model, each particle has two metrics: velocity and position. The velocity determines the direction and displacement of the particle’s next motion. The position describes the current position of the particle. The
i-th particle in 3-dimensional space can be expressed as follows:
where
and
denote the position and velocity of the
i-th particle, respectively.
PSO calculates the particle fitness value and compares it with the particle’s historical optimal fitness value
and the global optimal fitness value
expressed in Equation (13).
During the iterative process, the velocity and position of the particles are continuously updated to achieve the global optimum. The steps are as follows:
- A.
Particle population initialization
The three dimensions of this particle can be set to these three parameters , where is the regular rate of the 5DHLSTM neural network, H is the number of neurons in the hidden layer, and is the neural network learning rate.
The parameters to be initialized in this algorithm include the maximum number of iterations = 10, the inertia weight = 0.5, and the learning factors = 2 and = 2.
- B.
Hybrid neural network structure construction.
The long short-term memory (LSTM) neural network is an extension of the RNN and can store and transfer information. The LSTM neural network module is composed of an input gate, an output gate, and a forget gate. Input gates pass information from the input layer to the implicit layer. Forget gates control how previously stored information is forgotten so that important information can be selectively retained and unimportant information discarded. The output gate is responsible for passing the information. Geomagnetism is a kind of time series data; LSTM can handle this kind of geomagnetic sequence data well and can effectively capture the long-term dependency and time series features in geomagnetic data to more accurately analyze and utilize the geomagnetic data for localization. The expression of LSTM is as follows:
where
,
, and
are the input, forget, and output gates, respectively.
is a memory cell from a previous moment, and
is a candidate for memory updating.
is the hidden state.
is the input feature, and
and
are sigmoid and hyperbolic tangent functions, respectively.
,
,
, and
are the weights.
,
,
, and
are the biases.
The GRU is an improved LSTM network and has a simpler neuron structure, fast training speed, and high efficiency. It is more suitable for dynamic process modeling. The GRU model includes only two gates, the update gate and the reset gate, as shown in Equation (15):
where
and
are the update gate and reset gate, respectively.
is the state from the previous time step.
is a candidate state for the hidden layer.
and
are the weights of two different gates, and
is the weight of the cell states.
and
are the biases of two different gates, and
is the bias of the cell state.
We construct the 5DHLSTM model with eight layers. The first layer is the input layer used for acquiring geomagnetic data. The second layer is the flatten layer, which is used for transforming multidimensional data into one-dimensional data. The third and fifth layers used for geomagnetic feature extraction are the LSTM layer and the GRU layer, respectively. The fourth and sixth layers are exit layers with an exit rate of 0.2 to avoid overfitting. The fully connected layer and regression layer ensure that the geomagnetic features are not lost to achieve precise positioning.
- C.
Particle fitness function value calculation
The initial particles of each population are randomly generated for the 5DHLSTM neural network. To achieve the optimal parameters for the proposed hybrid neural network, the fitness function
f of each particle needs to be calculated as follows:
where
represent the predicted location of the target, and
represent the true location of the target.
- D.
Neural network parameter optimization
According to Equations (17) and (18), the positions and velocities of the particles are updated as follows:
where
,
, and
have been described in the particle population initialization step;
and
are random numbers;
is the particle velocity in the
n-th iteration;
is the particle position in the
n-th iteration;
is the individual optimal position; and
is the global optimal position.
After the update of the particle position and velocity is complete, the particle fitness function, particle global optimum, and per-particle optimum need to be recalculated. In this algorithm, we also set an adaptive function threshold to ensure positioning accuracy. When it is less than the threshold, the algorithm stops updating the particles and uses the current optimal parameters as the neural network parameters; otherwise, it returns to training the neural network.
- E.
Positioning prediction
The optimal parameters obtained via the previous step are input into the proposed neural network to forecast the target location.
To verify the localization performance of the designed PSO-5DHLSTM, experiments were conducted using different mobile phones in an underground car park (45.4 × 30.7 × 3.5 m
3).
Table 1 shows the root mean square errors between 5DHLSTM and PSO-5DHLSTM. The positioning error of PSO-5DHLSTM is smaller than that of 5DHLSTM. This is because the particle swarm is used to optimize the parameters of the 5DHLSTM to select the optimal combination of parameters to construct the 5DHLSTM model, which can increase the performance of the 5DHLSTM neural network and thus improve geomagnetic positioning accuracy.
Figure 6 shows the localization errors of LSTM, Maloc, PDR, DTW, and PSO-5DHLSTM. The experimental results reveal that the PSO-5DHLSTM method has the smallest mean localization error, and the outliers are significantly reduced. This is because the proposed algorithm uses particle swarm optimization to obtain the optimal network parameters on the basis of the current data, which can be adapted to different positioning scenarios.
3.4. 8DBiLSTM Heading Angle Estimation Model
PDR position estimation consists of step detection, step length estimation, and heading estimation. Accurate heading estimation is crucial for pedestrian dead recognition. In the deep learning network, BiLSTM processes the inputs through two independent LSTM layers in chronological and reverse chronological order. It can capture the comprehensive features in the forward and reverse directions. During pedestrian’s continuous walking, the previous straight walking state and the subsequent turning movement will have an impact on the heading judgment at the current moment. BiLSTM can effectively integrate these features to provide a richer basis for heading estimation at each time step. It can learn the dependencies between different time points to better handle the continuity and correlation of heading changes. The hidden state
and the cell state
at each time step
t are computed as follows:
where
,
, and
are the input gate, forget gate, and output gate, respectively.
represents the candidate state.
and
are sigmoid and hyperbolic tangent functions, respectively.
,
,
, and
are the weights.
,
,
, and
are the biases.
For heading estimation, azimuth data and geomagnetic data were collected with a smartphone.
Figure 7 shows three-axis azimuthal data and three-axis geomagnetic data in a gyratory corridor. The figure shows that when the heading changes, the magnitude of the geomagnetic and azimuthal angles significantly changes. Therefore, these data are related to the target heading.
In this paper, we construct an eight-dimensional dataset for heading estimation, as shown in Equation (20):
where
,
,
,
,
, and
are the
x,
y, and
z components of the geomagnetic and azimuthal angles, respectively. Then,
and
are the geomagnetic and azimuthal magnitudes, respectively, which can be calculated via Equations (21) and (22).
To reduce the impact of the heterogeneity of different mobile phone devices, the eight-dimensional dataset needs to be scaled to [0, 1], as defined below:
where
and
are the minimum and maximum values, respectively, of the dataset, and
is the dataset after normalization.
After eight-dimensional feature dataset construction, we propose a hierarchical 8DBiLSTM model to mine the head features. The hierarchical 8DBiLSTM model has eight layers. The first layer is the input layer used for acquiring data. The second, fourth, and sixth layers are exit layers with an exit rate of 0.2 to avoid overfitting. The third and fifth layers are the BiLSTM layers for feature extraction. The seventh layer is the flatten layer used for transforming the multidimensional data into one-dimensional data. The dense layer is subsequently used to output the predicted values. The proposed heading estimation model can be described as follows:
where
is the proposed network model, and
is the result after data segmentation.
is heading prediction.
To validate the heading estimation performance, we compare the proposed method with hierarchical LSTM [
27] and the quaternion method [
42] using Xiaomi 10 (Beijing, China) and Hi Nova 9 (Guangdong, China)terminals in two different scenes (the two different scenes are described in
Section 4.1).
Figure 8 displays the cumulative distribution function (CDF) of the heading error with different terminals. The results indicate that the proposed method can achieve more accurate heading estimations. This is because the BiLSTM neural network model can mine more effective features from both the forward and backward directions, and this results in a more accurate heading performance.
Figure 9 shows the CDF of the heading error among the proposed method, hierarchical LSTM, and quaternion methods in Scene 2. The experimental results demonstrate that our proposed heading estimation model achieves good accuracy in Scene 2. This is because the proposed algorithm can extract more accurate features and achieve better localization performance in more complex environments.
Table 2 and
Table 3 present the mean errors and RMSEs among the different heading algorithms in the two scenarios. The proposed heading algorithm can achieve a mean error of approximately 10 °C and an RMSE of approximately 40 °C. The experimental results indicate that the proposed heading algorithm has stronger robustness in different scenes and different terminals.
3.5. EKF-Based Fusion Positioning
In this section, fusion positioning is achieved via an extended Kalman filter (EKF). The state vector
and the measurement vector
are depicted as follows:
where
indicates the location of the PDR estimation.
denotes the heading angle.
implies the step length.
denotes the location of geomagnetic positioning.
The state and observation equations are shown below:
where
indicates the previous moment of the state vector.
and
are the state noise and measurement noise, respectively, which satisfy the normal distribution.
and
are nonlinear transition functions.
Taylor expansions of the nonlinear functions
and
around the prior estimation function
are performed separately, retaining only the primary terms and ignoring the higher-order terms.
The transformation matrix is obtained by taking the partial derivatives of the transformation function. The state transition matrix
and measurement matrix
are expressed in Equation (29).
The measurement matrix
is used to determine the state transfer matrix
.
The state is predicted, and the state at moment
k is projected on the basis of the state at moment
k-1, as shown in Equation (32):
The error covariance matrix
and Kalman gain
are as follows:
where
is the noise covariance matrix of the observation vector.
The position is obtained on the basis of the Kalman gain, state values, and observations, as shown in Equation (35). Finally,
is updated via the unit matrix
I to obtain the covariance matrix
to be used at the next time.
where
is the state vector at moment
k, and
is one-step state vector prediction.