Unmanned surface vehicle path planning method and system based on semantic grouping self-attention

By dividing the state vector into semantic groups and performing self-attention calculation, the problem of semantic information preservation and dynamic coupling modeling in path planning of unmanned surface vessels in complex marine environments is solved, thereby improving the real-time performance and stability of the planning.

CN123175294APending Publication Date: 2026-11-27SHANGHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611708972.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-11-02
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing unmanned surface vessel path planning methods struggle to maintain state semantic identity in complex and dynamic marine environments, dynamically model the coupling relationships between variables, and easily lose original information during processing, resulting in insufficient real-time performance and stability of planning decisions.

Method used

A path planning method based on semantic grouping self-attention is adopted, which divides the state vector into multiple semantic groups and forms state tokens by sharing linear projection and type embedding. Scaling dot product self-attention calculation is performed to preserve the original information path, and decision is made through a Dueling action value estimation network.

Benefits of technology

It improves the path planning performance of unmanned surface vessels in complex sea conditions, maintains state semantic identity, dynamically models the coupling relationship between variables, and improves the real-time performance and stability of planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123175294A_ABST
    Figure CN123175294A_ABST
Patent Text Reader

Abstract

The application discloses a semantic grouping self-attention-based unmanned surface vehicle path planning method and system, and belongs to the technical field of unmanned surface vehicle autonomous navigation and intelligent path planning. The method comprises the following steps: constructing a state vector; dividing semantic groups according to physical meanings; performing shared projection on the state scalar and adding type embedding to form a state token; obtaining interactive representation through state dimension self-attention; inputting the interactive representation into an action value estimation network after the interactive representation is flattened and spliced with the original state vector to obtain an action value; selecting an action according to the action value, updating the position of the vehicle in combination with wind flow drift and boundary constraints, and cyclically outputting a navigation action sequence and a planned path. The system comprises the following modules: an environment state acquisition module, a state construction and semantic grouping module, a shared projection and type coding module, a state dimension self-attention module, a feature fusion module, an action value estimation module, and an action selection and path updating module. The application can maintain semantic identity, model coupling between variables and preserve information channels, and can improve the path planning effect under complex sea conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous navigation and intelligent path planning technology for unmanned surface vessels, specifically to a path planning method and system for unmanned surface vessels based on semantic grouping self-attention. Background Technology

[0002] In missions such as marine environmental monitoring, maritime search and rescue, and environmental surveys, unmanned surface vessels (USVs) need to continuously generate safe and feasible navigation maneuvers and routes in complex waters where wind fields, ocean currents, and obstacles interact, based on target location, navigable areas, and real-time environmental information. Path planning technology is one of the fundamental capabilities of USVs to autonomously complete various tasks.

[0003] Early commonly used path planning methods, such as Algorithms such as RRT typically require the pre-establishment of an environmental map or cost function and rely on a relatively well-defined environmental model. When wind fields, ocean currents, or obstacle distributions change, these methods often need to rebuild the map or re-search for a path, affecting real-time performance and environmental adaptability, making it difficult to meet the autonomous navigation requirements of unmanned surface vessels in dynamic marine environments.

[0004] With the development of deep reinforcement learning technology, researchers are attempting to enable unmanned surface vessels (USVs) to interact with their environment and learn the mapping relationship between environmental states and navigation actions, thereby achieving path planning and autonomous obstacle avoidance in partially unknown or dynamically changing environments. These methods typically transform observation information from different sources into state vectors, which are then input into neural networks for action value estimation or policy learning. However, existing deep reinforcement learning-based USV path planning schemes still have some shortcomings in terms of state representation and information fusion.

[0005] First, unmanned surface vessels (USVs) need to simultaneously process position information, target information, wind direction and speed information, ocean current information, obstacle distribution information, and historical visit information during navigation, all of which have significantly different physical meanings and dimensions. Most existing methods directly flatten and concatenate these heterogeneous state variables into a unified vector before inputting it into a fully connected or convolutional network for processing. This approach easily weakens the physical semantic identity of different variables during multi-layered nonlinear transformations, making it difficult for the network to distinguish which information comes from the navigation target and which comes from the wind field or ocean current, thus affecting the rationality of planning decisions.

[0006] Secondly, the navigation of unmanned surface vessels is influenced by a variety of environmental factors, such as wind, ocean currents, and obstacles, and the coupling relationships between these factors change dynamically with the current state. Fixed-weight fully connected structures or static feature fusion methods are insufficient to express these state-changing interactions between variables, resulting in insufficient adaptability of the model when the environment is complex or changes rapidly.

[0007] Furthermore, some solutions attempt to introduce attention mechanisms to enhance feature interactions, but relying solely on attention transformation may cause the original observation information to attenuate during multi-layered nonlinear processing and attention computation, leaving the backend value network without a fundamental pathway to directly utilize the original state. When the original information is lost or distorted during the transformation process, the accuracy of action value estimation may decrease.

[0008] Furthermore, existing methods typically process state encoding, feature fusion, action value estimation, and position updating separately, failing to integrate physical semantic identity preservation, interaction modeling between state variables, faithful transmission of original information, and reasonable decomposition of action value into a unified closed-loop planning structure. Therefore, in complex marine environments coupled with wind, currents, and obstacles, existing unmanned surface vessel path planning methods still have room for improvement in terms of semantic information preservation, dynamic coupling modeling, and decision stability.

