A Long-Series Spatiotemporal Prediction Method for Ship Traffic Flow Based on ST-Informer

By combining the ST-Informer model with graph attention neural networks and sparse self-attention modules, the problem of spatiotemporal linkage and long-sequence prediction of maritime vessel traffic flow was solved, and efficient spatiotemporal correlation prediction of vessel traffic flow in multiple port areas was achieved.

CN116821784BActive Publication Date: 2025-10-28CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310517450.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2025-10-28
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively construct spatiotemporal linkage models of maritime vessel traffic flow, and their predictive performance is inadequate in long-series time-series forecasting.

Method used

The ST-Informer model is adopted, which combines graph attention neural network and sparse self-attention module. Spatiotemporal feature extraction and prediction are performed by constructing adjacency matrix and feature matrix. The model is trained by encoder and decoder, and future information is shielded to improve prediction accuracy.

Benefits of technology

It enables spatiotemporal correlation prediction of ship traffic flow in multiple port areas, improves the accuracy and generalization ability of long-sequence time series prediction, and is suitable for the complex road network structure of maritime ship traffic flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821784B_ABST
    Figure CN116821784B_ABST
Patent Text Reader

Abstract

This invention relates to a long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer. This invention predicts ship traffic flow over long periods by establishing a spatiotemporal fusion model. The main method employed is based on the ST-Informer model. First, the Automatic Identification System (AIS) data is cleaned and preliminarily statistically analyzed to extract ship traffic flow data for different time periods in each port area. Second, the ship traffic flow data is filled with default values ​​and standardized. Then, adjacency matrices and feature matrices are constructed based on the distances between ports and historical ship traffic flow data. Finally, the ship traffic flow in each port area is predicted based on the ST-Informer model. This invention, starting from the topological structure and long-sequence perspective of the maritime transportation network, fully considers the spatiotemporal characteristics inherent in ship traffic flow data, effectively improving the accuracy of long-sequence ship traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of waterway traffic flow prediction methods, and specifically relates to a long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer. Background Technology

[0002] Currently, although significant progress has been made in ship traffic flow prediction research, several challenges remain: 1) Traditional ship traffic flow prediction methods mostly model ship traffic flow data for single areas, neglecting the traffic conditions and spatiotemporal dependencies between port areas. This results in predictions that fail to consider the spatiotemporal linkage of ship traffic flows. Therefore, constructing a complex maritime traffic network structure to achieve spatiotemporal linkage prediction of ship traffic flows across multiple port areas is a current research challenge. 2) Existing research focuses more on short-term traffic flow prediction. When faced with long-term maritime ship traffic flow prediction tasks, most existing models suffer from insufficient prediction performance. Therefore, improving the long-term time-series prediction performance of these models remains a difficult bottleneck to overcome.

[0003] With the rapid development of deep learning technology, data-driven deep learning methods have provided new ideas and approaches for research on ship traffic flow prediction. Many deep learning models have been proposed and applied to maritime traffic flow research. Among them, graph attention neural networks (GNNs) are particularly suitable for the natural topology of maritime shipping networks, enabling research on maritime ship traffic flow prediction based on GNNs. Furthermore, compared to traditional recurrent neural network models, the Informer model exhibits better predictive performance and generalization ability in long-sequence time-series prediction tasks, further improving the accuracy of long-sequence time-series ship traffic flow prediction, thus facilitating better planning of ship routes and available ports of call. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer.

