Traffic flow prediction method and system based on graph neural network and diffusion model

By combining graph neural network and diffusion model, using external condition information and multi-layer embedding technology, the limitations of existing traffic flow prediction methods in spatiotemporal interaction and external condition processing are solved, and more accurate and generalized traffic flow prediction is achieved.

CN120216864AActive Publication Date: 2025-06-27SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202510179972.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-06-27
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are difficult to effectively capture the complex dependence of spatiotemporal data, especially when dealing with fine-grained fusion of spatiotemporal interactions, and the impact of external conditions on traffic flow is not fully considered.

Method used

The traffic flow prediction method based on graph neural network and diffusion model is adopted, and the diffusion model is deeply integrated with spatial structure and temporal dynamic information, and the diffusion model is constructed and the hidden space-time representation is extracted through multi-layer embedding, and the backward denoising is carried out in combination with graph attention network to achieve accurate prediction of traffic flow.

Benefits of technology

Effectively capture the complex dependence of spatiotemporal data, enhance the accuracy and generalization ability of traffic flow prediction, better handle the impact of external conditions on traffic flow, and improve traffic management decision support capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216864A_ABST
    Figure CN120216864A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method and system based on a graph neural network and a diffusion model, and relates to the technical field of intelligent traffic, and the method comprises the steps: obtaining traffic flow time series data of a target region, and carrying out the preprocessing; constructing a diffusion model, gradually adding noise to the preprocessed traffic flow time series data by using forward diffusion, extracting hidden space-time representation through multilayer embedding by using external condition information in the diffusion model, and constructing a backward denoising network of the diffusion model based on a graph attention network, and taking the traffic flow time series data after noise addition as input, fusing the hidden space-time representation with spatial features obtained through graph convolution, and denoising the traffic flow time series data after noise addition in combination with multi-layer attention to obtain a traffic flow prediction result. According to the method, a traffic flow prediction framework combining the graph neural network and the conditional diffusion model is provided, and decision support is provided for traffic management through the accurately predicted traffic flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent transportation, and more specifically, to a traffic flow prediction method and system based on graph neural network and diffusion model. Background Art

[0002] In traffic flow prediction, the spatio-temporal characteristics of data are particularly complex. First of all, traffic flow changes over time, with obvious periodicity and trend, and is affected by factors such as different time periods of a day, day of the week, holidays, etc. Secondly, traffic flow also shows obvious spatial dependence, and the traffic flow and traffic states between different roads, sections, and intersections will affect each other. Therefore, how to effectively model and capture the spatio-temporal dependence of traffic datasets has become a core challenge in traffic flow prediction. Traditional spatio-temporal prediction methods are usually based on regression or state space models, and generally assume that time and space dependencies can be decoupled, and the time and space dimensions are modeled separately. Although such methods perform well in some simple prediction tasks, their performance gradually degrades for complex high-dimensional data, especially when the interaction between time and space becomes closer. The development of deep learning technology provides new solutions for spatio-temporal prediction. Graph Convolutional Network (GCN), with its advantages in modeling graph-structured data, is widely used in traffic flow prediction tasks. By using the adjacency matrix of the road network or the dynamic graph structure, GCN can effectively capture the spatial dependence between each node in the road network. However, these methods still face certain limitations when dealing with the fine-grained fusion of spatio-temporal interactions.

[0003] In recent years, diffusion models have been introduced into spatio-temporal prediction tasks and achieved good results. Diffusion models can effectively capture the complex distribution characteristics of spatio-temporal data through a step-by-step denoising generation process. For example, in traffic flow prediction, diffusion models can simulate the traffic flow changes at different time steps and different sections through a multi-step noise diffusion process to capture spatio-temporal dependence. However, existing generative models usually do not fully consider external conditions (such as holidays, weather changes, special events, etc.), which have an important impact on traffic flow changes. The lack of external conditions may limit the prediction ability and generalization ability of the model when facing the actual traffic environment. Therefore, how to integrate graph neural network and conditional diffusion model, and embed external conditions and their implicit relationships as a kind of knowledge into the model inference process to improve the accuracy and generalization ability of traffic flow prediction has become a key problem that needs to be solved urgently. Summary of the Invention

[0004] In order to solve the above technical problems, the present invention proposes a traffic flow prediction method and system based on graph neural network and diffusion model, which realizes accurate prediction of spatio-temporal sequences by deeply integrating spatial structure and time dynamic information, and enhances the accuracy of traffic flow prediction.

