Multifaceted traffic flow distribution estimation method based on high-order graph attention gan
By using a multi-level traffic flow distribution estimation method based on high-order graph attention GAN, the shortcomings of existing traffic prediction methods in non-Gaussian distribution and multi-level modeling are addressed, achieving accurate estimation and consistent prediction of traffic flow, thus improving prediction accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF MINING & TECH
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-16
AI Technical Summary
Existing traffic condition prediction methods struggle to capture nonlinear dynamic changes, reflect traffic condition uncertainties, and lack multi-level joint modeling, leading to inconsistencies in predictions and biases in the Gaussian assumption, thus failing to effectively estimate traffic flow distribution in complex urban road networks.
A multi-layer traffic flow distribution estimation method based on high-order graph attention GAN is adopted. By constructing a high-order adjacency matrix and an inter-layer correlation matrix, adversarial training is performed by combining a generator and a discriminator to learn a non-Gaussian probability distribution and capture high-order spatiotemporal dependencies, thus ensuring consistency between micro-, meso-, and macro-level data.
It achieves accurate estimation of the complex non-Gaussian probability distribution of traffic flow at three levels: road segment, node, and region, improving prediction accuracy and uncertainty quantification capabilities, and significantly enhancing robustness and multi-level consistency under data shortage.
Smart Images

