A ship trajectory prediction method based on two-stage spatiotemporal interaction enhancement

By employing a two-stage spatiotemporal interaction enhancement method, this approach addresses the shortcomings of existing ship trajectory prediction technologies in long-term dependency modeling and incomplete spatial interaction characterization in complex waters and multi-ship scenarios. It achieves deep integration and iterative optimization of historical and future interactions, thereby improving the accuracy and stability of trajectory prediction.

CN123116208APending Publication Date: 2026-11-17BEIJING INFORMATION SCI & TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611245601.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing ship trajectory prediction technologies suffer from insufficient long-term dependency modeling capabilities, incomplete spatial interaction relationships, lack of differentiated strategies for interaction graph construction, and lack of a hierarchical progressive fusion mechanism for historical and future interactions in complex waters and multi-ship scenarios, resulting in insufficient prediction accuracy.

Method used

A two-stage spatiotemporal interaction enhancement method is adopted. First, the long-term and short-term temporal dependence features and spatial interaction relationships of ships are extracted through historical interaction encoding to generate a coarse-grained preliminary future trajectory. Then, the potential interaction map is reconstructed based on the future positional relationship, and the potential future interaction features are extracted and decoded. Finally, the prediction results of the future multi-step trajectory are output.

Benefits of technology

It improves the accuracy and stability of trajectory prediction in complex waters with multiple vessels, enhances the sensitivity to local dynamic behavior, reduces redundancy in interactive information and omission of key interactions, and achieves deep integration and iterative optimization of historical and future interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123116208A_ABST
    Figure CN123116208A_ABST
Patent Text Reader

Abstract

This invention discloses a ship trajectory prediction method based on two-stage spatiotemporal interaction enhancement, belonging to the field of ship trajectory prediction technology, including the following steps: S1, acquiring historical trajectory sequences of multiple ships in a water scene; S2, extracting historical temporal features of each ship; S3, extracting historical spatial interaction features of each ship; S4, generating preliminary future trajectories of each ship based on its historical temporal and spatial interaction features; S5, constructing historical-future joint trajectory features of each ship; S6, extracting potential future interaction features of each ship; wherein, a second distance threshold is less than a first distance threshold; S7, outputting the prediction results of the future multi-step trajectory of each ship. This invention adopts a two-stage progressive architecture of historical interaction encoding and future interaction enhancement, improving the problem of insufficient deep integration and iterative optimization of historical and future interactions under the existing single-stage prediction framework, thus contributing to improved rationality and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship trajectory prediction technology, and in particular to a ship trajectory prediction method based on two-stage spatiotemporal interaction enhancement. Background Technology

[0002] Ship trajectory prediction is a key technology in intelligent shipping and maritime safety supervision. By sensing and analyzing a ship's historical navigation status, it infers the ship's position and movement trends in the future, providing data support for collision warnings, channel scheduling, and emergency decision-making. In complex water environments, significant behavioral coupling and spatial interactions exist among multiple ships. Accurately characterizing these interactions and achieving high-precision, long-term trajectory prediction is crucial for improving the safety and operational efficiency of water transportation systems.

[0003] In the development of trajectory prediction technology, early methods mainly relied on kinematic and statistical models. For example, methods based on Kalman filtering, autoregressive moving average (ARMA) models, and Monte Carlo simulations extrapolated trajectories by establishing state transition equations or probability distribution models of ship motion. However, ship motion in complex waters is influenced by multiple factors such as channel constraints, encounter rules, and pilot intentions, exhibiting strong nonlinearity and non-Gaussianity. The aforementioned traditional methods based on linear assumptions or fixed modes struggle to effectively capture the complex evolution of ship dynamic behavior, leading to a significant decrease in prediction accuracy under maneuvering conditions such as turning and speed changes, and failing to demonstrate the interactive effects between multiple ships.

[0004] In recent years, with the development of deep learning technology, end-to-end trajectory prediction methods based on recurrent neural networks (RNNs), long short-term memory networks (LSTMs), and attention mechanisms have gradually become a research hotspot. These methods automatically learn the temporal dependencies in trajectory sequences through a data-driven approach, improving the ability of traditional methods to model nonlinear dynamics to some extent. However, existing RNN-based methods, when dealing with longer trajectory sequences, are limited by their serial computation structure, making it difficult to stably model long-distance temporal dependencies while maintaining computational efficiency. Furthermore, they lack sufficient sensitivity to short-term dynamic behaviors such as sudden speed changes and turns. In addition, most methods only model the historical trajectory of a single vessel in isolation, failing to fully utilize the spatial interaction information between multiple vessels in the same waterway, resulting in insufficient prediction robustness in scenarios of dense vessel encounters.

[0005] To further improve prediction performance in multi-ship scenarios, some researchers have introduced graph neural networks (GNNs) to explicitly model the spatial interactions between ships. This involves constructing an interaction graph based on a distance threshold and using graph convolution or graph attention mechanisms to aggregate neighborhood information, thereby capturing the influence of neighboring ships on the target ship's navigation behavior. However, existing graph neural network-based trajectory prediction methods typically rely solely on historical observation trajectories to construct a single static interaction graph and generate future trajectories within a single-stage prediction framework. This modeling approach has the following limitations:

[0006] 1. The historical interaction map and the potential future interaction map are not distinguished, making it difficult to adapt to the evolution of interaction relationships caused by changes in the dynamic position of ships. In addition, existing methods usually use a uniform and fixed spatial distance threshold when constructing interaction maps. They fail to use a larger radius in the historical situational awareness stage to cover the indirectly affected neighboring ships, while using a smaller radius in the potential interaction stage to focus on significant interactions. This results in both redundant interaction information and omission of key interactions.

[0007] 2. The model lacks explicit inclusion of future time domain information, making it unable to reconstruct potential interaction graphs based on predicted future positional relationships and correct prediction results accordingly. This results in limited prediction accuracy in situations where ships are in violent relative motion or encounter complex situations.

[0008] 3. Existing methods mostly adopt a single-stage prediction framework, directly outputting prediction results after encoding historical interactions. They lack a hierarchical progressive correction mechanism from coarse-grained prior prediction to fine-grained interaction enhancement, resulting in the failure to achieve deep integration and iterative optimization between historically observed interactions and future potential interactions.

[0009] In summary, existing ship trajectory prediction technologies still suffer from several technical problems in complex waters and multi-ship scenarios, including insufficient long-term dependency modeling capabilities, incomplete spatial interaction characterization, lack of differentiated strategies for interaction graph construction, and lack of a hierarchical progressive fusion mechanism for historical and future interactions. There is an urgent need for a ship trajectory prediction method that can take into account both long-term and short-term dependency modeling, explicitly distinguish between historical interactions and potential future interactions, and achieve hierarchical enhancement of spatiotemporal features through a two-stage progressive structure. Summary of the Invention

[0010] The purpose of this invention is to provide a ship trajectory prediction method based on two-stage spatiotemporal interaction enhancement to solve the problems mentioned in the background art.

[0011] To achieve the above objectives, the present invention provides the following technical solution: a ship trajectory prediction method based on dual-stage spatiotemporal interaction enhancement, comprising the following steps:

[0012] S1. Obtain the historical track sequence of multiple ships in the water scene. The track features of each time step in the historical track sequence include the ship's position information and motion state information.

[0013] S2. Perform time-series coding on the historical track sequences of each of the aforementioned vessels, and extract the historical time-series features of each of the aforementioned vessels;

[0014] S3. Take each of the ships as graph nodes, construct connecting edges between nodes whose spatial distance between ships is less than a first distance threshold, obtain a historical interaction graph, and perform spatial interaction modeling on the historical time sequence features of each of the ships on the historical interaction graph to extract the historical spatial interaction features of each of the ships.

[0015] S4. Generate preliminary future tracks for each of the aforementioned vessels based on their historical time-series characteristics and historical spatial interaction characteristics. The preliminary future tracks are coarse-grained predictions of the future movement trends of the vessels.

[0016] S5. Combine the historical trajectory sequence of each of the vessels with the corresponding preliminary future trajectory in the time dimension to construct the historical-future joint trajectory feature of each of the vessels;

[0017] S6. Based on the spatial positional relationship between ships, construct connection edges between ship nodes whose spatial distance is less than the second distance threshold to obtain a future potential interaction graph, and perform spatial interaction modeling on the historical-future joint trajectory features of each ship on the future potential interaction graph to extract the potential future interaction features of each ship; wherein, the second distance threshold is less than the first distance threshold;

[0018] S7. Perform time-series decoding on the potential future interaction features of each of the aforementioned ships, map the decoding results to the track space, and output the future multi-step track prediction results of each of the aforementioned ships.

[0019] Preferably, in step S1, the track characteristics at each time step include the ship's longitude, latitude, speed, and heading; before step S2, a preprocessing step for the historical track sequence is also included:

[0020] The track features are normalized to eliminate the dimensional differences between different physical quantities, and the normalized track features are projected onto a high-dimensional embedding space through linear mapping to obtain a node-level temporal feature matrix. The node-level temporal feature matrix is ​​then used as the input for temporal coding in step S2.

[0021] Preferably, in step S2, the Mamba model is used to perform time-series encoding on the historical track sequences of each of the vessels; the Mamba model models the long-term dependencies in the track sequences through state-space modeling and captures the short-term dynamic changes in the track sequences through a selective state update mechanism, thereby obtaining the hidden time-series feature vectors of each of the vessels as the historical time-series features.

[0022] Preferably, in step S3, the first distance threshold is 8km, and the spatial distance is calculated based on the current position of each of the ships; on the historical interaction graph, a graph attention network is used to perform spatial interaction modeling on the historical temporal features of each of the ships, including:

[0023] A linear transformation is performed on the node features, and the attention weight between each node and its neighboring nodes is calculated. The neighboring node features are then weighted and aggregated based on the attention weights to obtain the historical spatial interaction features of each node.