[0005] In the first aspect of the present invention, a traffic flow prediction method based on a graph neural network and a diffusion model is provided, including the following steps:

[0006] Obtain the traffic flow time-series data monitored by each time-series sensor in the target area within a preset time period, and preprocess the traffic flow time-series data;

[0007] Construct a diffusion model, and use forward diffusion to gradually add noise to the preprocessed traffic flow time-series data to make the traffic flow time-series data approach pure noise with a Gaussian distribution;

[0008] In the diffusion model, utilize external condition information to extract hidden spatio-temporal representations through multi-layer embedding, and embed the hidden spatio-temporal representations into the diffusion model;

[0009] Construct a backward denoising network of the diffusion model based on a graph attention network, take the noise-added traffic flow time-series data as input and convert it into a graph data format, fuse the hidden spatio-temporal representation corresponding to the external condition information with the spatial features obtained through graph convolution, and perform denoising on the noise-added traffic flow time-series data by combining multi-layer attention to obtain the traffic flow prediction result of the target area.

[0010] In this solution, obtaining the traffic flow time-series data monitored by each time-series sensor in the target area within a preset time period, and preprocessing the traffic flow time-series data specifically includes:

[0011] Obtain the traffic flow time-series data within a preset time period according to the time-series sensors preset in the target area, and perform missing value processing on the traffic flow time-series data by using linear interpolation;

[0012] Perform format normalization processing on the filled traffic flow time-series data, unify the time format and align the time steps, and for multiple data points that appear during the sampling process, adopt the method of mean aggregation to enhance the consistency of the traffic flow time-series data;

[0013] Finally, perform normalization processing on the formatted traffic flow time-series data to obtain the preprocessed traffic flow time-series data.

[0014] In this solution, constructing a diffusion model, and using forward diffusion to gradually add noise to the preprocessed traffic flow time-series data to make the traffic flow time-series data approach pure noise with a Gaussian distribution specifically includes:

[0015] Set hyperparameters to construct a diffusion model, and add Gaussian noise to each time step of the preprocessed traffic flow time-series data according to a preset noise ratio through a noise intensity scheduler;

[0016] As the time step increases, the original structure and features of the traffic flow time series data are gradually lost through noise accumulation, and the traffic flow time series data is converted into pure noise with a Gaussian distribution at the final time step.

[0017] In this solution, in the diffusion model, external condition information is used to extract hidden spatio-temporal representations through multi-layer embedding, and the hidden spatio-temporal representations are embedded into the diffusion model. Specifically:

[0018] A preliminary feature embedding layer, a periodic embedding layer, and a spatio-temporal adaptive embedding layer are constructed in the diffusion model. The preliminary feature embedding layer uses a fully connected layer to perform preliminary feature embedding representation on the preprocessed traffic flow time series data as input;

[0019] The periodic embedding layer represents seven days of a week and different time points in a day by setting a learnable embedding dictionary. According to the timestamp information of the traffic flow time series data, the corresponding embedding representation is extracted from the embedding dictionary, and the weekly cyclic feature and the daily cyclic feature are obtained according to the corresponding embedding representation, and the weekly cyclic feature and the daily cyclic feature are used to generate a periodic embedding representation;

[0020] The spatio-temporal adaptive embedding layer performs feature embedding by learning the spatio-temporal relationship features between different traffic flow time series data, shares the spatio-temporal relationship features for all traffic flow time series data, captures complex spatio-temporal dependencies across sequences, and generates spatio-temporal adaptive embedding representations;

[0021] The preliminary feature embedding, the periodic embedding, and the spatio-temporal adaptive embedding are concatenated to generate the final hidden spatio-temporal representation of the traffic flow time series data.

[0022] In this solution, a backward denoising network of the diffusion model is constructed based on the graph attention network. Specifically:

[0023] A backward denoising network is constructed based on the graph attention network. The noisy traffic flow time series data is input, and the noisy traffic flow time series data includes time series sensor node features and a time dimension. The input data is converted into a graph data format, the time series sensors are used as nodes, and the edge structure is set according to the spatial association between the time series sensors, and an adjacency matrix is constructed to represent the graph data;

[0024] The adjacency matrix is imported into the graph attention network, and weights of neighborhood nodes are dynamically assigned to each node through the self-attention mechanism to capture the non-uniform dependence relationship between nodes, and graph convolution operations are used to extract the spatial features of the nodes;

