Urban road network traffic flow prediction method based on K-shape clustering algorithm and graph convolutional neural network

Through the K-shape clustering algorithm and the time sequence clustering model of graph convolution neural network, the prediction sub-regions of traffic flow data are divided, and combined with graph convolution and LSTM network, the problem of insufficient traffic flow prediction accuracy in the existing technology is solved. , achieving higher prediction accuracy and stability.

CN119068681AInactive Publication Date: 2024-12-03HEBEI GEO UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411351446.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing urban road network traffic flow prediction methods cannot effectively reduce the impact of weak correlation data, and cannot deeply analyze the spatiotemporal characteristics of traffic flow data, resulting in insufficient prediction accuracy.

Method used

Using the time sequence clustering model (TSC-GCN) based on K-shape clustering algorithm and graph convolutional neural network, the traffic is captured by dividing more relevant prediction sub-regions of traffic flow data, combined with graph convolutional neural network and LSTM neural network. The spatial and temporal laws of streaming data.

Benefits of technology

It improves the accuracy of traffic flow prediction in urban road networks, reduces the impact of weak correlation data on prediction, and significantly improves the accuracy and stability of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068681A_ABST
    Figure CN119068681A_ABST
Patent Text Reader

Abstract

The invention discloses an urban road network traffic flow prediction method based on a K-shape clustering algorithm and a graph convolutional neural network. Original traffic flow data of a selected urban road network are obtained, and an urban road network traffic flow data set is obtained through data processing; a K-shape clustering algorithm is used to construct a sub-region division module of the urban road network traffic flow prediction method, urban sub-road network division is carried out on an urban road network, and prediction sub-regions with stronger traffic flow data correlation are obtained; selecting a graph convolutional neural network to construct a space module of the prediction method, and analyzing a traffic flow data space rule and a road network topological structure of each prediction subarea; a time module of the prediction method is constructed by using a long-short-term memory neural network, and a time rule of urban road network traffic flow data is mined; and introducing an output module of the full connection layer construction prediction method to obtain a pre-measured value of the urban road network traffic flow. Compared with an existing prediction method, the urban road network traffic flow prediction method can significantly improve the urban road network traffic flow prediction precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent transportation systems and relates to a method for predicting urban road network traffic flow based on a K-shape clustering algorithm and a graph convolutional neural network. Background Art

[0002] With the rapid development of social economy, the number of motor vehicles has increased year by year, and the resulting traffic congestion has become increasingly severe. In order to alleviate traffic congestion, intelligent transportation systems have come into being. In recent years, computer and information technology have been updated at a high speed, and intelligent transportation systems have been greatly developed. Intelligent transportation systems have become one of the main means to alleviate traffic congestion. Traffic flow prediction is an important part of the intelligent transportation system to achieve advance path planning and traffic management, and its accuracy is crucial.

[0003] Traffic flow prediction is to estimate future traffic flow data through historical traffic flow data and prediction methods. Therefore, the performance of the prediction method directly determines the accuracy of traffic flow prediction. Traffic flow prediction methods have been developed for decades, including statistical methods, machine learning methods and deep learning methods. Among them, statistical methods were used earlier, and the History Average (HA) model and time series model are the most widely used. Most statistical methods cannot capture the nonlinear fluctuations of traffic flow data, so machine learning methods are introduced into traffic flow prediction. With the explosive growth of traffic flow data, the disadvantages of shallow machine learning methods that they cannot effectively analyze the spatiotemporal laws of traffic flow big data have gradually emerged. Therefore, deep learning methods have become the mainstream method in the field of traffic flow prediction. The most widely used deep learning methods include Long Short-Term Memory (LSTM) neural network, gated recurrent unit neural network and convolutional neural network (CNN). With the continuous acceleration of urbanization, the scale of urban road networks has become larger and the structure has gradually diversified. In order to consider the topological structure of the road network, graph neural networks and graph convolutional neural networks (GCN) are also used for traffic flow prediction.