[0009] Therefore, it is essential to design a path planning method and system for unmanned surface vessels based on semantic grouping self-attention. Summary of the Invention

[0010] The purpose of this invention is to provide a path planning method and system for unmanned surface vessels based on semantic grouping self-attention, which can dynamically model the coupling relationship between variables and retain the original information path while maintaining the state semantic identity, thus improving the path planning effect under complex sea conditions.

[0011] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A path planning method for unmanned surface vessels based on semantic grouping self-attention includes: S1: Obtain the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and construct a state vector, where each state vector includes multiple components, i.e., state variables; S2: Divide the state vector into multiple semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs; S3: Perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity; S4: Construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and perform residual connection, layer normalization and feedforward transformation in sequence to obtain interactive representation; S5: Flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain the fused feature; S6: Input the fused features into the action value estimation network to obtain the state value and the action advantage of each candidate action, and calculate the action value of each candidate action. S7: Select the current navigation action based on the action value of each candidate action; S8: Superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, perform position constraints based on the navigable area boundary and obstacle constraints, and update the position of the unmanned surface vessel. S9: If the target position is reached or the termination condition is met, output the navigation action sequence and the planned path; otherwise, return to S1 to form a closed-loop decision.

[0012] Furthermore, in S2, the semantic group includes a navigation group, an environmental dynamics group, a security group, an access history group, and a drift risk group; The navigation group includes state variables corresponding to the current position and the target position; the environmental dynamics group includes state variables corresponding to the wind vector and the current vector; the safety group includes state variables corresponding to the relative coordinates of the nearest obstacle, the normalized distance, the current position occupancy marker, and the eight-neighbor occupancy marker; the access history group includes state variables corresponding to the eight-neighbor access marker; and the drift risk group includes drift risk state variables calculated based on the alignment of the combined drift with the obstacle direction.

[0013] Furthermore, in S3, the shared linear projection applies the same weight matrix and bias vector to each state scalar; The type embeddings are learnable vectors, read from the type embedding matrix by group identifiers.

[0014] Furthermore, in S4, a query matrix, key matrix, and value matrix are constructed based on the state token. Scaling dot product self-attention is performed along the state variable dimension, followed by residual connections, layer normalization, and feedforward transformation to obtain the interactive representation, specifically: Linearly map the state tokens to a query matrix, a key matrix, and a value matrix; Calculate the attention weight matrix based on the query matrix and the key matrix; The attention output is obtained by weighted summation of the value matrix based on the attention weight matrix. The residual connection, layer normalization, and feedforward transformation are performed in the order of first residual normalization, token-by-token feedforward network, and second residual normalization.

[0015] Furthermore, in S6, the action value estimation network is a Dueling network, which includes a shared hidden layer, a state value stream, and an action advantage stream; The fused features, after being processed by the shared hidden layer, are respectively entered into the state value stream and the action advantage stream; The state value stream outputs the state value, and the action advantage stream outputs the action advantage of each candidate action. The action value of each candidate action is obtained by adding the state value to the centralized action advantage.

[0016] Furthermore, in S8, the position constraint is at least one of boundary clipping, immobile action shielding, or collision-induced state rollback.

[0017] This invention also provides an unmanned surface vessel path planning system based on semantic grouping self-attention, applied to the aforementioned unmanned surface vessel path planning method based on semantic grouping self-attention, comprising: The environmental status acquisition module is used to acquire the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and provide observation data to the state construction and semantic grouping module; The state construction and semantic grouping module is used to construct state vectors based on observation data, divide the state vectors into at least two semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs. The shared scalar projection and type encoding module is used to perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity. The state dimension self-attention module is used to construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and sequentially perform residual connection, layer normalization and feedforward transformation to obtain interactive representation; The feature fusion module is used to flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain fused features; The action value estimation module is used to obtain the state value and action advantage of each candidate action based on the fusion features, and to calculate the action value of each candidate action. The action selection and path update module is used to select the current navigation action based on the action value of each candidate action, superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, update the position of the unmanned surface vessel according to the navigable area boundary and obstacle constraints, and output the navigation action sequence and planned path when the termination condition is met.

[0018] Furthermore, the state-dimensional self-attention module includes: A linear mapping unit is used to linearly map state tokens into a query matrix, a key matrix, and a value matrix; The attention calculation unit is used to calculate the attention weight matrix based on the query matrix and the key matrix, and to perform a weighted summation of the value matrix based on the attention weight matrix to obtain the attention output; The feedforward transformation unit is used to sequentially perform first residual normalization, token-by-token feedforward network, and second residual normalization on the attention output.

[0019] In summary, the present invention has at least one of the following beneficial technical effects: First, this invention divides the state vector into multiple semantic groups based on the physical meaning of the state variables and configures a type embedding corresponding to the semantic group for each state scalar. This enables the preservation of the source identity of different state variables during shared projection and subsequent feature transformation. This process makes wind field information, ocean current information, obstacle safety information, navigation information, and access history information less likely to be confused in subsequent network calculations, thus improving the clarity of state representation and the rationality of planning.

[0020] Second, this invention performs self-attention computation at the state variable dimension, enabling all state tokens to dynamically calculate correlation weights based on the current input, thereby modeling the input-related coupling relationships between wind, ocean currents, obstacles, navigation variables, and historical variables. Compared to methods using fixed weights or static fusion parameters, the interactive representation of this invention can adaptively adjust with changes in environmental state, which is beneficial for improving the adaptability of unmanned surface vessels in complex and dynamic marine environments.