[0024] The attention weight is used to characterize the relative influence of neighboring vessels on the navigation behavior of the target vessel.

[0025] Preferably, the graph attention network employs a multi-head attention mechanism, which concatenates or averages the outputs of multiple attention heads to obtain the historical spatial interaction features of each node.

[0026] Preferably, step S4 includes:

[0027] S41. Perform residual nonlinear mapping on the historical time series features of each of the ships to extract the high-order motion state features of each of the ships.

[0028] S42. The high-order motion state features of each ship are spliced ​​and fused with the corresponding historical space interaction features, and the fused features are batch normalized to obtain joint input features.

[0029] S43. Input the joint input features into the temporal decoding network to perform future temporal modeling and generate preliminary future tracks for each of the ships at multiple future time steps; wherein, the track features of each time step in the preliminary future track have the same feature dimension as the track features of each time step in the historical track sequence.

[0030] Preferably, in step S5, the historical track sequence of each ship is spliced ​​with the corresponding preliminary future track in the time dimension, so that the node features of each ship simultaneously include the real historical navigation status and the preliminary predicted future navigation trend, thus forming the historical-future joint trajectory feature.

[0031] Preferably, in step S6, the second distance threshold is 6km; the connecting edges of the future potential interaction graph are constructed based on the future positional relationships represented by the preliminary future trajectories of each of the ships; on the future potential interaction graph, a graph attention network is used to perform linear transformation, attention weight calculation and weighted aggregation on the historical-future joint trajectory features of each of the ships to obtain the potential future interaction features of each of the ships.

[0032] Preferably, step S7 includes:

[0033] S71. The potential future interaction features of each of the ships are temporally decoded using the Mamba model. During the decoding process, residual connections and layer normalization structures are introduced and multiple layers are stacked to obtain the decoded feature sequence.

[0034] S72. Flatten and recombine the time dimension and feature dimension of the decoded feature sequence to obtain a global temporal feature representation, which is then reshaped into a predicted feature in time series form after fully connected linear mapping and nonlinear activation.

[0035] S73. The predicted features are mapped to the track space through a linear regression layer, and the position prediction results of each ship at multiple future time steps are output. The position prediction results are two-dimensional geographic coordinates.

[0036] Preferably, steps S1 to S7 of the method are executed by a neural network model. The neural network model uses the ship's actual future track position as a supervision signal and performs end-to-end training by minimizing the deviation between the predicted track position and the actual track position using a mean square error loss function, so that the parameters of each module in the two stages are optimized collaboratively.

[0037] The technical effects and advantages of this invention are as follows:

[0038] (1) This invention adopts a two-stage progressive architecture of historical interaction coding and future interaction enhancement. The first stage generates a coarse-grained preliminary future trajectory based on the long-term and short-term temporal dependence features of the ship's historical track and the historical spatial interaction relationship between multiple ships, and explicitly constructs future temporal information; the second stage combines the historical track sequence and the preliminary future trajectory into a historical-future joint trajectory feature, and reconstructs the future potential interaction map based on the predicted future positional relationship, and then extracts the potential interaction features and decodes and outputs the final track. Thus, a hierarchical progressive correction relationship is formed between the historical observed interaction and the future potential interaction from coarse to fine, which improves the problem that the historical interaction and future interaction cannot be deeply integrated and iteratively optimized under the existing single-stage prediction framework, and helps to improve the rationality and stability of the track prediction results under complex encounter situations;

[0039] (2) In the historical time-series encoding and trajectory prediction decoding stages, this invention introduces a state-space modeling mechanism to stably represent the long-term dependencies in the trajectory sequence, while simultaneously capturing short-term dynamic changes such as sudden speed changes and turns through a selective state update mechanism. Compared to the dependency degradation and gradient vanishing problems that traditional recurrent neural networks are prone to when processing long trajectory sequences, this scheme can still effectively maintain the discriminative ability of time-series features under long historical trajectory input conditions, and the sensitivity to local dynamic behaviors is maintained.

[0040] (3) In the historical interaction modeling stage, this invention uses a larger spatial distance threshold to construct a historical interaction map to cover neighboring ships that have an indirect impact on the target ship's navigation decisions, ensuring the integrity of the overall navigation situation awareness; in the potential future interaction modeling stage, a smaller spatial distance threshold is used, and an interaction map is constructed based on the future positional relationships represented by the preliminary future trajectory to focus on neighboring ships that have a more significant impact on the evolution of the future trajectory. This differentiated threshold strategy reduces the problem of redundant interaction information and omission of key interactions under a uniform fixed threshold, enabling the model to adapt to the needs of situation awareness and refined interaction modeling at different stages.

