Expressway flow prediction method and system based on space-time diagram convolutional network
By deploying a spatiotemporal graph convolutional network model at edge computing nodes, the problem of insufficient timeliness, accuracy and scalability in the intelligent traffic flow prediction system is solved, and more efficient and accurate traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202510274036.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-06
AI Technical Summary
The existing intelligent traffic flow prediction system has problems such as insufficient timeliness of prediction results, insufficient prediction accuracy and insufficient system scalability.
The highway traffic prediction method based on the spatiotemporal graph convolution network is adopted. By deploying the STGCN model on the edge computing node, local processing of regional sampled data is realized to avoid transmission delays, and a distributed spatiotemporal graph convolution neural network module is built to extract the spatiotemporal features of traffic flow.
It improves the timeliness and accuracy of predictions, enhances the scalability and deployment flexibility of the system, and reduces the total amount of data processed in the cloud and the global network transmission bandwidth requirements.
Smart Images

Figure CN120108202A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent traffic flow prediction, and in particular to a highway flow prediction method and system based on a spatiotemporal graph convolutional network. Background Art
[0002] In the field of intelligent transportation systems and traffic flow prediction, existing systems are widely constructed based on cloud computing systems, using centralized neural network models such as long short-term memory networks, gated recurrent units, deep distributed neural networks, graph convolutional networks, and hierarchical graph convolutional networks. Although the systems implemented using this technical route have achieved the goal of traffic flow prediction to a certain extent, they generally have the following defects:
[0003] ① Insufficient timeliness of prediction results: The existing cloud-centric computing model requires a large amount of data to be aggregated to the cloud server for processing, which introduces transmission delays and occupies a large amount of network bandwidth, resulting in large processing delays and making it impossible to make real-time predictions for specific areas. For example, the video collected by highway cameras is aggregated in the cloud for processing and returns the prediction results, and the processing delay often exceeds hundreds of milliseconds.
[0004] ② Insufficient prediction accuracy: Traditional neural network models, such as LSTM, GRU, and DDNN, are suitable for processing data sets with single features. When faced with highway traffic flow data, they are affected by the inherent complexity of the spatial structure and the huge volume, making it difficult to extract obvious and unified traffic flow characteristics, resulting in large errors in the prediction results. Although the GCN and HGCN network models can extract spatial feature information from complex traffic flow data, they are limited by the centralized architecture of the model. The prediction results can only reflect the generalized characteristics within the sampling area. There are prediction biases for samples with wide coverage and large regional differences, especially for sub-regional targets. The prediction accuracy needs to be improved.
[0005] ③ Insufficient system scalability: The prediction model deployed using cloud computing architecture uses global raw data for training, which will generate a lot of computational redundancy in actual applications. Data processing, feature extraction, regression prediction and other operations need to be repeated for different regional nodes. When the prediction area changes, full training must be performed again, and incremental processing cannot be achieved, which to a certain extent causes a waste of computing resources. Summary of the invention
[0006] The purpose of the present invention is to provide a highway traffic prediction method and system based on spatiotemporal graph convolutional network to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: a highway flow prediction method and system based on spatiotemporal graph convolutional network, wherein the highway flow prediction method comprises the following steps:
[0008] S1. First, it is necessary to construct the spatiotemporal graph convolutional neural network module of the regional prediction model. The spatiotemporal graph convolutional network module is constructed in a stacked manner. The spatiotemporal graph convolutional network module is constructed by stacking n (n>1) spatial convolution layers and n+1 temporal convolution layers alternately. The input data passes through each temporal and spatial convolutional layer in turn, and the feature extraction of road traffic time characteristics and spatial feature information of road correlation in the monitoring area is completed at the same time.
[0009] S2. Secondly, it is necessary to construct a regional prediction model training data set. The training data of the regional prediction model is based on the vehicle traffic history information obtained by the cameras deployed on the road. The construction steps include the need for vehicle traffic sampling data, road traffic flow sampling data, regional traffic flow monitoring sample data, node-node adjacency relationship matrix, regional prediction model training data set, etc., which cooperate with each other to assist in improving the database.
[0010] S3. Furthermore, it is necessary to train the regional traffic prediction model including data allocation, that is, to allocate the K groups of data in the regional prediction model training data set to the k regional prediction spatiotemporal graph convolutional network modules covered by the global traffic prediction network according to the subscript k, for the training of the regional prediction model. The modules are used for specific areas and cannot be cross-used to avoid introducing errors into the regional traffic prediction results. The regional traffic prediction model training is to take the first 70% of the sample time series in the training data set used by each regional prediction spatiotemporal graph convolutional network module as the training set for model training. The regional traffic prediction model testing is to use the latter 30% of the sample time series in each regional prediction model training data set as the test set to test the generated regional traffic prediction model. The trained regional prediction model is used to predict the traffic flow in the latter part of the sample time series and compare it with the real sampling sample set in the test set.
[0011] S4. In addition, it is necessary to construct a global prediction model spatiotemporal graph convolutional neural network module. The global prediction model predicts the global traffic change trend based on the spatiotemporal feature moments of regional traffic extracted by the regional prediction model. Therefore, the module only contains three superimposed spatiotemporal convolutional network layers in terms of composition structure. However, a mapping conversion module is deployed before the spatiotemporal convolutional layer to aggregate the spatiotemporal feature matrices of regional traffic generated by each sub-region and convert them into the input matrix required for global traffic prediction. The module consists of a convergence layer and a mapping conversion layer arranged in series, in which the mapping conversion layer is composed of two sparsely connected layers and a normalization layer.
[0012] S5. Furthermore, it is necessary to train the global prediction model. The data used for global traffic prediction comes from the regional traffic feature matrix generated by the prediction models of each sub-region within the road network coverage area during the training process. Therefore, the training of the global prediction model and the regional prediction model are carried out at the same time. During the regional model training process, the output of the spatiotemporal graph convolutional neural network module is extracted and sent to the global prediction spatiotemporal graph neural network module as input data, and the back propagation and optimization algorithms are used to train the global prediction model.
[0013] S6. Finally, it is necessary to predict the traffic flow in each area and between areas in the highway network. By using the trained regional prediction model and global prediction model, the regional traffic flow and inter-regional traffic flow in the specified sampling period after time T can be predicted. For example, the traffic flow characteristics in the T+1 period can be predicted. The output of each regional prediction model contains the traffic prediction value of each node at time T+1; the global prediction model output shows the traffic flow prediction value between each sub-area in the domain at time T+1.
[0014] Preferably, the temporal convolution layer in the spatiotemporal graph convolution module is composed of a custom gated linear unit, the spatial convolution layer in the spatiotemporal graph convolution module adopts a typical graph convolution network GCN structure to capture the spatial correlation characteristics of the road, and the fully connected layer is used to finally generate the prediction result.
[0015] Preferably, the vehicle traffic sampling data represents the vehicle license plate information captured by a specific camera at a specific time point, the road traffic flow sampling data represents a sampling time slice is a time segment with 1 standard time unit, and it can be seen that a sample period with a duration of T contains T temporally continuous sampling time slices, and the regional traffic flow monitoring sample data represents that the flow sample matrix is constructed using the flow data of all nodes in the area.
[0016] Preferably, the node-node adjacency relationship matrix represents the total number of nodes deployed in the regulatory area of the known regional model, and constructs a matrix for capturing the spatial correlation between nodes. The regional prediction model training data set represents that if the global traffic prediction network covers a total of K regions, the traffic monitoring matrix and the node-node adjacency matrix are constructed for these K regions respectively according to the above collected data, and the prediction model training data set for each region is constructed.
[0017] Preferably, the spatiotemporal graph neural network module architecture of the global prediction module includes a convergence layer, that is, the global prediction model neural network convergence layer collects the spatiotemporal characteristics of regional traffic output from the regional prediction model of each regional end node, and performs splicing and integration to form the spatiotemporal characteristics of node traffic covering the entire sampling point. The mapping conversion layer converts the global sampling point traffic feature matrix obtained by aggregation into a regional traffic feature matrix, and inputs the subsequent time-space convolution layer to extract regional traffic flow features and establish a global prediction model. The mapping conversion layer is composed of two sparse connection layers and one normalization layer.
[0018] Preferably, the spatiotemporal graph neural network module architecture of the global prediction module also includes a region-node adjacency matrix, a region-region adjacency matrix, and a spatiotemporal graph neural network layer and a fully connected layer, that is, the region-node adjacency matrix indicates the correlation between the detection nodes and each region between regions and the region-region adjacency matrix is used to capture the spatial correlation between regions, and the convolutional neural network module of the global prediction model is composed of two layers of temporal convolutional layers sandwiching a layer of spatial convolutional layer, and finally a fully connected layer is used to achieve the final global prediction, converting the global features into global prediction outputs, and the construction method of the spatiotemporal graph neural network layer and the fully connected layer is the same as the regional prediction spatiotemporal graph convolutional neural network model.
[0019] Preferably, the inter-regional traffic prediction utilizes the trained regional prediction model to predict the traffic flow at each sampling point in the 10 monitoring sub-domains at future time t, wherein the interval between the prediction time t and t+1 is not less than 5 minutes, and the intermediate result node traffic feature matrix output by the regional prediction model is extracted and input into the global prediction model to obtain the regional and inter-regional node traffic prediction data at time t.
[0020] Preferably, during the regional model training process, the output of the spatiotemporal graph convolutional neural network module, i.e., the node traffic feature matrix of each region, is extracted and sent to the global prediction spatiotemporal graph neural network module as input data, and the back propagation and optimization algorithm ADAM is applied, and the learning rate is set to 0.001 and the batch size is set to 2,006 to train the global prediction model.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] The present invention improves the timeliness of prediction: by deploying the STGCN model on the edge computing node, local processing of regional sampling data is realized, transmission delays in the regional prediction operation process are avoided, and the real-time performance of the regional prediction results is improved. At the same time, since the aggregation of original sampling data is avoided, the total amount of data processed by the cloud is effectively reduced, the processing speed of the global prediction model on the cloud is improved, the timeliness is improved, and the global network transmission bandwidth requirements are reduced. In the simulation experiment, the response time on the traffic prediction server using the traditional centralized structure exceeds 200 milliseconds, while the average response time of the local prediction on the edge server is only 4 milliseconds; at the same time, under the same bandwidth conditions, the overall training time of the system is shortened by about 35%.
[0023] The present invention improves prediction accuracy: the improved STGCN model can fully capture the spatiotemporal correlation of traffic flow, effectively improve the prediction accuracy of the model, and when measured by the mean square error MSE, mean absolute percentage error, and determination coefficient as shown in formulas 1, 2, and 3, the MSE and MAPE of the regional prediction results are significantly reduced, and the determination coefficient is significantly improved. In actual traffic flow data tests on multiple highways in Guanzhong area of Shaanxi Province, the results show that the model has lower latency and excellent prediction effect, and the training time and prediction time are improved by 30% to 40% and 40%-50% respectively compared with the current most advanced methods, and the prediction effect surpasses all existing methods.
[0024] The present invention enhances the scalability of the system and improves the deployment flexibility: in multiple local areas included in the global region, edge servers can be set up and local prediction models can be deployed, allowing multi-point concurrent model training and traffic flow prediction operations. When the global coverage area is expanded, only new regional models need to be deployed and incremental training of the cloud-based global prediction model is performed, without the need to retrain the remaining edge node regional prediction models, thereby effectively reducing the system expansion cost, enhancing the system scalability and improving the deployment flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is the regional traffic prediction spatiotemporal graph neural network module architecture and data flow diagram of the present invention.
[0026] Figure 2 This is the global traffic prediction spatiotemporal graph convolutional neural network module architecture and data flow diagram of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] See also Figure 1-2 , a highway flow prediction method and system based on spatiotemporal graph convolutional network, the highway flow prediction method comprises the following steps:
[0029] S1. First, it is necessary to construct the spatiotemporal graph convolutional neural network module of the regional prediction model. The spatiotemporal graph convolutional network module is constructed in a stacked manner. By stacking n (n>1) spatial convolution layers and n+1 temporal convolution layers alternately, a spatiotemporal graph convolutional network module is formed. The input data passes through each temporal and spatial convolutional layer in turn, and the feature extraction of road traffic time characteristics and spatial feature information of road correlation in the monitoring area is completed at the same time. A distributed architecture is adopted to establish the neural network prediction model of the highway traffic prediction system, in which the regional prediction model located at the edge node is responsible for the traffic prediction of the local area, and the global prediction model located in the cloud is responsible for the overall traffic trend prediction of the road network coverage area.
[0030] S2. Secondly, it is necessary to construct a regional prediction model training data set. The training data of the regional prediction model is based on the vehicle traffic history information obtained by the cameras deployed on the road. Its construction steps include the need for vehicle traffic sampling data, road traffic flow sampling data, regional traffic flow monitoring sample data, node-node adjacency relationship matrix, regional prediction model training data set, etc., which cooperate with each other to assist in improving the database. When establishing the prediction model, a spatiotemporal graph convolutional neural network module is constructed in an on-demand stacking manner to simultaneously extract the spatiotemporal features of traffic flow monitoring data. By using different data sets to train the node modules distributed in the system, the spatiotemporal features of traffic flow in different regions can be accurately extracted, and the prediction errors introduced by environmental differences between different regions can be avoided, so as to obtain more accurate regional traffic prediction results.
[0031] S3. Furthermore, it is necessary to train the regional traffic prediction model including data allocation, that is, to allocate the K groups of data in the regional prediction model training data set to the k regional prediction spatiotemporal graph convolutional network modules covered by the global traffic prediction network according to the subscript k, for the training of the regional prediction model. The modules are used for specific areas and cannot be cross-used to avoid introducing errors into the regional traffic prediction results. The regional traffic prediction model training is to take the first 70% of the sample time series in the training data set used by each regional prediction spatiotemporal graph convolutional network module as the training set for model training. The regional traffic prediction model test is to use the last 30% of the sample time series in each regional prediction model training data set as the test set to test the generated regional traffic prediction model. The mean square error (MSE), mean absolute square error (MAE), mean absolute percentage error (MAPE), and determination coefficient (R-Square) are used to evaluate the test results, as shown in formulas (6, 7, 8, 9).
[0032]
[0033] in:
[0034] is the prediction result of the regional prediction model; y i is the real traffic data in the test set; n is the number of samples in the test set.
[0035] The trained regional prediction model is used to predict the traffic flow in the latter part of the sample time series and compare it with the real sample set in the test set. The evaluation indicators are calculated according to formulas (6, 7, 8, 9). If the indicator exceeds the error limit, the parameters in formulas (1, 2, 3) are adjusted and the training process of step 3 is repeated until the evaluation indicator meets the expected target. A data mapping conversion algorithm is proposed to convert the spatiotemporal feature output matrix obtained during the regional prediction model training process into the input matrix required for the global prediction model training, thereby avoiding the aggregation and processing of the original data in the cloud and significantly reducing the training and operation burden of the global prediction model.
[0036] S4. Furthermore, it is necessary to construct a spatiotemporal graph convolutional neural network module for the global prediction model. The global prediction model predicts the trend of global traffic changes based on the spatiotemporal feature moments of regional traffic extracted by the regional prediction model. Therefore, the module only contains three superimposed spatiotemporal convolutional network layers in terms of composition structure. However, a mapping conversion module is deployed before the spatiotemporal convolutional layer to aggregate the spatiotemporal feature matrices of regional traffic generated by each sub-region and convert them into the input matrix required for global traffic prediction. The module consists of a convergence layer and a mapping conversion layer arranged in series, where the mapping conversion layer is composed of two sparsely connected layers and a normalization layer. The architecture of the spatiotemporal graph neural network module of the global prediction module is as follows: Figure 2 as shown in .
[0037] S5. Furthermore, it is necessary to train the global prediction model. The data used for global traffic prediction comes from the regional traffic feature matrix generated by the prediction models of each sub-region in the road network coverage area during the training process. Therefore, the training of the global prediction model and the regional prediction model are carried out at the same time. During the regional model training process, the output of the spatiotemporal graph convolutional neural network module is extracted. The input data is sent to the global prediction spatiotemporal graph neural network module, and the back-propagation and optimization algorithms (such as Adam or RMSprop) are used to train the global prediction model.
[0038] S6. Finally, it is necessary to predict the traffic flow in each area and between areas in the highway network. By using the trained regional prediction model and global prediction model, the regional traffic flow and inter-regional traffic flow in the specified sampling period after time T can be predicted. For example, the traffic flow characteristics in the T+1 period can be predicted. The output of each regional prediction model contains the traffic prediction value of each node at time T+1; the global prediction model outputs x f-out Displays the traffic flow forecast value between each sub-area in the domain at time T+1.
[0039] In this embodiment: the temporal convolution layer in the spatiotemporal graph convolution module is composed of a custom gated linear unit, and its learning parameter operation formula is shown in formula (1):
[0040]
[0041] in:
[0042] x t-in represents the feature input matrix at time t; x t-out Represents the feature output matrix at time t;
[0043] σ represents the sigmoid activation layer of the graph convolutional network;
[0044] It is the bias parameter of the direct connection part and the activation part of the graph convolutional network;
[0045] and are the learning parameters of the gate linear module;
[0046] When processing traffic flow monitoring data in a local area, the two-step convolution operation is calculated first, and then the activated nodes in the network are processed through the σ activation layer. Finally, the output of the temporal convolution module is obtained by multiplication. The spatial convolution layer in the spatiotemporal graph convolution module adopts the typical graph convolution network GCN structure to capture the spatial correlation characteristics of the road. The learning parameter operation formula is shown in formula (2):
[0047]
[0048] in:
[0049] x s-in The input matrix represents the spatial dimensions; x 5-out represents the output matrix of spatial dimensions; and x s-in is the output of the previous layer of time convolution module in the stacked structure, that is, x 5-in =x t-out ;τ represents the ReLU activation layer;
[0050] A is an adjacency matrix used to collect the relationship between nodes (see Equation 5). The adjacency matrix represents the connection relationship between nodes in the graph; It is obtained by adding the unit matrix I to A. Its function is to consider its own information when updating the features at each node.
[0051] D is a diagonal matrix whose elements satisfy
[0052] is the learning parameter of the graph convolutional network;
[0053] When processing traffic flow monitoring data in a local area, the spatial convolution layer receives the output of the preceding temporal convolution layer as input, and the processing result is used as the input of the subsequent spatial convolution layer (or fully connected layer), and the fully connected layer is used to finally generate the prediction result. As shown in formula (3):
[0054] x r-out =Wx in +b (3)
[0055] in:
[0056] x in is the input feature matrix of the fully connected layer module; x r-out is the output feature matrix of the module; and x in It is the output of the last layer of time convolution module in the stacked structure, and is the spatiotemporal feature matrix of node traffic flow in this area. ;
[0057] b is the bias parameter;
[0058] W∈R fs×1 are trainable weights;
[0059] During the experimental verification process, a 5-layer stacked spatiotemporal graph convolutional neural network module with n=2 was constructed, such as Figure 1 as shown in .
[0060] In this embodiment, the vehicle traffic sampling data represents the vehicle license plate information captured by a specific camera at a specific time point, which can be represented as a triplet with spatiotemporal information features: vehicle_sample=(l p ,time,v), where:
[0061] lp is the vehicle photo information; time is the specific sampling time, accurate to milliseconds; v is the sampling point (camera) number. Since the camera is fixed, different cameras represent different deployment locations and have indirect geographic location coordinate information. The sampling points of vehicle traffic sampling data are referred to as nodes below;
[0062] By aggregating all the sampling data collected by the node numbered v within a sampling period of duration T_elp, the vehicle traffic sampling data set vsmp is constructed. v ={vehicle_sample time},0≤time≤T_elp;
[0063] The total number of cameras deployed in the regional model supervision area is N, which constitutes the node set V = {v i}, 1≤i≤N; then all the sampling data of the nodes in V in a sample period are aggregated to obtain the regional vehicle traffic sampling data set SMP={vsmp v}, v∈V, the road traffic flow sampling data represents a sampling time slice with 1 standard time unit. It can be seen that a sample period of duration T contains T temporally continuous sampling time slices. The road traffic flow sampling data is obtained based on vehicle traffic data statistics, which represents the total number of vehicles with different license plate information passing through a sampling point within a sampling time slice. The flow data can be expressed as a triple flow=(x,t,v), where:
[0064] x is the total number of vehicles with different license plate information lp; t is the sampling time slice number; v is the node number;
[0065] When performing flow monitoring and flow prediction, we focus on the x component in flow, so it is abbreviated as xv,t;
[0066] The historical traffic flow data collected by a node numbered v in a sample period constitutes a vector X v =(x v,1 ,x v,2 ,…,x v,T), the regional traffic flow monitoring sample data represents that the traffic sample matrix is constructed using the traffic data of all nodes in the region. Suppose there are N nodes deployed in the region, and the historical traffic flow vector obtained by each node in a sample period T is Xv, and the regional traffic flow monitoring matrix x is constructed. r , the structure is shown in formula (4):
[0067] (4)
[0068] x r The horizontal row is the flow monitoring data sequence of sampling point v within the sample period; r The vertical column is the traffic flow monitoring data of all N sampling points in the area at the sampling period t.
[0069] In this embodiment, the node-node adjacency matrix represents the total number of nodes deployed in the regulatory area of the known regional model, N, and constitutes a node set V = {v i}, 1≤i≤N. The matrix constructed to capture the spatial correlation between nodes is shown in formula (5), which is called the node-node adjacency matrix:
[0070] (5)
[0071] Where: r i,j , (1≤i, j≤N) identifies the node v i With v j The adjacency relationship between nodes is a Boolean constant. A matrix is constructed to capture the spatial correlation between nodes. The regional prediction model training data set indicates that if the global traffic prediction network covers a total of K regions, the traffic monitoring matrix and the node-node adjacency matrix are constructed for these K regions according to the above collected data, and the prediction model training data set for each region is constructed. Suppose that the kth (1≤k≤K) region contains N k nodes, the traffic monitoring matrix of the traffic prediction model in this area is The node-node adjacency matrix is Construct the regional prediction model training data set of all coverage areas of the global traffic prediction network model:
[0072]
[0073] In this embodiment: the global prediction module spatiotemporal graph neural network module architecture includes a convergence layer, that is, the global prediction model neural network convergence layer collects the regional traffic spatiotemporal feature matrix output from the regional prediction model of each regional end node The splicing and integration are performed to form the node traffic spatiotemporal feature matrix x covering the entire sampling point r , as shown in formula (10)
[0074]
[0075] Where: k = 1, ..., K is the serial number of the K areas covered by the global road network; is the regional traffic spatiotemporal feature matrix output by the k-th regional prediction model. The mapping conversion layer converts the global sampling point traffic feature matrix obtained by aggregation into a regional traffic feature matrix, and inputs the subsequent time-space convolution layer to extract regional traffic flow features and establish a global prediction model. The mapping conversion layer consists of two sparse connection layers and one normalization layer. The first sparse connection layer converts the N-dimensional node features into Q-dimensional intermediate features, as shown in formula (11); the second sparse connection layer converts the intermediate variables into M-dimensional regional traffic flow features, as shown in formula (13); the normalization layer located between the two is intended to reduce the internal covariate offset of the model. It can make x inter The mean and variance of are fixed to stabilize the global training network, which is constructed based on formula (13), where μ, σ 2 The calculation method of is shown in formula (12).
[0076] x inter =(E 0 ⊙W 0 )*x r +b 0 (11)
[0077]
[0078] x f =(E 1 ⊙W 1 )*x bn-inter +b 1 (14)
[0079] in:
[0080] x r It is the N-dimensional sampling point traffic feature matrix after aggregation;
[0081] Q is the dimension of the intermediate result matrix, and its value satisfies N>Q>M and Q mod M=0, where N is the total number of detection nodes in each area and M is the total number of detection nodes on the road sections between areas;
[0082] x inter It is the intermediate result of Q dimension and the characteristic matrix of N×Q dimension;
[0083] x bn-inter is x inter The intermediate results after normalization;
[0084] x f is the output matrix of the mapping conversion module and is a feature matrix of N×M dimensions;
[0085] μ is x inter The mean value, σ 2 is x inter The variance of , where ∈ is the smallest constant to maintain numerical stability;
[0086] w 0 is a trainable parameter, b 0 is the random bias of the first layer, E 0 is the embedding matrix used to process the first sparse link layer;
[0087] W 1 is a trainable parameter, b 1 is the random bias of the second layer, E 1 is the embedding matrix used to process the second sparse link layer;
[0088] E 0 and E 1 According to the region-node adjacency matrix The information is constructed by N×Q and Q×M matrices respectively.
[0089] In this embodiment: the global prediction module spatiotemporal graph neural network module architecture also includes a region-node adjacency matrix, a region-region adjacency matrix, and a spatiotemporal graph neural network layer and a fully connected layer, that is, the region-node adjacency matrix indicates the correlation between the detection nodes between regions and each region, and the region-node adjacency matrix indicates the correlation between the detection nodes between regions and each region, wherein each element Indicates the affiliation between node i and region j, which is a Boolean constant; is a Boolean matrix of dimension N×M, where N is the total number of global detection nodes, M is the number of sub-regions, and the region-region adjacency matrix is used to capture the spatial correlation between regions. It is a matrix of dimension M×M, where the element r i,j ∈A ff is a Boolean constant, indicating whether region i is adjacent to region j. The convolutional neural network module of the global prediction model consists of two temporal convolutional layers sandwiching a spatial convolutional layer. Finally, a fully connected layer is used to achieve the final global prediction, converting the global features into global prediction outputs. The construction method of the spatiotemporal graph neural network layer and the fully connected layer is the same as that of the regional prediction spatiotemporal graph convolutional neural network model, see formula (1, 2).
[0090] In this embodiment: the regional traffic prediction uses the regional prediction model obtained through training to predict the traffic flow of each sampling point in the 10 monitoring sub-areas at the future time t, wherein the interval between the prediction time t and t+1 is not less than 5 minutes, extracts the intermediate result node traffic feature matrix output by the regional prediction model, inputs the global prediction model, obtains the regional and inter-regional node traffic prediction data at time t, and implements the temporal convolutional neural network layer module shown in formula (1) and the spatial convolutional neural network layer module shown in formula (2) respectively, and stacks and encapsulates them in the order of time-space-time-space-time to form a prediction model feature extraction module with n=2;
[0091] The fully connected layer prediction module shown in formula (3) is implemented by programming, and is encapsulated together with the feature extraction module into a spatiotemporal graph convolutional neural network module of the regional prediction model.
[0092] In this embodiment: During the regional model training process, the output of the spatiotemporal graph convolutional neural network module, i.e., the node flow feature matrix of each region, is extracted and sent to the global prediction spatiotemporal graph neural network module as input data. The back propagation and optimization algorithm ADAM is applied, and the learning rate is set to 0.001 and the batch size is set to 2,006 to train the global prediction model. The data set used for model training and testing comes from the highway gantry vehicle monitoring data at the intersection of three highways in a certain place. The road network covers 10 administrative regions, which naturally constitutes the coverage subdomains of 10 regional prediction models; there are a total of 9 sections between regions. There are 59 gantries in the entire domain, with a total of 59 sampling points, of which 50 sampling points are located in the subdomain covered by the regional prediction model, and 9 sampling points are located in the inter-domain sections. The original data of gantry vehicle monitoring covers 183 days, including the monitoring records of all 59 sampling points.
[0093] According to the regional distribution of sampling points, the original sampling data of 59 gantries are divided into 10 groups of regional prediction model training data and 1 group of inter-domain sampling point detection data for global prediction model training data. This group of data will be combined with the intermediate result sampling point flow feature matrix x output by the regional prediction model. r They are input together into the aggregation layer of the global prediction module to construct the global model training data.
[0094] The following takes region 1 (including 5 sampling points) as an example to illustrate the construction of the regional prediction model training data set:
[0095] According to steps 2.1 to 2.3, let the sample period T = 24h and the sampling time slice length t = 5min, then all the data contains 183 sample periods, and each sample period contains 288 sets of sample data. Taking sampling point 1 as an example, all the sample flow monitoring data in the first sampling period constitute the traffic flow vector The sample flow monitoring data of all five sampling points in the first sampling period constitute the road traffic flow monitoring matrix x 1 :
[0096]
[0097] According to step 2.4, region 1 contains only one highway, where five gantry stations are evenly spaced (i.e., five sampling points are set up). The node-node adjacency matrix of region 1 is
[0098]
[0099] Referring to the traffic flow monitoring matrix construction method of the first cycle of area 1, continue to construct the road traffic flow monitoring matrix x for cycles 2 to 183 2 ~x 183 ;
[0100] Referring to the construction method of the training data set for region 1, training data sets of regional prediction models were constructed for the remaining 9 regions.
[0101] Regional traffic prediction model training
[0102] The 10 training data sets obtained in step 2 are divided into training sets and test sets in a ratio of 7:3 for training and testing of regional prediction models in 10 different regions. The training set contains data from the first 174 sample periods, and the test set contains data from the last 9 sample periods.
[0103] When training the regional prediction model, the feature sampling size of the temporal convolution is set to 16, and the feature sampling size of the spatial convolution is set to 8. The ADAM optimizer is used, and the learning rate is set to 0.001 and the batch size is set to 2,006. The mean square error (MSE) is used as the loss function for model training.
[0104] Constructing a global prediction model spatiotemporal graph convolutional neural network module
[0105] Using the implemented temporal convolutional neural network layer module and spatial convolutional neural network layer module, stack and encapsulate them in the order of time-space-time to form a prediction model feature extraction module of n=1; implement the convergence layer module shown in formula (10) according to programming, and implement the mapping conversion layer module shown in formulas (11-14); then add the fully connected layer module implemented in step 1, and Figure 1 The sequence of aggregation - transformation - time - space - time - full connection shown in the figure constitutes the spatiotemporal graph convolutional neural network module of the global prediction model.
[0106] Construct the region-node adjacency matrix according to step 4.3 The element a i,j The value of is assigned according to the affiliation relationship between sampling point i and region j. When i is in region j, the value is 1, otherwise it is 0;
[0107] According to constructing the region-region adjacency matrix The value of the element is determined according to the actual geographical location relationship. When subdomains i and j are adjacent, the value is 1, otherwise it is 0.
[0108] Global prediction model training
[0109] During the regional model training process, the output of the spatiotemporal graph convolutional neural network module, that is, the node traffic feature matrix of each region, is extracted and sent to the global prediction spatiotemporal graph neural network module as input data. The back propagation and optimization algorithm ADAM are applied, and the learning rate is set to 0.001 and the batch size is 2,006 to train the global prediction model.
[0110] Traffic forecast (including regional forecast and global forecast)
[0111] The trained regional prediction model is used to predict the traffic flow of each sampling point in the 10 monitoring sub-areas at the future time t, where the interval between the prediction time t and t+1 is not less than 5 minutes.
[0112] The node flow feature matrix of the intermediate result output by the regional prediction model is extracted and input into the global prediction model to obtain the regional and inter-regional node flow prediction data at time t.
[0113] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A highway traffic prediction method and system based on spatiotemporal graph convolutional network, characterized by: The highway traffic flow prediction method includes the following steps: S1. First, it is necessary to construct the spatiotemporal graph convolutional neural network module of the regional prediction model. The spatiotemporal graph convolutional neural network module is constructed in a stacked manner. The spatiotemporal graph convolutional neural network module is constructed by stacking n (n>1) spatial convolutional layers and n+1 temporal convolutional layers alternately. The input data passes through each temporal and spatial convolutional layer in turn, and the feature extraction of the road traffic time feature and the spatial feature information of the road correlation in the monitoring area is completed at the same time; S2. Secondly, it is necessary to construct a regional prediction model training data set. The training data of the regional prediction model is based on the vehicle traffic history information obtained by the cameras deployed on the road. The construction steps include the need for vehicle traffic sampling data, road traffic flow sampling data, regional traffic flow monitoring sample data, node-node adjacency relationship matrix, regional prediction model training data set, etc., which cooperate with each other to assist in improving the database; S3. Furthermore, it is necessary to train the regional traffic prediction model including data allocation, that is, to allocate the K groups of data in the regional prediction model training data set to the k regional prediction spatiotemporal graph convolutional network modules covered by the global traffic prediction network according to the subscript k, for the training of the regional prediction model, which is dedicated to each area and cannot be cross-used, so as not to introduce errors into the regional traffic prediction results. The regional traffic prediction model training, that is, in the training data set used by each regional prediction spatiotemporal graph convolutional network module, the first 70% of the sample time series is taken as the training set for model training, and the regional traffic prediction model is tested, that is, the latter 30% of the sample time series in the training data set of each regional prediction model is used as the test set to test the generated regional traffic prediction model, and the trained regional prediction model is used to predict the traffic flow in the latter part of the sample time series, and compared with the real sampling sample set in the test set; S4. Furthermore, it is necessary to construct a spatiotemporal graph convolutional neural network module for the global prediction model. The global prediction model predicts the trend of global traffic changes based on the spatiotemporal feature moments of regional traffic extracted by the regional prediction model. Therefore, the module only contains three superimposed spatiotemporal convolutional network layers in terms of composition structure. However, a mapping conversion module is deployed before the spatiotemporal convolutional layer to aggregate the spatiotemporal feature matrices of regional traffic generated by each sub-region and convert them into the input matrix required for global traffic prediction. The module consists of a convergence layer and a mapping conversion layer arranged in series, in which the mapping conversion layer is composed of two sparsely connected layers and a normalization layer; S5. Furthermore, it is necessary to train the global prediction model. The data used for global traffic prediction comes from the regional traffic feature matrix generated by the prediction models of each sub-region in the road network coverage area during the training process. Therefore, the training of the global prediction model and the regional prediction model are carried out at the same time. During the regional model training process, the output of the spatiotemporal graph convolutional neural network module is extracted and sent to the global prediction spatiotemporal graph neural network module as input data, and the back propagation and optimization algorithm are used to train the global prediction model. S6. Finally, it is necessary to predict the traffic flow in each area and between areas in the highway network. By using the trained regional prediction model and global prediction model, the regional traffic flow and inter-regional traffic flow in the specified sampling period after time T can be predicted. For example, the traffic flow characteristics in the T+1 period can be predicted. The output of each regional prediction model contains the traffic prediction value of each node at time T+1; the global prediction model output shows the traffic flow prediction value between each sub-area in the domain at time T+1.
2. According to claim 1, a highway traffic flow prediction method and system based on spatiotemporal graph convolutional network is characterized by: The temporal convolution layer in the spatiotemporal graph convolution module is composed of a custom gated linear unit, the spatial convolution layer in the spatiotemporal graph convolution module adopts a typical graph convolution network GCN structure to capture the spatial correlation features of the road, and the fully connected layer is used to finally generate the prediction results.
3. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: The vehicle traffic sampling data represents the vehicle license plate information captured by a specific camera at a specific time point. The road traffic flow sampling data represents that a sampling time slice is a time segment with 1 standard time unit. It can be seen that a sample period with a duration of T contains T temporally continuous sampling time slices. The regional traffic flow monitoring sample data represents that the flow sample matrix is constructed using the flow data of all nodes in the region.
4. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: The node-node adjacency relationship matrix represents the total number of nodes deployed in the regulatory area of the known regional model, and constructs a matrix for capturing the spatial correlation between nodes. The regional prediction model training data set represents that if the global traffic prediction network covers a total of K regions, the traffic monitoring matrix and the node-node adjacency matrix are constructed for these K regions according to the above collected data, and the prediction model training data set for each region is constructed.
5. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: The architecture of the spatiotemporal graph neural network module of the global prediction module includes a convergence layer, that is, the convergence layer of the global prediction model neural network collects the spatiotemporal characteristics of regional traffic output from the regional prediction model of each regional end node, and performs splicing and integration to form the spatiotemporal characteristics of node traffic covering the entire sampling point. The mapping conversion layer converts the global sampling point traffic feature matrix obtained by aggregation into a regional traffic feature matrix, and inputs the subsequent time-space convolution layer to extract regional traffic flow features and establish a global prediction model. The mapping conversion layer consists of two sparse connection layers and one normalization layer.
6. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: The global prediction module spatiotemporal graph neural network module architecture also includes a region-node adjacency matrix, a region-region adjacency matrix, and a spatiotemporal graph neural network layer and a fully connected layer, that is, the region-node adjacency matrix indicates the correlation between the detection nodes and each region between regions, and the region-region adjacency matrix is used to capture the spatial correlation between regions, and the convolutional neural network module of the global prediction model is composed of two layers of temporal convolutional layers sandwiching a layer of spatial convolutional layer, and finally a fully connected layer is used to achieve the final global prediction, converting the global features into global prediction outputs, and the construction method of the spatiotemporal graph neural network layer and the fully connected layer is the same as the regional prediction spatiotemporal graph convolutional neural network model.
7. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: The inter-regional traffic prediction uses the trained regional prediction model to predict the traffic flow of each sampling point in the 10 monitoring sub-domains at the future time t, where the interval between the prediction time t and t+1 is not less than 5 minutes. The intermediate result node traffic feature matrix output by the regional prediction model is extracted and input into the global prediction model to obtain the regional and inter-regional node traffic prediction data at time t.
8. The highway traffic flow prediction method and system based on spatiotemporal graph convolutional network according to claim 1 is characterized by: During the regional model training process, the output of the spatiotemporal graph convolutional neural network module, i.e., the node traffic feature matrix of each region, is extracted and sent to the global prediction spatiotemporal graph neural network module as input data. The back propagation and optimization algorithm ADAM are applied, and the learning rate is set to 0.001 and the batch size is set to 2,006 to train the global prediction model.