A method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference
By constructing a counterfactual graph attention network model and combining causal inference with spatiotemporal correlation, the accuracy and interpretability issues of traffic anomaly detection are solved, efficient detection and prediction of traffic network anomalies are achieved, and real-time response of traffic management is supported.
Patent Information
- Application Number
- CN202410295923.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-03-15
AI Technical Summary
Existing technologies make it difficult to effectively detect and analyze the spatiotemporal evolution of traffic anomalies. Traditional models lack interpretability and accuracy, making it difficult to use massive real-time data for large-scale road network analysis.
A method for analyzing the spatiotemporal evolution of abnormal traffic network situations that integrates causal inference is adopted, combined with a counterfactual graph attention network model. By identifying causal effects in traffic network data, a counterfactual graph attention network model is constructed, and spatiotemporal features are extracted and trained to improve detection accuracy and reliability.
It achieves high-precision and reliable detection of traffic anomalies, can monitor and predict the spatiotemporal evolution of abnormal situations in real time, and provide better traffic management support.
Smart Images

Figure CN118197047B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent traffic information processing, and more specifically to a method for spatiotemporal evolution of abnormal traffic network situations integrating causal inference. Background Art
[0002] Abnormal conditions that occur during traffic operations are collectively referred to as traffic incidents. Among various traffic issues, abnormal events such as traffic congestion occur most frequently, significantly impacting both travelers and social development. For individuals, encountering traffic incidents increases travel time and driving costs, reducing travel efficiency, travel experience, and overall well-being. For social development, these incidents can lead to productivity losses, increased economic burdens and social pressures, and environmental damage. Therefore, it is necessary to study the impact of abnormal events such as non-periodic traffic congestion and traffic accidents on road network traffic conditions and travelers, so as to develop targeted improvement measures.
[0003] Currently, in existing research, the main aspects of traffic anomaly event detection are as follows: (1) In order to reduce traffic congestion and other traffic anomalies, many scholars have proposed some methods based on traditional traffic models to conduct quantitative analysis of congestion propagation, such as the CTM model. (2) Based on massive real-time traffic big data, deep learning models such as BN and GCN are also used to simulate the traffic state propagation structure and reveal its hidden properties. (3) In order to further explore the causal relationship in the data and improve the interpretability of deep learning, domestic and foreign scholars have proposed a counterfactual reasoning algorithm framework to combine deep learning with causal inference.
[0004] However, existing research on traffic anomalies also has certain shortcomings: (1) In the era of big data, traditional algorithms and frameworks based on traffic models are difficult to meet current practical application needs. It is necessary to develop data-driven deep learning-based algorithms, but traditional deep learning models lack interpretability, resulting in low credibility in practical applications. (2) Traditional causal inference models and algorithms are difficult to support the analysis of large-scale road networks, and cannot take advantage of the advantages brought by massive real-time data, and it is difficult to improve the accuracy of the model. (3) There are few studies on deep causal models in the current transportation field, and most of them are used for traffic prediction models, while there is a large gap in the research on the spatiotemporal evolution of traffic anomalies.
[0005] Therefore, how to design a method for the spatiotemporal evolution of abnormal traffic network situations that integrates causal inference, construct a counterfactual graph attention network model, and improve the accuracy, reliability, and real-time performance of abnormal traffic network situation detection is an urgent problem that technical personnel in this field need to solve. Summary of the Invention
[0006] In view of this, the present invention provides a method for the spatiotemporal evolution of abnormal situations in traffic networks that integrates causal inference. This method combines causal inference and spatiotemporal correlation, and introduces a counterfactual graph attention network model. By identifying causal effects in traffic network data, it can better understand the causal relationship between events in the traffic system. When processing traffic network data, it can effectively capture the complex relationships and spatiotemporal characteristics between data, and has better effects in abnormal situation detection.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for analyzing the spatiotemporal evolution of abnormal traffic network situations that integrates causal inference, including:
[0009] Step 1: Obtain multi-source traffic network data, screen characteristic variables based on the spatiotemporal correlation and causal effects of the traffic network, and construct a data set;
[0010] Step 2: Based on the encoder and decoder structure, a counterfactual graph attention network model is constructed, and parameters of the counterfactual graph attention network model are set;
[0011] Step 3: Use the data set to train the counterfactual graph attention network model, input the traffic network data to be detected into the trained counterfactual graph attention network model, and obtain the abnormal situation detection and recognition results and spatiotemporal evolution of the traffic network.
[0012] Furthermore, in step 1, the characteristic variables include traffic state characteristics, time characteristics and abnormal event occurrence conditions;
[0013] The characteristic variable of input segment i is defined as:
[0014] H t (i) =[A t (i) ,X t (i) ]
[0015] Among them, A t (i) Indicates whether the road section i is intervened at time t and whether traffic abnormality occurs; X t (i) Represents the traffic speed characteristics and time characteristic variables of the road section;
[0016] The characteristic variables are subjected to Z-Score data standardization using the formula:
[0017]
[0018] Where x represents the data observation value, represents the data mean, σ ′ Represents standard deviation.
[0019] Furthermore, the step 1 further includes calculating the adjacency distance value of each road segment based on a preset adjacency distance threshold to obtain an adjacency matrix;
[0020] The formula used is:
[0021]
[0022] Where d represents the actual distance of the road segment, and Threshold represents the preset adjacent distance threshold.
[0023] Furthermore, in step 2, the encoder structure includes: a spatial feature extraction module and a temporal feature extraction module; the decoder structure includes a first decoder and a second decoder.
[0024] Furthermore, the structure of the spatial feature extraction module is a graph attention network, which introduces an attention coefficient to obtain new output features after integrating neighborhood information, specifically including:
[0025] Calculate the attention coefficient e between any node i and its neighbor node j ij , the formula used is:
[0026] e ij =μ([Wh i ||Wh j ])
[0027] Where j = 0, 1, ..., n-1, h i 、h j represents the input feature vector of nodes i and j, W represents the shared weight parameter, [·||·] represents the concatenation of the changed features, and μ represents the transformation that maps the high-dimensional feature to a real number;
[0028] The attention coefficient e between any node i and its neighbor node j ij Perform activation processing and normalization to obtain the attention coefficient α ij , the formula used is:
[0029]
[0030] Among them, Softmax and LeakyReLU represent activation functions, and exp() represents the xth power of the base e of the natural logarithm;
[0031] Based on the attention coefficient α ij , obtain the new output feature o after fusing neighborhood information i , using the formula:
[0032]
[0033] Among them, σ represents the nonlinear activation function, α ij represents the attention coefficient, W represents the shared weight parameter, h j Represents the input feature vector of node j.
[0034] Furthermore, the temporal feature extraction module includes a gated recurrent unit, which includes two core gates: a reset gate and an update gate. The internal processing process is as follows:
[0035] r t =σ(W r *[X t ,h t-1 ]+b r )
[0036] z t =σ(W z *[X t ,h t-1 ]+b z )
[0037] c t =tanh(W c [X t ,(r t *h t-1 )]+b c )
[0038] h t =z t *h t-1 +(1-z t )*c t
[0039] Among them, r t Represents the reset gate that controls the degree of ignoring state information at the previous moment, z t represents the update gate that controls the amount of state information before entering the current state, c t Represents the information at the current time t after the reset gate is processed, h t 、h t-1 Represents the hidden state at the current time t and time t-1, X t is the characteristic matrix of the input module at time t, tanh is the hyperbolic tangent activation function, W r 、W z 、W c Represent the corresponding weight matrix, b r 、b z 、b c They represent the corresponding biases respectively.
[0040] Furthermore, the network structure of the first decoder includes: an intervention processing classifier Ga, a speed result estimation network Gy and a balance representation network Φ;
[0041] The intervention classifier Ga is added with a gradient reversal layer, which can maximize the loss of the intervention classifier Ga and eliminate the deviation caused by time-varying confounding factors through domain adversarial training, specifically including:
[0042] Definition G a (Φ(H t ),θ a ) indicates that the parameter is θ a The intervention processing classifier is, then for time t, the intervention loss of road section i is for:
[0043]
[0044] Definition G y (Φ(H t ),θ y ) indicates that the parameter is θ y The speed result estimation network, then for time t, the result loss of road section i is for:
[0045]
[0046] Among them, LF and LCF are two complementary loss functions, LF represents factual loss, and LCF represents counterfactual loss;
[0047] The total loss at time slice t is:
[0048]
[0049] where the hyperparameter λ controls the trade-off between intervention classification and outcome estimation;
[0050] The probability of an abnormality occurring at time t is:
[0051]
[0052] Among them, Y t represents the traffic speed at time t, and They represent the traffic speed at which the model predicts a traffic anomaly will occur and the speed at which the model predicts no traffic anomaly will occur, respectively.
[0053] Furthermore, the second decoder adopts a fully connected network structure to identify abnormal traffic network conditions after a preset period of time.
[0054] Furthermore, in step three, the counterfactual graph attention network model is trained using the dataset, including:
[0055] The causal effect of the counterfactual graph attention network model is evaluated by the conditional average causal effect, and the formula is:
[0056] CATE=E[Y(T=1)|X=n]-E[Y(T=0)|X=n]
[0057] Among them, CATE represents the causal effect of the counterfactual graph attention network model, E[] represents the mathematical expectation of the experimental group, Y(T=1)|X=n represents the result of the intervention group with X=n in the sample set, and Y(T=0)|X=n represents the result of the control group with X=n in the sample set.
[0058] Furthermore, in the step three, the counterfactual graph attention network model is trained using the data set, and the accuracy of the counterfactual graph attention network model is evaluated using the root mean square error and mean absolute error.
[0059] It can be seen from the above technical solution that compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0060] (1) This method achieves model method innovation by integrating causal inference theory into deep learning model algorithms. It not only enhances the performance of deep models in processing complex traffic data, but also improves traditional causal inference models and improves their robustness, accuracy and interpretability.
[0061] (2) Based on the causal inference theory, by setting up time feature and space feature extraction modules to analyze the duration and spatial scope of abnormal situations, and comprehensively analyzing the spatiotemporal evolution laws, the internal mechanism of the spatiotemporal evolution of traffic anomalies is analyzed, and the degree of impact of traffic anomalies on traffic conditions and the probability of anomalies occurring are quantified.
[0062] (3) Combined with the model results, this study constructed a traffic anomaly risk rating model. Taking into account three aspects, namely, the road grade score, the speed reduction ratio before and after the traffic anomaly, and the road network evaluation index, the risk score of each road section was obtained and its traffic conditions were rated. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0064] Figure 1 A flow chart of a method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference provided by an embodiment of the present invention;
[0065] Figure 2 A diagram showing the structure of a counterfactual graph attention network according to an embodiment of the present invention;
[0066] Figure 3 A diagram showing the structure of a counterfactual graph attention network encoder according to an embodiment of the present invention;
[0067] Figure 4 A diagram showing the structure of the first decoder of the counterfactual graph attention network provided by an embodiment of the present invention;
[0068] Figure 5 A schematic diagram of a traffic network topology provided by an embodiment of the present invention;
[0069] Figure 6 A schematic diagram comparing ablation experiments with and without the GRL model provided in an embodiment of the present invention;
[0070] Figure 7 A schematic diagram showing a comparison of ablation experiments with and without dual-head output provided by an embodiment of the present invention;
[0071] Figure 8 A schematic diagram of the spatiotemporal evolution of traffic anomaly from time t0 to time t4 provided by an embodiment of the present invention;
[0072] Figure 9 A schematic diagram of the spatiotemporal evolution of abnormal traffic conditions from time t5 to time t10 provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0074] Example 1:
[0075] like Figure 1 As shown, this embodiment provides a method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference, including:
[0076] Step 1: Obtain multi-source traffic network data, screen characteristic variables based on the spatiotemporal correlation and causal effects of the traffic network, and construct a data set;
[0077] Step 2: Figure 2As shown in the figure, based on the encoder and decoder structure, a counterfactual graph attention network model is constructed, and the parameters of the counterfactual graph attention network model are set; the parameter setting includes: selecting network parameters, loss function, activation function, evaluation indicators, etc.
[0078] Step 3: Use the dataset to train the counterfactual graph attention network model, which aims to eliminate the influence of time-varying confounding factors in causal inference and obtain quantitative evaluation indicators of abnormal effects, thereby improving the robustness, scalability and training speed of the model.
[0079] The traffic network data to be detected is input into the trained counterfactual graph attention network model to obtain the abnormal situation detection and recognition results and spatiotemporal evolution of the traffic network.
[0080] This method combines causal inference and spatiotemporal correlation to construct a counterfactual graph attention network model, which can respond to changes in traffic network data in a timely manner and monitor and identify abnormal situations in real time. It improves the accuracy, reliability and real-time performance of abnormal situation detection in traffic networks, and provides better support and guarantee for the formulation and implementation of traffic management emergency response plans.
[0081] The following is a further detailed description of each of the above steps:
[0082] In step 1, the characteristic variables include traffic state characteristics, time characteristics and abnormal event occurrence;
[0083] The characteristic variable of input segment i is defined as:
[0084] H t (i) =[A t (i) ,X t (i) ]
[0085] Among them, A t (i) Indicates whether the intervention of road section i at time t causes traffic anomaly; X t (i) Represents the traffic speed characteristics and time characteristic variables of the road section;
[0086] In addition, the model adopts a potential outcome framework to explain the treatment of time-varying causal effects, defining Y[A t (i) ] is the potential outcome when the intervention occurs, and defines The evaluation metrics implemented for the model;
[0087] The characteristic variables are subjected to Z-Score data standardization using the formula:
[0088]
[0089] Where x represents the data observation value, represents the data mean, and σ′ represents the standard deviation.
[0090] In one embodiment, step 1 further includes calculating the adjacency distance value of each road segment based on a preset adjacency distance threshold to obtain an adjacency matrix;
[0091] The formula used is:
[0092]
[0093] Where d represents the actual distance of the road segment, and Threshold represents the preset adjacent distance threshold.
[0094] In step 2, the encoder structure includes: a spatial feature extraction module and a temporal feature extraction module; the decoder structure includes a first decoder and a second decoder.
[0095] like Figure 3 As shown in the figure, the encoder part of the model consists of a spatial feature extraction module and a temporal feature extraction module. By combining the GAT module in the spatial feature extraction module with the GRU module and the Attention module in the temporal feature extraction module, the encoder establishes a T-GAT model, which can simultaneously obtain the spatial characteristics of the road network and the temporal characteristics of traffic state changes.
[0096] In one embodiment, the structure of the spatial feature extraction module is a graph attention network. The graph attention network introduces an attention coefficient to obtain new output features after integrating neighborhood information, specifically including:
[0097] Calculate the attention coefficient e between any node i and its neighbor node j ij , the formula used is:
[0098] e ij =μ([Wh i ||Wh j ])
[0099] Where j = 0, 1, ..., n-1, h i 、h j represents the input feature vector of nodes i and j, W represents the shared weight parameter, [·||·] represents the concatenation of the changed features, and μ represents the transformation that maps the high-dimensional feature to a real number;
[0100] The attention coefficient e between any node i and its neighbor node j ij Perform activation processing and normalization to obtain the attention coefficient α ij , the formula used is:
[0101]
[0102] Based on the attention coefficient α ij , obtain the new output feature o after fusing neighborhood information i , using the formula:
[0103]
[0104] Among them, σ represents the nonlinear activation function, α ij represents the attention coefficient, W represents the shared weight parameter, h j Represents the input feature vector of node j.
[0105] In one embodiment, the temporal feature extraction module includes a gated recurrent unit. The gated recurrent unit includes two core gates: a reset gate and an update gate. The internal processing process is as follows:
[0106] r t =σ(W r *[X t ,h t-1 ]+b r )
[0107] z t =σ(W z *[X t ,h t-1 ]+b z )
[0108] c t =tanh(W c [X t ,(r t *h t-1 )]+b c )
[0109] h t =z t *h t-1 +(1-z t )*c t
[0110] Among them, r t Represents the reset gate that controls the degree of ignoring state information at the previous moment, z t represents the update gate that controls the amount of state information before entering the current state, c t Represents the information at the current time t after the reset gate is processed, h t 、h t-1 Represents the hidden state at the current time t and time t-1, W r 、W z 、W c Represent the corresponding weight matrix, br 、b z 、b c They represent the corresponding biases respectively.
[0111] In addition to the GRU module, the spatial feature extraction module also includes an Attention module. The Attention module shares similar structural principles with the spatial feature extraction module, differing primarily in that it is used to capture global trends in traffic conditions over time, enabling accurate identification and prediction of traffic conditions.
[0112] In one embodiment, the network structure of the first decoder includes: a Ga module, a Gy module and a balanced representation network (Φ);
[0113] like Figure 4 As shown, the Ga and Gy modules are trained separately to eliminate the influence of time-varying confounding factors to balance the data distribution in the representation network Φ. In addition, the Gy module implements a dual-head output to predict the traffic anomaly at the next moment. and no traffic anomalies traffic conditions.
[0114] The function of the Ga module is to realize the classification prediction of intervention, in which the gradient reversal layer (GRL) is added to maximize the loss of the intervention classifier Ga, and eliminate the deviation caused by time-varying confounding factors through domain adversarial training.
[0115] Specifically include:
[0116] Definition G a (Φ(H t ),θ a ) indicates that the parameter is θ a The intervention processing classifier is, then for time t, the intervention loss of road section i is for:
[0117]
[0118] Definition G y (Φ(H t ),θ y ) indicates that the parameter is θ y The speed result estimation network, then for time t, the result loss of road section i is for:
[0119]
[0120] Among them, LF and LCF are two complementary loss functions, LF represents factual loss, and LCF represents counterfactual loss;
[0121] In order to accurately estimate the traffic state results, the model goal is to maximize the intervention classification loss and minimize the result estimation loss. The total loss at time slice t is:
[0122]
[0123] where the hyperparameter λ controls the trade-off between intervention classification and outcome estimation;
[0124] The first decoder further analyzes the traffic status of the road network through the Ga module and the Gy module, and obtains the traffic speed at which traffic anomalies occur and the speed at which no traffic anomalies occur in the future time slice, and finally obtains the probability of anomaly occurrence at time t:
[0125] The probability of an abnormality occurring at time t is:
[0126]
[0127] In one embodiment, the second decoder uses a fully connected network structure to identify traffic network anomalies after a preset period of time. It can accurately grasp the temporal and spatial evolution of the anomaly, including its duration, propagation range, and pattern. It can determine the occurrence of network anomalies within the next hour and derive future trends in traffic anomalies.
[0128] In step 3, the counterfactual graph attention network model is trained using the dataset, including:
[0129] The causal effect of the counterfactual graph attention network model is evaluated by the conditional average causal effect, as follows:
[0130] CATE=E[Y(T=1)|X=n]-E[Y(T=0)|X=n]
[0131] Among them, CATE represents the causal effect of the counterfactual graph attention network model, Y(T=1)|X=n represents the result of the intervention group with X=n in the sample set, and Y(T=0)|X=n represents the result of the control group with X=n in the sample set.
[0132] In one embodiment, in step three, the counterfactual graph attention network model is trained using the dataset, further comprising: using root mean square error (RMSE) and mean absolute error (MAE) to evaluate the accuracy of the counterfactual graph attention network model.
[0133]
[0134] Among them, Y i Represents the actual results, represents the prediction result, and n is the number of samples.
[0135] This method combines causal inference and spatiotemporal correlation techniques. By identifying causal effects in traffic network data, it can better understand the causal relationship between events in the traffic system. It also introduces a counterfactual graph attention network model, which can effectively capture the complex relationships and spatiotemporal characteristics between data when processing traffic network data, improve the data representation ability and the model's reasoning ability, and has better results in abnormal situation detection.
[0136] In addition, by reasonably setting the parameters of the counterfactual graph attention network model and training the model with a large amount of traffic network data, the model has better generalization ability and adaptability, and can more accurately identify abnormal situations in the traffic network and predict its spatiotemporal evolution.
[0137] It can promptly respond to changes in traffic network data, monitor and identify abnormal situations in real time, and visually display the spatiotemporal evolution of abnormal situations, providing more intuitive and effective decision-making support for traffic management departments.
[0138] Example 2:
[0139] This example uses static road network data, traffic situation data, and traffic anomaly log data from the Beijing sub-venue of the 2022 Winter Olympics (i.e., the Olympic Sports Center) to further verify and promptly explain the spatiotemporal evolution method of traffic network anomaly situation in the above example.
[0140] The final data obtained after data preprocessing is shown in the following table:
[0141]
[0142] Finally, 213 eligible road sections were selected from the existing 2496 road sections as case road networks, such as Figure 5 As shown in the figure, road speed, intervention, time, and day of the week are selected as feature input models. The input and output step sizes used in this invention are both 12. The data after the time window slides is processed into the model input data format (8905, 213, 12, 4), where the four dimensions represent the data volume, number of road sections, number of time slices, and number of features, respectively.
[0143] Selecting a distance threshold of 50 meters, the resulting adjacency matrix is shown in the following table:
[0144] Segment ID 0 1 2 3 4 5 6 0 0.00 0.00 0.00 0.00 0.00 0.27 0.00 1 0.00 0.00 1.00 0.00 0.00 0.00 0.00 2 0.00 1.00 0.00 0.00 0.98 0.00 0.00 3 0.00 0.00 0.00 0.00 1.00 0.00 0.00 4 0.00 0.00 0.98 1.00 0.00 0.00 0.92 5 0.27 0.00 0.00 0.00 0.00 0.00 0.90 6 0.00 0.00 0.00 0.00 0.92 0.90 0.00
[0145] The dataset is divided into training, validation, and test sets according to a ratio of 6:2:2. The learning rate is set to 0.001, the batch_size is set to 32, and the Adam optimizer is used for optimization. The parameters and values of the remaining models are shown in the following table:
[0146]
[0147] Ablation experiments were conducted on two innovative features of GRL: the gradient reversal layer and the dual-head output. Comparative experiments were also conducted on two deep learning models and two causal inference models as baseline models to verify the accuracy and performance of the models.
[0148] like Figure 6 As shown in the figure, the RMSE and MAE values of the current model and the model without GRL change over the next five time slices. It can be seen that the model's prediction error gradually increases over time. Furthermore, GRL significantly improves the model's accuracy at each time slice. In particular, the accuracy is improved by approximately 20% in the first time slice.
[0149] like Figure 7 As shown in the figure, based on the evaluation results of the dual-head output and single-head output models, comparing the RMSE and MAE values of the two models over the next five time slices, it can be seen that the trend of the indicators in the time dimension continues to increase, which is consistent with the general trend. Furthermore, in each future time slice, the dual-head output has higher accuracy than the single-head output, with an accuracy improvement of approximately 22%. This fully demonstrates the rationality and effectiveness of this structural design.
[0150] Since this model integrates causal inference and deep learning methods, when selecting benchmark models, we selected representative models from the perspectives of causal inference and deep learning. The specific performance is shown in the following table:
[0151] Performance indicators A3TGCN GAT TARNet CRN CTGANet MAE 7.59 9.16 6.03 11.57 5.14 RMSE 10.10 12.36 8.97 14.69 7.45
[0152] like Figure 8-Figure 9 As shown in the figure, in order to focus on analyzing the occurrence of anomalies and the temporal and spatial evolution laws and to prove the effectiveness of the model, 1 hour of road section data was selected as input based on the traffic log data. The best model related parameters were obtained by model training, and the temporal and spatial attribute characteristics were input into the optimal model to obtain the evolution of the abnormal situation in the next hour, and the process of abnormal occurrence, evolution to the dissipation of the abnormal situation.
[0153] It can be seen that the traffic anomaly began on Section 1 and spread from east to west, with an overall trend toward the upstream section, consistent with general traffic patterns. Congestion peaked at t5, gradually dissipated from t6, and returned to normal at t9. This traffic anomaly lasted a total of 50 minutes. At the time of the traffic anomaly on each section, the calculated probability of occurrence exceeded 90%, demonstrating the rationality and practical significance of the model.
[0154] In addition, by calculating the causal effect index CATE, we analyzed the quantitative impact of the abnormalities at the abnormal starting node, Section 1, and the middle node, Section 8, and studied the spatiotemporal evolution of traffic anomalies from a causal perspective. The CATE values for Sections 1 and 8 are shown in the following table:
[0155]
[0156]
[0157] This model analyzes the propagation patterns of anomalies from a causal perspective, deriving the probability of anomaly occurrence and quantifying its impact on traffic conditions. Compared to traditional deep learning algorithms, this model improves the interpretability and credibility of its results. The results demonstrate that it combines the high accuracy of deep learning with the interpretability of causal inference, significantly reducing model error.
[0158] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. References to the same or similar parts between the various embodiments are sufficient. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For relevant parts, refer to the method description.
[0159] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference, characterized by: include: Step 1: Obtain multi-source traffic network data, based on the spatiotemporal correlation and causal effect of the traffic network, filter Feature variables, construct data sets; Step 2: Based on the encoder and decoder structures, a counterfactual graph attention network model is constructed, and parameters of the counterfactual graph attention network model are set; wherein the encoder structure includes: a spatial feature extraction module and a temporal feature extraction module; the decoder structure includes a first decoder and a second decoder; The structure of the spatial feature extraction module is a graph attention network. The graph attention network obtains new output features after integrating neighborhood information by introducing attention coefficients. Specifically, it includes: Calculate the attention coefficient e between any node i and its neighbor node j ij , the formula used is: e ij =μ([Wh i ||Wh j ]) Where j = 0, 1, ..., n-1, h i 、h j represents the input feature vector of nodes i and j, W represents the shared weight parameter, [·||·] represents the concatenation of the changed features, and μ represents the transformation that maps the high-dimensional feature to a real number; The attention coefficient e between any node i and its neighbor node j ij Perform activation processing and normalization to obtain the attention coefficient α ij , the formula used is: Among them, Softmax and LeakyReLU represent activation functions, and exp() represents the xth power of the base e of the natural logarithm; Based on the attention coefficient α ij , obtain the new output feature o after fusing neighborhood information i , using the formula: Among them, σ represents the nonlinear activation function, α ij represents the attention coefficient, W represents the shared weight parameter, h j represents the input feature vector of node j; The temporal feature extraction module includes a gated recurrent unit, which contains two core gates: a reset gate and an update gate. The internal processing process is as follows: r t =σ(W r *[X t ,h t-1 ]+b r ) z t =σ(W z *[X t ,h t-1 ]+b z ) c t =tanh(W c [X t ,(r t *h t-1 )]+b c ) h t =z t *h t-1 +(1-z t )*c t Among them, r t Represents the reset gate that controls the degree of ignoring state information at the previous moment, z t represents the update gate that controls the amount of state information before entering the current state, c t Represents the information at the current time t after the reset gate is processed, h t 、h t-1 Represents the hidden state at the current time t and time t-1, X t is the characteristic matrix of the input module at time t, tanh is the hyperbolic tangent activation function, W r 、W z 、W c Represent the corresponding weight matrix, b r 、b z 、b c They represent the corresponding biases respectively; The network structure of the first decoder includes: an intervention processing classifier Ga, a speed result estimation network Gy and a balance representation network Φ; The intervention classifier Ga is added with a gradient reversal layer, which can maximize the loss of the intervention classifier Ga and eliminate the deviation caused by time-varying confounding factors through domain adversarial training, specifically including: Definition G α (Φ(H t ),θ α ) indicates that the parameter is θ α The intervention processing classifier is, then for time t, the intervention loss of road section i is for: Definition G y (Φ(H t ),θ y ) represents the parameter θ y For the speed result estimation network, then for time t, the result loss of road section i for: in, represents the traffic speed of road section i at time t, L F and L CF are two complementary loss functions, L F Indicates actual loss, L CF represents the counterfactual loss; The total loss at time slice t is: where the hyperparameter λ controls the trade-off between intervention classification and outcome estimation; The probability of an abnormality occurring at time t is: Among them, Y t represents the traffic speed at time t, and They represent the traffic speed at which the model predicts a traffic anomaly will occur and the speed at which no traffic anomaly will occur, respectively; Step 3: Use the data set to train the counterfactual graph attention network model, input the traffic network data to be detected into the trained counterfactual graph attention network model, and obtain the abnormal situation detection and recognition results and spatiotemporal evolution of the traffic network.
2. The method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference according to claim 1 is characterized in that: In the step 1, the characteristic variables include traffic state characteristics, time characteristics and abnormal event occurrence; The characteristic variable of input segment i is defined as: in, Indicates whether traffic anomalies occur at the intervention of road section i at time t; Represents the traffic speed characteristics and time characteristic variables of the road section; The characteristic variables are subjected to Z-Score data standardization using the formula: Where x represents the data observation value, represents the data mean, σ ′ Represents standard deviation.
3. The method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference according to claim 1 is characterized in that: The step 1 further includes calculating the adjacency distance value of each road section based on a preset adjacency distance threshold to obtain an adjacency matrix; The formula used is: Where d represents the actual distance of the road segment, and Threshold represents the preset adjacent distance threshold.
4. The method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference according to claim 1 is characterized in that: The second decoder adopts a fully connected network structure to identify abnormal traffic network conditions after a preset period of time.
5. The method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference according to claim 1 is characterized in that: In the step three, the counterfactual graph attention network model is trained using the dataset, including: The causal effect of the counterfactual graph attention network model is evaluated by the conditional average causal effect, and the formula is: CATE=E[Y(T=1)|X=n]-E[Y(T=0)|X=n] Among them, CATE represents the causal effect of the counterfactual graph attention network model, E[] represents the mathematical expectation of the experimental group, Y(T=1)|X=n represents the result of the intervention group with X=n in the sample set, and Y(T=0)|X=n represents the result of the control group with X=n in the sample set.
6. The method for analyzing the spatiotemporal evolution of abnormal traffic network situations by integrating causal inference according to claim 1 is characterized in that: In the step three, the counterfactual graph attention network model is trained using the data set, and the method further includes: using the root mean square error and mean absolute error to evaluate the accuracy of the counterfactual graph attention network model.
Citation Information
Patent Citations
Traffic network data prediction method based on graph space-time self-encoding network
CN114565187A
Traffic state evolution prediction method and system based on Bayesian reasoning
CN117475620A