[0041] (4) In the interaction graph modeling, this invention uses a graph attention network to calculate adaptive attention weights based on the relative influence strength of each neighboring vessel on the navigation behavior of the target vessel, and performs neighborhood feature weighted aggregation accordingly. Since the potential future interaction graph in the second stage is based on the coarse-grained preliminary future trajectory construction, there may be a small number of incorrectly connected edges due to prediction bias; the above-mentioned adaptive weighting mechanism can assign smaller weights to neighboring nodes with lower influence strength, thereby suppressing the transmission of preliminary prediction errors to the final trajectory prediction results through the graph structure to a certain extent, and enhancing the robustness of the prediction process. Attached Figure Description

[0042] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention, but do not constitute a limitation thereof. In the drawings:

[0043] Figure 1 This is a diagram of the overall architecture of the TSIE-Net model of the present invention;

[0044] Figure 2 This is a schematic diagram of the trajectory prediction method of the present invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] This invention provides, for example Figure 1-2 The method for predicting ship tracks based on two-stage spatiotemporal interaction enhancement shown is as follows: Figure 1 This is a diagram illustrating the overall architecture of the prediction model used in this embodiment of the invention. In this embodiment, the model is referred to as the Two-Stage Progressive Spatiotemporal Interaction Enhanced Prediction Model (TSIE-Net), as follows... Figure 1 As shown, the model is a two-stage progressive structure consisting of historical interaction encoding and future interaction enhancement. The first stage includes temporal encoding, spatial interaction encoding, and preliminary track prediction, which are used to extract long-term and short-term temporal dependence features of ship historical tracks, model historical spatial interaction relationships among multiple ships, and generate coarse-grained preliminary future tracks, providing trajectory references for potential interaction modeling in the second stage. The second stage includes potential future interaction encoding and track prediction decoding, which construct joint features based on historical tracks and preliminary future tracks and reconstruct future potential interaction maps, extract potential interaction features among ships, and finally generate future multi-step continuous tracks, achieving end-to-end multi-ship track prediction.

[0047] The method includes the following steps:

[0048] S1. Obtain the historical track sequence of multiple ships in the water scene. The track features of each time step in the historical track sequence include the ship's position information and motion state information.

[0049] S2. Perform time-series coding on the historical track sequences of each vessel and extract the historical time-series features of each vessel;

[0050] S3. Treat each ship as a graph node, construct connecting edges between nodes whose spatial distance between ships is less than the first distance threshold, obtain the historical interaction graph, and perform spatial interaction modeling on the historical time sequence characteristics of each ship on the historical interaction graph to extract the historical spatial interaction characteristics of each ship.

[0051] S4. Generate preliminary future tracks for each ship based on its historical time-series characteristics and historical spatial interaction characteristics. The preliminary future tracks are coarse-grained predictions of the future motion trends of the ships.

[0052] S5. Combine the historical track sequences of each ship with the corresponding preliminary future tracks in the time dimension to construct the historical-future joint trajectory features of each ship;

[0053] S6. Based on the spatial positional relationship between ships, construct connecting edges between ship nodes whose spatial distance is less than the second distance threshold to obtain a potential future interaction graph. On the potential future interaction graph, perform spatial interaction modeling on the historical-future joint trajectory features of each ship and extract the potential future interaction features of each ship; wherein, the second distance threshold is less than the first distance threshold.

[0054] S7. Perform time-series decoding on the potential future interaction characteristics of each ship, map the decoding results to the track space, and output the future multi-step track prediction results of each ship.

[0055] Example 1: This example provides a detailed description of the specific implementation process of the above steps S1 to S4 (i.e., the first stage: historical spatiotemporal interactive coding and preliminary trajectory prediction).

[0056] like Figure 1 As shown, this embodiment is applied to multi-vehicle track prediction in complex water scenarios, using a multi-dimensional track sequence of Automatic Identification System (AIS) vessels sampled at equal time intervals as input. Let there be N target vessels in the water scenario. For the i-th vessel, its historical track sequence is expressed as formula (1):

[0057] (1)

[0058] in, Let be the length of the historical track sequence. The track feature vector corresponding to each time step is shown in formula (2):

[0059] (2)

[0060] in, and These represent the ship's longitude and latitude positions, respectively. Indicates speed, It indicates the course. That is, the track characteristics at each time step include the ship's position information (longitude, latitude) and motion status information (speed, course), which can comprehensively depict the ship's instantaneous navigation status and motion trend.

[0061] Before performing time-series coding, the historical track sequence is preprocessed: First, the features of each track are normalized, for example, by using min-max normalization or standardization, to eliminate the dimensional differences between different physical quantities such as longitude, latitude, speed, and heading; then, the normalized track features are projected onto a high-dimensional embedding space through linear mapping to provide a unified feature representation for subsequent time-series and interaction modeling. After coding the track features of all ships in the scene, the node-level time-series feature matrix is ​​obtained, as shown in formula (3):

[0062] (3)

[0063] The node-level temporal feature matrix is ​​used as the input for the temporal encoding in step S2 to construct the interaction relationship between ships and extract spatial dependency features.

[0064] II. Historical Time Series Feature Extraction (corresponding to step S2)

