Research on Accurate Location Algorithm of Optimized Multi-source Data Fusion Based on Improved GRU Network

The uncertainty of positioning trajectory and the existence of abnormal trajectory points are major challenges in the field of navigation and positioning. The method that only relies on global positioning system (GPS) has a large error, and the traditional location algorithms still have shortcomings in location efficiency and accuracy. Due to the successful exploration of deep learning in the field of navigation and positioning, an accurate positioning algorithm based on improved gated recurrent unit (GRU) and multi-source data fusion was proposed in this paper. Firstly, interpolation was used to fuse GPS data and inertial measurement unit (IMU) data to overcome the defect of single data. Then, an improved gated recurrent unit was introduced to process the data fusion. On this basis, the attention mechanism (AM) was added to reduce the loss of historical information and strengthen the influence of important information, so as to achieve accurate positioning. Compared with other advanced algorithms with regard to L2 norm and time of training iteration, the training time of this algorithm is reduced by more than 27%, and the highest optimization rate is 12.08%. Therefore, this algorithm can obtain higher positioning accuracy in a shorter time.


Introduction
The engineering application research and practice of navigation and positioning system are widely used in various living fields such as water conservancy, bridge and tunnel, water transportation, municipal administration and so on [1]. GPS positioning equipment needs to receive satellite signals in real time to get the moving track of moving objects. If there is a serious sheltered area in the positioning process, the noise, low-frequency GPS data and other factors will directly lead to the receiving equipment unable to receive satellite signals and data drift [2].
In order to reduce these errors, earlier studies mainly improved the accuracy by simply combining IMU and GPS. For example, Wang Ailin and others combined IMU, GPS and DSP processors to improve the accuracy of navigation [3]. In recent years, the research of integrated navigation has gradually matured, and the integration of various technologies has further improved the positioning accuracy. For example, Li Qingli and others proposed an integrated navigation positioning algorithm combined with Kalman filter, which effectively improved the positioning accuracy of the integrated navigation system [4]. Although the combination of IMU, GPS and other technologies has brought dawn to pedestrian navigation, its accuracy is still far from enough for low and medium precision inertial navigation. In order to improve this situation, some studies used deep learning to modify the positioning results of integrated navigation. For example, Deng Tianmin and others designed an IMU and GPS integrated navigation based on recurrent neural network, which greatly improved the positioning accuracy [5].
As a kind of deep learning algorithm, GRU has the advantages of few parameters and high efficiency, it covers a wide range of application fields and has developed well in some fields. Although some articles have studied the application of GRU in the field of positioning, there are few studies on the improvement of pedestrian navigation by GRU. Therefore, this paper used the IMU sensors in Android smartphone, collected and exported data through sensor stream IMU GPS, and finally used GRU algorithm combined with attention mechanism for real-time data correction to improve positioning accuracy. The main contributions of this paper are as follows: 1. Based on the research of traditional positioning data, this paper obtains pedestrian motion data by multi-source sensors in inertial measurement unit (IMU) on smart phone.
2. In order to deal with the problem of the inconsistency of data frequency collected by the lowfrequency GPS sensor and the high-frequency IMU sensor, the interpolation algorithm is used to fuse GPS data and IMU data.
3. Based on the GRU algorithm, the attention mechanism (AM) is introduced to give different weights to the implicit state of GRU through mapping weighting and learning parameter matrix. The experimental results show that the proposed algorithm can effectively improve the positioning accuracy and get the path trajectory closer to the real route.

Gated recurrent unit
The GRU network, as one of the variants of LSTM, adds gate functions to the network to deal with the problem of gradient disappearance and gradient explosion in RNN [6], such as adding gate structures and memory units [7] [8]. Compared with LSTM, its structure is simpler and the amount of calculation is much smaller. Therefore, GRU can be regarded as the simplification and improvement of LSTM, which is comparable to LSTM in performance and has been proved to be effective [9] [10].
The improvement of GRU is mainly reflected in two aspects: (1) different position states in the network structure have different effects on the current hidden layer nodes: the farther the distance, the smaller the weight; (2) If the error is generated by one or more information, the hidden layer only updates the information weight of the corresponding sequence.
The function definition of hidden layer state h of gated recurrent unit at time t is shown in formula (1): where Z t is the weight of the update gate, h t-1 is the previous state of the hidden layer, and the current state of the hidden layer h t is generated by the update area of the storage unit. The update door can calculate the information retained in the previous memory. The definition of the update door is shown in formula (2): Among them, σ is the activation function, x t is the input variable, w i z is the parameter of the input variable, and U i z is the parameter of the hidden layer. The update gate determines the weight of information that h t-1 passes to the next state. When Z t ≈ 1, h t-1 is almost completely transferred to h t ; When Z t ≈ 0, the new hidden layer state h t is transferred to the next layer.
h t is a memory unit. A new storage unit can be obtained through the previous hidden state h t-1 and the current new input, that is, the new information and historical information h t can be integrated together, and the fusion of sequences can be determined according to the sequence vector. The definition of memory unit is shown in formula (3) Where tanh is the activation function and r t is the weight of the reset door. Reset gate is a unique gate in GRU, which determines the influence of h t-1 on output h t . If h t-1 is not related to the storage unit, reset door will eliminate the previous hidden layer state. The definition of this function is shown in formula (4): GRU uses a special gate mechanism to control gradient propagation. Back propagation and gradient descent are used to train and update the weight of the gate unit structure to alleviate the problem of gradient disappearance and explosion. At the same time, the computer memory resources occupied is relatively small, and the efficiency is high. When processing a long input sequence, since the output h t of GRU neural network is used as the information representation of the whole input sequence, it means that all the information of the input sequence is compressed into a fixed length vector. With the increasing length of input sequence, the ability of the whole model to process information will be limited and weakened. In order to solve the problem that the data sequence is long, the attention mechanism is introduced in the decoding stage of neural network. Attention mechanism can be regarded as a simple three-layer neural network, including input layer, hidden layer and output layer. The output vector of multi-layer GRU is used as the input of the attention mechanism.

