A Method for Predicting Urban Traffic Data Based on Causal Classification and Bias Removal
Through the method of causal classification and debias, the distribution skewness of urban spatiotemporal data is corrected, potential spatiotemporal causal relationships are restored, and the causality diagram is learned and the spatiotemporal transmission mechanism is introduced, which solves the problem of poor generalization ability of urban traffic data prediction models in the existing technology, and achieves higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN202510285942.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-03-12
AI Technical Summary
The existing urban traffic data prediction methods are insufficient in dealing with extreme scenarios and distributed skewed data, resulting in poor generalization capabilities of the model and being unable to effectively adapt to multiple traffic scenarios.
The method based on causal classification is adopted to correct the distribution skew of urban spatiotemporal data through causal intervention, restore potential spatiotemporal causal relationships, combine spatial proximity and temporal position information, learn causal maps and introduce spatiotemporal causal transmission mechanisms.
It significantly improves the accuracy and robustness of urban traffic data prediction, improves the accuracy, robustness and generalization capabilities of the model, and can more effectively adapt to a variety of traffic scenarios.
Smart Images

Figure CN119783921B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spatio-temporal data mining, and specifically relates to a method for predicting urban traffic data based on causal classification debiasing. Background Art
[0002] As an important information resource, urban traffic data can intuitively and effectively reflect the dynamic change laws of current urban traffic behaviors. By deeply mining the implicit information in urban traffic data and exploring implicit spatio-temporal causal relationships, potential urban traffic behavior patterns can be revealed, which is conducive to implementing scientific urban traffic data prediction and analysis, and significantly improving the scientificity of urban managers in formulating urban planning decisions. This not only helps to relieve urban traffic problems targeted, but also has a positive promoting effect on improving the quality of life of residents.
[0003] In the prior art, most methods process spatio-temporal correlations based on graph networks, use static graph structures to describe the associations between nodes, or apply complex attention mechanisms to capture long-term dependencies. Thanks to large-scale and evenly distributed data sets, these methods have achieved certain results in simulating the spatio-temporal associations of some typical traffic scenarios. However, due to reasons such as rare extreme scenarios and sparse distribution of detectors, urban traffic observation data from real-world scenarios cannot cover all potential scenarios, and often exhibits significant distribution skewness. This skewness may cause traffic models to overfit specific biases in the data, weaken the generalization ability of the models, and only be applicable to single scenarios. For example, the Chinese patent with the publication number CN116740949B and the Chinese patent applications with the publication numbers CN111179592A and CN117636625A.
[0004] Regarding the problem of distribution skewness caused by sparse traffic data, spatio-temporal causal structure learning can correct the influence of spatio-temporal data distribution problems on causal mining through causal intervention, identify potential spatio-temporal causal structures, and provide an interpretable method for deeply understanding and modeling complex real environments such as urban traffic. The traffic flow prediction STACNN model introduces a spatial attention mechanism and a dilated causal convolutional neural network to model the potential causal relationships of traffic data, and effectively improves the prediction accuracy on multiple traffic data sets. The traffic flow prediction STCTN model, on the other hand, effectively avoids the interference of spurious correlations through the method of time-domain bias correction and spatial-domain causal transmission, and improves the stability of the model. These existing methods prove that modeling urban spatio-temporal data from a causal perspective can effectively avoid the interference of spurious correlations. However, due to uneven data distribution, existing methods tend to learn higher-frequency pattern features, thus hindering their generalization in real scenarios with significant pattern heterogeneity and data distribution skewness. Summary of the Invention
[0005] In view of the above problems, the present invention proposes a method for predicting urban traffic data based on causal classification debiasing, which utilizes spatial adjacency relationships and temporal positions to correct the influence of the skewness of urban spatio-temporal data distribution on causal mining through causal intervention, restores the spatio-temporal causal relationships hidden in the observed data, adopts prior information such as spatial proximity relationships and temporal positions to learn causal graphs, and introduces a spatio-temporal causal transmission mechanism spanning different time segments to strengthen spatio-temporal causal representations, thereby significantly improving the accuracy and robustness of urban traffic data prediction, and effectively enhancing the accuracy, robustness, and generalization ability of the prediction model.
[0006] The present invention provides a method for predicting urban traffic data based on causal classification debiasing, comprising:
[0007] Step S1: Determine the target prediction area;
[0008] Collect multiple traffic flow data of the target prediction area in the historical time period, and establish a corresponding urban traffic data set;
[0009] Perform standardization processing on the urban traffic data set to obtain the urban traffic data sets of each sub-region;
[0010] Step S2: Construct a prediction model for urban traffic data based on causal classification debiasing;
[0011] Step S3: Let t = 1. When t = 1, it represents the first historical time period;
[0012] Step S4: Obtain the traffic flow data of the t th historical time period and input it into the urban traffic data prediction model. Based on the potential confounder estimator A t , cluster and divide the multiple sub-regions of the t th historical time period to obtain multiple clusters containing characteristic confounders of the t th historical time period;
[0013] Step S5: Input the multiple clusters containing characteristic confounders of the t th historical time period into the causal debiaser B t to perform unbiased spatio-temporal feature extraction, and obtain the unbiased spatio-temporal features of the t th historical time period;
[0014] Step S6: Input the unbiased spatio-temporal features of the t th historical time period into the dynamic causal learner C t to obtain the causal transmission matrix of the t th historical time period;
[0015] Step S7: Input the causal transfer matrix of the t th historical time period into the causal propagation module D t to generate the causally enhanced spatio-temporal representation of the th historical time period; ;
[0016] Step S8: Map the causally enhanced spatio-temporal representation of the t th historical time period to the vehicle flow domain to generate the traffic flow prediction value of the th historical time period; t ;
[0017] Step S9: Determine whether t is greater than or equal to T , where T represents the total historical moments. If so, obtain the final urban traffic data prediction model. If not, let t = t +1 and return to Step S3;
[0018] Step S10: Obtain the traffic flow prediction value of the target area in the current time period based on the final urban traffic data prediction model.
[0019] Optionally, the traffic flow data is the traffic flow of various means of transportation.
[0020] Optionally, the specific steps of standardizing the urban traffic data set in Step S1 to obtain the urban traffic data sets of each sub-region include:
[0021] Divide the target prediction area into multiple sub-regions; obtain the traffic flow data of each sub-region in each historical time period, conduct statistics and analysis to obtain the urban traffic data sets of each sub-region.
[0022] Optionally, the urban traffic data prediction model in Step S2 includes a latent confounding factor estimator, a causal debiaser, a dynamic causal learner, and a causal propagation module.
[0023] Optionally, the specific steps of obtaining multiple clusters containing feature confounding factors in the t th historical time period in Step S4 include:
[0024] Step S41: Set a learnable confounding factor prototype matrix;
[0025] Step S42: Set the embedding matrix of the urban traffic area feature nodes;
[0026] Step S43: Map the learnable confounding factor prototype matrix and the embedding matrix of the urban traffic area features into the latent space to obtain the mapped latent space;
[0027] Step S44: Construct a causal hierarchical matrix based on the mapped latent space;
[0028] Step S45: Use the Gumbel normalization exponential trick to regularize the causal hierarchical matrix to obtain a regularized hierarchical matrix;
[0029] Step S46: Obtain multiple clusters containing characteristic confounding factors for the t th historical time period based on the regularized hierarchical matrix.
[0030] Optionally, the specific steps of outputting the unbiased spatio-temporal features for the t th historical time period in Step S5 include:
[0031] Apply the cross-attention mechanism to the learnable confounding factor prototype matrix and the regularized hierarchical matrix to obtain the confusion probability of the target prediction area for the t th historical time period;
[0032] According to the backdoor adjustment method, use the confusion probability of the target prediction area for the t th historical time period to obtain the unbiased causal features of each sub-region, and perform a splicing operation to obtain the unbiased spatio-temporal features for the t th historical time period.
[0033] Optionally, the specific steps of obtaining the causal transfer matrix for the t th historical time period in Step S6 include:
[0034] Step S61: Obtain the dynamic enhancement feature matrix for the t th historical time period and the dynamic enhancement feature matrix for the th historical time period;
[0035] Step S62: Based on the dynamic enhancement feature matrix for the t th historical time period and the dynamic enhancement feature matrix for the th historical time period, obtain the causal effect intensity of each sub-region in the t th historical time period;
[0036] Step S63: Standardize the causal effect intensity of each sub-region in the t th historical time period to obtain the causal transfer matrix of each sub-region in the t th historical time period;
[0037] Step S64: Based on the tThe causal transfer matrix of each sub-region in a historical time period is used to obtain the causal transfer matrix of the t historical time period.
[0038] Optionally, the specific steps of the causal enhanced spatio-temporal representation of the historical time period are as follows:
[0039] Step S71: Determine the output of the causal transfer module;
[0040] Step S72: Obtain the spatial proximity graph and integrate it into the causal transfer mechanism to obtain the updated causal transfer mechanism I;
[0041] Step S73: Obtain the regional interaction graph and incorporate it into the causal transfer mechanism to obtain the updated causal transfer mechanism II;
[0042] Step S74: Generate the causal enhanced spatio-temporal representation of the t historical time period based on the output of the causal transfer module, the updated causal transfer mechanism I, and the updated causal transfer mechanism II.
[0043] Optionally, the causal enhanced spatio-temporal representation of the t historical time period , the expression is:
[0044]
[0045] Wherein, is the causal enhanced spatio-temporal representation of the t historical time period, is the output of the causal transfer module of the t historical time period, is the updated causal transfer mechanism II, is the updated causal transfer mechanism I, represents the causal transfer process based on geographical distance, represents the adjacency matrix of the spatial proximity graph between regions in the t historical time period, H t represents the unbiased spatio-temporal representation in the historical time period, represents the causal transfer mechanism based on the regional interaction graph, is the regional interaction matrix in the historical time period.
[0046] Compared with the prior art, the present invention has at least the following beneficial effects:
[0047] (1) The urban traffic data prediction method based on causal classification debiasing corrects the distribution bias of urban spatio-temporal data through causal intervention strategies to eliminate the influence in the causal discovery process;
[0048] (2) The urban traffic data prediction method based on causal classification debiasing can reveal and reconstruct the potential spatio-temporal causal relationships behind the observed data;
[0049] (3) The urban traffic data prediction method based on causal classification debiasing adopts prior information such as spatial proximity relationships and temporal positions to learn causal graphs, and introduces a spatio-temporal causal transmission mechanism across different time segments to strengthen spatio-temporal causal representations, thereby significantly improving the accuracy and robustness of urban traffic data prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings are only for the purpose of illustrating specific embodiments and are not considered to be a limitation of the present invention.
[0051] Figure 1 It is a schematic diagram of the flowchart of the urban traffic data prediction method based on causal classification debiasing in the embodiment of the present invention;
[0052] Figure 2 It is a schematic diagram of the flowchart of obtaining the causal transmission matrix in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0053] In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be further described in detail below with reference to the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. In addition, the present invention may be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.
[0054] A specific embodiment of the present invention, as Figure 1 - Figure 2 , discloses an urban traffic data prediction method based on causal classification debiasing, and the specific implementation steps are as follows:
[0055] Step S1, determine the target prediction area;
[0056] Collect multiple traffic flow data in the historical time period of the target prediction area and establish a corresponding urban traffic data set;
[0057] Standardize the urban traffic data set to obtain the urban traffic data set of each sub-region;
[0058] Preferably, the traffic flow data is the traffic flow of various means of transportation;
[0059] The urban traffic data set includes the demand for shared bicycles, the load of buses, the demand for taxis, and / or the pedestrian flow.
[0060] Preferably, the specific steps of standardizing the urban traffic data set in step S1 to obtain the urban traffic data set of each sub-region include:
[0061] Dividing the target prediction area into multiple sub-regions; obtaining the traffic flow data of each sub-region in each historical time period, conducting statistics and analysis, and obtaining the urban traffic data set of each sub-region;
[0062] Step S2: Construct an urban traffic data prediction model based on causal classification debiasing;
[0063] Optionally, the urban traffic data prediction model in step S2 includes a potential confounding factor estimator, a causal debiaser, a dynamic causal learner, and a causal propagation module;
[0064] Step S3: Let t = 1. When t = 1, it represents the first historical time period;
[0065] Step S4: Obtain the traffic flow data of the t th historical time period and input it into the urban traffic data prediction model. Based on the potential confounding factor estimator A t , cluster and divide the multiple sub-regions of the t th historical time period to obtain multiple clusters containing characteristic confounding factors in the t th historical time period;
[0066] It can be understood that the number of clusters in step S4 is less than the number of sub-regions;
[0067] The cluster is a cluster containing characteristic confounding factors;
[0068] Preferably, the potential confounding estimator in step S4 divides the standard data into clusters with different confounding factors by constructing a hierarchical matrix.
[0069] Preferably, the specific steps of obtaining multiple clusters containing characteristic confounding factors in the t th historical time period in step S4 include:
[0070] Step S41: Set a learnable confounding factor prototype matrix , where represents an integer, is a hyperparameter for controlling the number of levels of confounding factors, represents the dimension of the confounding factor prototype and is randomly initialized;
[0071] Step S42: Set the embedding matrix of the urban traffic area feature nodes ; represents the dimension of the embedding layer;
[0072] Step S43: Map the learnable confounding factor prototype matrix and the embedding matrix of the urban traffic area feature nodes into the latent space to obtain the mapped latent space. The expression is:
[0073]
[0074] where, is the mapped latent space, is the query matrix transformed by the learnable parameter matrix and the bias vector, is the learnable parameter matrix, , represents the dimension, is the learnable parameter matrix, , is the first bias term, is the second bias term, is the key matrix transformed by the learnable parameter matrix and the bias vector.
[0075] Step S44: Construct a causal hierarchical matrix based on the mapped latent space , and the expression is:
[0076]
[0077] where, is the key matrix transformed by the learnable parameter matrix and the bias vector, represents the transpose, represents the dimension of the hidden layer.
[0078] Step S45: Use the Gumbel Softmax technique to regularize the causal hierarchical matrix to obtain the regularized hierarchical matrix , and the expression is:
[0079]
[0080] where, represents the th column of the regularized hierarchical matrix, j = 1, 2, 3,... J , J represents the total number of columns, is the temperature variable in the Gumbel Softmax technique, is a vector containing independent and identically distributed samples from the distribution, exp(•) is the normalized exponential function, represents the th column of the causal stratification matrix.
[0081] Step S46: Based on the regularized stratification matrix, obtain multiple clusters containing characteristic confounding factors for the t th historical time period.
[0082] Step S5: Input the multiple clusters containing characteristic confounding factors for the t th historical time period into the causal debiaser B t , perform unbiased spatio-temporal feature extraction, and obtain the unbiased spatio-temporal features for the t th historical time period;
[0083] Exemplarily, the specific steps for outputting the unbiased spatio-temporal features for the t th historical time period in Step S5 include:
[0084] There are N sub-regions, and the N sub-regions are divided into P types of clusters (P < N);
[0085] For the sub-regions in each type of cluster, use a causal debiaser with the same parameters to perform unbiased spatio-temporal feature extraction.
[0086] Preferably, the specific steps for outputting the unbiased spatio-temporal features for the t th historical time period in Step S5 include:
[0087] Apply the learnable confounding factor prototype matrix and the regularized stratification matrix, and use the cross-attention mechanism to obtain the confusion probability of the target prediction region for the t th historical time period. The expression is:
[0088]
[0089] where is the confusion probability, are learnable parameters, are learnable parameters. For regions belonging to the same confounding factor category, their confusion probabilities are the same. is the regularized stratification matrix, is the learnable confounding factor prototype matrix.
[0090] According to the backdoor adjustment method, use the confusion probability of the target prediction region for the t th historical time period to obtain the unbiased causal features of each sub-region, and perform a concatenation operation to obtain the unbiased spatio-temporal features for the t th historical time period , the expression is:
[0091]
[0092] Wherein, is the unbiased causal feature of the t th sub-region in the n th historical time period. || represents the concatenation operation of node dimensions. represents the confounding probability of the n th sub-region, and N is the total number of sub-regions.
[0093] Step S6: Input the unbiased spatio-temporal features of the t th historical time period into the dynamic causal learner C t to obtain the causal transfer matrix of the t th historical time period;
[0094] Preferably, the specific steps of obtaining the causal transfer matrix of the t th historical time period in step S6 include:
[0095] Step S61: Obtain the dynamic enhanced feature matrix of the t th historical time period and the dynamic enhanced feature matrix of the th historical time period. The expressions are respectively:
[0096]
[0097]
[0098] Wherein, represents the historical time period interval, is the dynamic enhanced feature matrix of the th historical time period, is the dynamic enhanced feature matrix of the th historical time period, is the projection matrix of the th historical time period, is the projection matrix of the th historical time period, represents the unbiased spatio-temporal representation in the th historical time period, , where N is the number of sub-regions, d is the dimension, represents the unbiased spatio-temporal representation in the th historical time period.
[0099] Step S62: Based on the dynamic enhanced feature matrix of the t th historical time period and the The dynamic enhancement feature matrix of the t historical time periods, and obtain the causal effect intensity of each sub-region in the
[0100]
[0101] Among them, represents the causal effect intensity of the sub-region t in the causal effect intensity of the i historical time period and the sub-region j of the dynamic enhancement feature matrix of the historical time period, i represents the sub-region of the dynamic enhancement feature matrix of the j historical time period.
[0102] Step S63: Standardize the causal effect intensity of each sub-region in the t historical time period to obtain the causal transfer matrix of each sub-region in the historical time period. The expression is: t
[0103]
[0104] Among them, t represents that the sub-region i in the historical time period receives the causal effect from the sub-region j in the historical time period; j (•) is the fully connected layer function of the sub-region t represents the causal effect intensity of the sub-region i in the causal effect intensity of the historical time period and the sub-region j of the dynamic enhancement feature matrix of the historical time period, t represents the causal effect intensity of the sub-region i in the causal effect intensity of the historical time period and the sub-region k of the dynamic enhancement feature matrix of the historical time period, (•) is the exponential function.
[0105]
[0105] Step S64. Based on the causal transfer matrices of each sub-region in the t th historical time period, obtain the causal transfer matrix of the t th historical time period. The expression is:
[0106]
[0107] where is the causal transfer matrix of the t th historical time period.
[0108] Step S7. Input the causal transfer matrix of the t th historical time period into the causal propagation module D t to generate the causally enhanced spatio-temporal representation of the t th historical time period ;
[0109] Preferably, the specific steps of the causally enhanced spatio-temporal representation of the th historical time period described in Step S7 include:
[0110] Step S71. Determine the output of the causal transfer module of the t th historical time period. The expression is;
[0111]
[0112]
[0113] where represents the output feature of the th layer in the th historical time period, is the output feature of the th layer in the -1th historical time period, is the causal transfer matrix of the t th historical time period, is the number of causal propagation layers, is the learnable parameter one, is the learnable parameter two, represents the output of the causal transfer module of the th historical time period, which is the time-causal enhanced representation at historical moment t , represents the management activation function.
[0114] Step S72. Obtain the spatial proximity graph of the t th historical time period and integrate it into the causal transfer mechanism to obtain the tUpdate the causal transmission mechanism 1 for a historical time period , where represents the causal transmission process based on geographical distance represents the adjacency matrix of the spatial proximity graph between regions in the -th historical time period H t represents the unbiased spatio-temporal representation in the -th historical time period ;
[0115] Optionally, the causal transmission mechanism includes a first graph convolutional layer, a first linear layer, a first rectified linear unit layer, a second graph convolutional layer, a second linear layer, and a second rectified linear unit layer
[0116] The output of updating the causal transmission mechanism 1 is a spatially causal enhanced spatio-temporal representation
[0117] The spatial proximity graph means that regions close in geographical location may have a causal relationship
[0118] The spatial proximity graph can be used to explore and show the influence of geographical location on the causal relationship between events, phenomena, or variables
[0119] Step S73: Obtain the regional interaction graph for the -th historical time period and incorporate it into the causal transmission mechanism for the -th historical time period to obtain the updated causal transmission mechanism 2 for the -th historical time period t ; where t represents the causal transmission mechanism based on the regional interaction graph t is the regional interaction matrix in the -th historical time period ; represents the causal transmission mechanism based on the regional interaction graph is the regional interaction matrix in the -th historical time period ;
[0120] Optionally, the output of the updated causal transmission mechanism 2 is an interaction causal enhanced spatio-temporal representation
[0121] The regional interaction graph is used to embed time, source region, and target region into the regional interaction calculation
[0122] It can be understood that the regional interaction graph is used to show how different variables or events affect each other through causal transmission; optionally, the specific steps to obtain the regional interaction graph include: successively performing Einstein summation on the potential spatial interaction law of time, the potential spatial interaction law of the source sub-region, and the potential spatial interaction law between the target sub-regions to obtain the summation result 1, the summation result 2, and the summation result 3 respectively; after performing rectified linear unit processing on the summation result 1, the summation result 2, and the summation result 3, then performing normalized exponential processing to obtain the corresponding regional interaction graph
[0123] Optionally, the -th Regional interaction matrix for a time period The expression is:
[0124]
[0125]
[0126]
[0127]
[0128] Wherein, is the spatial interaction influence received by sub-region t from sub-region i in the j th historical time period, represents the second process quantity of the interaction matrix between sub-region t and sub-region i when calculating the interaction matrix for the j th historical time period, represents the first process quantity of the interaction matrix between sub-region t and sub-region i when calculating the interaction matrix for the j th historical time period; represents the feature dimension of the time embedding in the learnable core tensor o , the spatial feature dimension of the target sub-region p , and the spatial feature dimension of the source sub-region q The potential spatial interaction law, characterized as the potential spatial interaction law among time, source sub-region, and target sub-region; represents the time embedding feature dimension of the t th historical time period o , which is an element in the learnable matrix; is the spatial feature dimension of the source sub-region i in the learnable matrix q ; is the spatial feature dimension of the target sub-region j in the learnable matrix p .
[0129] Step S74, based on the output of the causal transmission module for the t th historical time period, the updated causal transmission mechanism one for the t th historical time period, and the updated causal transmission mechanism two for the t th historical time period, generate the causally enhanced spatio-temporal representation for the th historical time period , the expression is:
[0130]
[0131] Among them, is the causally enhanced spatio-temporal representation of the historical time period, is the output of the causal transmission module of the historical time period, is to update the causal transmission mechanism two, is to update the causal transmission mechanism one, represents the causal transmission process based on geographical distance, represents the -th adjacency matrix of the spatial proximity map between regions in the historical time period, H t represents the unbiased spatio-temporal representation in the -th historical time period, represents the causal transmission mechanism based on the regional interaction graph, is the regional interaction matrix in the -th historical time period.
[0132] Step S8: Map the causally enhanced spatio-temporal representation of the -th historical time period to the vehicle flow domain to generate the traffic flow prediction value of the -th historical time period;
[0133] Step S9: Determine whether t is greater than or equal to T , T represents the total historical moments. If so, obtain the final urban traffic data prediction model. If not, let t = t + 1, and return to Step S3;
[0134] Step S10: Obtain the traffic flow prediction value of the target area in the current time period based on the final urban traffic data prediction model.
[0135] Embodiment 1
[0136] Use the traffic flow data of Xicheng District, Beijing and the traffic flow data set of New York City to train the urban traffic data prediction model;
[0137] The traffic flow data set of Xicheng District, Beijing includes the on-off data and flow data of taxis, buses, and shared bicycles in Xicheng District, Beijing from January 1, 2021 to December 31, 2021. The research area is divided into 235 non-overlapping sub-regions with a time interval of 30 minutes;
[0138] The New York City traffic flow dataset contains traffic flow data of taxis and bicycles in New York City, USA from April 1, 2016 to June 30, 2016. The research area is divided into 51 non-overlapping sub-regions, and the time interval is also 30 minutes.
[0139] (1) Split the dataset along the time axis, specifically divided into a training set (accounting for 70%), a validation set (accounting for 10%), and a test set (accounting for 20%);
[0140] Analyze the urban traffic flow data in the past 3 hours to achieve the prediction of the urban traffic flow in the next half hour;
[0141] (2) Train the causal classification debiased urban traffic data prediction model;
[0142] Standardize the data in the training set with standard score (Z-score), and randomly initialize all parameters in the causal classification debiased urban traffic data prediction model;
[0143] The training process is carried out in an open-source (Linux) operating system environment, where the number of hidden layer channels is set to 64; the open-source (Linux) operating system is configured with an Intel Core i9 10th generation flagship (Intel® Core™ i9-10980XE) CPU and a tensor core (NVIDIA V100 Tensor Core) GPU;
[0144] In the training mode, the amount of data processed in each batch is 64; use the Adam (Adaptive MomentEstimation) optimizer, with a learning rate of 0.001 and a weight decay coefficient of 0.0001; Adaptive MomentEstimation is an optimization algorithm widely used in machine learning and deep learning;
[0145] The total number of training rounds of the model is 200, and the Early Stopping strategy is adopted, that is, when the loss function value does not show a downward trend for 50 consecutive cycles, the training process is terminated in advance.
[0146] To verify the effectiveness of the method of the present invention, compare it with the existing method; perform urban traffic data prediction on the traffic flow datasets of Xicheng District, Beijing and New York City respectively, and the comparison results are shown in Tables 1 and 2. The evaluation indicators include the mean absolute error (MAE), the root mean square error (RMSE), and the mean absolute percentage error (MAPE), where the reduction of the error indicators intuitively reflects the improvement of the prediction performance. Comparative example one
[0147] The STGODE model for time series prediction captures spatio-temporal dynamic relationships through tensor-based ordinary differential equations.
[0148] Comparative Example 2
[0149] The Adaptive Graph Convolutional Recurrent Network (AGCRN) model is used for traffic flow prediction. It combines the features of graph convolutional networks and recurrent neural networks to dynamically capture spatio-temporal correlations in traffic sequences.
[0150] Comparative Example 3
[0151] The Dynamic Graph Convolutional Recurrent Network (DGCRN) model is used for traffic prediction. It adopts dynamic graph generation and graph convolution to capture spatio-temporal dynamic patterns in traffic data.
[0152] Comparative Example 4
[0153] The Dynamic Spatio-Temporal Aware Graph Neural Network (DSTAGNN) model for traffic flow prediction improves prediction accuracy by constructing spatio-temporal aware graphs and spatio-temporal attention modules.
[0154] Comparative Example 5
[0155] The Graph Convolutional Network under Hyperbolic Embedding (HGCN) model is a hierarchical graph convolutional network for traffic prediction. It captures traffic flow patterns at different scales through multi-layer graph convolution.
[0156] Comparative Example 6
[0157] The Regularized Graph Structure Learning (RGSL) model proposes a regularized graph structure learning method. It combines explicit prior structures and implicit structures for multivariate time series prediction, enhancing the combination of the prediction deep network and the graph structure.
[0158] Comparative Example 7
[0159] The DMSTGCN model improves prediction accuracy through dynamic graph construction and multi-faceted fusion modules.
[0160] Comparative Example 8
[0161] The time series model SCINet is a time series prediction model that predicts time series data through sample convolution and interactive learning, and shows excellent performance in various time series tasks.
[0162] Comparative Example 9
[0163] The TimesNet model, a time series basic model, improves prediction accuracy by modeling the two-dimensional changes in time series data.
[0164] Comparative Example 10
[0165] The model STNSCM for bicycle flow prediction uses a causal graph to predict future bicycle traffic flow based on structural causal theory.
[0166] Table 1 Comparison of predicted results of traffic flow data in Xicheng District, Beijing
[0167]
[0168] Table 2 Comparison of predicted results of traffic flow data in New York City
[0169]
[0170] As described above, it is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention.
Claims
1. A method for predicting urban traffic data based on causal classification debiasing, characterized in that: include: Step S1, determining the target prediction area; Collect multiple traffic flow data of the target prediction area in the historical time period and establish the corresponding urban traffic data set; Standardizing the urban traffic data set to obtain urban traffic data sets for each sub-region; Step S2, constructing an urban traffic data prediction model based on causal classification debiasing; Step S3: t =1, when t =1, it indicates the first historical time period; Step S4: Get t The traffic flow data of historical time periods are input into the urban traffic data prediction model, and the potential confounding factor estimator is used to estimate the traffic flow of the city. A t , will t Clustering is performed on multiple sub-regions in each historical period to obtain t The specific steps of clustering multiple characteristic confounding factors in a historical period include: Step S41, setting a learnable confounding factor prototype matrix; Step S42, setting an embedding matrix of characteristic nodes of urban traffic areas; Step S43, mapping the learnable confounding factor prototype matrix and the embedding matrix of the urban traffic area characteristic nodes into the latent space to obtain the mapped latent space; Step S44, constructing a causal hierarchical matrix based on the mapped latent space; Step S45, regularizing the causal hierarchical matrix to obtain a regularized hierarchical matrix; Step S46: Obtain the first t Multiple clusters with characteristic confounding factors for historical time periods; Step S5: t Clustering input causal debiasing for multiple historical time periods with characteristic confounding factors B t , perform unbiased spatiotemporal feature extraction and obtain the t The unbiased spatiotemporal characteristics of a historical period are obtained by: The learnable confounding factor prototype matrix and the regularized hierarchical matrix are applied with a cross attention mechanism to obtain the first t The confusion probability of the target prediction area in the historical time period; According to the backdoor adjustment method, use the t The confusion probability of the target prediction area in each historical time period obtains the unbiased causal characteristics of each sub-region and performs splicing operations to obtain the t Unbiased spatiotemporal characteristics of historical time periods; Step S6: t Unbiased spatiotemporal features of historical time periods as input to dynamic causal learners C t , get the t The causal transfer matrix of a historical period includes the following specific steps: Step S61: Get t Dynamically enhance the feature matrix for each historical period and Dynamically enhance the feature matrix for each historical time period, Indicates the time interval; Indicates a time interval; Step S62: Based on t Dynamically enhance the feature matrix for each historical period and Dynamically enhance the feature matrix for each historical time period and obtain the t The strength of the causal effect in each sub-region in a historical period; Step S63: t The causal effect intensity of each sub-region in the historical time period is standardized to obtain t The causal transmission matrix of each sub-region in a historical period; Step S64: Based on t The causal transfer matrix of each sub-region in the historical time period is obtained t The causal transmission matrix of historical time periods; Step S7: t The causal transfer matrix of historical time periods is input into the causal propagation module D t , generating t Causally enhanced spatiotemporal representation of historical time periods , the specific steps include: Step S71: Determine t output of a causal transfer module for a historical time period; the causal transfer module includes a causal transfer mechanism; Step S72: Get t The spatial proximity graph of each historical period is integrated into the t The causal transmission mechanism of historical time periods is obtained t Update the causal transmission mechanism one for each historical period; Step S73, obtain the t Interactive regional maps for historical time periods and incorporated into t The causal transmission mechanism of historical time periods is obtained t Update the causal transmission mechanism 2 for each historical period; Step S74: Based on t The output of the causal transfer module for the historical time period, t Update the causal transmission mechanism for historical time periods I and II t Update the causal transmission mechanism for each historical period to generate the t Causally enhanced spatiotemporal representation of historical time periods; Step S8: t Causally enhanced spatiotemporal representation of historical time periods Mapped to the vehicle flow domain, generating t Traffic flow forecast value for a historical period; Step S9: Determination t Is it greater than or equal to T , T Represents the total historical moment. If yes, we get the final urban traffic data prediction model. If no, let t = t +1, return to step S3; Step S10: Obtain the traffic flow prediction value of the target area in the current time period based on the final urban traffic data prediction model.
2. The urban traffic data prediction method based on causal classification debiasing according to claim 1 is characterized in that: The traffic flow data refers to the traffic flow of various transportation tools.
3. The urban traffic data prediction method based on causal classification debiasing according to claim 1 is characterized in that: In step S1, the specific steps of standardizing the urban traffic data set to obtain the urban traffic data set of each sub-region include: The target prediction area is divided into multiple sub-areas; the traffic flow data of each sub-area in each historical time period is obtained, and statistics and analysis are performed to obtain the urban traffic data set of each sub-area.
4. The urban traffic data prediction method based on causal classification debiasing according to claim 1 is characterized in that: The urban traffic data prediction model described in step S2 includes a potential confounding factor estimator, a causal debiaser, a dynamic causal learner and a causal propagation module.
5. The urban traffic data prediction method based on causal classification debiasing according to claim 1 is characterized in that: The said t The expression of the causal enhanced spatiotemporal representation of a historical period is: in, For the t causally enhanced spatiotemporal representation of historical time periods, For the t The output of the causal transfer module for each historical time period, To update the causal transmission mechanism 2, To update the causal transmission mechanism 1, Indicated in The adjacency matrix of the spatial proximity graph between regions in historical time periods, H t Indicated in An unbiased spatiotemporal representation of historical time periods, It is in Regional interaction matrix for a historical period.
Citation Information
Patent Citations
Urban traffic prediction method and system based on spatio-temporal data flow fusion analysis
CN111179592A
Urban traffic data prediction method based on spatiotemporal causal prediction of continuous learning
CN116740949B
Trajectory prediction method and system for traffic participants and storage medium
CN117636625A
Urban spatio-temporal data prediction method based on hybrid perception and causal depolarization
CN116307293A
Track prediction method under scene fusion based on space-time structure causal model
CN117933397A