[0021] Third, this invention sets up skip connection branches in the original state vector, concatenating the interaction representation with the original state vector before attention transformation, and then inputting them together into the action value estimation network. This not only utilizes the coupled interaction features obtained from self-attention computation, but also preserves a direct access path for basic observation information for the backend value estimation network, reducing the risk of original information attenuation caused by multi-layer nonlinear transformations or attention computation, and helping to improve the stability and reliability of action value estimation.

[0022] Fourth, this invention employs a Dueling action value estimation structure to separate the state value stream from the action advantage stream, and calculates the action value of each candidate action after centralizing the action advantage. This structure can more reasonably distinguish the overall value of the current state and the relative merits of different actions, making action selection more accurate and facilitating the generation of safe and effective discrete navigation actions.

[0023] Fifth, this invention organizes semantic grouping, type encoding, state-dimensional self-attention, original state jump fusion, Dueling action value decomposition, and wind drift constraint position update into a closed-loop decision-making step chain, which can continuously output the unmanned surface vessel's navigation action sequence and planned path. This closed-loop structure has good deployability and engineering applicability. In practical applications, online path planning can be performed using fixed network parameters to output navigation action commands or path point sequences for the unmanned surface vessel. Attached Figure Description

[0024] Figure 1 This is a block diagram of the system structure of the present invention.

[0025] Figure 2 This is a diagram showing the relationship between the SGS-DQN network structure and tensor transfer.

[0026] Figure 3 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0028] like Figure 3 As shown, this invention provides a path planning method for unmanned surface vessels based on semantic grouping self-attention, comprising: S1: Obtain the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and construct a state vector, where each state vector includes multiple components, i.e., state variables; S2: Divide the state vector into multiple semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs; S3: Perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity; S4: Construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and perform residual connection, layer normalization and feedforward transformation in sequence to obtain interactive representation; S5: Flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain the fused feature; S6: Input the fused features into the action value estimation network to obtain the state value and action advantage of each candidate action, and calculate the action value (Q value) of each candidate action. S7: Select the current navigation action based on the action value of each candidate action; S8: Superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, perform position constraints based on the navigable area boundary and obstacle constraints, and update the position of the unmanned surface vessel. S9: If the target position is reached or the termination condition is met, output the navigation action sequence and the planned path; otherwise, return to S1 to form a closed-loop decision.

[0029] Next, we will elaborate on this in detail.

[0030] In S1, the current position, target position, wind field, ocean current, obstacle set, and visit history of the unmanned surface vessel are obtained, and a state vector is constructed, specifically as follows: The environmental status acquisition module at any time The system reads the current position, target location, wind field, ocean current, obstacle set, and access history of the unmanned surface vessel. The current position is obtained from positioning equipment; wind field and ocean current can be measured in real time by onboard anemometers and current meters, or data can be received from shore-based, buoy-based, or numerical weather prediction systems via a communication interface; obstacle occupancy grids are obtained by mapping radar or visual perception results. The system operates on a decision-making cycle. To update the cycle, the latest valid values ​​from each data source are read once at the beginning of each decision cycle; when using shipborne sensors, their sampling frequency is no less than the decision frequency. When multiple sampled values ​​exist within the same period, the periodic average or the most recent valid value at the decision time is used.

[0031] When wind speed and flow velocity are given in m / s, they are first transformed from the sensor coordinate system to the map coordinate system, and then converted to the same grid / step displacement scale as discrete motion. The conversion relationship is as follows: ; In the formula, For decision step number; , These are the actual lengths of individual grid cells, one horizontal and one vertical, respectively, in meters per cell. Indicates , A second-order diagonal matrix with elements on the main diagonal and all other elements being zero. This is the inverse of the matrix, and its function is to convert the actual displacement into grid displacement. The actual time interval between two consecutive decisions, in seconds per step; , They are time points The wind-induced equivalent drift velocity vector and the flow-induced equivalent drift velocity vector, expressed in meters per second, are both two-dimensional column vectors; This is the rotation matrix from the input coordinate system to the map coordinate system. It is dimensionless; if the input is already represented in the map coordinate system, it is the identity matrix. Both types of inputs use the same coordinate system and therefore share the same... If the source coordinate systems are different, convert them to the map coordinate system first. , These are the final two-dimensional wind drift and current drift vectors used for boat position updates, both in units of grids per step. (Superscript) , Distinguish between wind-induced and flow-induced inputs, and use subscripts. The decision-making moments are not exponentiation operations.

[0032] The above conversion uses the linear drift approximation of this embodiment: first, the equivalent drift velocity is rotated to the map coordinate system, then multiplied by the decision time interval to obtain the actual displacement, and finally converted according to the grid length. The air speed measured by the actual boat anemometer should first be used to obtain the wind-induced equivalent drift velocity according to the wind-induced drift calibration relationship of the boat type, and then used for the above displacement conversion. The simulation embodiment is generated directly per grid / step. and No meter / second conversion is required.

