A trajectory prediction method and system based on a CNN-LSTM-attention neural network
By combining a hybrid neural network of CNN, LSTM and Attention, the problems of IMU data noise and accumulated error are solved, improving the accuracy and reliability of trajectory prediction, especially maintaining high accuracy in complex environments. This overcomes the shortcomings of traditional methods and achieves efficient trajectory prediction results.
Patent Information
- Application Number
- CN202510055395.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-01-14
AI Technical Summary
Existing trajectory prediction methods suffer from noise and accumulated errors when using IMU data, leading to reduced accuracy and reliability. Furthermore, they are insufficient in predicting accuracy in complex and ever-changing real-world scenarios, making it difficult to effectively capture spatial features and temporal dependencies in trajectory data. Traditional neural networks also lack the ability to focus on key features, resulting in poor model training stability.
A hybrid neural network architecture integrating convolutional neural networks (CNN), long short-term memory networks (LSTM), and attention mechanisms is adopted. The model is trained using multi-source sensor data, and data standardization is performed. A loss function and optimizer are defined, and the backpropagation algorithm is used to optimize the model parameters, thereby improving the performance of feature extraction and prediction.
It significantly improves the accuracy and robustness of trajectory prediction, especially maintaining high accuracy in complex environments and low signal-to-noise ratio conditions. The model training stability and prediction accuracy are verified, demonstrating superior performance in scenarios with unstable or lost signals.
Smart Images