[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows:

[0006] The long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer includes the following steps:

[0007] Step 1: Extract navigation data from the Automatic Identification System (AIS) data to obtain the ship traffic flow entering and leaving each port area at each time point within a certain period;

[0008] Step 2: Fill in the missing ship traffic flow data at the corresponding time by using the average value of ship traffic flow data in the same time period before and after, and normalize all ship traffic flow data.

[0009] Step 3: Construct the adjacency matrix A and the feature matrix X. Assuming the number of traffic nodes in the port area is N, the water transportation network is represented as G = (V N ,E,A),V N Let E represent the set of N nodes; E is the set of edges connecting the nodes; and A is the adjacency matrix, representing the connection status of each node.

[0010] A feature matrix X is constructed based on the historical ship traffic flow of each port area according to statistics:

[0011]

[0012] In the formula, This represents the ship traffic flow in port area i at time t, where m represents the time data dimension.

[0013] Step 4: Obtain the feature sequence using the feature matrix X. Where x i For the i-th column of the characteristic matrix X, the characteristic sequence X en After position encoding, it is input into the encoder along with the adjacency matrix A to process the labeled sequence X. token Concatenate with the placeholder X0 to obtain X de Then for X de After position encoding, it is input into the decoder along with the adjacency matrix A;

[0014] Step 5: The encoder is used to combine the adjacency matrix A and utilize a graph attention neural network and a sparse self-attention module to process the feature sequence X. en Spatiotemporal feature extraction is performed, followed by self-attention distillation. The output of the last spatiotemporal feature extraction module is then used as the key and value vectors and input into the cross-attention module of the decoder. The decoder is used to combine X... en The high-order spatiotemporal feature representation (HE) is obtained by extracting spatiotemporal features from the input data using a graph attention neural network, a sparse self-attention module of the mask, and a cross-attention module, thus yielding the decoder's output data (HD). l ;

[0015] Step 6, Decoder output data HD l The final predicted sequence is obtained after passing through a fully connected layer. And extract the last L. y The predicted values ​​at each time step are used as the ship traffic flow prediction result Y. output ;

[0016] Step 7: Based on the predicted and actual ship traffic flow, calculate the loss value using the loss function. Repeat step 5 to train the spatiotemporal prediction model based on graph attention neural network, adjust the model parameters, and train the model until the loss function is minimized. The model training is then complete, and the final ship traffic flow prediction model is obtained.

[0017] Step 8: Use the final ship traffic flow prediction model to predict future ship traffic flow.

[0018] Furthermore, the specific process of step 1 is as follows: First, the AIS data is cleaned and navigation vessel data is extracted by setting a speed threshold; then, according to the vessel identification number and update time, the discrete point data provided by AIS is converted into continuous track lines, and the intersection algorithm is used to determine whether each vessel track intersects with the defined port area boundary within a set time range; finally, the port entry / exit attribute is determined based on whether the vessel's track point before passing the port area boundary is within the port area. If so, the vessel data of the corresponding vessel is stored in the corresponding port entry / exit database, and the vessel traffic flow in and out of the port area is calculated by considering the vessel conversion factor.

[0019] Furthermore, in step 3, A = Q N×N +I N×N , among which, I N×N Let Q be an identity matrix with N rows and N columns. N×N From element Q ij Composition, where i∈{0,1,…,N}, j∈{0,1,…,N};

[0020]

[0021] In the formula, σ and ∈ are hyperparameters, and d ij Q represents the Euclidean distance between two ports. ij It represents the connection between port area i and port area j.

[0022] Furthermore, in step 4:

[0023]

[0024] Among them, the last L in the traffic flow input sequence is extracted. token Each time step feature is used as a label sequence. It is a marker sequence. L is a placeholder filled with 0 values ​​reserved for the predicted sequence. token L is the length of the labeled sequence. y The length of the output sequence is given by Concat(·), which represents feature concatenation.

[0025] Furthermore, in step 4, the meaning of position encoding is to add position information to the feature sequence. The specific steps include local timestamp representation, global timestamp representation, and balance factor mapping scaling to obtain long sequence time encoding. Finally, the result of long sequence time encoding is added to the feature sequence.

[0026] Furthermore, in step 5, the encoder includes multiple spatiotemporal feature extraction modules and a self-attention distillation module. The self-attention distillation module is located between two adjacent spatiotemporal feature extraction modules. The spatiotemporal feature extraction module includes a graph attention neural network and a sparse self-attention module. The graph attention neural network is used to extract spatial features from the input data based on the adjacency matrix A. The sparse self-attention module is used to extract temporal features from the input data. A one-dimensional convolutional neural network is used to perform dimensionality transformation to enhance the nonlinear expressive power of the model. The self-attention distillation module is used for model lightweighting, shortening the length of the input sequence by half, thereby reducing the memory usage of the stacked layers. The output data is then input to the next-level spatiotemporal feature extraction module. Finally, the output results of the multi-level spatiotemporal feature extraction modules are connected, and the connected high-order spatiotemporal feature representation HE is used as the query vector and key vector and input to the cross-attention module of each level of the decoder block.

[0027] Furthermore, in step 5, the entire decoder architecture includes multiple cascaded decoder blocks. Each decoder block includes a spatiotemporal feature extraction module for masking, a cross-attention module, and a one-dimensional convolutional neural network. The spatiotemporal feature extraction module for masking includes a graph attention neural network and a sparse self-attention module for masking. The graph attention neural network is used to extract spatial features from the input data based on the adjacency matrix A. The sparse self-attention module for masking information from future time steps is used to extract temporal features from the input data. The cross-attention module is used to calculate the interaction between two different input sequences by utilizing the interdependencies between the key vector and value vector output by the encoder and the query vector output by the sparse self-attention module for masking. The output data is then transformed by a one-dimensional convolutional neural network and input into the spatiotemporal feature extraction module of the next-level decoder block. The output of the final-level decoder block is the decoder output data HD. l .

[0028] Furthermore, in step 7, the L2 norm training loss function MAELoss(f(x;θ),y) is calculated using the following formula:

[0029] MAELoss(f(x;θ),y)=(f(x;θ)-y) 2

[0030] Where x represents the input sample, θ represents the parameters required by the model, f(x; θ) represents the predicted value of the model when the input sample is x and the model parameters are θ, and y represents the actual value corresponding to x.

[0031] The beneficial effects of this invention are as follows: (1) This invention uses the Informer model to predict ship traffic flow. Compared with RNN and its variant models, Informer is more suitable for capturing long-term dependencies between long sequence inputs and outputs due to its advantages such as efficient parallel computing, adaptive sequence length, and multi-scale time feature fusion. (2) This invention introduces a graph attention neural network to mine the spatiotemporal variation patterns of ship traffic flow and realize the spatiotemporal correlation between ship traffic flow in multiple port areas. The decoder of the ST-Informer model of this invention uses masked sparse self-attention and cross attention for time feature extraction. Masked sparse self-attention can shield information from future time steps, thereby avoiding autoregression, while cross attention uses the feature vectors output by the encoder and masked sparse self-attention to extract features, so as to improve the accuracy and generalization ability of long sequence prediction of ship traffic flow.

[0032] Attached illustrations

[0033] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0034] Figure 2 A logic diagram for extracting ship traffic flow data;