[0065] like Figure 1 As shown, in order to effectively characterize the long-term dependencies and short-term dynamic changes in the track sequence, this embodiment uses the Mamba model to perform time-series encoding on the historical track sequences of each ship. The Mamba model models the long-term dependencies in the track sequence through state-space modeling and captures the short-term dynamic changes in the track sequence through a selective state update mechanism. After inputting the entire historical track sequence of the ship into the Mamba encoder, its corresponding time-series feature representation is obtained, as shown in formula (4):

[0066] (4)

[0067] in, Let represent the hidden temporal feature vector of the i-th ship, serving as its historical temporal feature. Compared to traditional temporal modeling methods, the Mamba model can effectively model long-term dependencies with lower computational complexity when dealing with longer track sequences, avoiding feature degradation problems and thus improving the overall representation ability of ship dynamic behavior in complex waters.

[0068] III. Extraction of Historical Spatial Interaction Features (corresponding to step S3)

[0069] like Figure 1 As shown, each ship is considered as a node in the graph, and a historical interaction graph is constructed as shown in formula (5):

[0070] (5)

[0071] in, Represents the set of ship nodes. This represents the set of spatial interaction edges between ships.

[0072] To depict the effective interactions between ships, a graph structure is constructed based on the spatial positions of the ships at the current moment. Let the positions of the i-th ship and the j-th ship at the current moment be respectively... and The definition of the connecting edge between the two ships is shown in formula (6):

[0073] (6)

[0074] in, This indicates the spatial distance between the two ships at the current moment. The first distance threshold is used to filter neighboring vessels with potential interactive effects. In this embodiment, the first distance threshold... The value is set to 8km. Since there is stronger behavioral coupling between ships that are spatially close during navigation, while the interaction influence of ships that are far apart can be ignored, the first distance threshold is set to 8km in the historical interaction modeling stage. This can cover neighboring ships that may indirectly affect the navigation decision of the target ship in the future time window, so as to fully characterize the overall navigation status and potential interaction influence of ships in complex waters.

[0075] In the completed historical interaction diagram Above, a graph attention network is used to model the spatial interactions of the historical temporal features of each ship. For node i, its set of neighboring nodes is denoted as . First, a linear transformation is performed on the node features, as shown in formula (7):

[0076] (7)

[0077] Where W is a trainable weight matrix. Then, the attention weights between node i and its neighbor node j are calculated, as shown in formula (8):

[0078] (8)

[0079] in, These are trainable parameters in the attention mechanism. This represents a vector concatenation operation. This represents the normalization of the neighborhood node set. The attention weight is used to characterize the relative influence of neighboring ships on the navigation behavior of the target ship. By adaptively weighting the importance of different neighbors through the graph attention mechanism, redundant interference introduced by distant ships can be avoided.

[0080] Based on this, the historical spatial interaction characteristics of nodes are represented as shown in formula (9):

[0081] (9)

[0082] in, This represents a non-linear activation function. Furthermore, the graph attention network employs a multi-head attention mechanism, concatenating or averaging the outputs of multiple attention heads to obtain the historical spatial interaction features of each node, thereby enhancing the model's ability to model different interaction patterns.

[0083] The output of historical spatial interaction modeling is the historical interaction feature matrix of all ships, as shown in formula (10):

[0084] (10)

[0085] This matrix is ​​the result of joint spatiotemporal interaction coding of historical stages, which can comprehensively characterize the evolution characteristics of ship historical motion and its spatial interaction relationship, and serve as the basic input features for subsequent prediction stages.

[0086] IV. Preliminary Future Track Generation (corresponding to step S4)

[0087] like Figure 1 As shown, after completing the historical spatiotemporal interaction encoding, a joint feature representation capable of comprehensively characterizing the ship's historical motion state and spatial interaction relationship has been obtained. To explicitly construct future temporal domain information and provide structured future input for subsequent potential future interaction modeling, this embodiment performs a first-stage coarse-grained prediction of the ship's future motion trend, specifically including:

[0088] S41. Perform residual nonlinear mapping on the historical time series characteristics of each ship to extract the higher-order motion state characteristics of each ship. The residual characteristics are represented as shown in formula (11):

[0089] (11)

[0090] in, Represents the residual network mapping. This is a node feature representation obtained by encoding historical time series. The residual structure can enhance the depth of feature representation while maintaining stable transmission of original information, thus avoiding the gradient degradation problem during deep network training.

[0091] S42. The high-order motion state characteristics of each ship are spliced ​​and fused with the corresponding historical spatial interaction characteristics, as shown in formula (12):

[0092] (12)

[0093] in, The node features are obtained by modeling historical spatial interactions. To improve the stability of model training and enhance the consistency of feature distribution, the fused features are batch normalized, as shown in formula (13):

[0094] (13)

[0095] The joint input features obtained after normalization simultaneously contain historical time series information, spatial interaction features, and higher-order motion states, providing input for preliminary trajectory prediction.