[0004] Based on statistical methods, machine learning methods and deep learning methods, many traffic flow prediction methods have been proposed. However, there are few traffic flow prediction methods that can be applied to various urban road networks. The structure of urban road networks is complex, and the correlation of traffic flow data in the road network is not only related to the acquisition location, but also to the road connectivity. When predicting urban road network traffic flow, existing studies usually construct the traffic flow data of the entire urban road network into an input matrix, which cannot reduce the impact of weakly correlated data in the road network. In addition, existing traffic flow prediction studies based on graph neural networks usually only use one method, graph neural networks, for prediction, which cannot deeply analyze the spatiotemporal characteristics of urban road network traffic flow data. Therefore, based on graph neural networks, how to construct a traffic flow prediction method for urban road networks that can reduce the impact of weakly correlated data and capture spatiotemporal characteristics at the same time needs further exploration. Summary of the invention

[0005] The purpose of the present invention is to solve the problems existing in the existing research on urban road network traffic flow prediction, and propose a method for urban road network traffic flow prediction based on K-shape clustering algorithm and graph convolutional neural network, namely, graph convolutional neural network based on time series clustering (Graph Convolutional Network Based on Time Series Clustering, TSC-GCN model), so as to improve the accuracy of urban road network traffic flow prediction.

[0006] The purpose of the present invention can be achieved through the following technical solutions:

[0007] A method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network, the steps are as follows:

[0008] S1. Acquisition of traffic flow data of urban road network: determine the spatial scope of urban road network and obtain the original traffic flow data within the spatial scope; determine the time scope and time interval of traffic flow prediction task, pre-process and aggregate the original traffic flow data based on the determined time scope and time interval, and obtain the traffic flow data set of urban road network;

[0009] S2. TSC-GCN model construction: Use K-shape clustering algorithm to divide the urban road network to obtain the urban sub-road network with more relevant traffic flow data, called prediction sub-area; construct the input matrix of TSC-GCN model based on the traffic flow data set in the prediction sub-area; analyze the road network topology structure in the prediction sub-area based on GCN neural network to capture the spatial regularity of traffic flow data in each prediction sub-area; then, use LSTM neural network to analyze the temporal characteristics of traffic flow data in each prediction sub-area, and then construct TSC-GCN model for urban road network traffic flow prediction;

[0010] S3, TSC-GCN model training: divide the urban road network traffic flow dataset into training set and test set, construct the loss function, and use the training set to train the TSC-GCN model;

[0011] S4. TSC-GCN model performance evaluation: Use the trained TSC-GCN model to predict the urban road network traffic flow in the test set and evaluate the prediction performance of the TSC-GCN model.

[0012] The step S1 comprises the following steps:

[0013] S11. Acquisition of original traffic flow data of urban road network: Select the spatial range of urban road network, and use the traffic flow detector in the selected urban road network area to obtain the original traffic flow data R=(r1, r2,…, r d ,…,r D );r d = {r d (Ss,S)|0<s≤S} is the original traffic flow data sequence of the traffic flow detector d, S is any time, s is the sampling time interval of the traffic flow detector, d∈{1,2,…,D}, and D is the number of traffic flow detectors in the selected urban road network;

[0014] S12. Construction of urban road network traffic flow dataset: Process the original traffic flow data R according to the selected time range and time interval, including the recovery of missing and abnormal traffic flow data and the aggregation of traffic flow data, and then obtain the urban road network traffic flow dataset X = (x1, x2, ..., x d ,…,x D ), is the traffic flow data sequence of the traffic flow detector d; For the Traffic flow data of traffic flow detector d in time interval, The number of time intervals for traffic flow data within the selected time range.

[0015] The step S2 comprises the following steps:

[0016] S21. Construction of sub-area division module: Use the distance measure (Shape Based Distance, SBD) in the K-shape clustering algorithm to calculate the similarity of the traffic flow data sequences of any two traffic flow detectors in the urban road network traffic flow dataset X, that is:

[0017]

[0018] in, When the number of slides is u, x d and The mutual correlation coefficient between Traffic flow detector Traffic flow data series; For x d and The set of mutual correlation coefficients between The time displacement is Time d and The correlation coefficient between

[0019] The obtained mutual correlation coefficient is normalized, that is:

[0020]

[0021] in, When the number of slides is u, x d and The normalized correlation coefficient between For x d and The set of normalized mutual correlation coefficients between RL0(x d ,x d ) is the time displacement when x is 0 d and x d The correlation coefficient between When the time displacement is 0 and The correlation coefficient between

[0022] x d and The normalized correlation coefficient between is in the range of [-1, 1]; then, based on the normalized correlation coefficient, x is obtained. d and The SBD value between:

[0023]

[0024] in, For x d and SBD value between, Max is the maximum value;

[0025] Then, the number of prediction sub-areas Q is set, and the maximum normalized correlation coefficient between the traffic flow data of a certain traffic flow detector in the urban sub-road network and the traffic flow data of other traffic flow detectors is set as the goal, and the core traffic flow detector and the best prediction sub-area of ​​each urban sub-road network are obtained. The optimization function is as follows:

[0026]

[0027] Among them, x c is the traffic flow data of the assumed core traffic flow detector in the prediction sub-area q; q is the traffic flow dataset for the predicted sub-area q, q∈{1,2,…,Q}; argMax is the argMax function;

[0028] Secondly, the number of iterations of the K-shape clustering algorithm is set to obtain the best prediction sub-area;

[0029] S22. Spatial module construction: Select the time lag number for each prediction according to and X q Constructing the input matrix of the TSC-GCN model The GCN neural network is selected to build the spatial module of the TSC-GCN model for urban road network traffic flow prediction. The input of the GCN neural network includes the adjacency matrix and the urban road network traffic flow dataset. The adjacency matrix of the prediction sub-area is built according to the road network structure in the prediction sub-area, that is:

[0030]

[0031] in, To predict the traffic flow detector d and The adjacency coefficient between ; represents the traffic flow detector d and There is connectivity between represents the traffic flow detector d and There is no connectivity between them; is the traffic flow detector d and The actual distance between

[0032] Based on the adjacency coefficient of the traffic flow detector in the predicted sub-area q, the adjacency matrix corresponding to the predicted sub-area q is obtained. The adjacency matrix and traffic flow data of the Q predicted sub-areas are input into the GCN neural network, and then the output of the GCN neural network is obtained, namely:

[0033]

[0034] in, For the The output matrix of the graph convolution layer for predicting sub-region q; For the The output matrix of the graph convolution layer for predicting sub-region q, is the number of graph convolutional layers in the spatial module; when When it is 0, A is the input matrix of the first graph convolution layer for predicting sub-region q; q is the adjusted adjacency matrix corresponding to the predicted sub-region q; I q is the identity matrix corresponding to the predicted sub-region q; D q is the degree matrix corresponding to the predicted sub-region q; σ is the activation function in the graph convolution layer;

[0035] Traffic flow data is collected through the spatial module After the convolutional layer, we get the output of the spatial module. For the The output matrix of the graph convolution layer for predicting sub-region q;

[0036] S23. Time module construction: Use LSTM neural network to build the time module of TSC-GCN model for urban road network traffic flow prediction, and put the output of spatial module into LSTM neural network, that is:

[0037]

[0038]

[0039] in, For the In the time interval The input gate in the LSTM layer predicts the output of sub-region q; For the In the time interval The input of the LSTM layer to the prediction sub-region q, For the In the time interval The output of the graph convolution layer for predicting subregion q, is the number of LSTM layers in the time module; and For calculation Parameters when For the In the time interval The output of the forget gate in the LSTM layer predicts the sub-region q; and For calculation Parameters when For the In the time interval The output gate in the LSTM layer predicts the output of sub-region q; and For calculation Parameters when and Respectively The activation function selected by the input gate, forget gate and output gate for the prediction sub-region q in the LSTM layer; and Respectively and In the time interval The LSTM layer predicts the cell state of sub-region q; and For calculation Parameters when and Respectively and In the time interval The LSTM layer memorizes the prediction sub-region q; For Hadamard;

[0040] The spatial module output flows through After the LSTM layer, we get The memory information corresponding to Q prediction sub-regions in the time interval For the In the time interval The LSTM layer predicts the memory information of sub-region q, and then merges the memory information corresponding to Q prediction sub-regions into a matrix, that is:

[0041]

[0042] in, For the The memory information matrix obtained by the LSTM neural network in the time module within the time interval; Con is the matrix concatenation operation;

[0043] S24. Output module construction: Use the fully connected layer to build the output module of the TSC-GCN model, and put the memory information obtained by the time module into the output module, that is:

[0044]

[0045] in, For the The predicted value of urban road network traffic flow within a time interval; is the input of the fully connected layer; W and b are the calculation Parameters when σ D The activation function chosen for the fully connected layers.

[0046] The step S3 comprises the following steps:

[0047] S31, using the urban road network traffic flow data of the first t time intervals as a training set, and using the urban road network traffic flow data after the t-th time interval as a test set;

[0048] S32. Select mean square error as the loss function of the TSC-GCN model, that is:

[0049]

[0050] Among them, MSE TS is the loss function of the TSC-GCN model; For the The predicted value of urban road network traffic flow obtained by TSC-GCN model in the time interval; For the Traffic flow data of urban road network within a time interval;

[0051] S33. Train the TSC-GCN model using the training set and loss function.

[0052] The step S4 comprises the following steps:

[0053] S41. Use the TSC-GCN model to predict the urban road network traffic flow in the test set;

[0054] S42. The prediction accuracy of the TSC-GCN model is evaluated using three indicators: Mean Absolute Percentage Error (MAPE), Mean Absolute Error (MAE) and Root Mean Square Error (RMSE).

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] (1) The present invention takes into account the impact of the correlation of traffic flow data at different locations in the urban road network on the prediction accuracy, and uses a time series clustering algorithm to divide the urban road network to obtain prediction sub-areas with more relevant traffic flow data, thereby reducing the impact of weakly correlated data on the traffic flow prediction accuracy.

[0057] (2) The clustering algorithm used in the present invention is a time series clustering algorithm, namely, a K-shape clustering algorithm, which can better cluster the traffic flow time series data and obtain a more scientific prediction sub-area.

[0058] (3) The present invention gives full play to the advantages of GCN and LSTM neural networks. The GCN neural network in the spatial module is used to mine the spatial correlation of urban road network traffic flow data and the road network topology structure. The LSTM neural network in the temporal module is used to capture the temporal regularity of traffic flow data of each traffic flow detector, thereby further improving the accuracy of urban road network traffic flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 This is the TSC-GCN model structure diagram.

[0060] Figure 2 These are the predicted value and measured value of the traffic flow at the traffic flow detector 1 in the embodiment.

[0061] Figure 3 It is the MAPE value obtained by each prediction method in the embodiment. DETAILED DESCRIPTION

[0062] The following is a further description of the specific implementation of the present invention in conjunction with the accompanying drawings and technical solutions. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0063] A method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network, the specific steps are as follows:

[0064] S1. Acquisition of urban road network traffic flow data:

[0065] The urban road network in Sacramento, USA is selected as the research area. The selected urban road network contains 16 traffic flow detectors, which are numbered 1 to 16. The original traffic flow data R = (r1, r2, …, r 16 ).

[0066] The time range is from April 27 to May 24, 2020, and the time interval is 5 minutes. According to the time range and time interval, the original traffic flow data R = (r1, r2, ..., r 16 ) to pre-process and obtain the urban road network traffic flow data X = (x1, x2, ..., x 16 ).

[0067] S2. TSC-GCN model construction:

[0068] First, the K-shape clustering algorithm is used to divide the urban road network and obtain the predicted sub-areas. The number of iterations of the K-shape clustering algorithm is set to 100, and the number of predicted sub-areas is set to 3. Based on the K-shape clustering algorithm and the urban road network traffic flow data X = (x1, x2, ..., x 16 ), and three prediction sub-areas are obtained. Prediction sub-area 1 includes traffic flow detectors 8, 13, 15, and 16, prediction sub-area 2 includes traffic flow detectors 2, 4, 7, 9, 10, 12, and 14, and prediction sub-area 3 includes traffic flow detectors 1, 3, 5, 6, and 11, thereby obtaining the traffic flow data of the three prediction sub-areas, that is, X1 = (x8, x 13 ,x 15 ,x 16 )、X2=(x2,x4,x7,x9,x 10 ,x 12 ,x 14 ) and X3=(x1,x3,x5,x6,x 11 ).