[0035] Figure 3 Here is a diagram of the ST-Informer model structure;

[0036] Figure 4 Here is a structural diagram of the spatiotemporal feature extraction module;

[0037] Figure 5 This is a diagram illustrating the prediction results. Detailed Implementation

[0038] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0039] like Figure 1 As shown, the long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer includes the following steps:

[0040] Step 1: AIS Data Cleaning and Vessel Traffic Flow Extraction. First, AIS data is cleaned and navigation vessel data is extracted by setting a speed threshold. Then, based on the vessel identification number (MMSI) and update time (lasttime), the discrete point data provided by AIS is converted into continuous tracks. An intersection algorithm is used to sequentially determine whether each vessel track intersects with the defined port area boundary within a set time range. Finally, based on whether the vessel's previous track point before passing the port area boundary was within the port area, its entry / exit attribute is determined. Vessel data meeting the above conditions are stored in the corresponding entry / exit database, and vessel traffic flow in and out of the port area is calculated considering vessel conversion factors. The specific process is as follows: Figure 2 As shown;

[0041] Step 2: Data Preprocessing. First, the missing values ​​at a given time are filled using the average of data from the same time period before and after a specific moment. Then, Min-Max normalization is used to eliminate the influence of units on the prediction results. (Original sample x) original The transformation formula for x′ obtained through Min-Max normalization is as follows:

[0042]

[0043] Step 3: Construct the adjacency matrix and the feature matrix.

[0044] First, assuming the number of port areas under study is N, the water transport network can be represented as G = (V N ,E,A N×N V N Let A represent the set of N nodes; E is the set of edges connecting the nodes. N×N It is an adjacency matrix, representing the connectivity of each node. This invention constructs the adjacency matrix A based on the distances between port areas and sets certain parameters. N×N , to represent the spatial topology of the waterway network, the calculation formula is as follows:

[0045]

[0046] A N×N =Q N×N +I N×N

[0047] In the formula, σ and ∈ are hyperparameters, set to 6e-6 and 0.5 respectively, and d ij Q represents the Euclidean distance between two ports. ij This represents the connection relationship between vertices i and j. After adding self-connections, the resulting adjacency matrix A is formed. N×N This solves the self-propagation problem. The elements in matrix A can only take two values: 0 and 1. 1 indicates that the two nodes are connected or self-connected, while 0 indicates that the two nodes are not connected.

[0048] Secondly, a feature matrix was constructed based on the historical vessel traffic flow statistics for each port area, with each port area occupying one row. Furthermore, the port area indices in the feature matrix must match the port area indices in the constructed adjacency matrix. The constructed spatial feature matrix is ​​represented as follows:

[0049]

[0050] In the formula, the eigenvector X represents the traffic state at consecutive time steps. Let m represent the feature vector of the i-th node at time step t, m represent the data dimension, and N represent the number of traffic nodes.

[0051] The ultimate goal is to learn the mapping function F(·), where the input is the feature vectors of the past m time steps, and the output is the feature vectors predicted for the next n time steps. It is represented as follows:

[0052] Y n×N =F(X) m×N ,G)

[0053] Step 4: Predict ship traffic flow based on the ST-Informer model. This includes the following steps:

[0054] S41, Construct a long-sequence spatiotemporal model based on ST-Informer. The basic structure of the ST-Informer model is Encoder-Decoder, and both its encoder and decoder architectures are deep architectures composed of multiple encoders and decoders to improve the model's learning ability. The encoder is responsible for encoding historical spatiotemporal sequences, and the decoder is responsible for predicting future spatiotemporal sequences. This invention adds a graph attention neural network to the Informer model to improve the encoder and decoder, achieving long-sequence prediction of spatiotemporal sequence data. The structure is as follows: Figure 3 As shown.

[0055] Specifically, the input data of the encoder and decoder must first be represented by spatiotemporal embedding. Graph structure embedding is an adjacency matrix that represents the connection relationship between each port area, which is used by the graph attention neural network to extract the spatial features of ship traffic flow. Location embedding adopts a unified input representation method, adding location information to the feature sequence, which includes three parts: local timestamp representation, global timestamp representation, and balance factor.

[0056] (1) Local timestamp encoding

[0057] PE(pos,2i)=sin(pos / (2L x ) 2i / d_model )

[0058] PE(pos,2i+1)=cos(pos / (2L x ) 2i / d_model )

[0059] Where pos represents the embedding position, i represents the dimension index, and its value ranges from [0, d_model / 2), L x d_model represents the length of the input sequence and the dimension of the node embedding.

[0060] (2) Global timestamp encoding

[0061] For each type of global timestamp (such as weekday, hour, holiday, etc.), a learnable timestamp embedding representation SE can be assigned to it. (pos) Furthermore, each type of timestamp embedding representation has a fixed vocabulary size.

[0062] Model input is The balance factor uses one-dimensional convolution to convert x i Mapped to the d_model dimension, with u i The dimensions are aligned, and scaling is performed using the hyperparameter α to obtain the long sequence temporal encoding:

[0063]

[0064] Here, p represents the number of global information stamp types; if the input has been standardized, α = 1 will be used, and j represents the dimension index of the vector. Finally, the result of the long sequence time encoding is added to the input X.

[0065] Specifically, the entire encoder architecture is composed of L en A spatiotemporal feature extraction module and L en It consists of -1 self-attention distillation layers. The core component of a single encoder is the spatiotemporal feature extraction module, such as... Figure 4 As shown, this module consists of a graph attention neural network (GAT) and a sparse self-attention mechanism.

[0066] In the l-th layer encoder, firstly, a graph attention neural network is used to process the historical time series of the input. The process involves first extracting features from spatially related neighboring nodes of the target node; then, a sparse attention mechanism is used to assess the importance of features at different time steps within the input sequence to reduce computational bottlenecks, thereby obtaining a spatiotemporal feature representation. The specific calculation formula is as follows:

[0067]

[0068] Where GAT(·) represents the operation of graph attention network to extract spatial features, and ProbSparse(·) represents the operation of multi-head sparse self-attention to extract the importance of different time steps.

[0069] Then, the information from the output of the spatiotemporal feature extraction module is processed through a convolutional neural network consisting of a one-dimensional convolutional layer (Conv1D) and a ReLU activation function. Perform a dimensional transformation to obtain HE l This enhances the nonlinear expressive power of the model. During the stacking process of the ST-Informer model, each layer incorporates self-attention distillation on top of the previous layer for lightweight processing. This reduces the dimensionality of the probabilistic sparse self-attention feature map to half its original dimension, thereby reducing storage requirements and accelerating model inference. The specific implementation formula for distillation in the l-th layer encoder is as follows:

[0070]

[0071] Here, Conv1d(·) represents a one-dimensional convolution operation on the time series, using ELU as the activation function. A self-attention distillation mechanism is used to filter and weight important information in the sequence, resulting in a more accurate and effective representation.

[0072] Finally, all features output by the encoder are concatenated, and the output information of the spatiotemporal feature extraction module is converted into query vectors and key vectors HE, which are then used as input to the cross-attention module in each decoder. The resulting query vectors and key vectors contain local contextual information.

[0073] Specifically, the entire decoder architecture is similar to the encoder architecture, consisting of L de The ST-Informer model consists of several decoders, each containing a spatiotemporal feature extraction module for masking, a cross-attention mechanism, and a one-dimensional convolutional neural network module. The ST-Informer decoder employs a generative approach, outputting all predictions at once, thus eliminating the limitations of serial decoding. Furthermore, the difference between the ST-Informer model's decoder and encoder lies in the decoder's use of sparse self-attention and cross-attention for temporal feature extraction. Sparse self-attention masks information from future time steps, preventing autoregression, while cross-attention utilizes the feature vectors output by the encoder and sparse self-attention to extract features.

[0074] The specific process is to first set the input of the decoder to:

[0075]

[0076] in, It is a labeled sequence, that is, the last L in the traffic flow input sequence. token Each time step feature is used as a label sequence. L is a placeholder filled with 0 values ​​reserved for the predicted sequence. token L is the length of the labeled sequence. y The length of the output sequence is given by Concat(·), which represents feature concatenation.

[0077] In the l-th layer decoder, the encoder's feature vector HE is used to generate the key vector and value vector, while the mask's sparse self-attention feature vector... The query vectors are then generated and fed into the cross-attention mechanism module. They are then transformed by a convolutional neural network consisting of a one-dimensional convolutional layer (Conv1D) and a ReLU activation function to obtain the decoder's output HD. l Finally, the final predicted sequence is obtained after passing through a fully connected layer. And extract the last L. y The predicted value at each time step is used as the actual predicted output Y. output .

[0078] The specific decoder output is:

[0079]

[0080] Here Corresponding to X token The output of the labeled sequence is not included in the calculation of the loss function. This is the actual predicted output.

[0081] S42, the constructed ST-Informer model is trained using the training set, and the model's fit is evaluated and adjusted using the validation set. The loss function is trained using the L2 norm to obtain the trained ST-Informer model. The calculation formula is as follows:

[0082] MAELoss(f(x;θ),y)=(f(x;θ)-y) 2

