A method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations
Through a method based on fused graph convolutional gated neural differential equations, the problems of data complexity and insufficient adaptability in existing traffic anomaly detection methods are solved, and efficient anomaly detection and accurate state reconstruction of traffic networks are achieved.
Patent Information
- Application Number
- CN202411374860.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Existing traffic anomaly detection methods lack real data support, find it difficult to capture the complex spatiotemporal dependencies of traffic data, and lack adaptability to different regions and time periods, resulting in deviations between detection results and actual conditions.
A method based on fused graph convolutional gated neural differential equations is adopted to construct a traffic speed reconstruction model through a spatiotemporal embedding enhancement module, a graph gated recurrent differential equation and a fused graph convolution unit, and adaptively generate anomaly thresholds to detect sporadic traffic anomalies.
It significantly improves the accuracy and adaptability of traffic anomaly detection, can better capture the spatiotemporal heterogeneity of traffic networks, and provide more accurate traffic status representation and anomaly judgment.
Smart Images

Figure CN119152682B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation, and proposes a method for detecting sporadic traffic anomalies based on a fusion graph convolutional gated neural differential equation to address the problem of sporadic traffic anomalies. Background Art
[0002] Occasional traffic anomalies, such as traffic accidents and natural disasters causing traffic disruptions, are sudden and atypical phenomena in urban transportation systems. Unlike regular congestion during rush hour, these events are often unpredictable and sudden. If not detected and addressed promptly, they can pose a serious threat to public safety and social stability. Early detection and identification of these anomalies is crucial for policymakers and government agencies, minimizing the harmful impact of accidents, ensuring public safety, and improving urban transportation efficiency.
[0003] Although the importance of sporadic traffic anomaly detection has been widely recognized and some progress has been made in research methods, several challenges and limitations remain. First, current research generally lacks the support of real-world traffic accident datasets. Due to the scarcity of traffic accident records, most studies rely on simulated virtual data for experiments, which cannot fully reflect the complexity and diversity of the real world. Simulated data often cannot reproduce the noise, outliers, and complex interactions found in real data, resulting in a certain deviation between experimental results and reality. Second, existing methods lack dynamic models that can accurately represent complex spatiotemporal patterns. Sporadic traffic anomalies are influenced by multiple spatial and temporal factors, and traffic patterns have significant spatiotemporal heterogeneity. Many methods use only simple sequence models for modeling, ignoring the complex interactions between time and space, and therefore fail to fully capture the dynamic changes in the traffic system. Finally, the evaluation criteria for anomaly detection are relatively simple. Many methods use a globally unified threshold to identify anomalies, failing to consider the potential differences in road network anomaly identification criteria across different regions and time periods, and lack adaptability to real-world scenarios.
[0004] Traffic speed data, as a key indicator of real-time traffic conditions, can directly indicate the occurrence of traffic anomalies. For example, sudden deceleration or stopping often signals unusual conditions such as traffic accidents, congestion, or road construction. By monitoring changes in traffic speed, anomalies can be quickly identified and located, enabling timely responses and resolution. Furthermore, normal traffic conditions exhibit specific speed patterns and regularities. By analyzing this speed data, a baseline for normal traffic conditions can be established. Significant deviations from these baselines can be identified as an anomaly. This pattern recognition-based traffic anomaly detection method is of great significance in practical applications.
[0005] Traditional traffic speed representation methods rely on time series analysis techniques, such as the autoregressive integrated moving average (ARIMA) model and the vector autoregressive model (VAR), as well as machine learning algorithms such as k-nearest neighbor (k-NN) and support vector machines (SVM). However, these methods often struggle to effectively capture the complex spatiotemporal dependencies inherent in traffic data. In recent years, deep learning methods have made significant progress in the spatiotemporal domain. Recurrent neural networks (RNNs), with their advantages in modeling temporal dynamics, have improved model representation performance, while convolutional neural networks (CNNs) excel in spatial feature extraction due to their long receptive fields. However, these models still fall short in capturing the spatial dependencies found in urban networked systems. To address this shortcoming, graph convolutional networks (GCNs) have been gradually introduced to spatiotemporal tasks and have been widely used in the traffic field. Although existing work has achieved significant performance breakthroughs, classic graph spatiotemporal neural networks still face limitations in the face of the significant heterogeneity and non-stationarity of abnormal traffic scenarios, making them difficult to achieve ideal results in such scenarios. Summary of the Invention
[0006] In response to the problems existing in the prior art, the present invention proposes a method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations.
[0007] This paper introduces a fusion graph gated recurrent unit based on neural differential equations to model the normal mode of the traffic system in the continuous time domain. Its main components are:
[0008] (1) The spatiotemporal embedding enhancement module is a novel spatiotemporal feature modeling method that assigns a unique representation to each spatiotemporal context through learnable embeddings. Unlike traditional methods that rely on additional contextual information such as points of interest, the spatiotemporal embedding enhancement module maps daily and weekly cycle information into dynamic temporal feature representations in the temporal dimension, maps node number information into dynamic spatial feature representations in the spatial dimension, and maps node velocity information at the same time step into dynamic node feature representations. By concatenating these three types of embedding features, the module can effectively identify and distinguish input contexts in both temporal and spatial dimensions, thereby achieving modeling of spatiotemporal heterogeneity.
[0009] (2) Graph-gated recurrent differential equations (GREDEs) are a feature extraction framework based on neural differential equations. They enable continuous modeling of spatiotemporal sequences through graph-gated recurrent units. Compared to traditional spatiotemporal feature extraction methods, GREDEs can model in the continuous time domain, more naturally capturing the dynamic changes in traffic systems. This allows for the simultaneous representation of spatiotemporal features, significantly improving the model's expressive power.
[0010] (3) The fused graph convolution gating unit combines dynamic graph convolution with dynamic hypergraph convolution to form a more comprehensive normal component reconstruction model for traffic speed. Dynamic graph convolution generates a node relationship matrix through data-driven processing, which better reflects the dynamic changes of nodes and edges and adapts to the time-varying interactive relationships in actual scenarios. Dynamic hypergraph convolution generates a dynamic hypergraph based on different temporal features and uses the information of node-related hyperedges to update node representations, thereby capturing more complex relationships in the traffic network. By fusing dynamic graph convolution with hypergraph convolution, the model can simultaneously capture low-order and high-order spatial relationships, providing more accurate traffic speed reconstruction.
[0011] Technical solution of the present invention
[0012] A method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations includes the following steps:
[0013] Step 1: Generate time embedding based on the time period information of the dataset, generate spatial embedding based on the spatial information of the node, and generate historical information embedding based on the neighboring historical information. After splicing, obtain heterogeneous node spatiotemporal embedding.
[0014] Step 2: Continuous gated recurrent units capture temporal features, and dynamic graph convolution and hypergraph convolution modules are used to collaboratively model spatiotemporal data. An exponential moving average algorithm is used to smooth hidden state updates, ensuring the model maintains high fitting accuracy while also possessing good generalization capabilities. Finally, the calculated spatiotemporal features are input into a reconstruction module to reconstruct normal traffic patterns.
[0015] Step 3: Calculate the anomaly score based on the original traffic data and the reconstruction results The anomaly scores are normalized. Based on the anomaly scores of the training set, a real-time traffic anomaly detection algorithm is used to adaptively determine the anomaly thresholds for different areas, and detect and mark occasional anomalies in the road network based on the thresholds.
[0016] Beneficial effects
[0017] This paper uses spatiotemporal embedding enhancement technology to highlight and capture the different spatiotemporal contextual features in the traffic network, thereby better demonstrating its spatiotemporal heterogeneity. It utilizes gated recurrent differential equations to model the continuity of spatiotemporal data. By integrating dynamic graph convolution and hypergraph convolution as a gating mechanism, it achieves synchronous modeling of spatiotemporal features, allowing for a more natural and accurate representation of changes in traffic network status. Furthermore, the present invention proposes a real-time traffic anomaly detection algorithm that adaptively determines the anomaly threshold for each node, significantly improving the adaptability and accuracy of anomaly detection results in practical application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1This is a system flow chart of the method for detecting non-incidental anomalies in a traffic network according to the present invention;
[0019] Figure 2 This is a schematic diagram of the model structure proposed in step 1 of the present invention;
[0020] Figure 3 A visual topological structure diagram of an urban traffic network according to an embodiment of the present invention;
[0021] Figure 4 The figure shows the fitting curves of the reconstructed value and the true value at the node 296 and the node 44 under normal conditions and occasional abnormal conditions in the embodiment of the present invention;
[0022] Figure 5 The heat map of the reconstructed value and the true value of the normal component under the formal situation and the occasional abnormal situation of the embodiment of the present invention;
[0023] Figure 6 The following is a distribution diagram of abnormality scores under normal and occasional abnormal conditions in an embodiment of the present invention;
[0024] Figure 7 This is a graph showing the abnormality score and abnormality threshold value at node 296 under normal conditions and occasional abnormal conditions according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The technical solution provided by this application will be further described below in conjunction with specific embodiments and accompanying drawings. The advantages and features of this application will become more apparent with reference to the following description.
[0026] A method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations, such as Figure 1 As shown, the following steps are included:
[0027] Step 1: Generate time embedding based on the time period information of the dataset, spatial embedding based on the spatial information of the node, and historical information embedding based on the neighboring historical information. After splicing, heterogeneous node spatiotemporal embedding is obtained.
[0028] Specifically, the dataset uses the public transportation speed dataset PEMS-BAY.
[0029] Step 1 The specific steps are as follows:
[0030] Step 1.1: Perform cubic spline interpolation on the original traffic data to transform the discrete time series data into continuous changes, and obtain the interpolation coefficients as a continuous path to control the direction of solving the neural differential equation.
[0031] Step 1.2: Generate spatiotemporal embedding based on the timestamp information of the dataset, and generate historical information embedding based on the uninterpolated original data. The specific operation formulas are shown in formulas (1)(2)(3)(4)(5).
[0032] (1)
[0033] (2)
[0034] (3)
[0035] (4)
[0036] (5)
[0037] in,
[0038] Timestamp information within a day Input the embedding layer to obtain a high-dimensional daily cycle feature vector;
[0039] Timestamp information within a week Input the embedding layer to obtain a high-dimensional periodic feature vector;
[0040] Number the node Input the embedding layer to obtain a high-dimensional node feature vector;
[0041] The historical data of the node for 12 time steps are concatenated and input into the two-dimensional convolutional layer to obtain a high-dimensional historical feature vector;
[0042] Represents the splicing operation, which splices the above feature vectors to obtain the complete heterogeneous spatiotemporal features.
[0043] and The daily cycle and the weekly cycle are embedded. It is the timestamp information within a day. It is the timestamp information within a week; is the node space embedding, It is the node index information, and the spatiotemporal embedding uses the standard embedding layer; It is the historical information embedding, It is the original historical traffic data in the dataset, and the historical information embedding is achieved using a two-dimensional convolutional layer; is the final spatiotemporal context embedding. is the batch size of the batch processing, is the number of traffic network detectors, is the dimension of the embedded features.
[0044] Step 2: Continuous gated recurrent units are used to capture temporal features, and dynamic graph convolution and hypergraph convolution modules are used to collaboratively model spatiotemporal data. An exponential moving average algorithm is used to smooth hidden state updates, ensuring the model maintains high fitting accuracy while also achieving good generalization. Finally, the calculated spatiotemporal features are input into a reconstruction module to reconstruct normal traffic patterns.
[0045] Design neural differential equation models (such as Figure 2 ), the core of the model consists of three sub-modules: the fusion graph gated recurrent unit module, the controlled smooth update module and the reconstruction module.
[0046] The embedded features are input into the fusion graph gated recurrent unit module, and spatial associations of different scales are modeled by the fusion of dynamic graph and dynamic hypergraph convolution. Temporal associations are modeled by the gated recurrent unit, and the spatiotemporal associations are captured at the same time to obtain the change in the hidden state.
[0047] The controlled smooth update module uses data interpolation coefficients as a continuous path and uses an exponential smoothing algorithm to update the change in the hidden state, thereby improving the robustness of the model.
[0048] The reconstruction module embeds the node spatial position and splices the spatiotemporal features, and obtains the final normal component reconstruction result through a two-dimensional convolution layer.
[0049] The specific processing is as follows:
[0050] Step 2.1: The spatiotemporal context embedding generated in step 1 is linearly mapped and input into the fusion graph gated recurrent differential equation to capture the temporal evolution characteristics.
[0051] The fusion graph gated loop differential equation is as follows:
[0052] (6)
[0053] (7)
[0054] in, is the initial state representation of the differential equation, is a fusion graph gated recurrent unit, is the coefficient after interpolation of the original data, is the historical time step of model reconstruction, which is set to 12 in this experiment. are the parameters that the model needs to update. is the final spatiotemporal feature representation.
[0055] The structure of the fusion graph gated recurrent unit is as follows:
[0056] (8)
[0057] (9)
[0058] (10)
[0059] (11)
[0060] in, It is a fusion graph convolution gating module that aggregates neighbor node features to update node features; is the sigmoid activation function, Control the fusion ratio of the current input and the previous state during the update to obtain the final state ), which has the following structure:
[0061] First, randomly initialize node embeddings , used to represent node adjacency information and generate an adaptive adjacency matrix , dynamically adjust the topology between nodes as follows:
[0062] (12)
[0063] in, are randomly initialized node embeddings, is the resulting adaptive adjacency matrix.
[0064] The Chebyshev polynomials are used to approximate the graph convolution operation to implement an efficient graph convolution network and aggregate the spatial adjacency features of the nodes, as follows:
[0065] (13)
[0066] in, is the hidden state of the input, is the weight pool, is the offset pool, It is the result of dynamic graph convolution.
[0067] An adaptive dynamic hypergraph is used to model high-order spatial associations between nodes. In particular, daily period embedding is used to make the hypergraph have temporal periodic characteristics, and hypergraph convolution operations are used to update node features to obtain the final spatial features.
[0068] (14)
[0069] (15)
[0070] (16)
[0071] in, It is a daily cycle embedding, is an adaptive temporal hypergraph, is the obtained dynamic hyperedge representation, is a hyperedge embedding, is the weight pool, is the offset pool, It is the node feature representation after dynamic hypergraph convolution, is the output of the final fusion graph gating module.
[0072] Step 2.2 Hidden state update When using the exponential smoothing algorithm, the model can flexibly adapt to different data characteristics by weighted combination of the current state and the previous state, which can capture changes and filter out noise.
[0073]
[0074] in, is the smoothing factor.
[0075] Step 2.3: Concatenate the spatiotemporal features represented by the differential equations with the node embeddings and pass them through a two-dimensional convolutional layer to obtain the final result.
[0076] (17)
[0077] in, is the spatial embedding of the node, is the spatiotemporal characteristic represented by the differential equation, is the model reconstruction result.
[0078] Step 3: Calculate the anomaly score based on the original traffic data and the reconstruction results The anomaly scores are normalized. Based on the anomaly scores of the training set, a real-time traffic anomaly detection algorithm is used to adaptively determine the anomaly thresholds for different areas, and detect and mark occasional anomalies in the road network based on the thresholds.
[0079] The anomaly score is the square of the difference between the reconstructed normal speed value and the actual speed, reflecting the degree of deviation of the speed value from the normal traffic pattern.
[0080] Step 3 is as follows:
[0081] Step 3.1 Calculate the square error between the original data and the reconstructed result, and normalize them to obtain the anomaly score.
[0082] (18)
[0083] (19)
[0084] in, is the reconstructed traffic data, It's real traffic data. is the median anomaly score, is the interquartile range of the anomaly score, It is the normalized anomaly score, that is, the final road network traffic node anomaly score of the present invention.
[0085] Step 3.2: Obtain a threshold value based on the real-time traffic anomaly detection algorithm, mark the data points with anomaly scores greater than the threshold as anomalies, and obtain the detection results.
[0086] The input to the real-time traffic anomaly detection algorithm is the anomaly score obtained from the training set in step 3.1. The algorithm then calculates a candidate threshold by adjusting parameters, filters out anomaly scores above this threshold, and expands their index (taking into account that anomalies typically persist for a period of time after they occur). The algorithm then calculates the percentage reduction in the mean and standard deviation after removing these scores, updates the optimal threshold, and finally returns the optimal anomaly threshold.
[0087] Specifically, the pseudo code of the real-time traffic anomaly detection algorithm is as follows:
[0088] ---------------------------------------------------------------------
[0089] Input training set anomaly score , is the total dataset anomaly score Subset of
[0090] Output abnormal threshold
[0091] initialization
[0092] , ; ;
[0093] For each In range In step length To loop:
[0094] Calculate candidate thresholds
[0095] Less than Anomaly score
[0096] Greater than or equal to The index of the anomaly score
[0097] Extensions Includes indexes within a certain range before and after it and removes duplicates
[0098] if Not null:
[0099] Calculation removal The percentage decrease in the mean after the data is
[0100] Calculation removal The percentage of standard deviation reduction after the data is averaged
[0101] Calculate the candidate threshold score +
[0102] If the score is greater than or equal to And the number of candidate outliers Less than the total data volume 50% of:
[0103]
[0104]
[0105] otherwise:
[0106] Will
[0107] return
[0108] ---------------------------------------------------------------------
[0109] The obtained threshold is applied to the test set, and nodes with anomaly scores greater than the threshold are marked as anomalies.
[0110] To demonstrate the ability of this example to accurately represent the spatiotemporal characteristics of traffic networks, experiments were conducted on the public PEMS-BAY dataset. This dataset contains 308 monitoring nodes (numbered 1-308) and includes traffic data from March 2018 to February 2019, collected every 5 minutes. Furthermore, based on accident reports published in the corresponding area during the corresponding period, the distance between the accident site and the node was calculated. A valid threshold range of 1 km was set. If the distance between the two nodes was within the valid range, the data for the corresponding period at the node was marked as an anomaly, thus obtaining outlier information in real-world scenarios.
[0111] Since traffic anomalies have obvious temporal and spatial heterogeneity, in order to prove the robustness of the speed reconstruction of the present invention in different time and space, different road network nodes were tested at different times. Nodes 296 and 44 were selected as test nodes, where Node 296 is a regional internal road network node and Node 44 is a regional transportation hub node. The fitting curves of the reconstruction results and the true values of the speed normal component reconstruction model proposed in the present invention under normal conditions and accident scenarios are shown as follows: Figure 4 The horizontal axis represents time, from 00:00 to 24:00, and the vertical axis represents the speed values measured by the monitor. The left figure shows the true and reconstructed speed values for node 296, and the right figure shows the true and reconstructed speed values for node 44. The gray area corresponds to the time period when the accident occurred.
[0112] To further visualize the reconstruction effect of the present invention, Figure 5 Heat maps of the reconstructed and true values under normal and accident conditions are plotted, where grayscale represents the speed value.
[0113] To further illustrate the effectiveness of selecting anomaly scores as the criterion for determining occasional anomalies, Figure 6 It shows the ratio of abnormal scores of abnormal data points and normal data points to the total amount of their respective data, indicating the distribution difference.
[0114] To illustrate the difference between abnormal scores under normal conditions and accidental accident scenarios, and to further clarify the scientific validity of the score as a judgment standard, Figure 7 It shows the anomaly score of node 296 for one day and the anomaly threshold of that point.
[0115] In addition, to demonstrate the superiority of the present invention over other velocity modeling methods, a velocity reconstruction comparison experiment was conducted on the public dataset PEMS-BAYS using the latest and well-known models. The experimental results show that the proposed model outperforms similar models in terms of mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE), as shown in Table 1.
[0116] Table 1 Comparison of speed reconstruction results with well-known models
[0117]
[0118] As can be seen from Table 1, compared with the current mainstream methods, the reconstruction performance of the present invention has achieved the best in various indicators, whether in the short-term or long-term reconstruction scenarios. Among them, STSGCN[1] effectively captures complex local spatiotemporal correlations through a spatiotemporal synchronous modeling mechanism, and uses multiple modules for different time periods to effectively capture the heterogeneity in the local spatiotemporal graph; AGCRN[2] uses an adaptive graph convolutional network to dynamically learn the topological structure of the traffic network, and uses a recurrent neural network to capture time dependencies; simST[3] uses spatiotemporal embedding and splicing of spatial adjacent node features for feature representation, and can achieve excellent reconstruction performance through a simple fully connected layer; STGNCDE[4] uses neural network parameterized control differential equations to more accurately capture continuous time dynamics, can handle irregular sampling and multi-scale time series data, and provide more flexible and accurate modeling capabilities in traffic speed reconstruction. The traffic normal component representation model proposed in this invention is designed and introduces spatiotemporal embedding enhancement, graph gated recurrent units, dynamic fusion graph convolution, etc., combining the advantages of neural differential equations and graph neural networks to perform simultaneous spatiotemporal modeling, which significantly improves the model's ability to represent the spatiotemporal characteristics of traffic. At the same time, it has good generalization ability and robustness, and achieves the optimal results in reconstruction scenarios with different time steps.
[0119] In addition, to prove the accuracy of the present invention for traffic anomaly detection, the normal component reconstruction results and true values of different models were selected for comparative experiments on anomaly detection. The experimental results show that the detection accuracy (Accuracy), recall rate (Recall), weighted F1 score (F1) and area under the curve (AUC) indicators of the invention are better than those of similar models, as shown in Table 2
[0120] Table 2 Comparison of anomaly detection results with well-known models
[0121]
[0122] References are as follows:
[0123] [1]Song C, Lin Y, Guo S, et al. Spatial-Temporal Synchronous GraphConvolutional Networks: A New Framework for Spatial-Temporal Network DataForecasting[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2020, 34(01):914-921.
[0124] [2] Bai L, Yao L, Li C, et al. Adaptive graph convolutional recurrent network for traffic forecasting[J]. Advances in neural information processing systems, 2020, 33: 17804-17815.
[0125] [3] Liu X, Liang Y, Huang C, et al. SimST: A GNN-Free Spatio-TemporalLearning Framework for Traffic Forecasting[J].2023
[0126] [4] Choi J, Choi H, Hwang J, et al. Graph neural controlled differential equations for traffic forecasting[C] / / Proceedings of the AAAIconference on artificial intelligence. 2022, 36(6): 6367-6374.
[0127] Innovation
[0128] This paper proposes a method for detecting sporadic anomalies in urban road networks based on a fused graph convolutional gated neural differential equation. Its innovations are as follows:
[0129] (1) A method for reconstructing normal traffic speed in a road network based on a fused graph convolutional gated neural differential equation is proposed. Aiming at the inaccuracy of existing traffic speed modeling methods in representing spatiotemporal features, this paper utilizes the powerful representation capability of neural differential equations to transform the traffic speed feature representation into a numerical solution problem of ordinary differential equations. This method can not only handle irregular data but also has high memory efficiency. The differential equations are solved through a graph recurrent gated unit. The gating mechanism enables the model to selectively remember or forget past information, thereby more effectively processing the dependencies of time series data. In addition, during the training process, the model can adjust parameters faster, achieve convergence in a shorter time, and achieve better performance.
[0130] (2) Constructing a spatiotemporal information enhancement module and a fused graph convolution module to model the spatiotemporal heterogeneity of road network traffic. To address the problem that existing traffic feature representation methods ignore spatiotemporal heterogeneity, this paper introduces daily and weekly cycle embedding, node information embedding, and historical data embedding to obtain a unique spatiotemporal context representation. At the same time, to address the problem that existing methods ignore high-order relationships between nodes, this paper introduces fused graph convolution as a gating unit, uses dynamic graph convolution to extract real-time spatial associations between nodes, and extracts high-order relationships between nodes through hypergraph convolution, thereby more comprehensively capturing the complex spatiotemporal relationships in the traffic network.
[0131] (3) A traffic anomaly detection algorithm based on a road network traffic speed reconstruction and decomposition strategy is proposed. Based on the speed reconstruction results, this invention effectively addresses the difficulty of detecting anomalies due to the scarcity of accident data. A real-time traffic anomaly detection algorithm is proposed, which adaptively generates different anomaly thresholds for each region and performs anomaly judgment. Compared with using a unified anomaly threshold, this method fully considers the spatiotemporal heterogeneity of different regions and significantly improves the accuracy of anomaly detection results.
[0132] The above description is only a description of the preferred embodiments of the present application and does not limit the scope of the present application. Any changes or modifications made by any person skilled in the art based on the above disclosed technical content should be regarded as equivalent valid embodiments and fall within the scope of protection of the technical solution of the present application.
Claims
1. A method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations, characterized by: The following steps are involved: Step 1: Generate time embedding based on the time period information of the dataset, spatial embedding based on the spatial information of the node, and historical embedding based on the historical information of the neighboring nodes. After splicing, heterogeneous node spatiotemporal embedding is obtained; Step 2: Capture temporal features through continuous gated recurrent units, and use dynamic graph convolution and hypergraph convolution modules to achieve collaborative modeling of spatiotemporal data; An exponential sliding average algorithm is used to smooth the hidden state updates, ensuring that the model has good generalization capabilities while maintaining high fitting ability. Finally, the calculated spatiotemporal features are input into the reconstruction module to reconstruct the normal traffic pattern. Step 3: Calculate the anomaly score based on the original traffic data and the reconstruction results , and normalize the anomaly scores; based on the anomaly scores of the training set, a real-time traffic anomaly detection algorithm is used to adaptively determine the anomaly thresholds of different areas, and detect and mark occasional anomalies in the road network according to the anomaly thresholds; Step 2 specifically includes: Step 2.1: The spatiotemporal context embedding generated in step 1 is linearly mapped and input into the fusion graph gated recurrent differential equation to capture the temporal evolution characteristics; The fusion graph gated loop differential equation is as follows: (6) (7) in, is the initial state representation of the differential equation, is a fusion graph gated recurrent unit, is the coefficient after interpolation of the original data, is the historical time step of model reconstruction, are the parameters that the model needs to update. is the final spatiotemporal feature representation; The structure of the fusion graph gated recurrent unit is as follows: (8) (9) (10) (11) in, It is a fusion graph convolution gating module that aggregates neighbor node features to update node features; is the sigmoid activation function, Control the fusion ratio of the current input and the previous state during the update to obtain the final state ), whose structure is as follows: First, randomly initialize node embeddings , used to represent node adjacency information and generate an adaptive adjacency matrix , dynamically adjust the topology between nodes as follows: (12) in, are randomly initialized node embeddings, is the generated adaptive adjacency matrix; The Chebyshev polynomials are used to approximate the graph convolution operation to implement an efficient graph convolution network and aggregate the spatial adjacency features of the nodes, as follows: (13) in, is the hidden state of the input, is the weight pool, is the offset pool, is the result of dynamic graph convolution; Adaptive dynamic hypergraphs are used to model high-order spatial associations between nodes. In particular, daily period embedding is used to give the hypergraph temporal periodicity, and hypergraph convolution operations are used to update node features to obtain the final spatial features: (14) (15) (16) in, It is a daily cycle embedding, is an adaptive temporal hypergraph, is the obtained dynamic hyperedge representation, is a hyperedge embedding, is the weight pool, is the offset pool, It is the node feature representation after dynamic hypergraph convolution, is the output of the final fusion graph gating module; Step 2.2: Hidden state update When using exponential smoothing, the current state and the previous state are weighted to adapt to different data characteristics, which can capture changes and filter out noise: in, is the smoothing factor; Step 2.3: Concatenate the spatiotemporal features represented by the differential equation with the node embedding and pass them through a two-dimensional convolutional layer to obtain the final result: (17) in, is the spatial embedding of the node, is the spatiotemporal characteristic represented by the differential equation, is the model reconstruction result.
2. The method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations as claimed in claim 1, characterized in that: Step 1 The specific steps are as follows: Step 1.1: Perform cubic spline interpolation on the original traffic data to transform the discrete time series data into continuous changes. The interpolation coefficients are used as a continuous path to control the direction of solving the neural differential equation. Step 1.2: Generate spatiotemporal embeddings based on the timestamp information of the dataset, and generate historical information embeddings based on the uninterpolated original data; The specific operation formula is shown in formula (1)(2)(3)(4)(5): (1) (2) (3) (4) (5) in, Timestamp information within a day Input the embedding layer to obtain a high-dimensional daily cycle feature vector; Timestamp information within a week Input the embedding layer to obtain a high-dimensional periodic feature vector; Number the node Input the embedding layer to obtain a high-dimensional node feature vector; The historical data of the node for 12 time steps are concatenated and input into the two-dimensional convolutional layer to obtain a high-dimensional historical feature vector; represents the splicing operation, which splices the above feature vectors to obtain the complete heterogeneous spatiotemporal features; and The daily cycle and the weekly cycle are embedded. It is the timestamp information within a day. It is the timestamp information within a week; is the node space embedding, It is the node index information, and the spatiotemporal embedding uses the standard embedding layer; It is the historical information embedding, It is the original historical traffic data in the dataset, and the historical information embedding is achieved using a two-dimensional convolutional layer; is the final spatiotemporal context embedding; is the batch size of the batch processing, is the number of traffic network detectors, is the dimension of the embedded features.
3. The sporadic traffic anomaly detection method based on fused graph convolutional gated neural differential equations as claimed in claim 1 is characterized in that: Step 3 specifically includes: Step 3.1: Calculate the square error between the original data and the reconstructed result, and normalize it to get the anomaly score: (18) (19) in, is the reconstructed traffic data, It's real traffic data. is the median anomaly score, is the interquartile range of the anomaly score, is the normalized anomaly score, i.e., the final anomaly score of the road network traffic node; Step 3.2: Obtain an anomaly threshold based on the real-time traffic anomaly detection algorithm, mark the data points with an anomaly score greater than the anomaly threshold as anomalies, and obtain the detection results.
4. The method for detecting sporadic traffic anomalies based on fused graph convolutional gated neural differential equations as claimed in claim 3, characterized in that: The real-time traffic anomaly detection algorithm is specifically: Input the anomaly score obtained from the training set in step 3.1, calculate the candidate threshold by adjusting the parameters, filter out anomaly scores above the candidate threshold and expand their index, calculate the percentage reduction in the mean and standard deviation after removing these scores, update the optimal threshold, and finally return the obtained optimal anomaly threshold; The obtained anomaly threshold is applied to the test set, and nodes with anomaly scores greater than the anomaly threshold are marked as anomalies.
Citation Information
Patent Citations
Traffic prediction method based on multi-scale space-time fusion graph network
CN115240425A
DSTGCN-based traffic prediction method
CN115578852A