An intelligent weight prediction method for dynamic scenes
By using a hierarchical attention mechanism network, the problem of modeling nonlinear correlations between targets in unmanned surface vessel (USV) formation combat scenarios is solved. This achieves efficient and accurate weight prediction, adapts to complex and ever-changing dynamic scenarios, and has good real-time performance and computational efficiency.
Patent Information
- Application Number
- CN202511059319.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Existing dynamic methods struggle to effectively model nonlinear dependencies and complex relationships between targets in unmanned surface vessel (USV) formation combat scenarios. They also have a strong dependence on training data, limited generalization ability, and are unable to adapt to new environments, failing to meet the requirements of real-time performance and accuracy.
A hierarchical attention mechanism combining local and global attention networks is adopted. By acquiring unmanned surface vessel (USV) data, the index vectors of each USV are calculated, and attention weights are used for weight prediction. The final weight prediction results are generated by combining a fully connected feedforward layer, and the network parameters are adjusted using a stochastic gradient descent algorithm.
It achieves adaptive adjustment of multiple indicator systems in dynamic scenarios, improving robustness and accuracy. The error is less than 10-3, the standard deviation does not exceed 3×10-3, and the single inference time is stable at about 1 millisecond, meeting the requirements of efficient and real-time weight evaluation.
Smart Images