[0025] The hidden spatio-temporal representation extracted through multi-layer embedding in the diffusion model is read, and the hidden spatio-temporal representation is combined with the spatial features to strengthen the spatio-temporal dependence between nodes, and an updated feature matrix containing spatio-temporal information is obtained.

[0026] In this solution, in the backward denoising network, multi-layer attention is combined to denoise the noisy traffic flow time series data to obtain the traffic flow prediction result of the target area, specifically as follows:

[0027] Import the updated feature matrix containing spatio-temporal information into the time layer of the backward denoising network, set the information weights of different time steps through the multi-head self-attention mechanism, capture the time dependence between different time steps, and generate a feature matrix that enhances the time dependence;

[0028] Import the feature matrix with enhanced time dependence into the feature layer of the backward denoising network, measure the contribution of different features to traffic flow prediction through the multi-head self-attention mechanism, obtain the feature weight distribution, and obtain the feature matrix output by the feature layer according to the feature weight distribution;

[0029] Combine the feature matrix with external condition information through the gated activation module, and restore the original spatio-temporal structure of the traffic flow time series data through the fully connected layer in the regression layer to obtain the traffic flow prediction result of the target area.

[0030] In this solution, obtain the traffic flow prediction result of the target area at the preset time step and the signal timing plan of the current traffic lights in the target area, read the number of vehicles passing through per unit time through the real-time traffic flow data, and evaluate the traffic congestion degree according to the number of vehicles passing through per unit time;

[0031] Calculate the flow difference between the real-time traffic flow data of the target area and the traffic flow prediction result, generate the traffic characteristics of the target area based on the flow difference and the traffic congestion degree, and perform similarity retrieval in the historical timing instances according to the traffic characteristics;

[0032] Read the traffic flow change sequence and timing plan in the historical timing instance with the highest similarity, compare the trend of the real-time traffic flow data of the target area with the traffic flow change sequence, generate an adjustment coefficient according to the change trend deviation, and use the adjustment coefficient to correct the retrieved timing plan to generate the signal timing plan of the traffic lights in the target area.

[0033] The second aspect of the present invention provides a traffic flow prediction system based on a graph neural network and a diffusion model, and the system includes: a data preprocessing module, a forward diffusion module, a conditional generation module, a backward denoising module, and an application module;

[0034] The data preprocessing module is used to preprocess the traffic flow time series data monitored by each time series sensor in the target area within a preset time period;

[0035] The forward diffusion module is used to transform the preprocessed traffic flow time series data into pure noise with a Gaussian distribution;

[0036] The conditional generation module is used to integrate external conditional information through a multi-layer embedding method, extract the hidden spatio-temporal representation of the traffic flow time series data, and guide the generation of the denoising process;

[0037] The backward denoising module is used to capture the complex dependencies in the spatio-temporal sequence by combining graph convolution operations with attention mechanisms in the time and feature layers, and gradually restore the original spatio-temporal structure during the denoising process to achieve the prediction of the traffic flow in the target area;

[0038] The application module is used to dynamically adjust the signal timing plan of traffic lights according to real-time and predicted traffic flow data to adapt to the traffic flow demands of different sections in the target area.

[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0040] The present invention proposes a traffic flow prediction framework combining a graph neural network and a conditional diffusion model. Through the collaborative work of the conditional network and the denoising network modules, it effectively processes the complex dependencies in spatio-temporal data.

[0041] Through the graph attention network and the multi-layer attention mechanism, the model can effectively capture the complex dependencies in spatio-temporal data, and at the same time integrate external time conditions, enhance the accuracy of traffic flow data prediction, provide decision support for traffic management, optimize traffic signal control, route planning, emergency dispatching, etc., and improve the efficiency and intelligent level of the traffic system. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments or exemplifications of the present invention, the following will briefly introduce the drawings required for use in the embodiments or exemplifications. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the drawings shown.

[0043] Figure 1 Shows a flowchart of a traffic flow prediction method based on a graph neural network and a diffusion model;

[0044] Figure 2 Shows a flowchart of extracting hidden spatio-temporal representations through multi-layer embedding using external conditional information;

[0045] Figure 3 Shows a flowchart of achieving traffic flow prediction through denoising by a backward denoising network;