[0033] In this embodiment, variables are normalized according to their physical meaning: position coordinates divided by map width or height fall within the [0, 1] interval; target relative coordinates and direction components fall within the [-1, 1] interval; distance divided by map scale falls within the [0, 1] interval; the absolute upper limit of each step displacement for wind and current is set to 1 grid / step and clipped to the [-1, 1] interval. Obstacle set The elements are the two-dimensional coordinates of the occupied raster. , Access history collection The elements are from the initial time to time. Two-dimensional grid coordinates that have been reached ( , The number of repeated visits can be saved separately. When constructing the state, only it is determined whether the corresponding coordinates have been visited at least once. Out-of-bounds neighborhoods are treated as occupied and visited. Both the obstacle occupancy flag and the access flag are represented by 0 or 1.

[0034] In S2, the state vector is divided into multiple semantic groups according to the physical meaning of the state variables, and a group identifier for each semantic group to which each state variable belongs is generated, specifically as follows: The state construction and semantic grouping module normalizes observations from different sources and calculates state variables. Based on physical meaning, it divides the state vectors into five semantic groups: navigation, environmental dynamics, security, access history, and drift risk. In one embodiment, the 36-dimensional state is divided into 4, 4, 12, 8, and 8 dimensions; this dimension is used for illustration and does not limit the scope of protection.

[0035] The state construction process is as follows: navigation group Includes state variables corresponding to the current vessel position and the target position; environmental dynamics group It includes the state variables corresponding to the wind vector and the flow vector. Let the eight-neighbor direction set be... The nearest obstacle is Find the obstacle point with the smallest Euclidean distance from the current position, and normalize its distance to . In the formula, =( , (a collection of obstacles) In and at the current position The grid cell with the minimum Euclidean distance. For the ... Define obstacle occupancy markers in each neighborhood direction. and access tags .

[0036] In the formula, This is the current decision step number; , They are time points The horizontal and vertical grid coordinates, , These are the horizontal and vertical grid coordinates of the target point, respectively. and These are the grid width and grid height of the map, respectively. These are the horizontal and vertical components of the wind drift vector. These are the horizontal and vertical components of the flow drift vector. For the set of eight neighboring directions, The direction index is the neighborhood number. ; Take (0, -1), (1, 0), (0, 1), (-1, 0), (1, -1), (1, 1), (-1, 1), and (-1, -1) in the fixed order of top, right, bottom, left, top right, bottom right, bottom left, and top left respectively.

[0037] In the above distance formula, This represents the L2 norm of a vector, also known as its Euclidean length. For example, for a two-dimensional vector... Its second norm is ;therefore The distance between the nearest obstacle and the current position is the Euclidean distance. This is the diagonal scale of the map used for normalization. Indicates the membership relationship of a set. The indicated function takes the value 1 if the condition within the parentheses is true, and 0 otherwise; the superscript in the formula... Only the selected nearest obstacle is marked; multiplication or conjugation is not indicated.

[0038] The safety group consists of the normalized relative coordinates of the nearest obstacle, the normalized distance, the current location occupancy marker, and the eight neighboring area occupancy markers, namely: ; In the formula, Current position of the vessel. The coordinates of the grid cell occupied by the nearest obstacle; , These are the horizontal and vertical coordinates of the obstacle grid, respectively, with superscripts indicating their positions. Used to mark obstacles, subscript This indicates that the nearest obstacle selected based on the current boat position can change over time; = -x t , = -y t These represent the differences in lateral and longitudinal coordinates between the nearest obstacle and the current boat position, respectively. It is the normalized distance, calculated by dividing the distance to the nearest obstacle by the length of the map's diagonal.

[0039] This is the occupancy marker for the current position. The 0 in the superscript brackets is the number zero, used to distinguish the current position from the eight neighboring directions. For the first Occupancy markers for neighboring grid cells When the corresponding grid cell belongs to an obstacle set, a land area, or is outside the navigable area boundary, the corresponding occupancy flag is set to 1; otherwise, it is set to 0. and All are dimensionless binary quantities. This indicates that the security group consists of 12 real number components.

[0040] The access history group is: ; In the formula, For the first Access markers for neighboring grids; when Belongs to the access history collection Or when exceeding the navigable zone boundary, ,otherwise The history group is accessed by grouping in the direction of the eight neighboring domains. Arranged in the same fixed order.

[0041] Drift risk group based on drift The calculation of alignment with the obstacle direction can be represented in one embodiment as follows: ; In the formula, The resultant drift vector; For the first The drift risk component in each neighborhood direction is determined by the occupancy marker. Combined drift direction and neighborhood direction The product of the non-negative parts of the cosine similarity is obtained by multiplying the values ​​of the two cosine similarities, and the values ​​are located in the range of Interval; when the first When the neighborhood is not occupied . This represents the dot product of two vectors. This means truncating negative values ​​to zero.

[0042] in Small positive quantities are set to prevent the denominator from being zero. These are then connected in a fixed order to form a state vector. It also synchronously outputs the group identifier sequence corresponding to each dimension of the state. Therefore, the output of the state construction and semantic grouping module is "state vector + group identifier sequence", which are jointly passed to the shared scalar projection and type encoding module.

[0043] In S3, a shared linear projection is performed on each state scalar in the state vector, and a type embedding corresponding to the semantic group is added to form a state token with semantic identity, specifically: The shared scalar projection and type encoding module obtains the state vector from the state construction and semantic grouping module. and group identifier sequence Processing is performed on the state vector. The scalar By employing a linear mapping shared by all state dimensions and incorporating learnable type embeddings of their respective semantic groups, we obtain... ,in .

[0044] In the formula, This is the current 36-dimensional state column vector. For the first scalar component ; For the feature dimension of a single state token, this embodiment takes 16; The learnable projective weight matrix is ​​shared by all state scalars. For the corresponding bias column vector; For the first The semantic group number of each state component. For the learnable type embedding column vector obtained by this number; The first result obtained by adding shared projection and type embedding An initial token, with the superscript 0 indicating a stage identifier before attention processing. Represents the set of real numbers. Indicates by OK The matrix space consisting of columns of real numbers. express A dimensional real vector space.

[0045] Type embedding by matrix Read by group identifier, where This is the group numbering sequence corresponding to each state component; this paper uses... This represents the number of distinct group numbers in the sequence, i.e., the number of semantic groups, which is 5 in this embodiment, while the group number sequence contains 36 items. Each token is transposed into a row vector and stacked in state-dimensional order to obtain the initial token matrix. The semicolon here indicates that the rows are stacked. The superscript indicates transpose. This matrix serves as the direct input to the subsequent state-dimensional self-attention module; the original state vector... At the same time, it is retained to the jump branch.

[0046] In S4, a query matrix, key matrix, and value matrix are constructed based on the state token. Scaling dot product self-attention is performed along the state variable dimension, followed by residual connections, layer normalization, and feedforward transformation to obtain the interactive representation. Specifically: The state-dimensional self-attention module calculates correlation weights among all state variable tokens and obtains input-related interaction representations through residual connections, layer normalization, and feedforward transformation. This module models the internal dependencies of the model and does not directly interpret the attention weights as physical causal relationships.

[0047] In the specific calculation, the query matrix is ​​generated from the initial token matrix. Key matrix Sum matrix ,in, ; In the formula, This is the initial token matrix; , , These are the learnable linear transformation weight matrices for query, key, and value, respectively, all with size [missing information]. ; , , These are the transformed query matrix, key matrix, and value matrix, each with a size of [size missing]. Here It is a query matrix. Value matrix, and subsequent action value function and state value function Distinguish them according to the formula they belong to.

[0048] Then calculate the attention weight matrix and output: ; In the formula, This is the transpose of the key matrix; Let be the pairwise similarity score matrix of tokens, with size . Divide by Used to scale the magnitude of the dot product; Perform exponential normalization along the key-token dimension of each row so that the sum of the weights of each row is 1; This is the attention weight matrix. This is the attention output after weighted summation of the logarithmic matrices. Represents a matrix, and the subsequent set of candidate actions. and action advantage function different.

[0049] in, The dimension for the state token is 16 in this example. Then, the first residual normalization is performed: ; The representation layer normalization operation is performed on each state token. Each feature component is normalized, and the output is adjusted by learnable scaling and bias. This is the matrix obtained after adding the initial token matrix and the attention output, and then normalizing it through the first layer. The superscript 1 indicates the first residual normalization stage and does not represent exponentiation.

[0050] And it adopts a token-forward network: ; In the formula, For a token-forward network, tokens in each row are processed independently using the same set of parameters; This represents the feature dimension of the intermediate hidden layer of the feedforward network. , These are the learnable weight matrices for the first and second linear layers, respectively. , The corresponding bias vector is added row by row to each token; It is an element-wise nonlinear activation function, such as ReLU. The output size is still [missing information]. , can be with Add them together.

[0051] The interaction representation is obtained after normalization of the second residual: ; for The interaction representation matrix is ​​obtained by adding it to the output of its feedforward network and then normalizing it in the second layer; the superscript 2 indicates the second residual normalization stage and does not represent the square of the matrix. The The row corresponds to the first After the state token is interacted with Dimensional features.

[0052] The output retains the token positions corresponding to each state dimension and serves as the input for the interactive representation of the feature fusion module. The above computational path and the original state jump branch are as follows: Figure 2 As shown.

[0053] In S5, all state tokens in the interaction representation are flattened and concatenated with the untransformed state vector to obtain the fused feature, specifically: The feature fusion module flattens all interaction tokens and concatenates them with the original state vector without attention transformation, enabling the backend value network to use both coupled interaction features and directly utilize basic observations.

[0054] The splicing calculation is represented as: ; ; in, For interactive representation of the flattened column vector, the subscripts are... Label attention interaction features, The token matrix is ​​expanded in state-dimensional order, with semicolons indicating vector concatenation. Thus, features are fused. The former The dimension carries information about cross-state variable interactions, and then... The dimension preserves the original observations without attention transformation. In one embodiment, , After being flattened, a 576-dimensional interaction representation is obtained, which is then concatenated with the original 36-dimensional state vector to form a 612-dimensional fusion feature. The fusion feature is then fed into the action value estimation module.

[0055] In S6, the fused features are input into the action value estimation network to obtain the state value and the action advantage of each candidate action, and the action value of each candidate action is calculated, specifically as follows: The action value estimation module is a Dueling action value estimation network, including a shared hidden layer, a state value stream, and an action advantage stream, used to calculate the action value of each discrete candidate action. The fused features are first passed through the shared hidden layer to obtain the shared hidden layer output: ; Then proceed to the state value stream and action advantage stream respectively: ; ; In the formula, Input as fusion feature; To share the hidden layer width, To share the hidden layer output column vector; , These are the learnable weight matrix and bias vector of the shared hidden layer, respectively; Here, is the non-linear activation function for this layer, such as ReLU. For neural network hidden features, and access history tags Distinguish by index and formula.

[0056] The scalar state value is the current state value. and These are the learnable weight column vector and scalar bias of the state-value stream output layer, respectively. Represents the inner product. Let [the product name is missing]. If the number of candidate actions is , then Let the dot be the column vector of all candidate actions. This indicates that all candidate actions will be traversed. , These are the learnable weight matrix and bias vector of the action-dominant flow output layer, respectively. For the action in this vector The corresponding components.

[0057] For action sets The value of an action is calculated using the following formula: ; This centralized processing is used to eliminate the indistinguishability between the state value stream and the action advantage stream, ultimately outputting an action value vector. This invention employs a semantic grouping self-attention deep Q-network (SGS-DQN) to implement the above computation process, specifically as follows: Figure 2 As shown.

[0058] In S7, the current navigation action is selected based on the action value of each candidate action. During the training phase, an exploration strategy is used, while during the deployment phase, the action with the highest action value is selected. Specifically: The action selection and path update module determines actions based on the action selection strategy during the training or deployment phase. The training phase employs an ε-greedy strategy. ; Deployment phase order That is, selecting the action with the highest action value. Action Mapped to discrete displacement .

[0059] In the formula, For a moment Selected navigation maneuver; To explore the probability, the range of values ​​is: ; A random number generated independently for each action selection. This indicates a uniform distribution between 0 and 1; This means that an action is randomly selected from the set of actions with equal probability. Return the index of the action that maximizes the action's value. If the action is random, explore randomly; otherwise, select the action with the highest value. Deploy commands. . This represents the mapping from action to 2D grid displacement, in units of grids / step; the eight actions correspond sequentially to the aforementioned eight-neighborhood direction set. .

[0060] In S8, the discrete displacement corresponding to the selected action is superimposed with the current wind and current vectors. Position constraints are applied based on the navigable area boundary and obstacle constraints to update the unmanned surface vessel's position. Specifically: Actions Corresponding discrete displacement Combined drift (Including wind vector and current vector) superposition, to obtain candidate vessel positions: ; Then, the updated boat position is calculated using the position constraint operator: ; in, The navigable location domain is jointly determined by the map boundary and obstacle constraints; As a position constraint operator, it receives candidate boat positions after adding motion displacement and wind drift, and obtains updated boat positions according to the selected boundary clipping, immobile motion shielding, or collision-induced state rollback rules. , not limited to orthogonal projections in the sense of Euclidean distance. , The first , Two-dimensional boat position at each decision moment This represents the current wind and drift vector. If a candidate boat position intersects with an obstacle, it is recorded as a collision termination or an inaction-free action is implemented according to environmental rules.

[0061] The system adds boat positions in chronological order, denoted as .in, Deadline The ordered sequence of berths, Initial berth; The route sequence after adding the new berth; This indicates appending an element to the end of a sequence, preserving the order and repeated positions, but does not represent a set union operation. (Uppercase) Represents a path sequence, lowercase. Indicates a single berth.

[0062] In S9, if the target position is reached or the termination condition is met, the navigation action sequence and planned path are output; otherwise, return to S1 to form a closed-loop decision, specifically: When satisfied When a collision occurs or the maximum number of steps is reached, the action selection and path update module outputs the navigation action sequence and the planned path; otherwise, it returns to S1 based on the observation at the next moment to continue the closed-loop calculation.

[0063] In the formula, For the target location, This is the boat's position after the latest location update. Let it be the Euclidean distance between it and the target; The target arrival determination radius is set, with both distance and radius measured using the same grid coordinate scale, and the distance not exceeding [a certain value]. The goal is determined upon arrival. The maximum number of steps is a preset limit on the number of decision steps per round, counted in steps; the round ends when the cumulative number of steps executed in the current round reaches this limit. The aforementioned goal arrival, collision, and reaching the step limit are independent termination conditions; the current round terminates when any one of these conditions is met.

[0064] like Figure 1 As shown, Figure 1 The data transfer relationships between the environmental state acquisition module, state construction and semantic grouping module, shared scalar projection and type encoding module, state-dimensional self-attention module, feature fusion module, action value estimation module, and action selection and path update module are illustrated. The closed loop formed by the original state jump branch and the next-time observation feedback is also shown. This invention also provides an unmanned surface vessel path planning system based on semantic grouping self-attention, applied to the above method, including: The environmental status acquisition module is used to acquire the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and provide observation data to the state construction and semantic grouping module; The state construction and semantic grouping module is used to construct state vectors based on observation data, divide the state vectors into at least two semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs. The shared scalar projection and type encoding module is used to perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity. The state dimension self-attention module is used to construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and sequentially perform residual connection, layer normalization and feedforward transformation to obtain interactive representation; The feature fusion module is used to flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain fused features; The action value estimation module is used to obtain the state value and action advantage of each candidate action based on the fusion features, and to calculate the action value of each candidate action. The action selection and path update module is used to select the current navigation action based on the action value of each candidate action, superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, update the position of the unmanned surface vessel according to the navigable area boundary and obstacle constraints, and output the navigation action sequence and planned path when the termination condition is met.

[0065] The state-dimensional self-attention module includes: a linear mapping unit, used to linearly map state tokens into a query matrix, a key matrix, and a value matrix; an attention calculation unit, used to calculate the attention weight matrix based on the query matrix and the key matrix, and to perform a weighted summation of the value matrix based on the attention weight matrix to obtain the attention output; and a feedforward transformation unit, used to sequentially perform the first residual normalization, the token-by-token feedforward network, and the second residual normalization on the attention output.

[0066] The action value estimation module is a Dueling network, which includes a shared hidden layer, a state value stream, and an action advantage stream. The fused features are processed by the shared hidden layer and then fed into the state value stream and the action advantage stream, respectively. The state value stream outputs the state value, and the action advantage stream outputs the action advantage of each candidate action. The action value of each candidate action is obtained by adding the state value to the centralized action advantage.

[0067] Furthermore, the meanings of the symbols and formulas involved in this invention are shown in Table 1, and the main technical parameters are shown in Table 2: Table 1 Symbols and Formulas The shared projection and type encoding of each state scalar are represented as follows: ; Ensures that the token after shared projection still carries the semantic group identity; State-dimensional scaled dot product self-attention representation is: ; Establish interactions between state variables as they change with input; The value estimate of dueling actions is expressed as follows: ; The overall state value is separated from the relative advantage of actions; The closed-loop update of the vessel position is represented as follows: ; The model's output navigation maneuvers are transformed into the next boat position in a wind-current coupled environment.

[0068] Table 2 Main Technical Parameters This invention also provides deployment and training methods, specifically as follows: During training, Double DQN target estimation and prioritized experience replay can be used. The online network is used to select the next action, and the target network is used to evaluate the selected action. The priority of experience sampling can be determined based on the temporal difference error, and the batch loss can be corrected using importance sampling weights. After training, the network parameters are fixed, and the deployment end continuously executes S1 to S9, outputting action instructions or planned paths. The training strategy, experience replay, and target network are preferred implementations, and the core protection structure remains a collaborative information flow of semantic grouping, type encoding, state dimension interaction, original state jump fusion, and action value estimation.

[0069] Example 1: Training and Planning in a Coupled Grid Environment A 25×25 grid navigable area is constructed, with a starting point, target point, land area, discrete obstacles, wind vector, and current vector set. The action space includes up, down, left, right, and four diagonal directions. At each moment, the system reads the current boat position, relative direction to the target, two-dimensional wind, two-dimensional current, neighboring obstacles, eight-directional access history, and drift risk, forming a 36-dimensional state vector.

[0070] The state vectors are divided into five groups with dimensions of 4, 4, 12, 8, and 8. Each scalar is projected to d=16 dimensions through a shared linear layer and superimposed with the type embedding of its semantic group. All tokens enter a single-head state dimension self-attention module, and are flattened after residual connections, layer normalization, and a feedforward network. The flattened features are concatenated with the original 36-dimensional state and enter the state value stream and action advantage stream through a shared hidden layer to calculate the action value of eight candidate actions.

[0071] In this embodiment, the initial token matrix satisfies , where 36 is the number of state tokens and 16 is the feature dimension of each token. Figure 2 In Indicates The final interaction representation after the attention processing block of each state dimension The superscript indicates the number of blocks processed. This is a hierarchy identifier and does not represent exponentiation. This embodiment uses a processing block that includes attention, residual normalization, and feedforward transformation. Its output Corresponding to S4 All sizes After being flattened, it was obtained The 36-dimensional interactive representation is then concatenated with the original 36-dimensional state to obtain... An eight-dimensional fusion vector is generated. This fusion vector is used to calculate the action value of eight candidate actions through a shared hidden layer, state value flow, and eight-dimensional action advantage flow.

[0072] The training phase employs an exploration strategy and experience replay, while the deployment phase selects the actions with the highest value. Action displacement is superimposed with wind and current drift, and the position is restricted to a navigable area; the current round ends upon collision, timeout, or reaching the target. The unmanned surface vessel's planned path is obtained by recording the vessel's position at each moment.

[0073] Example 2: Module Replacement and Equivalent Implementation Without altering the information flow of this invention, shared linear projection can be replaced with a parameter-sharing multilayer perceptron; single-head attention can be replaced with multi-head attention; the Dueling action value estimation network can be combined with Double DQN, priority experience replay, hard target synchronization, or soft target update; the position constraint operator can employ pruning, non-movable action masking, or collision-based state rollback. The number of semantic groups and the variables in each group can be adjusted according to the sensor configuration, but it is necessary to retain the group identity encoding of heterogeneous states, cross-state variable interaction, direct fusion of original states, and the output of specific navigation actions or planned paths.

[0074] Example 3: Results and Applicable Boundaries In the three coupled grid simulation implementation scenarios of this technical solution, the average success rates across scenarios for the complete model, Dueling DQN, and FusedDQN were 48.9%, 46.8%, and 19.6%, respectively; in the congested obstacle scenario, the success rate of the complete model was 53.6% ± 16.0%. In the ablation experiment, after removing type embedding, token feedforward layer, and skip connections, the success rate decreased from 58.0% to 28.0%, 26.7%, and 37.3%, respectively. These data support the implementation of the structure and its ability to produce technical effects under specific simulation conditions. However, there are significant fluctuations between training seeds, and the success rate on the unobserved map is limited; therefore, it is not interpreted as a stable advantage under real sea conditions.

[0075] This embodiment illustrates the method using discrete grids and linear airflow. In actual deployment, positioning, airflow, radar, or vision equipment provides status information, and the planning output is converted into heading, propulsion, or waypoint commands; relevant engineering parameters are determined according to the vessel type.

[0076] Embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may 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.) that include computer-usable program code.

[0077] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and 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 illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0078] These 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 function 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.

