UWB / INS adaptive positioning method and system based on deep learning
By combining LSTM with an attention mechanism and a Kalman filter, the positioning accuracy and stability issues of the UWB/INS fusion system in complex environments were solved, achieving high-precision positioning under NLOS conditions and improving the system's adaptability and real-time performance.
Patent Information
- Application Number
- CN202510467728.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-04-15
AI Technical Summary
Existing UWB/INS fusion methods are difficult to effectively cope with the decrease in positioning accuracy caused by non-line-of-sight propagation and the cumulative error of INS in complex environments. Furthermore, deep learning models have insufficient generalization ability in dynamic environments, making it difficult to meet the needs of real-time applications.
An attention-based LSTM model combined with a Kalman filter is used to calculate the cumulative INS drift error using IMU sensor data, perform prior state estimation using a Kalman filter, and predict UWB increments using an attention-based LSTM. An innovative sequence is defined to calculate the loss function and update the model parameters, thereby improving positioning accuracy and robustness.
It significantly improves positioning accuracy and stability in NLOS environments, mitigates accuracy degradation under UWB signal obstruction or multipath conditions, reduces cumulative INS error, and enhances the application effect of multi-sensor fusion positioning.
Smart Images

Figure CN120368979B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of integrated navigation and positioning technology in complex environments, and particularly to a UWB / INS adaptive positioning method and system based on deep learning. Background Technology
[0002] With the development of autonomous vehicles, drone navigation, the Internet of Things (IoT), and intelligent transportation systems, the demand for high-precision positioning in complex environments such as cities is increasing. Ultra-wideband (UWB) technology, due to its high positioning accuracy and good anti-interference capabilities, is widely used in indoor and outdoor positioning scenarios. However, in environments with building obstruction or multipath propagation, UWB's positioning performance is severely affected by non-line-of-sight (NLOS) propagation. In contrast, inertial navigation systems (INS) can provide continuous pose updates, but they suffer from cumulative error drift. Therefore, integrating the complementary advantages of UWB and INS to achieve high-precision positioning has become a key issue in realizing high-precision navigation in complex scenarios. UWB provides high-precision ranging, while INS ensures the continuity and autonomy of the system; combining the two can improve positioning robustness and accuracy.
[0003] Traditional UWB / INS fusion primarily employs methods such as Extended Kalman Filter (EKF) or Particle Filter (PF). While these methods can improve positioning accuracy to some extent, they remain inadequate in handling ranging anomalies and uneven distributions caused by Non-Non-Standing Oscillations (NLOS), and their adaptability to dynamic and changing environments is relatively limited. With the rapid development of machine learning technology, techniques for generating UWB pseudo-observations using deep learning methods are increasingly being applied to the UWB / INS fusion field. For example, Recurrent Neural Networks (RNNs) and Long Short-Term Memory Networks (LSTMs) perform well in time-series data processing and can be used to predict lost or damaged UWB measurements, reducing the impact of NLOS on accuracy. Furthermore, the attention mechanism, which has emerged in recent years, can model long-distance dependencies through dynamic weight allocation and supports parallel processing, demonstrating excellent performance in time-series data analysis. This also provides new research ideas for UWB / INS system positioning in complex scenarios. Despite some progress in related research, the following shortcomings remain: First, many deep learning methods still lack generalization ability in highly dynamic and complex real-world environments, making it difficult to accurately capture rapid changes in motion patterns. Secondly, multi-sensor fusion often involves only simple feature stitching, failing to fully exploit the spatiotemporal correlation between UWB and INS. Thirdly, sequence models such as LSTM suffer from serial processing characteristics, resulting in relatively low inference efficiency and making them unsuitable for real-time applications. In more complex NLOS scenarios and highly dynamic environments, the robustness of existing methods remains insufficient, necessitating further research and exploration. Summary of the Invention
[0004] To address the above problems, this invention proposes a deep learning-based UWB / INS adaptive localization method and system to solve the positioning accuracy and stability issues of UWB / INS fusion systems in NLOS environments. To solve the aforementioned technical problems, this invention provides the following technical solution:
[0005] This invention provides a deep learning-based UWB / INS adaptive localization method, including:
[0006] S1: Under LOS conditions, the attitude, velocity, and position of the INS are calculated using IMU sensor data, and the cumulative drift error of the INS is calculated; UWB measurements are obtained through UWB equipment;
[0007] S2: Use a Kalman filter to estimate the prior state of UWB / INS and determine the fusion mode, and perform fusion based on the error state vector under the fusion mode;
[0008] S3: Construct an attention-based LSTM, input the pose, velocity, position and UWB measurements of the INS into the attention-based LSTM for training, and predict the UWB increment at the current time step;
[0009] S4: Define the difference between the predicted UWB increment and the actual observation as the innovation sequence. Calculate the loss function based on the innovation sequence and update the parameters of the attention-based LSTM to obtain the trained attention-based LSTM.
[0010] S5: Under NLOS conditions, the Kalman filter is updated using a trained attention-based LSTM to improve localization accuracy.
[0011] Further, S1 includes:
[0012] The cumulative error of INS drift is calculated as follows:
[0013] INS attitude error model Represented as:
[0014]
[0015] Where the superscript n represents the navigation coordinate system, ω in and δω in Let δω represent the angular velocity of the n-system relative to the i-system and its error. ib Let θ be the angular velocity error of the b-system relative to the i-system, and θ be the attitude angle error.
[0016] Velocity error model for:
[0017]
[0018] Where, δa n For acceleration error, ω ie and δω ie Let ω represent the angular velocity of the e-frame relative to the i-frame and its error, α represent the acceleration, v and δv represent the velocity and its error, and δg represent the velocity and its error, respectively. p This is the error due to gravitational acceleration.
[0019] The position error model can be expressed as:
[0020]
[0021] in, and These are the differentials of latitude, longitude, and altitude errors, respectively. λ and h represent latitude, longitude, and altitude, respectively. δλ and δh represent the latitude, longitude, and altitude errors, respectively, and V N For northbound velocity, V E V is the eastward velocity. D Let R be the ground velocity, tan be the tangent function, cos be the cosine function, and R be the ground velocity. M and R N These are the partial curvature halves of the meridian and the east-west circle, respectively.
[0022] Further, S2 includes:
[0023] The estimation of UWB / INS states using a Kalman filter is divided into two parts: prediction and update. Specifically:
[0024] Assume the linear state-space model of UWB / INS is as follows:
[0025] The state transition equation is:
[0026] x k =F k-1 x k-1 +w k-1
[0027] Where x k Let x be the state vector at time k. k-1 Let F be the state vector at time k-1. k-1 Let w be the state transition matrix. k-1 The process noise follows a zero-mean Gaussian distribution w k-1 ~N(0,Q) k-1 ), Q k -1 The process noise covariance distribution;
[0028] The measurement equation is:
[0029] z k=H k x k +v k
[0030] Where z k H is the measurement vector. k For the measurement matrix, v k To measure noise, it also needs to satisfy a zero-mean Gaussian distribution v k ~N(0,R k ), R k To measure the covariance distribution of noise;
[0031] The prediction steps of a Kalman filter are as follows:
[0032]
[0033] in Let k be the prior state estimate at time k. For posterior state estimation, P k|k-1 Let P be the predicted error covariance matrix. k-1|k-1 Let be the posterior error covariance matrix. Here is the transition matrix;
[0034] The update step then uses Kalman gain to balance the uncertainties between prediction and measurement.
[0035]
[0036] Among them, K k Here is the gain matrix. For measurement matrix;
[0037] A new prior state estimate is obtained. And error covariance P k|k :
[0038]
[0039] P k|k =(IK k H k )P k|k-1 .
[0040] Further, S2 includes:
[0041] The fusion mode is a loosely coupled mode, which fuses UWB / INS specifically as follows:
[0042] In loosely coupled mode, UWB and INS independently calculate their positions, and then a Kalman filter is used to fuse the data based on the error state vector; the loosely coupled error state vector can be written as:
[0043]
[0044] Where δp k δv k δθ k These represent the position, velocity, and attitude errors of the INS, δb a and δb g These represent the zero-bias errors of the accelerometer and gyroscope, respectively. T For transpose;
[0045] The Kalman filter uses the loosely coupled error state vector and measurement equation to recursively update the state estimate, thereby correcting INS drift and improving positioning accuracy.
[0046] Further, S2 includes:
[0047] The fusion mode is a tightly coupled mode, which fuses UWB / INS specifically as follows:
[0048] In tightly coupled mode, UWB ranging information is directly fed into the Kalman filter along with INS data, and the tightly coupled error state vector is:
[0049]
[0050] Where, δb r Indicates UWB ranging offset;
[0051] Measurement equations in tightly coupled mode: Based on the raw ranging values from several UWB base stations, the state is updated according to the difference between the INS estimate and the actual measurement.
[0052]
[0053] After linearization, we get:
[0054]
[0055] Among them, z i k Let be the measurement residual of the i-th UWB base station. and These are the estimated location from the INS and the location from the base station, respectively. This indicates the corresponding ranging offset error. For measurement noise that follows a Gaussian distribution, |||| represents the magnitude, p k This represents the current position vector calculated by INS. This represents the measurement matrix under tightly coupled mode, and represents the measurement variables. For the error state vector The linear approximation effect;
[0056] The state estimate is updated recursively based on the tightly coupled error state vector and its measurement equation using a Kalman filter.
[0057] Further, S3 includes:
[0058] S31: Construct an attention mechanism by weighting the input using a normalized attention matrix to obtain a weighted output, specifically:
[0059] Let the input sequence be Where R is the set of real numbers, n is the sequence length, and m is the feature dimension;
[0060] First, obtain the Key, Query, and Value matrices through linear transformation:
[0061] K = W k X
[0062] Q = W q X
[0063] V = W v X
[0064] Where K∈R d×n d is the hidden layer dimension; Q∈R d×n , V∈R m×n W k ∈R d×m W q ∈R d×m and W v ∈R m×m All are trainable linear transformations;
[0065] Attention weight matrix E∈R n×n The calculation method is as follows:
[0066]
[0067] Softmax is used to normalize each column to ensure that the sum of attention weights is 1.
[0068] Finally, the output matrix O is:
[0069] O = VE
[0070] S32: An LSTM is constructed by introducing cell state and gating mechanisms internally. The gating mechanisms include a forgetting gate, an input gate, and an output gate, specifically:
[0071] Forgotten Gate:
[0072] f t =σ(W f ·[h t-1 ,xt ]+b f )
[0073] Among them, f t W is the activation value of the forgetting gate, controlling the degree of cellular forgetting at the previous moment. f It is the weight matrix of the forget gate, h t-1 x represents the hidden state from the previous moment. t b represents the input at the current moment. f σ represents the paranoia term of the forgetting gate, and σ represents the sigmoid activation function.
[0074] Input Gate:
[0075] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0076] Among them, i t It is the activation value of the input gate, controlling the degree to which the current input affects the cell state, W. i It is the weight matrix of the input gate, b i It is the bias term of the input gate;
[0077] Cell state:
[0078]
[0079] Among them, W C It is the weight matrix of cell states, b C It is a bias in the cell state. It represents the cell state, and tanh is the hyperbolic tangent function;
[0080] Cell state update C t :
[0081]
[0082] Where ⊙ represents element-wise multiplication;
[0083] Output gate:
[0084] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0085] Among them, o t It is the activation value of the output gate, W. o It is the weight matrix of the output gate, b o It is the bias term of the output gate;
[0086] Hidden status update:
[0087] h t =o t ☉tanh(C t )
[0088] Among them, h t It is currently in a hidden state;
[0089] S33: Learn temporal features from INS using LSTM and predict UWB increments.
[0090] Further, S33 includes:
[0091] In loosely coupled mode, an attention-based LSTM is used to predict the UWB increment, which is the UWB position increment, specifically:
[0092] Attention-based LSTM learning maps the input to the UWB position increment at the current time k within a time window T.
[0093]
[0094] Among them, f NN,LC LSTM representing the attention mechanism; For IMU acceleration, high frequency n1; The IMU angular velocity has the same frequency as the acceleration. The attitude angles calculated by the INS have a frequency of n2. Speed of INS computation; The location of the INS solution. For UWB position increment, the lowest frequency is n3.
[0095] Further, S33 includes:
[0096] In tightly coupled mode, an attention-based LSTM is used to predict the UWB increment, which is the UWB ranging increment. Specifically:
[0097] LSTM learning based on the attention mechanism maps the input to the UWB ranging increment at the current time k within a time window T:
[0098]
[0099] in, This is the original UWB ranging.
[0100] Further, S4 includes:
[0101] In the Kalman filter, the innovation sequence is calculated:
[0102]
[0103] The covariance matrix is:
[0104]
[0105] Among them, s k To innovate the covariance matrix;
[0106] Calculate the Mahalanobis distance statistic:
[0107]
[0108] in, For the transpose of the innovation sequence;
[0109] Calculate the loss function:
[0110] The loss function in both fusion modes can be defined as the sum of squared errors between the predicted and actual UWB increments:
[0111]
[0112] Where L is the loss function, Δy is the predicted value of the UWB increment. k These are the actual observations of the UWB increment.
[0113] This invention also provides a deep learning-based UWB / INS adaptive localization system, comprising:
[0114] Drift cumulative error calculation module: Under LOS conditions, the attitude, velocity, position and UWB measurements of the INS are obtained from IMU sensor data, and the INS drift cumulative error is calculated; UWB measurements are obtained through UWB equipment;
[0115] UWB / INS fusion module: Uses Kalman filter to perform prior state estimation of UWB / INS and determine fusion mode, and performs fusion based on the error state vector under the fusion mode;
[0116] Attention-based LSTM training module: Construct an attention-based LSTM, input pose, velocity, position and UWB measurements into the attention-based LSTM for training, and predict the UWB increment at the current time step;
[0117] The attention-based LSTM update module defines the difference between the predicted UWB increment and the actual observation as the innovation sequence. It calculates the loss function based on the innovation sequence and updates the LSTM parameters based on the attention mechanism to obtain the trained LSTM based on the attention mechanism.
[0118] Kalman filter update module: Under NLOS conditions, a trained attention-based LSTM is used to update the Kalman filter to improve localization accuracy.
[0119] The beneficial effects of the technical solution provided by this invention include at least the following:
[0120] This invention utilizes an attention mechanism to dynamically extract and weight key features from IMU sensor data, thereby generating a predicted UWB increment under NLOS conditions. This predicted UWB increment can be combined with Kalman filtering to significantly improve positioning accuracy and robustness in complex NLOS environments. This invention effectively mitigates the accuracy degradation of UWB signals under occlusion or multipath conditions and reduces the cumulative error of INS, providing strong support for multi-sensor fusion positioning applications in complex environments. Attached Figure Description
[0121] Figure 1 A flowchart illustrating the deep learning-based UWB / INS adaptive localization method provided in this embodiment of the invention;
[0122] Figure 2 This is a diagram showing the results of NLOS detection based on innovative sequences;
[0123] Figure 3 The image shows the Mahalanobis distance detection results.
[0124] Figure 4 This is a map showing the localization trajectories of each model in the loosely coupled mode during the NLOS period;
[0125] Figure 5 This is a map showing the localization trajectories of each model during the NLOS period in tightly coupled mode;
[0126] Figure 6 Loosely coupled mode for trajectory positioning;
[0127] Figure 7 For tightly coupled mode, the trajectory is located;
[0128] Figure 8 Training curves for different parameter configurations of attention-based LSTM. Detailed Implementation
[0129] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0130] Example 1:
[0131] This embodiment will describe the deep learning-based UWB / INS adaptive localization method of the present invention in more detail with reference to the accompanying drawings, such as... Figure 1 As shown, it includes the following steps:
[0132] This invention provides a deep learning-based UWB / INS adaptive localization method, including:
[0133] S1: Under LOS conditions, the attitude, velocity, and position of the INS are calculated using IMU sensor data, and the cumulative drift error of the INS is calculated; UWB measurements are obtained through UWB equipment;
[0134] The cumulative error of INS drift is calculated as follows:
[0135] INS attitude error model Represented as:
[0136]
[0137] Where the superscript n represents the navigation coordinate system, ω in and δω in Let δω represent the angular velocity of the n-system relative to the i-system and its error. ib Let θ be the angular velocity error of the b-system relative to the i-system, and θ be the attitude angle error.
[0138] Velocity error model for:
[0139]
[0140] Where, δa n For acceleration error, ω ie and δω ie Let ω represent the angular velocity of the e-frame relative to the i-frame and its error, α represent the acceleration, v and δv represent the velocity and its error, and δg represent the velocity and its error, respectively. p This is the error due to gravitational acceleration.
[0141] The position error model can be expressed as:
[0142]
[0143] in, and These are the differentials of latitude, longitude, and altitude errors, respectively. λ and h represent latitude, longitude, and altitude, respectively. δλ and δh represent the latitude, longitude, and altitude errors, respectively, and V N For northbound velocity, VE V is the eastward velocity. D Let R be the ground velocity, tan be the tangent function, cos be the cosine function, and R be the ground velocity. M and R N These are the partial curvature halves of the meridian and the east-west circle, respectively.
[0144] It should be noted that the INS is the core system of inertial navigation system, providing information such as attitude, velocity, and position. However, IMU sensor errors can cause navigation accuracy to diverge rapidly over time. By introducing small perturbations into the INS update equations, the error equations for inertial navigation system can be derived.
[0145] S2: Use a Kalman filter to estimate the prior state of UWB / INS and determine the fusion mode, and perform fusion based on the error state vector under the fusion mode;
[0146] The estimation of UWB / INS states using a Kalman filter is divided into two parts: prediction and update. Specifically:
[0147] Assume the linear state-space model of UWB / INS is as follows:
[0148] The state transition equation is:
[0149] x k =F k-1 x k-1 +w k-1
[0150] Where x k Let x be the state vector at time k. k-1 Let F be the state vector at time k-1. k-1 Let w be the state transition matrix. k-1 The process noise follows a zero-mean Gaussian distribution w k-1 ~N(0,Q) k-1 ), Q k -1 The process noise covariance distribution;
[0151] The measurement equation is:
[0152] z k =H k x k +v k
[0153] Where z k H is the measurement vector. k For the measurement matrix, v k To measure noise, it also needs to satisfy a zero-mean Gaussian distribution v k ~N(0,R k ), R kTo measure the covariance distribution of noise;
[0154] The prediction steps of a Kalman filter are as follows:
[0155]
[0156] in Let k be the prior state estimate at time k. For posterior state estimation, P k|k-1 Let P be the predicted error covariance matrix. k-1|k-1 Let be the posterior error covariance matrix. Here is the transition matrix;
[0157] The update step then uses Kalman gain to balance the uncertainties between prediction and measurement.
[0158]
[0159] Among them, K k Here is the gain matrix. For measurement matrix;
[0160] A new prior state estimate is obtained. And error covariance P k|k :
[0161]
[0162] P k|k =(IK k H k )P k|k-1 .
[0163] It's important to note that the Kalman filter (KF) is a recursive least squares estimator based on a state-space model, widely used in signal processing, navigation systems, and control systems. KF reduces uncertainty by estimating the system state and fusing measurement information. Integrating UWB and INS (Instrument Sensing) leverages their complementary strengths to improve positioning accuracy. UWB measurements provide high-precision distance information but are susceptible to obstruction, refraction, and multipath effects; INS provides consistent position estimation but suffers from drift errors that accumulate over time. Fusing this information with a Kalman filter effectively reduces the impact of sensor errors, resulting in more stable and accurate navigation results. Depending on the fusion method, it can be categorized into loosely coupled and tightly coupled modes. In error-state-based Kalman filtering, the state vector represents the INS error, rather than directly using absolute physical quantities. This design often simplifies the filter structure and improves numerical stability. The error state vector typically includes errors in position, velocity, attitude, and sensor bias.
[0164] Furthermore, the fusion mode is a loosely coupled mode, and the fusion of UWB / INS is carried out in a loosely coupled mode, specifically as follows:
[0165] In loosely coupled mode, UWB and INS independently calculate their positions, and then a Kalman filter is used to fuse the data based on the error state vector; the loosely coupled error state vector can be written as:
[0166]
[0167] Where δp k δv k δθ k These represent the position, velocity, and attitude errors of the INS, δb a and δb g These represent the zero-bias errors of the accelerometer and gyroscope, respectively. T For transpose;
[0168] The Kalman filter uses the loosely coupled error state vector and measurement equation to recursively update the state estimate, thereby correcting INS drift and improving positioning accuracy.
[0169] It should be noted that in the loosely coupled mode, UWB and INS calculate their positions independently, and then use a Kalman filter to perform data fusion based on the error state vector. Specifically, INS obtains its pose by integrating acceleration and angular velocity, while UWB obtains its reference position by measuring the position from a known base station. In order to effectively characterize the error of INS during the fusion process and use UWB observations for correction, we introduce an error state vector for description.
[0170] Furthermore, the fusion mode is a tightly coupled mode, through which UWB / INS are fused.
[0171] Specifically:
[0172] In tightly coupled mode, UWB ranging information is directly fed into the Kalman filter along with INS data, and the tightly coupled error state vector is:
[0173]
[0174] Where, δb r This indicates the UWB ranging offset, which is the constant deviation between the measured value and the actual observed value;
[0175] Measurement equations in tightly coupled mode: Based on the raw ranging values from several UWB base stations, the state is updated according to the difference between the INS estimate and the actual measurement.
[0176]
[0177] After linearization, we get:
[0178]
[0179] Among them, z i k Let be the measurement residual of the i-th UWB base station. and These are the estimated location from the INS and the location from the base station, respectively. This indicates the corresponding ranging offset error. For measurement noise that follows a Gaussian distribution, |||| represents the magnitude, p k This represents the current position vector calculated by INS. The measurement matrix in tightly coupled mode is obtained by a first-order Taylor expansion of the measurement equations over the state vectors, and represents the measurement variables. For the error state vector The linear approximation effect;
[0180] The state estimate is updated recursively based on the tightly coupled error state vector and its measurement equation using a Kalman filter.
[0181] S3: Construct an attention-based LSTM, input the pose, velocity, position and UWB measurements of the INS into the attention-based LSTM for training, and predict the UWB increment at the current time step;
[0182] S31: Construct an attention mechanism by weighting the input using a normalized attention matrix to obtain a weighted output, specifically:
[0183] Let the input sequence be Where R is the set of real numbers, n is the sequence length, and m is the feature dimension;
[0184] First, obtain the Key, Query, and Value matrices through linear transformation:
[0185] K = W k X
[0186] Q = W q X
[0187] V = W v X
[0188] Where K∈R d×n d is the hidden layer dimension; Q∈R d×n , V∈R m×n W k ∈R d×m W q ∈R d×m and W v ∈R m×m All are trainable linear transformations;
[0189] Attention weight matrix E∈R n×n The calculation method is as follows:
[0190]
[0191] Softmax is used to normalize each column to ensure that the sum of attention weights is 1.
[0192] Finally, the output matrix O is:
[0193] O = VE;
[0194] It's important to note that the attention mechanism is a core module of the Transformer, enabling parallel signal weighting. Unlike the sequential processing of traditional recurrent neural networks (RNNs), the attention mechanism can process the input sequence in parallel, reducing accumulated errors during gradient propagation and making it more suitable for predicting UWB position increments based on INS information. Furthermore, traditional sequential processing tends to forget information from earlier time steps, while the attention mechanism can dynamically focus on important time steps, improving prediction accuracy.
[0195] S32: An LSTM is constructed by introducing cell state and gating mechanisms internally. The gating mechanisms include a forgetting gate, an input gate, and an output gate, specifically:
[0196] Forgotten Gate:
[0197] f t=σ(W f ·[h t-1 ,x t ]+b f )
[0198] Among them, f t W is the activation value of the forgetting gate, controlling the degree of cellular forgetting at the previous moment. f It is the weight matrix of the forget gate, h t-1 x represents the hidden state from the previous moment. t b represents the input at the current moment. f σ represents the paranoia term of the forgetting gate, and σ represents the sigmoid activation function.
[0199] Input Gate:
[0200] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0201] Among them, i t It is the activation value of the input gate, controlling the degree to which the current input affects the cell state, W. i It is the weight matrix of the input gate, b i It is the bias term of the input gate;
[0202] Cell state:
[0203]
[0204] Among them, W C It is the weight matrix of cell states, b C It is a bias in the cell state. It represents the cell state, and tanh is the hyperbolic tangent function;
[0205] Cell state update C t :
[0206]
[0207] Where ⊙ represents element-wise multiplication;
[0208] Output gate:
[0209] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0210] Among them, o t It is the activation value of the output gate, W. oIt is the weight matrix of the output gate, b o It is the bias term of the output gate;
[0211] Hidden status update:
[0212] h t =o t ☉tanh(C t )
[0213] Among them, h t It is currently in a hidden state;
[0214] S33: Learning temporal features from INS and predicting UWB increments using LSTM:
[0215] In loosely coupled mode, an attention-based LSTM is used to predict the UWB increment, which is the UWB position increment, specifically:
[0216] Attention-based LSTM learning maps the input to the UWB position increment at the current time k within a time window T.
[0217]
[0218] Where fNN,LC represents an attention-based LSTM; For IMU acceleration, high frequency n1; The IMU angular velocity has the same frequency as the acceleration. The attitude angles calculated by the INS have a frequency of n2. Speed of INS computation; The location of the INS solution. For UWB position increments, the minimum frequency is n3;
[0219] In tightly coupled mode, an attention-based LSTM is used to predict the UWB increment, which is the UWB ranging increment. Specifically:
[0220] LSTM learning based on the attention mechanism maps the input to the UWB ranging increment at the current time k within a time window T:
[0221]
[0222] in, For UWB raw ranging;
[0223] S4: Define the difference between the predicted UWB increment and the actual observation as the innovation sequence. Calculate the loss function based on the innovation sequence and update the parameters of the attention-based LSTM to obtain the trained attention-based LSTM.
[0224] In the Kalman filter, the innovation sequence is calculated:
[0225]
[0226] The covariance matrix is:
[0227]
[0228] Among them, s k To innovate the covariance matrix;
[0229] Calculate the Mahalanobis distance statistic:
[0230]
[0231] in, For the transpose of the innovation sequence;
[0232] Calculate the loss function:
[0233] The loss function in both fusion modes can be defined as the sum of squared errors between the predicted and actual UWB increments:
[0234]
[0235] Where L is the loss function, Δy is the predicted value of the UWB increment. k These are the actual observations of the UWB increment;
[0236] S5: Under NLOS conditions, the Kalman filter is updated using a trained attention-based LSTM to improve localization accuracy.
[0237] To further illustrate, such as Figure 2 As shown, to verify the effectiveness of the proposed method, 10,000 sets of IMU and UWB data were first generated in a simulation environment, including various motion modes (straight line, turning, acceleration and deceleration) to enhance the network's generalization ability. The network was trained using this dataset and tested in a localization scenario within an NLOS environment. Various deep learning models were compared, including DNN, RNN, GRU, LSTM, Attention-RNN, Attention-GRU, and the attention-based LSTM (Attention-LSTM) of this invention. The convergence performance of various models in predicting UWB increments was compared in loosely coupled and tightly coupled systems, such as... Figure 2-3As shown, the DNN model has the highest loss and the curve changes relatively little, indicating its difficulty in capturing the temporal dependencies of sequential data. While the RNN loss gradually decreases, it fluctuates significantly in loosely coupled systems, lacking stability. GRU and LSTM significantly outperform DNN and RNN, with smoother curves and lower final losses. Comparatively, LSTM performs slightly better, better learning complex long dependencies. Adding an attention mechanism further improves model accuracy. Attention-RNN shows slight improvement over RNN, but still falls short of GRU and LSTM. Attention-GRU and Attention-LSTM perform best in both systems, converging faster and with lower final losses. Attention-LSTM demonstrates the best performance, validating that combining LSTM's long dependency learning ability with the key feature extraction of the attention mechanism can achieve better results in predicting UWB pseudo-observations.
[0238] like Figure 2 and Figure 3 As shown, NLOS detection based on innovative sequences reveals that the peak value of the difference between the predicted UWB increment and the actual observed value basically corresponds to the true NLOS (red dots), but there are a small number of false positives and false negatives. Mahalanobis distance, after setting a 95% confidence threshold, can also effectively distinguish most NLOS points, with a correct detection rate of 71.86%. Although some false negatives and false negatives still exist, overall, this detection strategy effectively improves the ability to identify NLOS, providing a reference for subsequent removal or replacement of unreliable measurements.
[0239] Table 1 presents the localization error statistics for each model in loosely coupled mode. Figure 4 This demonstrates the trajectories of each method during the NLOS phase. Compared to other models, Attention-LSTM achieves the smallest error in most scenarios, such as only 0.86m in scenario 2 and only 0.22m in scenario 3, significantly lower than other methods. Attention-GRU follows closely behind, also showing relatively outstanding performance. RNN and Attention-RNN exhibit poor stability, while DNN, due to its inability to capture sequence dependencies, shows significant deviations in certain scenarios. Overall, Attention-LSTM is best at suppressing the large error increase brought about by the NLOS phase, and its generated trajectory is closest to the ground truth.
[0240] Table 1. Localization errors of each model in loosely coupled mode (unit: m)
[0241] Scene KF DNN RNN GRU LSTM Att-RNN Att-GRU Att-LSTM 1 1.35 0.79 0.87 0.73 1.14 0.52 0.56 0.45 2 3.73 3.21 2.13 2.07 2.38 2.08 2.93 0.67 3 1.31 0.51 0.26 0.35 0.23 0.92 0.25 0.40 4 1.21 1.09 0.80 0.56 0.83 0.58 0.65 0.41 5 1.48 0.54 0.81 0.54 0.44 0.38 0.41 0.64 6 1.52 0.72 1.11 1.08 1.05 1.38 0.72 0.14
[0242] Table 2 shows the localization errors of each model in the tightly coupled system. Figure 5The corresponding trajectory diagram is shown. Tightly coupled methods can directly update using the original ranging measurements. However, once NLOS occurs, the standard KF method struggles to effectively model abnormal rangings, leading to a significant increase in bias after noise is introduced. Introducing deep learning to generate low-noise pseudo-measurements improves overall accuracy, with Attention-LSTM showing the best performance and the lowest error in most scenarios. For example, the error is only 0.21m in scenario 1 and only 0.13m in scenario 2, with the trajectory almost perfectly matching the ground truth. LSTM and Attention-GRU also perform well, but slightly worse than Attention-LSTM. DNN and RNN methods have relatively high errors and cannot fully utilize historical sequence features. Therefore, the combination of attention mechanisms and LSTM in a tightly coupled architecture can effectively reduce the impact of NLOS.
[0243] Table 2. Positioning error statistics based on tightly coupled mode (unit: m)
[0244] Scene KF DNN RNN GRU LSTM Att-RNN Att-GRU Att-LSTM 1 0.97 0.57 0.63 0.46 0.37 0.32 0.38 0.17 2 0.36 0.66 0.52 0.46 0.30 0.84 0.46 0.33 3 0.23 0.14 0.28 0.25 0.08 0.30 0.24 0.08 4 0.57 0.40 0.22 0.30 0.26 0.59 0.15 0.21 5 0.23 0.39 0.31 0.39 0.28 0.24 0.21 0.17 6 0.36 0.51 0.21 0.39 0.26 0.23 0.40 0.14
[0245] Real-world environment testing:
[0246] Further testing was conducted in a real indoor environment. A UWB device based on the DW1000 chip and a consumer-grade inertial navigation module built into a mobile phone were used. Four UWB base stations were set up, and during testing, the tester moved around indoors holding a UWB tag and a smartphone. Both loosely coupled and tightly coupled modes were experimentally verified. In the loosely coupled system ( Figure 6 When entering NLOS, the standard UWB / INS method shows a significant deviation, with an error reaching 0.52m; while deep learning methods significantly improve localization accuracy. DNN and RNN both achieve an error of 0.23m, GRU is slightly higher at 0.30m, and LSTM is 0.22m; among attention mechanism models, Attention-RNN and Attention-GRU are 0.33m and 0.24m respectively, and Attention-LSTM is also 0.22m, on par with LSTM and maintaining a trajectory highly close to the ground truth, demonstrating the importance of sequence modeling capabilities in loosely coupled NLOS scenarios. In tightly coupled systems ( Figure 7All methods outperformed the standard method, reducing the error to 0.14m, but still falling short of deep learning. DNN and RNN achieved errors of 0.15m and 0.13m respectively, while GRU and LSTM decreased to 0.11m and 0.09m. Attention-RNN and Attention-GRU achieved errors of 0.09m and 0.12m respectively, with Attention-LSTM being the best at only 0.08m, and it still closely followed the real trajectory in NLOS scenarios. Experimental results show that tightly coupled systems generally outperform loosely coupled systems. Deep learning has a significant advantage over standard UWB / INS in both modes, with LSTM and attention-based models performing best. Attention-LSTM is the best overall, with an error of 0.22m in loose coupling and 0.08m in tight coupling, fully demonstrating its comprehensive utilization of temporal information and key features in NLOS scenarios.
[0247] Table 3. Positioning error in actual environment test (unit: m)
[0248]
[0249] Figure 8 The effects of different hidden layer sizes (h), number of layers (l), and learning rates (α) on the convergence and final loss of Attention-LSTM are shown. It is evident that network capacity and learning rate significantly impact model performance. When h = 64, l = 2, and α = 0.005 (red line), the model converges fastest and has the lowest final loss, indicating that larger hidden layer dimensions and deeper network structures help capture more complex features, and an appropriate learning rate can accelerate training. Configurations such as h = 32 and l = 1 are prone to underfitting or instability, leading to slow convergence or large loss fluctuations, indicating that insufficient network capacity cannot adapt to faster learning rates. Overall, appropriate parameter settings can significantly improve model performance in complex scenarios.
[0250] Example 2:
[0251] This invention also provides a deep learning-based UWB / INS adaptive localization system, comprising:
[0252] Drift cumulative error calculation module: Under LOS conditions, the attitude, velocity, position and UWB measurements of the INS are obtained from IMU sensor data, and the INS drift cumulative error is calculated; UWB measurements are obtained through UWB equipment;
[0253] UWB / INS fusion module: Uses Kalman filter to perform prior state estimation of UWB / INS and determine fusion mode, and performs fusion based on the error state vector under the fusion mode;
[0254] Attention-based LSTM training module: Construct an attention-based LSTM, input pose, velocity, position and UWB measurements into the attention-based LSTM for training, and predict the UWB increment at the current time step;
[0255] The attention-based LSTM update module defines the difference between the predicted UWB increment and the actual observation as the innovation sequence. It calculates the loss function based on the innovation sequence and updates the LSTM parameters based on the attention mechanism to obtain the trained LSTM based on the attention mechanism.
[0256] Kalman filter update module: Under NLOS conditions, a trained attention-based LSTM is used to update the Kalman filter to improve localization accuracy.
[0257] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
Claims
1. A deep learning-based UWB / INS adaptive positioning method, characterized in that, Comprise: S1: under the LOS condition, the INS attitude, velocity, position are calculated by the IMU sensor data, and the INS drift cumulative error is calculated; UWB measurement is obtained by UWB equipment; S2: the prior state estimation of UWB / INS is carried out by using Kalman filter, and the fusion mode is determined, and the fusion is carried out according to the error state vector in the fusion mode; S3: the LSTM based on attention mechanism is constructed, the INS attitude, velocity, position and UWB measurement are input into the LSTM based on attention mechanism for training, and the UWB increment at the current time is predicted; S4: the difference between the predicted UWB increment and the actual observation value is defined as the innovation sequence, the loss function is calculated according to the innovation sequence, and the LSTM based on attention mechanism is updated, so that the trained LSTM based on attention mechanism is obtained; S5: under the NLOS condition, the Kalman filter is updated by using the trained LSTM based on attention mechanism, so as to realize the positioning precision.
2. The deep learning-based UWB / INS adaptive positioning method of claim 1, wherein, The S1 comprises: The INS drift cumulative error is calculated, specifically: INS attitude error model is expressed as: where the superscript n denotes the navigation frame, ω in and δω in are the angular velocity and its error of the n-frame with respect to the i-frame, respectively, δω ib is the angular velocity error of the b-frame with respect to the i-frame, and θ is the attitude angle error; Speed error model is: where δa n is the acceleration error, ω ie and δω ie are the angular velocity and its error of e-frame with respect to i-frame, a is the acceleration, v and δv are the velocity and its error, and δg p is the error of gravitational acceleration; The position error model can be expressed as: where, and are the latitude, longitude and height error differentials, respectively, λ, h are the latitude, longitude and height, respectively, δλ, δh are the latitude, longitude and height errors, respectively, V N is the northward velocity, V E is the eastward velocity, V D is the downward velocity, tan is the tangent function, cos is the cosine function, R M and R N are the local radii of curvature of the meridian and prime vertical, respectively.
3. The deep learning-based UWB / INS adaptive positioning method of claim 2, wherein, The S2 comprises: The UWB / INS state is estimated by using Kalman filter, which is divided into prediction and update two parts, specifically: The linear state space model of UWB / INS is assumed as follows: The state transition equation is: x k = F k-1 x k-1 + w k-1 where x k is the state vector at time k, x k-1 is the state vector at time k-1, F k-1 is the state transition matrix, w k-1 is the process noise, satisfying zero-mean Gaussian distribution w k-1 ~ N(0, Q k-1 ), Q k-1 is the process noise covariance distribution; The measurement equation is: z k = H k x k + v k where z k is a measurement vector, H k is a measurement matrix, v k is a measurement noise, also satisfying a zero-mean Gaussian distribution v k ~ N(0, R k ), R k is a covariance distribution of the measurement noise; The prediction step of Kalman filter is: wherein is a prior state estimate at time k, is a posterior state estimate, P k|k-1 is a predicted error covariance matrix, P k-1|k-1 is a posterior error covariance matrix, is a transition matrix; The update step is to balance the uncertainty of prediction and measurement through Kalman gain: where K k is a gain matrix, is a measurement matrix; obtaining a new prior state estimate and error covariance P k|k : P k|k = (I - K k H k )P k|k-1 .
4. The deep learning-based UWB / INS adaptive positioning method of claim 3, wherein, The S2 comprises: The fusion mode is loose coupling mode, and UWB / INS is fused through loose coupling mode, specifically: In the loose coupling mode, UWB and INS calculate the position independently, and then the data fusion is carried out based on the error state vector by using Kalman filter; The loose coupling error state vector can be written as: Where δp k δv k δθ k These represent the position, velocity, and attitude errors of the INS, δb a and δb g These represent the zero-bias errors of the accelerometer and gyroscope, respectively. T For transpose; The Kalman filter uses the loose coupling error state vector and the measurement equation to recursively update the state estimation, so as to correct the drift of INS and improve the positioning precision.
5. The deep learning-based UWB / INS adaptive positioning method of claim 3, wherein, The S2 comprises: The fusion mode is tight coupling mode, and UWB / INS is fused through tight coupling mode, specifically: in the tight coupling mode, the UWB ranging information will directly enter the Kalman filter together with the INS data, and the tight coupling error state vector is: wherein δb r denotes the UWB ranging bias; The measurement equation under the tight coupling mode: based on the original ranging value of a plurality of UWB base stations, the state is updated according to the difference between the INS estimation and the real measurement: After linearization, the following can be obtained: where z i k is the measurement residual of the i-th UWB base station, and are the INS estimated position and the base station position, respectively, denotes the corresponding ranging bias error, is the measurement noise following a Gaussian distribution, ||| denotes the modulus, p k denotes the current position vector calculated by the INS, denotes the measurement matrix in the tight coupling mode, denotes the measurement variable linear approximation influence on the error state vector . The state estimation is recursively updated by using Kalman filter according to the tight coupling error state vector and its measurement equation.
6. The deep learning-based UWB / INS adaptive positioning method of claim 3, wherein, The S3 comprises: S31: the attention mechanism is constructed, the input is weighted by defining the normalized attention matrix, and the weighted output is obtained, specifically: Let the input sequence be where R is a set of real numbers, n is the sequence length, and m is the feature dimension. Firstly, the Key, Query and Value matrices are obtained by linear transformation: K = W k X Q = W q X V = W v X where K ∈ R d×n , d is the dimension of the hidden layer; Q ∈ R d×n , V ∈ R m×n , W k ∈ R d×m , W q ∈ R d×m , and W v ∈ R m×m are trainable linear transformations; The attention weight matrix E ∈ R n×n The calculation is: Wherein, Softmax is used for normalizing each column, so that the sum of attention weights is 1; Finally, the output matrix O is: O=VE S32: the LSTM is constructed by introducing cell state and gating mechanism in the interior, the gating mechanism includes forgetting gate, input gate and output gate, specifically: Forgetting gate: f t = σ(W f · [h t-1 , x t ] + b f ) wherein f t is the activation value of the forget gate, controlling the degree of forgetting of the cell at the previous time, W f is the weight matrix of the forget gate, h t-1 represents the hidden state at the previous time, x t represents the input at the current time, b f represents the bias term of the forget gate, and σ represents the Sigmoid activation function; Input gate: i t = σ(W i · [h t-1 , x t ] + b i ) wherein, i t is the activation value of the input gate, controlling the degree of influence of the current input on the cell state, W i is the weight matrix of the input gate, b i is the bias term of the input gate; Cell state: where W C is a weight matrix of the cell state, b C is a bias of the cell state, is the cell state, and tanh is the hyperbolic tangent function. Cell status update C t : wherein, represents element-wise multiplication; Output gate: o t = σ(W o · [h t-1 , x t ] + b o ) wherein o t is the activation value of the output gate, W o is the weight matrix of the output gate, b o is the bias term of the output gate; Hidden state update: h t = o t ⊙ tanh(C t ) where h t is the current hidden state; S33: learning time series features from INS and predicting UWB increment by LSTM.
7. The deep learning-based UWB / INS adaptive positioning method of claim 6, wherein, The S33 comprises: In the loosely coupled mode, the UWB increment, i.e., UWB position increment, is predicted by LSTM based on attention mechanism. The LSTM based on the attention mechanism learns to map the input to the UWB position increment at the current time k within a time window T wherein f NN,LC LSTM representing attention mechanism; is the IMU acceleration, high frequency n1; is the IMU angular velocity, same frequency as acceleration; is the INS solved attitude angle, frequency n2; is the INS solved velocity; INS solved position, is the UWB position increment, lowest frequency n3.
8. The deep learning-based UWB / INS adaptive positioning method of claim 6, wherein, The S33 comprises: In the tight coupling mode, an attention mechanism based LSTM is used to predict the UWB increment, which is the UWB ranging increment Specifically: The LSTM based on attention mechanism learns to map the input to the UWB ranging increment at the current time k within the time window T: wherein, is the UWB raw ranging.
9. The deep learning-based UWB / INS adaptive positioning method of claim 6, wherein, The S4 comprises: In the Kalman filter, the innovation sequence is calculated: The covariance matrix is: where S k is the innovation covariance matrix; compute Mahalanobis distance statistic: wherein is the transpose of the innovation sequence; The loss function is calculated: The loss function in the two fusion modes can be defined as the sum of squared errors between the predicted value and the actual observed value of the UWB increment: where L is a loss function, is the predicted value of the UWB increment, Ay k is the actual observed value of the UWB increment.
10. A deep learning based UWB / INS adaptive positioning system, characterized in that, It comprises: Drift cumulative error calculation module: under the LOS condition, the attitude, velocity, position and UWB measurement of INS are calculated by the IMU sensor data, and the INS drift cumulative error is calculated; the UWB measurement is obtained by the UWB device; UWB / INS fusion module: using Kalman filter to estimate the prior state of UWB / INS and determine the fusion mode, and fusing according to the error state vector under the fusion mode; LSTM training module based on attention mechanism: constructing LSTM based on attention mechanism, inputting attitude, velocity, position and UWB measurement into LSTM based on attention mechanism for training, and predicting UWB increment at the current time; LSTM update module based on attention mechanism: defining the difference between the predicted UWB increment and the actual observed value as the innovation sequence, calculating the loss function according to the innovation sequence and updating the LSTM parameters based on attention mechanism, and obtaining the trained LSTM based on attention mechanism; Kalman filter update module: under the NLOS condition, updating the Kalman filter using the trained LSTM based on attention mechanism to realize the accuracy of positioning; To realize the deep learning based UWB / INS adaptive positioning method according to any one of claims 1-9.