A ship trajectory prediction method based on graph attention mechanism and electronic chart
By integrating nautical chart and channel data with AIS data, a ship trajectory prediction model based on graph attention mechanism is constructed, which solves the problem that existing methods fail to fully consider the influence of geographical environment, and achieves high-precision ship trajectory prediction and improved interpretability.
Patent Information
- Application Number
- CN202511122606.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing methods for predicting ship trajectories have failed to effectively address the issue. These methods primarily focus on modeling the time-series characteristics of ship positions without adequately considering factors such as the geospatial environment, waterway layout, and navigation rules. Consequently, the accuracy, stability, and interpretability of the trajectory prediction results are insufficient.
By integrating nautical chart and channel data with AIS data, a ship trajectory prediction model based on a multi-layer graph neural network is constructed. By employing graph attention mechanism and electronic nautical charts, multi-modal data fusion is achieved, and an intelligent ship trajectory prediction model based on a multi-layer graph neural network is built, thereby improving the accuracy and interpretability of ship trajectory prediction.
It improves the accuracy and interpretability of ship trajectory prediction, enhances the model's adaptability in complex water environments, and improves navigation safety and efficiency.
Smart Images

Figure CN120632376B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent ships, and particularly relates to a ship trajectory prediction method based on a graph attention mechanism and an electronic sea chart. BACKGROUND
[0002] An automatic identification system (AIS) is one of the core technologies for monitoring and managing ship activities, integrating modern communication, computer processing and electronic information display technologies. The AIS can broadcast its own navigation state to surrounding ships and a vessel traffic service (VTS) in real time through a very high frequency (VHF) channel, and receive navigation information of other ships within a range of 20 nautical miles. The AIS system can realize ship identification and dynamic monitoring, and effectively alleviate the traffic management pressure of ports and waterways. The AIS system continuously collects and records a large amount of dynamic navigation data including positioning time stamp, latitude and longitude, course over ground (COG), speed over ground (SOG) and the like. By applying data mining and intelligent analysis technologies, the ship navigation behavior law can be deeply mined, the intelligent level of water traffic monitoring and management is improved, and the ship is further assisted to realize safer and more efficient navigation. On this basis, the AIS data-based intelligent prediction of ship trajectory becomes an important research direction in the field of intelligent shipping and waterway traffic management. Through modeling and analysis of historical trajectory data, the future motion trajectory of the ship can be predicted, thereby providing a basis for supporting navigation decision, collision avoidance warning and port scheduling optimization.
[0003] Currently, most ship trajectory prediction researches adopt deep learning methods to learn the inherent time sequence rules of historical trajectory data and predict the future movement trajectory of ships. For example, in the paper "Trajectory Prediction Research Based on Ship Motion Behavior and Time Graph Neural Network", a ship trajectory long-time sequence prediction method based on ship motion behavior analysis and time graph neural network (TGCN-MP) is proposed to solve the problem of insufficient modeling ability of traditional prediction methods for complex navigation behavior. Through ship AIS data preprocessing, motion behavior modeling and trajectory clustering, typical ship motion patterns are mined, and graph convolutional neural network and gated recurrent unit (GRU) are combined to realize high-precision trajectory prediction. However, in this scheme, although the model combines the spatio-temporal correlation characteristics and motion patterns of ship trajectories, the current graph convolution and GRU network structure still have limited ability to model the fine-grained interaction relationships of multiple ships in complex sea areas, resulting in increased prediction error in extremely complex interaction scenarios. At the same time, the model is mainly based on ship AIS trajectory data and motion pattern modeling, and does not systematically introduce environmental factors such as weather, sea conditions, and chart channel data. For another example, in the paper "Ship Trajectory Prediction Model Based on NGO-Bi-GRU", a new ship trajectory prediction model combining Northern Goshawk Optimization (NGO) and Bidirectional Gated Recurrent Unit (Bi-GRU) neural network is proposed to improve the performance of traditional neural networks in hyperparameter optimization, prediction accuracy and stability. By using NGO algorithm to automatically optimize the learning rate, hidden node number and regularization coefficient of Bi-GRU model, the problem of low efficiency and easy to fall into local optimum of traditional manual parameter adjustment is avoided. However, some existing intelligent optimization algorithms (such as whale optimization, grey wolf optimization) have slow convergence speed and are easy to fall into local extreme value when facing high-dimensional hyperparameter search, which limits the further improvement of the performance of the prediction model. Moreover, the current model mainly considers basic features such as speed, latitude and longitude, and does not fully model micro-dynamic factors such as heading, heading change, and navigation period, affecting the refinement and robustness of trajectory prediction. There are also ship trajectory prediction schemes that use graph neural networks combined with time sequence networks, such as the patent CN117494871A-A Ship Trajectory Prediction Method Considering Ship Interaction Influence, which extracts the interaction relationship between ships from dynamic AIS data and models the dynamic interaction between multiple ships. This scheme considers the interaction between ships and does not consider the channel information of the electronic chart, making it difficult to fully reflect the actual navigation rules influenced by the geographical environment during ship movement.
[0004] It is evident that existing ship trajectory prediction schemes still have many limitations: existing methods mostly focus on modeling the time series characteristics of ship positions and predict ship trajectories based on single time series features, rarely taking into account the influence of factors such as geospatial environment, waterway layout, and navigation rules. They are difficult to fully reflect the actual navigation patterns of ships affected by the geographical environment during their movement, resulting in significant deficiencies in the accuracy, stability, and interpretability of trajectory prediction results. Summary of the Invention
[0005] In view of this, this invention proposes a ship trajectory prediction method based on graph attention mechanism and electronic nautical charts. This method fuses nautical chart and channel data with AIS data through a multi-layer graph structure to achieve multi-modal data fusion, constructing an intelligent ship trajectory prediction model based on a multi-layer graph neural network. This model can accurately predict the ship's navigation trajectory over a future period, effectively improving the accuracy and interpretability of intelligent ship trajectory prediction in complex water environments. By utilizing AIS data in conjunction with nautical chart and channel data, this invention enables a deeper understanding and prediction of ship behavior, thereby improving the navigation safety and efficiency of inland waterways.
[0006] Therefore, the present invention adopts the following technical solution:
[0007] This invention provides a method for predicting ship trajectories based on graph attention mechanism and electronic nautical charts, comprising:
[0008] S1. Collect the boundary line and centerline of the target channel from the nautical chart channel data and save them in the form of latitude and longitude coordinates;
[0009] S2. Filter the AIS data of ships in the target waterway, separate the trajectory of each ship according to MMSI to form a ship trajectory dataset, and preprocess the ship trajectory dataset.
[0010] S3. Data fusion of nautical chart channel data and ship trajectory data is performed using vectorization methods;
[0011] S4. A ship trajectory prediction model is constructed based on an improved hierarchical graph neural network, and the model is trained and evaluated. The model vectorizes channel elements and ship trajectories into a set of polylines, each polyline consisting of multiple vector nodes. The node features include the coordinates of the start and end points and attributes. The model adopts a three-layer architecture: a subgraph encoding layer, a global graph interaction layer, and a prediction layer. The subgraph encoding layer uses a graph attention network and max pooling to aggregate local information within the same polyline and extract polyline-level features. The global graph interaction layer models high-order interactions between all polylines through a global interaction graph based on a self-attention mechanism. The prediction layer uses gated recurrent units to capture the temporal dynamics in the trajectory data and predict the ship trajectory.
[0012] S5, obtaining a ship trajectory prediction result by using the trained ship trajectory prediction model.
[0013] Further, the coordinates of the boundary line and the center line of the target channel are converted to a local Cartesian coordinate system.
[0014] Further, the coordinates of the trajectory obtained from the ship AIS data are converted to a local Cartesian coordinate system.
[0015] Further, the data of the channel center line is saved to an XML file, which records the channels and surrounding static elements in the scene where the ship is located.
[0016] Further, each channel segment in the XML file is a geometric structure, including the following attributes: channel segment unique identifier, center line coordinate point sequence, upstream channel segment ID, downstream channel segment ID, left adjacent channel segment ID, right adjacent channel segment ID and turning information.
[0017] Further, the ship trajectory data set is preprocessed, including:
[0018] Identify and eliminate abnormal points, which are points that are repeatedly uploaded at the same location due to equipment failure or network congestion;
[0019] Identify and propose drift points, which are points in the trajectory that deviate from the main route and have sudden changes in position, caused by positioning errors or decoding abnormalities, and significantly deviate from the trajectory of the connecting line between the previous and next points.
[0020] For entangled points where the time sequence is disordered and the trajectory is folded back, a time sequence repair mechanism is proposed to ensure the continuity of the trajectory in the time and space dimensions by identifying and reordering or discarding abnormal ordering points.
[0021] Further, the chart channel data and ship trajectory data are fused by vectorization method, including:
[0022] The channel boundary line and the center line are converted into a polyline representation composed of coordinate points, and the geometric structure and attribute information of the channel are extracted; at the same time, the ship trajectory is organized into a continuous coordinate sequence in time sequence and also represented as a polyline, preserving its dynamic behavior characteristics;
[0023] The channel polyline and the trajectory polyline are uniformly mapped to a local coordinate system to construct a fusion data structure containing spatial adjacency relationships, align and fuse the static information of the channel and the dynamic information of the ship at the representation level, and provide a unified vectorized input for subsequent graph neural network modeling.
[0024] Further, the model vectorizes the channel elements and ship trajectories into a set of polylines, including:
[0025] For channel features, sequentially connect the coordinates of adjacent points to form a directed vector;
[0026] For ship trajectory, sample the trajectory points at fixed time intervals of 60 seconds, also connect them into vectors;
[0027] The channel feature vectors and ship trajectory vectors form a polyline, denoted as ;
[0028] Each vector will be a node in a graph, and its features are defined as:
[0029] ;
[0030] wherein and are the coordinates of the start and end points of the vector respectively; is the vector attribute; is the ID of the to which the vector belongs.
[0031] Further, at the subgraph encoding layer, a subgraph is constructed for each polyline, and graph attention propagation is performed on all vector nodes inside it. The propagation form of each layer of graph attention network is:
[0032] ;
[0033] wherein is the feature of the adjacent node; is the weight matrix; is the edge weight calculated through the attention mechanism; is the ReLU activation function;
[0034] After completing the graph attention network aggregation, maximum pooling operation is performed on the entire polyline to obtain the polyline feature, and a linear layer is used to unify the output dimension;
[0035] At the global graph interaction layer, all polyline features are taken as nodes to construct a fully connected graph to model the high-order relationship between polylines;
[0036] To implement the attention mechanism, each polyline node concatenates its ID encoding vector to form the input, which is then sent to a single-layer self-attention module:
[0037] ;
[0038] The output is the context-enhanced feature of each polyline;
[0039] At the prediction layer, starting from the polyline feature corresponding to the target ship, a three-layer gated recurrent unit is used to predict the future trajectory sequence, and finally the ship trajectory prediction value is obtained.
[0040] Compared with the prior art, the present application has the following beneficial effects:
[0041] 1) Improve trajectory prediction accuracy: by fusing AIS trajectory data and channel geographic information, considering time, space and environment three kinds of characteristics, effectively improve the precision of ship trajectory prediction, better than the method based on time series data only.
[0042] 2) Enhance model interpretability: introduce channel structure information, make the prediction result more consistent with the actual sailing path and channel rules, have good physical interpretability and sailing semantic consistency.
[0043] 3) Improve the adaptability to complex environment: use graph neural network to model channel structure and combine attention mechanism to capture the complex correlation between ship behavior and surrounding environment, improve the performance of the model in dynamic, crowded or complex structure water area.
[0044] In addition, it should be noted that, compared with the existing patent CN117494871A - a ship trajectory prediction method considering the interaction between ships, the two technologies have essential differences in modeling objects and innovation directions. This application emphasizes the fusion of channel information (such as center line, channel boundary, channel direction, etc.) and ship trajectory for multi-modal fusion. The channel center line, boundary line, channel direction, and other channel properties in the chart are modeled, and a spatial topology graph based on channel chart information and trajectory information is constructed to enhance the ship trajectory prediction effect. The existing patent CN117494871A extracts the interaction between ships from dynamic AIS data, dynamically models the time and space relationship between multiple ships, and constructs an interaction relationship graph (adjacency matrix dynamically changes) based on dynamic ships. The modeling ideas of the two are completely different. In terms of graph structure modeling, the method of this application fuses channel boundary lines, center lines, and ship trajectory information, and uses vectorization to represent the method of constructing a graph structure. Specifically, the channel center line and boundary information are regarded as a polyline that contains channel properties, and the ship trajectory is mapped to this structure. Through the collaborative modeling of local subgraphs and global graphs, the structural guidance of the channel to the ship behavior is realized. The channel information comes from electronic chart information, which has the advantages of strong interpretability and stable structure. In contrast, the existing patent CN117494871A constructs a dynamic graph based on real-time AIS data between ships. It takes each ship as a node of the graph, dynamically constructs edges by calculating time proximity efficiency and spatial relative distance, and forms an adjacency matrix that changes over time. This method emphasizes the interaction between ships. Although both use the method of combining graph neural networks with time series networks, the specific module structure, fusion method, and application direction are completely different. This application introduces GAT network in the subgraph encoding stage to improve the representation ability of the waterway structure, uses Self-Attention to extract global channel context information, and finally uses GRU decoding for trajectory prediction, which is significantly different from the combination structure of GCN+GRU in the comparison patent (GCN is used to extract the spatial dependence between ships, there is no global interaction mechanism, and the local interaction depends on GCN).
[0045] This application first introduces channel information from electronic charts into ship trajectory prediction models and constructs a GAT-based channel subgraph structure extraction and global attention modeling mechanism, which is an important extension and innovation of existing technologies. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0047] Figure 1 The flow chart is used in the embodiments of the present application.
[0048] Figure 2 The schematic diagram of channel selection is used in the embodiments of the present application.
[0049] Figure 3 The coordinate visualization of chart channel data is used in the embodiments of the present application.
[0050] Figure 4 The model structure diagram is used in the embodiments of the present application.
[0051] Figure 5 The comparison diagram of model prediction visualization is used in the embodiments of the present application. DETAILED DESCRIPTION
[0052] In order to make the person skilled in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without any creative effort should belong to the protection scope of the present application.
[0053] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0054] The application provides a ship trajectory prediction method based on a graph attention mechanism and an electronic sea chart. Firstly, the boundary line and the center line of a target channel are collected and saved in the form of latitude and longitude coordinates. Secondly, AIS data of ships in the target channel is screened, and the trajectory of each ship is separated according to MMSI. Thirdly, the sea chart channel data and the ship trajectory data are fused through a vectorization method. Finally, a graph neural network is selected for training and evaluation to complete intelligent prediction of the ship trajectory. The method combines dynamic AIS trajectory data and static channel geographic information, models the ship trajectory and the sea chart channel data, and realizes high-precision prediction of the future trajectory of the ship.
[0055] The following will take the ship trajectory prediction of a certain section of the Yangtze River as an example to illustrate the scheme in detail. As shown in Figure 1 The ship trajectory prediction method based on the graph attention mechanism and the electronic sea chart in the embodiment of the application comprises the following steps:
[0056] S1, collecting channel data;
[0057] The collected sea chart channel data in this embodiment is selected from a channel of about 6 nautical miles long in the Yangtze River, as shown in Figure 2
[0058] The boundary line and the center line of the selected channel are recorded in latitude and longitude coordinates, but in the modeling and prediction tasks, the local Cartesian coordinate system (coordinates with a reference point as the origin) is more accurate and efficient, so all the coordinates are converted to the local Cartesian coordinate system, and the visualization is as shown in Figure 3
[0059] For the channel center line, it is additionally saved in an XML (eXtensible Markup Language) file. The file records the channel and the surrounding static elements in the scene where the ship is located. Each channel segment is a geometric structure, including the following attributes:
[0060]
[0061] The XML file is mainly used to provide environmental context to help the model understand the channel structure, possible feasible paths, channel boundary constraints, etc. where the ship is currently located, so as to improve the prediction accuracy and feasibility.
[0062] In the multi-modal trajectory intelligent prediction model, the chart channel data plays a crucial role. The chart provides rich environmental context for the model, including the geometric structure of the channel (centerline coordinates), semantic information (turning type), channel boundary line, and topological structure (predecessor / successor channel, left / right adjacent channel, etc.). These information enable the model to not only rely on the historical trajectory of the target ship for prediction, but also understand the channel structure in which the ship is located, thereby improving the modeling capability of future behavior. For example, the "successor_ids" and "turn_direction" information contained in the XML can help the model identify all feasible paths, such as left turn, straight ahead, or right turn, to filter out reasonable options. In the model of the invention, these map elements are converted into vector representations (such as each channel centerline segment into a vector), then input into the model together with the ship trajectory to form local subgraphs, and interactively modeled through graph neural networks, finally aggregating multi-modal context information in the global graph to generate more physically feasible and environmentally consistent future trajectory prediction results. Therefore, the map not only enhances the interpretability and prediction accuracy of the model, but also significantly improves its generalization ability in complex scenarios. The channel data set produced by the invention can meet the above requirements.
[0063] S2, ship trajectory data collection and preprocessing;
[0064] From the AIS data, data located in the target channel is selected, and the trajectory of each ship is separated by MMSI. Like the channel data, the coordinates also need to be converted to the local Cartesian coordinate system.
[0065] In the ship trajectory data, the original AIS records often have problems such as noise, outliers, or data missing, which will seriously affect the accuracy and stability of subsequent trajectory modeling and prediction if not handled. Therefore, before carrying out trajectory prediction modeling, the original data needs to be systematically preprocessed to eliminate abnormal points, complete missing values, and improve data quality.
[0066] In terms of abnormal points, repeated records are mainly identified and removed. Such points are usually caused by equipment failure or network congestion, resulting in repeated uploading of data at the same location, and their characteristics are consistent position, speed, and heading, but different timestamps. Second, identify points in the trajectory that deviate from the main route and have sudden changes in position as drift points, which are usually caused by positioning errors or decoding abnormalities, significantly deviating from the trajectory of the connecting line between the previous and next points, and need to be removed. Finally, for entangled points where the time sequence is disordered and the trajectory is folded and twisted, a time sequence repair mechanism is proposed to identify abnormal ordering points and re-order or discard them to ensure the coherence of the trajectory in the time and spatial dimensions. Through the above multi-dimensional abnormal processing method, the usability of AIS data and the robustness of the trajectory prediction model are effectively improved.
[0067] S3, fuse the channel data and the ship trajectory data;
[0068] Fuse the chart channel data of S1 and the ship trajectory data of S2 by a vectorization method.
[0069] S4, construct a ship trajectory prediction model;
[0070] An improved hierarchical graph neural network model VMGAT (Vessel Multi-modal Graph Attention Network for Vessel Trajectory Prediction) is proposed in the embodiment for intelligent prediction of ship trajectory. By directly learning the unified scene context from the vector representation of the channel and the ship, the information loss and high computational cost of traditional rendering and ConvNet coding are avoided. The model vectorizes the channel elements (such as channel, boundary line, center line) and ship trajectory into a set of polylines, and each polyline is composed of multiple vector nodes, and the node features include start point, end point coordinates and attributes. In the embodiment, the model adopts a three-layer architecture: first, graph attention network (GAT) and maximum pooling are used to aggregate local information within the same polyline, so that the model can adaptively assign different weights to different neighbor nodes, thereby enhancing the modeling ability of complex spatio-temporal dependencies in ship trajectory and extracting polyline-level features; then, the global interaction graph (based on the self-attention mechanism) is used to model the high-order interaction between all polylines; finally, the prediction module adopts a gated recurrent unit (GRU), so that the model can better capture the temporal dynamics in the trajectory data, especially when dealing with ship trajectories with long time dependencies, the GRU effectively avoids the gradient vanishing problem. The model proposed in the present application is as shown in the following figure. Figure 4
[0071] In the chart channel data, the coordinates of the channel boundary line and the coordinates of the channel center line are recorded, and additional attribute information such as whether to turn, whether there are left and right adjacent channels, upstream and downstream channels, etc. are carried. The ship trajectory data are all time series coordinates. These elements can be approximately represented by a set of vectors: for channel features, sequentially connect adjacent point coordinates to form a directed vector; for ship trajectory, sample trajectory points at a fixed time interval of 60 seconds, and also connect them into vectors, and these vector groups are represented by Each vector is taken as a node in a graph, and its features are defined as:
[0072] ;
[0073] wherein, and are the coordinates of the start point and the end point of the vector respectively; is the vector attribute; ID of the vector belongs to ID of the vector belongs to
[0074] In the subgraph encoding stage, a subgraph is constructed for the polyline, and graph attention propagation is performed for all vector nodes inside it. The propagation form of each layer of GAT is as follows:
[0075]
[0076] wherein, is the feature of the adjacent node; is the weight matrix; is the edge weight calculated by the attention mechanism; is the ReLU activation function.
[0077] After completing the GAT aggregation, max pooling is performed on the entire polyline to obtain its overall feature, and a linear layer is used to unify the output dimension.
[0078] In the global graph interaction stage, all polyline features are taken as nodes to construct a fully connected graph to model the high-order relationship between polylines. To implement the attention mechanism, each polyline node concatenates its ID encoding vector to form an input, which is then sent to a single-layer self-attention module:
[0079]
[0080] The output is the context-enhanced feature of each polyline, which is used for subsequent prediction.
[0081] In the prediction stage, starting from the polyline feature corresponding to the target ship, a 3-layer GRU is used to predict the future trajectory sequence, and finally the ship trajectory prediction value is obtained.
[0082] S5, training a ship trajectory prediction model;
[0083] The trajectory data is divided into a training set and a test set in a ratio of 8:2, with 10,000 and 2,500 trajectories respectively, which are put into the built model for training. During training, the training batch epoch is 400 times, the learning rate is 0.001, the learning rate decay is reduced by 0.05% every 5 epochs, and the learning rate warm-up number of rounds is 50.
[0084] S6, using the trained ship trajectory prediction model to obtain the ship trajectory prediction result.
[0085] 20% of the ship trajectory data in the data set is used for verification. Experiments are carried out in the above data set, and RNN, LSTM, VectorNet and the method proposed in the application are compared, and VMGAT is the model of the scheme.
[0086] ADE (Average Displacement Error) and FDE (Final Displacement Error) are two commonly used evaluation indicators in trajectory prediction tasks, mainly used to evaluate the deviation between the predicted trajectory and the real trajectory.
[0087] ADE measures the average Euclidean distance error between the predicted trajectory and the real trajectory in the entire prediction period. It reflects the overall prediction accuracy of the model in the entire prediction process, and the formula is as follows:
[0088] ;
[0089] FDE only focuses on the error of the last prediction time step, and measures the Euclidean distance between the predicted trajectory endpoint and the real endpoint. It is mainly used to evaluate the accurate prediction ability of the model to the trajectory endpoint, and the formula is as follows:
[0090] ;
[0091] Wherein is the number of prediction time steps; is the predicted position at the th time step; is the real position at the th time step; represents the Euclidean distance (L2 norm).
[0092] The results obtained by predicting the test set are shown in Table 1.
[0093] Table 1
[0094]
[0095] As can be seen, in the test set, the ADE of the VMGAT model proposed in the embodiment is reduced by 13.64% compared with the best model (namely VectorNet) in the ablation experiment. This shows that the model has significant improvement in ship trajectory prediction accuracy.
[0096] In addition, in order to more intuitively show the performance of each model in the prediction task, the prediction results of some typical trajectories are visualized, as shown in Figure 5 Figure 5 As can be seen, the predicted trajectories of RNN, LSTM and VectorNet have certain deviations from the real trajectories, especially large deviations near the end point. The VMGAT model proposed in this study shows stronger prediction ability, not only in the overall trajectory form, but also in the prediction of the end point position. This further verifies the effectiveness of the model in improving the accuracy of ship trajectory prediction.
[0097] In the above embodiments, by fusing dynamic AIS trajectory data and static channel geographic information, high-precision modeling and prediction of ship future motion trajectory are realized. This method extends the traditional time series-based trajectory modeling method to multi-modal joint modeling, first introduces channel structure vector representation, extracts the structure information of the channel environment based on graph neural network, and deeply fuses it with the historical trajectory data of the ship, to build a trajectory expression method containing time, space and environment three semantics. In terms of model architecture, the invention uses graph attention mechanism to enhance the node representation ability in the channel subgraph, and introduces a time series modeling module to model the trajectory evolution law, effectively improving the prediction accuracy and generalization ability of the model in complex water environment. The invention realizes high-quality modeling, interpretable prediction and intelligent support of ship trajectory, and is suitable for key scenarios such as high-density waterway traffic management, ship path planning and navigation safety warning.
[0098] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for predicting ship trajectories based on graph attention mechanism and electronic nautical charts, characterized in that, include: S1. Collect the boundary line and centerline of the target channel from the nautical chart channel data and save them in the form of latitude and longitude coordinates; S2. Filter the AIS data of ships in the target waterway, separate the trajectory of each ship according to MMSI to form a ship trajectory dataset, and preprocess the ship trajectory dataset. S3. Data fusion of nautical chart channel data and ship trajectory data is performed using vectorization methods, including: converting channel boundary lines and centerlines into polyline representations composed of coordinate points to extract the geometric structure and attribute information of the channel; simultaneously, organizing ship trajectories into continuous coordinate sequences in chronological order and representing them as polylines to preserve their dynamic behavior characteristics; mapping channel polylines and trajectory polylines to a unified local coordinate system to construct a fused data structure containing spatial adjacency relationships, achieving alignment and fusion of static channel information and dynamic ship information at the representation level, and providing a unified vectorized input for subsequent graph neural network modeling; S4. A ship trajectory prediction model is constructed based on an improved hierarchical graph neural network, and the model is trained and evaluated. The model vectorizes channel elements and ship trajectories into a set of polylines, each polyline consisting of multiple vector nodes. The node features include the coordinates of the start and end points and attributes. The model adopts a three-layer architecture: a subgraph encoding layer, a global graph interaction layer, and a prediction layer. The subgraph encoding layer uses a graph attention network and max pooling to aggregate local information within the same polyline and extract polyline-level features. The global graph interaction layer models high-order interactions between all polylines through a global interaction graph based on a self-attention mechanism. The prediction layer uses gated recurrent units to capture the temporal dynamics in the trajectory data and predict the ship trajectory. S5. Using the trained ship trajectory prediction model, obtain the ship trajectory prediction results.
2. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart as described in claim 1, characterized in that, Transform the coordinates of the boundary line and centerline of the target channel to the local Cartesian coordinate system.
3. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart as described in claim 1, characterized in that, The coordinates of the trajectory obtained from the ship's AIS data will be transformed to a local Cartesian coordinate system.
4. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart according to claim 1, characterized in that, The data of the channel centerline is saved to an XML file, which records the channel and surrounding static elements in the scene where the ship is located.
5. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart according to claim 4, characterized in that, Each channel segment in the XML file is a geometric structure that includes the following attributes: a unique identifier for the channel segment, a sequence of centerline coordinates, the ID of the upstream channel segment, the ID of the downstream channel segment, the ID of the adjacent channel segment to the left, the ID of the adjacent channel segment to the right, and turning information.
6. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart according to claim 1, characterized in that, The preprocessing of the ship trajectory dataset includes: Identify and remove outliers, which are points where data is repeatedly uploaded from the same location due to equipment failure or network congestion. Identify and propose drift points, which are points in the trajectory that deviate from the main route or have abrupt changes in position, caused by positioning errors or decoding anomalies, and significantly deviate from the trajectory connecting the preceding and following points; To address entanglement points in the trajectory where the time sequence is disordered or the trajectory folds and twists, a time series repair mechanism is proposed. By identifying abnormally sorted point segments and reordering or discarding them, the continuity of the trajectory in the time and space dimensions is ensured.
7. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart according to claim 1, characterized in that, The model vectorizes channel elements and ship trajectories into a set of polylines, including: For channel features, sequentially connect the coordinates of adjacent points to form a directed vector; For ship trajectories, trajectory points are sampled at fixed time intervals of 60 seconds and connected into a vector; The channel feature vector and the ship trajectory vector form a polyline, which is then used to... express; Each vector It will be treated as a node in the graph, and its characteristics are defined as follows: ; in, and These are the coordinates of the vector's starting and ending points, respectively. For vector attributes; For the vector to which ID.
8. The ship trajectory prediction method based on graph attention mechanism and electronic nautical chart according to claim 7, characterized in that, In the subgraph encoding layer, a subgraph is constructed for each polyline, and graph attention propagation is performed on all vector nodes within it. The propagation form of each layer of the graph attention network is as follows: ; in, Features of adjacent nodes; This is the weight matrix; Edge weights are calculated using an attention mechanism; It is the ReLU activation function; After completing the graph attention network aggregation, max pooling is performed on the entire polyline to obtain the polyline features, and a linear layer is used to unify the output dimension. In the global graph interaction layer, all polyline features are used as nodes to construct a fully connected graph to model the higher-order relationships between polylines; To implement the attention mechanism, each polyline node is concatenated with its ID encoding vector to form the input, which is then fed into a single-layer self-attention module. The output is the context-enhanced feature for each polyline. In the prediction layer, starting from the polygonal features corresponding to the target ship, a three-layer gated recurrent unit is used to predict the future trajectory sequence, and finally the ship trajectory prediction value is obtained.
Citation Information
Patent Citations
Ship abnormal behavior detection method based on improved graph attention neural network
CN120354292A
System and method for forecasting trajectory based on AIS data and tide observation station information
KR102778555B1