[0079] 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.

[0080] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.

Claims

1. A path planning method for unmanned surface vessels based on semantic grouping self-attention, characterized in that, include: S1: Obtain the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and construct a state vector, where each state vector includes multiple components, i.e., state variables; S2: Divide the state vector into multiple semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs; S3: Perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity; S4: Construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and perform residual connection, layer normalization and feedforward transformation in sequence to obtain interactive representation; S5: Flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain the fused feature; S6: Input the fused features into the action value estimation network to obtain the state value and the action advantage of each candidate action, and calculate the action value of each candidate action. S7: Select the current navigation action based on the action value of each candidate action; S8: Superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, perform position constraints based on the navigable area boundary and obstacle constraints, and update the position of the unmanned surface vessel. S9: If the target position is reached or the termination condition is met, output the navigation action sequence and the planned path; otherwise, return to S1 to form a closed-loop decision.

2. The unmanned surface vessel path planning method based on semantic grouping self-attention according to claim 1, characterized in that, In S2, the semantic groups include navigation group, environmental dynamics group, security group, access history group, and drift risk group; The navigation group includes state variables corresponding to the current position and the target position; the environmental dynamics group includes state variables corresponding to the wind vector and the current vector; the safety group includes state variables corresponding to the relative coordinates of the nearest obstacle, the normalized distance, the current position occupancy marker, and the eight-neighbor occupancy marker; the access history group includes state variables corresponding to the eight-neighbor access marker; and the drift risk group includes drift risk state variables calculated based on the alignment of the combined drift with the obstacle direction.

