Traffic state prediction method and system fusing multi-cycle and spatial semantic correlation
By constructing a traffic state prediction method that integrates multi-period and spatial semantic associations, and utilizing adaptive diffusion graph convolutional networks and gated temporal convolutional networks, the problem of low accuracy in traffic state prediction in existing technologies is solved, and higher accuracy traffic state prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAZHONG UNIV OF SCI & TECH
- Filing Date
- 2023-07-04
- Publication Date
- 2026-04-17
AI Technical Summary
Existing traffic condition prediction methods only consider the spatial distance between road traffic nodes and recent changes, resulting in low prediction accuracy.
A traffic state prediction method integrating multi-period and spatial semantic association is adopted. By constructing a training sample set, an adaptive diffusion graph convolutional network and a gated temporal convolutional network are used, combined with a distance adjacency matrix and an adaptive semantic adjacency matrix, to learn the spatial and temporal variation patterns between traffic nodes, and prediction is performed through an adaptive fusion layer and a fully connected layer.
It improves the accuracy and robustness of traffic condition prediction, and can more comprehensively capture the multi-period characteristics and spatial correlations of traffic conditions, thereby enhancing prediction accuracy.
Smart Images

Figure CN116863688B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic condition prediction technology, and more specifically, relates to a traffic condition prediction method and system that integrates multi-period and spatial semantic association. Background Technology
[0002] Traffic condition prediction is an important research branch of Intelligent Transportation Systems (ITS). Real-time and accurate traffic condition prediction is of great significance in scenarios such as vehicle scheduling, route planning, and arrival time estimation. Ride-hailing apps, which are most commonly used in people's daily travel, all involve traffic condition prediction technologies when estimating travel time and planning travel routes.
[0003] However, in real-world road networks, traffic conditions are influenced by a variety of factors, exhibiting highly complex patterns of change. This presents a significant challenge to traffic condition prediction. Existing traffic condition prediction methods generally only consider the correlation of spatial distances between road nodes and their recent changes, resulting in low accuracy in traffic condition prediction. Summary of the Invention
[0004] To address the shortcomings and improvement needs of existing technologies, this invention provides a traffic state prediction method and system that integrates multi-period and spatial semantic association, with the aim of improving the accuracy of traffic state prediction.
[0005] To achieve the above objectives, according to a first aspect of the present invention, a traffic state prediction method integrating multi-period and spatial semantic associations is provided, comprising:
[0006] Training phase:
[0007] S1. Obtain the original traffic status data X of each road segment in the actual road network;
[0008] S2. Use the traffic state data X to construct a training sample set and train a traffic state prediction model.
[0009] Each training sample includes: X, representing recent relevant data on traffic conditions within a historical time slice. r X represents the daily cycle of traffic conditions over several historical days within the time frame to be predicted. d X represents the weekly correlation data of traffic conditions over several historical weeks within the time frame to be predicted. w And the training objective Y represents the traffic state within the time slice to be predicted. true The historical time slices refer to the time slices to be predicted, including the previous time slice and the preceding consecutive T slices. r A time slice; the time slice to be predicted is a continuous T to be predicted.p A time slice;
[0010] Application phase: The historical data corresponding to the traffic state data to be measured is processed into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and then input into the trained traffic state prediction model to output the traffic state within the predicted time slice.
[0011] Furthermore, the traffic state prediction model includes: three parallel branches, an adaptive fusion layer, and a fully connected layer; the three parallel branches are a recent correlation change pattern learning branch, a daily cycle correlation change pattern learning branch, and a weekly cycle correlation change pattern learning branch;
[0012] Recent relevant data X r Daily cycle related data X d Weekly cycle related data X w The features are respectively input into the corresponding recent correlation change pattern learning branch, daily cycle correlation change pattern learning branch, and weekly cycle correlation change pattern learning branch. The features output from the three parallel branches are adaptively fused through the adaptive fusion layer, and then passed through the fully connected layer to obtain the predicted output Y. pred .
[0013] Furthermore, the recent relevant change pattern learning branch includes a spatiotemporal feature learning network, which includes a spatial learning module, a temporal learning module, and a spatiotemporal information fusion module.
[0014] The spatial learning module is used to learn from the distance adjacency matrix A and the adaptive adjacency matrix A. apt and recent relevant data X used as a data sample r As input, an adaptive diffusion graph convolutional network is used to output spatially related information H between traffic nodes. s The distance adjacency matrix A is used to represent the spatial distance relationship between traffic nodes, and the adaptive semantic adjacency matrix A... apt Used to represent the semantic information relationships between traffic nodes;
[0015] The time learning module is used to use the recent relevant data X r As input, output the recent temporal variation patterns H among traffic nodes. t ;
[0016] The spatiotemporal information fusion module is used to fuse the spatial related information H s With the aforementioned recent time variation pattern characteristic H t The recent spatiotemporal variation patterns H between traffic nodes were obtained. r .
[0017] Furthermore, the daily cycle-related change pattern learning branch or the weekly cycle-related change pattern learning branch includes a splitting module and T. p The spatiotemporal feature learning network and splicing module are connected in parallel;
[0018] The splitting module is used to split the daily cycle-related data X d Or related data X for the weekly cycle w Slicing along the time dimension and performing dimensional transformations yields T. p One data block;
[0019] T p The three parallel spatiotemporal feature learning networks are respectively used to output T. p The daily or weekly spatiotemporal variation patterns of traffic conditions within a given time slice to be predicted; wherein, the data sample input to each of the spatiotemporal feature learning networks is the corresponding T. p One data block;
[0020] The splicing module is used to connect T p The outputs of the parallel spatiotemporal feature learning networks are concatenated along the time dimension and then subjected to dimensionality transformation to obtain the daily spatiotemporal variation pattern H of the traffic state within the time slice to be predicted. d Or the spatiotemporal variation pattern of the cycle H w .
[0021] Furthermore, the adaptive adjacency matrix A apt for:
[0022]
[0023] in, For traffic node embedding vectors that are randomly initialized and have learnable parameters, This represents the spatial similarity between any two nodes in the data sample; N represents the number of traffic nodes, and c is a hyperparameter; Relu(·) represents the activation function, and Softmax(·) is used for normalization;
[0024] The output of the adaptive diffusion graph convolutional network is:
[0025]
[0026] in, This is the forward transition matrix. This is the backward transition matrix; rowsum(·) represents adding along the rows; A Transpose represents the transpose of the distance adjacency matrix A; k is the diffusion factor, K represents the set threshold; W k1 W k2 W k3 It is a parameter matrix.
[0027] Furthermore, the time learning module is a gated temporal convolutional network.
[0028] Furthermore, the aforementioned recent relevant data X r and the training target Y true The generation method is as follows:
[0029]
[0030] Among them, D r This is a dataset containing all recently relevant data samples, where each sample is the recently relevant data. D true Given a dataset containing all training target samples, where each sample is the training target... T r T represents the historical step size for recent relevant data. p The future step size to be predicted; newaxis represents adding a new dimension; Stack dim=1 This indicates that the sliced data is stacked along dimension 1.
[0031] Furthermore, the daily cycle-related data X d and the aforementioned periodic related data X w The generation methods include:
[0032] S221. Generate a set of daily and weekly periodic correlation data corresponding to any time t based on the traffic state data X.
[0033]
[0034] Where q represents the sampling frequency of traffic nodes within a day; T d T represents the historical step size for daily periodic data. w This refers to the historical step size of the weekly data.
[0035] S222, the set Each element in the data is stacked along the time dimension to obtain the daily periodic data corresponding to any time t. and weekly data
[0036] S223. Based on S221 and S222, generate all sampling times T. s The corresponding set S, consisting of daily and weekly periodic data. d S w :
[0037]
[0038] S224, Set the set S d S w Each element in the sample time T s By stacking and dimensional transformation, all sampling times T are obtained. s Daily cycle related data Data related to the cycle in,
[0039] S225. Generate the daily cycle-related data X. d and the cycle-related data X w :
[0040]
[0041] Among them, D d For the corresponding daily periodic sample dataset, D w For a periodic sample dataset, D d Each sample in the dataset is the daily periodic correlation data X. d , D w Each sample in the dataset is the periodic correlation data X. w ,
[0042] According to a second aspect of the present invention, a traffic state prediction system integrating multi-period and spatial semantic association is provided for performing the method described in any one of the first aspects above, the system comprising: a training module and an application module;
[0043] The training module includes:
[0044] The data acquisition unit is used to acquire the original traffic status data X of each road segment in the actual road network;
[0045] A multi-period data sample generation and training unit is used to construct a training sample set using the traffic state data X and train a traffic state prediction model.
[0046] Each training sample includes: X, representing recent relevant data on traffic conditions within a historical time slice. r X represents the daily cycle of traffic conditions over several historical days within the time frame to be predicted. d X represents the weekly correlation data of traffic conditions over several historical weeks within the time frame to be predicted. w And the training objective Y represents the traffic state within the time slice to be predicted. true Wherein, the historical time slice is the continuous T-slice before and after the time slice to be predicted. rA time slice; the time slice to be predicted is a continuous T to be predicted. p A time slice;
[0047] The application module is used to process the historical data corresponding to the traffic state data to be measured into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and input them into the trained traffic state prediction model to output the traffic state within the predicted time slice.
[0048] According to a third aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the first aspects.
[0049] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects:
[0050] (1) The traffic state prediction method of the present invention, which integrates multi-period and spatial semantic correlation, takes into account that the change pattern of traffic state at the time level is not singular, but exhibits a multi-period characteristic. Specifically, the traffic state in a certain period of time is not only affected by the traffic state in the previous period of time, but also by the traffic state in the same period of the past few days and the same period of the past few weeks. Based on this, the present invention processes the traffic state data X into recent relevant data X. r Daily cycle related data X d Weekly cycle related data X w The data is then input into a traffic condition prediction model for training. By fully exploring the recent, daily, and weekly correlation patterns in the input data, the model can predict the changing patterns of traffic conditions, thereby improving the accuracy of the prediction.
[0051] (2) Furthermore, the method of the present invention also considers that the spatial relationship between traffic nodes is affected not only by the spatial distance between nodes, but also by road semantic information. A spatiotemporal feature learning network is constructed. The spatial learning module constructs a distance adjacency matrix and an adaptive semantic adjacency matrix to simultaneously consider the spatial distance information between traffic nodes and road semantic information. Simultaneously, the temporal learning module learns recent relevant data X. r Daily cycle related data X d and related data X for the weekly cycle w The system learns the corresponding recent, daily, and weekly variation patterns; it integrates the temporal and spatial information learned from the two modules, and finally learns the multi-period characteristics of traffic conditions as well as spatial relationships including spatial distance and road semantic information, which effectively improves the accuracy of prediction.
[0052] (3) Further, this invention constructs a fully parameterized adaptive adjacency matrix and aggregates information of neighboring nodes through an adaptive diffusion graph convolutional network. Specifically, it aggregates information of nodes that are spatially close by means of the adjacency matrix. For distant nodes with strong correlation, the model adjusts the adaptive adjacency matrix A during training. apt The parameters in the matrix assign greater weights to distant nodes, making the corresponding adaptive adjacency matrix A... apt The larger the value in the middle, the smaller the loss, and ultimately the traffic state prediction model of the present invention can automatically learn the semantic information between traffic nodes during the training process; at the same time, compared with the basic graph convolutional network, the diffuse graph convolutional network used in the present invention can learn the information of the higher-order neighborhood of the node, thus making the mining of spatial related information more thorough.
[0053] (4) As a preferred method, compared with the time series data modeling method based on recurrent neural networks, the temporal convolutional network used in this invention can learn the long-term dependencies between different times and has higher computational efficiency. At the same time, the gating mechanism used in this invention enables information to flow better between TCN layers, which is very useful for time series data modeling, so that the network model can automatically select information that is more relevant to the traffic state at the next time moment to flow into the next layer.
[0054] (5) As a preferred option, the daily cycle related data and the weekly cycle related data are split and transformed along the time dimension by the splitting module, so that the split data blocks are semantically consistent with the recent related data, and different branches can be learned using the same spatiotemporal feature learning network.
[0055] (6) Preferably, the relevant data generation method designed in this invention slices the original data containing three dimensions (number of samples in each training batch, number of sensors, and number of traffic states) at once, and then stacks them along the time dimension to obtain the four-dimensional data format required by this invention. Based on this data format, future traffic states can be predicted based on historical traffic state data. Compared with existing data processing methods, this invention can generate recent relevant data X at once. r Daily cycle related data X d Weekly cycle related data X w and the predicted target Y true This can improve computing efficiency.
[0056] In summary, the method of this invention considers the impact of the multi-periodicity of traffic state data on prediction at the time level, and the impact of spatial distance between traffic nodes and road semantic information on prediction at the spatial level. This enables the prediction method of this invention to obtain richer and more comprehensive traffic state information, and effectively improves the accuracy and robustness of traffic state prediction. Attached Figure Description
[0057] Figure 1 This is an overall flowchart of the traffic state prediction method that integrates multi-period and spatial semantic association in an embodiment of the present invention.
[0058] Figure 2 This is an overall architecture diagram of the traffic state prediction method that integrates multi-period and spatial semantic association in an embodiment of the present invention. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0060] like Figure 1 , Figure 2 As shown, the traffic state prediction method of the present invention, which integrates multi-period and spatial semantic association, includes a training phase and an application phase:
[0061] The training phase includes:
[0062] S1. Obtain the original traffic status data X of each road segment in the actual road network and perform preprocessing;
[0063] S2. Use the preprocessed traffic state data X to construct a training sample set and train the traffic state prediction model.
[0064] Each training sample includes: recent relevant data X r Daily cycle related data X d Weekly cycle related data X w and training target Y true Among them, recent relevant data X r T represents r Traffic conditions at a historical time slice, daily related data X w This indicates that several days of history are in the T range, which is yet to be predicted. p Traffic conditions within a time slice, weekly related data X w Indicates the historical weeks in the T-predicted period pTraffic conditions within a time slice; Training objective Y true T to be predicted p Traffic conditions in each time slice; among which, the traffic conditions to be predicted for T... p Each time slice is a continuous T to be predicted. p A time slice; T r The historical time slices to be predicted include the previous time slice and the preceding consecutive T slices. r A time slice; in this embodiment of the invention, the daily cycle-related data X w Select traffic status data from the past 4 days within the time frame to be predicted; weekly related data X w Select traffic state data from the past four weeks for the time slot to be predicted. Select training samples corresponding to different time slots to be predicted, and use multiple training samples to train the traffic state prediction model.
[0065] During the training of the traffic condition prediction model, recent relevant data X is used. r Daily cycle related data X d Weekly cycle related data X w The data are input into the traffic state prediction model to minimize the output Y predicted by the model. pred With training target Y true The traffic state prediction model is trained with the feature difference loss as the target, and the parameters of the traffic state prediction model are adjusted in reverse to make the loss converge.
[0066] The application phase includes:
[0067] The historical data corresponding to the actual traffic state data to be measured is processed into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and then input into the trained traffic state prediction model to output the predicted T. p Traffic conditions in a given time frame.
[0068] Specifically, in S1, the original traffic state data X of each road segment in the actual road network is obtained by setting traffic nodes on each road segment. The road segments in the study are divided according to the location of the traffic nodes, and the traffic state data collected by the traffic nodes is statistically analyzed at fixed time intervals (the length of a time slice). Finally, T... s Traffic conditions collected at each time point are used as raw traffic condition data. Where N represents the number of traffic nodes, and D represents the number of traffic status data that each traffic node can collect at any given time. Traffic nodes are sensors on the road used to measure the real-time status of road traffic.
[0069] Specifically, in this embodiment of the invention, a 5-minute time interval is used to statistically analyze the traffic status collected at traffic nodes; the traffic status data includes vehicle speed, traffic flow, and road occupancy rate, etc.
[0070] Specifically, the preprocessing includes zero-padding and normalization of the original traffic state data X; wherein, zero-padding of the original traffic state data X includes replacing the zero values in the original traffic state data X with the mean of the original traffic state data X, in order to mitigate the impact of missing data.
[0071] After normalizing the zero-padded traffic state data X', and letting std represent the variance of the original traffic state data X, the normalized traffic state data X is:
[0072]
[0073] In S2, in this embodiment of the invention, a relevant data generation method is designed using matrix slicing and stacking operations, so that recent relevant data X can be generated in one go using preprocessed traffic state data X. r Daily cycle related data X d Weekly cycle related data X w and the predicted target Y true To improve computational efficiency.
[0074] In this embodiment of the invention, recent relevant data X r and training target Y true The generation method is as follows:
[0075]
[0076] Among them, D r This is a dataset containing all recently relevant data samples, where each sample is a recently relevant data sample. D true Given a dataset containing all training target samples, each sample is a training target. T r T represents the historical step size for recent relevant data. p Let T be the future step size to be predicted. p Traffic conditions within a time slice; newaxis indicates the addition of a new dimension; Stack dim=1 This indicates that the sliced data is stacked along dimension 1.
[0077] In this embodiment of the invention, the daily cycle-related data X d Related data X for the cycle w The generation methods include:
[0078] S221. Generate a set of daily and weekly periodic correlation data corresponding to any time t based on the preprocessed traffic state data X:
[0079]
[0080] in, Let T represent the sets of daily periodic data at any time t and the sets of weekly periodic data at any time t, respectively; q represents the sampling frequency of traffic nodes within a day; T d T represents the historical step size for daily periodic data. w This refers to the historical step size of the weekly data.
[0081] S222. Stack and change the dimensions of each element in the set consisting of daily and weekly periodic data at any time t along the time dimension to obtain the daily periodic data corresponding to any time t. and weekly data
[0082] S223. Based on S221 and S222, generate all sampling times T. s The corresponding set S, consisting of daily and weekly periodic data. d S w :
[0083]
[0084] S224, All sampling times T s Each element in the set consisting of daily and weekly periodic correlation data moves along the sampling time T. s By stacking and dimensional transformation, all sampling times T are obtained. s Daily cycle related data Data related to the cycle
[0085] S225, For all sampling times T s Daily cycle related data Data related to the cycle Perform matrix slicing and stacking operations to obtain daily cycle-related data X. d Related data X for the cycle w The formulas for matrix slicing and stacking operations are as follows:
[0086]
[0087] Among them, D d For the corresponding daily periodic sample dataset, D w Given a periodic sample dataset, where D dEach sample in the dataset represents the daily cycle-related data X. d , D w Each sample in the dataset is the periodic correlation data X. w ,
[0088] The data generation method designed in this invention slices the original data containing three dimensions (number of samples in each training batch, number of sensors, and number of traffic states) at once, and then stacks them along the time dimension to obtain the four-dimensional data format required by this invention. Based on this data format, future traffic states can be predicted according to historical traffic state data. In other embodiments, the preprocessed traffic state data X can also be used to obtain the required data through multiple iterations using common iterative methods.
[0089] In this invention, considering that traffic conditions do not exhibit a singular pattern over time but rather a multi-periodic characteristic—specifically, the traffic condition within a certain period is influenced not only by the traffic condition of the preceding period but also by the traffic condition of the same time period in the past few days and the same time period in the past few weeks—this invention processes the traffic condition data X into recent relevant data Xn. r Daily cycle related data X d Weekly cycle related data X w The data is then input into a traffic condition prediction model for training. By fully exploring the recent, daily, and weekly correlation patterns in the input data, the model can predict the changing patterns of traffic conditions, thereby improving the accuracy of the prediction.
[0090] As a further design of the present invention, at the spatial level, the present invention also considers that the spatial relationship between traffic nodes is not only affected by the spatial distance between traffic nodes, but also by the semantic information of roads. For example, during the time of going to and from school, the traffic conditions of roads near schools show similar changing trends, even if the spatial distance between them is far.
[0091] Based on this, the traffic state prediction model designed in this invention can learn spatiotemporal related information in the input dataset. This spatiotemporal related information includes not only recent correlation change patterns, daily cycle correlation change patterns, and weekly cycle correlation change patterns at the time level, but also spatial distance related information and road semantic information at the spatial level.
[0092] Specifically, the traffic state prediction model designed in this invention includes: parallel learning branches for recent correlation patterns, daily correlation patterns, and weekly correlation patterns, as well as an adaptive fusion layer and a fully connected layer; the features output by the three parallel branches are adaptively fused by the adaptive fusion layer, and then passed through the fully connected layer to obtain the predicted output Y. pred .
[0093] Each branch includes: a spatial learning module, a temporal learning module, and a spatiotemporal information fusion module; wherein, the spatial learning module and the temporal learning module are connected in parallel, and the output features of the spatial learning module and the temporal learning module are fused into spatiotemporal information through the spatiotemporal information fusion module. In this embodiment of the invention, the network composed of the spatial learning module, the temporal learning module, and the spatiotemporal information fusion module is a spatiotemporal feature learning network;
[0094] For the spatial learning module, this invention constructs both a distance adjacency matrix A and an adaptive semantic adjacency matrix A'. apt This approach simultaneously considers spatial distance information between traffic nodes and road semantic information; where the distance adjacency matrix A represents the spatial distance relationship between traffic nodes, and this relationship is inversely proportional to the spatial distance; the adaptive semantic adjacency matrix A... apt Used to represent the semantic information relationship between traffic nodes, it reflects the spatial relationship between distant nodes.
[0095] Specifically, the distance adjacency matrix A is constructed as follows:
[0096]
[0097]
[0098] A = A + I
[0099] in, For any two traffic nodes v i and v j The Euclidean distance between them, C i,j For the calculated traffic node v i and v j Euclidean distance correlation weights between them The threshold value is set based on experience, I is the identity matrix used to add self-loops, and λ represents the hyperparameter.
[0100] Adaptive adjacency matrix A apt The construction method is as follows:
[0101]
[0102] in, Let N be a randomly initialized traffic node embedding vector with learnable parameters, where N represents the number of traffic nodes, c represents the dimension of the node embedding vector, and c is a hyperparameter; ReLU(·) represents the activation function, and Softmax(·) represents the activation function used for normalization; E1 and E2 represent the embeddings of the source node and the target node, respectively. This indicates the calculation of spatial similarity between the target node and the source node.
[0103] Let the distance adjacency matrix A and the adaptive adjacency matrix A apt The data samples are input into the spatial learning module, which uses an adaptive diffusion graph convolutional network to learn spatial information related to traffic nodes. The data samples for the branch learning recent correlation patterns are recent relevant data X. r The data sample for the daily cycle correlation change pattern learning branch is daily cycle correlation data X. d The data sample for the learning branch of the periodic correlation variation pattern is the periodic correlation data X. w .
[0104] Specifically, in the recent correlation change pattern learning branch, the forward propagation formula of the adaptive diffusion graph convolutional network is:
[0105]
[0106] Among them, H s This represents the output of the spatial learning module in the recent correlation change pattern learning branch. This is the forward transition matrix. For the backward transition matrix, rowsum(·) represents the summation along the rows, A Transpose This represents the transpose of A, k is the diffusion factor, and K represents the set threshold. In this embodiment of the invention, K = 5. k1 W k2 W k3 It is a parameter matrix.
[0107] During the training process of the traffic state prediction model, the goal is to minimize the output Y predicted by the traffic state prediction model. pred With training target Y true The traffic state prediction model is trained using the feature difference loss as the objective, and W is then back-adjusted. k1 W k2 W k3 and the adaptive adjacency matrix A apt Continue until the loss converges and the trained W is obtained. k1 W k2 W k3 and the adaptive adjacency matrix A aptSpecifically, during model training, the adaptive diffusion graph convolutional network aggregates information from neighboring nodes. It aggregates information from nodes that are spatially close using the adjacency matrix. For distant nodes with strong correlations, the model adjusts the adaptive adjacency matrix A during training. apt The parameters in the matrix assign greater weights to distant nodes, making the corresponding adaptive adjacency matrix A... apt The larger the value in the middle, the less the loss.
[0108] For the time-based learning module, in this embodiment of the invention, a gated temporal convolutional network is used to learn recent relevant data X. r Daily cycle related data X d and related data X for the weekly cycle w The characteristics are used to obtain its recent variation patterns, daily cycle variation patterns, and weekly cycle variation patterns.
[0109] Specifically, the gated temporal convolutional network in this invention comprises two temporal convolutional network (TCN) branches, and uses a gating mechanism to enable the network to control the transmission of information between layers during training. Assume the output of the first TCN branch is H. a The output of the second TCN branch is H. b The forward propagation formula for a gated convolutional network is:
[0110] H t =tanh(H a )⊙σ(H b )
[0111] Among them, H t This represents the output of the time learning module in each branch.
[0112] Specifically, in the embodiments of the present invention, the spatiotemporal information fusion module is an adaptive fusion network, used to integrate the output H of the spatial learning module. s The output H of the time learning module t The fusion process yields a branch output that simultaneously contains spatiotemporal information. Specifically, the adaptive fusion network calculates adaptive weights z, and then applies them to H... s and H t Assigning weights z and 1-z, the formula is as follows:
[0113]
[0114] Where σ1 is the sigmoid activation function of the adaptive fusion network, W 11 W 22 b are parameter matrices, and ⊙ is the Hadamard dot product.
[0115] During the training of the traffic condition prediction model, W is adjusted in reverse.11 W 22 b, until the loss converges, and the trained W is obtained. 11 W 22 b.
[0116] For the branch that learns recent relevant change patterns, the spatial learning module takes the distance adjacency matrix A and the adaptive adjacency matrix A as inputs. apt and recent relevant data X r The input to the time-based learning module is recent relevant data X. r The outputs of the two modules are fused through a spatiotemporal information fusion module to obtain the output H of this branch. r .
[0117] The branch focuses on learning patterns related to daily cycles, using daily cycle-related data X. d Before inputting the spatial learning module and the temporal learning module, the daily cycle-related data X is processed by splitting the modules. d Break it down and extract the daily cycle-related data X d Split into T p Individual data related to recent events X r Data blocks of the same dimension are used, and each data block undergoes spatiotemporal feature learning through independent spatial learning modules, temporal learning modules, and spatiotemporal information fusion modules to obtain T. p One output, T p Each output is processed by the splicing module according to T. p By concatenating the dimensions, we obtain the output H of the learning branch for the daily cycle-related change patterns. d .
[0118] Specifically, the split module will divide the daily cycle-related data. Along the time dimension T p Slice the image, and then perform a dimensionality transformation on each slice to obtain the desired result. At this time T p The meaning becomes T p Group, and T d Replace T p It becomes a new time dimension. After the "splitting" operation, The meaning is semantically related to X r Maintaining consistency allows the use of the same network for learning.
[0119] The splicing module will split the individual data blocks The output after spatiotemporal feature learning through independent spatial learning modules, temporal learning modules, and spatiotemporal information fusion modules. The data is then merged to obtain an output that includes the daily cyclical variation pattern of traffic conditions within the time slice to be predicted.
[0120]
[0121] Here, Concat represents the concatenation operation.
[0122] Similarly, for the branch that learns the patterns of change related to the weekly cycle, in the weekly cycle-related data X w Before inputting the spatial and temporal learning modules, the data is split. Each split data block is then processed through independent spatial, temporal, and spatiotemporal information fusion modules to learn spatiotemporal features, resulting in T. p Each output is processed by the splicing module according to T. p By concatenating the dimensions, we obtain the output H of the learning branch for the periodic related change patterns. w .
[0123] That is, in the embodiments of the present invention, both the daily cycle correlation change pattern learning branch and the weekly cycle correlation change pattern learning branch include a splitting module and a T module. p A parallel spatiotemporal feature learning network and splicing module.
[0124] The adaptive fusion layer in the traffic state prediction model designed in this invention is used to integrate the output H of the recent relevant change pattern learning branch. r The output H of the learning branch for the daily cycle-related change pattern d The output H of the learning branch related to the periodic variation law w The layers are then fused to obtain the final hidden layer output H. Specifically, this includes:
[0125] The adaptive fusion weights are calculated using the following formula:
[0126]
[0127] Where z1 and z2 are adaptive fusion weights; σ2 is the sigmoid activation function of the adaptive fusion layer; W1, W2, W3, W4, W5, W6, b1, and b2 are learnable parameter matrices, which are obtained through training during the training process of the traffic state prediction model.
[0128] To assign weights to each branch, each weight must be within the range of [0,1] and the sum of the three weights must be 1. The formula is as follows:
[0129] H=(z2-z1·z2)⊙H r +z1⊙H d +(1-z1-z2+z1·z2)⊙H w
[0130] The fully connected layer in the traffic state prediction model designed in this invention is used to further learn the hidden layer output H through a multilayer perceptron, and its output is used as the output Y predicted by the traffic state prediction model. pred :
[0131] Y pred = (H·W7+b3)·W8+b4
[0132] Among them, W7, W8, b3, and b4 are learnable parameter matrices.
[0133] The method of this invention, at the time level, considers that the traffic state within a certain period is simultaneously affected by the traffic state of the previous period, the traffic state of the same period in the past few days, and the traffic state of the same period in the past few weeks. The change pattern of traffic state exhibits multi-periodic characteristics. The design is to process the traffic state data X into recent relevant data X. r Daily cycle related data X d Weekly cycle related data X w The data is then input into a traffic condition prediction model for training. By fully exploring the recent, daily, and weekly correlation patterns in the input data, the model can predict the changing patterns of traffic conditions, thereby improving the accuracy of the prediction.
[0134] At the spatial level, considering that the spatial relationships between traffic nodes are influenced not only by the spatial distance between them but also by road semantic information, a spatiotemporal feature learning network is constructed. The spatial learning module constructs a distance adjacency matrix and an adaptive semantic adjacency matrix to simultaneously consider both spatial distance information between traffic nodes and road semantic information. Simultaneously, the temporal learning module learns recent relevant data X. r Daily cycle related data X d and related data X for the weekly cycle w The corresponding recent, daily, and weekly variation patterns are observed. The temporal and spatial information learned from the two modules is fused to ultimately learn the multi-periodic characteristics of traffic conditions and spatial relationships including spatial distance and road semantic information, effectively improving prediction accuracy. Furthermore, by constructing a fully parameterized adaptive adjacency matrix, the traffic condition prediction model can automatically learn the semantic information between traffic nodes during training. Moreover, compared to basic graph convolutional networks, the diffuse graph convolutional network used in this invention can learn information from the higher-order neighborhoods of nodes, thus more fully mining spatially relevant information.
[0135] Furthermore, compared to time series data modeling methods based on recurrent neural networks, the temporal convolutional network used in this invention can learn long-term dependencies between different time points and has higher computational efficiency. At the same time, the gating mechanism used in this invention enables information to flow better between TCN layers, which is very useful for time series data modeling, allowing the network model to automatically select information that is more relevant to the traffic state at the next time point to flow into the next layer.
[0136] According to a second aspect of the present invention, a traffic state prediction system integrating multi-period and spatial semantic association is provided, for performing the corresponding steps in the traffic state prediction method integrating multi-period and spatial semantic association in the above embodiments, the system comprising: a training module and an application module;
[0137] The training module includes:
[0138] The data acquisition unit is used to acquire the original traffic status data X of each road segment in the actual road network;
[0139] A multi-period data sample generation and training unit is used to construct a training sample set using traffic state data X and train a traffic state prediction model.
[0140] Each training sample includes: representing T r Recent relevant data on traffic conditions within a historical time frame X r , indicating the number of historical days in the T-zone to be predicted p Daily cycle-related data on traffic conditions within a given time frame X d , indicating the historical weeks in the T-week to be predicted p Weekly correlation data of traffic conditions within a time slice X w and T represents the value to be predicted p Training objective Y: Traffic conditions within a given time frame true Among them, T r The historical time slices to be predicted include the previous time slice and the preceding consecutive T slices. r A time slice; T to be predicted p Each time slice is a continuous T to be predicted. p A time slice;
[0141] The application module is used to process the historical data corresponding to the traffic state data to be measured into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and input them into the trained traffic state prediction model to output the traffic state within the predicted time slice.
[0142] According to a third aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the traffic state prediction method that integrates multi-period and spatial semantic association as described in the above embodiments.
[0143] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for traffic state prediction fusing multi-period and spatial semantic correlation, characterized in that, include: Training phase: S1. Obtain the original traffic status data of each road segment in the actual road network. ; S2, using the traffic status data Construct a training sample set and train the traffic state prediction model; Each training sample includes: recent relevant data representing traffic conditions within a historical time slice. This represents daily-cycle data related to traffic conditions over several historical days within the predicted time frame. This represents the weekly data related to traffic conditions over several historical weeks within the time frame to be predicted. And the training objective is to represent the traffic conditions within the time frame to be predicted. Wherein, the historical time slice is the continuous period including the previous time slice and preceding time slices of the time slice to be predicted. A time slice; the time slice to be predicted is a continuous time slice to be predicted. Each time slice; the recent relevant data and the training objective The generation method is as follows: in, This is a dataset containing all recently relevant data samples, where each sample is the recently relevant data. ; Given a dataset containing all training target samples, where each sample is the training target. , This refers to the historical step size of recent relevant data. The future step size to be predicted; This indicates the addition of a new dimension; This indicates that the sliced data is stacked along dimension 1; The daily cycle related data and the aforementioned periodic related data The generation methods include: S221. Based on the traffic status data Generate any time The corresponding set of daily and weekly cycle related data , : in, This indicates the sampling frequency of traffic nodes within a day; The historical step size for daily cycle data. This refers to the historical step size of the weekly data. S222, the set , Each element in the array is stacked along the time dimension to obtain any time interval. Corresponding daily cycle data and weekly data ; S223. Based on S221 and S222, generate all sampling times. The corresponding set of daily and weekly data , : S224, the set , Each element in the sample time By stacking and dimensional transformation, all sampling times can be obtained. Daily cycle related data Data related to the cycle ;in, , ; S225. Generate the daily cycle-related data. and the related data of the cycle : in, For the corresponding daily periodic sample dataset, For a periodic sample dataset, Each sample in the dataset represents the daily cycle-related data. , , Each sample in the dataset represents the periodic correlation data. , ; Application phase: The historical data corresponding to the traffic state data to be measured is processed into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and then input into the trained traffic state prediction model to output the traffic state within the predicted time slice.
2. The method according to claim 1, characterized in that, The traffic condition prediction model includes: three parallel branches, an adaptive fusion layer, and a fully connected layer; the three parallel branches are a recent correlation change pattern learning branch, a daily cycle correlation change pattern learning branch, and a weekly cycle correlation change pattern learning branch; Recent relevant data Daily cycle related data Weekly related data The features are respectively input into the corresponding recent correlation change pattern learning branch, daily cycle correlation change pattern learning branch, and weekly cycle correlation change pattern learning branch. The features output from the three parallel branches are adaptively fused through the adaptive fusion layer, and then passed through the fully connected layer to obtain the predicted output. .
3. The method according to claim 2, characterized in that, The recent relevant change pattern learning branch includes a spatiotemporal feature learning network, which includes a spatial learning module, a temporal learning module, and a spatiotemporal information fusion module. The spatial learning module is used to learn from the distance adjacency matrix. Adaptive adjacency matrix and recent relevant data as a data sample As input, an adaptive diffusion graph convolutional network is used to output spatial information related to traffic nodes. The distance adjacency matrix An adaptive semantic adjacency matrix is used to represent the spatial distance relationships between traffic nodes. Used to represent the semantic information relationships between traffic nodes; The time learning module is used to learn from the recent relevant data. As input, output the recent time variation patterns between traffic nodes. ; The spatiotemporal information fusion module is used to fuse the spatial related information. With the aforementioned recent time change pattern characteristics The recent spatiotemporal variation patterns between traffic nodes were obtained. .
4. The method according to claim 3, characterized in that, The learning branch for daily or weekly cycle-related changes includes a module breakdown. The spatiotemporal feature learning network and splicing module are connected in parallel; The splitting module is used to process daily cycle-related data. Or related data for the week By slicing along the time dimension and performing dimensional transformations, we obtain... One data block; The parallel spatiotemporal feature learning networks are respectively used for output. The daily or weekly spatiotemporal variation patterns of traffic conditions within a given time slice to be predicted; wherein, the data sample input to each of the spatiotemporal feature learning networks is the corresponding... One data block; The splicing module is used to... The outputs of the parallel spatiotemporal feature learning networks are concatenated along the time dimension and then subjected to dimensionality transformation to obtain the daily spatiotemporal variation pattern of traffic status within the time slice to be predicted. Or the spatiotemporal variation pattern of the cycle .
5. The method according to claim 3 or 4, characterized in that, The adaptive adjacency matrix for: in, , For traffic node embedding vectors that are randomly initialized and have learnable parameters, This represents the spatial similarity between any two nodes in a data sample. Indicates the number of traffic nodes. For hyperparameters; This represents the activation function. Used for normalization; The output of the adaptive diffusion graph convolutional network is: in, Let be the forward transition matrix. This is the backward transition matrix; This indicates addition along the rows; This represents the transpose of the distance adjacency matrix A; For diffusion factor, This indicates the set threshold. , , It is a parameter matrix.
6. The method according to claim 3, characterized in that, The time learning module is a gated temporal convolutional network.
7. A traffic state prediction system integrating multi-period and spatial semantic association, characterized in that, The system for performing the method according to any one of claims 1-6, the system comprising: a training module and an application module; The training module includes: The data acquisition unit is used to acquire raw traffic status data for each road segment in the actual road network. ; A multi-period data sample generation and training unit is used to utilize the traffic state data. Construct a training sample set and train the traffic state prediction model; Each training sample includes: recent relevant data representing traffic conditions within a historical time slice. This represents daily-cycle data related to traffic conditions over several historical days within the predicted time frame. This represents the weekly data related to traffic conditions over several historical weeks within the time frame to be predicted. And the training objective is to represent the traffic conditions within the time frame to be predicted. Wherein, the historical time slice is the continuous period including the previous time slice and preceding time slices of the time slice to be predicted. A time slice; the time slice to be predicted is a continuous time slice to be predicted. A time slice; The application module is used to process the historical data corresponding to the traffic state data to be measured into recent relevant data, daily periodic relevant data, and weekly periodic relevant data, and input them into the trained traffic state prediction model to output the traffic state within the predicted time slice.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Multi-module traffic intensity prediction method based on semantic information
CN113112792A