A GCN-LSTM Ship Traffic Flow Prediction Method Based on Attention Mechanism
By using the GCN-LSTM model based on attention mechanism in the prediction of ship traffic flow, the spatial and temporal correlation characteristics are extracted, and the problem of difficult to accurately predict ship traffic flow in the prior art is solved, which improves the prediction accuracy and effectiveness of port traffic management.
Patent Information
- Application Number
- CN202210410429.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-04-19
AI Technical Summary
The existing technology is difficult to accurately explore the spatial and temporal correlation in ship traffic flow prediction, which makes it difficult to effectively solve the problem of port traffic congestion.
The GCN-LSTM model based on attention mechanism is adopted to extract the spatial correlation characteristics of ship traffic flow data through graph convolution neural network, and the time-dependent characteristics are captured in combination with the long-term and short-term memory network, identify the generated points of ship traffic congestion, and implement control measures.
It improves the accuracy of ship traffic flow prediction, can more accurately identify traffic congestion points, provide theoretical basis and technical support, and help solve port traffic congestion problems.
Smart Images

Figure CN114881295B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traffic management, and particularly relates to a GCN-LSTM ship traffic flow prediction method based on an attention mechanism. Background Technique
[0002] Under the influence of economic globalization, the world economy has developed increasingly rapidly. Ship transportation still has an irreplaceable position in the current cargo transportation system. The giant cargo ship "Ever Given" under the well-known shipping company Evergreen Group in Taiwan, China, was hit by strong winds and deviated from its course, and finally ran aground in the Suez Canal and got stuck in the middle of the river channel, causing the north-south line of the Suez Canal to be completely paralyzed.
[0003] Moreover, the congestion situation in port areas is even more severe. The throughput of some large ports exceeds 100 million tons, but there is no clear shipping route for ship traffic, and the shipping routes may sometimes merge or cross. Ship traffic flow prediction can provide a basis for the planning and scheduling of port traffic; it can ensure the transportation efficiency and safety of ports.
[0004] For many years, the research in the field of traffic flow prediction has been gradually deepening, and there are a variety of prediction models. Linear system models such as the Kalman filter method and the historical average model have the advantages of intuitive change trends and strong interpretability, but the disadvantages are simple structures and large errors, with certain limitations. The neural network model has strong nonlinear mapping and adaptive learning capabilities. The nonlinear, periodic, and random characteristics of traffic data determine the advantages of the neural network model in the field of traffic flow prediction. The BP (Back Propagation) neural network prediction model is widely used in the field of ship traffic flow prediction, but there are problems such as low convergence and high sensitivity to training parameters. The Recurrent Neural Network (RNN) model introduces time series, can effectively utilize time dependence, and has better adaptability, but there is a problem of gradient disappearance and a shortcoming in the spatial relationship between data. The Long Short-term Memory Network (LSTM) model solves the problem of gradient disappearance of the recurrent neural network, but due to the fact that the ship traffic flow in ports is easily affected by multiple factors such as weather and tide rise and fall, it is difficult for the prediction model to accurately represent the spatial characteristics of the data. Summary of the Invention
[0005] Based on the above problems, the object of the present invention is to provide a GCN-LSTM port ship traffic flow prediction method based on the attention mechanism, which can mine the spatio-temporal correlation in port ship traffic flow data, identify the points where ship traffic congestion occurs according to the prediction results of ship traffic flow, and implement control measures, providing a theoretical basis and technical support for solving the increasingly serious port traffic congestion problem. Ship traffic flow prediction can provide a basis for the planning and scheduling of port traffic; it can ensure the transportation efficiency and safety of the port.
[0006] The technical solution for achieving the object of the present invention is as follows:
[0007] A GCN-LSTM ship traffic flow prediction method based on the attention mechanism, comprising the following steps:
[0008] Step 1, obtain a data set and perform preprocessing;
[0009] Step 2, construct a GCN-LSTM ship traffic flow prediction model based on the attention mechanism;
[0010] Step 3, use the data set to iteratively train the model constructed in Step 2 to obtain a trained model;
[0011] Step 4, perform ship traffic flow prediction based on the trained GCN-LSTM ship traffic flow prediction model based on the attention mechanism.
[0012] Compared with the prior art, the present invention has the following remarkable advantages:
[0013] (1) The technical solution of the present invention can mine the spatio-temporal correlation in port ship traffic flow data by constructing a GCN-LSTM joint model, identify the points where ship traffic congestion occurs according to the prediction results of ship traffic flow, and implement control measures, providing a theoretical basis and technical support for solving the increasingly serious port traffic congestion problem;
[0014] (2) The technical solution of the present invention introduces the attention mechanism to solve the problem of the decline in the model prediction performance caused by the increase in the input sequence length and improve the prediction accuracy of ship traffic flow.
[0015] By comparing and analyzing the prediction output and the actual output of different prediction methods through evaluation indicators, the results show that the GCN-LSTM model based on the attention mechanism has a higher prediction accuracy;
[0016] (2) The present invention's
[0017] The following further describes the present invention in detail with reference to the accompanying drawings and specific embodiments. Description of the Drawings
[0018] Figure 1 This is the flowchart of the steps of the ship traffic flow prediction method of the present invention.
[0019] Figure 2 This is a schematic diagram for comparing the prediction MAE indicators of the GCN-LSTM ship traffic flow prediction model with the attention mechanism introduced in the embodiment of the present invention and the model without the attention mechanism.
[0020] Figure 3 This is a schematic diagram for comparing the prediction RMSE indicators of the GCN-LSTM ship traffic flow prediction model with the attention mechanism introduced in the embodiment of the present invention and the model without the attention mechanism.
[0021] Figure 4 This is a schematic diagram for comparing the predicted values and the actual values of the ship traffic flow prediction model based on the attention mechanism GCN-LSTM in the embodiment of the present invention. Detailed implementation manners
[0022] A ship traffic flow prediction method based on the attention mechanism, comprising the following steps:
[0023] Step 1, obtain a data set and perform preprocessing, specifically:
[0024] Step 1-1, obtain ship traffic flow data, and divide the sample data set into a training set and a test set;
[0025] Step 1-2, perform normalization processing on the data set to form a normalized data set;
[0026] Use Min-Max normalization to map the data to the interval [0,1] according to the attributes, which is convenient for training and thus improves the performance of the overall model:
[0027]
[0028] Wherein, X min is the minimum value of the data set X, X max is the maximum value of the data set X, x is the initial value, and x' is the normalized value.
[0029] Step 2, construct a ship traffic flow prediction model based on the attention mechanism, specifically:
[0030] Step 2-1, obtain the ship traffic flow data of the recent period, daily cycle, and weekly cycle of the period to be predicted:
[0031] x r =(x t-r ,…,x t-2 ,x t-1 )
[0032] x d = (x t-d*m , …, x t-2*m , x t-1*m )
[0033] x w = (x t-r*7*m , …, x t-2*7*m , x t-1*7*m )
[0034] where m represents the total number of time intervals into which a day is divided; t represents the time period to be predicted; x t represents the predicted vessel flow in the prediction area during period t; r, d, and w represent the number of time intervals for the recent period, daily cycle, and weekly cycle, respectively;
[0035] Step 2-2: Construct a GCN graph convolutional neural network model to obtain the spatial correlation features of the traffic flow data for three time periods x r , x d and x w specifically as follows:
[0036] Step 2-2-1: Divide the prediction water area into grids and construct an undirected graph G = {V, E, A};
[0037] where V represents the set of grid nodes, E represents the connectivity between each node, and A N×N represents the adjacency matrix of graph G. The traffic flow of each node is used as the quantity feature of the node, and the features of each node constitute the feature matrix X N×L , and L is the length of the traffic flow time series;
[0038] Step 2-2-2: Construct a GCN graph convolutional neural network model:
[0039] The input of the GCN graph convolutional neural network model is the adjacency matrix A N×N and the feature matrix X N×L , and graph convolution operation is performed in the spectral domain using Fourier transform to capture the spatial correlation features between nodes through the filter in the Fourier domain:
[0040]
[0041]
[0042]
[0043] In the present invention, a 2-layer GCN model is selected, and the above formula can be expressed as:
[0044]
[0045] where, is a matrix with additional self-connections, I N is the identity matrix, is the degree matrix of, H (n) is the feature of the nth layer, H (1) = X, σ is the non-linear activation function, D represents the degree matrix of A, W (l) represents the weight matrix of the lth layer.
[0046] Step 2-3: Construct a long short-term memory (LSTM) model to respectively obtain the temporal correlation features of the traffic flow data output in Step 2-1, specifically:
[0047] After the spatial feature extraction of the ship traffic flow data by the GCN module, the feature information of each node already contains the feature information of the adjacent nodes on the corresponding graph. Using the LSTM network can not only extract the feature information in the time dimension of each node, but also fuse the feature information of other associated nodes. Splice the recent segment, daily cycle segment, and weekly cycle segment of the prediction period in chronological order, and the temporal dimension feature extraction can obtain the correlation between different cycle segments.
[0048] Construct a four-layer LSTM model to obtain the temporal dependence features of the port ship flow:
[0049] (a) Forget gate: Calculate the proportion of the information passing through from the previous moment through the forget gate:
[0050] f t = σ(W f ·[h t-1 , x t + b f )
[0051] where σ is the Sigmoid function in logistic regression, with a value range of [0,1], W f represents the weight of the forget gate, · represents the vector product, h t-1 represents the output of the recurrent hidden layer at time t-1, x t represents the input of the LSTM model at time t, b f represents the bias condition of the forget gate;
[0052] (b) Input gate: Calculate the output i t through the Sigmoid layer in the input gate, which determines the content of the information to be updated, while the tanh layer generates the information to be updated to the cell state. According to the calculated data, the state value c t of the memory cell at the current moment can be obtained:
[0053] i t = σ(W i ·[ht-1 , x t + b i )
[0054]
[0055] Among them, i t represents the output value of the input gate; W i represents the weight of the input gate; tanh represents the hyperbolic tangent activation function, W c represents the weight matrix of the vector ; b i , b c represent the biases of the input gate and the cell state respectively;
[0056] (c) Cell state: The state value c of the memory cell at the current moment is obtained through the forget gate and the input gate t :
[0057]
[0058] Among them, c t-1 represents the state value at the previous moment, c t represents the cell state value, represents the Hadamard product, that is, the corresponding multiplication of matrix elements;
[0059] (d) Output gate: The final output is obtained through the output gate. Among them, the sigmoid layer determines the information content to be output from the cell state, and then passes the cell state through the tanh layer and multiplies it by the output of the sigmoid layer to obtain the information to be output:
[0060] o t = σ(W o ·[h t-1 , x t + b o )
[0061]
[0062] Among them, o t represents the output value of the output gate; W o represents the weight matrix of the output gate; b o represents the bias; h t represents the hidden state of the LSTM cell, that is, the output of the LSTM cell.
[0063] Step 2-4, construct an attention mechanism model, determine the attention coefficients of each time node in the traffic flow data output in Step 2-2 for the prediction results respectively, and obtain the prediction data for three time periods specifically:
[0064] Calculate the attention coefficient of each time node to the prediction target through the attention mechanism module, describe the tightness of the correlation between the time node and the ship traffic flow prediction, and use these coefficients as weights for weighting when predicting the final result, so that the ship traffic flow at more relevant time nodes can be concerned about when predicting the ship traffic flow;
[0065] Obtain the traffic flow data output by the long short-term memory (LSTM) model, use the output of the last layer of the LSTM network as the input for each moment, and introduce different time series y i (i = 1, 2, …, n), where n is the length of the time series, and the weights of each time series feature are calculated by softmax function normalization to determine the traffic flow prediction data for the recent, daily cycle, and weekly cycle of the prediction period respectively:
[0066] e i = w a * y i + b a
[0067]
[0068]
[0069] Among them, w a represents the weight, b a is the bias condition, y i (i = 1, 2, …, n) represents the traffic flow data output by the long short-term memory (LSTM) model, and n represents the length of the time series, represents the traffic flow prediction data for the recent, daily cycle, or weekly cycle of the prediction period.
[0070] Step 2-5: Use feature fusion to obtain the final ship traffic flow prediction result, specifically:
[0071]
[0072] Among them, σ represents the ramp activation function, represents the Hadamard product, W r , W d , W w are the parameter tensors to be trained, representing the influence degrees affected by the recent, daily, and weekly dependencies respectively, and represent the traffic flow prediction data for the recent, daily cycle, or weekly cycle of the prediction period respectively.
[0073] Step 3: Use the data set to iteratively train the model constructed in Step 2 to obtain the trained model. Among them, the present invention uses the gradient descent method to train the GCN-LSTM ship traffic flow prediction model based on the attention mechanism,
[0074] Step 4: Predict the ship traffic flow based on the trained GCN-LSTM ship traffic flow prediction model with attention mechanism.
[0075] A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0076] Step 1: Obtain a data set and perform preprocessing;
[0077] Step 2: Construct a GCN-LSTM ship traffic flow prediction model with attention mechanism;
[0078] Step 3: Use the data set to iteratively train the model constructed in Step 2 to obtain a trained model;
[0079] Step 4: Predict the ship traffic flow based on the trained GCN-LSTM ship traffic flow prediction model with attention mechanism.
[0080] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0081] Step 1: Obtain a data set and perform preprocessing;
[0082] Step 2: Construct a GCN-LSTM ship traffic flow prediction model with attention mechanism;
[0083] Step 3: Use the data set to iteratively train the model constructed in Step 2 to obtain a trained model;
[0084] Step 4: Predict the ship traffic flow based on the trained GCN-LSTM ship traffic flow prediction model with attention mechanism.
[0085] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0086] Embodiment
[0087] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0088] As Figure 1As shown in the figure, it is the flow chart of the steps of a GCN-LSTM ship traffic flow prediction method based on the attention mechanism of the present invention;
[0089] 1. First, obtain the data set and perform preprocessing:
[0090] Select the AIS data of the waters of Shanghai Baoshan Port from July 1, 2020 to July 31, 2020, which includes information such as MMSI, longitude and latitude, and positioning time. In order to better extract the characteristics of the ship traffic flow change, the ship traffic flow is statistically analyzed at 30-minute intervals to obtain 1488 sample data, and each sample data contains the ship inflow and outflow of 7×7 grids in the prediction area. In this paper, the data set is divided according to time, and the data from July 1, 2020 to July 30, 2020 is selected as the training set for training the model, with a total of 1440 sample data; the data on July 31, 2020 is selected as the test set to evaluate the model performance, with a total of 48 sample data.
[0091] Normalize the data set to form a normalized data set;
[0092] Use the minimum-maximum normalization (Min-Max) to map the data to the interval [0,1] according to the attributes, which is convenient for training, thereby improving the performance of the overall model:
[0093]
[0094] Among them, X min is the minimum value of the data set X, X max is the maximum value of the data set X, x is the initial value, and x' is the value after normalization.
[0095] 2. Build a GCN-LSTM ship traffic flow prediction model based on the attention mechanism and train it, specifically:
[0096] During the training process of the traffic flow prediction model, the parameter settings are as follows: the learning rate is set to 0.001; the batch size is set to 32; the number of training epochs is set to 100;
[0097] Since the settings of the number of graph convolution layers and the number of long short-term memory network layers determine the prediction accuracy of the GCN-LSTM model, in order to achieve the highest prediction accuracy, multiple groups of comparative experiments are carried out on different situations of the number of graph convolution layers and the number of long short-term memory network layers on the same data set, and the optimal model structure is selected according to the experimental results.
[0098]
[0099]
[0100] As can be seen from the above table, when the number of graph convolutional layers of the GCN network is set to 2 and the number of LSTM layers is set to 4, the values of different evaluation metrics based on RMSE and MAE reach the lowest, that is, the prediction effect of the model reaches the best case of this model. Therefore, both the GCN-LSTM model and the attention-based GCN-LSTM model in this example select a combined model of 2 graph convolutional layers plus 4 LSTM layers to predict ship traffic flow.
[0101] 3. Experimental Results
[0102] Let the true value of ship traffic flow be x k . The predicted value is x' k (k = 1, 2, 3, …, N, where N is the number of experimental groups).
[0103] (1) Mean Absolute Error (MAE)
[0104]
[0105] (2) Root Mean Square Error (RMSE)
[0106]
[0107] To verify the effect of the attention mechanism module, the prediction results of the ship traffic flow prediction model based on the attention mechanism and the model without using the attention mechanism were compared and analyzed. The experimental results are shown in the following table. The evaluation metrics MAE and RMSE of the ship traffic flow prediction model based on the attention mechanism are 0.6667 and 1.0206 respectively, and its prediction performance is significantly better than that of the ship traffic flow prediction model without using the attention mechanism, which proves the effectiveness of the attention mechanism module. Its schematic diagram is as Figure 2 and Figure 3 shown;
[0108]
[0109] To further verify the performance of the ship traffic flow prediction model based on the attention mechanism proposed in this paper, it was compared with 3 common prediction models, namely Support Vector Regression (SVR), LSTM, and GRU. The following table shows the comparison results of these models.
[0110]
[0111]
[0112] As can be seen from the above table, compared with the prediction models using traditional machine learning method SVR and other prediction models using deep learning methods, the prediction performance of the prediction model using traditional machine learning method SVR is poor. Among the deep learning models, the ship traffic flow prediction model based on attention mechanism GCN-LSTM proposed in this patent has achieved good prediction results, with MAE and RMSE being 0.6667 and 1.0206 respectively, which are better than other prediction models.
[0113] Through the above construction, training and prediction, Figure 4 The prediction results visually show the comparison between the actual ship traffic flow values in the predicted area of Shanghai Baoshan Port on July 31, 2020 in the test set and the prediction results of the GCN-LSTM model based on the attention mechanism. In the figure, the solid line represents the trend of the real data, and the dotted line represents the trend predicted by the GCN-LSTM prediction method based on the attention mechanism proposed in this patent. The vertical coordinate represents the ship traffic flow in a certain time period, and the horizontal coordinate represents the time point. The time is one day, and the time interval is 1 hour.
[0114] The above is the single-step prediction performance of the ship traffic flow prediction model. For further analysis, the multi-step prediction performance of this model is verified in this paper. At each step of prediction, the attention mechanism calculates the weights for each hidden state of the GCN-LSTM network, and the weights obtained at different time steps are also different, so as to improve the accuracy of multi-step prediction. The following table gives the result comparison of multi-step prediction, that is, the prediction effect after 1 hour, the prediction effect after 1.5 hours, and the prediction effect after 2 hours.
[0115]
[0116] Through the comparison of the prediction effects under different time steps, when the prediction time step changes from 0.5 hour to 2 hours, although the prediction performance of the GCN-LSTM ship traffic flow prediction model based on the attention mechanism decreases, the overall prediction trend is still relatively accurate and better than the GCN-LSTM model.
[0117] To sum up, through the comparative analysis of the prediction output and the actual output of different prediction methods by evaluation indicators, the results show that the GCN-LSTM ship traffic flow prediction method based on the attention mechanism in this patent has higher prediction accuracy.
Claims
1. A GCN-LSTM ship traffic flow prediction method based on the attention mechanism, characterized in that, It includes the following steps: Step 1: Obtain a dataset and perform preprocessing; Step 2: Construct a GCN-LSTM ship traffic flow prediction model based on the attention mechanism: Step 2-1: Obtain the ship traffic flow data for the recent period, daily cycle, and weekly cycle of the period to be predicted; x r = (x t-r , …, x t-2 , x t-1 ) x d = (x t-d*m , …, x t-2*m , x t-1*m ) x w =(x t-r*7*m ,…,x t-2*7*m ,x t-1*7*m ) Among them, m represents the total number of time intervals into which a day is divided; t represents the time period to be predicted; x t represents the predicted ship flow in the prediction area during the t period; r, d, and w respectively represent the number of time intervals for the recent period, daily cycle, and weekly cycle; Step 2-2: Construct a GCN graph convolutional neural network model to obtain the spatial correlation features of traffic flow data x r , x d and x w respectively; Step 2-3: Construct a long short-term memory (LSTM) model to respectively obtain the temporal correlation features of the traffic flow data output in Step 2-1; Step 2-4: Construct an attention mechanism model to respectively determine the attention coefficients of each time node in the traffic flow data output in Step 2-2 on the prediction result, and obtain the prediction data for three time periods respectively; Step 2-5: Use feature fusion to obtain the final ship traffic flow prediction result; Step 3: Use the dataset to iteratively train the model constructed in Step 2 to obtain a trained model; Step 4: Perform ship traffic flow prediction based on the trained GCN-LSTM ship traffic flow prediction model based on the attention mechanism.
2. The GCN-LSTM port ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The obtaining of the dataset and performing preprocessing in Step 1 is specifically as follows: Step 1-1: Obtain ship traffic flow data and divide the sample dataset into a training set and a test set; Step 1-2: Normalize the dataset to form a normalized dataset; Use min-max normalization (Min-Max) to map the data to the interval [0, 1] according to the attributes: where X min is the minimum value of the data set X, and X max is the maximum value of the data set X, x is the initial value, and x' is the value after normalization.
3. The GCN-LSTM ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The using of the GCN model to obtain the spatial association features of the traffic flow data in Step 2-2 is specifically as follows: Step 2-2-1: Divide the prediction waters into grids and construct an undirected graph G = {V, E, A}; where \(V\) represents the set of grid nodes, \(E\) represents the connectivity between each node, and \(A\) N×N represents the adjacency matrix of graph \(G\). The traffic flow of each node is used as the quantity feature of the node, and the features of each node constitute the feature matrix \(X\) N×L , and \(L\) is the length of the traffic flow time series; Step 2-2-2: Construct a GCN graph convolutional neural network model: The input of the GCN graph convolutional neural network model is the adjacency matrix A N×N and the feature matrix X N×L , and graph convolution operations are performed in the spectral domain using Fourier transform to capture the spatial correlation features between nodes through filters in the Fourier domain: Among them, is a matrix with additional self-connections, I N is the identity matrix, is the degree matrix of (n) is the feature of the nth layer, H (1) = X, σ is the non-linear activation function, D represents the degree matrix of A, W (l) represents the weight matrix of the lth layer.
4. The GCN-LSTM ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The using of the LSTM model to obtain the temporal correlation features of the traffic flow data in Step 2-3 is specifically as follows: Construct an LSTM model: (a) Forget gate: Calculate the proportion of the information passing through from the previous moment through the forget gate: f t = σ(W f · [h t-1 , x t + b f ) Among them, σ is the Sigmoid function in logistic regression, and its value range is [0, 1]. W f represents the weight of the forget gate, · represents the vector product, and h t-1 represents the output of the recurrent hidden layer at time t-1, and x t represents the input of the LSTM model at time t, and b f represents the bias condition of the forget gate; (b) Input gate: The output i is calculated through the Sigmoid layer in the input gate, which determines the content of the information to be updated. The tanh layer generates the information to be updated to the cell state, and the state value c of the memory cell at the current moment can be obtained according to the calculation data. t , which determines the content of the information to be updated, while the tanh layer generates the information to be updated to the cell state, and the state value c of the memory cell at the current moment can be obtained according to the calculation data. t : i t = σ(W i · [h t-1 , x t + b i ) where, i t represents the output value of the input gate; W i represents the weight of the input gate; tanh represents the hyperbolic tangent activation function, W c represents the weight matrix of the vector ; b i , b c represent the biases of the input gate and the cell state, respectively; (c) Cell state: Obtain the state value c of the memory cell at the current moment through the forget gate and the input gate t : Among them, c t-1 represents the state value at the previous moment, and c t represents the cell state value, which represents the Hadamard product, that is, the corresponding multiplication of matrix elements; (d) Output gate: Obtain the final output through the output gate. Among them, the sigmoid layer determines the information content to be output from the cell state, then passes the cell state through the tanh layer, and multiplies it by the output of the sigmoid layer to obtain the information to be output: o t = σ(W o · [h t-1 , x t + b o ) h t = o t °tanh(c t ) where, o t represents the output value of the output gate; W o represents the weight matrix of the output gate; b o represents the bias; h t represents the hidden state of the LSTM cell, i.e., the output of the LSTM cell.
5. The GCN-LSTM ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The using of the attention mechanism model to determine the attention coefficients of each time node on the prediction result in Step 2-4 is specifically as follows: Obtain the traffic flow data output by the long short-term memory (LSTM) model, and respectively determine the traffic flow prediction data for the recent period, daily cycle, and weekly cycle of the period to be predicted; e i = w a * y i + b a Among them, w a represents the weight, and b a is the bias condition. y i (i = 1, 2, …, n) represents the traffic flow data output by the long short-term memory (LSTM) model, and n represents the length of the time series. represents the traffic flow prediction data for the recent period, daily cycle, or weekly cycle of the period to be predicted.
6. The GCN-LSTM ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The using of feature fusion to obtain the final ship traffic flow prediction result in Step 2-5 is specifically as follows: Among them, σ represents the ramp activation function, represents the Hadamard product, and W r , W d , W w are parameter tensors to be trained, representing the influence degrees affected by recent, daily, and weekly dependencies respectively. and represent the traffic flow prediction data for the recent, daily cycle, or weekly cycle in the time period to be predicted respectively.
7. The GCN-LSTM ship traffic flow prediction method based on the attention mechanism according to claim 1, wherein The using of the dataset to iteratively train the constructed model in Step 3 is specifically as follows: Use the gradient descent method to train the GCN-LSTM ship traffic flow prediction model based on the attention mechanism.
8. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1-7.
Citation Information
Patent Citations
Ship traffic flow prediction method based on EEMD-IAGA-BP neural network
CN110111606A
Runoff prediction method based on attention mechanism and LSTM
CN110288157A
Convolutional network traffic flow prediction method based on space-time attention mechanism
CN113450568A