A method for traffic network state estimation based on probability diffusion model

Through the traffic road network state estimation method based on the probability diffusion model, the accuracy and efficiency of the traffic road network state estimation are solved, high-quality traffic data is provided to support traffic management decisions, and road congestion is alleviated.

CN117690290BActive Publication Date: 2025-01-17BEIJING JIAOTONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311612649.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-01-17
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately and efficiently estimate the status of the traffic road network. Due to the influence of multiple factors such as time, road network structure and external environment, it makes it difficult to formulate reasonable and effective measures for traffic management decisions.

Method used

Using the traffic road network state estimation method based on the probability diffusion model, the road network environment encoder and traffic state estimation model TrafficDDPM are constructed, and the road network features are extracted and high-quality are generated by combining environmental condition encoding, classifier-free guide and U-shaped network structure. Quality traffic status data.

Benefits of technology

It realizes accurate estimation of the traffic road network status under any environmental conditions, provides an important decision-making basis for traffic management, improves traffic planning and management capabilities, and reduces road congestion problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117690290B_ABST
    Figure CN117690290B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for estimating the state of a traffic network based on a probability diffusion model, comprising: step 1, analyzing traffic network environment data, constructing a network environment encoder; step 2, extracting network state features, constructing a network-level traffic state estimation model Traffic DDPM, using a denoising probability diffusion model framework DDPM to maximize the fitting probability distribution, using the network environment encoder constructed in step 1 to extract network environment attributes and fuse them into environment coding, using a classifier-free guide CFG to control the model sampling direction, using a U-shaped network structure and an attention mechanism to extract network features; step 3, verifying the model of Traffic DDPM obtained in step 2 from the aspects of model accuracy comparison and instance error, and finally estimating the network state. The present invention can accurately and efficiently estimate the state of a traffic network under any environmental conditions, and provide an important basis for decision makers to formulate management decision measures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of transportation, and relates to a method for estimating the state of a transportation network based on a probability diffusion model. Background Art

[0002] In recent years, China's urbanization has accelerated, and the urbanization rate in 2022 was 65.22%, an increase of 0.5%. The 2022 China Economic Communiqué shows that the national motor vehicle ownership will reach 417 million in 2022, an increase of 5.39%, and the number of drivers will exceed 500 million. In the 2022 Urban Traffic Report released by Baidu Maps, the top three cities with peak commuting congestion are Beijing, Shanghai, and Changchun. Among them, Beijing's peak congestion index is 2.082, the average actual speed is 26.91 kilometers per hour, and the average commuting time is as high as 43 minutes. Affected by factors such as the expansion of urbanization and the increase in the number of motor vehicles, road congestion is particularly prominent. Road congestion not only prolongs residents' travel time and increases energy consumption in fuel and other aspects, but also increases the probability of traffic accidents, affecting the quality of life and personal safety of urban residents. Therefore, alleviating traffic congestion and doing fine management and planning are tasks facing major cities.

[0003] Improving traffic supply, guiding traffic demand, and optimizing traffic planning and management capabilities are common means to alleviate road congestion problems at a macro level. In terms of traffic supply, for my country's first- and second-tier large cities, idle land resources are scarce, and the urban structure has been finalized and is difficult to adjust. In terms of traffic demand, properly guiding traffic demand can alleviate traffic pressure, but at the same time it will affect the normal social activities of residents, which has both advantages and disadvantages. In terms of traffic planning and management, on the basis of exploring the inherent objective laws of road traffic, gradually improving the efficiency and quality of traffic management through scientific technical means, methods and principles, etc., can achieve the greatest economic, traffic and environmental benefits. Therefore, improving traffic planning and management capabilities and properly guiding traffic demand are more scientific and effective means. Road network-level traffic state estimation is a basic and important link. However, the road network state is affected by many factors such as time, road network structure, and external environment. How to efficiently integrate multi-source traffic environment attributes and accurately estimate the road network state is a key issue.

[0004] Purpose of the Invention

[0005] The purpose of the present invention is to address the problems faced by the prior art and accurately estimate the traffic status of the road network. Specifically, it provides a traffic network status estimation method based on a probability diffusion model, which can accurately and efficiently estimate the traffic network status under any environmental conditions, and can provide an important basis for decision makers to formulate reasonable and effective management decision measures. Summary of the invention

[0006] The present invention provides a method for estimating a traffic network state based on a probability diffusion model, comprising the following steps:

[0007] Step 1: Analyze the traffic network environment data and build a road network environment encoder;

[0008] Step 2: Extract the road network status features and construct the road network level traffic status estimation model TrafficDDPM;

[0009] Step 3: The traffic state estimation model TrafficDDPM obtained in step 2 is verified from the aspects of model accuracy comparison and instance error to obtain the traffic network state.