Figure CN120805990B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned surface vessel data analysis technology, and in particular to an intelligent weight prediction method for dynamic scenarios. Background Technology
[0002] In unmanned surface vessel (USV) swarm combat scenarios, it is necessary to determine the priority of the vessels in the target group to obtain the maximum combat advantage. However, due to the continuous changes in the formation configuration and the actual combat capabilities of each vessel over time, relevant indicators such as deployment position and distance from the formation center will also change continuously. The problem of allocating evaluation weights for each indicator for different USVs in dynamic scenarios faces the following challenges: 1. Large USV swarm size and rapid state changes: As the scenario evolves, the attributes and priorities of USVs may continuously change, and the evaluation algorithm needs to be able to dynamically adapt to the changing relationships between different USVs; 2. Diverse and interrelated indicators: Each USV is usually represented by multiple indicators, and these indicators may have nonlinear correlations or cross-influences, which are difficult for traditional linear models to capture; 3. Diverse scenarios: Under different situational conditions, the weight distribution of indicators for USVs may be completely different, and the evaluation algorithm needs to have the ability to generalize and predict for different scenarios; 4. Real-time requirements: The evaluation algorithm needs to respond quickly to scenario changes and generate a weight allocation scheme that conforms to the current state.
[0003] However, while existing dynamic methods (such as time series models and reinforcement learning methods) can capture time dependencies and dynamic changes, they struggle to effectively model nonlinear dependencies and complex relationships between targets in high-dimensional data and multi-objective scenarios. Furthermore, existing methods generally have a strong dependence on training data and limited generalization ability, making them prone to failing to adapt to new environments in practical applications. Therefore, the technical problem of this application is to provide a dynamic weight prediction method for unmanned vessel formations that is highly adaptable and provides more accurate predictions. Summary of the Invention
[0004] This application provides an intelligent weight prediction method for dynamic scenarios, which can capture the relationship between parameters in the index vector to match different formation working scenarios, and significantly improve the accuracy of index weight prediction.
[0005] In a first aspect, embodiments of this application provide an intelligent weight prediction method for dynamic scenarios, including:
[0006] Acquire unmanned surface vessel (USV) data; USV data is an n×m matrix, where n is the number of USVs in the USV formation, m is the number of indicators, and the matrix elements are the quantitative indicator values of the corresponding USVs on the corresponding indicators.
[0007] The index vectors of each unmanned vessel are obtained based on the data from the unmanned vessel.
[0008] Each index vector is input into the local attention network to obtain the corresponding first attention weights;
[0009] Calculate the corresponding local attention aggregation result based on each first attention weight;
[0010] The aggregated results of each local attention are input into the global attention network to obtain the corresponding second attention weights;
[0011] Calculate the corresponding global attention output based on each of the secondary attention weights;
[0012] The outputs of each global attention function are concatenated to obtain the output head vector;
[0013] The output head vector is input into a fully connected feedforward layer to obtain the weight prediction results; the weight prediction results include the prediction weights of each unmanned vessel for each indicator.
[0014] Furthermore, the metrics for unmanned vessels include deployment centrality, attributes, maneuverability, payload capacity, and current status.
[0015] Furthermore, the deployment centrality is the distance from the unmanned vessel to the center of the unmanned vessel formation; the attribute is the type of the unmanned vessel obtained according to the fuzzy quantization rule, the maneuverability is the result obtained based on the speed of the unmanned vessel; the payload capacity is proportional to the size of the unmanned vessel; the current state includes the adversarial state and the operational state.
[0016] Furthermore, the index vectors for each unmanned surface vessel (USV) obtained from the USV data include:
[0017] The unmanned vessel data is input into the embedding layer and linearly transformed to obtain index vectors for each preset dimension.
[0018] Furthermore, the various index vectors are input into the local attention network to obtain the corresponding first attention weights, including:
[0019] The index vector is input into the local attention network and reconstructed into the first attention subsequence of the unmanned vessel; the first attention subsequence includes the first query vector, the first key vector, and the first value vector.
[0020] The first attention weight of the unmanned vessel is obtained based on the first attention subsequence.
[0021] Furthermore, the first attention weights of the unmanned vessel obtained based on the first attention subsequence include:
[0022] The target vector is obtained by transposing the first key vector and multiplying it by the first query vector.
[0023] Divide the target vector by the square root of the preset dimension to obtain the first attention score;
[0024] The first attention score is input into the softmax function to obtain the first attention weight.
[0025] Furthermore, the aforementioned calculation of the corresponding local attention aggregation results based on each first attention weight includes:
[0026] Multiply the first attention weight by the first value vector to obtain the corresponding local attention aggregation result.
[0027] Furthermore, the outputs of each global attention point are concatenated to obtain the output head vector, which includes:
[0028] The concat function is used to concatenate the outputs of each global attention function to obtain the output head vector.
[0029] Furthermore, the loss function of the intelligent weight prediction method is the mean absolute percentage error function.
[0030] Furthermore, the local attention network, global attention network, and fully connected feedforward layer employ stochastic gradient descent to adjust the network parameters.
[0031] Secondly, embodiments of this application provide an intelligent weight prediction device for dynamic scenarios, comprising:
[0032] The acquisition module is used to acquire unmanned surface vessel (USV) data. The USV data is an n×m matrix, where n is the number of USVs in the USV formation, m is the number of indicators, and the matrix elements are the quantitative indicator values of the corresponding USVs on the corresponding indicators.
[0033] The embedded module is used to obtain the index vectors of each unmanned vessel based on the unmanned vessel data.
[0034] The first reconstruction module is used to input each index vector into the local attention network to obtain the corresponding first attention weights;
[0035] The local aggregation module is used to calculate the corresponding local attention aggregation result based on each first attention weight;
[0036] The second reconstruction module is used to input the aggregation results of each local attention into the global attention network to obtain the corresponding second attention weights;
[0037] The global output module is used to calculate the corresponding global attention output based on each of the second attention weights.
[0038] The concatenation module is used to concatenate the outputs of the various global attention functions to obtain the output head vector;
[0039] The prediction module is used to input the output head vector into the fully connected feedforward layer to obtain the weight prediction results; the weight prediction results include the prediction weights of each unmanned vessel for each indicator.
[0040] Furthermore, the aforementioned embedded module is specifically used for:
[0041] The unmanned vessel data is input into the embedding layer and linearly transformed to obtain index vectors for each preset dimension.
[0042] Furthermore, the aforementioned first reconstruction module includes a vector calculation unit and a weight calculation unit;
[0043] The vector computation unit is used to input the index vector into the local attention network and reconstruct it into the first attention subsequence of the unmanned vessel; the first attention subsequence includes the first query vector, the first key vector, and the first value vector.
[0044] The weight calculation unit is used to obtain the first attention weight of the unmanned vessel based on the first attention subsequence.
[0045] Furthermore, the weight calculation unit is specifically used to transpose the first key vector and multiply it with the first query vector to obtain the target vector; divide the target vector by the square root of the preset dimension to obtain the first attention score; and input the first attention score into the softmax function to obtain the first attention weight.
[0046] Furthermore, the local aggregation module is specifically used to multiply the first attention weight and the first value vector to obtain the corresponding local attention aggregation result.
[0047] Furthermore, the concatenation module is specifically used to concatenate the output results of each global attention using the concat function to obtain the output head vector.
[0048] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the steps of an intelligent weight prediction method for dynamic scenarios as described in any of the above embodiments.
[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of an intelligent weight prediction method for dynamic scenarios as described in any of the above embodiments.
[0050] In summary, compared with the prior art, the beneficial effects of the technical solution provided in this application include at least the following:
[0051] This application provides an intelligent weight prediction method for dynamic scenarios. This method exhibits good robustness and adaptability when handling dynamic inputs from multiple indicators, enabling fast and stable weight estimation, fully meeting the real-time and accuracy requirements of dynamic scenarios such as unmanned surface vessel control. Furthermore, the hierarchical attention mechanism network used in this application achieves high prediction accuracy, with an average error not exceeding 10%. -3 The standard deviation fluctuation does not exceed 3×10 -3 The accuracy is stable, and the time for a single inference is basically stable at around 1 millisecond with minimal fluctuation, demonstrating good time consistency. This indicates that while maintaining high prediction accuracy, this application has good computational efficiency and real-time performance, which can meet the needs of dynamic weight evaluation scenarios with high response speed requirements. In scenarios that require frequent real-time updates of weight distribution, this application can significantly reduce computational latency. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating an intelligent weight prediction method for dynamic scenarios, provided as an embodiment of this application.
[0053] Figure 2 This is a flowchart of an intelligent weight prediction method for dynamic scenarios, provided as another embodiment of this application.
[0054] Figure 3 An error test curve of the prediction model constructed in this application is provided as an embodiment of this application.
[0055] Figure 4 The inference time curve is a test sample provided in one embodiment of this application.
[0056] Figure 5 The distribution of weight prediction results of the prediction model provided in one embodiment of this application under changing scene conditions is shown in the figure.
[0057] Figure 6 This is a structural diagram of an intelligent weight prediction device for dynamic scenarios provided in one embodiment of this application. Detailed Implementation
[0058] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0059] Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] Existing dynamic weight evaluation methods can be divided into two main categories: static methods and dynamic methods.
[0061] Static methods have been widely used in multi-objective evaluation and weight calculation, especially in scenarios with stable environments and minimal changes in requirements. These methods can efficiently and concisely complete the evaluation and decision-making of objective weights.
[0062] The most common static methods include entropy weight method, analytic hierarchy process (AHP), and fuzzy comprehensive evaluation method.
[0063] Entropy weighting is a weighting method based on information theory principles, determining weights by measuring the entropy value of each indicator's information. In entropy weighting, the wider the data distribution of an indicator, the greater the amount of information it provides, and thus its weight is higher; conversely, if the data distribution of an indicator is concentrated, it indicates that the amount of information it provides is less, and its weight is lower. The advantage of entropy weighting is its ability to efficiently and automatically calculate weights without relying on expert experience, making it widely used in many practical applications, especially suitable for evaluation problems with relatively independent and stable data. However, entropy weighting cannot adjust weights in real time; it assumes that the weights between objectives are fixed during analysis and assigns weights based on historical data or expert experience. This makes these methods significantly limited in dynamic environments. For example, the target group and task requirements may change over time and with the environment; if these changes cannot be reflected in real time, the evaluation results will lack adaptability.
[0064] The Analytic Hierarchy Process (AHP) is a multi-criteria decision-making method based on expert judgment. It decomposes complex decision problems into multiple levels by constructing a hierarchical structure, comparing each level pairwise to determine the relative importance of each level. AHP is particularly suitable for complex decision problems, especially when there is a hierarchical relationship between objectives or when decision-makers have a degree of subjective judgment. AHP constructs a judgment matrix, calculates eigenvalues and eigenvectors, and ultimately derives the weights of each objective or indicator. However, AHP's drawback lies in its heavy reliance on expert subjective judgment and the high requirement for consistency in judgment. This is especially true when facing a large number of objectives and complex decisions, where judgment bias is prone to occur. Furthermore, expert judgment is often influenced by personal experience, knowledge, and biases, making the weight calculation process highly subjective. Particularly when there are many objectives and complex evaluation criteria, experts may not accurately grasp the relative importance of each objective, thus affecting the objectivity and accuracy of the final evaluation results. Its applicability and reliability are difficult to guarantee in complex and dynamic scenarios.
[0065] Fuzzy comprehensive evaluation is a method that utilizes fuzzy mathematics to handle multi-attribute decision-making problems. It employs fuzzy set theory to address the uncertainty and fuzziness in goal evaluation. By setting membership functions for each goal, fuzzy comprehensive evaluation can calculate weights under conditions of uncertainty or fuzziness, making it particularly suitable for problems with strong subjectivity and fuzziness. Compared to AHP, fuzzy comprehensive evaluation offers more flexible and diverse solutions when facing multi-goal and complex uncertain environments. In dynamic environments, as task objectives and evaluation indicators change, traditional static methods cannot effectively address the dynamism and uncertainty of the environment.
[0066] Therefore, in recent years, many studies have begun to focus on weight evaluation methods based on dynamic data. These methods, by introducing time series analysis, machine learning algorithms, and reinforcement learning, can adjust the weights and evaluation criteria of the target in real time in a dynamically changing environment, thereby improving the adaptability and accuracy of the system.
[0067] Time series analysis methods, such as autoregressive moving average models, long short-term memory networks (LSTM), and gated recurrent units (GRU), are widely used in dynamic target evaluation. Time series models can capture the regularity of data changes over time and analyze the dynamic dependencies between targets. For example, recurrent neural networks such as LSTM and GRU have shown good performance in processing dynamic data with long-term dependencies. These methods are particularly suitable for scenarios where data changes drastically and has time dependencies, such as climate change, stock market forecasting, and dynamic target weight adjustment. However, these methods have high training and computational complexity, requiring a large amount of historical data as input, and the adjustment of model parameters often requires a long training period. Moreover, time series prediction models often cannot effectively capture the complex nonlinear relationships between targets. Models such as LSTM and GRU are good at handling long-term dependencies, but in practical applications, the relationships between targets are not limited to linear changes in time series data; they often involve mutual influence between targets, dynamic changes in the environment, and disturbances from external factors. Therefore, a single time series model has certain limitations in dynamic target weight evaluation, especially when faced with highly complex and variable data and tasks, making it difficult to accurately capture the complex dynamic dependencies between targets.
[0068] Reinforcement learning is another common dynamic approach, particularly well-suited for solving complex dynamic decision-making problems. In reinforcement learning, an agent continuously explores the optimal policy by interacting with the environment to maximize cumulative rewards. Reinforcement learning algorithms such as DDPG (Deep Deterministic Policy Gradient) and A3C (Asynchronous Advantage Actor-Critic) are widely used in dynamic target evaluation and weight calculation problems. These methods can dynamically adjust decision-making policies based on real-time feedback from the environment, thus exhibiting strong adaptability in complex, variable, and uncertain environments. Deep reinforcement learning methods like DDPG have demonstrated good performance in continuous action spaces, effectively solving the problem of dynamic weight adjustment in target group value evaluation. However, the main challenge of reinforcement learning methods lies in the need for a large number of interaction samples during training, and the challenges in convergence and stability during training.
[0069] Machine learning and deep learning methods are playing an increasingly important role in the field of dynamic target evaluation. Through ensemble learning, support vector machines (SVM), and convolutional neural networks (CNN), features can be extracted from large amounts of historical data to dynamically predict target weights. Deep learning methods, in particular, can automatically learn feature representations of data through multi-layered network structures and achieve significant results in tasks with strong nonlinear relationships. These methods can not only adjust target weights in real time in dynamic environments but also simultaneously solve multiple target evaluation problems in a multi-task learning context.
[0070] While deep learning and reinforcement learning methods have demonstrated powerful capabilities in handling high-dimensional and complex problems, they also face challenges such as high training complexity and long training times. Especially in high-dimensional, continuous state and action spaces, reinforcement learning algorithms require vast amounts of interaction data and lengthy training periods to converge. For large-scale applications with high real-time requirements, training efficiency becomes a significant bottleneck. Furthermore, the training process often involves processing large amounts of historical data, which not only increases computational complexity but also demands more powerful computing resources, further limiting the widespread application of these methods.
[0071] Many data-driven methods, such as linear regression and Bayesian networks, while able to learn target weights from data, are sensitive to noise and outliers. Because these methods rely on the statistical properties or probabilistic models of the data, they can introduce significant errors when data quality is poor. For example, in the presence of outliers in the environment, linear regression is easily affected by extreme values, leading to inaccurate weight calculations. Similarly, Bayesian networks are less adept at handling outliers, potentially resulting in incorrect weight allocation and consequently impacting the quality of decision-making.
[0072] Supervised and unsupervised learning techniques are typically highly dependent on training data. If the training data contains specific biases or lacks representativeness, the model's generalization ability will be severely affected. Especially in dynamic scenarios where the target group and task are constantly changing, a well-trained model often fails to perform as expected in new situations, leading to inaccurate evaluation results. Although some methods, such as reinforcement learning, have a certain degree of generalization ability, they usually require repeated training to adapt to new environments, posing a challenge for practical deployment.
[0073] In summary, existing dynamic target weight evaluation methods suffer from drawbacks such as staticity, noise sensitivity, and insufficient ability to capture complex relationships. While they are well-suited for static scenarios, such as single-shot evaluations of unmanned vessel swarms in ports, they struggle to meet the real-time and accuracy requirements of dynamic scenarios (such as maritime swarm warfare). In these scenarios, the indicator data is typically obtained from physical data through quantitative analysis, exhibiting high time sensitivity, and the evaluation process is continuous. Therefore, in practical applications, target weights often need to be dynamically adjusted over time and with environmental changes. However, traditional static methods (such as entropy weighting and analytic hierarchy process) cannot achieve real-time weight updates, demonstrating insufficient adaptability to dynamic scenarios. Furthermore, while data-driven methods (such as linear regression and Bayesian networks) can learn target weights through models, they are highly sensitive to noise and outliers, resulting in poor model stability in complex scenarios. Existing dynamic methods (such as time series models and reinforcement learning methods), although capable of capturing time dependencies and dynamic changes, suffer from high training complexity and low computational efficiency. Especially in high-dimensional data and multi-objective scenarios, these methods struggle to effectively model nonlinear dependencies and complex relationships between objectives. Furthermore, existing methods generally have a strong dependence on training data, limited generalization ability, and are prone to failing to adapt to new environments in practical applications.
[0074] In operational scenarios, unmanned surface vessel (USV) formations need to prioritize members within a target group to maximize their adversarial advantage. However, the formation configuration and individual vessel capabilities constantly change over time, causing related indicators such as deployment location, distance from the formation center, and remaining adversarial capability to fluctuate. Existing dynamic methods (such as time series models and reinforcement learning) can capture time dependencies and dynamic changes, but they suffer from high training complexity and low computational efficiency. Particularly in high-dimensional data and multi-target scenarios, these methods struggle to effectively model nonlinear dependencies and complex relationships between targets. Furthermore, existing methods generally have a strong dependence on training data and limited generalization ability, making them prone to failing to adapt to new environments in practical applications.
[0075] Based on the above analysis, and considering the shortcomings of the existing technology, this application aims to solve the following technical problems:
[0076] 1. Adaptive weight modeling: Enables adaptive adjustment of the weights of each indicator in a multi-indicator system for different scenarios.
[0077] 2. Enhance robustness: Strengthen the ability to tolerate abnormal data and dynamic sample disturbances.
[0078] 3. Enhanced expressive power: More accurately captures the nonlinear dynamic correlations between unmanned vessels and between indicators.
[0079] 4. Reduce training complexity, improve model convergence speed, and achieve efficient and real-time weight evaluation in dynamic scenarios.
[0080] For this purpose, please see Figure 1 and Figure 2 This application provides an intelligent weight prediction method for dynamic scenarios to solve the above problems. The method may specifically include the following steps:
[0081] Step S1: Obtain unmanned surface vessel (USV) data. The USV data is an n×m matrix, where n is the number of USVs in the USV formation, m is the number of indicators, and the matrix elements are the quantitative indicator values of the corresponding USVs on the corresponding indicators.
[0082] Typically, data types present in maritime swarm warfare (unmanned surface vessel formation warfare) scenarios include target deployment location, target type, speed, size, and current state. Based on this, a target evaluation index system is established, including deployment centrality, attributes, maneuverability, payload capacity, and current state.
[0083] Specifically, the quantitative values of various indicators of the unmanned surface vessel (USV) are calculated from actual physical data through quantitative analysis methods. Among them, the deployment centrality is the distance from the USV to the center of the USV formation; the attribute is the type of USV obtained according to fuzzy quantization rules; the maneuverability is the result obtained based on the speed of the USV; the payload capacity is directly proportional to the size of the USV. It is generally believed that the larger the size, the more space there is for the equipment, and the larger the quantitative value of the payload capacity; the current state includes the combat state and the working state, and the corresponding quantitative value is represented by 0 / 1.
[0084] In dynamic scenarios, the quantified values of various indicators will change to some extent as the process progresses. Traditional methods, such as the entropy weight method, only calculate weights based on physical data and cannot take into account the changes in the importance of indicators at different stages of the process. For example, when the unmanned vessel's task is interference, the subjective importance ranking is shown in the table below:
[0085] Sort Indicator Name 1 Current status 2 Load capacity 3 property 4 Deployment Centrality 5 Mobility
[0086] When in a pursuit and capture mission, the order of importance of various indicators of the unmanned surface vessel changes as shown in the table below:
[0087] Sort Indicator Name 1 Mobility 2 Deployment Centrality 3 property 4 Load capacity 5 Current status
[0088] The AHP method calculates weights based on a subjective judgment matrix, which, once set, remains fixed and does not change as the mission progresses. To meet the evaluation calculations under various situations, multiple judgment matrices need to be set, leading to a significant consumption of storage space in the shipboard computer. Furthermore, from the perspective of index values and the final evaluation results, the relationships between multiple physical quantities (such as target size, maneuverability, and load capacity) are no longer simple linear relationships but exhibit complex interdependencies as the environment or state changes.
[0089] The nonlinear relationship between target size and maneuverability: A target's maneuverability is generally related to its size; the larger the target, the smaller its maneuverability (e.g., speed, turning ability). However, this relationship is not linear. The maneuverability of large targets is affected by various factors such as their mass, shape, and propulsion; therefore, as the target size increases, maneuverability may decrease nonlinearly.
[0090] The nonlinear relationship between target size and payload capacity: While target size and payload capacity are typically positively correlated—that is, larger targets carry more equipment—this relationship is not linear. In some cases, after the target size increases to a certain extent, the rate of increase in payload capacity slows down, exhibiting a saturation or accelerating trend.
[0091] The nonlinear relationship between a target's current state and its maneuverability: A target's current state affects its maneuverability. In adversarial situations, targets typically need to improve their maneuverability to perform complex tasks, and this change is often nonlinear. The transition of a target from an operational state to an adversarial state can lead to a sudden change or acceleration in its maneuverability.
[0092] The nonlinear relationship between target maneuverability and payload capacity: The relationship between a target's maneuverability and payload capacity is often mutually restrictive. Generally speaking, the stronger the target's payload capacity, the worse its maneuverability may be, because a larger payload means a larger mass, which in turn leads to a decrease in the target's acceleration and maneuverability. However, this relationship is usually nonlinear; there is no simple inverse relationship between payload capacity and maneuverability.
[0093] Nonlinear dynamic correlations reflect the complex and non-intuitive relationships between multiple physical quantities, especially when physical quantities such as the target's size, maneuverability, and load capacity change, the relationships between these physical quantities are not simple linear changes. Since the training data consists of an index matrix and target evaluation results, traditional CNN networks transform input features into outputs through a series of linear transformations (i.e., matrix multiplication). In the computation of each layer, features are linearly combined according to weights, failing to directly capture the complex and nonlinear relationships between features. The attention mechanism in this application dynamically determines which features are more important for the final decision by assigning different weights to different input features.
[0094] Step S2: Obtain the index vector of each unmanned vessel based on the unmanned vessel data.
[0095] Specifically, the unmanned vessel data is input into the embedding layer and linearly transformed to obtain indicator vectors for each preset dimension.
[0096] After the unmanned surface vessel (USV) data is sent to the embedding layer, each USV data... i represents the i-th unmanned vessel. A linear transformation is used for embedding to obtain an index vector of a predetermined dimension:
[0097] X embed =Liner embed (X)=XW e +b e
[0098] is the indicator vector, where N is the number of unmanned vessel data sets and d is the preset dimension after embedding.
[0099] Step S3: Input each index vector into the local attention network to obtain the corresponding first attention weights.
[0100] Specifically, step S31 is executed first, in which the index vector is input into the local attention network and reconstructed into the first attention subsequence of the unmanned vessel; the first attention subsequence includes the first query vector, the first key vector and the first value vector.
[0101] In the above process, each unmanned vessel is treated as a local subgraph:
[0102]
[0103] Among them, Q (l) K is the first query vector. (l) V is the first key vector. (l) For the first value vector, These are learnable parameters.
[0104] Then, step S32 is executed to obtain the first attention weight of the unmanned ship based on the first attention subsequence.
[0105] Specifically, the weighted calculation of the local first attention weights includes:
[0106] Step S321: Transpose the first key vector and multiply it with the first query vector to obtain the target vector.
[0107] Step S322: Divide the target vector by the square root of the preset dimension to obtain the first attention score.
[0108] Step S323: Input the first attention score into the softmax function to obtain the first attention weight.
[0109] The formula is expressed as:
[0110]
[0111] Among them, A (l) This is the first attention weight.
[0112] Step S4: Calculate the corresponding local attention aggregation result based on each first attention weight.
[0113] Specifically, the first attention weight and the first value vector are multiplied to obtain the corresponding local attention aggregation result.
[0114]
[0115] Among them, Z (l) This is the result of local attention aggregation.
[0116] Z (l) This represents the embedded representation of a single unmanned vessel after attention is aggregated within its own metrics.
[0117] Step S5: Input the aggregation results of each local attention into the global attention network to obtain the corresponding second attention weights. Specifically, the aggregation results Z of the local attention are... (l) As a global input, the collaborative relationships between unmanned vessels are further modeled:
[0118]
[0119] Obtain the second attention subsequence
[0120] Then, the second attention weight A is calculated based on the second attention subsequence. (g) :
[0121]
[0122] Step S6: Calculate the corresponding global attention output based on each second attention weight.
[0123]
[0124] Specifically, the global attention output Z (g) The calculation method is similar to that of local attention.
[0125] Step S7: Concatenate the outputs of each global attention to obtain the output head vector.
[0126] Specifically, the `concat` function can be used to concatenate the outputs of each global attention function to obtain the output head vector:
[0127] Z = concat(Z1, Z2, ..., Z) n )
[0128] Where Z is the output head vector, Z1, Z2, ..., Z n Output the results for each global attention.
[0129] Step S8: Input the output head vector into the fully connected feedforward layer to obtain the weight prediction results; wherein, the weight prediction results include the prediction weights of each unmanned vessel for each indicator.
[0130] Specifically, the fully connected feedforward layer in this application performs further nonlinear transformations and combinations on the features processed by the hierarchical attention mechanism, i.e., the output head vector Z, to generate the final output:
[0131] H1=ZW1+b1
[0132] H2 = ReLU(H1W2 + b2)
[0133]
[0134] Among them, W o W1 and W2 are the linear transformation parameters of the feedforward network, b o b1 and b2 represent bias vectors, which work together to complete a linear transformation. The specific parameters are implemented by the network itself. The shape is defined when the network is built, and then initial values are given through random initialization or other initialization methods. During training, the backpropagation algorithm continuously updates the values. The final output represents the overall weight vector of m indicators, where each element represents the relative importance of an indicator.
[0135] The intelligent weight prediction method for dynamic scenarios provided in the above embodiments exhibits good robustness and adaptability when handling dynamic inputs of multiple indicators. It can quickly and stably complete weight estimation, fully meeting the real-time and accuracy requirements of dynamic scenarios such as unmanned vessel control. Moreover, the hierarchical attention mechanism network used in this application has high prediction accuracy, with an average error not exceeding 10⁻³ and a standard deviation fluctuation not exceeding 3 × 10⁻³. The accuracy is stable, and the single inference time is basically stable at around 1 millisecond with minimal fluctuation, demonstrating good temporal consistency. This indicates that while maintaining high prediction accuracy, this application has good computational efficiency and real-time performance, meeting the needs of dynamic weight evaluation scenarios with high response speed requirements. In scenarios that require frequent real-time updates of weight distribution, this application can significantly reduce computational latency.
[0136] In some embodiments, the loss function of the intelligent weight prediction method is the mean absolute percentage error function.
[0137] The Mean Absolute Percentage Error (MAPE) function is:
[0138]
[0139] Specifically, the above model (i.e., the model architecture consisting of hierarchical attention mechanism and fully connected feedforward layer) uses the mean absolute percentage error (MAPE) as the loss function for parameter updates during training.
[0140] In some embodiments, the local attention network, global attention network, and fully connected feedforward layer used in the above algorithm employ stochastic gradient descent to adjust network parameters during training.
[0141] Specifically, by using the stochastic gradient descent (SGD) algorithm to adjust the parameters, the loss function can be minimized.
[0142]
[0143] Where θ is the network parameter, including the weight matrix and bias vector, and α is the model's learning rate.
[0144] To address the problem that traditional methods (such as entropy weighting and AHP) typically have fixed weights that are difficult to adapt to real-time changes in dynamic environments, this application uses a hierarchical attention mechanism to accurately and dynamically adjust the weights of the target based on real-time changes in input features. This significantly improves the model's adaptability to rapidly changing environments and is particularly suitable for complex tasks and multi-objective scenarios.
[0145] Traditional methods for dynamic adjustment require significant storage space. For example, the AHP method requires a judgment matrix to provide a basic reference for weight calculation, but each judgment matrix can only correspond to one case. In the offline training of the model in this application, all weight vectors obtained based on the judgment matrix are used as input data for feature learning. After the model is trained, no other input is needed to complete the prediction of the weight vector based solely on the index matrix.
[0146] Most methods (such as linear regression and Bayesian networks) assume that the relationships between features are linear or simply independent, making it difficult to handle complex nonlinear relationships between targets. This application, through a combination of hierarchical attention mechanisms and fully connected layers, can capture the nonlinear relationships between targets and generate accurate weight distributions, thereby improving the accuracy of multi-target evaluation.
[0147] The following is a data simulation verification process for an intelligent weight prediction method for dynamic scenarios proposed in this application:
[0148] Experimental data: Assume there is an unmanned vessel formation in a certain sea area, with 11 unmanned vessels. After data processing and abstract feature extraction, 5 indicators are obtained. Each indicator is quantified and preprocessed to determine the unmanned vessel data.
[0149] The design yielded 2000 sets of unmanned surface vessel (USV) data, with each set containing 11 USVs and 5 metric values. The data was randomly divided into a training set and a test set in an 8:2 ratio. The number of attention heads was set to the product of the number of targets and the number of metrics, which is 55.
[0150] To ensure comprehensive data coverage, the indicator data used during training was randomly generated and normalized according to the indicators. The indicator weights were determined by cross-coupling of the entropy weight method and the analytic hierarchy process (AHP). Five situational scenarios were proposed for testing, and five AHP criterion layer judgment matrices were determined as follows (where indicators 1-5 represent deployment centrality, attributes, mobility, load capacity, and current state, respectively).
[0151] Table 1 Judgment Matrix for Case 1
[0152]
[0153] Table 2 Judgment Matrix for Scenario 2
[0154]
[0155] Table 3 Judgment Matrix for Case 3
[0156]
[0157] Table 4 Judgment Matrix for Case 4
[0158]
[0159] Table 5 Judgment Matrix for Situation 5
[0160]
[0161] The final weight value is:
[0162] ω=0.5×ω ent +0.5×ω AHP
[0163] Where ω is the final weight prediction result obtained from the prediction, i.e., the index matrix X. i The label Y i .
[0164] Please see Figure 3 The error distribution obtained by the prediction method on the test set shows that the hierarchical attention mechanism network can effectively capture the correlation between indicators within a single unmanned vessel indicator and the implicit coupling within the entire target group, and further obtain accurate weight prediction values. It has shown good adaptive ability in the process of changing various situational conditions. The data obtained after statistical analysis of the errors of each indicator are shown in Table 6.
[0165] Table 6. Test Set Error Statistics
[0166] <![CDATA[Average error (10 -3 )]]> <![CDATA[Standard deviation (10 -3 )]]> 1 0.6 1.0 2 0.7 0.5 3 0.2 1.3 4 0.3 3.0 5 0.2 1.6
[0167] The test set results show that the model exhibits good robustness and adaptability when dealing with dynamic inputs of multiple indicators, and can quickly and stably complete weight estimation, fully meeting the requirements for real-time performance and accuracy in dynamic scenarios.
[0168] The hierarchical attention mechanism network demonstrates high and stable prediction accuracy. Statistical analysis of the model's prediction time on the test set yields the following results: Figure 4 As shown.
[0169] Statistical results from the test set show that the single inference time remains relatively stable at around 1 millisecond, with minimal fluctuations, demonstrating good time consistency. This indicates that the entire prediction model maintains high prediction accuracy while possessing good computational efficiency and real-time performance, meeting the needs of dynamic evaluation scenarios with high responsiveness requirements. In applications requiring frequent real-time updates to weight distribution, this model can significantly reduce computational latency, demonstrating its practical value in engineering deployments.
[0170] Furthermore, assuming a scenario where the situation is constantly changing, a predictive model is used to predict indicator weights at multiple time points within that scenario, yielding results such as... Figure 5As shown. This allows us to verify the conclusion:
[0171] The intelligent weight prediction method based on a hierarchical attention mechanism proposed in this application enables rapid and accurate evaluation of multi-objective weights in dynamic scenarios, exhibiting significant advantages such as high efficiency, robustness, and adaptability. This method utilizes a hierarchical modeling structure to progressively extract and aggregate multi-level feature information from the bottom up. This allows the model to dynamically adjust the attention distribution based on the state of different input samples, achieving self-adaptation in weight calculation and effectively addressing the nonlinear changes in the relationship between the state and indicators of unmanned vessels as the environment changes. Without relying on a large amount of prior knowledge storage, the prediction model achieves broad generalization by learning the inherent patterns in the data, demonstrating strong model transfer and environmental adaptability. Simultaneously, the attention mechanism possesses excellent parallel computing characteristics, enabling the prediction model to maintain high accuracy while significantly improving inference speed, meeting the real-time requirements of application scenarios. Overall, this method demonstrates superior response speed and prediction accuracy in complex, dynamic tasks with multiple objectives and indicators, providing strong support for achieving efficient and intelligent weight evaluation.
[0172] Please see Figure 6 Another embodiment of this application provides an intelligent weight prediction device for dynamic scenarios, comprising:
[0173] The acquisition module 101 is used to acquire unmanned surface vessel (USV) data. The USV data is an n×m matrix, where n is the number of USVs in the USV formation, m is the number of indicators, and the matrix elements are the quantitative indicator values of the corresponding USVs on the corresponding indicators.
[0174] The embedded module 102 is used to obtain the index vector of each unmanned vessel based on the unmanned vessel data.
[0175] The first reconstruction module 103 is used to input each index vector into the local attention network to obtain the corresponding first attention weights.
[0176] The local aggregation module 104 is used to calculate the corresponding local attention aggregation result based on each first attention weight.
[0177] The second reconstruction module 105 is used to input the aggregation results of each local attention into the global attention network to obtain the corresponding second attention weights.
[0178] The global output module 106 is used to calculate the corresponding global attention output result based on each second attention weight.
[0179] The concatenation module 107 is used to concatenate the output results of each global attention to obtain the output head vector.
[0180] The prediction module 108 is used to input the output head vector into the fully connected feedforward layer to obtain the weight prediction results; wherein, the weight prediction results include the prediction weights of each unmanned vessel for each indicator.
[0181] Furthermore, the aforementioned embedded module 102 is specifically used for:
[0182] The unmanned vessel data is input into the embedding layer and linearly transformed to obtain index vectors for each preset dimension.
[0183] Furthermore, the aforementioned first reconstruction module 103 includes a vector calculation unit and a weight calculation unit.
[0184] The vector computation unit is used to input the index vector into the local attention network and reconstruct it into the first attention subsequence of the unmanned vessel; the first attention subsequence includes the first query vector, the first key vector, and the first value vector.
[0185] The weight calculation unit is used to obtain the first attention weight of the unmanned vessel based on the first attention subsequence.
[0186] Furthermore, the weight calculation unit is specifically used to transpose the first key vector and multiply it with the first query vector to obtain the target vector; divide the target vector by the square root of the preset dimension to obtain the first attention score; and input the first attention score into the softmax function to obtain the first attention weight.
[0187] The specific limitations of the intelligent weight prediction device for dynamic scenes provided in this embodiment can be found in the embodiment of the intelligent weight prediction method for dynamic scenes described above, and will not be repeated here. Each module in the aforementioned intelligent weight prediction device for dynamic scenes can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0188] This application provides a computer device that may include a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it causes the processor to perform the steps of an intelligent weight prediction method for dynamic scenes as described in any of the above embodiments. The working process, details, and technical effects of the computer device provided in this embodiment can be found in the above embodiments regarding an intelligent weight prediction method for dynamic scenes, and will not be repeated here.
[0189] This application provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the steps of an intelligent weight prediction method for dynamic scenarios as described in any of the above embodiments. The computer-readable storage medium refers to a data storage carrier, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The working process, details, and technical effects of the computer-readable storage medium provided in this embodiment can be found in the embodiments of an intelligent weight prediction method for dynamic scenarios described above, and will not be repeated here.
[0190] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0191] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0192] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A dynamic scene oriented intelligent weight prediction method, characterized in that, The method comprises the following steps: obtaining unmanned ship data; the unmanned ship data is an n*m matrix, n is the number of unmanned ships in the unmanned ship formation, m is the number of indexes, and the matrix element is the quantitative index value of the corresponding unmanned ship on the corresponding index; obtaining an index vector of each unmanned ship according to the unmanned ship data; inputting each index vector into a local attention network to obtain a corresponding first attention weight; calculating a corresponding local attention aggregation result according to each first attention weight; inputting each local attention aggregation result into a global attention network to obtain a corresponding second attention weight; calculating a corresponding global attention output result according to each second attention weight; splicing each global attention output result to obtain an output head vector; inputting the output head vector into a fully connected feedforward layer to obtain a weight prediction result; wherein the weight prediction result comprises a predicted weight of each unmanned ship for each index; wherein the indexes of the unmanned ship include deployment centrality, attribute, maneuvering capability, load capacity, and current state; the deployment centrality is the distance from the unmanned ship to the center position of the unmanned ship formation; the attribute is the result obtained according to the fuzzy quantization rule of the type of the unmanned ship; the maneuvering capability is the result obtained based on the speed of the unmanned ship; the load capacity is in a positive correlation with the size of the unmanned ship; and the current state includes an antagonistic state and a working state.
2. The method of claim 1, wherein, The method comprises the following steps: inputting the unmanned ship data into an embedding layer to perform linear transformation and obtain the index vector of each preset dimension.
3. The method of claim 2, wherein, The method comprises the following steps: inputting the index vector into the local attention network to reconstruct a first attention subsequence of the unmanned ship; the first attention subsequence comprises a first query vector, a first key vector, and a first value vector; obtaining the first attention weight of the unmanned ship based on the first attention subsequence.
4. The method of claim 3, wherein, The method comprises the following steps: multiplying the first key vector after transposition and the first query vector to obtain a target vector; dividing the target vector by the square root of the preset dimension to obtain a first attention score; inputting the first attention score into a softmax function to obtain the first attention weight.
5. The method of claim 4, wherein, The method comprises the following steps: multiplying the first attention weight and the first value vector to obtain the corresponding local attention aggregation result.
6. The method of claim 1, wherein, The method comprises the following steps: splicing each global attention output result by using a concat function to obtain the output head vector.
7. The method of claim 1, wherein, The loss function of the intelligent weight prediction method is an average absolute percentage error function.
8. The method of claim 1, wherein, The local attention network, the global attention network, and the fully connected feedforward layer use a stochastic gradient descent algorithm to adjust network parameters.
Citation Information
Patent Citations
Feature pyramid time sequence prediction method based on cross attention
CN119917809A
Vehicle trajectory prediction method based on physical social soft attention Transformer
CN120145000A