Neural network prediction method for traffic flow diagram of ships in harbor group water area
By using O-D data and graph neural network methods in ship traffic flow prediction, combining diffusion and temporal convolution networks, the problems of sparsity and spatiotemporal correlation are solved, the prediction accuracy and applicability are improved, and accurate prediction at different time resolutions are achieved.
Patent Information
- Application Number
- CN202411451983.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art has problems such as sparsity, unacceptable spatial and temporal correlation, and unstable AIS data in the prediction of ship traffic flow, resulting in low prediction accuracy and poor applicability.
A method for predicting ship traffic flow graph neural networks in port group waters is proposed. The port water network model is constructed using O-D data, combined with diffusion graph convolution networks and time convolution networks, and a space-time zero-expansion negative binomial graph neural network is constructed to adapt to the sparseness and quantitative uncertainty of data.
By more intuitively representing the internal coupling relationship of the port group water navigation network and the macro-level representation network, the accuracy and applicability of ship traffic flow prediction are improved, and ship traffic flow can be accurately predicted at different time resolutions.
Smart Images

Figure CN119514755A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of waterway traffic organization optimization and intelligent management and control, and in particular to a neural network prediction method for a ship traffic flow graph in a port group water area. Background Art
[0002] With the rapid development of the global economy, the growth of ship traffic has posed an increasing challenge to ship navigation safety, and has also caused a series of water safety issues such as loss of life and property and damage to the marine environment around the world. Faced with a complex water traffic environment, high-precision prediction of ship traffic flow is crucial to improving the organization, optimization and control of water traffic, especially to provide ship traffic flow data support for reducing ship collision accidents, improving navigation safety, and assisting port decision-making and management. By predicting key information such as the route, number and density of ships, it can help ship managers and port regulators plan ship routes more effectively, avoid collision accidents, and respond to unforeseen safety threats in a timely manner.
[0003] The evolution of ship traffic flow is inevitably affected by many different factors, such as special events, economic development, tourist seasons, trade activities, holidays, monsoons, environmental changes and bad weather (such as haze, low illumination, rain and snow). In the past few decades, researchers have mainly used two types of methods, model-based prediction methods and learning-based prediction methods, to carry out a lot of research on the problem of ship traffic flow prediction. Most of the pioneering studies were initially based on the time series data of ship traffic flow, and used statistical theory to establish prediction models. They mainly include linear time series models, Kalman filter models and nonlinear non-parametric regression models. The above models can effectively complete the task of ship traffic flow prediction, and have the advantages of high computational efficiency and strong interpretability. However, the models generally have problems such as low prediction accuracy, high complexity and weak robustness. In recent years, with the advancement of data acquisition technology and equipment, the development of artificial intelligence technology and its wide range of integrated applications, more and more studies have integrated machine learning methods into the problem of ship traffic flow prediction. These methods mainly include improved genetic algorithm (GA), back propagation neural network (BP), convolutional neural network (CNN) and long short-term memory neural network (LSTM). Compared with the model-based prediction method, the above machine learning method has higher prediction accuracy. The above machine learning prediction method mainly solves the problem of ship traffic flow prediction based on the traffic network in Euclidean space, without considering the inherent spatiotemporal correlation of ship traffic flow. In fact, unlike the explicit characteristics of the network structure of the road traffic system, most structures of the waterway traffic system do not have obvious mesh topological characteristics and do not have Euclidean space. The above research methods are poorly applicable and unreasonable.
[0004] In order to address the above limitations, some studies have proposed to extend the graph convolutional network (GCN) method to ship traffic flow prediction. These studies are based on AIS data for ship traffic flow prediction, but AIS data may be unstable due to factors such as ship equipment status and data transmission interruption, and the historical data provided can only be short-term. In addition, AIS data is not intuitive for building a navigation network in port group waters and understanding the internal coupling relationship of the network from a macro perspective. In view of this, it is necessary to try to use other data with better performance to study ship traffic flow prediction. Origin-destination (OD) data is widely used to study traffic flow prediction problems in transportation networks with diversity and complexity because it contains the spatial distribution characteristics and time series characteristics of the transportation network. The use of the above dense and continuous OD matrix data helps to improve the prediction accuracy in complex transportation network traffic flow prediction problems. With the continuous deepening of research, the OD matrix constructed based on traffic flow data has sparse problems when used to predict traffic flow. These sparsities are mainly caused by the lack of traffic flow time series data and insufficient data in specific areas. Therefore, these data do not satisfy the continuous Gaussian distribution of deterministic deep learning models, which brings difficulties to the design of deep learning traffic flow prediction methods.
[0005] In summary, the problems existing in the prior art are:
[0006] 1. The existing technology research predicts ship traffic flow based on AIS data. However, AIS data may be unstable due to factors such as ship equipment status and data transmission interruption. The historical data provided can only be short-term. In addition, AIS data is not intuitive for building a navigation network in port group waters and recognizing the internal coupling relationship of the network from a macro perspective.
[0007] 2. The machine learning prediction methods in the existing technology do not take into account the inherent spatiotemporal correlation of ship traffic flow and the Euclidean space characteristics between associated nodes in the navigation network of port group waters.
[0008] 3. The OD matrix constructed based on traffic flow data in the prior art has a sparsity problem when used to predict traffic flow. Summary of the invention
[0009] Aiming at the significant characteristics of sparsity, spatiotemporal correlation, uncertainty, etc. in the prediction of ship traffic flow, as well as the fact that the current machine learning methods do not consider the inherent spatiotemporal correlation of ship traffic flow and the instability of AIS data. In order to more intuitively characterize the navigation network of port group waters and characterize the internal coupling relationship of the network from a macro level, the present invention attempts to use OD data to construct a port water network model for the first time, and extracts and constructs the characteristics of the water transportation network based on ship OD data. Compared with the commonly used processing method based on AIS data, ship OD data has the advantage of being able to provide spatial distribution characteristics and time series characteristics of the transportation network. In order to solve the sparsity problem and effectively predict the spatiotemporal correlation of ship traffic flow, the present invention proposes a neural network prediction method for ship traffic flow graph in port group waters to adapt to the sparsity and quantitative uncertainty of the data.
[0010] To this end, the technical solution adopted in the present invention is:
[0011] A neural network prediction method for ship traffic flow graph in port group waters, the method comprising:
[0012] Deconstruct the port group waters, set relevant parameters of the port group waters, and build a navigation network for the port group waters;
[0013] Based on the mathematical assumptions of the navigation network in the port group waters, a ship traffic flow prediction model is constructed;
[0014] The distribution characteristics of inter-port ship traffic in the port group water navigation network are analyzed, and it is confirmed that its distribution conforms to the zero-inflated negative binomial distribution characteristics;
[0015] According to the navigation network of the port group waters, the adjacency matrix of OD pairs between ports is calculated as the input of the graph neural network prediction method;
[0016] Use diffusion graph convolutional network to capture the spatial adjacency of OD pairs;
[0017] Use temporal convolutional networks to capture the temporal correlation between OD pairs;
[0018] The diffusion graph convolutional network is combined with the temporal convolutional network to form a spatiotemporal zero-inflated negative binomial graph neural network method, which is applied to the ship traffic flow prediction model to predict ship traffic flow.
[0019] According to the above scheme, the relevant parameters of the port group waters are set specifically as follows: the time length of each port in the port group waters is set to T, and the number of departure ports, the number of destination ports, and the ship traffic flow and longitude and latitude coordinates of each port with a time length of T are obtained.
[0020] According to the above scheme, the port group water navigation network is specifically defined as an undirected OD graph G = (V, E, A), where V represents the OD pair set, that is, the set of departure ports to destination ports in the extracted port group water navigation network, |V| = N is the number of OD pairs; E represents the edge set, representing the connectivity between nodes; A is the adjacency matrix in G that describes the relationship between OD pairs; each OD pair of G samples time series data of length T at the same sampling frequency, and the time series data is the characteristic vector of G.
[0021] According to the above scheme, the data set collected in the port group water navigation network G is represented by a third-order tensor D (d1, d2, d3), where d1, d2, and d3 are the OD pair set, characteristic vector, and time dimension of G respectively; the ship traffic flow prediction model predicts the ship traffic flow in a future time window through the ship traffic flow of each OD pair in the tth time window, thereby predicting the ship traffic flow of all nodes in the future time windows of the port group water navigation network.
[0022] According to the above scheme, the distribution characteristics of ship traffic flow between ports conform to the zero-inflated negative binomial distribution characteristics, which are as follows: the ship arrival process is highly random, over-dispersed and has a clustering effect, and the ship traffic flow between ports is sparse, and its flow data contains a large number of zeros;
[0023] The inter-port ship traffic flow that conforms to the zero-inflated negative binomial distribution characteristics is expressed by the zero-inflated negative binomial distribution function:
[0024]
[0025] Where n and p represent the shape parameters of the success probability and failure probability in a trial, respectively, and χ k represents the ship traffic flow at the kth moment.
[0026] According to the above scheme, based on the latitude and longitude coordinates of the departure port and the destination port and the actual straight-line distance between them, the OD pair adjacency matrix between ports is expressed as:
[0027]
[0028] in, are the longitude and latitude of OD for the departure port i are the longitude and latitude of OD to destination port j respectively, haversine() takes the longitude and latitude of the departure port and the destination port, and calculates the actual straight-line distance between them.
[0029] According to the above scheme, the diffusion graph convolutional network is used to capture the spatial adjacency of OD pairs as follows:
[0030] Set up at least 2 diffusion graph convolutional network layers, each diffusion graph convolutional network layer is:
[0031]
[0032] Among them, H l represents the lth hidden layer; Chebyshev polynomial T k (X) = 2XT k-1 (X)-T k-2 (X) is used to approximate the convolution operation in the diffusion graph convolution network, with boundary conditions T0(X)=I and T1(X)=X; and is the learning parameter of the lth hidden layer; σ is the activation function; They represent the forward transfer matrix of the forward diffusion process of the graph convolutional network node and the backward transfer matrix of the backward diffusion process, respectively. Backward transfer matrix The diffusion results converge to a stationary distribution P,
[0033] Where K is the diffusion step size, which is usually set to a finite number; α is the diffusion probability, α∈[0,1]; Represents the node matrix of the graph; the Chebyshev polynomials are also used to approximate the diffusion P distribution.
[0034] According to the above scheme, the temporal correlation between OD pairs is captured by using a temporal convolutional network as follows:
[0035] Set up at least 2 temporal convolutional network layers, each with l Receive from the previous layer J l-1 The data signal is updated using the following formula:
[0036] J l =f(Γ l *J l-1 +b)
[0037] where Γ l is the convolution filter of the corresponding layer, * is the shared convolution operation, and b represents the bias, which is used to adjust the output offset.
[0038] According to the above scheme, the spatiotemporal correlation parameter Z = M (X 1:t ,A), where M is the proposed method framework, which takes historical record data and adjacency matrix as input, outputs the spatiotemporal correlation parameter Z of future prediction data; and uses the probability mass function f of zero-inflated negative binomial distribution ZINB (Xt+1:t+k |Z) is used to predict the ship traffic flow in the kth time window in the future, and the negative log-likelihood loss function is used as the performance measure of the ship traffic flow prediction model.
[0039] According to the above scheme, the spatiotemporal correlation parameter is obtained specifically in the following manner:
[0040] A batch of historical data X of size B in the jth time window j:j+B The input ODT tensor is converted into a tensor as a zero-inflated negative binomial distribution input; the diffusion graph convolution network includes a spatial embedding parameter n s , p s , π s and the temporal embedding parameter n t , p t , π t , used to parameterize the zero-inflated negative binomial distribution output, using the Hadamard product to convert n s , p s , π s and n t , p t , π t The spatial and temporal correlation parameters of the zero-inflated negative binomial distribution are fused into the spatial and temporal correlation parameters of the zero-inflated negative binomial distribution to obtain the spatial and temporal correlation parameters of the zero-inflated negative binomial distribution.
[0041] The beneficial effects produced by the present invention are:
[0042] The present invention introduces OD pair data into the navigation network of the port group waters, which more intuitively characterizes the navigation network of the port group waters, characterizes the internal coupling relationship of the network from a macro level, and predicts the ship traffic flow based on the OD pair data, providing good spatial distribution characteristics and time series characteristics of the ship traffic network; at the same time, the present invention uses a spatiotemporal zero-expansion negative binomial graph neural network (STZINB-GNN) prediction method, which effectively solves the zero-expansion problem in the OD pair data, adapts to data sparsity, and can accurately predict the ship traffic flow at different time resolutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a method flow chart of an embodiment of the present invention;
[0044] FIG. 2( a ) is a schematic diagram of port vessel traffic flow in 2017 provided by an embodiment of the present invention;
[0045] FIG2( b ) is a schematic diagram of port vessel traffic flow in 2018 provided by an embodiment of the present invention;
[0046] FIG2( c ) is a schematic diagram of port vessel traffic flow in 2019 provided by an embodiment of the present invention;
[0047] Figure 3 This is a flowchart of a graph neural network method implementation according to an embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of the ship traffic flow prediction result between ports AB in the OD_Data_1Day scenario of one embodiment of the present invention;
[0049] Figure 5 It is a schematic diagram of the prediction result of ship traffic flow between AC ports in the OD_Data_1Day scenario of one embodiment of the present invention;
[0050] Figure 6 This is a schematic diagram of the prediction results of ship traffic flow between AD ports in the OD_Data_1Day scenario according to an embodiment of the present invention;
[0051] Figure 7 This is a schematic diagram of the prediction results of ship traffic flow between AE ports under the OD_Data_1Day scenario of one embodiment of the present invention;
[0052] Figure 8 This is a schematic diagram of the ship traffic flow prediction results between AF ports in the OD_Data_1Day scenario according to an embodiment of the present invention;
[0053] Fig. 9 It is a schematic diagram of the ship traffic flow prediction result between AG ports under the OD_Data_1Day scenario of one embodiment of the present invention;
[0054] Fig.10 This is a schematic diagram of the prediction result of ship traffic flow between AF ports in the OD_Data_1Month scenario according to an embodiment of the present invention;
[0055] Fig.11 This is a schematic diagram of the prediction result of ship traffic flow between AG ports in the OD_Data_1Month scenario according to an embodiment of the present invention;
[0056] Fig.12 It is a schematic diagram of the prediction result of the ship traffic flow between AC ports in the OD_Data_1Month scenario according to an embodiment of the present invention;
[0057] Fig.13 It is a schematic diagram of the prediction results of ship traffic flow between AD ports in the OD_Data_1Month scenario according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0059] The following are explanations of some terms in this embodiment:
[0060] HiFleet: An online fleet platform that provides global ship satellite AIS real-time position tracking, historical trajectory playback, ship weather navigation, route planning and other services.
[0061] OD dataset: a data set from the departure port to the destination port in the navigation network of the port group waters.
[0062] STZINB-GNN: A spatiotemporal zero-inflated negative binomial graph neural network that uses diffusion and temporal convolutional networks to analyze spatiotemporal correlations and parameterize the probability distribution of OD pairs.
[0063] The present invention provides a neural network prediction method for a ship traffic flow graph in a port group water area, which specifically comprises the following steps:
[0064] S1. Based on graph theory, deconstruct the port group waters, make assumptions and definitions on the port group waters, and build a navigation network for the port group waters.
[0065] Based on graph theory, aiming at the navigation characteristics of port group waters, the port group waters are deconstructed and reasonable assumptions are made. The component elements and the interaction relationship between the elements are defined to construct a navigation network for port group waters.
[0066] In this embodiment, S1 uses the fleet online platform (HiFleet) to extract the ship OD data set between ports in the vicinity of a strait (hereinafter referred to as the ship OD data set). OD_Data contains the travel records of different ships between ports for 5 years from January 1, 2017 to December 31, 2022, including: departure port, destination port, ship departure time, ship arrival time, ship number, ship name and other information. The data set is divided into 3 different time scales (1 day, 1 week and 1 month) to test the high accuracy of the prediction method.
[0067] In order to intuitively understand the data distribution characteristics of OD_Data, this embodiment performs the following analysis on the data set:
[0068] S11. Take the OD_Data from 2017 to 2019 and count the number of destination ports and total ship traffic flow involved in these three years, as shown in the following table.
[0069] years Number of destination ports Vessel traffic 2017 282 20663 2018 346 31118 2019 347 38656
[0070] As can be seen from the table, the number of destination ports and ship traffic volume has increased year by year, with the most obvious growth from 2017 to 2018.
[0071] According to the OD_Data information, some ports have single-digit ship traffic volume in a year. These ports are removed from the original data set, and only the OD data between ports with large ship traffic volume are retained to form a new data set, which constitutes the ship traffic volume of the OD pair data of the new data set.
[0072] Figures 2(a), 2(b) and 2(c) show the top destination ports in terms of ship traffic flow in 2017, 2018 and 2019 respectively. Based on the above statistical data, OD pairs with the same time period in the original data set are selected as spatially sparse data samples (OD pairs are composed of permutations and combinations of the top-ranked destination ports in the original data set).
[0073] S12, using mathematical language to make assumptions and definitions for the port group waters, setting the time length of each port in the port group waters to T, obtaining the number of departure ports m (18 in this embodiment), the number of destination ports l (18 in this embodiment), and the ship flow data and longitude and latitude coordinates of each port with a time length of T, and constructing a port group waters navigation network including 18 ports. In the port group waters navigation network, ship flow data with a time length of T for 18 departure ports and 18 destination ports are used as experimental data. Each port OD pair has time window data for the first k moments, that is, a data sequence containing k flow data is used to predict an adjacent data sequence containing the same number of flow data.
[0074] S13, define the water navigation network constructed in S12 as an undirected OD graph G = (V, E, A), where V represents the OD pair set, that is, the set of departure ports to destination ports in the extracted water navigation network, |V| = N is the number of OD pairs; E represents the edge set, representing the connectivity between nodes; ( is a real number set) is the adjacency matrix in G that describes the relationship between OD pairs. It can be clearly concluded that |V| = m × l, which means that the OD graph is completely connected. Let x it Indicates that at t th The i-th th The ship traffic flow of OD pairs, where i∈V, Indicates that at t th The ship traffic flow of all OD pairs within the time window, where x itAs the input of the network model. Each OD pair in the water navigation network G samples time series data of length T at the same sampling frequency, that is, each node will generate a feature vector of length T in each time period. Through the above definition, the historical record X 1:t As data input to predict X t:t+k The distribution of ship traffic flow in the next k time windows (i.e., k=t-1) is obtained to analyze the expected and confidence interval range of ship traffic flow in the future navigation network.
[0075] S2. Based on the mathematical assumptions of the navigation network of the port group waters, a ship traffic flow prediction model is constructed.
[0076] According to the mathematical assumptions of the navigation network of the port group waters constructed in step S1, it is assumed that the data set collected in the navigation network G is represented by a third-order tensor, namely D(d1, d2, d3), where d1, d2, and d3 are the OD pair set, characteristic vector, and time dimension of G, respectively.
[0077] Assume that each OD pair is th x in the time window it is the traffic flow characteristic sequence, and the navigation volume within a certain period of time in the future is the target volume to be predicted. Represents the time series of the j-th eigenvalue of OD pair i and eigenvector x. represents the value of the fth feature of the i-th OD pair at time t, represents the value of the f-th feature of all nodes at time t, represents the value of the fth feature of all OD pairs in the k time window, Represents the values of all features of all OD pairs at time t. Represents the values of all time series features of all nodes in the k time window.
[0078] set up is the ship traffic flow value of the i-th OD pair at time t. The prediction target of the ship traffic flow prediction model is the ship traffic flow value of all nodes in the future with a window length of T. in, Represents the prediction target of the i-th OD pair.
[0079] S3. Analyze the distribution characteristics of inter-port ship traffic flow and confirm that its distribution conforms to the zero-inflated negative binomial distribution characteristics.
[0080] In this embodiment, the OD_Data vessel traffic flow information obtained in S1 divided into three different time scales (1 day, 1 week and 1 month) is shown in the following table:
[0081] Dataset Time scale OD Dataset size Zero rate OD_Data_1Day 1Day 18×18 (633199,6) 93.28% OD_Data_1Week 1Week 18×18 (90457,6) 69.72% OD_Data_1Month 1Month 18×18 (21106,6) 48.93%
[0082] When the temporal resolution of the OD_Data dataset increases from 1 month to 1 day, its zero value rate increases from 48.93% to 93.28%, which means that most of the ship traffic flow in the dataset is 0, and the distribution of OD for ship traffic flow is quite skewed.
[0083] By analyzing the distribution characteristics of ship traffic flow between ports, it is easy to find that, affected by various factors such as weather, port operation efficiency, and ship type, the ship arrival process is highly random, over-dispersed, and has a clustering effect. In addition, the ship traffic flow between ports is sparse, and its flow data contains a large number of zeros, which conforms to the zero-inflated negative binomial distribution characteristics. Therefore, the zero-inflated negative binomial distribution function is used to represent the distribution characteristics of ship traffic flow.
[0084] Assume that the ship traffic flow input follows a zero-inflated negative binomial distribution:
[0085]
[0086] in n and p represent the shape parameters of the success probability and failure probability in a trial, respectively. In the real world, ship traffic data has many observations with zero values and overdispersion. The large number of zeros increases the parameter learning task of the negative binomial distribution. Therefore, a new parameter π is introduced to learn the zero expansion phenomenon in the data, thus obtaining the zero-inflated negative binomial distribution. Its probability mass function can be expressed as:
[0087]
[0088] There are two types of data generated by the zero-inflated negative binomial distribution above: they are either zero values with probability π, or non-zero values with probability 1-π, which also follow the negative binomial distribution.
[0089] S4. According to the navigation network of the port group waters, the adjacency matrix of OD pairs between ports is calculated as the input of the graph neural network prediction method.
[0090] In this embodiment, the 18 departure ports and 18 destination ports in the port group water navigation network in step S1 are used as node components, and these port nodes are paired to form an OD pair set. Intuitively, the positions of OD pairs with different departure ports and destination ports on the adjacency matrix are also different. According to the latitude and longitude coordinates of the departure port and the destination port and the actual straight-line distance between them, the adjacency matrix is expressed as:
[0091]
[0092] in, are the longitude and latitude of OD for the departure port i are the longitude and latitude of OD to destination port j respectively, haversine() takes the longitude and latitude of the departure port and the destination port, and calculates the actual straight-line distance between them.
[0093] The order of i and j does not affect the output of the haversine() function, which shows that the adjacency matrix A is symmetric. The final adjacency matrix A is A O and A D In order to clearly display the uncertainty quantification results of the model and enhance its interpretability, the above-mentioned simpler adjacency matrix construction method is used to avoid the problem of not achieving the expected results due to the complex structure of the adjacency matrix.
[0094] S5. Use diffusion graph convolutional network to capture the spatial adjacency of OD pair adjacency matrix.
[0095] The spatial convolution module can capture the spatial dependency between data. To capture the spatial adjacency of the adjacency matrix of OD pairs, the diffusion process theory is introduced in the spatial correlation modeling, and the diffusion graph convolution network is used to more effectively learn the spatial dependency between OD pairs.
[0096] The diffusion process diffuses forward and backward through the forward diffusion matrix and the backward diffusion matrix. The forward transfer matrix is The backward transfer matrix is After a sufficiently long time step, the Markov property of the diffusion process ensures that the diffusion results converge to a stationary distribution.
[0097] Where K is the diffusion step size, which is usually set to a finite number; α is the diffusion probability, α∈[0,1]; The node matrix of the graph is represented by the forward diffusion process and the backward diffusion process. The forward diffusion process can simulate the dynamic process of a ship moving from one route to another, such as the process of a ship departing from port A to port B and then to port C.
[0098] In this embodiment, three diffusion graph convolutional network layers are set, and each diffusion graph convolutional network layer can be written as:
[0099]
[0100] Among them, H l Indicates l th Hidden layer; Chebyshev polynomial T k (X) = 2XT k-1 (X)-T k-2 (X) is used to approximate the convolution operation in the diffusion graph convolution network and the approximate diffusion P = distribution, with boundary conditions T00 (X) = I and T1(X) = X; and is an added learning parameter to control how each node converts the received information; σ is an activation function, such as RELU function and Linear function.
[0101] S6. Use a temporal convolutional network to capture the temporal correlation between OD pairs.
[0102] Temporal convolutional networks can capture the temporal correlation between data. Considering that temporal convolutional networks have the characteristics of lightweight architecture and fast training, and can use data sequences of different lengths as input, they have the advantage of adapting to different temporal resolutions. Temporal convolutional networks are used to capture the temporal correlation between OD pairs. The structure of the temporal convolutional network is based on l th The width of the layer is w l A shared gated one-dimensional convolution is performed to transfer the information of neighboring nodes at the current time point.
[0103] In this embodiment, three time convolutional network layers are set, each time convolutional network layer J l Receive from the previous layer J l-1 The data signal is updated using the following formula:
[0104] J l =f(Γ l *J l-1 +b)
[0105] where Γ l is the convolution filter of the corresponding layer, * is the shared convolution operation, and b represents the bias, which is an additional parameter added to the result of the convolution operation or the fully connected operation. It can be regarded as an offset used to adjust the input of the activation function to help the model learn more flexible mappings. It can also adjust the output offset to make the model more expressive. If the previous hidden layer follows The convolution filter is Therefore, it can be deduced that: If the temporal convolutional network layers are not padded, use w l <w l-1 Represents. The temporal convolutional network is a sequence-to-sequence prediction model that can directly output continuous prediction results within the future target time window. By controlling Γ l The number of cores can be adjusted to different time resolutions.
[0106] S7. The diffusion graph convolutional network is combined with the temporal convolutional network to form a spatiotemporal zero-inflated negative binomial graph neural network method, which is applied to the ship traffic flow prediction model to predict ship traffic flow.
[0107] Considering the uncertainty and sparsity of ship traffic between ports, a generalized deep learning method, the spatiotemporal zero-inflated negative binomial graph neural network method (STZINB-GNN), is introduced to predict ship traffic. Through this method, the spatiotemporal correlation parameter Z = M (X 1:t ,A), and using the probability mass function f of the zero-inflated negative binomial distribution ZINB (X t+1:t+k |Z) to predict the ship traffic flow in the future k moments. M is the proposed method framework, which combines historical record data and adjacency matrix As input, we can get future prediction data The spatiotemporal correlation parameters
[0108] f ZINB (X t+1:T+k |n t+1:t+k ,p t+1:t+k ,π t+1:t+k )=f ZINB (X t+1:T+k |M(X 1:t ,A))=f ZINB (X t+1::t+k |Z)
[0109] The graph neural network method in S7 is usually composed of the spatial convolution module of S5 and the temporal convolution network of S6. The spatial convolution module is used to extract spatial dependencies in the data, and the temporal convolution network is used to capture the temporal correlation in the data.
[0110] A batch of historical data of size B in the jth time window The input ODT tensor is converted into a tensor The input is a zero-inflated negative binomial distribution. The spatial adjacency of OD pairs is captured using the diffusion graph convolutional network of S5, and the temporal correlation of OD pairs is captured using the temporal convolutional network of S6. The spatial embedding parameter n of the diffusion graph convolutional network is s , p s , π s and the temporal embedding parameter n t , p t , π t is used to parameterize the output of the zero-inflated negative binomial distribution. These spatial embedding parameters and temporal embedding parameters contain independent estimates of the parameters of the zero-inflated negative binomial distribution, which are then transformed into n using the Hadamard product. s , p s , π s and n t , p t , π tFusion into Z, this step can also be replaced by a fully connected layer, and finally the spatiotemporal correlation parameter Z of the zero-inflated negative binomial distribution is obtained.
[0111] In addition, this embodiment uses negative likelihood as a loss function to measure the performance of the ship traffic flow prediction model in order to better fit the data into the probability distribution. Let y be the ground truth value, the log likelihood estimate of the zero-inflated negative binomial distribution (ZINB) distribution consists of two parts, y=0 and y>0, and it can be approximated as:
[0112]
[0113] Where n, p, π are selected and calculated according to y = 0 or y > 0, and Γ is the Gamma function. The final negative log-likelihood loss function can be expressed as:
[0114] NLL STZINB =-LL y=0 -LL y>0
[0115] like Figure 3 , which is a flow chart for implementing the graph neural network method for predicting ship traffic flow in port group waters provided in an embodiment of the present invention.
[0116] In this embodiment, the above method is implemented based on the Pytorch framework using the ship traffic flow characteristics in the OD dataset. The structure of this method is connected through 3 time domain convolution modules and 3 spatial domain convolution modules. The number of output channels of the time domain convolution module is 64, and the number of output channels of the spatial domain convolution module is 32. The hidden layer of the time domain convolution module is set to 20, and the hidden layer of the spatial domain convolution module is set to 40. The loss function is the negative log-likelihood loss function, and the method has undergone 200 rounds of training. The learning rate is 10 -6 In terms of the input sequence length of the time domain convolution, the sequence length was set to 1 day, 2 days, ... 10 days, and 10 experiments were conducted, that is, the sequence data of x days was used to predict the data of x days in the next sequence. This operation is conducive to obtaining the values of various indicators for method comparison and analysis. When changing the time resolution of the data set, the same operation was performed on weekly and monthly data.
[0117] In order to more intuitively display the prediction performance of different models, the six OD pairs with the lowest true zero rate are selected from all the 18×18 OD pairs in the dataset for prediction. In order to more clearly show the comparison effect between the predicted value and the true value, the label of ship traffic flow of 0 is removed when drawing the above figure. Figure 4-9 The predicted and actual ship traffic flows in the OD_Data_1Day dataset for the above six ODs are shown. Figure 10-13The predicted and actual ship traffic flows for four of the OD pairs in the OD_Data_1Month dataset are shown.
[0118] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, and two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.
[0119] The order of execution of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0120] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.
Claims
1. A neural network prediction method for ship traffic flow graph in port group waters, characterized in that: The method comprises: Deconstruct the port group waters, set relevant parameters of the port group waters, and build a navigation network for the port group waters; Based on the mathematical assumptions of the navigation network in the port group waters, a ship traffic flow prediction model is constructed; The distribution characteristics of inter-port ship traffic in the port group water navigation network are analyzed, and it is confirmed that its distribution conforms to the zero-inflated negative binomial distribution characteristics; According to the navigation network of the port group waters, the adjacency matrix of OD pairs between ports is calculated as the input of the graph neural network prediction method; Use diffusion graph convolutional network to capture the spatial adjacency of OD pairs; Use temporal convolutional networks to capture the temporal correlation between OD pairs; The diffusion graph convolutional network is combined with the temporal convolutional network to form a spatiotemporal zero-inflated negative binomial graph neural network method, which is applied to the ship traffic flow prediction model to predict ship traffic flow.
2. According to claim 1, a neural network prediction method for ship traffic flow graph in port group waters is characterized in that: The setting of the relevant parameters of the port group waters is specifically as follows: setting the time length of each port in the port group waters to T, obtaining the number of departure ports, the number of destination ports, and the ship traffic flow and longitude and latitude coordinates of each port with a time length of T.
3. The neural network prediction method for ship traffic flow graph in port group waters according to claim 1 is characterized in that: The port group water navigation network is specifically defined as an undirected OD graph G = (V, E, A), where V represents the OD pair set, that is, the set of departure ports to destination ports in the extracted port group water navigation network, |V| = N is the number of OD pairs; E represents the edge set, representing the connectivity between nodes; A is the adjacency matrix in G that describes the relationship between OD pairs; each OD pair of G samples time series data of length T at the same sampling frequency, and the time series data is the characteristic vector of G.
4. A method for predicting vessel traffic flow graph in a port group water area according to claim 1 or claim 2 or claim 3, characterized in that: Assume that the data set collected in the port group water navigation network G is represented by a third-order tensor D(d1, d2, d3), where d1, d2, and d3 are the OD pair set, feature vector, and time dimension of G, respectively; the ship traffic flow prediction model predicts the ship traffic flow in a future time window through the ship traffic flow of each OD pair in the tth time window, thereby predicting the ship traffic flow of all nodes in the future time windows of the port group water navigation network.
5. The neural network prediction method for ship traffic flow graph in port group waters according to claim 1 is characterized in that: The distribution characteristics of ship traffic flow between ports conform to the zero-inflated negative binomial distribution. The characteristics are as follows: the ship arrival process is highly random, over-dispersed and has a clustering effect, and the ship traffic flow between ports is sparse, and its flow data contains a large number of zeros; The inter-port ship traffic flow that conforms to the zero-inflated negative binomial distribution characteristics is expressed by the zero-inflated negative binomial distribution function: Where n and p represent the shape parameters of the success probability and failure probability in a trial, respectively, and χ k represents the ship traffic flow at the kth moment.
6. A neural network prediction method for ship traffic flow graph in port group waters according to claim 1 or claim 2, characterized in that: According to the latitude and longitude coordinates of the departure port and the destination port and the actual straight-line distance between them, the OD pair adjacency matrix between ports is expressed as: in, are the longitude and latitude of OD for the departure port i, are the longitude and latitude of OD to destination port j respectively, haversine() takes the longitude and latitude of the departure port and the destination port, and calculates the actual straight-line distance between them.
7. The neural network prediction method for ship traffic flow graph in port group waters according to claim 1 is characterized in that: The diffusion graph convolutional network is used to capture the spatial adjacency of OD pairs as follows: Set up at least 2 diffusion graph convolutional network layers, each diffusion graph convolutional network layer is: Among them, H l Indicates l th Hidden layer; Chebyshev polynomial T k (X) = 2XT k-1 (X)-T k-2 (X) is used to approximate the convolution operation in the diffusion graph convolution network, with boundary conditions T0(X)=I and T1(X)=X; and for l th The learning parameters of the hidden layer; σ is the activation function; They represent the forward transfer matrix of the forward diffusion process of the graph convolutional network nodes and the backward transfer matrix of the backward diffusion process, respectively. Backward transfer matrix The diffusion results converge to a stationary distribution P, Where K is the diffusion step size, which is usually set to a finite number; α is the diffusion probability, α∈[0,1]; Represents the node matrix of the graph; the Chebyshev polynomials are also used to approximate the diffusion P distribution.
8. The neural network prediction method for ship traffic flow graph in port group waters according to claim 1 is characterized in that: The time correlation between OD pairs is captured by temporal convolutional network as follows: Set up at least 2 temporal convolutional network layers, each with l Receive from the previous layer J l-1 The data signal is updated using the following formula: J l =f(Γ l *J l-1 +b) where Γ l is the convolution filter of the corresponding layer, * is the shared convolution operation, and b represents the bias, which is used to adjust the output offset.
9. The neural network prediction method for ship traffic flow graph in port group waters according to claim 1 is characterized in that: The spatiotemporal correlation parameters Z = M (X) of each item in the OD data under the assumption of zero-inflated negative binomial distribution are obtained by using the spatiotemporal zero-inflated negative binomial graph neural network method. 1:t ,A), where M is the proposed method framework, which takes historical record data and adjacency matrix as input, outputs the spatiotemporal correlation parameter Z of future prediction data; and uses the probability mass function f of zero-inflated negative binomial distribution ZINB (X t+1:t+k |Z) is used to predict the ship traffic flow in the kth time window in the future, and the negative log-likelihood loss function is used as the performance measure of the ship traffic flow prediction model.
10. A neural network prediction method for ship traffic flow graph in port group waters according to claim 9, characterized in that: The spatiotemporal correlation parameter is obtained specifically in the following manner: A batch of historical data X of size B in the jth time window j:j+B The input ODT tensor is converted into a tensor as a zero-inflated negative binomial distribution input; the diffusion graph convolution network includes a spatial embedding parameter n s , p s , π s and the time embedding parameter n t , p t , π t , used to parameterize the zero-inflated negative binomial distribution output, using the Hadamard product to convert n s , p s , π s and n t , p t , π t The spatial and temporal correlation parameters of the zero-inflated negative binomial distribution are fused into the spatial and temporal correlation parameters of the zero-inflated negative binomial distribution to obtain the spatial and temporal correlation parameters of the zero-inflated negative binomial distribution.
Citation Information
Cited By
Reef limestone crack connectivity prediction method and device in combination with graph neural network
CN120705520A
A method and device for predicting fracture connectivity in reef limestone using graph neural networks
CN120705520B