[0096] S43. Input the joint input features into the temporal decoding network to perform future temporal modeling. In this embodiment, the temporal decoding network adopts the Mamba decoder and generates continuous trajectory prediction results for multiple future time steps through the state space recursive structure, as shown in formula (14):

[0097] (14)

[0098] in, This represents the prediction function consisting of a decoder and a linear mapping layer. Let be the preliminary predicted track sequence of the i-th ship at future times. The track characteristics of each time step in the preliminary future track have the same feature dimensions as the track characteristics of each time step in the historical track sequence. That is, each time step in the preliminary future track also includes track characteristics in four dimensions: longitude, latitude, speed, and heading.

[0099] After performing preliminary trajectory predictions for all ships in the scenario, a preliminary set of future trajectories is obtained, as shown in formula (15):

[0100] (15)

[0101] It should be noted that the preliminary future trajectory generated in this stage is not the final prediction result, but a coarse-grained estimate of the future movement trend of ships. Its main function is to explicitly introduce future time domain information, so that the model can characterize potential interaction patterns based on the predicted future positional relationships in the second stage, thereby achieving two-stage interaction enhancement prediction for complex waters and multi-ship scenarios.

[0102] Example 2: This example provides a detailed description of the specific implementation process of steps S5 to S7 (i.e., the second stage: potential future interaction coding and track prediction decoding) described above.

[0103] V. Construction of Historical-Future Joint Trajectory Features (corresponding to step S5)

[0104] like Figure 1 As shown, in this embodiment, the historical track sequence of each ship is spliced ​​with the corresponding preliminary future track in the time dimension, as shown in formula (16):

[0105] , ; (16)

[0106] in, This represents the preliminary future trajectory prediction result of the i-th ship generated by the model in the previous stage. In order for the model to utilize both historical observation information and future prediction information, the two are spliced ​​together in the time dimension to form a historical-future joint trajectory feature, as shown in formula (16):

[0107] in, This represents a sequence concatenation operation. In this way, each node not only contains the actual historical navigation state but also explicitly incorporates prior information about future navigation trends. The joint trajectory features of all ships in the scenario are represented as a set of node features, as shown in Equation (2.17).

[0108] (17)

[0109] in, This represents the historical-future joint trajectory feature of the i-th ship.

[0110] VI. Extraction of potential future interaction features (corresponding to step S6)

[0111] like Figure 1 As shown, in the interaction modeling of the future stage, the interaction relationship no longer merely reflects the current spatial proximity, but is constructed based on the future positional relationship represented by the preliminary future trajectory. It should be noted that the spatial positional relationship in this invention includes both the spatial positional relationship based on the current position and the future spatial positional relationship based on the preliminary future trajectory. Let the preliminary future trajectories of the i-th and j-th ships be respectively... and The definition of the connecting edge between the two ships is shown in formula (18):

[0112] (18)

[0113] in, The spatial distance radius threshold is used for the joint interaction modeling phase. To focus on nearby vessels that have a more significant impact on future trajectory evolution, while avoiding the introduction of redundant information from distant vessels, this paper will... The threshold is set to 6 km. Compared to the historical interaction modeling stage, this threshold is usually set smaller to focus on neighboring ships that have a more significant impact on future track evolution, which is conducive to the model efficiently and accurately capturing the potential interaction relationships of multiple ships. Thus, a potential future interaction map can be constructed, as shown in formula (19):

[0114] (19)

[0115] In this embodiment, the second distance threshold of 6km is less than the first distance threshold of 8km. The reason for setting this threshold is that the historical interaction modeling stage needs to fully cover neighboring ships that may indirectly affect future navigation decisions, so a larger interaction radius is used to ensure the integrity of situational awareness. In the future interaction modeling stage, an explicit estimate of future positional relationships has been obtained through preliminary future trajectories. Using a smaller distance threshold can focus on neighboring ships that have a more significant impact on the evolution of future trajectories, while avoiding the introduction of redundant information from distant ships. This is conducive to the model efficiently and accurately capturing the potential interaction relationships of multiple ships.

[0116] On the constructed potential future interaction graph, a graph attention network is used to model the historical-future joint trajectory features of each ship. First, the node features are linearly transformed, as shown in formula (20):

[0117] (20)

[0118] in, This is a trainable weight matrix. Then, the attention weights between node i and its neighbor node j are calculated, as shown in formula (21):

[0119] (twenty one)

[0120] in, For trainable attention parameters, This represents a vector concatenation operation. This attention mechanism adaptively measures the potential impact of different vessels on the target vessel's navigation behavior in future phases. Furthermore, since the initial future trajectory is a coarse-grained prediction, the connecting edges constructed based on it may contain a small number of incorrectly connected edges. The adaptive weighting of the graph attention mechanism assigns smaller attention weights to incorrectly connected neighbors with lower impact intensity, thereby reducing the propagation of initial prediction errors to the final prediction result.

[0121] The potential future interaction features of nodes are represented as shown in Equation (22):

[0122] (twenty two)