[0069] Then, the time lag number for each prediction is Set to 12, construct the matrix prediction corresponding to each prediction sub-area based on X1, X2 and X3 and Secondly, build the spatial module, temporal module and output module of the TSC-GCN model. Figure 1 A schematic diagram of the TSC-GCN model structure is given, where GCN is the graph convolution layer and LSTM is the LSTM layer. is the adjacency matrix corresponding to the predicted sub-region Q, X Q The traffic flow dataset for predicting sub-area Q. The number of graph convolution layers in the spatial module of the TSC-GCN model Set to 2, the number of LSTM layers in the time module Set to 1. The number of units in the LSTM layer is set to 16.

[0070] S3. TSC-GCN model training:

[0071] The urban road network traffic flow data from April 27 to May 23, 2020 was used as the training set to train the TSC-GCN model. The urban road network traffic flow data from May 24, 2022 was selected as the test set for prediction. The TSC-GCN model was trained 100 times with a batch size of 64. The Adam algorithm was selected as the optimization algorithm with a learning rate of 0.001. The MSE was minimized. TS As the training target, the TSC-GCN model with optimal parameters is obtained.

[0072] S4. TSC-GCN model performance evaluation:

[0073] The prediction accuracy of the TSC-GCN model is verified using the urban road network traffic flow data on May 24, 2022. In addition, in order to compare the performance of the proposed method with the existing methods, the existing HA model, CNN, LSTM and GCN neural networks are selected as comparison methods. The parameters of the four existing methods are the same as the TSC-GCN model.

[0074] Figure 2 The traffic flow prediction values ​​and traffic flow observation values ​​obtained by HA, CNN, LSTM, GCN and TSC-GCN models at the traffic flow detector 1 on May 24, 2022 are given. Figure 2 It can be seen that the traffic flow prediction values ​​obtained by the HA, CNN, LSTM, GCN and TSC-GCN models are generally close to the observed values, which shows that the parameters of each prediction method are reasonably set and the prediction results are effective. Compared with the HA, CNN, LSTM and GCN neural networks, the predicted values ​​obtained by the TSC-GCN model are closer to the observed values, indicating that the TSC-GCN model has the best prediction effect. Figure 3 The MAPE values ​​of each prediction method for each traffic flow detector in the urban road network on May 24, 2022 are given. It can be found that the MAPE values ​​obtained by the HA model are larger at each traffic flow detector; the MAPE values ​​obtained by the TSC-GCN model are usually the smallest at each traffic flow detector, and the fluctuation range is small, which shows that the prediction accuracy of the TSC-GCN model is good.

[0075] Table 1 Average performance indicators of various prediction methods in urban road networks

[0076]

[0077] To further compare the performance of each prediction method, Table 1 gives the average performance indicators of each method in the urban road network. It can be seen that compared with the HA model, the MAPE, MAE and RMSE values ​​obtained by the LSTM, CNN, GCN and TSC-GCN models are all smaller, indicating that the deep learning method is better than the traditional statistical method; compared with the existing four prediction methods, the MAPE, MAE and RMSE values ​​obtained by the TSC-GCN model decreased by 6.37% to 23.48%, 1.73% to 19.06% and 1.76% to 16.14%, respectively, indicating that the TSC-GCN model has the highest prediction accuracy. The above analysis shows that the TSC-GCN model has the best performance in predicting urban road network traffic flow.

[0078] Therefore, the urban road network traffic flow prediction method based on K-shape clustering algorithm and graph convolutional neural network proposed in the present invention can accurately obtain the urban road network traffic flow prediction value, and the prediction stability is good.

