A ship trajectory prediction method based on spatio-temporal adaptive graph pool
By constructing a ship trajectory prediction model based on spatiotemporal adaptive graph pooling, and using the adaptive graph pooling mechanism to eliminate redundant interactions and obtain the spatiotemporal characteristics of ships, the problem of large prediction deviation in existing methods is solved, and high-precision ship trajectory prediction is achieved, thus ensuring maritime transportation safety.
Patent Information
- Application Number
- CN202411646372.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-18
AI Technical Summary
Existing ship trajectory prediction methods fail to consider direction when learning ship interactions, resulting in many useless features, large prediction biases, and impacting maritime transport safety.
A ship trajectory prediction method based on spatiotemporal adaptive graph pooling is adopted. The model is constructed by ship trajectory time encoder, spatial interaction encoder and prediction decoder. The adaptive graph pooling mechanism is used to eliminate redundant interactions, construct sparse directed graph, obtain the spatiotemporal characteristics of ships, and achieve accurate prediction.
It improves the accuracy and efficiency of ship trajectory prediction, ensures maritime transport safety, reduces unnecessary ship interactions, and enhances prediction accuracy.
Smart Images

Figure CN119558188B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ship trajectory prediction, and in particular to a ship trajectory prediction method based on a spatio-temporal adaptive graph pool. BACKGROUND
[0002] Ship trajectory prediction plays a crucial role in the early warning and safety of maritime navigation. When moving a ship, the navigator must have a complete understanding of the future trajectory of the ship within a certain period of time in order to effectively avoid collisions. However, the accuracy of ship trajectory prediction is currently an important problem to be solved. With the rapid growth of maritime trade, the demand for more, larger cargo-carrying capacity and higher speed ships has increased, highlighting the issue of maritime safety and security. Ensuring the safety of maritime transportation is of great importance. Trajectory prediction helps to prevent collisions of marine objects such as ships and is considered to reduce the risk of maritime transportation accidents, and most ships are obliged to use response systems such as AIS to identify themselves. In contrast, ships that do so intentionally or unintentionally are referred to as black ships. They must use other tools to be discovered, such as drones, aircraft or satellites equipped with radio frequency receivers or imaging sensors. Knowing the future trajectory of a ship not only helps to avoid collisions between ships, but also helps to identify black ships discovered in satellite images. This is of great significance to ensuring the safety of maritime transportation and promoting the development of intelligent shipping.
[0003] In recent years, trajectory prediction has played an important role in autonomous navigation, multi-agent cooperation of pedestrians, vehicles and ships. Current prediction methods are mainly divided into two aspects, one is data-driven trajectory prediction, and the other is model-driven trajectory prediction. Model-driven trajectory prediction learns the motion rules of ships from a large amount of AIS historical data and infers the future motion trajectory of the ship according to the previous motion characteristics of the ship. Compared with data-driven methods, the prediction accuracy of this method has been improved. Deep learning models have been increasingly widely used in ship trajectory prediction due to their high representation ability, and have also enabled more detailed features to be learned from historical data, laying the foundation for more accurate and continuous real-time ship trajectory prediction.
[0004] However, the current prediction method learns the interaction of ships by establishing a fixed spatial range, and the interaction of ships occurs without considering their direction, resulting in too many useless features, which can easily lead to unnecessary interaction and thus large deviations in ship trajectory prediction. SUMMARY
[0005] The present application provides a ship trajectory prediction method based on a spatio-temporal adaptive graph pool to overcome the above technical problems.
[0006] To achieve the above purpose, the technical solution of the present application is:
[0007] A ship trajectory prediction method based on a space-time adaptive graph pool, specifically comprising the following steps:
[0008] S1: obtaining AIS original data of a ship trajectory;
[0009] S2: data preprocessing of the AIS original data to obtain a ship trajectory data sample set;
[0010] and randomly dividing the ship trajectory data sample set into a training set and a validation set;
[0011] S3: constructing a ship trajectory prediction model, and the ship trajectory prediction model includes a ship trajectory time encoder, a ship trajectory space interaction encoder, a feature fusion module, and a prediction decoder;
[0012] Based on the ship trajectory time encoder, the ship trajectory data sample is encoded for ship trajectory motion sequence to obtain ship time sequence features;
[0013] The ship trajectory space interaction encoder includes a graph attention network layer and a space interaction encoding unit;
[0014] The graph attention network layer is used to obtain aggregated trajectory features of different ships according to the ship time sequence features; the space interaction encoding unit is used to obtain ship feature vectors with time continuity ship space interaction features based on an adaptive graph pool mechanism according to the aggregated trajectory features;
[0015] The feature fusion module is used to fuse the ship time sequence features and the ship feature vectors to obtain an intermediate state vector, and the intermediate state vector is used as a hidden state vector of the current time step;
[0016] The prediction decoder is used to predict and obtain a hidden state vector of the next time step, i.e. a position corresponding to the next time step of the ship, according to the intermediate state vector;
[0017] S4: model training and model verification of the ship trajectory prediction model based on the training set and the validation set to obtain an optimal ship trajectory prediction model, and then realizing the prediction of the ship trajectory through the optimal ship trajectory prediction model.
[0018] Further, the data preprocessing of the AIS original data in S2 includes AIS data filtering, AIS data separation, and AIS data extraction in sequence;
[0019] The AIS data filtering includes at least the following: deleting AIS data whose ship MMSI number is not a preset number of digits; deleting AIS data containing null values; deleting AIS data whose ship speed on land (SOG) and heading on land (COG) exceed a preset threshold range; deleting AIS data containing fewer than a preset number of ships at the same timestamp, and randomly deleting AIS data with duplicate timestamps corresponding to the same ship MMSI number; and resampling AIS data using linear interpolation at a preset interval sampling period to supplement missing ship latitude and longitude data.
[0020] The AIS data separation refers to separating the filtered AIS data to obtain separated trajectory sequence data, specifically including:
[0021] AIS data is grouped based on the ship's MMSI number to obtain the corresponding AIS trajectory data for each ship. Based on the timestamp, the AIS trajectory data of each ship is sorted by time to obtain continuous ship trajectory sequence data for each ship.
[0022] The AIS data extraction method employs a sliding window approach to extract ship trajectory sequence data at a preset time step to obtain a sample set of ship trajectory data.
[0023] Furthermore, the model expression for the ship trajectory time encoder described in S3 is as follows:
[0024]
[0025] In the formula: Let represent the latitudinal coordinates of ship i at time step t, where t∈{1,…,N}; This represents the latitude coordinate of ship i at time step t-1; This indicates the ship's relative latitudinal position at time step t relative to time step t-1; Represents the longitude coordinates of the ship at time step t; This represents the longitude coordinates of ship i at time step t-1; This indicates the ship's relative longitude position at time step t relative to time step t-1; The relative position is embedded into a fixed-length vector at each time step; φ(·) represents the embedding function; W e Indicates the embedding weights; W represents the hidden state of the ship trajectory time encoder at time step t for ship i; m This represents the weights of the ship trajectory time encoder.
[0026] Furthermore, the spatial interaction coding unit has the following model expression:
[0027]
[0028] where ∥ denotes the connection operation between hidden states; W denotes the weight matrix of the shared linear transformation applied to each ship node; denotes the attention coefficient of ship node i and ship node j at time step t; N i denotes the neighbor set of node i in the directed graph based on the graph attention network; a denotes the weight vector of the single-layer feedforward neural network; a T denotes the transpose of a; τ denotes the adaptive distance threshold function and τ ∈ [0, 1]; n denotes the number of neighbor nodes of node i in the directed graph; ||{·} denotes the selection function; denotes the attention coefficient after the adaptive graph pooling mechanism; σ denotes the nonlinear activation function; denotes the spatial interaction feature of ship; W g denotes the weight of the spatial interaction encoder; denotes the feature vector of the interaction feature with time continuity; denotes the feature vector of the time continuity interaction feature of ship i at time step t-1.
[0029] Further, the prediction decoder in S3 has a model expression as
[0030]
[0031] where W d denotes the weight of the prediction decoder; mlp(·) denotes the linear layer; denotes the fixed-length vector at time step t obs ; denotes the intermediate state vector at time step t obs +1; denotes the hidden state of the ship trajectory time encoder at time step t obs ; denotes the feature vector of the interaction feature with time continuity output by the spatial interaction encoding unit at time step t obs ; denotes the position horizontal coordinate and the position vertical coordinate corresponding to the ship at time step t obs +1, respectively.
[0032] Further, the S4 specifically comprises the following steps
[0033] S41: inputting the training set into the constructed ship trajectory prediction model for model training, to obtain a trained ship trajectory prediction model;
[0034] S42: verifying the trained ship trajectory prediction model by using the verification set;
[0035] that is, whether the output of the trained ship trajectory prediction model converges;
[0036] If the output of the trained ship trajectory prediction model converges, it is confirmed that the trained ship trajectory prediction model at this time is the optimal ship trajectory prediction model;
[0037] Otherwise, based on the back propagation algorithm, the weight parameters of the trained ship trajectory prediction model are adaptively adjusted, and step S41 is repeatedly executed until the weight parameters of the trained ship trajectory prediction model whose output converges are confirmed to be the optimal weight parameters and the ship trajectory prediction model is reconstructed to obtain the optimal ship trajectory prediction model.
[0038] Further, the loss function Loss in S42 for judging whether the output of the trained ship trajectory prediction model converges is
[0039]
[0040] In the formula: represents the predicted trajectory of the ship i; Y i represents the real trajectory of the ship i.
[0041] Beneficial effects: The application provides a ship trajectory prediction method based on a spatio-temporal adaptive graph pool, adopts an encoder-decoder structure to construct a ship trajectory prediction model based on a spatio-temporal adaptive graph pool, encodes the ship trajectory movement through a ship trajectory time encoder, can extract the movement sequence features of each ship from the historical trajectory in the time dimension, adopts an adaptive distance threshold to eliminate redundant interactions in the space interaction coding unit based on an adaptive graph pool mechanism, constructs a sparse directed graph and a ship space interaction feature with time continuity, and further obtains the spatio-temporal features of the ship sequence data to eliminate useless features in the ship interaction; a feature fusion module is used to fuse the ship time sequence features and the ship space interaction features into an intermediate state vector, and the intermediate state vector is used as the hidden state vector of the current time step, and is input into a prediction decoder to predict and obtain the position corresponding to the next time step of the ship, thereby realizing ship trajectory prediction, and greatly improving the prediction accuracy and efficiency of ship trajectory prediction. BRIEF DESCRIPTION OF DRAWINGS
[0042] 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 to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0043] Figure 1A flow chart of a ship trajectory prediction method based on a spatio-temporal adaptive graph pool according to the present application;
[0044] Figure 2 A structural block diagram of constructing a ship trajectory prediction model based on a spatio-temporal adaptive graph pool according to the present application;
[0045] Figure 3 A flow chart of data preprocessing of AIS original data according to the present application;
[0046] Figure 4 An illustration of a single graph attention layer according to the present application. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0048] The present application provides a ship trajectory prediction method based on a spatio-temporal adaptive graph pool, as shown in Figure 1 , which specifically includes the following steps:
[0049] S1: Obtain AIS original data of ship trajectory; specifically, the AIS original data includes MMSI (unique ship ID), BaseDateTime (timestamp), LAT (latitude), LON (longitude), SOG (speed over ground), COG (course over ground), Heading (heading angle), ship name, IMO number, call sign, ship type, navigation state, length, width, draft, and cargo weight;
[0050] S2: Perform data preprocessing on the AIS original data, obtain a ship trajectory data sample set, and randomly divide the ship trajectory data sample set into a training set and a validation set;
[0051] Specifically, as shown in Figure 3 , according to a pre-created data processor, perform data preprocessing on the AIS original data, which includes AIS data filtering, AIS data separation, and AIS data extraction in sequence; wherein the pre-created data processor is a unit module set according to existing data filtering, data separation, and data extraction techniques, and is only used to pre-process data according to existing data processing functions, and the data processing techniques themselves are not the points of the present application, and will not be described in more detail here;
[0052] The AIS data filtering includes at least the following: deleting AIS data whose vessel MMSI number is not a preset number of digits, i.e., deleting data whose MMSI number is not 9 digits, to ensure the uniqueness and validity of the data; deleting AIS data containing null values, i.e., deleting data samples of AIS attribute information containing null values; deleting AIS data whose vessel speed to land (SOG) and heading to land (COG) exceed preset threshold ranges, i.e., SOG range is set to [1.0-22.0], COG range is set to [0-360], and data exceeding these ranges will be deleted; deleting AIS data containing fewer than a preset number of vessels at the same timestamp, and randomly deleting AIS data with duplicate timestamps corresponding to the same vessel MMSI number, i.e., deleting AIS data and SOG values of non-maritime vessels. For AIS data of moored and anchored vessels with less than 1 knot, AIS data containing fewer than 3 vessels under the same BaseDateTime is deleted. In addition, for the same MMSI number, the BaseDateTime is checked, and AIS data with duplicate timestamps is removed, retaining the unique record for the same BaseDateTime. AIS data is resampled using linear interpolation at a preset interval to supplement missing vessel latitude and longitude data. That is, AIS data is resampled using linear interpolation at one-minute intervals to supplement the missing LAT and LON data of AIS data every minute. Since SOG and Heading are relatively stable in a short period of time, the average value is used instead of SOG and Heading for interpolation during this period.
[0053] The AIS data separation refers to separating the filtered AIS data to obtain separated trajectory sequence data. Specifically, it includes: grouping AIS data based on the ship's MMSI number to obtain the AIS trajectory data of each ship, and sorting the AIS trajectory data of each ship according to time based on the timestamp to obtain continuous ship trajectory sequence data of each ship.
[0054] Specifically, the raw AIS data is grouped by MMSI number, and the data for the same MMSI number (i.e., the same ship) is sorted by time. In this embodiment, the ship trajectory data is defined as T = {p0, p1, ..., p n}, where n is the number of valid samples for each ship, and p = (x, y) represents the specific location information of the ship at a certain moment; x represents the LON longitude; y represents the LAT latitude;
[0055] The AIS data extraction method involves using a sliding window method to extract the ship trajectory sequence data at a preset time step to obtain a ship trajectory data sample set.
[0056] Specifically, for ship trajectory sequence data T={p0,p1,…,p n}, since the model needs to learn to predict a target sequence of length Q based on an input sequence of length l, the length of the sliding window is set to l + Q; starting from the beginning of the trajectory sequence, a time window of length l + Q is taken, and the sliding window slides forward by a step of 1 each time to obtain a new trajectory sample, until the last ship trajectory point of the entire trajectory sequence is covered; after extracting the trajectory data, the preprocessing of the AIS data is completed, and a series of trajectory data samples are obtained as the ship trajectory data sample set input to the prediction model;
[0057] S3: constructing a ship trajectory prediction model, as shown in Figure 2 , and the ship trajectory prediction model comprises a ship trajectory time encoder, a ship trajectory space interaction encoder, a feature fusion module and a prediction decoder; based on the ship trajectory time encoder, the ship trajectory data sample is subjected to ship trajectory motion sequence coding to obtain ship time sequence features;
[0058] Specifically, assuming that there are N ships in a set sea area, the historical trajectories X = {X1, X2, …, XN} of all ships are received, and the ship trajectory prediction model is used to predict the future trajectories of all ships N}. The historical trajectory of ship i in a period of time t obs is defined as , wherein t e {1, …, t obs}, and the predicted trajectory of the ship in a future period of time t pred can be defined as , wherein t e {t obs +1, …, t pred}. represents the latitude and longitude value of ship i at time step t;
[0059] The ship trajectory time encoder is composed of multiple layers of ConvLSTM, which can extract the motion sequence features of each ship in the time dimension from the historical trajectory. First, the relative position of each ship in the current time step relative to the previous time step is calculated, and the expression is:
[0060]
[0061] In the formula: represents the latitude coordinate of ship i at time step t and t e {1, …, N} ; represents the latitude coordinate of ship i at time step t-1; represents the relative latitude position of the ship at time step t relative to time step t-1; represents the longitude coordinate of the ship at time step t; represents the longitude coordinate of ship i at time step t-1; represents the relative longitudinal position of the ship at time step t relative to time step t-1;
[0062] embedding the relative position into a fixed-length vector at each time step to obtain the embedding vector representation of the feature, which is expressed as
[0063]
[0064] wherein: represents the embedding of the relative position into a fixed-length vector at each time step; φ(·) represents an embedding function; W e represents an embedding weight;
[0065] embedding the fixed-length vector as the input of the ship trajectory temporal encoder to obtain the ship time series feature, which is expressed as
[0066]
[0067] wherein: φ(·) represents an embedding function; W e represents an embedding weight; represents the hidden state of the M-ConvLSTM of the ship i at time step t; W m represents the weight of the ship trajectory temporal encoder, and these parameters are shared by all ships in the sea area.
[0068] The ship trajectory spatial interaction encoder comprises a graph attention network layer and a spatial interaction encoding unit.
[0069] The graph attention network layer is configured to obtain aggregated trajectory features of different ships according to the ship time series feature; and the spatial interaction encoding unit is configured to obtain ship spatial interaction features with time continuity based on an adaptive graph pooling mechanism according to the aggregated trajectory features.
[0070] In a specific embodiment, considering that ship motion is an interactive activity, using a ConvLSTM for each ship cannot capture the spatial interactions between ships, and the interactions between different ships are different; in order to consider the continuity of spatial interactions between ships in the time dimension, this embodiment uses a graph attention network (GAT) to aggregate the hidden states of the ConvLSTM and establish a ship spatial interaction model with spatiotemporal awareness. In order to facilitate information exchange between various ships in complex and crowded scenarios, the social interactions between ships are modeled as a directed graph, and the ships in the scenario are regarded as nodes on the graph, with each node containing the sequence features of the ship. First, the hidden states of each ship trajectory feature are obtained using a ship trajectory encoder. Then, a graph attention mechanism is used to weight and sum the features of adjacent nodes, which is entirely dependent on node features and independent of the graph structure. Different ships exhibit different interaction behaviors, leading to different interactions between nodes in the directed graph. The attention mechanism helps encode the relative influence and potential spatial interactions between ships. A graph attention network (GAT) is used as an aggregation mechanism to assign different importance to different nodes, thus aggregating information from adjacent nodes. The input to the GAT layer comes from the embedding vector m = {m1, m2, ..., m...} of the hidden states obtained from the ship trajectory encoder. N}, where m i ∈R F R represents the number of nodes in the graph; F represents the feature dimension of each node, and the output of the GAT layer is m′={m′1,m′2,…,m′ N}, where m′ i ∈R F′ The input and output feature dimensions of a node can be unequal; a single graph attention layer, such as... Figure 4 As shown:
[0071] The hidden state of ship i in M-ConvLSTM at time step t After being fed into the attention layer graph, the formula for calculating the attention mechanism coefficient of node pair (i,j) is as follows:
[0072]
[0073] In the formula: || represents the join operation between hidden states; W∈R F′×F This represents the weight matrix of the shared linear transformation applied to each node; N represents the attention coefficients of ship node i and ship node j at time step t; i This represents the set of neighborhoods of node i in a directed graph obtained based on a graph attention network; 'a' represents the weight vector of a single-layer feedforward neural network, which is then normalized by a softmax function with a Leaky ReLU activation function to obtain the normalized attention coefficients. a T denotes the transpose of a;
[0074] An adaptive graph pooling (AGP) mechanism is used to reduce redundant ship spatial interaction and improve trajectory prediction accuracy. However, the traditional pooling method still needs to use a pooling rate parameter for manual graph screening in the calculation process, which limits its ability to dynamically determine the optimal value for each directed graph. To solve this problem, an adaptive distance threshold (ADT) is used to provide a dynamic threshold for each directed graph, greatly reducing the problem of losing important ship trajectory information in the pooling process.
[0075] An adaptive distance threshold function τ is used to reduce dense interactions, and when the initial value of is maintained; otherwise, set to 0, and finally obtain the attention coefficient after the adaptive graph pooling mechanism, whose expression is
[0076]
[0077] In the formula: τ represents the adaptive distance threshold function and τ ∈ [0, 1]; n represents the number of adjacent nodes of node i in the directed graph; ||{·} represents the selection function; represents the attention coefficient after the adaptive graph pooling mechanism; ||{·} represents the selection function;
[0078] The output ship spatial interaction feature of node i, i.e., ship i at time step t, after the adaptive graph pooling mechanism is
[0079]
[0080] In the formula: σ represents a nonlinear activation function, and two GAT layers are used in the adaptive graph pooling mechanism,
[0081] to obtain the ship spatial interaction feature
[0082] In this embodiment, in order to consider the continuity of the spatial interaction feature in the time dimension, the GAT aggregates the hidden state of the ConvLSTM, and the spatial interaction feature after the adaptive graph pooling mechanism is
[0083] After that, a spatial interaction encoding unit is used to establish a ship spatial interaction model with spatiotemporal perception, i.e., the spatial interaction encoding unit is composed of a ConvLSTM unit, which is referred to as a G-ConvLSTM to capture the feature vector of the ship spatial interaction feature with time continuity, and its expression is
[0084]
[0085] wherein W represents the weight of the spatial interaction encoder; g represents the weight of the spatial interaction encoder; represents the feature vector of the interaction feature with time continuity; represents the feature vector of the interaction feature with time continuity of the ship i at the time step t-1;
[0086] The feature fusion module is configured to fuse the ship time sequence feature and the ship spatial interaction feature, obtain an intermediate state vector, and take the intermediate state vector as a hidden state vector of a current time step;
[0087] In specific embodiments, in the ship trajectory time encoder, the motion sequence feature of each ship is modeled by using M-ConvLSTM, the time continuity of the spatial interaction between ships is modeled by using G-ConvLSTM, the spatial feature of the ship interaction with time continuity is obtained, and the spatio-temporal information fusion of the ship trajectory is realized by fusing these high-level features; at the time step t obs , the ship time sequence feature and the ship feature vector obtained by each ship passing through the ship trajectory time encoder and the ship trajectory spatial interaction encoder are taken as two hidden state variables and and the two are fused by a series operation to obtain an intermediate state vector , the expression of which is
[0088]
[0089] wherein represents the series operation between vectors; represents the observed ship i at the time step t obs , and contains the spatio-temporal features of the ship;
[0090] The prediction decoder is configured to predict and obtain the hidden state vector of the next time step, i.e., the position corresponding to the next time step of the ship, according to the intermediate state vector.
[0091] Specifically, D-ConvLSTM is used as the prediction decoder to predict the future trajectory of the ship, as the initial hidden state input of the prediction decoder, to predict the future trajectory of the ship. The prediction decoder predicts the hidden state vector of the next time step as The predicted relative position of the ship is , the expression of which is
[0092]
[0093] wherein W represents the weight of the spatial interaction encoder; ddenotes a weight of a prediction decoder; mlp(·) denotes a linear layer; denotes a fixed-length vector at time step t obs ; denotes an intermediate state vector at time step t obs +1; denotes a hidden state of a ship trajectory temporal encoder at time step t obs ; denotes a feature vector of an interaction feature output by a spatial interaction encoding unit and having temporal continuity at time step t obs ; denote a horizontal coordinate and a vertical coordinate of a ship at time step t obs +1, respectively;
[0094] S4: model training and model verification are performed on the ship trajectory prediction model based on the training set and the verification set to obtain an optimal ship trajectory prediction model, and then the prediction of the ship trajectory is realized through the optimal ship trajectory prediction model, specifically including the following steps
[0095] S41: the training set is input into the constructed ship trajectory prediction model for model training, and a trained ship trajectory prediction model is obtained;
[0096] S42: the trained ship trajectory prediction model is verified through the verification set;
[0097] that is, whether the output of the trained ship trajectory prediction model converges is determined;
[0098] if the output of the trained ship trajectory prediction model converges, it is confirmed that the trained ship trajectory prediction model at this time is the optimal ship trajectory prediction model;
[0099] wherein the loss function Loss for determining whether the output of the trained ship trajectory prediction model converges, that is, the L2 loss is taken as a loss function to measure the similarity between the generated prediction trajectory and the real trajectory, and the expression is
[0100]
[0101] In the formula: denotes a prediction trajectory of a ship i; Y i denotes a real trajectory of the ship i;
[0102] In this embodiment, the model is trained by minimizing the loss function, so as to achieve optimal performance and realize the prediction of the future trajectory of the ship, so that effective collision avoidance strategies can be taken in time to ensure the safety of maritime transportation;
[0103] Otherwise, based on the back propagation algorithm, the weight parameters of the trained ship trajectory prediction model are adaptively adjusted, and step S41 is repeatedly executed until the weight parameters of the trained ship trajectory prediction model output are confirmed to be optimal weight parameters and the ship trajectory prediction model is reconstructed to obtain an optimal ship trajectory prediction model.
[0104] Compared with the prior art, the embodiment provides a ship trajectory prediction method based on a spatio-temporal adaptive graph pool. A ship trajectory prediction model based on a spatio-temporal adaptive graph pool, namely an STCLAGP model, adopts an encoder-decoder structure. The ship trajectory motion is sequentially encoded by a ship trajectory time encoder, which can extract the motion sequence features of each ship in the time dimension from the historical trajectory. In a spatial interaction encoding unit, based on an adaptive graph pool mechanism, an adaptive distance threshold is used to eliminate redundant interactions, a sparse directed graph is constructed, and the ship spatial interaction features with time continuity are obtained, so as to eliminate the useless features in the ship interaction. A feature fusion module is used to fuse the ship time sequence features and the ship spatial interaction features into an intermediate state vector, and the intermediate state vector is used as the hidden state vector of the current time step, which is input into a prediction decoder to predict and obtain the position corresponding to the next time step of the ship, so as to realize the ship trajectory prediction, and greatly improve the prediction accuracy and efficiency of the ship trajectory.
[0105] 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 that: 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 ship trajectory prediction method based on spatiotemporal adaptive graph pooling, characterized in that, Specifically, the following steps are included: S1: Obtain raw AIS data of the ship's trajectory; S2: Perform data preprocessing on the raw AIS data to obtain a sample set of ship trajectory data; The ship trajectory data sample set was randomly divided into a training set and a validation set. S3: Construct a ship trajectory prediction model, which includes a ship trajectory time encoder, a ship trajectory spatial interaction encoder, a feature fusion module, and a prediction decoder. Based on the ship trajectory time encoder, ship trajectory data samples are encoded with ship trajectory motion sequence to obtain ship time series features; The ship trajectory spatial interactive encoder includes a graph attention network layer and a spatial interactive coding unit; The graph attention network layer is used to obtain the aggregated trajectory features of different ships based on the ship time series features; The spatial interaction coding unit is used to obtain ship feature vectors with temporally continuous ship spatial interaction features based on the adaptive graph pooling mechanism and aggregated trajectory features. The spatial interaction coding unit has the following model expression: In the formula: || represents the connection operation between hidden states; W represents the weight matrix of the shared linear transformation applied to each ship node; N represents the attention coefficients of ship node i and ship node j at time step t; i This represents the set of neighborhoods of node i in a directed graph based on a graph attention network; 'a' represents the weight vector of a single-layer feedforward neural network; a T τ represents the transpose of a; τ represents the adaptive distance threshold function and τ∈[0,1]; n represents the number of neighboring nodes of node i in the directed graph; ∥{·} represents the selection function; σ represents the attention coefficient after the adaptive graph pooling mechanism; σ represents the non-linear activation function. Indicates the spatial interaction characteristics of ships; W g Represents the weights of the spatial interactive encoder; A feature vector representing interactive features that are continuous over time; The feature vector representing the temporal continuity interaction characteristics of ship i at time step t-1; This represents the hidden state of the ship trajectory time encoder at time step t for ship i; the feature fusion module is used to fuse the ship time series features with the ship feature vector to obtain the intermediate state vector, and use the intermediate state vector as the hidden state vector for the current time step. The predictive decoder is used to predict and obtain the hidden state vector for the next time step based on the intermediate state vector, that is, the position of the ship at the next time step. S4: Based on the training set and validation set, the ship trajectory prediction model is trained and validated to obtain the optimal ship trajectory prediction model, and then the ship trajectory is predicted through the optimal ship trajectory prediction model.
2. The ship trajectory prediction method based on spatiotemporal adaptive graph pooling according to claim 1, characterized in that, The data preprocessing of AIS raw data described in S2 includes AIS data filtering, AIS data separation and AIS data extraction in sequence. The AIS data filtering includes at least the following: deleting AIS data whose ship MMSI number is not a preset number of digits; deleting AIS data containing null values; deleting AIS data whose ship speed (SOG) and heading (COG) exceed a preset threshold range; deleting AIS data containing fewer than a preset number of ships at the same timestamp, and randomly deleting AIS data with duplicate timestamps corresponding to the same ship MMSI number; and resampling AIS data using linear interpolation at a preset interval sampling period to supplement missing ship latitude and longitude data. The AIS data separation refers to separating the filtered AIS data to obtain separated trajectory sequence data, specifically including: AIS data is grouped based on the ship's MMSI number to obtain the corresponding AIS trajectory data for each ship. Based on the timestamp, the AIS trajectory data of each ship is sorted by time to obtain continuous ship trajectory sequence data for each ship. The AIS data extraction method employs a sliding window approach to extract ship trajectory sequence data at a preset time step to obtain a sample set of ship trajectory data.
3. The ship trajectory prediction method based on spatiotemporal adaptive graph pooling according to claim 2, characterized in that, The ship trajectory time encoder described in S3 has the following model expression: In the formula: Let represent the latitudinal coordinates of ship i at time step t, where t∈{1,…,N}; This represents the latitude coordinate of ship i at time step t-1; This indicates the ship's relative latitudinal position at time step t relative to time step t-1; Represents the longitude coordinates of the ship at time step t; This represents the longitude coordinates of ship i at time step t-1; This indicates the ship's relative longitude position at time step t relative to time step t-1; The relative position is embedded into a fixed-length vector at each time step; φ(·) represents the embedding function; W e Indicates the embedding weights; This represents the hidden state of the ship trajectory time encoder at time step t for ship i. W m This represents the weights of the ship trajectory time encoder.
4. The ship trajectory prediction method based on spatiotemporal adaptive graph pooling according to claim 3, characterized in that, The predictive decoder described in S3 has the following model expression: In the formula: W d This represents the weights of the predictive decoder; mlp(·) represents the linear layer; This indicates that at time step t obs A fixed-length vector at time; This indicates that at time step t obs The intermediate state vector at +1; This indicates that at time step t obs At that time, the hidden state of the ship trajectory time encoder; This indicates that at time step t obs At that time, the spatial interaction coding unit outputs a feature vector with temporally continuous interaction characteristics; These represent the ship's position at time step t. obs The x and y coordinates of the position corresponding to +1.
5. The ship trajectory prediction method based on spatiotemporal adaptive graph pooling according to claim 1, characterized in that, S4 specifically includes the following steps. S41: Input the training set into the constructed ship trajectory prediction model to train the model and obtain the trained ship trajectory prediction model; S42: Validate the trained ship trajectory prediction model using the validation set; That is, to determine whether the output of the trained ship trajectory prediction model has converged; If the output of the trained ship trajectory prediction model converges, then the trained ship trajectory prediction model is confirmed to be the optimal ship trajectory prediction model. Otherwise, based on the backpropagation algorithm, the weight parameters of the trained ship trajectory prediction model are adaptively adjusted, and step S41 is repeated until the weight parameters of the trained ship trajectory prediction model that has converged are confirmed to be the optimal weight parameters, and the ship trajectory prediction model is reconstructed to obtain the optimal ship trajectory prediction model.
6. The ship trajectory prediction method based on spatiotemporal adaptive graph pooling according to claim 5, characterized in that, In S42, the loss function Loss, which determines whether the output of the trained ship trajectory prediction model converges, is... In the formula: Y represents the predicted trajectory of ship i; i This represents the actual trajectory of ship i.
Citation Information
Patent Citations
Ship trajectory prediction method and system based on deep learning
CN117408372A
Multi-ship trajectory prediction method and system based on dynamic space-time refinement network
CN117743795A