Attention mechanism
The overall framework of the improved GRU model based on attention mechanism proposed in this paper is shown in Figure 1.

Parameter configuration and experimental data set
The experimental environment of this paper is configured as Intel Core i5-8300h 2.30Ghz processor and NVIDIA GTX 1050Ti graphics card. The software environment is Python 3.6 and tensorflow 1.14.0. The experiment is implemented in the application of jupyter notebook interactive computing.
In order to verify the performance of the improved GRU network optimized multi-source data fusion precision positioning algorithm proposed in this paper, the "IMU + GPS stream" professional software is used to collect motion data. The application records the measurement results of the sensor in the format of "CSV", and the functions implemented by Python are used for analysis and data preprocessing.  Table 1 shows sample data for activity records. In this paper, the tag value of motion record is completed using the online Ordnance Survey map service [11]. This service consists of a route creation application that allows users to draw path points on satellite images. Finally, the tag value data of user motion is aligned with multi-source sensor data according to interpolation algorithm. The results before and after interpolation are shown in Figure 2. The corresponding sequence has the same color in "ground truth" and GPS, where, (a) represents the misaligned sequence and (b) represents the aligned sequence.
(a) (b) Figure 2. Sequence of the "Ground truth" and GPS

Evaluating indicator
In this paper, L2 norm evaluation index is used to compare the accuracy differences between models. L2 norm is a function space composed of square integrable function on measure space, which is defined as the square root of the integral of the square of the absolute value of the function. The calculation formula of L2 norm is shown in the following formula.  (5) Where, x is the absolute value of the difference between the model predicted value and the real label value y. The smaller the difference between the model predicted value and the real label value, the closer the model predicted value is to the real value, that is, the higher the accuracy of the model is, the smaller the prediction error is.

Optimized hyperparameter set
In order to obtain the optimal experimental results of the model, this paper makes a comparative experiment on the data sequence length of the input neural network, which is the most important super parameters. The sequence lengths used in the comparative experiment are 200, 400, 800, 1500 and 3500 respectively. For the test of all training processes, one tenth of the length of different sequences is selected as the test set. Figure 3 (a) shows the change of loss value of each sequence length data set during training.
It can be seen from this experiment that the sequence length of the lowest loss is 400. Therefore, a sequence length of 400 is used thereafter.
(a) (b) Figure 3. Comparison of different data sequence and model structure In order to reduce the training time, the structure of the neural network unit in the model is changed. 1, 2, 3, 5 and 10 neural network layers are tried, and different number of state tests on each neural network layer are carried out. The results are shown in Figure 3 (b). Figure 3 (b) shows the network converging at the lowest loss value often has 2 or 3 layers of neural network. Although there is little difference in the loss value between them, it have an impact on the time to complete an iteration. Three-layer neural network makes the iteration time of the model about 1.5 times longer than two-layer neural network, and the convergence value of three-layer network and twolayer network tends to be consistent. Therefore, this paper selects a two-layer network with 128 hidden units as the final model structure. The detailed parameters of the model in this paper are shown in Table  2. It can be seen from table 3 that during the comparative test, the model proposed in this paper has the smallest test error and the highest optimization rate, which effectively improves the positioning accuracy of users in the process of movement.

Conclusion
The existing positioning algorithms have large deviation and low positioning accuracy. The positioning data obtained by single GPS often leads to large errors due to noise and low-frequency GPS data, which affects the accuracy of navigation and positioning. This paper presents an improved GRU positioning method based on multi-source data fusion of GPS and IMU. By introducing inertial navigation data, the problem of low quality of single GPS data itself is made up. The deep learning GRU combined with the attention mechanism is introduced to optimize the location algorithm. Experiments show that the proposed algorithm is better than LSTM, RNN and other algorithms, can effectively shorten the positioning time, and the optimization rate is 12.08%. The network structure of GRU further improves the performance of the model to a certain extent, which can better solve the problem of low accuracy of GPS navigation and positioning.