[0046] Figure 4A block diagram of a traffic flow prediction system based on a graph neural network and a diffusion model is shown. Detailed implementation manners

[0047] In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.

[0048] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention may be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.

[0049] Figure 1 A flowchart of a traffic flow prediction method based on a graph neural network and a diffusion model is shown.

[0050] As Figure 1 shown, in the first embodiment of the present invention, a traffic flow prediction method based on a graph neural network and a diffusion model is provided, including:

[0051] S102, obtaining traffic flow time series data monitored by each time series sensor in a target area within a preset time period, and preprocessing the traffic flow time series data;

[0052] S104, constructing a diffusion model, and gradually adding noise to the traffic flow time series data after preprocessing by forward diffusion to make the traffic flow time series data approach pure noise with a Gaussian distribution;

[0053] S106, in the diffusion model, using external condition information to extract hidden spatio-temporal representations through multi-layer embedding, and embedding the hidden spatio-temporal representations into the diffusion model;

[0054] S108, constructing a backward denoising network of the diffusion model based on a graph attention network, taking the noise-added traffic flow time series data as input and converting it into a graph data format, fusing the hidden spatio-temporal representation corresponding to the external condition information with the spatial features obtained through graph convolution, and denoising the noise-added traffic flow time series data by combining multi-layer attention to obtain the traffic flow prediction result of the target area.

[0055] It should be noted that the traffic flow time series data within a preset time period is obtained by a timing sensor preset for the target area, and linear interpolation is used to process the missing values in the traffic flow time series data to ensure the integrity and continuity of the data. Linear interpolation calculates the missing values through the linear relationship between adjacent data points, effectively retaining the continuity of the time series and avoiding the impact of data anomalies on subsequent analysis. The filled traffic flow time series data is subjected to format normalization processing to unify the time format and align the time steps. The timestamps of the traffic flow time series data are converted into a standardized format, and the time steps are resampled and aligned in minutes. For multiple data points that appear during the sampling process, the method of mean aggregation is adopted to ensure that each time step has an accurate representation, thereby enhancing the consistency of the time series data. Finally, the formatted traffic flow time series data is normalized to obtain the preprocessed traffic flow time series data. Normalization processing is used to eliminate the dimensional differences between features. Using a standardization method, the data is converted into a distribution form with a mean of 0 and a standard deviation of 1. This can not only improve the training efficiency of the model but also avoid the impact of feature range differences on the model results, thereby providing high-quality input data for subsequent modeling and prediction.

[0056] It should be noted that the diffusion model is a type of generative model. The purpose of the generative model is to learn to generate data given some training data. The generation of the diffusion model starts from random noise and is gradually refined through multiple steps until the output target prediction result appears. A diffusion model is constructed by setting hyperparameters. Gaussian noise is added to each time step of the preprocessed traffic flow time series data according to a preset noise ratio through a noise intensity scheduler, and the noise intensity scheduler is used to define the noise ratio for each time step; as the time steps increase, the traffic flow time series data gradually loses its original structure and features through noise accumulation, and the traffic flow time series data is converted into pure noise with a Gaussian distribution at the final time step. The traffic flow time series data approaches a standard normal distribution, providing a random starting point for the subsequent inverse diffusion generation process.

[0057] Figure 2 The flowchart shows the extraction of hidden spatio-temporal representations using external condition information through multi-layer embedding.

[0058] According to an embodiment of the present invention, in the diffusion model, hidden spatio-temporal representations are extracted using external condition information through multi-layer embedding, and the hidden spatio-temporal representations are embedded into the diffusion model. Specifically:

[0059] S202, a preliminary feature embedding layer, a periodic embedding layer, and a spatio-temporal adaptive embedding layer are constructed in the diffusion model. The preliminary feature embedding layer uses a fully connected layer to perform preliminary feature embedding representation on the input preprocessed traffic flow time series data;

[0060] S204. The periodic embedding layer represents seven days of a week and different time points in a day by setting a learnable embedding dictionary. According to the timestamp information of the traffic flow time series data, the corresponding embedding representation is extracted from the embedding dictionary, and the weekly cyclic feature and the daily cyclic feature are obtained according to the corresponding embedding representation, and the weekly cyclic feature and the daily cyclic feature are used to generate a periodic embedding representation.

