Improved PDR indoor positioning method based on LSTM and map matched filtering
The heading angle is estimated through the LSTM model and combined with particle filtering technology to match it with the map, the problem of heading angle error accumulation in the indoor PDR algorithm is solved, and the accuracy of indoor pedestrian positioning is improved, especially in the positioning accuracy of impermeable areas.
Patent Information
- Application Number
- CN202411394734.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In indoor environments, inertial navigation and positioning technologies based on inertial sensors, such as PDR algorithm, are difficult to provide high-precision pedestrian positioning due to signal occlusion and error accumulation. The existing technology cannot effectively solve the drift problem of heading angle analysis when GPS signal is limited. .
The heading angle in the PDR algorithm is estimated using a long and short-term memory network (LSTM) model, and the map is matched with particle filtering technology to correct the positioning results, correct the pedestrian trajectory in the inaccessible areas, and improve the positioning accuracy.
It effectively reduces the accumulation of heading angle errors, improves the accuracy of pedestrian positioning, especially the correction ability in impermeable areas, and enhances the accuracy of indoor positioning.
Smart Images

Figure CN119299955A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of indoor positioning technology, and in particular to an improved PDR indoor positioning method based on LSTM and map matching filtering. Background Art
[0002] At present, with the rapid development of information technology, people's demand for location information is growing, so location-based services (LBS) have gradually become one of the mainstream market demands. In outdoor environments, the Global Positioning System (GPS) can already provide relatively accurate positioning services. However, in indoor environments, due to signal obstruction and attenuation, the positioning accuracy of GPS is greatly reduced, or even unusable. At the same time, with the increasing development of micro-electro-mechanical systems (MEMS), inertial navigation and positioning technology based on inertial sensors has received attention, and its main implementation methods are strapdown inertial navigation algorithms and pedestrian dead reckoning (PDR) algorithms.
[0003] The PDR algorithm obtains the number of steps, step length, and heading angle information of pedestrians when walking by analyzing the three-axis acceleration and three-axis angular velocity data collected by the three-axis accelerometer and three-axis gyroscope in the inertial sensor, and then calculates the position of pedestrians. However, the PDR algorithm is easily affected by factors such as raw data noise. As the positioning time increases, the error of the raw data gradually accumulates during the PDR positioning process. In particular, the gyroscope used for heading angle analysis is the part with the most serious cumulative error, which ultimately leads to the accumulation of positioning errors and positioning trajectory drift.
[0004] At present, Cavallo et al. use the integrated information of inertial sensors and global positioning systems (GPS) to reduce the drift in heading angle analysis, but this method cannot be well applied to indoor pedestrian positioning because the GPS signal is limited in indoor environments; J.Leu et al. perform heading angle analysis based on the three-axis rotation angle measured by the built-in gyroscope of the smartphone, and classify the heading angle into east, south, west, and north. This method is only applicable to the scene where pedestrians walk along the corridor and lacks flexibility; Borenstein et al. use the Heuristic Drift Elimination (HDE) algorithm to correct the heading angle error and reduce the drift phenomenon during walking, but this algorithm is only applicable to structured indoor environments, that is, the corridors are straight and the corridors are parallel or intersect at multiple angles of 45°.
[0005] Therefore, someone applied for publication number CN116465412A named "An improved PDR indoor positioning method based on LSTM and attention mechanism";
[0006] The solution adopted by the application is to use the LSTM model to estimate the step size in the PDR algorithm and use the traditional quaternion attitude solution to obtain the heading angle estimate. The present invention estimates the heading angle in the PDR algorithm through the LSTM model and uses the map matching based on particle filtering to correct the positioning result. Summary of the invention
[0007] To solve the above technical problems, the present invention provides an improved PDR indoor positioning method based on LSTM and map matching filtering, which can correct the error of heading angle analysis in the PDR algorithm by introducing a long short-term memory network (LSTM), and correct the pedestrian trajectory in the inaccessible area with the assistance of map information to improve the final positioning accuracy.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The present invention provides an improved PDR indoor positioning method based on LSTM and map matching filtering. The specific steps of the indoor positioning method are as follows:
[0010] S1, collects and preprocesses the raw data required by the PDR algorithm, namely the three-axis acceleration data of pedestrians during walking Three-axis angular velocity data
[0011] S2, combined with the real-time quaternion information [q0, q1, q2, q3] obtained by Xsens MT Manager, according to the derivation principle of the attitude transformation matrix, rotates the carrier coordinate system b in the inertial sensor to the navigation coordinate system n;
[0012] S3, dividing the three-axis acceleration and three-axis angular velocity data of each step according to the step detection, and recording the angle increment of each step of the pedestrian to establish a data set;
[0013] S4, taking the three-axis acceleration and three-axis angular velocity data of each step after preprocessing as input, and the angle increment of each step as output, training the LSTM model, and using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, to obtain the PDR positioning result based on LSTM;
[0014] S5, uses the particle filter-based map matching to correct the LSTM-based PDR positioning result, corrects the pedestrian trajectory in the impassable area, and obtains the final positioning result.
[0015] As a further improvement of the present invention, step S1 includes the following steps:
[0016] S11, set a fixed route as the training route, pedestrians wear inertial sensors on their waists and walk along the training route multiple times, and obtain the three-axis acceleration data of the pedestrians during walking collected by the inertial sensors from Xsens MT Manager Three-axis angular velocity data
[0017] S12, since the normal walking frequency of pedestrians is within 1-5Hz, and the frequency exceeding 5Hz is noise, the three-axis acceleration and three-axis angular velocity data are subjected to Butterworth low-pass filtering to filter out high-frequency noise; and according to Normalize the filtered three-axis acceleration and three-axis angular velocity data, where data is the original data and data new is the normalized data.
[0018] As a further improvement of the present invention, step S2 includes the following steps:
[0019] S21, calculate the attitude conversion matrix at the current moment according to the conversion formula of quaternion and attitude conversion matrix:
[0020]
[0021] S22, according to the attitude conversion matrix, convert the three-axis acceleration data and the three-axis angular velocity data in the carrier coordinate system b to the navigation coordinate system n:
[0022]
[0023] As a further improvement of the present invention, step S4 includes the following steps:
[0024] S41, according to the sampling frequency of the inertial sensor and the frequency of pedestrian steps, the LSTM network input sample size is set to len*dim;
[0025] S42, setting the time step to T, that is, fitting the angle increment of one training step through the data of each T steps;
[0026] S43, select Adam optimizer and set the learning rate to LR;
[0027] S44, select mean square error As the loss function, H i is the angle increment of each step of the pedestrian recorded in step S1, h i is the predicted value;
[0028] S45, when the number of training times reaches the set threshold Max_time times, or the training set loss is lower than the set threshold Min_loss, or the training set loss continues to increase during Up_time training times, stop training;
[0029] S46, using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, and obtaining the angle increment of each step;
[0030] S47, integrate the angle increment to obtain the heading angle of each step, obtain the pedestrian's step length according to the fixed step length model, and solve the PDR positioning result based on LSTM according to the PDR algorithm principle.
[0031] As a further improvement of the present invention, step S5 comprises the following steps:
[0032] S51, drawing a map, establishing a real coordinate system, and evenly dividing the map into a plurality of grids to establish a grid information matrix;
[0033] S52, determining the coordinates of corresponding matrix elements of pedestrian-inaccessible areas such as walls and desktops in the grid information matrix, and marking the corresponding matrix element coordinates;
[0034] S53, using the initial positioning coordinate X in the real coordinate system map,0 (x map,0 ,y map,0 ) is used as the center to perform Gaussian distribution sampling, and the standard deviation of the sampled Gaussian distribution function is set as the positioning error δ to obtain the initialized sampling particles;
[0035] S54, according to the PDR algorithm principle and the LSTM-based PDR positioning result, determine the state update equation of the particle in the real coordinate system
[0036]
[0037] where d k is the k-th step length calculated by the fixed step length model, The k-th step heading angle calculated by the LSTM model;
[0038] S55, determining the previous real coordinate point X of the particle in the real coordinate system before updating. map,k-1 (x map,k-1 ,y map,k-1 ) and the updated actual coordinate point X in the actual coordinate system map,k (x map,k ,y map,k );
[0039] S56, determining the matrix element coordinates corresponding to the line connecting the front realistic coordinate point and the rear realistic coordinate point of the particle in the grid information matrix according to the front realistic coordinate point and the rear realistic coordinate point of the particle and the grid information matrix;
[0040] S57, if the coordinates of the matrix elements corresponding to the line connecting the front real coordinate point and the rear real coordinate point of the particle in the grid information matrix pass through the marked inaccessible area, the weight of the particle is reset to 0;
[0041] S58, when the number of valid particles whose weights are not set to 0 is less than the set threshold, resampling is performed to copy the first M particles with larger weights;
[0042] S59, according to the updated particle coordinates and their weights, obtain the real coordinate point of the center position of the particle in the real coordinate system through weighted summation as the final positioning result.
[0043] The beneficial effects of the present invention include:
[0044] 1) The present invention uses the LSTM model to estimate the heading angle, which effectively reduces the heading angle divergence caused by error accumulation in the traditional heading angle estimation method and improves the pedestrian positioning accuracy to a certain extent;
[0045] 2) The present invention establishes a grid information matrix corresponding to the real map, and corrects the initial positioning coordinates through map matching based on particle filtering, which effectively reduces the situation where the positioning coordinates appear in inaccessible areas and further improves the positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of an improved PDR indoor positioning method based on LSTM and map matching filtering provided in an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of establishing a corresponding grid information matrix according to a real map in an embodiment of the present invention;
[0048] Figure 3 It is a schematic diagram of the area through which the line connecting the actual coordinate point before and after the detection of the particle passes in the grid information matrix in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present invention will be specifically described below in conjunction with the accompanying drawings and embodiments, and the technical solutions adopted by the present invention will be introduced in detail and completely. It should be noted that the described embodiments only represent a part of the present invention, not all embodiments. Therefore, the application, use, etc. of the present invention in other embodiments are not limited by the embodiments described herein.
[0050] This embodiment uses a strapdown inertial navigation device to obtain the three-axis acceleration and three-axis angular velocity data of pedestrians when they are walking, with a sampling frequency of 100Hz. The pedestrian's step length is obtained according to the fixed step length model; the LSTM model is used to obtain the pedestrian's heading angle in combination with the three-axis acceleration and three-axis angular velocity data. According to the principle of the PDR algorithm, the pedestrian's initial positioning coordinates are obtained in combination with the pedestrian's step length and heading angle. Combined with the map information, the initial positioning coordinates are corrected through map matching based on particle filtering to obtain the final positioning coordinates.
[0051] like Figure 1 As shown, this embodiment provides an improved PDR indoor positioning method based on LSTM and map matching filtering, and the method includes the following steps:
[0052] S1, collects and preprocesses the raw data required by the PDR algorithm, namely the three-axis acceleration data of pedestrians during walking Three-axis angular velocity data
[0053] S2, combined with the real-time quaternion information [q0, q1, q2, q3] obtained by Xsens MT Manager, according to the derivation principle of the attitude transformation matrix, rotates the carrier coordinate system b in the inertial sensor to the navigation coordinate system n;
[0054] S3, dividing the three-axis acceleration and three-axis angular velocity data of each step according to the step detection, and recording the angle increment of each step of the pedestrian to establish a data set;
[0055] S4, taking the three-axis acceleration and three-axis angular velocity data of each step after preprocessing as input, and the angle increment of each step as output, training the LSTM model, and using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, to obtain the PDR positioning result based on LSTM;
[0056] S5, uses the particle filter-based map matching to correct the LSTM-based PDR positioning result, corrects the pedestrian trajectory in the impassable area, and obtains the final positioning result.
[0057] As a further improvement of the present invention, step S1 includes the following steps:
[0058] S11, set a fixed route as the training route, pedestrians wear inertial sensors on their waists and walk along the training route multiple times, and obtain the three-axis acceleration data of the pedestrians during walking collected by the inertial sensors from Xsens MT Manager Three-axis angular velocity data
[0059] S12, since the normal walking frequency of pedestrians is within 1-5Hz, and the frequency exceeding 5Hz is noise, the three-axis acceleration and three-axis angular velocity data are subjected to Butterworth low-pass filtering to filter out high-frequency noise; and according to Normalize the filtered three-axis acceleration and three-axis angular velocity data, where data is the original data and data new is the normalized data.
[0060] As a further improvement of the present invention, step S2 includes the following steps:
[0061] S21, calculate the attitude conversion matrix at the current moment according to the conversion formula of quaternion and attitude conversion matrix:
[0062]
[0063] S22, according to the attitude conversion matrix, convert the three-axis acceleration data and the three-axis angular velocity data in the carrier coordinate system b to the navigation coordinate system n:
[0064]
[0065] As a further improvement of the present invention, step S4 includes the following steps:
[0066] S41, according to the sampling frequency of the inertial sensor and the pedestrian step frequency, the LSTM network input sample size is set to 100*6;
[0067] S42, setting the time step to 2, that is, fitting the angle increment of one step of training through the data of every two steps;
[0068] S43, select Adam optimizer and set the learning rate to 0.0001;
[0069] S44, select mean square error As the loss function, H i is the angle increment of each step of the pedestrian recorded in step S1, h i is the predicted value;
[0070] S45, set to stop training when the number of training times reaches 5000, or the training set loss is lower than 0.002, or the training set loss continues to increase in 200 training times;
[0071] S46, using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, and obtaining the angle increment of each step;
[0072] S47, integrate the angle increment to obtain the heading angle of each step, obtain the pedestrian's step length according to the fixed step length model, and solve the PDR positioning result based on LSTM according to the PDR algorithm principle.
[0073] As a further improvement of the present invention, step S5 comprises the following steps:
[0074] S51, such as Figure 2 As shown, the indoor plane map is surveyed and mapped, the grid width is set to l, and the map is divided into several l×l grids, each grid corresponding to an element in the grid information matrix;
[0075] S52, setting the element value corresponding to the passable area in the grid information matrix to 0, and setting the element value corresponding to the inpassable area such as the wall and the table in the grid information matrix to 1;
[0076] S53, using the initial positioning coordinate X in the real coordinate system map,0 (x map,0 ,y map,0 ) is used as the center for Gaussian distribution sampling, and the standard deviation of the sampled Gaussian distribution function is set as the positioning error δ, and N initialized sampling particles are obtained. Its real coordinate system coordinates are The weight is
[0077] S54, according to the PDR algorithm principle and the LSTM-based PDR positioning result, determine the state update equation of the particle in the real coordinate system
[0078]
[0079] where d k is the k-th step length calculated by the fixed step length model, The k-th step heading angle calculated by the LSTM model;
[0080] S55, determining the previous real coordinate point of the i-th particle in the real coordinate system before updating and the updated actual coordinate point in the actual coordinate system
[0081] S56, according to the front and rear real coordinate points of the particle and the grid information matrix, determine the matrix element coordinates corresponding to the line connecting the front and rear real coordinate points of the particle in the grid information matrix. Assume that the front real coordinate point of the particle is Then the rows and columns of the corresponding elements in the grid information matrix are:
[0082]
[0083] Since the matrix element index starts from 1, we use The symbol is rounded up, and the actual coordinate system is obtained from the above formula: The element coordinates of the particle in the grid information matrix are
[0084] S57, such as Figure 3 As shown, the line between the matrix element coordinates before and after the particle is traversed and detected to determine the matrix element coordinates corresponding to all the grids passed by the line. Assume that the actual coordinate point before the particle is The actual coordinate point is The corresponding coordinates of the front matrix elements are The coordinates of the matrix elements are The slope of the line connecting the particles is make but The corresponding element coordinates of (x1, y1) and (x2, y2) in the grid information matrix are If the corresponding element value of (m1,n1) and (m2,n2) in the grid information matrix is 1, it means that the line passes through an inaccessible area, and the weight of the particle is reset to 0;
[0085] S58, when the number of valid particles whose weights are not set to 0 is less than the set threshold, resampling is performed to copy the first M particles with larger weights;
[0086] S59, according to the updated particle coordinates and their weights, obtain the real coordinate point of the center position of the particle in the real coordinate system through weighted summation as the final positioning result.
Claims
1. An improved PDR indoor positioning method based on LSTM and map matching filter, characterized in that: The following steps are involved: S1, collects and preprocesses the raw data required by the PDR algorithm, namely the three-axis acceleration data of pedestrians during walking Three-axis angular velocity data S2, combined with the real-time quaternion information [q0, q1, q2, q3] obtained by Xsens MT Manager, according to the derivation principle of the attitude transformation matrix, rotates the carrier coordinate system b in the inertial sensor to the navigation coordinate system n; S3, dividing the three-axis acceleration and three-axis angular velocity data of each step according to the step detection, and recording the angle increment of each step of the pedestrian to establish a data set; S4, taking the three-axis acceleration and three-axis angular velocity data of each step after preprocessing as input, and the angle increment of each step as output, training the LSTM model, and using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, to obtain the PDR positioning result based on LSTM; S5, uses the particle filter-based map matching to correct the LSTM-based PDR positioning result, corrects the pedestrian trajectory in the impassable area, and obtains the final positioning result.
2. According to claim 1, an improved PDR indoor positioning method based on LSTM and map matching filtering is characterized in that: The step S1 comprises the following steps: S11, set a fixed route as the training route, pedestrians wear inertial sensors on their waists and walk along the training route multiple times, and obtain the three-axis acceleration data of the pedestrians during walking collected by the inertial sensors from Xsens MT Manager Three-axis angular velocity data S12, since the normal walking frequency of pedestrians is within 1-5Hz, and the frequency exceeding 5Hz is noise, the three-axis acceleration and three-axis angular velocity data are subjected to Butterworth low-pass filtering to filter out high-frequency noise; and according to Normalize the filtered three-axis acceleration and three-axis angular velocity data, where data is the original data and data new is the normalized data.
3. The improved PDR indoor positioning method based on LSTM and map matching filtering according to claim 1 is characterized in that: The step S2 comprises the following steps: S21, calculate the attitude conversion matrix at the current moment according to the conversion formula of quaternion and attitude conversion matrix: S22, according to the attitude conversion matrix, convert the three-axis acceleration data and the three-axis angular velocity data in the carrier coordinate system b to the navigation coordinate system n:
4. The improved PDR indoor positioning method based on LSTM and map matching filtering according to claim 1 is characterized in that: The step S4 comprises the following steps: S41, according to the sampling frequency of the inertial sensor and the frequency of pedestrian steps, the LSTM network input sample size is set to len*dim; S42, setting the time step to T, that is, fitting the angle increment of one training step through the data of each T steps; S43, select Adam optimizer and set the learning rate to LR; S44, select mean square error As the loss function, H i is the angle increment of each step of the pedestrian recorded in step S1, h i is the predicted value; S45, when the number of training times reaches the set threshold Max_time times, or the training set loss is lower than the set threshold Min_loss, or the training set loss continues to increase during Up_time training times, stop training; S46, using the trained LSTM model to identify the angle increment of each step when the pedestrian actually walks, and obtaining the angle increment of each step; S47, integrate the angle increment to obtain the heading angle of each step, obtain the pedestrian's step length according to the fixed step length model, and solve the PDR positioning result based on LSTM according to the PDR algorithm principle.
5. The improved PDR indoor positioning method based on LSTM and map matching filtering according to claim 1 is characterized in that: The step S5 comprises the following steps: S51, drawing a map, establishing a real coordinate system, and evenly dividing the map into a plurality of grids to establish a grid information matrix; S52, determining the coordinates of corresponding matrix elements of pedestrian-inaccessible areas such as walls and desktops in the grid information matrix, and marking the corresponding matrix element coordinates; S53, using the initial positioning coordinate X in the real coordinate system map,0 (x map,0 ,y map,0 ) is used as the center to perform Gaussian distribution sampling, and the standard deviation of the sampled Gaussian distribution function is set as the positioning error δ to obtain the initialized sampling particles; S54, according to the PDR algorithm principle and the LSTM-based PDR positioning result, determine the state update equation of the particle in the real coordinate system: where d k is the k-th step length calculated by the fixed step length model, The k-th step heading angle calculated by the LSTM model; S55, determining the previous real coordinate point X of the particle in the real coordinate system before updating. map,k-1 (x map,k-1 ,y map,k-1 ) and the updated actual coordinate point X in the actual coordinate system map,k (x map,k ,y map,k ); S56, determining the matrix element coordinates corresponding to the line connecting the front realistic coordinate point and the rear realistic coordinate point of the particle in the grid information matrix according to the front realistic coordinate point and the rear realistic coordinate point of the particle and the grid information matrix; S57, if the coordinates of the matrix elements corresponding to the line connecting the front real coordinate point and the rear real coordinate point of the particle in the grid information matrix pass through the marked inaccessible area, the weight of the particle is reset to 0; S58, when the number of valid particles whose weights are not set to 0 is less than the set threshold, resampling is performed to copy the first M particles with larger weights; S59, according to the updated particle coordinates and their weights, obtain the real coordinate point of the center position of the particle in the real coordinate system through weighted summation as the final positioning result.
Citation Information
Patent Citations
Indoor positioning method and device
CN109883418A
Unmanned aerial vehicle tracking method based on LSTM-particle filter coupling model
CN111552322A
Indoor personnel positioning method based on particle filtering and map matching
CN113884981A
Improved PDR indoor positioning method based on LSTM and attention mechanism
CN116465412A
Localization method and apparatus, mobile terminal and computer-readable storage medium
WO2019047637A1