CN116386312A - Traffic prediction model construction method and system - Google Patents
Traffic prediction model construction method and system Download PDFInfo
- Publication number
- CN116386312A CN116386312A CN202211464446.0A CN202211464446A CN116386312A CN 116386312 A CN116386312 A CN 116386312A CN 202211464446 A CN202211464446 A CN 202211464446A CN 116386312 A CN116386312 A CN 116386312A
- Authority
- CN
- China
- Prior art keywords
- data
- time
- sequence
- dependency
- nodes
- 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.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims abstract description 38
- 239000011159 matrix material Substances 0.000 claims abstract description 54
- 238000012360 testing method Methods 0.000 claims abstract description 39
- 238000000034 method Methods 0.000 claims abstract description 30
- 238000012545 processing Methods 0.000 claims abstract description 24
- 238000000605 extraction Methods 0.000 claims abstract description 18
- 238000012795 verification Methods 0.000 claims abstract description 11
- 230000015654 memory Effects 0.000 claims description 22
- 108090000623 proteins and genes Proteins 0.000 claims description 17
- 238000004458 analytical method Methods 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 7
- 238000010219 correlation analysis Methods 0.000 claims description 7
- 230000008878 coupling Effects 0.000 claims description 7
- 238000010168 coupling process Methods 0.000 claims description 7
- 238000005859 coupling reaction Methods 0.000 claims description 7
- 238000005070 sampling Methods 0.000 claims description 7
- 230000002776 aggregation Effects 0.000 claims description 6
- 238000004220 aggregation Methods 0.000 claims description 6
- 238000009826 distribution Methods 0.000 claims description 6
- 230000007246 mechanism Effects 0.000 claims description 6
- 238000012805 post-processing Methods 0.000 claims description 4
- 230000002441 reversible effect Effects 0.000 claims description 4
- 238000000354 decomposition reaction Methods 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims description 3
- 230000036962 time dependent Effects 0.000 claims description 3
- 230000004931 aggregating effect Effects 0.000 claims description 2
- 238000007781 pre-processing Methods 0.000 claims description 2
- 238000005096 rolling process Methods 0.000 claims description 2
- 238000001228 spectrum Methods 0.000 claims description 2
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000004590 computer program Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000013528 artificial neural network Methods 0.000 description 6
- 238000012549 training Methods 0.000 description 6
- 230000000875 corresponding effect Effects 0.000 description 5
- 238000003860 storage Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000009825 accumulation Methods 0.000 description 3
- 238000013527 convolutional neural network Methods 0.000 description 3
- 230000000306 recurrent effect Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 2
- 238000009792 diffusion process Methods 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000011425 standardization method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Images
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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- 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
- 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/0137—Measuring and analyzing of parameters relative to traffic conditions for specific applications
- G08G1/0145—Measuring and analyzing of parameters relative to traffic conditions for specific applications for active traffic flow control
-
- 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
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Analytical Chemistry (AREA)
- Chemical & Material Sciences (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention is applicable to the field of intelligent transportation systems, and provides a method and a system for constructing a traffic prediction model, wherein the method comprises the steps of dividing preprocessed data into a test set, a verification set and a test set; constructing an adjacency matrix according to the positions of the road section nodes, wherein the adjacency matrix is used for representing the correlation between the road section nodes; extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes; and carrying out full-connection layer processing on the extraction results of the time dependency and the space dependency to complete the construction of the traffic prediction model. The embodiment of the invention has the beneficial effects that: the time dependence, the space dependence and the trend mode of road traffic are effectively learned, so that traffic can be efficiently predicted.
Description
Technical Field
The invention belongs to the field of intelligent transportation systems, and particularly relates to a method and a system for constructing a traffic prediction model.
Background
In recent years, traffic prediction tasks in intelligent transportation systems have been attracting attention due to their important role in traffic management. By using advanced deep learning technology, the time-space correlation can be extracted from a complex road network, so that the prediction accuracy of traffic is improved. However, the existing prediction methods face problems in space-time dependent learning, trend pattern learning and the like, so that the prediction methods cannot be further used in the aspect of prediction accuracy.
In terms of traffic space learning, the latter has gradually become the dominant approach to road network space modeling due to the translational invariance of traditional convolutional neural networks (Convolution Neural Network, CNN) and the high-speed development of graph convolution networks (Graph Convolution Network, GCN). Although GCN solves the problem of CNN translational invariance, it focuses only on the geographically contiguous segments of the target segment, ignoring the possible "neighboring" segments that have a higher correlation with the target segment, but have a geographically incoherent relationship with the target segment, resulting in inaccuracy of the prediction result.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a system for constructing a traffic prediction model, which aim to solve the technical problems in the prior art determined in the background art.
The embodiment of the invention is realized in such a way that a traffic prediction model construction method comprises the following steps:
dividing the preprocessed data into a test set, a verification set and a test set;
the data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the traffic flow of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future traffic flow data of the road section to be predicted;
constructing an adjacency matrix according to the positions of the road section nodes, wherein the adjacency matrix is used for representing the correlation between the road section nodes;
extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes;
and carrying out full-connection layer processing on the extraction results of the time dependency and the space dependency to complete the construction of the traffic prediction model.
Another object of an embodiment of the present invention is to provide a system for constructing a traffic prediction model, the system including:
the data processing module is used for dividing the preprocessed data into a test set, a verification set and a test set;
wherein the data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the traffic flow of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future traffic flow data of the road section to be predicted;
the adjacency matrix construction module is used for constructing an adjacency matrix according to the positions of the road section nodes, and the adjacency matrix is used for representing the correlation among the road section nodes;
the space-time module is used for extracting time dependency and space dependency of the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes;
and the output module is used for carrying out full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
The embodiment of the invention has the beneficial effects that: when constructing the spatial relationship of the traffic road section, synthesizing the geographic relationship and the traffic volume correlation, and constructing a brand new adjacency matrix to describe the spatial relationship of the road network; adopting a spliced aggregation mode to replace a GCN to reserve more road interaction information by accumulating aggregation modes of all order neighbors; when constructing the time relation of the traffic road section, forward analysis is carried out on the historical data, reverse analysis is carried out on the historical future data, and the model can sense the time information more comprehensively; the invention simulates the biological gene mode, embeds the time stamp as the trend gene into the model, records the flow trend change condition of each sampling time every day in a week in a similar biological gene mode, and enables the proposed framework to adapt to the flow change more quickly.
Drawings
FIG. 1 is a flowchart of a method for constructing a traffic prediction model according to an embodiment of the present invention;
FIG. 2 is a flow chart of constructing an adjacency matrix according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a road network structure according to an embodiment of the present invention;
FIG. 4 is a flowchart of extracting spatial dependency of data according to a sequence according to an embodiment of the present invention;
FIG. 5 is a flowchart of extracting time dependency of data according to a sequence according to an embodiment of the present invention;
fig. 6 is a schematic state diagram of a method for constructing a traffic prediction model according to an embodiment of the present invention;
FIG. 7 is a block diagram of a traffic prediction model construction system according to an embodiment of the present invention;
FIG. 8 is a block diagram of a traffic prediction model construction system according to another embodiment of the present invention;
FIG. 9 is a block diagram of an adjacency matrix construction unit according to an embodiment of the present invention;
FIG. 10 is a block diagram of the internal architecture of a computer device in one embodiment.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another element. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
As shown in fig. 1 and 6, in one embodiment, a method for constructing a traffic prediction model is provided, which specifically includes the following steps:
step S100, the preprocessed data is divided into a test set, a verification set and a test set.
The data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the flow of vehicles of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future flow data of the road section to be predicted.
In the embodiment of the invention, F is the number of features, and features are the average occupancy of the road section, the vehicle speed and the vehicle flow, namely f=3 and s=5. The data are divided into a training set, a verification set and a test set in a ratio of 6:1:3, wherein the training set is used for adjusting parameters of the model, the verification set is used for adjusting super parameters of the model, and the test set is used for testing performance of the model.
The embodiment of the invention adopts the data collected by the loop monitor of the los Angeles Caltrans performance measurement system in practical application. The characteristics included in the data are the average occupancy of the link, the traffic flow, and the average vehicle speed, respectively. The initial sampling frequency of the data was 2880 times per day, which was aggregated by the present invention to 288 times per day, i.e., one record was obtained every 5 minutes, for efficiency and practicality.
Preferably, in order to improve the performance of the model and speed up convergence, the embodiment of the invention adopts a Zero-mean standardization method to convert data distribution into standard normal distribution, and the formula is as follows:
wherein n represents the number of data samples, m represents the number of attributes of each data sample, and x p,i And y p,i The original value and normalized value, mu, of the p-th attribute of the i-th data sample are represented, respectively p Sum sigma p The mean and standard deviation of the property p are indicated, respectively.
Step S200, constructing an adjacency matrix according to the positions of the road segment nodes, wherein the adjacency matrix is used for representing the correlation among the road segment nodes.
The adjacency matrix in the embodiment of the invention is a square matrix, wherein the element is 0 or 1, wherein 1 represents that the corresponding two road section nodes are adjacent, and 0 represents that the corresponding two node nodes are not adjacent, and the position and time relationship are considered in construction.
And step S300, extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes.
In the embodiment of the invention, because the number of the sequences is 5, in practical application, the extraction of the time dependency and the space dependency needs to be synchronously executed for five times, wherein the object of the time dependency is a time step, the object of the time dependency is to extract the dependency between two moments, the object of the space dependency is a road section node, and the extraction of the space dependency is essentially to obtain the weight relationship between the nodes.
And step S400, performing full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
In the embodiment of the invention, after the traffic prediction model is constructed, parameters are optimized by using a back propagation algorithm according to the verification set and the test set.
In one embodiment, as shown in fig. 2 and 3, the step S200 may specifically include the following steps:
step S201, determining the adjacency relation between the road section nodes according to the adjacency construction method based on the geographic position.
In the embodiment of the present invention, a method for constructing an adjacency based on a geographic location belongs to the prior art, and the adjacency construction is performed according to the proximity or the communication between road section nodes, which is not specifically described herein.
But only this factor is generally considered in the prior art. Some potential neighbors are ignored. Potential neighbors refer to certain road segments whose traffic information is highly correlated with traffic information of the target road segment, but this high correlation cannot be expressed by geographic location. For example, in fig. 3 there is a road network having a three-dimensional shape, wherein the time dimension represents the road network status for each time step and the space dimension represents the details of the road network. The solid point is the target road segment to be predicted (i.e., road segment a). The former mode is to search for geographically adjacent roads of the link a (i.e., the link B and the link C) and fully consider their influence when learning the spatial information. The link E has a higher correlation with the link a but is far away from the link a and is not of interest. Thus, the geographic location based adjacency construction method loses many road segments highly correlated with the target road segment.
Step S202, carrying out relevance analysis on road segment nodes by adopting a Pearson relevance coefficient, and judging that the road segment nodes are in an adjacent relation when the result of the relevance analysis is larger than a set threshold value, otherwise, not being adjacent.
The embodiment of the invention excavates the potential neighbors through correlation analysis, and considers the geographic neighbors and the potential neighbors while learning traffic space characteristics. The correlation analysis adopts the pearson correlation coefficient, and the formula is as follows:
wherein X and Y represent two data sets, μ, for correlation analysis X Sum mu Y Mean value, sigma, of data sets X and Y, respectively X Sum sigma Y Standard deviation of data sets X and Y. E [. Cndot.]Representing the desire; cov (. Cndot.) represents covariance. If the correlation coefficient of the two road section nodes is larger than the threshold value, the corresponding element in the adjacency matrix is 1, namely the adjacency relation is 0, otherwise.
Step S203, coupling the adjacent construction method based on the geographic position with the result of the pearson correlation coefficient correlation analysis to obtain an adjacent matrix.
In the embodiment of the present invention, the coupling mode may be understood as accumulation, that is, the term with 1 in the adjacency matrix may be the correlation in the geographic location, or may be the potential correlation calculated according to the pearson correlation coefficient.
In one embodiment, as shown in fig. 4, the step of extracting the spatial dependency relationship of the data in the test set according to the sequence specifically includes:
step S301, defining a convolution operation on the graph by using a diagonalized linear operator in the fourier domain of the graph convolution network based on the spectrum domain, where the convolution operation formula on the graph is:
wherein g θ For convolution kernel, θ is the corresponding weight, x is the feature of data, U is the feature vector matrix of normalized graph laplace operator L, U is the transposed matrix of U, U x represents fourier transform of feature x, I N The matrix is an identity matrix, D is a degree matrix of L, A is an adjacent matrix, and Λ is a diagonal matrix for storing characteristic values of L.
In the embodiment of the invention, after the adjacent matrix construction is completed, convolution theorem and Fourier transformation are used for reference, and a diagonalized linear operator in the Fourier domain based on GCN (graph convolution network) in the spectral domain is adopted to define convolution operation on the graph.
In step S303, the truncated expansion of the Chebyshev polynomial is adopted to approximate the convolution kernel to calculate the feature decomposition of L.
In the embodiment of the invention, because the feature decomposition for calculating L has higher cost for a large-scale graph, the embodiment of the invention adopts the Chebyshev polynomial T k (x) Is a truncated expansion approximation of the convolution kernel to K-order.
Wherein, θ' k Coefficients representing the kth order chebyshev polynomial. Since the definition field of chebyshev polynomials is between-1 and 1, a scaling of Λ is required.Representing the rescaled eigenvalue vector, the scaling formula is as follows:
wherein lambda is max Representing the characteristic value of lmax. The iterative formula of chebyshev polynomials is as follows:
where k represents the number of iterations and x is the argument. Returning to the defined on-graph convolution formula, one can get:
this formula can be demonstrated by the following formula:
(U∧U T ) k =U∧ k U T (10)
step S305, aggregating each order in the graph rolling network in a splicing aggregation mode, so that characteristic information among the road section nodes is interacted.
In the embodiment of the invention, the GCN accumulates the spatial information of each order of neighborhood extracted by the convolution kernel, but the information interaction of each road section of the traffic is a diffusion process. The conventional method adopts an end-to-end accumulation mode, and omits the process of traffic information diffusion. Therefore, the invention changes each order accumulation aggregation mode in GCN into a splicing aggregation mode so as to reserve more traffic characteristic information, and the formula is as follows:
through space dependency extraction, the characteristic information of each node on the graph is interacted, and the target node can acquire the characteristic information of the neighbor node and the high-correlation node in a weighted mode.
In one embodiment, as shown in fig. 5, the step of extracting the time dependency relationship of the data in the test set according to the sequence specifically includes:
step S302, filtering the input information and the hidden state of each time step through spatial correlation learning.
In the embodiment of the invention, the input information and the hidden state (the initial state is 0) of each time step are filtered through a graph convolution kernel (namely spatial correlation learning). Spatial correlation learning is in fact filtering by using the convolution kernel of graph convolution to extract features, and the RNN recurrent neural network functions to learn the correlation of data at different times, where the data is subjected to graph convolution kernel processing (i.e., correlation learning) before the RNN recurrent neural network processing.
And step S304, processing the obtained time step characteristics by a memory mechanism and a threshold mechanism to obtain output data and a hidden state of the next time step.
In the embodiment of the invention, the time step characteristics are learned based on the RNN circulating neural network, and Long Short-Term Memory (LSTM) and gate-controlled circulating units (Gated Recurrent Unit, GRU) are also embedded in the RNN circulating neural network, namely, a Memory mechanism and a threshold mechanism are introduced into the RNN circulating neural network to share Long-Term information.
Step S306, output information of the last moment is obtained according to time dimension circulation.
Step S308, the output information obtained by extracting the time dependency relation according to the sequence is spliced to obtain the time characteristic information.
In the embodiment of the invention, the splicing operation is as follows:
H=C[h 0 ,h 1 ,h 2 ,h 3 ,h 4 ] (13)
wherein H is time characteristic information obtained by final splicing, and H 0 For the most recent data sequence feature, h 2 And h 1 Respectively historical sequence characteristics and future data sequence characteristics, h at the moment before the day 4 And h 3 The historical sequence characteristic and the future sequence characteristic before one week are respectively, and C represents the splicing operation.
Through the operation, the weight relation among different time steps can be obtained through the extraction of the time dependency relation, and the characteristic information of the historical moment is combined to predict the characteristic information of the future moment.
In one embodiment, the method further comprises the steps of:
and encoding the time stamp into a trend gene to describe the traffic change trend of each sampling moment in the set period, and performing full-connection layer processing on the trend gene and the extraction result to obtain a prediction result.
In the embodiment of the invention, the method imitates the biological gene, takes the time stamp as the trend gene, records the flow trend change condition of each sampling time every day in a week in a similar biological gene form, and enables the proposed framework to adapt to the flow change more quickly.
In practical applications, for example, 12 am is a peak hours of next business hours, such as a business district, the traffic may be increased sharply, and the timestamp "12 am" may be used as a part of the input to characterize the phenomenon.
In one embodiment, in the step of extracting the time-dependent relationship of the data in the test set in sequence,
and eliminating the output part of the data, processing the input part of the data, performing forward arrangement post-processing analysis on the historical sequence characteristics, and performing reverse arrangement post-processing analysis on the future data sequences corresponding to the historical sequence characteristics.
In embodiments of the present invention, future traffic data cannot be used as training data because it cannot be obtained during the test phase. In this case, embodiments of the present invention discard future data, and instead look for historical future data (i.e., future data sequence features at the time of day and future data sequence features at the time of week). The invention gives enough attention to the historical data sequence and the future data sequence of the previous day of prediction time and the historical data sequence and the future data sequence of the previous week of prediction time. Considering the problem of the sequence, the invention performs the reverse sequence operation on the sequence when analyzing the historical future information so as to accord with the continuity of the data sequence.
According to the embodiment of the invention, 5 data sequences are obtained, and the five sequences are respectively input into the GRU for time feature extraction, so that 5 features are obtained. The calculation formula of the GRU is as follows:
wherein W and U represent the weights of GRU, sigma and phi represent the activation functions sigmoid and tanh, r and z represent the reset threshold and the update threshold, respectively,and h t-1 The hidden layer data respectively representing the input time data and the last time;representing intermediate variables. The 5 features extracted by the GRU are the nearest data sequence features h respectively 0 Historical sequence feature h at time of day 2 And future data sequence feature h 1 Historical sequence feature h at the moment before one week 4 And future sequence feature h 3 And 5 features are spliced to obtain final time feature information H.
The parameter design of the model in the embodiment of the invention is as follows:
(1) The training environment of the model is Intel to Qianglin 4114CPU (main frequency is 2.20 GHz) and Injewata GeForce RTX 2080 (video memory is 8 GB).
(2) The number of hidden layer neurons of the model is 64, the training times are 200, the batch size is 64, and the learning rate is 1e-3.
(3) The optimization algorithm selects an adaptive moment estimate (Adaptive Moment Estimation, adam), with the L2 penalty used as the regularization term, and the coefficient size is 1e-6.
(4) The correlation threshold is set to 90%, the chebyshev polynomial cut-off order is 3, the historical data step size for prediction is 24, and the predicted data step sizes are respectively selected from [3,6,9,12 ].
As shown in fig. 6 and 7, in one embodiment, a traffic prediction model building system is provided that includes a data processing module 100, an adjacency matrix building module 200, a spatiotemporal module 300, and an output module 400. Wherein:
a data processing module 100 for dividing the preprocessed data into a test set, a validation set and a test set;
wherein the data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the traffic flow of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future traffic flow data of the road section to be predicted;
an adjacency matrix construction module 200, configured to construct an adjacency matrix according to the locations of road segment nodes, where the adjacency matrix is used to characterize the correlation between road segment nodes;
the space-time module 300 is configured to extract a time dependency relationship and a space dependency relationship from the data in the test set according to a sequence, where the time dependency relationship is used to characterize a weight relationship between time steps, and the space dependency relationship is used to characterize a weight relationship between road section nodes;
and the output module 400 is used for performing full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
In the embodiment of the invention, input data (data characteristics are average occupancy, traffic flow and average vehicle speed) comprising five sequences are respectively input into five space-time module respectively learning characteristics. The input information and hidden state (initial state 0) for each time step is filtered by a graph convolution kernel (i.e., spatial correlation learning). Then, the extracted features are processed by the update gate, the reset gate and the memory unit to obtain the output data and the hidden state of the next time step. The output at the last instant is obtained in a time-dimensional loop. The five obtained output information are fused into the final space-time characteristics through the complete connection layer.
As shown in fig. 8, in one embodiment, the system further includes a trend gene module 500, where the trend gene module 500 is configured to encode a time stamp into a trend gene to describe a traffic variation trend at each sampling time in a set period, and the trend gene and the extraction result perform a full link layer process to obtain a prediction result.
As shown in fig. 9, in one embodiment, the adjacency matrix construction module 200 includes a first adjacency determination unit 201, a second adjacency determination unit 202, and a coupling unit 203. Wherein:
a first adjacency determining unit 201 for determining adjacency between road segment nodes according to an adjacency constructing method based on geographical locations;
a second adjacency determining unit 202, configured to perform a relevance analysis on the road segment node by using a pearson correlation coefficient, and determine that the road segment node is an adjacency when a result of the relevance analysis is greater than a set threshold, and otherwise, the road segment nodes are not adjacent;
and a coupling unit 203, configured to couple the geographic location-based adjacency construction method with the result of the pearson correlation coefficient correlation analysis, so as to obtain an adjacency matrix.
In one embodiment, as shown in FIG. 6, the data is preprocessed in a manner that converts the data distribution into a standard normal distribution.
In the embodiment of the invention, in order to improve training effect and accelerate convergence during data preprocessing, zero-mean is adopted to standardize the data. In the test stage, the model outputs standardized prediction data, so that the real prediction traffic is obtained by restoring the standardized data, and a restoring formula is shown as follows:
wherein,,representing the p-th attribute, z, of model predictive ith data p,i Is the p-th attribute of the restored i-th data.
FIG. 10 illustrates an internal block diagram of a computer device in one embodiment. As shown in fig. 10, the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may also store a computer program that, when executed by a processor, causes the processor to implement a method of constructing a traffic prediction model. The internal memory may also store a computer program that, when executed by the processor, causes the processor to perform a method of constructing a traffic prediction model. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 10 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a traffic prediction model construction system provided herein may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 10. The memory of the computer device may store various program modules constituting the construction system of the traffic prediction model, such as the data processing module 100, the adjacency matrix construction module 200, the spatiotemporal module 300, and the output module 400 shown in fig. 7. The computer program constituted by the respective program modules causes the processor to execute the steps in a method of constructing a traffic volume prediction model of the respective embodiments of the present application described in the present specification.
For example, the computer apparatus shown in fig. 10 may perform step S100 by the data processing module 100 in the construction system of a traffic prediction model as shown in fig. 7. The computer device may perform step S200 through the adjacency matrix construction module 200. The computer device may perform step S300 through the spatiotemporal module 300.
In one embodiment, a computer device is presented, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step S100, the preprocessed data is divided into a test set, a verification set and a test set.
Step S200, constructing an adjacency matrix according to the positions of the road segment nodes, wherein the adjacency matrix is used for representing the correlation among the road segment nodes.
And step S300, extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes.
And step S400, performing full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which when executed by a processor causes the processor to perform the steps of:
step S100, the preprocessed data is divided into a test set, a verification set and a test set.
Step S200, constructing an adjacency matrix according to the positions of the road segment nodes, wherein the adjacency matrix is used for representing the correlation among the road segment nodes.
And step S300, extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes.
And step S400, performing full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the invention and are described in detail herein without thereby limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.
Claims (10)
1. A method of constructing a traffic prediction model, the method comprising:
dividing the preprocessed data into a test set, a verification set and a test set;
the data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the traffic flow of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future traffic flow data of the road section to be predicted;
constructing an adjacency matrix according to the positions of the road section nodes, wherein the adjacency matrix is used for representing the correlation between the road section nodes;
extracting time dependency and space dependency from the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes;
and carrying out full-connection layer processing on the extraction results of the time dependency and the space dependency to complete the construction of the traffic prediction model.
2. The method according to claim 1, wherein the step of constructing an adjacency matrix from the locations of the road segment nodes, the adjacency matrix being used for characterizing the correlation between the road segment nodes, comprises:
determining the adjacency relation between road section nodes according to an adjacency construction method based on geographic positions;
carrying out relevance analysis on road segment nodes by adopting pearson relevance coefficients, and judging that the road segment nodes are in an adjacent relation when the result of the relevance analysis is larger than a set threshold value, otherwise, not being adjacent;
and coupling a geographic position-based adjacency construction method with the result of the pearson correlation coefficient correlation analysis to obtain an adjacency matrix.
3. The method according to claim 2, wherein the step of extracting the spatial dependency relationship of the data in the test set according to the sequence specifically comprises:
the convolution operation on the graph is defined by adopting a diagonalized linear operator of a graph convolution network based on a spectrum domain in a Fourier domain, and the convolution operation formula on the graph is as follows:
wherein g θ For the convolution kernel, θ is the corresponding weight, x is the data feature, U is the feature vector matrix of the normalized graph Laplacian L, U is the transposed matrix of U, ux represents the Fourier transform of the feature x, I N The matrix is a unit matrix, D is a degree matrix of L, A is an adjacent matrix, and Λ is a diagonal matrix, and is used for storing characteristic values of L;
adopting a chebyshev polynomial to cut-off expansion approximation convolution kernel to calculate the characteristic decomposition of L;
and aggregating all orders in the graph rolling network in a splicing aggregation mode so as to enable the characteristic information among all road section nodes to be interacted.
4. The method according to claim 1, wherein the step of extracting the data in the test set in a time-dependent relationship in sequence specifically comprises:
filtering the input information and the hidden state of each time step through spatial correlation learning;
processing the obtained time step characteristics by a memory mechanism and a threshold mechanism to obtain output data and a hidden state of the next time step;
circularly obtaining the output information of the last moment according to the time dimension;
and splicing the output information obtained by extracting the time dependency relation according to the sequence to obtain the time characteristic information.
5. The method according to claim 1 or 2 or 3 or 4, further comprising the steps of:
and encoding the time stamp into a trend gene to describe the traffic change trend of each sampling moment in the set period, and performing full-connection layer processing on the trend gene and the extraction result to obtain a prediction result.
6. The method of claim 4, wherein in the step of extracting the data in the test set in a time-dependent relationship in a sequence,
and eliminating the output part of the data, processing the input part of the data, performing forward arrangement post-processing analysis on the historical sequence characteristics, and performing reverse arrangement post-processing analysis on the future data sequences corresponding to the historical sequence characteristics.
7. A system for constructing a traffic prediction model, the system comprising:
the data processing module is used for dividing the preprocessed data into a test set, a verification set and a test set;
wherein the data are expressed as NxTxFxS, wherein N is the number of nodes of a road section, T is the time step of the data, F is the number of features, the features are the average occupancy, the speed and the traffic flow of the road section, S is a sequence, the sequence comprises the latest data sequence feature, the history sequence feature and the future data sequence feature before the day, the history sequence feature and the future data sequence feature before the week, each data comprises an input part and an output part, wherein the input part inputs traffic data representing history, and the output data is the future traffic flow data of the road section to be predicted;
the adjacency matrix construction module is used for constructing an adjacency matrix according to the positions of the road section nodes, and the adjacency matrix is used for representing the correlation among the road section nodes;
the space-time module is used for extracting time dependency and space dependency of the data in the test set according to the sequence, wherein the time dependency is used for representing the weight relationship between time steps, and the space dependency is used for representing the weight relationship between road section nodes;
and the output module is used for carrying out full-connection layer processing on the extraction results of the time dependency relationship and the space dependency relationship to complete the construction of the traffic prediction model.
8. The traffic prediction model construction system according to claim 7, further comprising:
and the trend gene module is used for encoding the time stamp into a trend gene so as to describe the traffic change trend of each sampling moment in the set period, and the trend gene and the extraction result are subjected to full-connection layer processing to obtain a prediction result.
9. The traffic prediction model construction system according to claim 7, wherein the adjacency matrix construction module includes:
a first adjacency determining unit for determining adjacency between road segment nodes according to an adjacency constructing method based on geographical positions;
the second adjacency relation determining unit is used for carrying out relevance analysis on the road segment nodes by adopting the Pearson relevance coefficient, and judging that the road segment nodes are in adjacency relation when the result of the relevance analysis is larger than a set threshold value, otherwise, the road segment nodes are not adjacent;
and the coupling unit is used for coupling the adjacent construction method based on the geographic position with the result of the pearson correlation coefficient correlation analysis to obtain an adjacent matrix.
10. The traffic prediction model construction system according to claim 7, wherein the preprocessing of the data is to convert a data distribution into a standard normal distribution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211464446.0A CN116386312A (en) | 2022-11-22 | 2022-11-22 | Traffic prediction model construction method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211464446.0A CN116386312A (en) | 2022-11-22 | 2022-11-22 | Traffic prediction model construction method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116386312A true CN116386312A (en) | 2023-07-04 |
Family
ID=86964284
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211464446.0A Pending CN116386312A (en) | 2022-11-22 | 2022-11-22 | Traffic prediction model construction method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116386312A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117218868A (en) * | 2023-11-07 | 2023-12-12 | 福建理工大学 | Traffic flow prediction method based on geometric scattering map network |
-
2022
- 2022-11-22 CN CN202211464446.0A patent/CN116386312A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117218868A (en) * | 2023-11-07 | 2023-12-12 | 福建理工大学 | Traffic flow prediction method based on geometric scattering map network |
CN117218868B (en) * | 2023-11-07 | 2024-03-22 | 福建理工大学 | Traffic flow prediction method based on geometric scattering map network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tekouabou et al. | Improving parking availability prediction in smart cities with IoT and ensemble-based model | |
Wang et al. | A compound framework for wind speed forecasting based on comprehensive feature selection, quantile regression incorporated into convolutional simplified long short-term memory network and residual error correction | |
CN114944053B (en) | Traffic flow prediction method based on space-time hypergraph neural network | |
CN110675623A (en) | Short-term traffic flow prediction method, system and device based on hybrid deep learning | |
Ye et al. | Spatial-temporal traffic data imputation via graph attention convolutional network | |
CN115578852B (en) | DSTGCN-based traffic prediction method | |
JP6980521B2 (en) | Data metascaling device and method for continuous learning | |
CN110570035B (en) | People flow prediction system for simultaneously modeling space-time dependency and daily flow dependency | |
CN111047078B (en) | Traffic characteristic prediction method, system and storage medium | |
CN115965160B (en) | Data center energy consumption prediction method and device, storage medium and electronic equipment | |
CN116363878B (en) | Traffic flow prediction system and method based on continuous dynamic ordinary differential equation | |
CN113971496A (en) | Urban traffic network state evolution trend prediction method and system under influence of activities | |
CN116386312A (en) | Traffic prediction model construction method and system | |
CN116434569A (en) | Traffic flow prediction method and system based on STNR model | |
CN117612370A (en) | Traffic flow prediction method based on temporal-spatial information fusion and storage medium | |
CN117195976A (en) | Traffic flow prediction method and system based on layered attention | |
Xu et al. | Dynamic spatiotemporal graph wavelet network for traffic flow prediction | |
Li et al. | Graph convolution recurrent denoising diffusion model for multivariate probabilistic temporal forecasting | |
Son et al. | Partial convolutional LSTM for spatiotemporal prediction of incomplete data | |
CN117975710A (en) | Traffic flow prediction method, device, equipment and storage medium | |
Prabowo et al. | Traffic forecasting on new roads unseen in the training data using spatial contrastive pre-training | |
CN115953902B (en) | Traffic flow prediction method based on multi-view space-time diagram convolutional network | |
CN114372526B (en) | Data recovery method, system, computer equipment and storage medium | |
CN115545168A (en) | Dynamic QoS prediction method and system based on attention mechanism and recurrent neural network | |
Huang et al. | Short-term traffic flow prediction based on graph convolutional network embedded lstm |
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 |