[0061] S206. The spatio-temporal adaptive embedding layer performs feature embedding by learning the spatio-temporal relationship features between different traffic flow time series data, shares the spatio-temporal relationship features for all traffic flow time series data, captures the complex spatio-temporal dependencies across sequences, and generates a spatio-temporal adaptive embedding representation.

[0062] S208. Concatenate the preliminary feature embedding, the periodic embedding, and the spatio-temporal adaptive embedding to generate the final hidden spatio-temporal representation of the traffic flow time series data.

[0063] It should be noted that in the periodic embedding layer, a learnable embedding dictionary is constructed to represent seven days of a week. By querying the embedding dictionary, the day-of-week data is converted into the corresponding embedding representation to capture the weekly cyclic feature. Another learnable embedding dictionary is constructed to represent different time points in a day. According to the timestamp information, the corresponding timestamp embedding is extracted by querying the embedding dictionary to characterize the daily periodic feature. The day-of-week embedding and the timestamp embedding are concatenated together to form an overall representation of the periodic feature, and it is extended to the data of all sensors to ensure that the diffusion model can capture the periodic pattern of the time series. In the spatio-temporal adaptive embedding layer, a spatio-temporal shared embedding representation is designed to learn the spatio-temporal relationship features between different time series, and the embedding is shared for all sequences, which can help the model capture the complex spatio-temporal dependencies across sequences. Finally, the preliminary feature embedding, the periodic embedding, and the spatio-temporal adaptive embedding are concatenated together to generate the final hidden spatio-temporal representation. Since the time and space features of the traffic flow time series data are comprehensively considered, it can be ensured that the model not only considers the periodic feature but also can capture the different time patterns of different sensors in the traffic flow time series data.

[0064] Figure 3 The flowchart showing traffic flow prediction by denoising through the backward denoising network is shown.

[0065] According to an embodiment of the present invention, the backward denoising network of the diffusion model is constructed based on the graph attention network, and the denoising of the noisy traffic flow time series data is performed by combining multi-layer attention to obtain the traffic flow prediction result of the target area, specifically:

[0066] S302. Construct a backward denoising network based on the graph attention network. Input the noisy traffic flow time series data, which contains time series sensor node features and the time dimension. Convert the input data into the graph data format. Use the time series sensors as nodes and set the edge structure according to the spatial association between the time series sensors. Construct an adjacency matrix to represent the graph data.

[0067] S304. Import the adjacency matrix into the graph attention network. Dynamically assign weights to the neighborhood nodes for each node through the self-attention mechanism to capture the non-uniform dependence relationship between nodes. Use graph convolution operations to extract the spatial features of the nodes.

[0068] S306. Read the hidden spatio-temporal representation extracted through multi-layer embedding in the diffusion model. Combine the hidden spatio-temporal representation with the spatial features to strengthen the spatio-temporal dependence between nodes and obtain an updated feature matrix containing spatio-temporal information.

[0069] S308. Import the updated feature matrix containing spatio-temporal information into the time layer of the backward denoising network. Set the information weights for different time steps through the multi-head self-attention mechanism to capture the time dependence relationship between different time steps and generate a feature matrix that enhances the time dependence relationship.

[0070] S310. Import the feature matrix that enhances the time dependence relationship into the feature layer of the backward denoising network. Measure the contribution of different features to traffic flow prediction through the multi-head self-attention mechanism to obtain the feature weight distribution. Obtain the feature matrix output by the feature layer according to the feature weight distribution.

[0071] S312. Combine the feature matrix with the external condition information through the gated activation module. Restore the original spatio-temporal structure of the traffic flow time series data through the fully connected layer in the regression layer to obtain the traffic flow prediction result of the target area.

[0072] It should be noted that the graph attention network extracts the spatial features of each node and emphasizes the neighborhood node information highly relevant to the prediction target. The graph convolution operation can be expressed as:

[0073] H (l) = GAT(X (l-1) , A)

[0074] where H (l) is the spatial feature vector of the l-th layer, X (l-1) is the input feature of the previous layer (initially a mixed feature of spatial and time information), and A is the adjacency matrix, representing the spatial association between nodes.

[0075] Read the hidden spatio-temporal representation extracted by multi-layer embedding in the diffusion model and map it to a high-dimensional embedding vector to capture the information in the spatio-temporal dimension. Combine the hidden spatio-temporal representation with the spatial features output by the graph attention network to enhance the model's ability to model spatio-temporal dependencies and provide richer context information for subsequent processing. The hidden spatio-temporal representation E(t) is as follows:

[0076] E(t) = Embedding(t c )

[0077] where N is the number of nodes, is the conditional information at the current time step, and Embedding(t) represents converting t c into a high-dimensional embedding vector through multi-layer embedding.

[0078] After the graph convolution operation, combine the hidden spatio-temporal representation E(t) obtained by diffusion embedding with the output features of the graph neural network to enhance the model's ability to model temporal dependencies and generate a feature matrix that enhances the temporal dependency relationship which is expressed as:

[0079] The time layer of the backward denoising network captures the dependencies between time steps through the multi-head self-attention mechanism, mining the long-term dependencies and short-term fluctuations in the time series data. By identifying the key time steps, dynamically adjusting the information weights of different time steps, and generating a feature representation that enhances the temporal dependency. During this process, the time layer captures the dependencies between different time steps through the self-attention mechanism, and the attention operation is expressed as:

[0080]

[0081] where Q time is the query matrix, K time is the key matrix, V time represents the value matrix, is a learnable parameter. Based on this, calculate the self-attention score A time to capture the temporal relationships between different spatial nodes:

[0082]

[0083] where d h is the dimension. Finally, obtain the output X time of the time layer, and X time = A time V time .

[0084] The self-attention mechanism of the feature layer of the backward denoising network models the interaction relationships between various features and measures the contribution of features to the prediction task. Through the multi-head attention mechanism, it focuses on the impacts of different feature combinations, thereby optimizing the feature weight distribution, strengthening the attention to key features, and improving the modeling accuracy. The self-attention mechanism of the feature layer is expressed as follows:

[0085]

[0086] Among them, X feature is the feature matrix output by the feature layer, and Q feature , K feature , and V feature are respectively the query matrix, key matrix, and value matrix of the attention mechanism in the feature layer, and d k is the dimension.

[0087] Finally, the feature matrix is combined with the external conditional information sequence C through a gated activation unit to generate the final prediction result. The traffic flow prediction result of the target area is calculated through the regression output layer FC is the fully connected layer.

[0088] It should be noted that to obtain the traffic flow prediction result of the target area at the preset time step and the signal timing plan of the current traffic signal in the target area, the number of vehicles passing through per unit time is read through the real-time traffic flow data, and the traffic congestion degree is evaluated according to the number of vehicles passing through per unit time; the flow difference between the real-time traffic flow data of the target area and the traffic flow prediction result is calculated, and the traffic characteristics of the target area are generated based on the flow difference and the traffic congestion degree, and similarity retrieval is performed in the historical timing instances according to the traffic characteristics; the traffic flow change sequence and the timing plan in the historical timing instance with the highest similarity are read, and the real-time traffic flow data of the target area is compared with the traffic flow change sequence. The trend comparison can be obtained through the trend distance comparison. The trend distance is the difference between the starting point and the ending point of the sequence segment. After segmenting the real-time traffic flow data and the traffic flow change sequence, the trend distance is calculated to obtain the change trend deviation. An adjustment coefficient is generated according to the change trend deviation, and the retrieved timing plan is corrected using the adjustment coefficient to generate the signal timing plan of the traffic signal in the target area.

[0089] Figure 4 Fig. shows the block diagram of the traffic flow prediction system based on the graph neural network and the diffusion model.

[0090] The second embodiment of the present invention provides a traffic flow prediction system 4 based on the graph neural network and the diffusion model. The system includes: a data preprocessing module 401, a forward diffusion module 402, a conditional generation module 403, a backward denoising module 404, and an application module 405;

[0091] The data preprocessing module is used to preprocess the traffic flow time series data monitored by each time series sensor in the target area within a preset time period;

[0092] The forward diffusion module is used to transform the preprocessed traffic flow time series data into pure noise with a Gaussian distribution;

[0093] The conditional generation module is used to integrate external conditional information through a multi-layer embedding method, extract the hidden spatio-temporal representation of the traffic flow time series data, and guide the generation of the denoising process;

[0094] The backward denoising module is used to capture the complex dependencies in the spatio-temporal sequence by combining graph convolution operations with attention mechanisms in the time and feature layers, and gradually restore the original spatio-temporal structure during the denoising process to achieve the prediction of the traffic flow in the target area;

[0095] The application module is used to dynamically adjust the timing scheme of traffic lights according to real-time and predicted traffic flow data to adapt to the traffic flow demands of different road sections in the target area.