3. The unmanned surface vessel path planning method based on semantic grouping self-attention according to claim 1, characterized in that, In S3, the shared linear projection applies the same weight matrix and bias vector to each state scalar; The type embeddings are learnable vectors, read from the type embedding matrix by group identifiers.

4. The unmanned surface vessel path planning method based on semantic grouping self-attention according to claim 1, characterized in that, In S4, a query matrix, key matrix, and value matrix are constructed based on the state token. Scaling dot product self-attention is performed along the state variable dimension, followed by residual connections, layer normalization, and feedforward transformation to obtain the interactive representation. Specifically: Linearly map the state tokens to a query matrix, a key matrix, and a value matrix; Calculate the attention weight matrix based on the query matrix and the key matrix; The attention output is obtained by weighted summation of the value matrix based on the attention weight matrix. The residual connection, layer normalization, and feedforward transformation are performed in the order of first residual normalization, token-by-token feedforward network, and second residual normalization.

5. The unmanned surface vessel path planning method based on semantic grouping self-attention according to claim 1, characterized in that, In S6, the action value estimation network is a Dueling network, which includes a shared hidden layer, a state value stream, and an action advantage stream. The fused features, after being processed by the shared hidden layer, are respectively entered into the state value stream and the action advantage stream; The state value stream outputs the state value, and the action advantage stream outputs the action advantage of each candidate action. The action value of each candidate action is obtained by adding the state value to the centralized action advantage.