Figure CN122223959A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation systems technology, and in particular to a multi-layered traffic flow distribution estimation method based on high-order graph attention (GAN). Background Technology
[0002] With the acceleration of global urbanization and the continuous expansion of city scale, the number of motor vehicles has exploded, and urban transportation networks are facing unprecedented congestion pressure. Traffic congestion not only significantly reduces urban operational efficiency and increases logistics and resident travel costs, but also brings about problems such as energy consumption and exhaust emissions, becoming a key bottleneck restricting sustainable urban development. Against this backdrop, Intelligent Transportation Systems (ITS) have emerged, and Traffic State Estimation (TSE), as the core foundation of ITS, provides accurate information such as flow rate, speed, and density, which is an important prerequisite for formulating strategies such as traffic light timing optimization, route guidance, congestion pricing, and emergency response.
[0003] Current mainstream traffic condition prediction methods have significant limitations. Early parametric statistical models (such as ARIMA and Kalman filtering) rely on the assumption of linear or stationary data, making it difficult to capture nonlinear dynamic changes during peak hours and under sudden events. Traditional machine learning methods (such as K-nearest neighbors and support vector regression) have improved in nonlinear processing, but feature engineering is complex and generalization ability is limited when dealing with high-dimensional spatiotemporal data. Even the deep learning models that have become mainstream in recent years (such as LSTM and GCN) still produce deterministic results in essence, failing to reflect the uncertainty of traffic conditions caused by random factors such as weather, accidents, and large-scale events.
[0004] Existing probability distribution prediction methods, like spatiotemporal dependency modeling, suffer from significant drawbacks. Some probabilistic prediction methods assume that traffic flow follows a Gaussian distribution, an assumption that is unreasonable in complex urban road networks. Traffic data often exhibits non-Gaussian characteristics such as skewness, heavy tails, and multimodality. Forcing a fit can lead to biased estimates of extreme event probabilities, misleading control decisions. In terms of spatiotemporal modeling, mainstream graph convolutional networks are limited by first-order adjacency matrices, only able to aggregate local neighbor information, making it difficult to capture the lag effects of higher-order distant nodes, and prone to oversmoothing. Furthermore, existing research often focuses on single levels at the road segment, node, or region level, lacking multi-level joint modeling, resulting in inconsistencies between micro-predictions and macro-observations, thus disrupting the physical consistency of the traffic system. In summary, a unified framework is urgently needed that can learn non-Gaussian complex probability distributions, capture higher-order spatiotemporal dependencies, and ensure consistency across multiple levels of data. Summary of the Invention
[0005] The purpose of this invention is to provide a multi-layered traffic flow distribution estimation method based on high-order graph attention GAN, which can learn complex non-Gaussian probability distributions through a parameter-free method, effectively capture high-order spatiotemporal dependencies, and ensure data consistency across micro, meso, and macro levels.
[0006] To achieve the above objectives, this invention provides a multi-layered traffic flow distribution estimation method based on high-order graph attention GAN, comprising the following steps: S1. Define the entity set of the traffic network at three levels: road segment, node, and region; construct the high-order adjacency matrix based on physical connection within each level, and the inter-level association matrix describing the road segment-node convergence relationship and the node-region affiliation relationship; obtain the historical traffic flow data and corresponding time condition labels of the three levels. S2. Construct a generator with random noise and time conditions as input and road segment layer traffic as output; the generator adopts the graph attention Transformer architecture, and introduces the high-order adjacency matrix of the road segment layer as topological constraint in the attention calculation process; S3. Construct discriminators corresponding to three levels: road segment, node, and region. Each discriminator adopts a graph attention Transformer architecture based on the high-order adjacency matrix of the corresponding level. S4. Train the generator and discriminator using historical traffic flow data and time condition labels: Aggregate the road segment layer traffic output by the generator into node layer and region layer traffic data through the inter-layer correlation matrix; input the generated road segment layer traffic data and node and region layer traffic data into the corresponding discriminator, and simultaneously input the real road segment, node, and region layer traffic data and corresponding time condition labels into the corresponding discriminator; perform adversarial joint optimization of the generator and discriminator based on the Wasserstein GAN with GradientPenalty (WGAN-GP) objective function; S5. Input the target time conditions into the trained generator, generate multiple sets of traffic flow data through multiple sampling, and form a probability distribution estimate of traffic flow; for traffic state inference under incomplete data, when data is missing, use the generator to complete the data based on existing observation data and historical time conditions.
[0007] Preferably, the entity sets at the three levels of road segment, node, and region in step S1 are defined as: Road segment set Node set Region set ,in, The total number of road segments. The total number of nodes. Total number of regions; The higher-order adjacency matrix is adjacency matrix Based on elements in the transportation network and Shortest path distance between Will adjacency matrix Defined as: ; in, It is a positive integer greater than 1; Inter-layer correlation matrix includes node-road segment correlation matrix Region-node association matrix Node-Road Segment Association Matrix elements On the road section Inflow node The value is 1 if the condition is met, and 0 otherwise; Region-Node Indication Matrix elements At the node Located in the region The value is 1 if the time is within the specified range, and 0 otherwise. Time condition labels include time. Corresponding hour tags and date type tags .
[0008] Preferably, the calculation of aggregation through the inter-layer association matrix in step S4 is as follows: Generated node layer traffic ; Generated regional layer traffic ; in, The segment layer flow output by the generator.
[0009] Preferably, step S2 specifically includes: S21, From the standard normal distribution Medium-sampled random noise vector By searching the pre-constructed time period embedding matrix and date type embedding matrix, the embedding vector corresponding to the time condition label is obtained. and The random noise vector is concatenated with the time-conditional embedding vector, and then a linear transformation is performed to form the initial road segment feature tensor. ; S22, Generator contains The multi-headed graph mask attention Transformer blocks are connected in sequence, for the first layer... layer: S221, Input features Linear mapping to multiple sets of queries ,key Value vector The output of each attention head is calculated using the following formula: ; in, For road segment layer The topological mask matrix constructed from the adjacency matrix of order K is used for pairs of entities that are not adjacent in order K. The mask value is negative infinity, otherwise it is 0. This represents the dimension of each head. For feature dimension, The number of subspaces; S222: The outputs of multiple attention heads are spliced and linearly fused, and then processed by residual connection and layer normalization. S223. Input the processed features into a feedforward neural network module. The module uses Gaussian error linear units as activation functions and performs residual connections and layer normalization again, outputting the features of this layer. ; S23. Map the features output by the last Transformer block through a convolutional layer with a 1×1 kernel to generate the road segment layer traffic. .
[0010] Preferably, the spatial entity corresponding to the discriminator in step S3 introduces a learnable spatial location code, which is added to the input flow features and then input into the graph attention layer.
[0011] Preferably, at least the road segment discriminator also includes an auxiliary classification module for predicting time condition labels based on the input traffic data.
[0012] Preferably, in step S4, the total loss function of the discriminator The weighted sum of losses is used to determine the losses at three levels: road segment, node, and region. ; in, , , The discriminator losses are categorized into three levels: road segment, node, and region. , These are the weighting coefficients.
[0013] Preferably, the loss for any discriminator layer includes the following components: Combat losses This is used to distinguish between real and generated data; Gradient penalty term The gradient norm is used to constrain the discriminator. Classification loss It is used to measure the classification error of the discriminator on real data time labels.
[0014] Preferably, the generator loss function in step S4 The goal is to deceive all three levels of discriminators and ensure that the temporal features of the generated data can be correctly identified. The generator loss function... Represented as: ; in, , , These represent the negative values of the expected scores of the generated data on the road segment, node, and region discriminators, respectively. This represents the classification error of the discriminator on the generated data time labels. These are the weighting coefficients.
[0015] Therefore, this invention employs the aforementioned multi-layered traffic flow distribution estimation method based on higher-order graph attention (GAN), overcoming the deterministic limitations and Gaussian assumption deficiencies of traditional traffic forecasting. It achieves, for the first time, accurate estimation of the complex non-Gaussian probability distribution of traffic flow across three layers: road segments, nodes, and regions. By capturing long-distance spatial dependencies through higher-order graph attention and utilizing hard constraints on the correlation matrix to ensure multi-layered physical consistency, it significantly improves prediction accuracy, uncertainty quantification capabilities, and robust inference performance under data shortage conditions.
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0017] Figure 1 This is a flowchart of a method according to an embodiment of the present invention; Figure 2 This is an integrated network architecture diagram of the GAT-WGAN model in an embodiment of the present invention; Figure 3 This is a detailed internal structure diagram of the generator in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the principle of the multi-head graph attention mechanism in an embodiment of the present invention; Figure 5 This is a detailed internal structure diagram of the discriminator in an embodiment of the present invention; Figure 6 This is a graph showing the convergence curves of the generator and discriminator loss functions during model training in an embodiment of the present invention, as well as the trend of JS divergence decreasing with the number of iterations. Figure 7 This is a comparison chart of the probability distribution curve generated by the model and the actual distribution curve under different data missing rates in embodiments of the present invention. Detailed Implementation
[0018] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0019] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] Example like Figure 1 As shown, the multi-layered traffic flow distribution estimation method based on high-order graph attention GAN includes the following steps: S1 defines the set of entities at three levels: road segments, nodes, and regions in a transportation network. Road segment collection ,in This represents the total number of road segments.
[0021] Node set ,in This represents the total number of nodes.
[0022] Region set ,in This represents the total number of regions.
[0023] Time point set It covers the whole year or a specific research period.
[0024] Variable definition: : The segment flow vector at any given time.
[0025] : The node flow vector at time t.
[0026] : The regional flow vector at any given time.
[0027] : The hour label for the moment.
[0028] : Date type label for the time (e.g., weekday / non-weekday).
[0029] To describe the spatial topology between elements, we construct high-order adjacency matrices based on physical connections within each level, as well as inter-layer association matrices describing road segment-node convergence relationships and node-region affiliation relationships. 1st order adjacency matrix: In the original transportation network, the degree between connected elements is... The degree between unconnected elements is considered to be 1, while the degree between unconnected elements is considered to be 0. The adjacency matrices of each layer are shown below: Road segment adjacency matrix .
[0030] Node adjacency matrix .
[0031] Region adjacency matrix .
[0032] Higher-order adjacency matrix: If element and The minimum distance between them is less than or equal to Then the element Treat as an element of Order adjacency means that elements and exist In a hierarchical adjacency traffic graph network, all nodes are interconnected. adjacency matrix Defined as: ; in, For positive integers greater than 1, this invention introduces... (like This allows the model to directly aggregate neighbor information within the 3rd order range, capturing a wider range of spatial correlations.
[0033] Inter-layer correlation matrix: Node-Road Segment Association Matrix : Used to describe the convergence relationship of flow towards nodes on a road segment. If the road segment Inflow node ,but (Two nodes are connected by road segments, which are directed road segments. When a flow of traffic enters a node along a direction on a road segment, the directed road segment is considered to be associated with this node. The flow of traffic to a node is defined by the flow of traffic from these road segments entering the node.) Region-node association matrix : Used to describe the relationship of the region to which a node belongs. If a node Located in the region Inside, then .
[0034] S2. Construct a generator that takes random noise and time conditions as input and road segment layer flow as output. Figure 3 A detailed internal structure diagram of the generator is provided, illustrating the connections between the input embedding layer, multi-layer graph attention Transformer blocks, residual connections, and the output layer; the generator The task is to establish a mapping ,in It is a noise vector. It is a time condition vector (time attribute). This refers to the generated traffic flow at the road segment level. The generator network is entirely based on the Transformer architecture, abandoning traditional recurrent neural networks to improve parallel computing efficiency and long-distance feature capture capabilities. A high-order adjacency matrix of the road segment level is introduced as a topological constraint during the attention calculation process. Generator network design includes: Input embedding layer (embedding layer): The generator's input consists of two parts: Random noise From the standard normal distribution The latent variables sampled in the middle are used to introduce randomness and simulate the uncertainty of traffic conditions.
[0035] Temporal conditional embedding: Divide the 24 hours of a day into discrete time slots and construct a time slot embedding matrix. .
[0036] Construct a date embedding matrix based on date type (weekday / weekend). .
[0037] According to the current time The corresponding vector is obtained by looking up the table. and .
[0038] Feature concatenation: The noise vector is concatenated with the temporal embedding vector, and then mapped to the road segment feature dimension through a linear layer. To form the initial feature tensor .
[0039] For the Layer: Multi-headed Graph Attention Transformer Layer (Multi-headed Graph Attention Layer): This is the core module of the generator, which achieves deep fusion of high-order spatial features of the road network by introducing graph structure inductive bias. This layer mainly consists of a multi-head graph mask attention mechanism and a feedforward neural network (FFN). For the ... Layer Transformer block: Linear mapping and multi-head splitting: First, input features (in, Represents the set of real numbers. For the number of road segments, (For feature dimensions) are mapped to a learnable weight matrix. In 3 different subspaces. For the 1st One attention point ( ),like Figure 4 : Query: ; Key: ; Value: ,in , These are the dimensions of each head; Introducing a graph attention mechanism using higher-order topological masks: Within each subspace, the model computes attention scores between nodes. Unlike the standard Transformer, this method introduces a higher-order adjacency matrix mask. To limit the scope of information aggregation: ; If the road section and The topological distance between them is greater than The order, then when ;otherwise Through this mask, the model is forced to focus on its traffic flow correlation when calculating the traffic flow correlation of road segments. Traffic flow changes within the order neighborhood enable inductive bias in graph structures.
[0040] Multi-head feature fusion: Will The outputs of the multiple heads are concatenated and integrated through a linear mapping layer to ensure that road features of different flow directions and levels captured by the multiple heads can interact. ; in, Then, residual connections and layer normalization (LayerNorm) are performed: ; Feedforward neural networks: To enhance the nonlinear expressive power of the model, a position-by-position feedforward transformation is performed on the output of the attention layer.
[0041] First layer (dimensionality increase): Using a linear mapping to increase the dimension from... Expand to .
[0042] Activation function: Use the GELU (Gaussian Error Linear Unit) activation function, whose formula is as follows: Compared to ReLU, it provides a smoother gradient.
[0043] Second layer (dimensionality reduction): reducing the dimension from... Map back .
[0044] Mathematical expression: ; Finally, output the result via residual connection: ; Traffic generation and aggregation: After processing through multiple Transformer layers, it passes through a convolutional layer. The network structure maps feature dimensions to a single flow value as follows: The number of input channels is the feature dimension. The number of output channels is 1, which means that a single flow value is generated.
[0045] A 1×1 convolution kernel with a stride of 1, without edge padding.
[0046] Obtain the generated road segment flow : ; ; Subsequently, the node and region layer traffic is calculated using a predefined correlation matrix: ; ; In this way, the generator only needs to output the lowest level road segment data to obtain the traffic status of the entire layer through deterministic transformation.
[0047] S3. Construct discriminators corresponding to three levels: road segment, node, and region. Figure 5 A detailed internal structure diagram of the discriminator is provided, showing a dual-output structure including a true / false discrimination head and an auxiliary classification head for time label prediction: Road segment discriminator Input traffic flow of the road segment Using the road segment adjacency matrix Perform graph attention calculation.
[0048] Node discriminator Input node traffic Using the node adjacency matrix Perform the calculation.
[0049] Region discriminator Input area traffic Using the region adjacency matrix Perform the calculation.
[0050] Each discriminator employs a graph attention Transformer architecture based on a corresponding high-order adjacency matrix, including: Feature embedding: Using linear layers to map one-dimensional traffic data into high-dimensional features.
[0051] Location Encoding: Since each node in a transportation network has a fixed spatial location, a learnable spatial location encoding is introduced to enhance the model's perception of geographical distribution. This encoding is defined as a one-dimensional learnable tensor (dimension 1). ),in The step size of the spatial sequence. The location encoding is initialized randomly using a standard normal distribution and then added element-wise to the linearly embedded traffic features via residual connections. In this way, the discriminator can identify the topological order of traffic flow data in the spatial dimension, thereby more accurately distinguishing the spatial consistency differences between generated and actual traffic flow.
[0052] Graph attention layer: The structure is similar to the generator, but it uses the adjacency matrix corresponding to each layer.
[0053] Discriminant head (predictive head): True or False: Output a scalar score representing the confidence level that the input data is true.
[0054] Auxiliary classification (especially road segment discriminator): Add a classification head to predict the time label (time period and weekday) to which the input data belongs.
[0055] Design intent: By forcing the discriminator to recognize time attributes, a significant classification loss will occur if the "morning rush hour" data generated by the generator is misclassified as "off-peak" by the discriminator. This, in turn, forces the traffic flow generated by the generator to possess distinct characteristics that conform to specific time patterns.
[0056] S4. Train the generator and discriminator using historical traffic flow data and time condition labels: Aggregate the segment-level traffic flow output by the generator into node-level and region-level traffic flow data through the inter-layer correlation matrix; input the generated segment-level traffic flow data, as well as the node and region-level traffic flow data, into the corresponding discriminator respectively, and simultaneously input the real segment, node, and region-level traffic flow data and corresponding time condition labels into the corresponding discriminator. Based on the Wasserstein GAN with GradientPenalty (WGAN-GP) objective function, perform adversarial joint optimization of the generator and discriminator to solve the problem of GAN training non-convergence. Figure 2 It demonstrates how the generator generates road segment traffic by embedding random noise and time-conditional labels, derives node and regional traffic through the correlation matrix, and how the three-level discriminators distinguish between true and false data and provide feedback for each level.
[0057] Total loss of the discriminator It consists of three parts: road segment layer loss Node layer loss and regional layer loss : ; Road segment layer discriminator loss For example, it includes the following items: Adversarial loss: Maximize the score on the real data and minimize the score on the generated data.
[0058] ; Gradient penalty term: The discriminator is constrained to satisfy the 1-Lipschitz continuity condition.
[0059] ; in, These are points randomly sampled on the line connecting the real data and the generated data.
[0060] Classification loss: The time-label classification error of real data.
[0061] ; The goal of the generator is to fool all three levels of discriminators and ensure that the temporal features of the generated data can be correctly identified. Generator loss function. The expression is: ; in, 、 、 These represent the negative values of the expected scores of the generated data on the road segment, node, and region discriminators, respectively. These are the weighting coefficients. This represents the classification error of the discriminator in the generated data time labels. By minimizing this term, the generator learns to inject the correct time pattern into the generated traffic data.
[0062] S5. Input the target time conditions into the trained generator, generate multiple sets of traffic flow data through multiple sampling, and form a probability distribution estimate of traffic flow; for traffic state inference under incomplete data, when data is missing, use the generator to complete the data based on existing observation data and historical time conditions.
[0063] Example 1 This embodiment uses publicly available data from PeMS in California, USA, which is recognized globally in the transportation field.
[0064] Data source: California Department of Transportation Performance Measurement System (PeMS).
[0065] Network Overview: Subnetworks in California's Regions 4 and 7 were selected, comprising 4,828 sensors. After screening, 298 sensors with high data quality and continuous location were retained as the road segment layer research objects, involving 48 major nodes and 4 administrative regions.
[0066] Data characteristics: Traffic data for the entire year of 2018 was selected. The original data was sampled at 5-minute intervals, and this experiment aggregated it into hourly traffic data to match medium- and long-term planning needs.
[0067] Missing data simulation: To test robustness, some sensor data was randomly masked in the test set, and the missing rate gradient was set to 10%, 20%, 40%, and 60%.
[0068] Model parameter settings and training environment: This embodiment is implemented using the Python language and the PyTorch deep learning framework. The experimental hardware environment is a high-performance workstation equipped with an NVIDIA GeForce RTX 3090 (24GB VRAM).
[0069] Network hyperparameters: Generator: Transformer with 5 layers, feature embedding dimension The number of bullish heads is 50. The value is 5, and the hidden layer dimension of the feedforward network is 200.
[0070] Discriminators: The road segment discriminator has 4 layers and a feature dimension of 60; the node discriminator has 3 layers and a feature dimension of 40; and the region discriminator has 3 layers and a feature dimension of 40.
[0071] Graph attention parameter: order of the higher-order adjacency matrix Comparative experiments show The effect is best when the dropout rate is 0.5 (to prevent overfitting).
[0072] Training parameters: Optimizer: Adam optimizer. Learning rate: generator. Discriminator Momentum parameter: Loss weights: gradient penalty coefficients Node / Region Discriminative Loss Weights Classification loss weights Iteration settings: Batch size: 32. Total training epochs: 300. Discriminator / generator update ratio. The ratio is 5:1.
[0073] Evaluation indicators: To quantify the difference between the generated distribution and the true distribution, the following statistical indicators are used: Wasserstein distance (WS): A measure of the "bulldozer distance" between two probability distributions, which effectively reflects the differences in the geometry of the distributions.
[0074] ; Jensen-Shannon divergence (JS): A symmetric index that measures the similarity between two probability distributions. The smaller the value, the better.
[0075] ; Statistical error metrics, including: mean absolute percentage error (GAP-M), standard deviation absolute percentage error (GAP-SD), and quantile error (50th and 75th quantiles, MAPE): assess the accuracy of the fit to the distribution shape.
[0076] Prediction Results and Analysis: The performance of the model was compared when using adjacency matrices of orders 1 to 5, as shown in Table 1.
[0077] Table 1 Performance comparison of GAT-WGAN under different graph order settings
[0078] Results analysis: As shown in Table 1, as the graph order increases from 1 to 3, all indicators at all levels show significant improvement. However, when the graph order reaches 4 and 5, the evaluation effect of indicators at each level decreases.
[0079] At the road segment level: the WS distance decreased from 11.192 for order 1 to 9.908 for order 3, and the JS divergence error decreased from 0.117 to 0.103. This directly demonstrates that introducing higher-order neighbor information can effectively help the model capture spatial correlations over long distances. For example, a order 3 neighborhood may cover the upstream intersection of a congested road segment, and the introduction of this information allows the model to more accurately predict traffic fluctuations in the current road segment. Then, as the order increases from order 3 to order 5, the WS distance and JS divergence begin to increase again. This suggests that when there are too many traffic flows in the road segments of interest, various complex factors may interfere with the estimation of road segment traffic, especially sudden traffic events occurring between multiple road segments.
[0080] At the macro level (nodes and regions): the improvement is even more significant. The JS divergence of region flow under adjacency matrices from order 1 to order 3 decreased from 0.081 to 0.043, almost halving. Figure 6 This indicates that the multi-layered joint training mechanism, supported by a high-order graph structure, can better coordinate the consistency between the micro and macro levels. Similarly, as the order continues to increase, the error also begins to gradually increase.
[0081] Robustness testing: addressing missing data.
[0082] The performance of the model under different data missing rates was tested, as shown in Table 2.
[0083] Table 2 Model performance under different data integrity conditions
[0084] Results analysis: such as Figure 7 As the data missing rate increased, the model performance declined to some extent, with the JS divergence increasing from 0.153 to 0.233.
[0085] However, it is worth noting that with a 40% missing rate (i.e., only 60% of the data is available), the average error (GAP-M) of the segment traffic is only 4.382%, and the JS divergence of 0.210 is still within an acceptable range.
[0086] By observing the generated probability density curves, even with a high missing rate, the distribution curves generated by GAT-WGAN can still cover the main peak regions of the real distribution. This indicates that the model does not simply memorize data, but rather learns the inherent topological relationships and dynamic laws of the transportation network, thus enabling it to "infer" the state of missing nodes using the spatial information of non-missing nodes.
[0087] To demonstrate the advancement of this invention, GAT-WGAN was compared with 10 benchmark models, including traditional statistical models (ND, GMM) and deep generative models (GAN, CGAN, ACGAN, DDPM, Info-GAN, etc.).
[0088] Table 3 Comparison of traffic flow distribution estimation errors of each model on the test set
[0089] Comparison conclusion: Outperforming statistical models: The ND model had the largest error (WS=364.63), confirming that the simple Gaussian distribution assumption completely fails in complex traffic flows. Although GMM improved performance through mixed distributions, it still failed to capture deep spatiotemporal features.
[0090] Superior to other GAN variants: While GAN and CGAN perform reasonably well in WS distance, they are significantly higher than this invention in quantile error (50th, 75th), indicating that they are not as good as GAT-WGAN in fitting the details of the distribution (such as peak position and tail shape).
[0091] Superior to Diffusion model: DDPM is one of the most advanced generative models, but in this task, GAT-WGAN’s JS divergence (0.143) is better than DDPM’s (0.154), and its inference speed is faster (GAN is a single-step generation, while Diffusion requires multiple steps of denoising).
[0092] Optimal overall performance: This invention achieved optimal values among all listed metrics. This fully demonstrates that combining Graph Attention Transformer with WGAN-GP and introducing multi-level consistency constraints is currently the best technical approach for solving the traffic flow probability prediction problem.
[0093] Therefore, this invention adopts the above-mentioned multi-layer traffic flow distribution estimation method based on high-order graph attention GAN, and achieves three core technological breakthroughs through the GAT-WGAN model.
[0094] First, it accurately learns the non-Gaussian distribution of traffic flow, abandoning the traditional Gaussian assumption. It significantly outperforms statistical models such as GMM in terms of indicators such as Wasserstein distance and JS divergence, truly reflecting complex traffic flow characteristics such as multi-peak and skewed distribution, and providing support for risk warning.
[0095] Secondly, it efficiently captures high-order spatial dependencies. After introducing a third-order adjacency matrix, the WS distance of road segment flow is significantly reduced, the GAP-M error is reduced, and the long-distance traffic wave propagation effect is successfully captured.
[0096] Third, it ensures data consistency across multiple levels by reducing regional traffic flow JS divergence through hard constraints on the correlation matrix and supervision by a multi-layer discriminator, achieving logical self-consistency across micro, meso, and macro levels. Simultaneously, the model maintains low error even with a 40%-60% data missing rate, demonstrating outstanding robustness and superior overall performance compared to 10 benchmark models, providing a reliable solution for traffic state estimation.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A multi-layered traffic flow distribution estimation method based on high-order graph attention GAN, characterized in that, Includes the following steps: S1. Define the entity set of the traffic network at three levels: road segment, node, and region; construct the high-order adjacency matrix based on physical connection within each level, and the inter-level association matrix describing the road segment-node convergence relationship and the node-region affiliation relationship; obtain the historical traffic flow data and corresponding time condition labels of the three levels. S2. Construct a generator that takes random noise and time conditions as input and road segment level flow as output; The generator adopts a graph attention Transformer architecture, which introduces a high-order adjacency matrix of the road segment layer as a topological constraint during the attention calculation process; S3. Construct discriminators corresponding to three levels: road segment, node, and region. Each discriminator adopts a graph attention Transformer architecture based on the high-order adjacency matrix of the corresponding level. S4. Train the generator and discriminator using historical traffic flow data and time condition labels: aggregate the road segment layer traffic output by the generator into node layer and regional layer traffic data through the inter-layer correlation matrix. The generated traffic data of road segments, nodes, and regions are input into the corresponding discriminators, and the real traffic data of road segments, nodes, and regions, along with the corresponding time condition labels, are input into the corresponding discriminators. The generator and discriminator are jointly optimized adversarially based on the Wasserstein GAN with Gradient Penalty objective function. S5. Input the target time conditions into the trained generator, generate multiple sets of traffic flow data through multiple sampling, and form a probability distribution estimate of traffic flow; for traffic state inference under incomplete data, when data is missing, use the generator to complete the data based on existing observation data and historical time conditions.
2. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, In step S1, the entity sets at the three levels of road segment, node, and region are defined as: Road segment set Node set Region set ,in, The total number of road segments. The total number of nodes. Total number of regions; The higher-order adjacency matrix is adjacency matrix Based on elements in the transportation network and Shortest path distance between Will adjacency matrix Defined as: ; in, It is a positive integer greater than 1; Inter-layer correlation matrix includes node-road segment correlation matrix Region-node association matrix Node-Road Segment Association Matrix elements On the road section Inflow node The value is 1 if the condition is met, and 0 otherwise; Region-Node Indication Matrix elements At the node Located in the region The value is 1 if the time is within the specified range, and 0 otherwise. Time condition labels include time. Corresponding hour tags and date type tags .
3. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 2, characterized in that, The calculation of aggregation through the inter-layer association matrix in step S4 is as follows: Generated node layer traffic ; Generated regional layer traffic ; in, The segment layer flow output by the generator.
4. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, Step S2 specifically includes: S21, From the standard normal distribution Medium-sampled random noise vector By searching the pre-constructed time period embedding matrix and date type embedding matrix, the embedding vector corresponding to the time condition label is obtained. and The random noise vector is concatenated with the time-conditional embedding vector, and then a linear transformation is performed to form the initial road segment feature tensor. ; S22, Generator contains The multi-headed graph mask attention Transformer blocks are connected in sequence, for the first layer... layer: S221, Input features Linear mapping to multiple sets of queries ,key Value vector The output of each attention head is calculated using the following formula: ; in, For road segment layer The topological mask matrix constructed from the adjacency matrix of order X, for in Non-adjacent pairs of entities within the same order. The mask value is negative infinity, otherwise it is 0. This represents the dimension of each head. For feature dimension, The number of subspaces; Indicator key Transpose of; S222: The outputs of multiple attention heads are spliced and linearly fused, and then processed by residual connection and layer normalization. S223. Input the processed features into a feedforward neural network module. The module uses Gaussian error linear units as activation functions and performs residual connections and layer normalization again, outputting the features of this layer. ; S23. Map the features output by the last Transformer block through a convolutional layer with a 1×1 kernel to generate the road segment layer traffic. .
5. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, In step S3, the spatial entity corresponding to the discriminator is introduced with a learnable spatial location code. The location code is added to the input flow feature and then input into the graph attention layer.
6. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, The road segment discriminator also includes an auxiliary classification module for predicting time condition labels based on the input traffic data.
7. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, The total loss function of the discriminator in step S4 The weighted sum of the losses at the three levels—road segment, node, and region—is calculated using the following formula: ; in, , , The discriminator losses are categorized into three levels: road segment, node, and region. , These are the weighting coefficients.
8. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 7, characterized in that, The loss for any discriminator layer includes: Combat losses This is used to distinguish between real and generated data; Gradient penalty term , used to constrain the gradient norm of the discriminator; Classification loss It is used to measure the classification error of the discriminator on real data time labels.
9. The multi-layered traffic flow distribution estimation method based on high-order graph attention GAN according to claim 1, characterized in that, Generator loss function in step S4 The goal is to deceive all three levels of discriminators and ensure that the temporal features of the generated data can be correctly identified. The generator loss function... Represented as: ; in, , , These represent the negative values of the expected scores of the generated data on the road segment, node, and region discriminators, respectively. This represents the classification error of the discriminator on the generated data time labels. These are the weighting coefficients.