[0010] Preferably, in step 1, the traffic network environment data includes minute-level road section time, day of the week, working holidays, road network structure, weather, and traffic policy.

[0011] Preferably, the road network environment encoder in step 1 includes two parts: an environment encoder and a road network structure encoder, wherein the environment encoder fuses the timing, road section location, week, holidays, peak and off-peak hours, weather, and traffic restriction policy environment attributes into an environment code using One-Hot encoding and a fully connected neural network as a conditional guidance signal; the road network encoder uses graph embedding technology DeepWalk to convert the known road network structure into a low-dimensional dense vector, and uses a low-dimensional feature vector to represent the road section nodes, road section connection relationships, and road network structure information in the road network.

[0012] Further preferably, in step 1, the road network encoder applies the graph embedding technology DeepWalk, first converts the road network into a coordinate graph Graph according to the road segments and the adjacency matrix, then generates multiple paths using a random walk method to form training samples, and then uses the random walk path to complete the skip-gram task, and finally outputs the representation vector of each road segment through the softmax layer; wherein the skip-gram task uses the Word2Vec model, and the goal is to learn the conditional probability from the input vector to the output vector, and its objective function is expressed as shown in formula (1):

[0013]

[0014] The road network structure encoding model uses a three-layer neural network. The dimensions of the input layer and the output layer are V, representing the number of road sections. The hidden layer dimension is N, which is an adjustable parameter. The output layer uses the softmax activation function. The input vector w I Predicted output vector w O The conditional probability of the road segment is maximized by using the maximum likelihood method to make the inner product distance of similar road segments smaller.

[0015] Preferably, in step 2, the traffic state estimation model TrafficDDPM is divided into four parts as a whole, namely, a probability diffusion framework, a road network state learning model, a classifier-free guide and an environmental condition encoder; the denoising probability diffusion model framework DDPM is used to maximize the fitting probability distribution, the road network environment encoder constructed in step 1 is used to extract road network environment attributes and fuse them into environment coding, the classifier-free guide is used to control the model sampling direction, and the U-type network structure and attention mechanism are used to extract road network features.

[0016] Preferably, the operation process of the traffic network model TrafficDDPM in step 2 includes inputting the road network noise sequence into the diffusion framework, and the diffusion framework outputs the target road network state sequence after T-step sampling, wherein each sampling step needs to perform the following sub-steps:

[0017] 1) In each sampling process, seven types of environmental information including time sequence, road section location, day of the week, holidays, peak and off-peak hours, weather, and traffic restriction policies and road network topology need to be input into the environmental condition encoder to generate environmental condition codes;

[0018] 2) Encoding the environmental conditions into the classifier-free guide and converting them into guide conditions;

[0019] 3) The road network state learning module is based on the guidance information and the noise sequence X of the previous time step t , sampling is performed from the probability distribution function to obtain X t-1 , when X t When back-diffusion to X0, the road network result X0 is obtained and output.

[0020] Preferably, the process of constructing the road network level traffic state estimation model TrafficDDPM in step 2 includes the following sub-steps:

[0021] Step S21, define a probability diffusion framework, and use the result of adding Gaussian noise in multiple steps as samples X0, X1, ..., X t , the probability distribution of noise P is learned through the back diffusion process θ-noise(x) Finally, the sampling Sample is performed, from the pure noise sample X noise Eliminate P θ-noise(x) The noise sampled in multiple steps is finally obtained, and the target sample is obtained. The process includes: fitting the noise distribution P in the traffic state estimation model TrafficDDPM θ-noise(x) It is defined as shown in formula (2)-(3):

[0022]

[0023] p θ (x t-1 |x t)=N(x t-1 ;μ θ (x t ,t),∑ θ (x t ,t)) (3),

[0024] Among them, T refers to the number of sampling steps, x 0:T Refers to the sample x at a given time T T The reverse diffusion process to x0, N refers to Gaussian distribution, μ θ (x t ,t) refers to the mean of the sampled Gaussian distribution at time t,∑ θ (x t ,t) refers to the variance of Gaussian distribution; in the problem of network state generation, the network state under unit time slice is converted into a sequence X = (x1, x2, ..., x n ), each dimension represents the average speed of the current road section, according to the approximate optimal probability distribution P θ (x) generates a tensor of dimension o and defines the road network state estimation problem as shown in formula (4):

[0025]

[0026] Among them, V * Probability distribution The sampled data is is the probability distribution of the model fitting, refers to the true probability distribution;

[0027] The target loss function is defined as the known distribution P(X) and the predicted distribution P in the forward diffusion process. θ-noise (X) is expressed as The objective function is defined as shown in formula (5):

[0028]

[0029] Among them, D KL (P|P θ ) refers to the distribution P and the distribution P θ KL divergence; if o! = n, the traffic state estimation model is applicable to the time series road network state prediction; if o = n, the input and output scales are limited, and the traffic state estimation model is applicable to the road network state estimation problem;