[0079] The above descriptions are merely selected embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network, characterized in that: Here are the steps: S1. Acquisition of traffic flow data of urban road network: determine the spatial scope of urban road network and obtain the original traffic flow data within the spatial scope; determine the time scope and time interval of traffic flow prediction task, pre-process and aggregate the original traffic flow data based on the determined time scope and time interval, and obtain the traffic flow data set of urban road network; S2. TSC-GCN model construction: Use K-shape clustering algorithm to divide the urban road network to obtain the urban sub-road network with more relevant traffic flow data, called prediction sub-area; construct the input matrix of TSC-GCN model based on the traffic flow data set in the prediction sub-area; analyze the road network topology structure in the prediction sub-area based on GCN neural network to capture the spatial regularity of traffic flow data in each prediction sub-area; then, use LSTM neural network to analyze the temporal characteristics of traffic flow data in each prediction sub-area, and then construct TSC-GCN model for urban road network traffic flow prediction; S3, TSC-GCN model training: divide the urban road network traffic flow dataset into training set and test set, construct the loss function, and use the training set to train the TSC-GCN model; S4. TSC-GCN model performance evaluation: Use the trained TSC-GCN model to predict the urban road network traffic flow in the test set and evaluate the prediction performance of the TSC-GCN model.

2. The method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network according to claim 1, characterized in that: Step S1 specifically includes: S11. Acquisition of original traffic flow data of urban road network: Select the spatial range of urban road network, and use the traffic flow detector in the selected urban road network area to obtain the original traffic flow data R=(r1, r2,…, r d ,…,r D );r d = {r d (Ss,S)|0<s≤S} is the original traffic flow data sequence of the traffic flow detector d, S is any time, s is the sampling time interval of the traffic flow detector, d∈{1,2,…,D}, and D is the number of traffic flow detectors in the selected urban road network; S12. Construction of urban road network traffic flow dataset: Process the original traffic flow data R according to the selected time range and time interval, including the recovery of missing and abnormal traffic flow data and the aggregation of traffic flow data, and then obtain the urban road network traffic flow dataset X = (x1, x2, ..., x d ,…,x D ), is the traffic flow data sequence of the traffic flow detector d; For the Traffic flow data of traffic flow detector d in time interval, The number of time intervals for traffic flow data within the selected time range.