[0096] In several embodiments provided by the present application, it should be understood that the disclosed method can be implemented in other ways. The system embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed with each other can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms. In addition, in each embodiment of the present invention, each functional module can be all integrated in a processing module, or each module can be separately used as a module, or two or more modules can be integrated in a module; the above integrated modules can be implemented in the form of hardware, or in the form of a hardware plus software functional module.

[0097] If the above-mentioned integrated module of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.

[0098] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention.

Claims

1. A traffic flow prediction method based on graph neural network and diffusion model, characterized in that: The following steps are involved: Acquire the traffic flow time series data monitored by each time series sensor in the target area within a preset time period, and pre-process the traffic flow time series data; Constructing a diffusion model, using forward diffusion to gradually add noise to the preprocessed traffic flow time series data, so that the traffic flow time series data is close to pure noise of Gaussian distribution; In the diffusion model, using external condition information to extract hidden spatiotemporal representation through multi-layer embedding, and embedding the hidden spatiotemporal representation into the diffusion model; Based on the graph attention network, the backward denoising network of the diffusion model is constructed. The noisy traffic flow time series data is taken as input and converted into a graph data format. The hidden spatiotemporal representation corresponding to the external condition information is fused with the spatial features obtained through graph convolution. The noisy traffic flow time series data is denoised with multi-layer attention to obtain the traffic flow prediction result of the target area.

2. The traffic flow prediction method based on graph neural network and diffusion model according to claim 1 is characterized in that: Obtain the traffic flow time series data monitored by each time series sensor in the target area within a preset time period, and pre-process the traffic flow time series data, specifically: The traffic flow time series data within the preset time period is obtained according to the preset time series sensors in the target area, and the missing values ​​of the traffic flow time series data are processed by linear interpolation; The padded traffic flow time series data is formatted and normalized, the time format is unified and the time step is aligned. For multiple data points that appear during the sampling process, the mean aggregation method is adopted to enhance the consistency of the traffic flow time series data. Finally, the formatted traffic flow time series data is normalized to obtain the preprocessed traffic flow time series data.

3. The traffic flow prediction method based on graph neural network and diffusion model according to claim 1 is characterized in that: A diffusion model is constructed, and forward diffusion is used to gradually add noise to the preprocessed traffic flow time series data, so that the traffic flow time series data is close to pure noise of Gaussian distribution, specifically: The hyperparameters are set to build a diffusion model, and Gaussian noise is added to each time step of the preprocessed traffic flow time series data according to the preset noise ratio through the noise intensity scheduler; As the time step increases, the traffic flow time series data gradually loses its original structure and characteristics through noise accumulation, and at the final time step, the traffic flow time series data is converted into pure noise of Gaussian distribution.

4. The traffic flow prediction method based on graph neural network and diffusion model according to claim 1 is characterized in that: In the diffusion model, the hidden spatiotemporal representation is extracted by multi-layer embedding using external condition information, and the hidden spatiotemporal representation is embedded into the diffusion model, specifically: A preliminary feature embedding layer, a periodic embedding layer and a spatiotemporal adaptive embedding layer are constructed in the diffusion model, wherein the preliminary feature embedding layer uses a fully connected layer to perform preliminary feature embedding representation on the input preprocessed traffic flow time series data; The periodic embedding layer sets a learnable embedding dictionary to represent the seven days of the week and different time points of the day, extracts the corresponding embedding representation from the embedding dictionary according to the timestamp information of the traffic flow time series data, obtains the weekly cycle features and the daily cycle features according to the corresponding embedding representation, and generates the periodic embedding representation by using the weekly cycle features and the daily cycle features; The spatiotemporal adaptive embedding layer embeds features by learning the spatiotemporal relationship features between different traffic flow time series data, shares the spatiotemporal relationship features with all traffic flow time series data, captures the complex spatiotemporal dependencies across sequences, and generates a spatiotemporal adaptive embedding representation; The preliminary feature embedding, periodic embedding and spatiotemporal adaptive embedding are concatenated to generate the final hidden spatiotemporal representation of traffic flow time series data.