[0123] in, is a non-linear activation function. A multi-head attention mechanism is also introduced to further enhance the model's ability to express diverse interaction patterns. The final output of the potential future interaction modeling is the representation of the potential future interaction features of all ships, as shown in formula (23):

[0124] (twenty three)

[0125] This feature not only integrates historical motion status and preliminary future trend information, but also explicitly models the potential interaction relationships that may occur between ships in the prediction stage, thereby providing high-level semantic support for subsequent track prediction and decoding, and realizing two-stage spatiotemporal interaction enhancement modeling.

[0126] VII. Track Prediction Decoding (corresponding to step S7)

[0127] like Figure 1As shown, the core objective of the trajectory prediction decoding module is to map the high-dimensional spatiotemporal interaction features output by the potential future interaction coding module to the physical trajectory space, generating continuous position prediction results for the target ship at multiple future time steps. This module is responsible for mapping from the semantic feature space to the physical coordinate space and is the final output stage for achieving end-to-end multi-step trajectory prediction.

[0128] In the aforementioned stages, the model has obtained a joint feature representation that integrates historical navigation status, preliminary future trends, and potential interactions among multiple vessels. Let the output of the potential future interaction encoding module be:

[0129] :(twenty four)

[0130] in, Indicates the first The high-dimensional joint feature vectors corresponding to each time step have a feature dimension of . , The length of the historical-future joint sequence.

[0131] To fully model the temporal dependencies in the joint feature sequences, this paper employs the Mamba model for deep decoding of the feature sequences, with the mapping relationship as follows:

[0132] Its output can be represented as: in, This represents the feature representation after temporal decoding. The Mamba model compresses and updates historical feature information through hidden state recursion and selective state update mechanisms, enabling the model to maintain its ability to model long-term dependencies while remaining sensitive to short-term dynamic behaviors such as speed changes and turns.

[0133] To improve the model's training stability and feature representation ability, residual connections and layer normalization structures are introduced during the temporal decoding process. Their abstract form is shown in formula (25):

[0134] (25)

[0135] By stacking multiple layers, the above structure can extract high-level temporal features from local dynamic changes to global evolution trends step by step, providing high-quality decoding representations for subsequent trajectory prediction.

[0136] S72. Reassemble the decoded feature sequence output by Mamba decoding, flatten the time dimension and feature dimension to obtain the global temporal feature representation, as shown in formula (26):

[0137] (26)

[0138] This operation preserves the overall temporal structure information while compressing multi-time-step features into a unified vector representation, achieving an aggregated expression of global temporal information. Subsequently, a prediction feature space is constructed using a fully connected linear mapping and a nonlinear activation function, as shown in Equation (27):

[0139] (27)

[0140] in, and For trainable parameters, Represents a non-linear activation function. This is a high-dimensional feature representation for the prediction stage. It is used to obtain the predicted feature vector. Then, it was reshaped into a time series format: .

[0141] S73. The predicted features are mapped to the track space through a linear regression layer to obtain the final multi-step track prediction result, as shown in formula (28):

[0142] (28)

[0143] in, Indicates the target vessel in the future The predicted position at any given time is given as two-dimensional geographic coordinates (longitude and latitude). It should be noted that the final output of this invention is a two-dimensional geographic coordinate system. The ship's future motion state information (such as speed and heading) can be derived by differentially analyzing the position prediction results of adjacent time steps, thereby simplifying the output dimensions without losing the ability to depict the ship's future motion trend.

[0144] Through the above decoding and mapping process, a structured transformation from a high-dimensional spatiotemporal interactive semantic space to a physical trajectory space is achieved. In a single forward inference process, the model can comprehensively utilize historical motion information, spatial interaction relationships, and their temporal evolution characteristics to perform overall modeling and unified regression of future trajectories, ensuring the continuity of prediction results in the temporal dimension and physical consistency in the spatial dimension.

[0145] Example 3: This example describes the training process and alternative implementation methods of the above method.

[0146] Steps S1 to S7 of the method are executed by a neural network model. The neural network model is trained end-to-end using the mean squared error (MSE) loss function, with the ship's actual future track position as the supervision signal, guiding the model to fit the ship's motion laws and interaction patterns, and minimizing the deviation between the predicted track position and the actual track position. The mathematical representation of the loss function is shown in formula (29):

[0147] (29)

[0148] Where N represents the number of ships in the scene. To predict the step size, This is the actual flight path location. The model predicts vessel track positions. During training, the Adam optimizer can be used to iteratively update the model parameters. Through end-to-end loss backpropagation, the parameters of each module in the two stages can be optimized collaboratively, ultimately achieving high-precision prediction of multi-vehicle tracks in complex waters.