[0030] Step S22, constructing an environmental coding unconditional guide, specifically, in the problem of generating a road network state guided by environmental conditions, adding an input condition y in the calculation process, where y is a tensor after encoding the multi-dimensional environmental condition features, y is the output of the road network environment encoder, and the road network state generation formula is expressed as shown in formula (6):

[0031]

[0032] Among them, p(x t-1 |x t ,y) refers to the joint conditional probability distribution guided by the classifier, x t-1 Refers to the sample at the previous moment of the diffusion process, μ(x t ,y) refers to the mean of the Gaussian distribution at time t in the diffusion process, Refers to the variance of the Gaussian distribution at time t of the diffusion process, and I refers to the unit matrix;

[0033] The guidance weight scaling mechanism is added to the classifier, which is expressed as shown in formula (7):

[0034]

[0035] Among them, ε θ (x t ,y,t) refers to the prediction noise at time t under the guidance of the classifier, ε θ (x t ,t) refers to the predicted noise at time t without the guidance of the classifier, and w refers to the guidance intensity of the environmental conditions; Step S23, construct a road network state feature learning model, and define the road network state learning model as including Road Unet-1D and Road Attention sub-modules, wherein Road Unet-1D is used to extract road network features in the local field of view, and Road Attention is used to extract road network state features in the global field of view.

[0036] Preferably, step 3 further comprises the following sub-steps:

[0037] Step S31, horizontal comparison of model accuracy;

[0038] Step S32, global error analysis of road network instance;

[0039] Step S33: analyzing the error of the road network instance per unit time. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flow chart of the traffic network state estimation method based on the probability diffusion model described in the present invention.

[0041] Figure 2 It is a detailed structural diagram of the traffic network model based on the probability diffusion model described in the present invention.

[0042] Figure 3 It is a structural diagram of the environmental condition encoder in the traffic network model.

[0043] Figure 4It is a structural diagram of the road network structure encoder in the traffic network model.

[0044] Figure 5 It is a schematic diagram of the overall structure of the traffic network model TrafficDDPM.

[0045] Figure 6 It is a global error analysis comparison diagram of the road network state estimation result in the embodiment of the present invention.

[0046] Figure 7 It is a comparison diagram of the unit time error analysis of the road network state estimation result in the embodiment of the present invention.

[0047] Figure 8 It is a road network state deduction diagram (unit time) in an embodiment of the present invention.

[0048] Fig. 9 It is a schematic diagram of a MAPE curve showing the influence of the diffusion time step on the model accuracy when the model is verified in an embodiment of the present invention.

[0049] Fig.10 It is a schematic diagram of a MAPE curve showing the influence of the conditional guidance weight on the model accuracy when the model is verified in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The present invention is further described below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Those skilled in the art will appreciate that the step numbers used herein are only for convenience of description and are not intended to be a limitation on the order in which the steps are performed. The terms used in the present specification are only for the purpose of describing a specific embodiment and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms of "one", "an" and "the" may include plural forms unless the context clearly indicates otherwise. The term "and / or" refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. In the description of the present invention, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically limited.

[0052] Figure 1 It is a flow chart of the traffic network state estimation method based on the probability diffusion model described in the present invention. Figure 2This is a detailed structural diagram of the traffic network model based on the probability diffusion model of the present invention. As shown in the figure, first, the traffic network environment data is analyzed to construct a network environment encoder. Then, the network state characteristics are extracted to construct a network-level traffic state estimation model TrafficDDPM. Finally, the obtained traffic state estimation model TrafficDDPM is verified from the aspects of model accuracy comparison and instance error, so as to obtain the traffic network state.

[0053] In order to estimate the traffic network state at the road network level, the present invention proposes a new road network state estimation model Traffic DDPM. It maximizes the fitting of the road network state probability distribution function based on the probability diffusion model. Under the framework of the probability diffusion model, the environmental condition encoder is used to extract the road network environment attributes and merge them into the environment code, the classifier-free guide is used to control the model sampling direction, and the U-Net and attention mechanism are used to extract the road network features. The present invention proposes a new idea for the problem of traffic network state estimation. The specific method is as follows:

[0054] (1) Constructing a road network environment encoder

[0055] Environmental data related to the traffic network, including road section time (minute level), day of the week, working holidays, road network structure, weather, traffic policies, etc. Changes in the road network status will be affected by the above environment.

[0056] In the preprocessing stage, the environmental attributes are converted into computer-recognizable environmental condition parameters through discretization. The mapping relationship between environmental attributes and discretized values ​​is shown in Table 1:

[0057] Table 1 Mapping relationship between environmental attributes and discretized numerical values

[0058]

[0059]