[0083] Where x represents the input sample of the deep learning model, θ represents the parameters required by the model, f(x; θ) represents the predicted value of the model when the input sample is x and the model parameters are θ, and y represents the actual value corresponding to x.

[0084] The model sets the number of iterations and batch size to 150 and 50 respectively, with a learning rate of 3e-4, and uses the RAdam optimizer for internal parameter tuning. Then, the GAT model's attention mechanism heads are set to 8. For the Informer model, which consists of 3 encoders and 2 decoders, the multi-head attention mechanism heads for each encoder are set to 12, and a dropout layer is added to prevent overfitting. Finally, during model training, if the validation set loss value does not decrease after more than 30 epochs, training is stopped using earlystop to avoid overfitting. When the model converges, training is stopped, the model parameters are saved, and the final ship traffic flow prediction model is obtained.

[0085] S43 inputs the test set and adjacency matrix into the trained ship traffic flow prediction model and outputs the ship traffic flow for each port area in the future time period.

[0086] Experimental results

[0087] This invention was tested on a dataset from Ningbo-Zhoushan Port. The prediction results on the test set are as follows: Figure 5 As shown. Its mean absolute error (MAE), root mean square error (RMSE), explained variance, and coefficient of determination (R²) are presented. 2 The values ​​are 2.0153, 2.5579, 0.8744 and 0.8736, respectively.

[0088] like Figure 5 Experimental results show that the prediction method based on ST-Informer proposed in this invention can more accurately capture the potential spatial and temporal correlations in ship traffic flow, and achieve better prediction capabilities in solving the long-sequence prediction problem of ship traffic flow in multiple port areas.