Figure CN120003529B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine learning and data analysis technology, specifically relating to a method for achieving high-precision trajectory prediction using a neural network model that combines convolutional neural networks (CNN), long short-term memory networks (LSTM), and attention mechanisms. Background Technology
[0002] Trajectory prediction refers to predicting the future movement path of an object by analyzing its past motion trajectory. It is widely used in fields such as intelligent transportation, autonomous driving, robot navigation, and aerospace. With the development of big data and artificial intelligence technologies, trajectory prediction methods based on deep learning have gradually become a research hotspot.
[0003] Existing trajectory prediction methods mainly include traditional physics-based methods and machine learning-based methods. Traditional methods rely on physical laws and kinematic models, making them difficult to adapt to complex and ever-changing real-world scenarios, especially in complex and rapidly changing environments, where their prediction accuracy and adaptability are low. For example, in urban environments, dense buildings and numerous signal blockages can lead to signal loss or severe attenuation of navigation signals (such as GNSS), causing traditional trajectory estimation methods based on navigation signals to fail.
[0004] Machine learning-based methods, especially deep learning methods such as recurrent neural networks (RNNs) and long short-term memory networks, excel in processing time-series data. However, these methods still have limitations in capturing spatial features and long-term dependencies in trajectory data. CNNs have a significant advantage in extracting spatial features, while LSTMs perform exceptionally well in capturing temporal dependencies. Attention mechanisms can effectively enhance the model's ability to focus on key features. Combining these three approaches can fully leverage their respective strengths, improving the accuracy and robustness of trajectory prediction.
[0005] In scenarios where navigation signals are lost, such as underground parking lots, tunnels, and dense urban areas, trajectory estimation methods relying on traditional navigation signals are insufficient to provide reliable location information. In such cases, using IMU (Inertial Measurement Unit) data for trajectory prediction becomes an effective supplementary method.
[0006] However, IMU data itself contains noise and accumulated errors, which reduces the accuracy and reliability of trajectory prediction. Summary of the Invention
[0007] This invention proposes a trajectory prediction method and system based on a CNN-LSTM-Attention neural network, aiming to solve the following technical problems:
[0008] 1. When using IMU data for trajectory prediction, the accuracy and reliability of trajectory prediction are reduced due to the noise and accumulated errors inherent in the IMU data itself.
[0009] 2. The accuracy of trajectory prediction in complex and ever-changing real-world scenarios.
[0010] 3. The problem of capturing spatial features and temporal dependencies in trajectory data.
[0011] 4. Traditional neural network models suffer from insufficient attention to key features and instability during model training.
[0012] The trajectory prediction method based on CNN-LSTM-Attention neural network proposed in this invention includes:
[0013] S1: Collect multi-source sensor data and preprocess it to generate input features for training;
[0014] S2: Divide the preprocessed sensor data into training set data and test set data, and standardize the input features and target output;
[0015] S3: Construct a hybrid neural network architecture, set the structure and parameters of each layer in the hybrid neural network architecture, and define the loss function and optimizer;
[0016] S4: The hybrid neural network architecture is trained using the training set data, and the model parameters are optimized using the backpropagation algorithm;
[0017] S5: Calculate the error index between the predicted trajectory and the actual trajectory, and evaluate the prediction performance of the hybrid neural network architecture based on the error index;
[0018] S6: Select the neural network with the best prediction performance for real-time trajectory prediction.
[0019] Furthermore, a preferred embodiment is provided: the multi-source sensor data includes: inertial measurement unit and conventional navigation data signals.
[0020] Furthermore, a preferred solution is provided: the preprocessing includes: reading the position information file calculated from the inertial measurement unit and traditional navigation data signals, and naming and organizing each data column.
[0021] Furthermore, a preferred solution is provided: In S2, the standardization processing of the input features and the target output specifically involves performing Z-score standardization processing on the input features and the target output.
[0022] Furthermore, a preferred solution is provided: the Z-score standardization formula is as follows,
[0023]
[0024] Where x is the original data, μ is the mean, and σ is the standard deviation.
[0025] Furthermore, a preferred embodiment is provided: S3 includes:
[0026] A hybrid neural network architecture integrating Convolutional Neural Network (CNN), Long Short-Term Memory Network (LSTM), and Attention mechanism is constructed. Specifically, the CNN module extracts spatial features and local patterns of the input data through multi-layer convolution and pooling operations; the LSTM layer processes the temporal features extracted by the CNN; the attention mechanism layer weights the features output by the LSTM; and the weighted features are linearly combined in a fully connected layer to output the final trajectory prediction result.
[0027] Furthermore, a preferred solution is provided: in S3, the mean squared error (MSE) is defined as the loss function, and the RMSprop optimizer is selected.
[0028] The present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a trajectory prediction method based on a CNN-LSTM-Attention neural network as described in any of the above-described scheme combinations.
[0029] The present invention also proposes a computer-readable storage medium for storing a computer program that executes a trajectory prediction method based on a CNN-LSTM-Attention neural network as described in any of the above-described scheme combinations.
[0030] This invention also proposes a trajectory prediction system based on a CNN-LSTM-Attention neural network. The system is implemented based on any combination of the above-mentioned schemes and a trajectory prediction method based on a CNN-LSTM-Attention neural network, comprising:
[0031] Data processing module: used to collect multi-source sensor data, perform preprocessing, and generate input features for training;
[0032] Data partitioning module: used to divide the preprocessed sensor data into training set data and test set data, and to standardize the input features and target output;
[0033] Model Component Module: Used to build a hybrid neural network architecture, set the structure and parameters of each layer in the hybrid neural network architecture, and define the loss function and optimizer;
[0034] Model training module: used to train the hybrid neural network architecture using training set data and to optimize model parameters using the backpropagation algorithm;
[0035] Model evaluation module: used to calculate the error index between the predicted trajectory and the actual trajectory, and to evaluate the prediction performance of the hybrid neural network architecture based on the error index;
[0036] Real-time prediction module: Used to select the neural network with the best prediction performance for real-time trajectory prediction.
[0037] Compared with the prior art, the advantages of the present invention are:
[0038] (1) High-precision prediction: By combining convolutional neural networks, long short-term memory networks and attention mechanisms, spatial and temporal features in trajectory data can be fully extracted, significantly improving the accuracy of trajectory prediction.
[0039] (2) Robustness enhancement: An attention mechanism is introduced to enhance the model’s ability to focus on key features, especially in complex environments and low signal-to-noise ratio conditions, it can still maintain high prediction accuracy.
[0040] (3) Model optimization: By standardizing data, handling missing values and dividing the dataset reasonably, the stability of model training and the accuracy of prediction are ensured. At the same time, the RMSprop optimization algorithm is used to effectively optimize the model parameters.
[0041] (4) Comparison of auxiliary models: By training and evaluating auxiliary models using only CNN or LSTM, the superior performance of the CNN-LSTM-Attention model in trajectory prediction task was further verified.
[0042] The trajectory prediction method based on a CNN-LSTM-Attention neural network described in this invention significantly improves the accuracy and reliability of trajectory prediction by combining deep learning methods with multi-source sensor data. Therefore, the trajectory prediction method based on the CNN-LSTM-Attention neural network has important application value in complex scenarios where signals are unstable or lost.
[0043] This invention is applicable to intelligent transportation systems, autonomous driving, route planning, and other application scenarios. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0045] Figure 1 This is a flowchart of a trajectory prediction method based on a CNN-LSTM-Attention neural network according to a specific embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of the CNN-LSTM-Attention neural network structure described in Embodiment 1 of the present invention;
[0047] Figure 3 This is a comparison chart of trajectory prediction results based on different neural network algorithms as described in Embodiment 3 of the present invention;
[0048] Figure 4 This is a comparison chart of trajectory prediction error results based on different neural network algorithms as described in Embodiment 3 of the present invention;
[0049] Figure 5 This is a comparison chart of eastward error results based on different algorithms as described in Specific Embodiment 3 of the present invention;
[0050] Figure 6 This is a comparison chart of northbound error results based on different algorithms as described in Specific Embodiment 3 of the present invention. Detailed Implementation
[0051] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail.
[0052] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0053] It should also be understood that the terminology used in this application specification is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this application specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0056] Implementation Method 1
[0057] Reference Figure 1 , Figure 2 This implementation method is described below.
[0058] This implementation proposes a trajectory prediction method based on a CNN-LSTM-Attention neural network, including:
[0059] Step 1: Collect, organize, and convert raw multi-source sensor data to generate an input format suitable for neural network training.
[0060] Step 2: Divide the data processed in Step 1 into training and testing sets, and perform Z-score standardization on the input features and target output.
[0061] Step 3: Design and configure a hybrid neural network architecture that integrates Convolutional Neural Network (CNN), Long Short-Term Memory Network (LSTM), and Attention mechanism. Set the structure and parameters of each layer, define the loss function and optimizer, and optimize the model parameters through backpropagation algorithm to minimize the prediction error.
[0062] Step 4: Train the neural network model using the processed dataset and the trained model, and use the trained model to predict the trajectory of the validation set data. Save the prediction results for subsequent analysis.
[0063] Step 5: Evaluate the model's predictive performance by calculating error metrics (such as root mean square error (RMSE) and mean square error (MAE) between the predicted and actual trajectories.
[0064] Step Six: Combine the input inertial navigation data with the trained neural network model to perform real-time trajectory prediction.
[0065] like Figure 1As shown, a trajectory prediction method based on a CNN-LSTM-Attention neural network collects, organizes, and transforms multi-source sensor data to generate an input format suitable for neural network training. The preprocessed data is then divided into training and testing sets, and Z-score standardization is applied to the input features and target output. Next, a hybrid neural network architecture integrating convolutional neural networks, long short-term memory networks, and attention mechanisms is designed and configured. The structure and parameters of each layer are set, and a loss function and optimizer are defined. The model parameters are optimized using the backpropagation algorithm to minimize prediction error. The processed dataset and neural network model are used for training, and the trained model is used to predict trajectories on the validation set data. The prediction results are saved for subsequent analysis. The model's prediction performance is evaluated by calculating error metrics (such as root mean square error (RMSE) and mean absolute error (MAE) between the predicted and actual trajectories. Finally, real-time trajectory prediction is performed using the trained neural network model in conjunction with the input inertial navigation data. By fully extracting the spatial and temporal features from the trajectory data, the accuracy of trajectory prediction is significantly improved.
[0066] Implementation Method 2
[0067] This embodiment is a further illustrative example of the trajectory prediction method based on the CNN-LSTM-Attention neural network described in Embodiment 1.
[0068] The trajectory prediction method based on CNN-LSTM-Attention neural network described in this embodiment specifically includes:
[0069] Step 1: Acquire multi-source sensor data, including inertial measurement unit (IMU) and conventional navigation data signals. IMU data typically contains accelerometer and gyroscope readings along with corresponding quaternion information, while conventional navigation data provides position information. Use data processing tools to read the position information files calculated by the IMU and conventional navigation systems, and name and organize each data column for subsequent processing.
[0070] Using quaternion information from IMU data, the acceleration and angular velocity in the body coordinate system are transformed to the NED coordinate system, and gravity compensation is performed. Given the quaternion q = (q... w ,q x ,q y ,q z ), whose corresponding rotation matrix R quat for,
[0071]
[0072] The acceleration a in the body coordinate system body Transform to the NED coordinate system and perform gravity compensation.ned =R quat ·a body -g, where
[0073]
[0074] To further analyze and process attitude information, the quaternions need to be converted into Euler angles (roll angle φ, pitch angle θ, yaw angle ψ). The specific conversion formula is as follows:
[0075]
[0076] Where φ is the roll angle, representing rotation about the X-axis; θ is the pitch angle, representing rotation about the Y-axis; yaw angle is φ; and ψ represents rotation about the Z-axis. These angles are used to describe the spatial attitude of an object.
[0077] By numerically integrating the acceleration and angular velocity, the velocity of the object in the NED coordinate system is calculated as v(t) = v(t-1) + a. ned (t)·Δt and rotation angle θ(t)=θ(t-1)+ω ned (t)·Δt, where v(t) is the velocity vector at time t, θ(t) is the rotation angle vector at time t, and Δt is the time interval.
[0078] Window sliding is used to divide the time series data into multiple time windows, each containing sensor data at several time points, which are then used as input to the neural network. The specific steps are as follows:
[0079] The window size is set to W. Each input sample contains data from the current time step and the previous n-1 time steps. The sample includes the accelerometer value 'a' in the IMU volume coordinate system. body gyroscope value ω body The input feature matrix X and the target output vector y are generated by considering three rotation angles φ, θ, and ψ, and the velocity v(t) in the NED coordinate system.
[0080] X={x t-n+1 ,x t-n+2 ,…,x t}, y=y t -y t-1 (6)
[0081] Where, x t Let y be the input feature at time t. t This represents the location information at time t.
[0082] Step 2: Divide the dataset according to a certain proportion to ensure the effectiveness of model training and evaluation, ensure the continuity of each subset in the time series, and avoid data leakage. Perform Z-score standardization on the input features X and target output y obtained in Step 1 to eliminate the influence of different units and scales on model training, improving the model's convergence speed and prediction accuracy. The Z-score standardization formula is as follows:
[0083]
[0084] Where x represents the original data, μ is the mean, and σ is the standard deviation. Standardization is applied to the training set and then to the validation and test sets.
[0085] Step 3: Construct a hybrid neural network architecture that integrates Convolutional Neural Network (CNN), Long Short-Term Memory (LSTM) network, and Attention mechanism. The data training process is as follows:
[0086] First, the CNN module extracts spatial features and local patterns from the input data through multiple convolutional and pooling operations, enhancing its feature representation capabilities. The kernel size is set to k, the stride to s, the padding to p, and the dilation rate to d.
[0087] H = ReLU ( Conv1D(X)) (8)
[0088] Where X is the input feature and H is the convolution output feature.
[0089] Secondly, the LSTM layer processes the temporal features extracted by the CNN, models long-term dependencies in trajectory data, and solves the gradient vanishing problem in traditional RNNs. The hidden layer size is set to h, and the number of layers is L.
[0090] h t ,c t = LSTM (H t ,h t-1 ,c t-1 (9)
[0091] Among them, h t and c t These represent the cellular state and the hidden state, respectively.
[0092] Next, the attention mechanism layer weights the features output by the LSTM, enhancing the model's ability to focus on features at key time steps and improving prediction accuracy. The formula for calculating the attention weights is as follows:
[0093]
[0094] Where Q, K, and V represent the query, key, and value matrices, respectively, and d kGiven the dimension of the key vector, the final generated context vector c is...
[0095]
[0096] Where, α i h represents the attention weights. i This represents the hidden state output by the LSTM.
[0097] Finally, the weighted features are linearly combined in a fully connected layer to output the final trajectory prediction result.
[0098]
[0099] Where W and b are the weight matrix and bias vector, respectively.
[0100] In the constructed neural network model, the mean squared error (MSE) is defined as the loss function, and the RMSprop optimizer is selected. The model parameters are optimized through backpropagation to minimize the prediction error. The formula for the loss function is as follows:
[0101]
[0102] Where N is the number of samples, y i For the actual trajectory points, To predict trajectory points.
[0103] Choosing the RMSprop optimizer, its parameter update formula is:
[0104]
[0105] Where θ is the model parameter, η is the learning rate, and g t For the gradient, E[g] 2 ] t is the exponentially decaying average of the squared gradient, and ∈ is a small constant to prevent division by zero.
[0106] Step 4: After completing the corresponding neural network design as in Step 3, train the designed CNN-LSTM-Attention model multiple times using the training set data. Optimize the model parameters using the backpropagation algorithm to minimize the MSE loss. During training, batch gradient descent is used, with a batch size of B and the number of training epochs set to E. Simultaneously, learning rate scheduling is employed to prevent overfitting and ensure the model has good generalization ability on the validation set. During training, the training loss and validation loss for each epoch are recorded, and the model parameters with the minimum validation loss are saved as the optimal model. The optimal model parameters are loaded, and trajectory prediction is performed on the validation set data to generate predicted trajectories. The prediction results are inversely standardized to restore them to the original data scale and saved as a data file for subsequent error analysis and performance evaluation.
[0107]
[0108] Where, σ y and μ y These are the standard deviation and mean of the target output, respectively.
[0109] Step 5: After obtaining the data processed in Step 4, calculate the root mean square error (RMSE) and mean absolute error (MAE) between the predicted trajectory and the true trajectory to quantify the model's predictive performance. The specific formulas are as follows:
[0110]
[0111] Among them, y i For the actual trajectory points, Let N be the number of trajectory points to be predicted. The calculated RMSE and MAE values are analyzed to evaluate the model's prediction accuracy in different scenarios.
[0112] Step Six: Select the network with the best evaluation results for practical application. Acquire inertial navigation data in real time and process, transform, and preprocess it using the same methods as in Step One, including coordinate transformation, velocity and rotation angle calculation, data windowing, and standardization. Input the preprocessed real-time data into the trained CNN-LSTM-Attention model. Use the standardized parameters fitted in Step Two to perform Z-score standardization on the real-time data. Input the standardized data into the model, and obtain the prediction result through forward propagation. The prediction results are inversely standardized to restore them to the original data scale. It is important to note that the prediction results obtained through network training... This is the coordinate difference between the current time and the previous time. To obtain the complete trajectory, we need to sum the predicted differences at each time step. Assuming the initial position is y0, the predicted trajectory... for
[0113]
[0114] Through this cumulative process, we can gradually update the trajectory prediction, adding the corresponding prediction difference at each moment to obtain the complete trajectory sequence.
[0115] Implementation Method 3
[0116] This embodiment is a further illustrative example of a trajectory prediction method based on a CNN-LSTM-Attention neural network as described in Embodiment 1 and Embodiment 2.
[0117] This implementation uses the Brno-Urban-Dataset dataset to verify the effectiveness of the improved scheme. Maintained by the Robotics-BUT team and released under the MIT license, this dataset is an open-source navigation and localization dataset. It provides abundant real-world environmental data and is widely used in fields such as autonomous vehicle and robot design, offering high-quality environmental perception information for model training and validation, ensuring the accuracy and reliability of the experimental results.
[0118] This implementation uses datasets 1_1_2_3 (distance traveled 1.1km, total duration 191s) and 1_1_3_1 (distance traveled 2.2km, total duration 267s) from the Brno-Urban-Dataset as training sets. The input to the training sets includes IMU accelerometer values, gyroscope values, three rotation angles, and velocity in the navigation coordinate system for the previous W time steps. The output consists of the difference between the GPS coordinates at the current time step and the previous time step. Dataset 1_1_1_2 (distance traveled 1km, total duration 259s) was selected as the validation set.
[0119] During the experiment, it was assumed that the autonomous vehicle lost its GPS signal during the 142s-220s period in the validation set, thus failing to achieve accurate positioning. During this 78-second timeframe, this implementation employed the proposed CNN-LSTM-Attention neural network-based method for trajectory prediction, and its prediction accuracy was compared with that of methods using only CNN, LSTM, and inertial navigation system (INS) solutions. This comparison evaluated the robustness and prediction accuracy of the proposed method in the case of navigation signal loss, thereby verifying its application potential and advantages in complex environments.
[0120] Table 1 Key Simulation Parameters
[0121] Data sampling frequency f IMU: 100Hz; Traditional navigation source: 10Hz Window size W 4 time steps <![CDATA[Number of CNN layers N CNN > 2 kernel size k 3 Convolution stride s 1 Convolution filling p 2 Convolutional dilation rate d 2 Convolution output channel C First layer: 64; Second layer: 128 LSTM layer number L 3 LSTM hidden layer size h 32 <![CDATA[Pooling kernel size k pool > 2 <![CDATA[Pooling stride s pool > 2 <![CDATA[Attention mechanism key d k > 128 <![CDATA[Value dimension d v > 128 Training batch size B 32 Maximum number of training rounds E 450 Learning rate η 0.001 Dorpout layer 0.2
[0122] Figure 3 The results show a comparison of trajectory predictions from different algorithms within a selected 78-second prediction timeframe. Figure 4 The error results of different algorithms predicting trajectories are shown. Based on this data, we calculated the root mean square error and absolute mean error of each algorithm, and the results are shown in Table 2.
[0123] Table 2. Positioning error results of different algorithms
[0124] algorithm RMSE / m MAE / m C+L+A 7.09 8.26 CNN 10.92 10.11 LSTM 12.41 15.88 INS 34.30 43.64
[0125] The total error curve is subdivided into two coordinate axes, east and north, and the position errors in the east and north directions are calculated separately. The error results are as follows: Figure 5 As shown in Figure 6, the root mean square error and absolute mean error results for the east and north directions are shown in Table 3.
[0126] Table 3. Positioning error results of different algorithms in the east and north directions.
[0127] algorithm Eastbound RMSE / m Northbound RMSE / m Eastbound MAE / m Northbound MAE / m C+L+A 4.25 5.47 4.76 6.14 CNN 6.97 8.71 5.89 7.35 LSTM 7.44 10.42 9.07 12.48 INS 14.83 26.70 17.01 30.53
[0128] As can be seen from Tables 2 and 3, the trajectory prediction using the CNN-LSTM-Attention algorithm performs best in terms of overall localization error, eastward error, and northward error. Its RMSE and MAE values are lower than those of CNN, LSTM, and traditional INS algorithms, showing the best prediction effect.
[0129] In summary, simulation experiments fully validate the efficiency, robustness, and accuracy advantages of the trajectory prediction method based on CNN-LSTM-Attention neural networks in complex environments. This method demonstrates superior performance in navigation scenarios with missing signals and complex paths, effectively solving the error accumulation problem in traditional INS methods. In the future, this technology can be widely applied in fields such as autonomous vehicle navigation and UAV path planning, possessing significant application value and broad prospects for promotion.
[0130] Implementation Method 4
[0131] This embodiment proposes a trajectory prediction system based on a CNN-LSTM-Attention neural network. The system is implemented based on a trajectory prediction method based on a CNN-LSTM-Attention neural network as described in either Embodiment 1 or Embodiment 2, and includes:
[0132] Data processing module: used to collect multi-source sensor data, perform preprocessing, and generate input features for training;
[0133] Data partitioning module: used to divide the preprocessed sensor data into training set data and test set data, and to standardize the input features and target output;
[0134] Model Component Module: Used to build a hybrid neural network architecture, set the structure and parameters of each layer in the hybrid neural network architecture, and define the loss function and optimizer;
[0135] Model training module: used to train the hybrid neural network architecture using training set data and to optimize model parameters using the backpropagation algorithm;
[0136] Model evaluation module: used to calculate the error index between the predicted trajectory and the actual trajectory, and to evaluate the prediction performance of the hybrid neural network architecture based on the error index;
[0137] Real-time prediction module: Used to select the neural network with the best prediction performance for real-time trajectory prediction.
[0138] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0139] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0140] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0141] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware implementation, a completely software implementation, or an implementation combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0143] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific embodiments of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the claims to be published and pending approval.
Claims
1. A trajectory prediction method based on a CNN-LSTM-Attention neural network, characterized in that, The method comprises: S1: collecting multi-source sensor data and preprocessing to generate input features for training; S2: dividing the preprocessed sensor data into training set data and test set data, and standardizing the input features and target output; S3: constructing a hybrid neural network architecture, setting the structure and parameters of each layer in the hybrid neural network architecture, and defining the loss function and optimizer; S4: training the hybrid neural network architecture using the training set data, and optimizing the model parameters using the back propagation algorithm; S5: calculating the error index between the predicted trajectory and the real trajectory, and evaluating the prediction performance of the hybrid neural network architecture according to the error index; S6: selecting the neural network with the best prediction performance for real-time trajectory prediction; The multi-source sensor data in S1 includes inertial measurement unit and traditional navigation data signals; The acceleration and angular velocity in the body coordinate system are converted to the NED coordinate system by using the quaternion information in the IMU data, and gravity compensation is performed; the quaternion at the current moment is given The corresponding rotation matrix is The acceleration in the body coordinate system is converted to the NED coordinate system and gravity compensation is performed wherein, convert the quaternions to Euler angles, where the Euler angles include a roll angle , a pitch angle , and a yaw angle , according to the following formulas: wherein, is a roll angle, representing rotation about the X axis; is a pitch angle, representing rotation about the Y axis; is a yaw angle, representing rotation about the Z axis; The velocity of the object in the NED coordinate system is calculated by numerically integrating the acceleration and angular velocity. and rotation angle ,in for The velocity vector at time t, for The rotation angle vector at time t, For time intervals; The window sliding technique is used to divide the time series data into multiple time windows, each window containing sensor data at several time points for neural network input, and the specific steps are as follows: The window size is set as Each input sample contains data at the current time and its previous N time, including the accelerometer value , gyroscope value , three rotation angles , , and the velocity in the NED coordinate system in the IMU body coordinate system, to generate an input feature matrix and a target output vector , that is wherein, is input features at a time instant, is location information at a time instant; In S3, the mean square error MSE is defined as the loss function, and the RMSprop optimizer is selected.
2. The trajectory prediction method based on a CNN-LSTM-Attention neural network according to claim 1, characterized in that, The preprocessing includes reading the position information file calculated from the inertial measurement unit and traditional navigation data signals, and naming and organizing each data column. 3.The trajectory prediction method based on CNN-LSTM-Attention neural network according to claim 1, characterized in that, In S2, the standardization processing of input features and target output is specifically Z-score standardization processing of input features and target output.
4. The trajectory prediction method based on a CNN-LSTM-Attention neural network according to claim 3, characterized in that, The Z-score standardization formula is as follows, , wherein, is the original data, is the mean, is the standard deviation. 5.The trajectory prediction method based on CNN-LSTM-Attention neural network according to claim 1, characterized in that, S3 includes: A hybrid neural network architecture is constructed by fusing convolutional neural network CNN, long short-term memory network LSTM and attention mechanism Attention, specifically: the CNN module extracts the spatial features and local patterns of the input data through multiple convolution and pooling operations; the LSTM layer processes the time sequence features extracted by CNN; the attention mechanism layer weights the features output by LSTM; the weighted features are linearly combined in the fully connected layer to output the final trajectory prediction result.
6. Computer device, characterized in that The system comprises a memory and a processor, and the memory stores a computer program, when the processor runs the computer program stored in the memory, the processor executes the trajectory prediction method based on CNN-LSTM-Attention neural network according to any one of claims 1-5.
7. A computer readable storage medium characterized by, The computer readable storage medium is used to store a computer program, which executes the trajectory prediction method based on CNN-LSTM-Attention neural network according to any one of claims 1-5. 8.A trajectory prediction system based on CNN-LSTM-Attention neural network, characterized in that, The system is realized based on the trajectory prediction method based on CNN-LSTM-Attention neural network according to any one of claims 1-5, comprising: The data processing module is used for collecting multi-source sensor data and preprocessing to generate input features for training; The data division module is used for dividing the preprocessed sensor data into training set data and test set data, and standardizing the input features and target output; A model component module is configured to build a hybrid neural network architecture, set structures and parameters of layers in the hybrid neural network architecture, and define a loss function and an optimizer; A model training module is configured to train the hybrid neural network architecture by using training set data, and optimize model parameters by using a back propagation algorithm; A model evaluation module is configured to calculate an error index between a predicted trajectory and a real trajectory, and evaluate a prediction performance of the hybrid neural network architecture according to the error index; A real-time prediction module is configured to select a neural network with the best prediction performance to perform real-time trajectory prediction.
Citation Information
Patent Citations
Positioning method and system based on multi-modal data fusion and ensemble learning
CN118960719A
Ship motion prediction method and device, electronic equipment and readable storage medium
CN119160350A