Method for predicting angular velocity and angular position of tank based on long-short-term memory network of attention mechanism
Through the long short-term memory network based on the attention mechanism, the problem of inaccurate prediction of the tank barrel motion state is solved, and higher-precision shooting prediction is achieved. It adapts to different tank models and environments, and improves shooting accuracy and real-time performance.
Patent Information
- Application Number
- CN202510666639.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional methods find it difficult to accurately capture key information about the tank barrel in complex dynamic processes, resulting in inaccurate shooting accuracy. Especially when considering the deviation between the bullet and the target, how to quickly and accurately predict the movement state of the barrel becomes an urgent problem to be solved.
By adopting a long short-term memory network based on the attention mechanism, through data collection, normalization, data partitioning, prediction model construction and sliding window training, we focus on the key information in the dynamic characteristics of the tank barrel, including angular position and angular velocity, to improve the prediction accuracy.
It achieves more accurate prediction of barrel motion status, meets real-time requirements, improves shooting accuracy and adaptability, is suitable for different tank models and combat environments, and maintains the stability and advancement of prediction performance.
Smart Images

Figure CN120633711A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of neural network recognition technology, and in particular to a method for predicting the angular velocity and angular position of a tank based on a long short-term memory network with an attention mechanism. Background Art
[0002] In modern tank firing systems, increasing vehicle speed and surface complexity significantly impacts firing accuracy. Accurately predicting the motion of the weapon barrel during the firing delay period, based on key factors influencing impact point deviation, including barrel angular velocity and launch angle, allows for more precise calculation of impact point deviation. This approach has significant application value in dynamically determining the timing of mobile firing and optimizing existing firing decision mechanisms.
[0003] The dynamic characteristics of the barrel have a crucial impact on shooting accuracy. Traditional prediction methods often struggle to accurately capture key information from complex dynamic processes such as barrel vibration, resulting in inaccurate predictions that affect both firing timing and accuracy.
[0004] Especially when the bullet-target deviation needs to be considered, how to quickly and accurately predict the movement state of the barrel becomes an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method for predicting the angular velocity and angular position of a tank based on a long short-term memory network with an attention mechanism, which can be used to solve the technical problem of low accuracy in predicting the motion state of the barrel.
[0006] This application provides a method for predicting the angular velocity and angular position of a tank based on a long short-term memory network with an attention mechanism, the method comprising:
[0007] Step 1: Collect key tank data;
[0008] Step 2, normalize the data;
[0009] Step 3: divide the data;
[0010] Step 4: Build a prediction model based on the power layer;
[0011] Step 5: Perform model training;
[0012] Step 6: Perform sliding window training.
[0013] Compared with the prior art, the present invention has the following significant advantages:
[0014] By introducing the attention mechanism, the model can focus on key information in the dynamic characteristics of the tank barrel, including the angular position and angular velocity of the barrel, thereby more accurately predicting the motion state of the barrel, significantly improving the prediction accuracy compared to traditional methods.
[0015] This prediction method has a fast real-time response and can quickly predict the movement state of the barrel, meeting the real-time requirements of tanks in dynamic environments and providing support for real-time and rapid decision-making on shooting timing.
[0016] This method has good adaptability to different tank models and combat environments. Through appropriate training and parameter adjustment, it can be applied to various practical scenarios to improve the combat effectiveness of tanks.
[0017] The model can adapt to changes in tank barrel characteristics and new combat requirements by continuously learning and updating training data, maintaining the stability and advancement of predictive performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A comparison chart of the predicted results of one cycle provided in the embodiment of this application and the actual data;
[0019] Figure 2 A comparison chart of the predicted 5-cycle results and the actual data provided in the embodiment of this application;
[0020] Figure 3 A comparison chart of the predicted 10-cycle results and the actual data provided in the embodiment of this application;
[0021] Figure 4 A comparison chart of the predicted 15-cycle results and the actual data provided in the embodiment of this application;
[0022] Figure 5 This is a graph showing the statistical results of the prediction errors for periods 1-15 provided in the embodiment of the present application;
[0023] Figure 6 A schematic flow chart of model training provided in an embodiment of the present application;
[0024] Figure 7 LSTM working principle diagram of the attention mechanism provided in the embodiment of the present application;
[0025] Figure 8 A schematic flow chart of data prediction provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0027] The following first introduces the embodiments of the present application with reference to the accompanying drawings.
[0028] The method provided in this application comprises the following steps:
[0029] Step 1: Collect key tank data;
[0030] Under different road conditions, the barrel shaking trend changes significantly. The tank's key data is collected during high-speed moving shooting tests on different road surfaces. The tank's key data includes: barrel elevation angular position, barrel elevation angular velocity, barrel azimuth angular position, and barrel azimuth angular velocity.
[0031] Step 2, normalize the data;
[0032] Scale the tank's key data to the [0,1] interval, and the normalization method is:
[0033] Among them, min(x) is the minimum value of the data feature, max(x) is the maximum value of the data feature; x′ is the result after data normalization.
[0034] Step 3: divide the data;
[0035] The data is divided into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%. The training set is used for model training, and the test set is used for model verification and prediction.
[0036] Step 4: Build a prediction model based on the power layer; Figure 7 As shown:
[0037] The LSTM layer is used to capture long-term dependencies in time series data;
[0038] The attention layer is used to enhance the model's ability to focus on key time steps; the calculation method of the multi-head attention mechanism is: The Attention function is defined as:
[0039] head i is the calculation result of the i-th head of the attention mechanism;
[0040] Among them, Q is the query matrix; K is the key matrix; V is the value matrix; d k is the dimension of the key; T is the matrix transpose; h is the number of attention heads; W i Q ,W i K ,W i V is the weight matrix of the i-th attention head; W Ois the output weight matrix; Concat is the matrix concatenation operation; softmax is the activation function;
[0041] The output layer is used to map the output of the LSTM layer and the attention layer to the dimension of the prediction target; the calculation method of the fully connected layer is: y = Wx + b;
[0042] Among them, x is the input feature vector from LSTM and attention layer; W is the weight matrix, b is the bias term, and y is the final prediction result.
[0043] Step 5: Perform model training:
[0044] The Adam optimizer is used, which has an adaptive learning rate adjustment function to improve the training efficiency and train the prediction model.
[0045] Calculate the predicted output of the model; calculate the loss between the predicted output and the true value; update the model parameters to minimize the loss; when the validation set loss no longer improves within 10 consecutive epochs (full training), stop training early to prevent overfitting.
[0046] Step 6: Perform sliding window training:
[0047] Use the trained model to perform sliding window predictions on the test data, predicting the barrel pose for cycles 1-15. The steps for sliding window prediction are: initialize the prediction window; use the model to predict the output of the current window; remove the oldest data point and slide the window backward; repeat these steps until all cycles are predicted.
[0048] The present application is further verified below based on specific examples:
[0049] For example, a high-speed, moving firing test of a certain type of tank on a Class C road surface required real-time prediction of the tank barrel's elevation and azimuth positions to improve firing accuracy. A long short-term memory network with an attention mechanism was used to model and predict the tank barrel's elevation (and azimuth) positions, and the error characteristics of the prediction results were analyzed.
[0050] The barrel vibration data during movement comes from the test records of a certain type of tank on a Class C road. The data includes the vertical and horizontal posture data of the tank barrel, with a sampling frequency of 1000 times per second. The data file is in .dat format, and its motion curve is as follows: Figure 1 The blue curve shows multiple test samples using the LTSM model with attention mechanism. The parameters are as follows:
[0051] 1. Input dimensions: 2 (barrel elevation and angular velocity)
[0052] 2. Number of hidden layer units: 50
[0053] 3. Output dimensions: 2 (barrel elevation and angular velocity)
[0054] 4. Number of LTSM layers: 2
[0055] 5. Forecast step: 1-15 cycles, adjusted according to actual needs.
[0056] The online prediction mode is adopted, that is, the prediction is carried out in real time during the data collection process, and the execution time of the prediction is in milliseconds. The trained model is used to perform sliding window prediction on the test set data, predicting the barrel posture for 1-15 cycles, and calculating the error statistical indicators of the prediction results, including mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE) and determination coefficient (R2). The figure shows the comparison between the predicted value and the actual value when the prediction step is 1, 5, 10 and 15 cycles. Figures 1 to 4 As shown, Figure 5 The error statistics for prediction steps from 1 to 15 periods are shown.
[0057] from Figure 5 As can be seen from the figure, MAE shows a trend of gradual increase as the prediction step length increases. The MAE of prediction point 1 is 0.0482, with the smallest error; while the MAE of prediction point 15 reaches 0.1348, with the largest error, indicating that the model's prediction error increases significantly with the increase in prediction points. In particular, after prediction point 5, the growth rate of MAE accelerates significantly, indicating that the error accumulation effect of the model at farther prediction points is more obvious. 2 It gradually decreases as the number of prediction points increases. 2 The model has the strongest explanatory power, and the R 2 It drops to 0.7785, and the model's explanatory power is the weakest. This shows that the model cannot fully capture the variation of the data at farther prediction points, and the prediction performance gradually decreases. However, the error of the model prediction still meets the requirements of the fire control system and can still provide quantitative support for the tank fire control to effectively capture more accurate shooting opportunities.
[0058] Overall, the model demonstrates high accuracy in short-term predictions. However, in long-term predictions, the error gradually increases and the explanatory power decreases. Further optimization is needed to improve long-term prediction performance. This case study modeled and predicted the vertical and horizontal posture of a tank's barrel during high-speed, moving firing on a Class C road. Experimental results demonstrate that the model effectively predicts barrel posture with high accuracy. Error statistics and analysis further validate the model's reliability and applicability.
[0059] The above-described embodiments of the present application do not constitute a limitation on the scope of protection of the present application.
Claims
1. A method for predicting tank angular velocity and angular position based on a long short-term memory network with an attention mechanism, characterized in that: The method comprises: Step 1: Collect key tank data; Step 2, normalize the data; Step 3: divide the data; Step 4: Build a prediction model based on the power layer; Step 5: Perform model training; Step 6: Perform sliding window training.
2. The method according to claim 1, characterized in that Step 1: Collect key tank data; including: Key tank data is collected during high-speed moving shooting tests on different road surfaces. The key tank data includes: barrel elevation angular position, barrel elevation angular velocity, barrel azimuth angular position, and barrel azimuth angular velocity.
3. The method according to claim 1, characterized in that Step 2: normalize the data; including: Scale the tank's key data to the [0,1] interval, and the normalization method is: Among them, min(x) is the minimum value of the data feature, max(x) is the maximum value of the data feature; x′ is the result after data normalization.
4. The method according to claim 1, wherein Step 3: Data partitioning; including: The data is divided into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%. The training set is used for model training, and the test set is used for model verification and prediction.
5. The method according to claim 1, wherein Step 4: Build a prediction model based on the power layer; including: The LSTM layer is used to capture long-term dependencies in time series data; The attention layer is used to enhance the model's ability to focus on key time steps; the calculation method of the multi-head attention mechanism is: The Attention function is defined as: head i is the calculation result of the i-th head of the attention mechanism; Where Q is the query matrix; K is the key matrix; V is the value matrix; dk is the dimension of the key; T is the matrix transpose; h is the number of attention heads; W i Q ,W i K ,W i V is the weight matrix of the i-th attention head; W O is the output weight matrix; Concat is the matrix concatenation operation; softmax is the activation function; The output layer is used to map the output of the LSTM layer and the attention layer to the dimension of the prediction target; the calculation method of the fully connected layer is: y = Wx + b; Among them, x is the input feature vector from LSTM and attention layer; W is the weight matrix, b is the bias term, and y is the final prediction result.
6. The method according to claim 1, characterized in that Step 5: Perform model training, including: The prediction model is trained using the Adam optimizer. Calculate the predicted output of the model; calculate the loss between the predicted output and the true value; update the model parameters to minimize the loss; when the validation set loss no longer improves within 10 consecutive epochs, stop training early to prevent overfitting.
7. The method according to claim 1, characterized in that Step 6: Perform sliding window training; including: Use the trained model to perform sliding window predictions on the test data, predicting the barrel pose for cycles 1-15. The steps for sliding window prediction are: initialize the prediction window; use the model to predict the output of the current window; remove the oldest data point and slide the window backward; repeat these steps until all cycles are predicted.