3. The urban road network traffic flow prediction method based on K-shape clustering algorithm and graph convolutional neural network according to claim 1 is characterized in that: Step S2 specifically includes: S21. Construction of sub-area division module: Use the distance measure in the K-shape clustering algorithm to calculate the similarity of the traffic flow data sequences of any two traffic flow detectors in the urban road network traffic flow dataset X, that is: in, When the number of slides is u, x d and The mutual correlation coefficient between Traffic flow detector Traffic flow data series; For x d and The set of mutual correlation coefficients between The time displacement is Time d and The correlation coefficient between The obtained mutual correlation coefficient is normalized, that is: in, When the number of slides is u, x d and The normalized correlation coefficient between For x d and The set of normalized correlation coefficients between RL0(x d ,x d ) is the time displacement when x is 0 d and x d The correlation coefficient between When the time displacement is 0 and The correlation coefficient between x d and The normalized correlation coefficient between is in the range of [-1, 1]; then, based on the normalized correlation coefficient, x is obtained. d and The SBD value between: in, For x d and SBD value between, Max is the maximum value; Then, the number of prediction sub-areas Q is set, and the maximum normalized correlation coefficient between the traffic flow data of a certain traffic flow detector in the urban sub-road network and the traffic flow data of other traffic flow detectors is set as the goal, and the core traffic flow detector and the best prediction sub-area of ​​each urban sub-road network are obtained. The optimization function is as follows: Among them, x c is the traffic flow data of the assumed core traffic flow detector in the prediction sub-area q; q is the traffic flow dataset for the predicted sub-area q, q∈{1,2,…,Q}; argMax is the argMax function; Secondly, the number of iterations of the K-shape clustering algorithm is set to obtain the best prediction sub-area; S22. Spatial module construction: Select the time lag number for each prediction according to and X q Constructing the input matrix of the TSC-GCN model The GCN neural network is selected to build the spatial module of the TSC-GCN model for urban road network traffic flow prediction. The input of the GCN neural network includes the adjacency matrix and the urban road network traffic flow dataset. The adjacency matrix of the prediction sub-area is built according to the road network structure in the prediction sub-area, that is: in, To predict the traffic flow detector d and The adjacency coefficient between ; represents the traffic flow detector d and There is connectivity between represents the traffic flow detector d and There is no connectivity between them; is the traffic flow detector d and The actual distance between Based on the adjacency coefficient of the traffic flow detector in the predicted sub-area q, the adjacency matrix corresponding to the predicted sub-area q is obtained. The adjacency matrix and traffic flow data of the Q predicted sub-areas are input into the GCN neural network, and then the output of the GCN neural network is obtained, namely: in, For the The output matrix of the graph convolution layer for predicting sub-region q; For the The output matrix of the graph convolution layer for predicting sub-region q, is the number of graph convolutional layers in the spatial module; when When it is 0, A is the input matrix of the first layer of graph convolutional layer for predicting sub-region q; q is the adjusted adjacency matrix corresponding to the predicted sub-region q; I q is the identity matrix corresponding to the predicted sub-region q; D q is the degree matrix corresponding to the predicted sub-region q; σ is the activation function in the graph convolution layer; Traffic flow data is collected through the spatial module After the convolutional layer, we get the output of the spatial module For the The output matrix of the graph convolution layer for predicting sub-region q; S23. Time module construction: Use LSTM neural network to build the time module of TSC-GCN model for urban road network traffic flow prediction, and put the output of spatial module into LSTM neural network, that is: in, For the In the time interval The input gate in the LSTM layer predicts the output of sub-region q; For the In the time interval The input of the LSTM layer to the prediction sub-region q, For the In the time interval The output of the graph convolution layer for predicting subregion q, is the number of LSTM layers in the time module; and For calculation Parameters when For the In the time interval The output of the forget gate in the LSTM layer predicts the sub-region q; and For calculation Parameters when For the In the time interval The output gate in the LSTM layer predicts the output of sub-region q; and For calculation Parameters when and Respectively The activation function selected by the input gate, forget gate and output gate for the prediction sub-region q in the LSTM layer; and Respectively and In the time interval The LSTM layer predicts the cell state of sub-region q; and For calculation Parameters when and Respectively and In the time interval The LSTM layer memorizes the prediction sub-region q; For Hadamard; The spatial module output flows through After the LSTM layer, we get The memory information corresponding to Q prediction sub-regions in the time interval For the In the time interval The LSTM layer predicts the memory information of sub-region q, and then merges the memory information corresponding to Q prediction sub-regions into a matrix, that is: in, For the The memory information matrix obtained by the LSTM neural network in the time module within the time interval; Con is the matrix concatenation operation; S24. Output module construction: Use the fully connected layer to build the output module of the TSC-GCN model, and put the memory information obtained by the time module into the output module, that is: in, For the The predicted value of urban road network traffic flow within a time interval; is the input of the fully connected layer; W and b are the calculation Parameters when D The activation function chosen for the fully connected layers.

4. The method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network according to claim 1, characterized in that: Step S3 specifically includes: S31, using the urban road network traffic flow data of the first t time intervals as a training set, and using the urban road network traffic flow data after the t-th time interval as a test set; S32. Select mean square error as the loss function of the TSC-GCN model, that is: Among them, MSE TS is the loss function of the TSC-GCN model; For the The predicted value of urban road network traffic flow obtained by TSC-GCN model in the time interval; For the Traffic flow data of urban road network within a time interval; S33. Train the TSC-GCN model using the training set and loss function.

5. The method for predicting urban road network traffic flow based on K-shape clustering algorithm and graph convolutional neural network according to claim 1, characterized in that: Step S4 specifically includes: S41. Use the TSC-GCN model to predict the urban road network traffic flow in the test set; S42. The prediction accuracy of the TSC-GCN model is evaluated using three indicators: mean absolute percentage error, mean absolute error, and root mean square error.

Citation Information

Cited By

  • Traffic flow prediction method based on clustering and space-time fusion graph convolutional network

    CN120375614A