[0149] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement, characterized in that, Includes the following steps: S1. Obtain the historical track sequence of multiple ships in the water scene. The track features of each time step in the historical track sequence include the ship's position information and motion state information. S2. Perform time-series coding on the historical track sequences of each of the aforementioned vessels, and extract the historical time-series features of each of the aforementioned vessels; S3. Take each of the ships as graph nodes, construct connecting edges between nodes whose spatial distance between ships is less than a first distance threshold, obtain a historical interaction graph, and perform spatial interaction modeling on the historical time sequence features of each of the ships on the historical interaction graph to extract the historical spatial interaction features of each of the ships. S4. Generate preliminary future tracks for each of the aforementioned vessels based on their historical time-series characteristics and historical spatial interaction characteristics. The preliminary future tracks are coarse-grained predictions of the future movement trends of the vessels. S5. Combine the historical trajectory sequence of each of the vessels with the corresponding preliminary future trajectory in the time dimension to construct the historical-future joint trajectory feature of each of the vessels; S6. Based on the spatial positional relationship between ships, construct connection edges between ship nodes whose spatial distance is less than the second distance threshold to obtain a future potential interaction graph, and perform spatial interaction modeling on the historical-future joint trajectory features of each ship on the future potential interaction graph to extract the potential future interaction features of each ship; wherein, the second distance threshold is less than the first distance threshold; S7. Perform time-series decoding on the potential future interaction features of each of the aforementioned ships, map the decoding results to the track space, and output the future multi-step track prediction results of each of the aforementioned ships.

2. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 1, characterized in that, In step S1, the track characteristics at each time step include the ship's longitude, latitude, speed, and heading; before step S2, a preprocessing step is also included for the historical track sequence: The track features are normalized to eliminate the dimensional differences between different physical quantities, and the normalized track features are projected onto a high-dimensional embedding space through linear mapping to obtain a node-level temporal feature matrix. The node-level temporal feature matrix is ​​then used as the input for temporal coding in step S2.

3. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 1, characterized in that, In step S2, the Mamba model is used to perform time-series encoding on the historical track sequences of each of the vessels. The Mamba model models the long-term dependencies in the track sequences through state-space modeling and captures the short-term dynamic changes in the track sequences through a selective state update mechanism, thereby obtaining the hidden time-series feature vectors of each of the vessels as the historical time-series features.

4. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 1, characterized in that, In step S3, the first distance threshold is 8km, and the spatial distance is calculated based on the current position of each of the ships. On the historical interaction graph, a graph attention network is used to perform spatial interaction modeling of the historical temporal features of each of the ships, including: A linear transformation is performed on the node features, and the attention weight between each node and its neighboring nodes is calculated. The neighboring node features are then weighted and aggregated based on the attention weights to obtain the historical spatial interaction features of each node. The attention weight is used to characterize the relative influence of neighboring vessels on the navigation behavior of the target vessel.

5. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 4, characterized in that, The graph attention network employs a multi-head attention mechanism, which concatenates or averages the outputs of multiple attention heads to obtain the historical spatial interaction features of each node.

6. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 1, characterized in that, Step S4 includes: S41. Perform residual nonlinear mapping on the historical time series features of each of the ships to extract the high-order motion state features of each of the ships. S42. The high-order motion state features of each ship are spliced ​​and fused with the corresponding historical space interaction features, and the fused features are batch normalized to obtain joint input features. S43. Input the joint input features into the temporal decoding network to perform future temporal modeling and generate preliminary future tracks for each of the ships at multiple future time steps; wherein, the track features of each time step in the preliminary future track have the same feature dimension as the track features of each time step in the historical track sequence.

7. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 6, characterized in that, In step S5, the historical trajectory sequence of each ship is spliced ​​with the corresponding preliminary future trajectory in the time dimension, so that the node features of each ship simultaneously contain the real historical navigation status and the preliminary predicted future navigation trend, thus forming the historical-future joint trajectory feature.

8. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 7, characterized in that, In step S6, the second distance threshold is 6km; the connecting edges of the future potential interaction graph are constructed based on the future positional relationships represented by the preliminary future trajectories of each of the ships; on the future potential interaction graph, a graph attention network is used to perform linear transformation, attention weight calculation and weighted aggregation on the historical-future joint trajectory features of each of the ships to obtain the potential future interaction features of each of the ships.

9. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to claim 1, characterized in that, Step S7 includes: S71. The potential future interaction features of each of the ships are temporally decoded using the Mamba model. During the decoding process, residual connections and layer normalization structures are introduced and multiple layers are stacked to obtain the decoded feature sequence. S72. Flatten and recombine the time dimension and feature dimension of the decoded feature sequence to obtain a global temporal feature representation, which is then reshaped into a predicted feature in time series form after fully connected linear mapping and nonlinear activation. S73. The predicted features are mapped to the track space through a linear regression layer, and the position prediction results of each ship at multiple future time steps are output. The position prediction results are two-dimensional geographic coordinates.

10. The ship trajectory prediction method based on two-stage spatio-temporal interaction enhancement according to any one of claims 1-9, characterized in that, Steps S1 to S7 of the method are executed by a neural network model. The neural network model uses the ship's actual future track position as a supervision signal and employs a mean square error loss function to minimize the deviation between the predicted track position and the actual track position for end-to-end training, thereby enabling the parameters of each module in the two stages to be optimized collaboratively.