[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A long-sequence spatiotemporal prediction method for ship traffic flow based on ST-Informer, characterized in that, Includes the following steps: Step 1: Extract navigation data from the Automatic Identification System (AIS) data to obtain the ship traffic flow entering and leaving each port area at each time point within a certain period; Step 2: Fill in the missing ship traffic flow data at the corresponding time by using the average value of ship traffic flow data in the same time period before and after, and normalize all ship traffic flow data. Step 3: Construct the adjacency matrix A and the feature matrix X. Assuming the number of traffic nodes in the port area is N, the water transportation network is represented as G = (V N ,E,A),V N Represents a set of N nodes; E is the set of edges connecting nodes; A is the adjacency matrix, representing the connection status of each node; A feature matrix X is constructed based on the historical ship traffic flow of each port area according to statistics: Where, This represents the ship traffic flow in port area i at time t, where m represents the time data dimension. Step 4: Obtain the feature sequence using the feature matrix X. where x i For the i-th column of the characteristic matrix X, the characteristic sequence X en After position encoding, it is input into the encoder along with the adjacency matrix A to process the labeled sequence X. token Concatenate with the placeholder X0 to obtain X de Then for X de After position encoding, it is input into the decoder along with the adjacency matrix A; Step 5: The encoder is used to combine the adjacency matrix A and utilize a graph attention neural network and a sparse self-attention module to process the feature sequence X. en Spatiotemporal feature extraction is performed, followed by self-attention distillation. The output high-order spatiotemporal feature representation (HE) is then input into the cross-attention module of the decoder, which is used to combine X... en The high-order spatiotemporal feature representation (HE) is obtained by extracting spatiotemporal features from the input data using a graph attention neural network, a sparse self-attention module of the mask, and a cross-attention module, resulting in the decoder's output data (HD). l ; Step 6, Decoder output data HD l The final predicted sequence is obtained after passing through a fully connected layer. And extract the last L. y The predicted values ​​at each time step are used as the ship traffic flow prediction result Y. output ; Step 7: Based on the predicted and actual ship traffic flow, calculate the loss value using the loss function. Repeat step 5 to train the spatiotemporal prediction model based on graph attention neural network, adjust the model parameters, and train the model until the loss function is minimized. The model training is then complete, and the final ship traffic flow prediction model is obtained. Step 8: Use the final ship traffic flow prediction model to predict future ship traffic flow.

2. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, The specific process of step 1 is as follows: First, the AIS data is cleaned and navigation vessel data is extracted by setting a speed threshold; then, the discrete point data provided by AIS is converted into continuous tracks according to the vessel identification number and update time, and the intersection algorithm is used to determine whether each vessel track intersects with the defined port area boundary within a set time range; finally, the port entry / exit attribute is determined based on whether the vessel's previous track point before passing the port area boundary is within the port area. If so, the vessel data of the corresponding vessel is stored in the corresponding port entry / exit database, and the vessel traffic flow in and out of the port area is calculated by considering the vessel conversion factor.

3. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, In step 3, A = Q N×N +I N×N , where I N×N Let Q be an identity matrix with N rows and N columns. N×N From element Q ij Composition, where i∈{0,1,…,N-1}, j∈{0,1,…,N-1}; In the formula, σ and ∈ are hyperparameters, and d ij Q represents the Euclidean distance between two ports. ij It represents the connection between port area i and port area j.

4. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, In step 4, position encoding means adding position information to the feature sequence. The specific steps include local timestamp representation, global timestamp representation, and balancing factor mapping scaling to obtain long sequence time encoding. Finally, the result of long sequence time encoding is added to the feature sequence.

5. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, In step 4: Among them, the last L in the traffic flow input sequence is extracted. token Each time step feature is used as a label sequence. It is a marker sequence. L is a placeholder filled with 0 values ​​reserved for the predicted sequence. token L is the length of the labeled sequence. y The length of the output sequence is given by Concat(·), which represents feature concatenation.

6. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, In step 5, the encoder architecture includes multiple cascaded spatiotemporal feature extraction modules and a self-attention distillation module. The self-attention distillation module is located between two adjacent spatiotemporal feature extraction modules. The spatiotemporal feature extraction module includes a graph attention neural network and a sparse self-attention module. The graph attention neural network is used to extract spatial features from the input data based on the adjacency matrix A. The sparse self-attention module is used to extract temporal features from the input data. A one-dimensional convolutional neural network is used to transform the dimensionality of the output information of the spatiotemporal feature extraction module to enhance the nonlinear expressive power of the model. The self-attention distillation module is used for model lightweighting, shortening the length of the input sequence by half, thereby reducing the memory usage of the stacked layers. The output data is then input to the next-level spatiotemporal feature extraction module. Finally, the output results of the multi-level spatiotemporal feature extraction modules are connected, and the connected high-order spatiotemporal feature representation HE is used as the query vector and key vector and input to the cross-attention module of each level of the decoder block.

7. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 6, characterized in that, In step 5, the decoder architecture includes multiple cascaded decoder blocks. Each decoder block includes a spatiotemporal feature extraction module for masking, a cross-attention module, and a one-dimensional convolutional neural network. The spatiotemporal feature extraction module for masking includes a graph attention neural network and a sparse self-attention module for masking. The graph attention neural network is used to extract spatial features from the input data based on the adjacency matrix A. The sparse self-attention module for masking information from future time steps is used to extract temporal features from the input data. The cross-attention module is used to calculate the interaction between two different input sequences by utilizing the interdependencies between the key vector and value vector output by the encoder and the query vector output by the sparse self-attention module for masking. The output data is then transformed by a one-dimensional convolutional neural network and input to the spatiotemporal feature extraction module of the next-level decoder block. The output of the last-level decoder block is the decoder output data HD. l .

8. The method for long-sequence spatiotemporal prediction of ship traffic flow based on ST-Informer according to claim 1, characterized in that, In step 7, the L2 norm training loss function MAELoss(f(x; θ), y) is calculated as follows: MAELoss(f(x;θ),y)=(f(x;θ)-y) 2 Where x represents the input sample, θ represents the parameters required by the model, f(x; θ) represents the predicted value of the model when the input sample is x and the model parameters are θ, and y represents the actual value corresponding to x.

Citation Information

Patent Citations

  • Ship traffic flow prediction method based on improved graph convolutional neural network

    CN114565124A

  • GCN-LSTM ship traffic flow prediction method based on attention mechanism

    CN114881295A