6. The unmanned surface vessel path planning method based on semantic grouping self-attention according to claim 1, characterized in that, In S8, the position constraint is at least one of boundary clipping, immobile action shielding, or collision-induced state rollback.

7. A path planning system for unmanned surface vessels based on semantic grouping self-attention, applied to the path planning method for unmanned surface vessels based on semantic grouping self-attention as described in any one of claims 1-6, characterized in that, include: The environmental status acquisition module is used to acquire the current position, target position, wind field, ocean current, obstacle set and access history of the unmanned surface vessel, and provide observation data to the state construction and semantic grouping module; The state construction and semantic grouping module is used to construct state vectors based on observation data, divide the state vectors into at least two semantic groups according to the physical meaning of the state variables, and generate a group identifier for the semantic group to which each state variable belongs. The shared scalar projection and type encoding module is used to perform a shared linear projection on each state scalar in the state vector and add a type embedding corresponding to the semantic group to form a state token with semantic identity. The state dimension self-attention module is used to construct query matrix, key matrix and value matrix based on state tokens, perform scaled dot product self-attention in the state variable dimension, and sequentially perform residual connection, layer normalization and feedforward transformation to obtain interactive representation; The feature fusion module is used to flatten all state tokens in the interaction representation and concatenate them with the untransformed state vector to obtain fused features; The action value estimation module is used to obtain the state value and action advantage of each candidate action based on the fusion features, and to calculate the action value of each candidate action. The action selection and path update module is used to select the current navigation action based on the action value of each candidate action, superimpose the discrete displacement corresponding to the selected action with the current wind vector and flow vector, update the position of the unmanned surface vessel according to the navigable area boundary and obstacle constraints, and output the navigation action sequence and planned path when the termination condition is met.

8. The unmanned surface vessel path planning system based on semantic grouping self-attention according to claim 7, characterized in that, The state-dimensional self-attention module includes: A linear mapping unit is used to linearly map state tokens into a query matrix, a key matrix, and a value matrix; The attention calculation unit is used to calculate the attention weight matrix based on the query matrix and the key matrix, and to perform a weighted summation of the value matrix based on the attention weight matrix to obtain the attention output; The feedforward transformation unit is used to sequentially perform first residual normalization, token-by-token feedforward network, and second residual normalization on the attention output.