[0060] In order to integrate the above multi-dimensional environmental attributes, the present invention proposes an environmental condition encoder, which includes an environment encoder Environment Encoder and a road graph encoder Road Graph Encoder, which can integrate the above seven environmental condition attributes into an environmental code to serve as a conditional signal to guide diffusion. Figure 3 It is a structural diagram of the environmental condition encoder. Figure 4 It is a structural diagram of the road network structure encoder.

[0061] The modeling idea of ​​Environment Encoder is to design the mapping function y=f(x) so that each type of environmental information can retain complete information during encoding and meet the requirements of the subsequent generation model guidance conditions.

[0062] There are relatively few categories of environmental information such as time series, road section location, day of the week, holidays, peak and off-peak hours, weather, and traffic restriction policies. First, we use One-Hot encoding to discretize each type of information into a feature vector, and then use a fully connected neural network to fuse the One-Hot encoding, and finally output an N-dimensional environmental code.

[0063] Aiming at the environmental characteristics of the road section location, a road network structure encoder Road Graph Encoder is proposed separately. The road network structure belongs to the graph structure. The present invention selects the graph embedding technology (DeepWalk) to convert the road network structure into a low-dimensional dense vector, and uses the low-dimensional feature vector to represent the road section nodes, road section connection relationship and road network structure information in the road network. DeepWalk first converts the road network into a Graph according to the road section and the adjacency matrix, and then generates multiple paths using a random walk method to form a training sample, and then uses the random walk path to complete the skip-gram task, and finally outputs the representation vector of each road section through the softmax layer. The skip-gram task uses the Word2Vec model, and the goal is to learn the conditional probability from the input vector to the output vector. The objective function is shown in formula (1):

[0064]

[0065] The road network structure encoding model uses a three-layer neural network, the dimensions of the input layer and the output layer are V (number of road sections), the hidden layer dimension is N (adjustable parameter), and the output layer uses the softmax activation function. I Predicted output vector w O The conditional probability of the road segment is maximized by using the maximum likelihood method to make the inner product distance of similar road segments smaller.

[0066] (2) Constructing the traffic state estimation model Traffic DDPM at the road network level

[0067] Based on the probability diffusion theory, the present invention proposes a probability diffusion traffic network model TrafficDDPM guided by environmental conditions. TrafficDDPM applies the probability diffusion model framework to the generation of road network state data. In order to extract the road network state features, a road network state learning sub-model (Road Unet-1D and RoadAttention) adapted to the diffusion model framework is proposed. At the same time, in order to control the diffusion sampling direction, an environmental condition encoder sub-model is creatively proposed. With the help of the idea of ​​no classifier guidance, the environmental coding is effectively applied to the diffusion process, and finally high-quality traffic network state data that meets the environmental conditions is generated.

[0068] Figure 5This is a schematic diagram of the overall structure of the traffic network model TrafficDDPM, as shown in the figure: TrafficDDPM is divided into four parts, namely the probability diffusion framework Traffic Diffusion, the road network state learning model (Road Unet-1D), the classifier-free guide (Classifier-FreeGuidance) and the environment condition encoder (EnvironmentEncoder, Road Graph Encoder).

[0069] The operation process of the traffic network model TrafficDDPM is as follows:

[0070] The road network noise sequence is input into the diffusion framework, which outputs the target road network state sequence after T-step sampling. Each sampling step requires the following sub-steps:

[0071] 1) In each sampling process, the seven types of environmental information and the road network topology structure need to be input into the environmental condition encoder to generate the environmental condition code;

[0072] 2) Encoding the environmental conditions into the classifier-free guide and converting them into guide conditions;

[0073] 3) The road network state learning module is based on the guidance information and the noise sequence X of the previous time step t , sampling is performed from the probability distribution function to obtain X t-1 , when X t When back-diffusion to X0, the road network result X0 is obtained and output is X0.

[0074] The specific steps of constructing the traffic network model TrafficDDPM include:

[0075] Step 1: Define the probability diffusion framework.

[0076] The probability diffusion framework Traffic Diffusion defines the reverse diffusion sampling process of pure noise samples to maximize the fitting probability distribution function. The probability diffusion model Diffusion is a generative model designed based on undetermined coefficients and fractional models. In the reverse diffusion process, pure noise is gradually denoised to construct samples with known probability distribution. In the probability diffusion model, the result of adding Gaussian noise in multiple steps is used as the sample X0, X1, ..., X t , the probability distribution of noise P is learned through the back diffusion process θ-noise(x) Finally, the sampling Sample is performed, from the pure noise sample X noise Eliminate P θ-noise(x) The noise sampled in multiple steps is finally obtained as the target sample.

[0077] The P in TrafficDDPMθ-noise(x) The formula is shown in formula (2)-(3):

[0078]

[0079] p θ (x t-1 |x t )=N(x t-1 ;μ θ (x t ,t),∑ θ (x t ,t)) (3),

[0080] In the network state generation problem, the network state per unit time slice is converted into a sequence X = (x1, x2, ..., x n ), each dimension represents the average speed of the current road section, according to the approximate optimal probability distribution P θ (x) generates a tensor of dimension o, as shown in formula (4):

[0081]

[0082] Among them, if o! = n, the model is suitable for time series road network state prediction; if o = n, the input and output scales are limited, and the model is suitable for road network state estimation problems.

[0083] Step 2: Build environment encoding unconditional boot

[0084] Classifier-Free-Guidance allows conditional signals to be added during model training and sampling to control the direction of sample generation.

[0085] The core idea of ​​the conditional guided diffusion method is to add conditional signals during the diffusion model training process, optimize the diffusion model using conditional guidance, and set guidance weights to control the guidance intensity during the inference sampling process. In the problem of network state generation guided by environmental conditions, it is necessary to add input conditions y during the calculation process. y is a tensor that encodes multi-dimensional environmental condition features. At this time, the network state generation formula is shown in formula (5):

[0086]

[0087] Classifier-Free can add a guided weight scaling mechanism to control the relevance (authenticity) and diversity of the balancing effect during the inference sampling process. The noise term calculation formula after adding the weight w is shown in formula (6):

[0088]

[0089] The first half of formula (6) represents the guided conditional generation result with weight enhancement, and the second half represents the unconditional guided generation result.

[0090] Combined with the probability diffusion model in the first step, the problem of generating road network status guided by environmental conditions is defined: in a road network with N road sections and G topological structure, environmental attribute conditions Env are given, and a diffusion model guided by environmental conditions is established to solve the road network status X0 under the current environmental conditions.

[0091] The training sample is the road network speed data X, and the target loss function is the known distribution P(X) of the forward diffusion process and the predicted distribution P θ-noise (X), that is The objective function is expressed as shown in formula (7):

[0092]

[0093] Step 3: Build a road network status feature learning model.

[0094] The road network state learning model includes a one-dimensional UNet local road network feature learning model Road Unet-1D and an attention global road network feature learning model Road Attention sub-modules. Road Unet-1D is used to extract road network features in the local field of view, and Road Attention is used to extract road network state features in the global field of view.

[0095] 1) Road Unet-1D——One-dimensional UNet local road network feature learning model

[0096] The present invention uses a one-dimensional UNet network to extract road section context information and location information from the local field of view. UNet belongs to an encoder-decoder structure. The encoder extracts features through downsampling convolution, and the decoder upsamples and deconvolutes to fuse features. The encoder is composed of 4 downsampling modules, each of which includes a convolution layer (Conv) and a maximum pooling layer (MaxPooling), wherein the convolution layer includes 3 layers of one-dimensional convolution structures with a kernel of 7 (1D-Conv) and 1 layer of residual structure (1D-ResNet), and the maximum pooling layer is a one-dimensional average pooling structure (1D-AvgPool). The decoder is composed of 4 upsampling modules, each of which includes a convolution layer, a deconvolution layer and a feature splicing layer. The convolution layer is a one-dimensional convolution structure with a kernel of 7, and the deconvolution layer is a one-dimensional upsampling module (UnSample) with scale=5. The feature splicing layer is used to fuse the road network features captured by the encoder.

[0097] The process of Road Unet-1D learning road network features is as follows:

[0098] A. Process the road network status in a unit time slice into a one-dimensional tensor X (the vector length is equal to the number of road sections);

[0099] B. Input X into the UNet encoder and extract the road network features after 4 steps of downsampling;

[0100] C. Input the road network features into the UNet decoder and fuse the road network features through 4 layers of upsampling;

[0101] D. Map the fused road network features into a one-dimensional tensor Y through the output layer (Y incorporates the road network structure features, and the vector length is equal to the number of road sections).

[0102] 2) Attention——Attention Global Road Network Feature Learning Model

[0103] The present invention uses the self-attention mechanism to extract the relevance of road sections from the global field of view. The most special feature of the attention mechanism is that it adds query (random clue) and selects input in a biased manner through query (random clue) and key (non-random clue).

[0104] The calculation process of the attention global road network feature learning model is as follows:

[0105] A. Process the road network status in a unit time slice into a one-dimensional tensor X (the vector length is equal to the number of road sections)

[0106] B. Calculate random clue input q i ,q i =W q *X, where W q is the weight matrix of random clue query

[0107] C. Calculate the involuntary clue input k i , k i =W k *X i , where W k is the weight of the non-random clue key

[0108] D. Calculate the network node state input v i , v i =W v *X i v i =W v *X i , where W v is the value weight matrix

[0109] E. Calculate the attention score a i And parameterize, a i =q i *ki , a i =softmax(a i )

[0110] F. Extracting road node features b based on attention scores i =∑ j a i,j *v i , and finally output the characteristics B of all nodes in the road network (the vector length is equal to the number of road sections).

[0111] In summary, the pseudo code of the road network state estimation model training and sampling algorithm based on the probability diffusion model is shown in Table 2:

[0112] Table 2 Pseudocode of road network state estimation model training and sampling algorithm

[0113]

[0114]

[0115] (3) Verifying the road network state estimation model

[0116] The road network state estimation model is verified from the following three aspects:

[0117] 1) To compare the model with other models, the MAE, MSE and other evaluation indicators of each model at multiple time steps (30min, 1h, 2h, 6h, 12h) were calculated, and the model effect was analyzed based on the indicator data;

[0118] 2) In order to analyze the changing rules of road network status, a full-time road network-level traffic status visualization analysis method is proposed based on the data heat map. Figure 6 It is a heat map of global error analysis of road network state estimation results. The horizontal axis of the heat map is the time index, the vertical axis is the road section index, and the main part is the normalized speed value of a certain road section at a certain time. Each point in the interval represents the normalized average speed value on the road section ([0,1]), and the color change represents the speed change. The lighter the color, the greater the speed value, and the darker the color, the smaller the speed value. After the heat map is drawn, the global error of the heat map data will be calculated, as shown in the attached figure. Figure 6 shown.

[0119] 3) In order to analyze the road network status error per unit time, a road network status visualization analysis method per unit time is proposed in combination with geographic location information. Figure 7 is the error analysis (per unit time) diagram of the road network state estimation result, Figure 8It is a road network status deduction diagram (unit time). The horizontal axis of the diagram is longitude, the vertical axis is latitude, the line segments represent road segments, the endpoints represent the road segment connection points, the data above the line segments are the absolute error and relative error between the estimated road segment status and the actual road segment status, and the line segment color indicates the error size, the darker the color, the smaller the error. Figure 7 , Figure 8 shown.

[0120] Example

[0121] The present invention is further described below in conjunction with a specific embodiment. The data used in this embodiment is the average driving speed data of motor vehicles on the expressway within the Fifth Ring Road in Beijing from December 7, 2019 to January 17, 2020. The sampling interval of the data is 5 minutes. The data example is shown in Table 3.

[0122] Table 3 Average speed data of motor vehicles within the Fifth Ring Road of Beijing from December 07, 2019 to January 17, 2020

[0123]

[0124] The data set is divided into training set, validation set and test set. The sample size calculation formula is the number of dates × the number of daily time slices × the number of road network sections, and the environmental attribute data size calculation formula is the number of dates × the attribute size with the maximum discrimination among environmental attributes. The specific division rules of the experimental data set are shown in Table 4.

[0125] Table 4 Dataset division rules

[0126]

[0127] (1) Evaluation indicators

[0128] Mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) are used as evaluation indicators. MSE and RMSE reflect the difference between the predicted value and the true value, MAE represents the absolute error size, and MAPE is dimensionless, which can more objectively reflect the degree of deviation between the measured value and the true value. The smaller the indicator value, the smaller the model inference effect (sampling effect). The formula is as follows:

[0129]

[0130] Where n is the number of samples, m is the number of road network sections, and y is the true sample value. is the inference prediction value.

[0131] (2) Experimental environment

[0132] The hardware and software environment that the TrafficDDPM model depends on are shown in Table 5. The deep learning framework is Pytorch, and the model training is mainly performed on the GPU.

[0133] Table 5 Experimental environment description

[0134]

[0135] (3) Experimental results analysis

[0136] The analysis is presented from three aspects: model comparison accuracy, global road network instance error, and road network error analysis per unit time.

[0137] 1) Comparative analysis of model accuracy

[0138] In the study of road network state estimation, there are few models that directly generate road network states. This paper selects two models commonly used for traffic flow prediction (HA, LSTM) to compare with this model. In addition, based on the same diffusion framework, this paper also compares the impact of different internal models (MLP, UNetAtt) on the final model indicators.

[0139] Using the Beijing road network test data, the average error indicators of the road network status of each model in multi-time estimation (30min, 1h, 2h, 6h, 12h) are shown in Table 6. The three models with the best results are marked in orange. The TrafficDDPM model uses environmental conditions to guide the inference results, so its effect in multi-step estimation is consistent. The comprehensive evaluation indicators of the TrafficDDPM model are better. In the same DDPM framework, the UNetAtt network has better ability to extract road network features than MLP. HA and LSTM have cumulative errors in long-term estimation, especially LSTM, so its average error is lower than that of the TrafficDDPM model.

[0140] Table 6 Comparison of average error indicators of various models

[0141]

[0142] Table 7 is a comparison of multi-step reasoning error indicators, which lists the reasoning results of each model in 30 minutes, 1 hour, 2 hours, 6 hours, and 12 hours, and uses orange to mark the intervals with better results. The TrafficDDPM model has no cumulative error in the number of reasoning steps, and the estimation effect is better than other models. LSTM has the best model effect in short-term (30 minutes) estimation, but it is easily affected by the cumulative error of the number of reasoning steps. The model degradation is particularly obvious in reasoning over 6 hours.

[0143] Therefore, the road network state estimation model based on the probability diffusion model proposed in the present invention is more in line with the actual needs of high precision in application.

[0144] Table 7 Comparison of multi-step reasoning error indicators

[0145]

[0146]

[0147] 2) Visualized comparative analysis of traffic status at the road network level at all times

[0148] The global laws learned by the probability diffusion traffic network model are visualized as follows: Figure 6 As shown in the figure, the left figure shows the real road network law (data are all from the test set, including 1 Sunday and 2 weekdays), and the right figure shows the road network law learned by the model when the guide weight is 0.6. The global average absolute error is 5.01km / h, and the average absolute percentage error is 12.92%. In the figure, the X-axis represents time (time slice index value), 0-287 is Sunday, 288-576 is Thursday, and 577-865 is Monday. The Y-axis represents the section index value. Each point in the interval represents the normalized value of the average speed on the section ([0,1]). The color change represents the speed change. The lighter the color, the greater the speed value, and the darker the color, the smaller the speed value. From the interval color change in the right figure, it can be seen that the traffic flow peak on Sunday is in the daytime and lasts for a long time. Monday and Thursday are weekdays with significant morning and evening peak characteristics, and the night traffic is in a free flow state. Both the left and right figures have the above characteristics and laws, so it can be proved that the probability diffusion traffic network model has mastered the law of road network state distribution. Fig. 9 It is the influence of diffusion time step on model accuracy.

[0149] 3) Visualization and comparative analysis of traffic status errors per unit time

[0150] Taking the Beijing Fifth Ring Expressway at 19:40 on 2019-12-29 as an example, the road network environment attributes are "time slice 236 holiday 1 Sunday 7 cloudy 4 off-peak 1 no license plate restriction", the model estimates the current road network status based on the above environmental attribute conditions. The error distribution between the road network status estimation result and the true value is as follows Figure 7 As shown in the figure, the line segments on the figure represent expressway sections. The darker the color of the section, the lower the error. The estimated relative error of 94% of the sections in the entire network is less than 15%. Only the estimation results of sections such as "Pingfang Bridge-Yuantong Bridge", "Siyuan Bridge-Wuyuan Bridge", and "Siyuan Bridge-Chaoyang Park Bridge" are slightly poor. The global average absolute error of the road network status at the current time is 4.87km / h, and the average absolute percentage error is 10.36%, which proves that the model has high inference accuracy per unit time. Fig.10 is the effect of conditional bootstrap weights on model accuracy.

Claims

1. A method for estimating the state of a traffic network based on a probability diffusion model, characterized in that: The following steps are involved: Step 1: Analyze the traffic network environment data and build a road network environment encoder; Step 2: Extract the road network status features and construct the road network level traffic status estimation model TrafficDDPM; In step 2, the traffic state estimation model TrafficDDPM is divided into four parts, namely, probability diffusion framework, road network state learning model, classifier-free guide and environmental condition encoder; the denoising probability diffusion model framework DDPM is used to maximize the fitting probability distribution, the road network environment encoder constructed in step 1 is used to extract the road network environment attributes and merge them into the environment code, the classifier-free guide is used to control the model sampling direction, and the U-shaped network structure and attention mechanism are used to extract the road network features; The operation process of the traffic state estimation model TrafficDDPM described in step 2 includes inputting the road network noise sequence into the probability diffusion framework, and the probability diffusion framework outputs the target road network state sequence after T-step sampling, wherein each sampling step needs to perform the following sub-steps: 1) In each sampling process, seven types of environmental information including time sequence, road section location, day of the week, holidays, peak and off-peak hours, weather, and traffic restriction policies and road network topology need to be input into the environmental condition encoder to generate environmental condition codes; 2) Encoding the environmental conditions into the classifier-free guide and converting them into guide conditions; 3) The road network state learning module is based on the guidance information and the noise sequence X of the previous time step t , sampling is performed from the probability distribution function to obtain X t-1 , when X t When back diffusion reaches X0, the road network result X0 is obtained and output; The process of constructing the road network-level traffic state estimation model TrafficDDPM in step 2 includes the following sub-steps: Step S21: define a probability diffusion framework, and use the result of adding Gaussian noise in multiple steps as samples X0, X1, ..., X t , the probability distribution of noise P is learned through the back diffusion process θ-noise(x) Finally, the sampling Sample is performed, from the pure noise sample X noise Eliminate P θ-noise(x) The noise sampled in multiple steps is finally obtained. The process includes: the probability distribution P of the noise in the traffic state estimation model TrafficDDPM is θ-noise(x) It is defined as shown in formula (2)-(3): p θ (x t-1 |x t )=N(x t-1 ;μ θ (x t ,t),∑ θ (x t ,t)) (3), Among them, T refers to the number of sampling steps, x 0:T1 Refers to the given sample x at time T1 T1 The reverse diffusion process to x0, N refers to Gaussian distribution, μ θ (x t ,t) refers to the mean of the sampled Gaussian distribution at time t,∑ θ (x t ,t) refers to the variance of Gaussian distribution; in the problem of network state generation, the network state under unit time slice is converted into a sequence X = (x1, x2, ..., x n ), each dimension represents the average speed of the current road section, according to the approximate optimal probability distribution P θ (x) generates a tensor of dimension o and defines the road network state estimation problem as shown in formula (4): Among them, V * Probability distribution The sampled data is is the probability distribution of the model fitting, refers to the true probability distribution; The target loss function is defined as the known distribution P(X) and the predicted distribution P in the forward diffusion process. θ-noise (X) is expressed as The objective function is defined as shown in formula (5): Among them, D KL (P|P θ ) refers to the distribution P and the distribution P θ KL divergence; if o! = n, the traffic state estimation model is applicable to the time series road network state prediction; if o = n, the input and output scales are limited, and the traffic state estimation model is applicable to the road network state estimation problem; Step S22, constructing an environmental coding condition guide, specifically, in the problem of generating a road network state guided by environmental conditions, adding an input condition y in the calculation process, where y is a tensor after encoding the multi-dimensional environmental condition features, y is the output of the road network environment encoder, and the road network state generation formula is expressed as shown in formula (6): Among them, p(x t-1 |x t ,y) refers to the joint conditional probability distribution guided by the classifier, x t-1 Refers to the sample at the previous moment of the diffusion process, μ(x t ,y) refers to the mean of the Gaussian distribution at time t in the diffusion process, Refers to the variance of the Gaussian distribution at time t of the diffusion process, and I refers to the unit matrix; The guidance weight scaling mechanism is added to the classifier, which is expressed as shown in formula (7): Among them, ε θ (x t ,y,t) refers to the prediction noise at time t under the guidance of the classifier, ε θ (x t ,t) refers to the prediction noise at time t without classifier guidance, and w refers to the guidance intensity of environmental conditions; Step S23, constructing a road network state feature learning model, and defining the road network state learning model as including Road Unet-1D and Road Attention submodules, wherein Road Unet-1D is used to extract road network features in a local field of view, and Road Attention is used to extract road network state features in a global field of view; Step 3: The traffic state estimation model TrafficDDPM obtained in step 2 is verified from the aspects of model accuracy comparison and instance error to obtain the traffic network state.

2. A method for estimating a traffic network state based on a probability diffusion model according to claim 1, characterized in that: In step 1, the traffic network environment data includes minute-level road section time, weekdays, weekdays, holidays, road network structure, weather and traffic policies.

3. The method for estimating the state of a traffic network based on a probability diffusion model according to claim 1, characterized in that: The road network environment encoder described in step 1 includes two parts: an environment encoder and a road network structure encoder. The environment encoder fuses the time sequence, road section location, week, holiday, peak and off-peak hours, weather or traffic restriction policy environment attributes into environment code using One-Hot encoding and a fully connected neural network as a conditional guidance signal; the road network structure encoder uses graph embedding technology DeepWalk to convert the known road network structure into a low-dimensional dense vector, and uses a low-dimensional feature vector to represent the road section nodes, road section connection relationships and road network structure information in the road network.

4. A method for estimating a traffic network state based on a probability diffusion model according to claim 3, characterized in that: In step 1, the road network structure encoder applies the graph embedding technology DeepWalk. First, the road network is converted into a coordinate graph according to the road segments and adjacency matrix. Then, multiple paths are generated by random walk to form training samples. Then, the random walk paths are used to complete the skip-gram task. Finally, the representation vector of each road segment is output through the softmax layer. The skip-gram task uses the Word2Vec model. The goal is to learn the conditional probability from the input vector to the output vector. Its objective function is expressed as shown in formula (1): The road network structure encoding model uses a three-layer neural network. The dimensions of the input layer and the output layer are V, representing the number of road sections. The hidden layer dimension is N, which is an adjustable parameter. The output layer uses the softmax activation function. The input vector w I Predicted output vector w O The conditional probability of the road segment is maximized by using the maximum likelihood method to make the inner product distance of similar road segments smaller.

5. The method for estimating the state of a traffic network based on a probability diffusion model according to claim 1, characterized in that: Step 3 further includes the following sub-steps: Step S31, horizontal comparison of model accuracy; Step S32, global error analysis of road network instance; Step S33: analyzing the error of the road network instance per unit time.

Citation Information

Patent Citations

  • Method and device for predicting traffic state and electronic equipment

    CN114387782A