5. The traffic flow prediction method based on graph neural network and diffusion model according to claim 1 is characterized in that: The backward denoising network of the diffusion model is constructed based on the graph attention network, specifically: A backward denoising network is constructed based on a graph attention network, and the noisy traffic flow time series data is input, wherein the noisy traffic flow time series data includes the time series sensor node features and the time dimension, and the input data is converted into a graph data format, and the time series sensors are used as nodes and the edge structure is set according to the spatial association between the time series sensors, and an adjacency matrix is ​​constructed to represent the graph data; Importing the adjacency matrix into a graph attention network, dynamically assigning weights of neighboring nodes to each node through a self-attention mechanism, capturing non-uniform dependencies between nodes, and using graph convolution operations to extract spatial features of nodes; The hidden spatiotemporal representation extracted by multi-layer embedding in the reading diffusion model is combined with the spatial feature to strengthen the spatiotemporal dependency between nodes and obtain an updated feature matrix containing spatiotemporal information.

6. The traffic flow prediction method based on graph neural network and diffusion model according to claim 5 is characterized in that: In the backward denoising network, the noisy traffic flow time series data is denoised by combining multi-layer attention to obtain the traffic flow prediction result of the target area, which is specifically: Import the updated feature matrix containing spatiotemporal information into the time layer of the backward denoising network, set the information weights of different time steps through the multi-head self-attention mechanism, capture the temporal dependency between different time steps, and generate a feature matrix with enhanced temporal dependency; The feature matrix of the enhanced time dependency is imported into the feature layer of the backward denoising network, the contribution of different features to traffic flow prediction is measured through a multi-head self-attention mechanism, the feature weight distribution is obtained, and the feature matrix output by the feature layer is obtained according to the feature weight distribution; The feature matrix is ​​combined with external condition information through a gated activation module, and the original spatiotemporal structure of the traffic flow time series data is restored through the fully connected layer in the regression layer to obtain the traffic flow prediction result of the target area.

7. The traffic flow prediction method based on graph neural network and diffusion model according to claim 1 is characterized in that: Obtain the traffic flow prediction results of the target area at the preset time step and the timing plan of the current traffic lights in the target area, read the number of vehicles passing through per unit time through real-time traffic flow data, and evaluate the traffic congestion level based on the number of vehicles passing through per unit time; Calculate the traffic flow difference between the real-time traffic flow data of the target area and the traffic flow prediction result, generate the traffic characteristics of the target area based on the traffic flow difference and the traffic congestion level, and perform similarity search in historical timing instances according to the traffic characteristics; The traffic flow change sequence and timing plan in the historical timing instance corresponding to the highest similarity are read, and the trend of the real-time traffic flow data in the target area is compared with the traffic flow change sequence. An adjustment coefficient is generated according to the deviation of the change trend, and the retrieved timing plan is corrected using the adjustment coefficient to generate a timing plan for the traffic lights in the target area.

8. A traffic flow prediction system based on graph neural network and diffusion model, characterized in that: Implementing the traffic flow prediction method based on graph neural network and diffusion model as described in any one of claims 1 to 7, the system comprises: a data preprocessing module, a forward diffusion module, a condition generation module, a backward denoising module and an application module; The data preprocessing module is used to preprocess the traffic flow time series data monitored by each time series sensor in the target area within a preset time period; The forward diffusion module is used to convert the pre-processed traffic flow time series data into pure noise of Gaussian distribution; The condition generation module is used to integrate external condition information through multi-layer embedding, extract the hidden spatiotemporal representation of traffic flow time series data, and guide the generation of denoising process; The backward denoising module is used to capture the complex dependencies in the spatiotemporal sequence by combining the graph convolution operation with the attention mechanism of the time and feature layers, and gradually restore the original spatiotemporal structure during the denoising process to achieve the prediction of traffic flow in the target area; The application module is used to dynamically adjust the timing scheme of traffic lights according to real-time and predicted traffic flow data to adapt to the traffic flow demand of different sections of the target area.

Citation Information

Patent Citations

  • Space-time event prediction method and device based on deep learning

    CN118378734A

  • Traffic flow prediction method based on de-noising attention enhancement cyclic multi-graph convolutional network

    CN118506589A

  • Traffic flow prediction method based on decoupling fusion network

    CN119049285A

  • A system for enhancing the strength of spray-type steel fiber reinforced concrete applied with SIP(Shelter in Place, evacuation facilities in facilities) using induction heating

    KR102469240B1

  • Traffic flow forecasting method based on deep graph gaussian processes

    US20230058520A1

Cited By

  • Marine observation data prediction method based on DDPM and GAT

    CN122262700A