CN115063972B - Traffic speed prediction method and system based on graph convolution and gating circulation unit - Google Patents
Traffic speed prediction method and system based on graph convolution and gating circulation unit Download PDFInfo
- Publication number
- CN115063972B CN115063972B CN202210563146.1A CN202210563146A CN115063972B CN 115063972 B CN115063972 B CN 115063972B CN 202210563146 A CN202210563146 A CN 202210563146A CN 115063972 B CN115063972 B CN 115063972B
- Authority
- CN
- China
- Prior art keywords
- data
- traffic
- traffic speed
- graph
- gating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 239000011159 matrix material Substances 0.000 claims abstract description 58
- 238000005096 rolling process Methods 0.000 claims abstract description 36
- 230000003068 static effect Effects 0.000 claims abstract description 24
- 238000004458 analytical method Methods 0.000 claims abstract description 23
- 230000004927 fusion Effects 0.000 claims abstract description 18
- 239000002131 composite material Substances 0.000 claims abstract description 16
- 238000012545 processing Methods 0.000 claims abstract description 15
- 238000013461 design Methods 0.000 claims abstract description 13
- 238000012549 training Methods 0.000 claims description 17
- 230000002159 abnormal effect Effects 0.000 claims description 10
- 238000010606 normalization Methods 0.000 claims description 7
- 238000012360 testing method Methods 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000012732 spatial analysis Methods 0.000 claims description 4
- 238000012795 verification Methods 0.000 claims description 4
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 claims description 3
- 101001095088 Homo sapiens Melanoma antigen preferentially expressed in tumors Proteins 0.000 claims description 3
- 102100037020 Melanoma antigen preferentially expressed in tumors Human genes 0.000 claims description 3
- 238000004422 calculation algorithm Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 238000012886 linear function Methods 0.000 claims description 3
- 238000012731 temporal analysis Methods 0.000 claims description 3
- 239000000284 extract Substances 0.000 abstract description 7
- 230000002123 temporal effect Effects 0.000 abstract description 3
- 238000013528 artificial neural network Methods 0.000 description 5
- 238000013527 convolutional neural network Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 125000004122 cyclic group Chemical group 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- YHXISWVBGDMDLQ-UHFFFAOYSA-N moclobemide Chemical compound C1=CC(Cl)=CC=C1C(=O)NCCN1CCOCC1 YHXISWVBGDMDLQ-UHFFFAOYSA-N 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000001373 regressive effect Effects 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
- G08G1/0129—Traffic data processing for creating historical data or processing based on historical data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/15—Correlation function computation including computation of convolution operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/052—Detecting movement of traffic to be counted or controlled with provision for determining speed or overspeed
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Traffic Control Systems (AREA)
Abstract
The traffic speed prediction method based on the graph rolling and gating circulating unit comprises the following steps: (1) data acquisition; (2) data processing; (3) traffic speed prediction; (4) error analysis; and (5) displaying the result. Meanwhile, the traffic speed prediction method based on the graph rolling and gating circulation unit comprises a system for implementing the traffic speed prediction method based on the graph rolling and gating circulation unit. The invention adopts a graph rolling and gate control circulating unit, integrates traffic flow data, and designs and realizes a traffic speed prediction model and a traffic speed prediction system. The model captures spatial features using graph convolution and extracts temporal features using multiple gated loop units. Meanwhile, the attention mechanism is adopted, the data fusion of the traffic speed and the traffic flow is realized at the time level, the composite adjacency matrix applied to the graph convolution operation is designed, the static and dynamic spatial correlation is comprehensively analyzed, and the data fusion of the traffic flow and the traffic speed is realized at the space level.
Description
Technical Field
The invention relates to a traffic speed prediction method and a traffic speed prediction system for intelligent traffic, which can predict the traffic speed in a future period of time. The traffic speed prediction method can be used for signal control, path planning and traffic guidance, and is suitable for urban traffic road networks and high-speed traffic road networks.
Background
Traffic speed is one of the most important characteristic parameters in the intelligent traffic field, and can intuitively reflect the traffic state of roads and the traffic situation of urban road networks. Traffic control can be optimized through traffic speed prediction, road traffic efficiency is improved, and the traffic speed prediction is an important component of an intelligent traffic system. The traffic manager can optimize future traffic according to the result of traffic speed prediction, so that the traffic capacity of the whole road network is improved.
Three main types of methods are used to solve the traffic speed prediction problem. One of the earlier approaches is based on statistical predictive models such as historical averaging (Historical Average, HA), vector Auto-Regressive (VAR), and autoregressive differential moving average (Auto-REGRESSIVE INTEGRATED Moving Average Model, ARIMA), etc. The method uses statistical method to analyze traffic data, such as average, regression, fitting, etc. The method predicts by statistical results, cannot be suitable for complex traffic scenes, and has low prediction accuracy. The second type of method is a machine learning-based method, including K-nearest neighbor (KNN), support vector machine (Support Vector Machine, SVM), support vector regression (Support Vector Regressive, SVR), and the like. The method can well predict the future short-time traffic speed, but the final prediction performance is affected because the space road network cannot be modeled. The third class is neural network-based methods, mainly recurrent neural networks (Recurrent Neural Network, RNN), long Short-Term Memory (LSTM), convolutional neural networks (Convolutional Neural Network, CNN), and graph rolling networks (Graphic Convolutional Network, GCN), etc. The method is a prediction method which is generated by the development of big data and artificial intelligence technology, has certain advancement, and has a plurality of problems when being applied specifically. The iterative neural network methods such as RNN and LSTM are time-consuming in calculation, cannot extract spatial features, and have limited prediction accuracy. The CNN method adopts a convolution mode to extract the space characteristics, but is only suitable for two-dimensional grid data, and is not suitable for complex traffic road networks. The GCN method can capture the spatial characteristics of the traffic network, improves the traffic speed prediction capability, but only can extract static spatial characteristics. Moreover, all neural network methods only use historical traffic speed data to predict future traffic speeds, while the original traffic speed data has acquisition errors, which also affects the accuracy of traffic speed prediction.
At present, the existing traffic speed prediction method has the following main problems: 1) Most methods only consider the time relevance of the data of each road section, but do not consider the spatial relevance existing among the road sections, and do not conform to the actual traffic road network; 2) The partial method only considers the static characteristics of the spatial relationship and does not consider the dynamic characteristics of the spatial relationship; 3) Most of the methods only use historical traffic speed data, and do not consider acquisition errors of the traffic speed data, so that prediction accuracy is affected.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a traffic speed prediction method and a traffic speed prediction system based on a graph rolling and gating circulating unit, which are applicable to urban road networks and expressway networks.
The invention adopts the graph rolling and gate control circulating unit, integrates traffic flow data, and designs and realizes the traffic speed prediction model. The model captures spatial features using graph convolution and extracts temporal features using multiple gated loop units. Meanwhile, the attention mechanism is adopted, the data fusion of the traffic speed and the traffic flow is realized at the time level, the composite adjacency matrix applied to the graph convolution operation is designed, the static and dynamic spatial correlation is comprehensively analyzed, and the data fusion of the traffic flow and the traffic speed is realized at the space level. The invention comprehensively adopts the convolution structure and the cyclic iteration structure, realizes the balance between the time consumption of model training and the prediction precision, fuses traffic flow data on the time and space level, improves the prediction precision, and can be suitable for urban road networks and expressway networks.
The invention achieves the aim through the following technical scheme: namely, the traffic speed prediction method based on the graph rolling and gating circulation unit comprises the following specific implementation steps:
(1) And (5) data acquisition. And collecting original historical traffic data, generating average data of 5-minute time intervals, and forming historical traffic flow and traffic speed data.
(2) And (5) data processing. The data processing mainly comprises abnormal data identification, missing value filling and data normalization. The original data obtained by direct acquisition generally contains missing values, abnormal data, noise data and the like, and in order to improve prediction accuracy, the missing values need to be filled up, and the abnormal data and the noise data need to be processed. And carrying out normalization processing on the data by adopting a Z-Score method, so that the mean value of the original data is 0 and the variance is 1.
(3) And (5) traffic speed prediction. Including the design of traffic speed prediction models, the generation of data sets, the training of prediction models, and the prediction of future traffic speeds. The traffic speed prediction model adopts an encoder-decoder framework and consists of a plurality of gating circulating units and a graph rolling network, wherein the gating circulating units perform temporal analysis on input historical traffic speed data, and the graph rolling network performs spatial analysis. The correlation between traffic flow and traffic speed and the accuracy of traffic flow data are considered, a attention mechanism is adopted in the model, the data fusion of traffic flow and traffic speed is realized at a time level, a composite adjacency matrix applied to graph convolution operation is designed, the static and dynamic spatial correlation is comprehensively analyzed, and the data fusion of traffic flow and traffic speed is realized at a space level. After the design of the prediction model is completed, the traffic data obtained in the step (2) is split, a training data set, a verification data set and a test data set are generated, and the traffic speed prediction model is trained. And after the training of the prediction model is completed, predicting the traffic speed in a future time period according to the traffic data acquired in real time.
The model includes a plurality of gated loop units, each gated loop unit calculated as:
ht=GRU(xt,ht-1) (1)
The input content of the gating cycle unit is (x t,ht-1),xt represents traffic speed data of all road sections at the current moment, h t-1 represents a hidden state output by the gating cycle unit at the previous moment, and h t is a new state of the gating cycle unit.
The encoder layer of the model adopts an attention mechanism for calculating the influence degree of traffic flow data at different historical moments, and the internal state of the attention mechanism is changed into:
Wherein the input of the attention mechanism And outputting the weight W t i for each historical moment as the traffic flow data of the ith road section at the t moment, wherein the weight is an influence factor of the traffic flow data at each historical moment.
The model combines the influence factors generated by the traffic flow with the hidden state obtained by the gating circulation unit to obtain a context vector as the output of the encoder layer, and the context vector is specifically as follows:
The model adopts a graph rolling network to extract the spatial relation of traffic data, and realizes the graph rolling process through a chebyshev polynomial, and the expression form of the chebyshev polynomial of the graph rolling is as follows:
Where the input x of the graph convolution is the output h e,t,θk of the encoder, the chebyshev polynomial coefficients, T k is the chebyshev polynomial, its recurrence is defined as T k(x)=2xTk-1(x)-Tk-2 (x), and T 0=1,T1 =x. Represents a eigenvector matrix scaled to a range of [ -1,1], lambda max being the maximum eigenvalue of the laplace matrix L. L represents a normalized version of the Laplace matrix of the graph, D is the degree matrix of the graph, and A is the adjacency matrix of the graph.
The model designs a composite adjacency matrix, which is applied to the graph rolling operation of the model. Compared with the traditional adjacency matrix, the composite adjacency matrix fuses a static adjacency matrix and a dynamic adjacency matrix, thereby realizing the comprehensive analysis of the spatial relationship between road sections and realizing the data fusion of traffic flow and traffic speed on a spatial level. The method comprises the following steps:
Wherein, Based on the static adjacency matrix of the exponential distance, the exponential distance is adopted to analyze the static space correlation between road sections. ε is used to control the sparsity of the matrix, |x i-xj||2 is used to calculate the distance between road segments i and j, σ 2 represents the spatial decay length. /(I)Based on the dynamic adjacency matrix of traffic flow, the covariance matrix is adopted to calculate the correlation of traffic flow between each road section, thereby realizing the dynamic analysis of the spatial correlation of road sections,/>And/>Is the average traffic flow of road segments i and j over the past l time periods, i.e./> The composite adjacency matrix is combined with the static adjacency matrix and the dynamic adjacency matrix, and the static and dynamic spatial relations between road sections can be comprehensively analyzed.
The internal state change of the model decoder layer is:
hd,t=GRU(dt,hd,t-1) (8)
Wherein, for the input content of each gating cycle unit (d t,ht-1),dt represents the current moment element state input, i.e. hidden state information obtained by graph convolution, h t-1 represents the hidden state of the gating cycle unit output in the decoder at the last moment.
The internal state change of the model predictive output layer is:
Wherein W, b are the weight and bias terms of the linear function, respectively. When the future traffic speed is predicted, Is the first predicted value and then/>Input data is spliced into the system, and the traffic speed of the next time period can be predicted by repeating the same processBy repeating the process continuously, the traffic speed of T time periods in the future can be predicted.
The model is trained with Adam optimizer, and the parameters are updated using gradient descent algorithm. The loss function of the model adopts a mean square error, and is specifically as follows:
Wherein, Is a predicted value and Y i is a true value.
(4) And (5) error analysis. According to the future traffic speed predicted value obtained in the step (3), analysis is carried out according to three different error evaluation indexes (MAE/MAPE/RMSE), and the calculation method is as follows:
wherein N is the number of samples, As predicted values, Y i is real data.
(5) And (5) displaying results. And (3) visually displaying the future traffic speed predicted value obtained in the step (3) and the error analysis result in the step (4) through a line graph, a bar graph and the like, so that a user can intuitively analyze the traffic speed predicted result.
Preferably, in formula (5) of step (2), the parameter is set to σ 2 =100, ε=0.5.
Preferably, in step (2), the training data set, the validation data set and the test data set are generated by splitting in a ratio of 6:2:2.
The system for implementing the traffic speed prediction method based on the graph rolling and gating circulating unit comprises a data acquisition module, a data processing module, a traffic speed prediction module, an error analysis module and a result display module which are connected in sequence.
The invention adopts a graph rolling and gate control circulating unit, integrates traffic flow data, and designs and realizes a traffic speed prediction model and a traffic speed prediction system. The traffic speed prediction model captures spatial features by adopting graph convolution, and extracts time features by adopting a plurality of gating circulating units. Meanwhile, the attention mechanism is adopted, the data fusion of the traffic speed and the traffic flow is realized at the time level, the composite adjacency matrix applied to the graph convolution operation is designed, the static and dynamic spatial correlation is comprehensively analyzed, and the data fusion of the traffic flow and the traffic speed is realized at the space level. The invention comprehensively adopts the convolution structure and the cyclic iteration structure, realizes the balance between the time consumption of model training and the prediction precision, fuses traffic flow data on the time and space level, improves the prediction precision, and can be suitable for urban road networks and expressway networks.
The invention has the beneficial effects that: (1) The invention adopts the graph rolling and the gate control circulation unit to respectively realize the space-time analysis of traffic data. The encoder finishes encoding the time dimension information, the graph convolution structure processes traffic data obtained by encoding to extract spatial features of the traffic data, and finally, the decoding layer further extracts the time features on the nodes; (2) The invention considers data fusion, adopts the attention mechanism to realize the fusion of traffic speed and traffic flow, and improves the prediction precision of traffic speed; (3) The invention designs the composite adjacency matrix, comprehensively considers the static and dynamic spatial relationship, and improves the prediction precision.
Drawings
Fig. 1 is a block diagram of a traffic speed prediction model according to the present invention.
Fig. 2 is a functional block diagram of the system of the present invention.
Detailed Description
The technical scheme of the invention is further described below with reference to the accompanying drawings.
The traffic speed prediction method based on the graph rolling and gating circulating unit comprises the following specific implementation steps:
(1) And (5) data acquisition. And collecting original historical traffic data, generating average data of 5-minute time intervals, and forming historical traffic flow and traffic speed data.
(2) And (5) data processing. The data processing mainly comprises abnormal data identification, missing value filling and data normalization. The original data obtained by direct acquisition generally contains missing values, abnormal data, noise data and the like, and in order to improve prediction accuracy, the missing values need to be filled up, and the abnormal data and the noise data need to be processed. And carrying out normalization processing on the data by adopting a Z-Score method, so that the mean value of the original data is 0 and the variance is 1.
(3) And (5) traffic speed prediction. Including the design of traffic speed prediction models, the generation of data sets, the training of prediction models, and the prediction of future traffic speeds. The traffic speed prediction model adopts an encoder-decoder framework and consists of a plurality of gating circulating units and a graph rolling network, wherein the gating circulating units perform temporal analysis on input historical traffic speed data, and the graph rolling network performs spatial analysis. The correlation between traffic flow and traffic speed and the accuracy of traffic flow data are considered, a attention mechanism is adopted in the model, the data fusion of traffic flow and traffic speed is realized at a time level, a composite adjacency matrix applied to graph convolution operation is designed, the static and dynamic spatial correlation is comprehensively analyzed, and the data fusion of traffic flow and traffic speed is realized at a space level. After the design of the prediction model is completed, splitting the traffic data obtained in the step (2) according to the proportion of 6:2:2, generating a training data set, a verification data set and a test data set, and training the traffic speed prediction model. And after the training of the prediction model is completed, predicting the traffic speed in a future time period according to the traffic data acquired in real time.
The model includes a plurality of gated loop units, each gated loop unit calculated as:
ht=GRU(xt,ht-1) (1)
The input content of the gating cycle unit is (x t,ht-1),xt represents traffic speed data of all road sections at the current moment, h t-1 represents a hidden state output by the gating cycle unit at the previous moment, and h t is a new state of the gating cycle unit.
The encoder layer of the model adopts an attention mechanism for calculating the influence degree of traffic flow data at different historical moments, and the internal state of the attention mechanism is changed into:
Wherein the input of the attention mechanism And outputting the weight W t i for each historical moment as the traffic flow data of the ith road section at the t moment, wherein the weight is an influence factor of the traffic flow data at each historical moment.
The model combines the influence factors generated by the traffic flow with the hidden state obtained by the gating circulation unit to obtain a context vector as the output of the encoder layer, and the context vector is specifically as follows:
The model adopts a graph rolling network to extract the spatial relation of traffic data, and realizes the graph rolling process through a chebyshev polynomial, and the expression form of the chebyshev polynomial of the graph rolling is as follows:
Where the input x of the graph convolution is the output h e,t,θk of the encoder, the chebyshev polynomial coefficients, T k is the chebyshev polynomial, its recurrence is defined as T k(x)=2xTk-1(x)-Tk-2 (x), and T 0=1,T1 =x. Represents a eigenvector matrix scaled to a range of [ -1,1], lambda max being the maximum eigenvalue of the laplace matrix L. L represents a normalized version of the Laplace matrix of the graph, D is the degree matrix of the graph, and A is the adjacency matrix of the graph.
The model designs a composite adjacency matrix, which is applied to the graph rolling operation of the model. Compared with the traditional adjacency matrix, the composite adjacency matrix fuses a static adjacency matrix and a dynamic adjacency matrix, thereby realizing the comprehensive analysis of the spatial relationship between road sections and realizing the data fusion of traffic flow and traffic speed on a spatial level. The method comprises the following steps:
Wherein, Based on the static adjacency matrix of the exponential distance, the exponential distance is adopted to analyze the static space correlation between road sections. Epsilon is used to control the sparsity of the matrix, |x i-xj||2 is used to calculate the distance between road segments i and j, σ 2 represents the spatial decay length, and typically the parameters are set to σ 2 =100, epsilon=0.5. /(I)Based on the dynamic adjacency matrix of traffic flow, the covariance matrix is adopted to calculate the correlation of traffic flow between each road section, thereby realizing the dynamic analysis of the spatial correlation of road sections,/>And/>Is the average traffic flow of road segments i and j over the past l time periods, i.e The composite adjacency matrix is combined with the static adjacency matrix and the dynamic adjacency matrix, and the static and dynamic spatial relations between road sections can be comprehensively analyzed.
The internal state change of the model decoder layer is:
hd,t=GRU(dt,hd,t-1) (8)
Wherein, for the input content of each gating cycle unit (d t,ht-1),dt represents the current moment element state input, i.e. hidden state information obtained by graph convolution, h t-1 represents the hidden state of the gating cycle unit output in the decoder at the last moment.
The internal state change of the model predictive output layer is:
Wherein W, b are the weight and bias terms of the linear function, respectively. When the future traffic speed is predicted, Is the first predicted value and then/>Input data is spliced into the system, and the traffic speed of the next time period can be predicted by repeating the same processBy repeating the process continuously, the traffic speed of T time periods in the future can be predicted.
The model is trained with Adam optimizer, and the parameters are updated using gradient descent algorithm. The loss function of the model adopts a mean square error, and is specifically as follows:
Wherein, Is a predicted value and Y i is a true value.
(4) And (5) error analysis. According to the future traffic speed predicted value obtained in the step (3), analysis is carried out according to three different error evaluation indexes (MAE/MAPE/RMSE), and the calculation method is as follows:
wherein N is the number of samples, As predicted values, Y i is real data.
(5) And (5) displaying results. And (3) visually displaying the future traffic speed predicted value obtained in the step (3) and the error analysis result in the step (4) through a line graph, a bar graph and the like, so that a user can intuitively analyze the traffic speed predicted result.
Referring to fig. 1, the traffic speed prediction model structure of the present invention is shown. The model has four parts in total, including an encoder layer, a spatial analysis layer, a decoder layer and a prediction output layer. The encoder layer comprises two parts, one part is composed of a plurality of gate control circulating units (GRUs) and is used for processing input historical traffic speed data, extracting time correlation of the historical traffic speed data, and the other part is composed of an attention mechanism and is used for data fusion of traffic flow and traffic speed. The space analysis layer is arranged between the encoder and the decoder, and mainly adopts a graph rolling operation to extract the space characteristics of the traffic data, wherein the graph rolling operation fuses the dynamic traffic flow data. The decoder layer includes a plurality of gating loop units to further extract temporal features of the traffic data. And the prediction output layer adopts a full connection mode to realize the output of a final predicted value.
As shown in figure 2, the system function module diagram of the invention comprises a data acquisition module, a data processing module, a traffic speed prediction module, an error analysis module and a result display module which are connected in sequence. The data acquisition module is used for acquiring and arranging original data; the data processing module is used for realizing data preprocessing, including abnormal data identification, missing value filling and data normalization; the traffic speed prediction is based on input data, training and learning are carried out according to a designed traffic speed prediction model, and future traffic speed is predicted; the error analysis is to realize the error comparison and analysis of the predicted data; the result display is to display the predicted result in a visual mode.
The embodiments described in the present specification are merely examples of implementation forms of the inventive concept, and the scope of protection of the present invention should not be construed as being limited to the specific forms set forth in the embodiments, and the scope of protection of the present invention and equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims (4)
1. The traffic speed prediction method based on the graph rolling and gating circulating unit comprises the following steps:
(1) Collecting data; collecting original historical traffic data, generating average data of 5-minute time intervals, and forming historical traffic flow and traffic speed data;
(2) Data processing; the data processing mainly comprises abnormal data identification, missing value filling and data normalization; for the original data obtained by direct acquisition, which usually contains missing values, abnormal data, noise data and the like, in order to improve the prediction precision, the missing values need to be filled, and the abnormal data and the noise data are processed; carrying out normalization processing on the data by adopting a Z-Score method to ensure that the mean value of the original data is 0 and the variance is 1;
(3) Predicting traffic speed; the method comprises the steps of designing a traffic speed prediction model, generating a data set, training the prediction model and predicting the future traffic speed; the traffic speed prediction model adopts an encoder-decoder framework and consists of a plurality of gating circulating units and a graph rolling network, wherein the gating circulating units perform temporal analysis on input historical traffic speed data, and the graph rolling network performs spatial analysis; considering the correlation between traffic flow and traffic speed and the accuracy of traffic flow data, the model adopts a attention mechanism, realizes the data fusion of traffic flow and traffic speed at a time level, designs a composite adjacency matrix applied to graph convolution operation, comprehensively analyzes the static and dynamic spatial correlation, and realizes the data fusion of traffic flow and traffic speed at a space level; after the design of the prediction model is completed, splitting traffic data obtained based on the step (2), generating a training data set, a verification data set and a test data set, and training a traffic speed prediction model; after the training of the prediction model is completed, predicting the traffic speed of a future time period according to the traffic data collected in real time;
the model includes a plurality of gated loop units, each gated loop unit calculated as:
ht=GRU(xt,ht-1) (1)
The input content of the gating cycle unit is (x t,ht-1),xt represents traffic speed data of all road sections at the current moment, h t-1 represents a hidden state output by the gating cycle unit at the previous moment, and h t is a new state of the gating cycle unit;
the encoder layer of the model adopts an attention mechanism for calculating the influence degree of traffic flow data at different historical moments, and the internal state of the attention mechanism is changed into:
Wherein the input of the attention mechanism Output/>, as traffic flow data of the ith road section at time tThe weight of each historical moment is an influence factor of traffic flow data of each historical moment;
The model combines the influence factors generated by the traffic flow with the hidden state obtained by the gating circulation unit to obtain a context vector as the output of the encoder layer, and the context vector is specifically as follows:
The model adopts a graph rolling network to extract the spatial relation of traffic data, and realizes the graph rolling process through a chebyshev polynomial, and the expression form of the chebyshev polynomial of the graph rolling is as follows:
Wherein the input x of the graph convolution is the output h e,t,θk of the encoder is the chebyshev polynomial coefficient, T k is the chebyshev polynomial whose recursion is defined as T k(x)=2xTk-1(x)-Tk-2 (x), and T 0=1,T1 =x; Representing a eigenvector matrix scaled to a range of [ -1,1], lambda max being the maximum eigenvalue of the laplace matrix L; l represents a normalized form of a Laplace matrix of the graph, D is a degree matrix of the graph, and A is an adjacency matrix of the graph;
The model designs a composite adjacency matrix, and is applied to graph rolling operation of the model; compared with the traditional adjacency matrix, the composite adjacency matrix fuses a static adjacency matrix and a dynamic adjacency matrix, so that the comprehensive analysis of the spatial relationship between road sections is realized, and the data fusion of traffic flow and traffic speed is realized on a spatial level; the method comprises the following steps:
Wherein, Based on the static adjacency matrix of the index distance, adopting the index distance to analyze the static space correlation between road sections; epsilon is used to control the sparsity of the matrix, |x i-xj||2 is used to calculate the distance between road segments i and j, σ 2 represents the spatial decay length; /(I)Based on the dynamic adjacency matrix of traffic flow, the covariance matrix is adopted to calculate the correlation of traffic flow between each road section, thereby realizing the dynamic analysis of the spatial correlation of road sections,/>And/>Is the average traffic flow of road segments i and j over the past l time periods, i.e./> The composite adjacency matrix is combined with the static adjacency matrix and the dynamic adjacency matrix, so that the static and dynamic spatial relations between road sections can be comprehensively analyzed;
the internal state change of the model decoder layer is:
hd,t=GRU(dt,hd,t-1) (8)
Wherein, for the input content of each gating cycle unit (d t,ht-1),dt represents the current moment element state input, i.e. hidden state information obtained by graph convolution, h t-1 represents the hidden state output by the gating cycle unit in the decoder at the last moment;
the internal state change of the model predictive output layer is:
wherein W, b are the weight and bias term of the linear function respectively; when the future traffic speed is predicted, Is the first predicted value and then/>Input data can be spliced, and the traffic speed/>, of the next time period can be predicted by repeating the same processThe traffic speed of T time periods in the future can be predicted by continuously repeating the steps;
Training the model by adopting an Adam optimizer, and updating parameters by using a gradient descent algorithm; the loss function of the model adopts a mean square error, and is specifically as follows:
Wherein, Is a predicted value, Y i is a true value;
(4) Error analysis; according to the future traffic speed predicted value obtained in the step (3), analysis is carried out according to three different error evaluation indexes (MAE/MAPE/RMSE), and the calculation method is as follows:
wherein N is the number of samples, As predicted values, Y i is real data;
(5) Displaying results; and (3) visually displaying the future traffic speed predicted value obtained in the step (3) and the error analysis result in the step (4) through a line graph, a bar graph and the like, so that a user can intuitively analyze the traffic speed predicted result.
2. The traffic speed prediction method based on graph rolling and gating loop unit as claimed in claim 1, wherein: equation (5) of step (2), the parameter is set to σ 2 =100, ε=0.5.
3. The traffic speed prediction method based on graph rolling and gating loop unit as claimed in claim 1, wherein: in the step (2), the training data set, the verification data set and the test data set are generated by splitting according to the ratio of 6:2:2.
4. A system for implementing the graph rolling and gating loop-based traffic speed prediction method of claim 1, wherein: the system comprises a data acquisition module, a data processing module, a traffic speed prediction module, an error analysis module and a result display module which are sequentially connected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210563146.1A CN115063972B (en) | 2022-05-18 | 2022-05-18 | Traffic speed prediction method and system based on graph convolution and gating circulation unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210563146.1A CN115063972B (en) | 2022-05-18 | 2022-05-18 | Traffic speed prediction method and system based on graph convolution and gating circulation unit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115063972A CN115063972A (en) | 2022-09-16 |
CN115063972B true CN115063972B (en) | 2024-06-11 |
Family
ID=83197770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210563146.1A Active CN115063972B (en) | 2022-05-18 | 2022-05-18 | Traffic speed prediction method and system based on graph convolution and gating circulation unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115063972B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115512545B (en) * | 2022-09-30 | 2023-06-27 | 浙江财经大学 | Traffic speed prediction method based on space-time dynamic graph convolution network |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111899510A (en) * | 2020-07-28 | 2020-11-06 | 南京工程学院 | Intelligent traffic system flow short-term prediction method and system based on divergent convolution and GAT |
WO2021109318A1 (en) * | 2019-12-03 | 2021-06-10 | 东南大学 | Method for estimating and predicting short-term traffic circulation state of urban road network |
CN113450568A (en) * | 2021-06-30 | 2021-09-28 | 兰州理工大学 | Convolutional network traffic flow prediction method based on space-time attention mechanism |
CN113705880A (en) * | 2021-08-25 | 2021-11-26 | 杭州远眺科技有限公司 | Traffic speed prediction method and device based on space-time attention diagram convolutional network |
CN113808396A (en) * | 2021-09-01 | 2021-12-17 | 浙江工业大学 | Traffic speed prediction method and system based on traffic flow data fusion |
-
2022
- 2022-05-18 CN CN202210563146.1A patent/CN115063972B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021109318A1 (en) * | 2019-12-03 | 2021-06-10 | 东南大学 | Method for estimating and predicting short-term traffic circulation state of urban road network |
CN111899510A (en) * | 2020-07-28 | 2020-11-06 | 南京工程学院 | Intelligent traffic system flow short-term prediction method and system based on divergent convolution and GAT |
CN113450568A (en) * | 2021-06-30 | 2021-09-28 | 兰州理工大学 | Convolutional network traffic flow prediction method based on space-time attention mechanism |
CN113705880A (en) * | 2021-08-25 | 2021-11-26 | 杭州远眺科技有限公司 | Traffic speed prediction method and device based on space-time attention diagram convolutional network |
CN113808396A (en) * | 2021-09-01 | 2021-12-17 | 浙江工业大学 | Traffic speed prediction method and system based on traffic flow data fusion |
Also Published As
Publication number | Publication date |
---|---|
CN115063972A (en) | 2022-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109492822B (en) | Air pollutant concentration time-space domain correlation prediction method | |
CN111612243B (en) | Traffic speed prediction method, system and storage medium | |
CN115240425B (en) | Traffic prediction method based on multi-scale space-time fusion graph network | |
CN113487066B (en) | Long-time-sequence freight volume prediction method based on multi-attribute enhanced graph convolution-Informer model | |
CN112949828B (en) | Graph convolution neural network traffic prediction method and system based on graph learning | |
CN108009674A (en) | Air PM2.5 concentration prediction methods based on CNN and LSTM fused neural networks | |
CN112232543B (en) | Multi-station prediction method based on graph convolution network | |
CN114664091A (en) | Early warning method and system based on holiday traffic prediction algorithm | |
CN113808396B (en) | Traffic speed prediction method and system based on traffic flow data fusion | |
CN116721537A (en) | Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model | |
CN114565187B (en) | Traffic network data prediction method based on graph space-time self-coding network | |
CN115148019A (en) | Early warning method and system based on holiday congestion prediction algorithm | |
CN113516304B (en) | Regional pollutant space-time joint prediction method and device based on space-time diagram network | |
CN110990718A (en) | Social network model building module of company image improving system | |
Zhang et al. | Forecast daily tourist volumes during the epidemic period using COVID-19 data, search engine data and weather data | |
CN112991721A (en) | Urban road network traffic speed prediction method based on graph convolution network node association degree | |
CN113505536A (en) | Optimized traffic flow prediction model based on space-time diagram convolution network | |
CN117154704B (en) | Photovoltaic power prediction method based on multiscale space-time diagram attention convolution network | |
CN116108984A (en) | Urban flow prediction method based on flow-POI causal relationship reasoning | |
CN115862324A (en) | Space-time synchronization graph convolution neural network for intelligent traffic and traffic prediction method | |
CN114596726A (en) | Parking position prediction method based on interpretable space-time attention mechanism | |
CN116259172A (en) | Urban road speed prediction method considering space-time characteristics of traffic network | |
CN115063972B (en) | Traffic speed prediction method and system based on graph convolution and gating circulation unit | |
CN112580859A (en) | Haze prediction method based on global attention mechanism | |
CN116434569A (en) | Traffic flow prediction method and system based on STNR model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |