A traffic data compensation method based on multi-feature dual discriminator
Through the traffic data compensation method based on multi-feature dual discriminator, the RoadNetPixel algorithm and ST-DDGAN component model are used to solve the problem of traffic data missing, and high-precision traffic data compensation is realized, which is suitable for data prediction and control of intelligent traffic systems.
Patent Information
- Application Number
- CN202311141096.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-09-06
AI Technical Summary
In intelligent transportation systems, the lack of traffic data is difficult to solve, especially in terms of road network traffic flow image generation, spatiotemporal correlation capture of traffic data, and external features affecting accuracy.
The traffic data compensation method based on multi-feature dual discriminator is adopted, and the road network traffic flow image is generated through the RoadNetPixel algorithm. Combined with the multi-head attention mechanism and the ST-DDGAN component model, the spatiotemporal features are captured and external factors are fused, and the adversarial training is carried out to complete the missing data.
Accurate compensation for missing traffic flow data is achieved, the accuracy of traffic data compensation is improved, and it can be applied to traffic flow prediction, control and path planning.
Smart Images

Figure CN117058882B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation, and in particular relates to a traffic data compensation method based on multi-feature dual discriminators. Background Art
[0002] Accurate and high-quality traffic data is the foundation for building intelligent transportation systems. However, traffic data loss is inevitable, creating significant challenges for building these systems. Traffic data restoration is a pressing issue for building smart cities and is attracting increasing attention from scholars.
[0003] In recent years, a growing number of scholars, both domestically and internationally, have begun to research and focus on traffic data compensation. Missing data compensation methods are primarily categorized as statistical, machine learning, and deep learning-based. Statistical methods primarily learn the statistical characteristics of traffic data and utilize historical data for missing data. Machine learning methods train machine learning algorithms to obtain the data most relevant to the missing data, which is then supplemented using a computational approach. Deep learning methods train neural networks to mine hidden features within the data to fill in the missing data.
[0004] Although many scholars have conducted extensive research on traffic data compensation and achieved good results, some challenges still exist:
[0005] Problem of generating road network traffic flow images: Urban roads are crisscrossed, and the spatial structure of the road network is complex. Traffic trajectories are structured data, while road network pixels are unstructured data. How to achieve the conversion from structured to unstructured data is a problem.
[0006] Traffic data faces complex spatiotemporal correlations: Traffic data is highly correlated across time and space. Checkpoints located adjacent to each other in Euclidean space may have weak spatial correlations. Conversely, some checkpoints may not be adjacent but nonetheless influence each other. Checkpoint traffic has strong temporal correlations during rush hour, but strong temporal correlations may also exist at other times. Capturing these hidden spatiotemporal correlations in traffic data is a clear challenge.
[0007] The impact of external characteristics of traffic data on data compensation results: In the collected traffic data, external factors will affect the changes in traffic flow. However, the intensity of the impact of external factors on traffic flow is inconsistent. How to accurately represent the impact of external characteristics of traffic data requires further research. Summary of the Invention
[0008] To solve the above technical problems, the present invention proposes a traffic data compensation method based on a multi-feature dual discriminator, comprising the following steps:
[0009] S1: Obtain checkpoint traffic data and a real traffic flow image x of the road network from the API interface provided by the data platform; the traffic data includes checkpoint sensor information and external attribute information;
[0010] S2: Convert the road network into a traffic network structure diagram;
[0011] S3: extracting relevant attributes from the checkpoint sensor information, wherein the relevant attributes include vehicle trajectory, checkpoint and road network traffic flow;
[0012] S4: Based on the relevant attributes extracted from the checkpoint sensor data and the established traffic network structure diagram, the influence relationship between the checkpoints is analyzed from the vehicle trajectory, and the road network traffic flow image R is generated using the RoadNetPixel algorithm;
[0013] S5: Capture the hidden spatiotemporal features in the traffic network based on the traffic flow image R;
[0014] S6: Use the multi-head attention mechanism to combine external factors and assign different weight coefficients to mine the external features of external attribute information;
[0015] S7: Fusing spatiotemporal features and external features to obtain fused features;
[0016] S8: Build ST-DDGAN component models;
[0017] S9: Input the fused features and the road network traffic flow image R into the ST-DDGAN component model, perform adversarial training based on the real traffic flow image x of the road network, and use the trained ST-DDGAN component model to complete the missing traffic data.
[0018] Beneficial effects of the present invention:
[0019] The present invention uses an automatic encoder-decoder structure generator and a dual discriminator structure to construct the ST-DDGAN component model, performs adversarial learning on the generator and discriminator, and compensates based on multiple features, which can accurately compensate for missing traffic flow data.
[0020] The present invention visualizes the road network and extracts spatiotemporal features based on the road network map. At the same time, it integrates external factors to complete missing data. In the case of high traffic data loss rate, the accuracy of traffic data compensation is high, and it can be used by relevant departments to predict traffic flow status, traffic control, and route planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of the process framework of a traffic data compensation method based on multi-feature dual discriminators of the present invention. DETAILED DESCRIPTION
[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0023] A traffic data compensation method based on multi-feature dual discriminator, such as Figure 1 Shown, including:
[0024] S1: Obtain checkpoint traffic data and a real traffic flow image x of the road network from the API interface provided by the data platform; the traffic data includes checkpoint sensor information and external attribute information;
[0025] S2: Convert the road network into a traffic network structure diagram;
[0026] S3: extracting relevant attributes from the checkpoint sensor information, wherein the relevant attributes include vehicle trajectory, checkpoint and road network traffic flow;
[0027] S4: Based on the relevant attributes extracted from the checkpoint sensor data and the established traffic network structure diagram, the influence relationship between the checkpoints is analyzed from the vehicle trajectory, and the road network traffic flow image R is generated using the RoadNetPixel algorithm;
[0028] S5: Capture the hidden spatiotemporal features in the traffic network based on the traffic flow image R;
[0029] S6: Use the multi-head attention mechanism to combine external factors and assign different weight coefficients to mine the external features of external attribute information;
[0030] S7: Fusing spatiotemporal features and external features to obtain fused features;
[0031] S8: Build ST-DDGAN component models;
[0032] S9: Input the fused features and the road network traffic flow image R into the ST-DDGAN component model, perform adversarial training based on the real traffic flow image x of the road network, and use the trained ST-DDGAN component model to complete the missing traffic data.
[0033] Raw data obtained through the data query API provided by the data platform is often not directly usable for data analysis due to its high repetitiveness and irrelevance. Data preprocessing can help identify and eliminate outliers, thereby improving the reliability and accuracy of subsequent experiments.
[0034] The road network is converted into a graph. The road network structure graph G = (V, E, A). In the network topology of the entire road network, V represents the set of nodes, each node represents a checkpoint that records traffic data, E represents the set of edges, each edge represents a traffic road connecting two checkpoints, and A represents the adjacency matrix of the road network. The value of each element of A indicates whether the corresponding nodes are connected. It is defined as follows:
[0035]
[0036] Among them, a i,j Indicates whether nodes i and j are connected.
[0037] The relevant attributes of the preprocessed data are extracted as follows:
[0038] S31: Vehicle trajectory Tr i :
[0039] The vehicle will be recorded by the checkpoints on the road during its driving process, and the vehicle trajectory contains all the checkpoints that the vehicle passes during its travel time on the road network.
[0040] Tr i ={m i1 ,m i2 ,m i3 ,…,m in}
[0041] Among them, m i1 Indicates that the vehicle passes the first checkpoint in the road network, m in Indicates that the vehicle has left the last checkpoint on the road network.
[0042] S32: Checkpoint traffic flow B i , D i :
[0043] Checkpoint traffic flow refers to the number of vehicles passing through a checkpoint within a certain period of time. Checkpoint traffic flow is divided into checkpoint observation traffic flow B i and the actual traffic flow at the checkpoint D i Due to equipment failure, improper maintenance, and intermittent communication, the data collected by the checkpoint may be missing, and there may be differences between the actual flow value and the observed flow value. i , D i Respectively expressed as:
[0044] B i ={b i1 ,b i2 ,b i3 ,…,b iT}
[0045] D i ={di1 ,d i2 ,d i3 ,…,d iT}
[0046] Among them, b iT represents the traffic flow at checkpoint i at time T, where the subscript i represents the checkpoint number, the subscript T represents the time, and b and d represent the observed and actual traffic flow values at the checkpoint.
[0047] S33: Road network traffic flow X, Y:
[0048] Road network traffic flow refers to the number of vehicles passing through the road network within a certain period of time. Road network traffic flow is divided into the observed traffic flow X and the actual traffic flow Y. The road network traffic flow X and Y are expressed as:
[0049] X={x1,x2,x3,…,x T}
[0050] Y={y1,y2,y3,…,y T}
[0051] Among them, x T ={B 1T ,B 2T ,B 3T ,…,B NT} represents the traffic flow value observed on the road network at time T, the subscript N represents the checkpoint number, and y T Represents the actual traffic flow value of the road network at time T.
[0052] S41: Traffic road network pixelation: A road network pixelation method RoadNetPixel is proposed to mine the influence relationship between checkpoints from vehicle trajectories and construct a road network traffic flow image R.
[0053] S411: Bayonet high-dimensional feature vector representation:
[0054] By analyzing vehicle trajectories, we found that vehicle trajectories have a certain structural similarity to sentences. In a sentence, words are constrained by the semantics of the context words, while in vehicle trajectories, the checkpoints are similar to words, m in Subject to m i(n-1) and m i(n+1) Word embedding technology tags words by mining relationships between sentence contexts, thereby exploring the intrinsic connections between words and reducing the dimensionality of the word space. Considering the structural similarity between trajectories and sentences, the skip-gram algorithm is used to extract high-dimensional feature representations from trajectories. t-SNE is then used to reduce the dimensionality and map them to a low-dimensional space.
[0055] Input a certain trajectory sample, introduce the skip-gram algorithm, mine the high-dimensional feature representation of the checkpoint from the trajectory, and obtain the high-dimensional feature vector representation of the checkpoint [c1, c2, ..., c N ]; the process can be expressed as:
[0056]
[0057] Where s represents the optimization target for a given corpus M.
[0058]
[0059] Among them, S m Represents the optimization goal for a given trajectory sample (m, context(m)), context(m) represents the predicted context checkpoint, and NEG(q) represents the negative sample generated by processing checkpoint q. q Indicates the probability of predicting a positive sample, p u Represents the probability of predicting negative samples, σ represents the sigmoid function, Represents the transpose of the low-dimensional word vector of the target card m, θ q and θ u They represent the contextual checkpoint vectors corresponding to checkpoint q and checkpoint u respectively.
[0060] S312: Bayonet low-dimensional feature vector representation:
[0061] Input high-dimensional bayonet feature vector [c1,c2,…,c N ], the t-SNE method is introduced to achieve dimensionality reduction and map it to a low-dimensional space; the similarity p between each checkpoint and its adjacent checkpoints in the high-dimensional space is calculated. ij , which can be expressed as:
[0062]
[0063] Among them, p i|j Indicates bayonet x j Distribution in x i The probability of the surrounding, N represents the total number of bayonet, c i 、c j 、c l 、c k Represent different bayonets in high-dimensional space, σ i 2 Represents variance.
[0064] Next, calculate the similarity q between each checkpoint and its adjacent checkpoints in the low-dimensional space ij , which can be expressed as:
[0065]
[0066] Among them, f i 、f j 、f k 、f l They represent different bayonets in the low-dimensional space.
[0067] The KL divergence (Kullback-Leibler Divergence) is introduced to measure the difference between the probability distribution of the high-dimensional space and the probability distribution of the mapped low-dimensional space. By minimizing the KL divergence, the position of the checkpoint in the low-dimensional space is continuously adjusted so that the similarity in the low-dimensional space is as close as possible to the similarity in the high-dimensional space. The KL divergence is defined as:
[0068]
[0069] Among them, P represents the joint probability distribution of each checkpoint in high-dimensional space, and Q represents the joint probability distribution of each checkpoint in low-dimensional space.
[0070] After t-SNE processing, the points close to each other in the high-dimensional data space are mapped to the low-dimensional data space to keep them close to each other. The final output is the bayonet feature representation in the low-dimensional space [f1,f2,…,f N ].
[0071] S413: Road network traffic flow image construction:
[0072] In order to convert the checkpoints in the low-dimensional space into a road network pixel matrix, the low-dimensional space is cut horizontally and vertically so that the pixel space contains all the checkpoints. However, the number of checkpoints contained in each pixel may be greater than or equal to 0. In order to ensure that each pixel in the road network pixel matrix contains at most one checkpoint, the pixels containing too many checkpoints are dispersed. The dispersion rule is to use the checkpoint containing the maximum traffic flow as the center, and the remaining checkpoints expand outward in a circle for dispersion. If the pixel point in the outer circle does not contain a checkpoint, this pixel point will be occupied. Otherwise, it will continue to expand outward in a circle until all checkpoints are dispersed to the nearest pixel point. When each pixel point contains at most one checkpoint, the road network pixel matrix P is obtained. Finally, the corresponding checkpoint traffic flow is filled into the road network pixel matrix P, and the missing checkpoints in the matrix are filled with 0 to generate the road network traffic flow image R. It can be expressed as:
[0073] R=P(X)={P(X1),P(X2),P(X3),…P(X n )}
[0074] Among them, P(X) represents the road network traffic flow image set, P(X n ) represents the road network traffic flow image observed at time n.
[0075] S521: Road network spatial correlation extraction: In order to better mine the internal topological correlation between adjacent checkpoints in the traffic network, GCN is introduced to learn complex topological structures to capture spatial dependencies. First, a filter is constructed to act on the nodes of the graph, and the spatial features between the nodes are captured through the first-order neighborhood. The node's own features are aggregated with the features of its neighboring nodes to update the node's feature representation. Then, by superimposing multiple convolutional layers, more complex topological structures and feature representations are extracted. The output of each graph convolutional layer serves as the input of the next layer, forming a layer-by-layer feature update process. Therefore, the model can gradually extract higher-level and more abstract feature representations, and better mine the internal topological correlation between adjacent checkpoints in the traffic network. The process of traffic network modeling is expressed as:
[0076]
[0077] Among them, σ represents the activation function, Indicates adding a self-loop adjacency matrix, Denotes the corresponding degree matrix, H l Represents the l-th layer feature matrix, W l represents the weight matrix of the lth convolutional layer, H (l+1) is the output of the l+1th layer, H (l+1) It is based on the lth layer and transmits the adjacent node information and updates the fusion of the target node features through the connection weights between the two layers. A represents the road network adjacency matrix and I represents the unit matrix.
[0078] The road network adjacency matrix and the traffic flow images R of the road network at multiple time steps are used as GCN inputs. The model will select adjacent nodes based on the topological information of the input data to fully capture the spatial topological relationship of the nodes. Then, the adjacent nodes and the target node are aggregated through a first-order filtering operation. After a series of convolution operations, the high-level spatial features of the road network are gradually extracted, and finally a serialized spatial graph R is generated. s .
[0079] S522: Road Network Time Correlation Extraction: In order to capture the long-distance temporal dependency of traffic, GRU is introduced to extract traffic time features and capture the temporal variation pattern of traffic data. This module takes the serialized spatial graph generated by GCN as input. GRU uses reset gates and update gates to learn and control the flow of traffic information in the time series, so that it can more effectively capture the dependency of traffic network in a longer time range. At the current time t, the spatial graph at the current time is input. and the hidden layer state information h at the previous moment t-1 , calculate the hidden layer state information at time t; reset gate r t Expressed as:
[0080]
[0081] Among them, σ is the sigmoid activation function, the output mapping range is (0,1), W r To reset the gate weight matrix, h t-1 is the hidden layer state information at time t-1, b r is the reset gate coefficient vector; r t The smaller the value, the more hidden traffic information at the previous moment needs to be discarded; the candidate hidden layer state information at time t Expressed as:
[0082]
[0083] Among them, b h represents the learnable parameters of the hidden layer.
[0084] Update gate z t It determines the degree of retention of the traffic status information at the previous moment in the current moment, which is expressed as:
[0085]
[0086] Among them, W z To update the gate weight matrix, b z is the update gate coefficient vector; z t The smaller the value, the less traffic status information is transmitted at the previous moment; the hidden layer state information h at time t can be obtained t , expressed as:
[0087]
[0088] Finally, the output spatiotemporal features at time t can be obtained Expressed as:
[0089]
[0090] Among them, W0 is the weight matrix of the output layer, and b0 is the output layer coefficient vector.
[0091] Taking into account the involvement of multiple external factors, a multi-head attention mechanism is used to extract features of external factors, refine traffic external feature information from multiple dimensions and prevent overfitting.
[0092] First, the weather, day of the week, and time period are discretized using one-hot encoding and converted into fixed-length vectors. The three external factor vectors are concatenated, and the concatenated vector is set as E. Then, E is input into the multi-head attention layer of the multi-head attention mechanism model, and by calculating the scaled dot product attention, rich external features are extracted. The multi-head attention calculation process is as follows:
[0093] The first step is linear transformation. The query, key, and value vectors of the input sequence are transformed to the same dimension through different linear transformations to facilitate subsequent attention calculations and improve the ability to capture the potential structure of external features. It is expressed as:
[0094] Q=E'·W q
[0095] K=E'·W k
[0096] V=E'·W v
[0097] Among them, Q, K, V represent the query vector, key vector and value vector of the input sequence respectively, E' represents the vector after the embedding operation, and W q , W k and W v Represent the weight matrices of Q, K, and V respectively.
[0098] The second step is to calculate the scaled dot product attention. Calculate the scaled dot product of Q and K, dig out the mutual connections between weather, day of the week and time period, and capture the internal dependency, which is expressed as:
[0099]
[0100] Among them, Attention(Q,K,V) represents the internal dependency of vector E, d k The softmax function converts the attention score into a numerical value. On the one hand, it can be normalized to obtain a probability distribution in which the sum of all weight coefficients is 1. On the other hand, it can highlight the weight of important external factors. Finally, the weight is weighted and summed with the value to obtain the final Attention value.
[0101] The third step is to extract multi-dimensional external features: external factors are incorporated into multiple attention layers. Each attention layer can independently focus on different parts of the external factors, which helps to capture more information. Each attention layer is calculated separately and the results are spliced together, expressed as:
[0102] MultiHead(Q,K,V)=Concat(head1,…,head i ,…,head h )
[0103] Among them, MultiHead(Q,K,V) represents the output of the attention layer, h represents the number of attention heads, and head i represents the scaled dot product attention result of the i-th head.
[0104] The fourth step is weight connection: combine the results of multi-head attention into a vector, expressed as:
[0105] Ex=MultiHead(Q,K,V)W i
[0106] Among them, Ex represents the fusion vector, W i represents a learnable parameter matrix.
[0107] Finally, the results of the multi-head attention are residually connected and normalized through the normalization layer (LayerNorm) to output the external features Fe E , expressed as:
[0108] Fe E =LayerNorm(Ex)
[0109] The extracted spatiotemporal features Fe ST and external features Fe E Perform feature fusion, multiply them by the corresponding weights, and then add the results to obtain the fused feature F, which is expressed as:
[0110] F=Fe ST w ST +Fe E w E
[0111] Among them, F represents the fusion feature, Fe ST Represents spatiotemporal characteristics, Fe E Represents external features, w ST and w E Represent the weights of spatiotemporal features and external features respectively.
[0112] In order to generate high-quality road network traffic flow images using the traffic network image generation model, the spatiotemporal features mined by the ST-DDGAN component are constructed. The ST-DDGAN component includes: a generator G and a discriminator D. The generator G is an autoencoder-decoder structure. The autoencoder replaces the convolution layer with a residual block in the residual network. Each residual block contains two convolution operations with the same convolution kernel and batch normalization. The discriminator D is a dual discriminator structure, including a global discriminator D. G and local discriminator D L At the same time, the fusion feature F is used to optimize the generator of the ST-DDGAN component to improve the quality of the generated traffic data. Finally, the discriminator of the ST-DDGAN component is designed as a dual discriminator structure to comprehensively evaluate the quality of the generated road network traffic flow images from both global and local perspectives.
[0113] To further improve the realism and accuracy of the generated road network traffic flow images, the generator G of ST-DDGAN adopts an autoencoder structure, taking as input the fused features F and the road network traffic flow image R. The encoder first convolves the road network traffic flow image, replacing the convolutional layer with residual blocks from a residual network. Each residual block contains two convolution operations with the same convolution kernel and batch normalization, effectively preventing network gradient vanishing. The encoder obtains the hidden layer features, enabling more realistic data generation. Finally, the decoder de-encodes the hidden layer features and the fused features F to generate the road network traffic flow image.
[0114] In order not to ignore the unique spatiotemporal properties of the traffic network, the discriminator of ST-DDGAN is designed as a global discriminator D G and local discriminator D L The dual discriminators focus on the global and local information of the generated road network traffic flow images, respectively. The global discriminator receives the generated road network traffic flow images and the real road network traffic flow images and determines whether the road network traffic flow images are true or false. The global discriminator's judgment results update the parameters of the generator, constraining the generator to produce more accurate road network traffic flow images. The generator also constrains the global discriminator, which continuously improves its discrimination ability. The loss function of the global discriminator can be expressed as:
[0115]
[0116] Among them, x represents the real road network traffic flow image, G(z) represents the road network traffic flow image generated by the generator, and D G (x) represents the judgment result of the global discriminator on the real data x, D G (G(z)) represents the judgment result of the global discriminator in generating data G(z), represents the expectation when all data are real data, Indicates that all data are expectations when generating data, p g (x) represents the probability distribution function of x, p s (z) represents the probability distribution function of z.
[0117] The local discriminator receives the generated road network traffic flow image and the local area of the real road network traffic flow image to evaluate the probability that the generated road network traffic flow image has the spatiotemporal attributes of the traffic data. The loss function of the local discriminator can be expressed as:
[0118]
[0119] Among them, x c Represents the local area of the real road network traffic flow image, G(z) c Represents the local area of the road network traffic flow image generated by the generator.
[0120] When the generated road network traffic flow image is realistic enough, the dual discriminator cannot make an effective judgment. Finally, the missing traffic data is compensated based on the trained model to obtain the road network traffic compensation result Y', which can be expressed as:
[0121] Y'=Recover(R r ,F)
[0122] Among them, Y' represents the road network traffic flow image after the missing data is completed, R r represents a road network traffic flow image with missing data, F represents the fusion feature of the traffic data with missing data, and Recover() represents the ST-DDGAN component performing the operation of completing the missing traffic data at the checkpoint.
[0123] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A traffic data compensation method based on multi-feature dual discriminator, characterized in that: include: S1: Obtain checkpoint traffic data and a real traffic flow image x of the road network from the API interface provided by the data platform; the traffic data includes checkpoint sensor information and external attribute information; S2: Convert the road network into a traffic network structure diagram; S3: extracting relevant attributes from the checkpoint sensor information, wherein the relevant attributes include vehicle trajectory, checkpoint and road network traffic flow; S4: Based on the relevant attributes extracted from the checkpoint sensor data and the established traffic network structure diagram, the influence relationship between the checkpoints is analyzed from the vehicle trajectory, and the road network traffic flow image R is generated using the RoadNetPixel algorithm; According to the relevant attributes extracted from the checkpoint sensor data, the influence relationship between checkpoints is analyzed from the vehicle trajectory, and the RoadNetPixel algorithm is used to generate the road network traffic flow image R, including: The vehicle trajectory consists of multiple checkpoints. The vehicle trajectory sample is input and the skip-gram algorithm is introduced to mine the high-dimensional feature representation of the checkpoint from the trajectory to obtain the high-dimensional feature vector representation of the checkpoint [c1, c2, …, c N ], the t-SNE method is introduced to analyze the high-dimensional feature vectors [c1,c2,…,c N ] Perform dimensionality reduction processing and map it to a low-dimensional space; Calculate the similarity p between each checkpoint and its adjacent checkpoints in the high-dimensional space ij , and calculate the similarity q between each checkpoint and its adjacent checkpoints in the low-dimensional space ij ; By minimizing the KL divergence, the position of the checkpoint in the low-dimensional space is continuously adjusted to make the similarity in the low-dimensional space as close as possible to the similarity in the high-dimensional space, and the checkpoint feature vector [f1,f2,…,f N ]; Cut the low-dimensional space horizontally and vertically so that the pixel space contains all the bayonet points; For pixels that contain too many checkpoints, the checkpoint containing the maximum traffic flow is used as the center, and the remaining checkpoints are expanded outward in a circle for dispersion. If the pixel point in the outer circle does not contain a checkpoint, this pixel point is occupied. Otherwise, it continues to expand outward in a circle until all checkpoints are dispersed to the nearest pixel point. When each pixel point in the pixel space contains at most one checkpoint, the road network pixel matrix P is obtained; Fill the corresponding checkpoint traffic flow into the road network pixel matrix P, and fill the missing checkpoints in the matrix with 0 to generate the road network traffic flow image R; S5: Capture the hidden spatiotemporal features in the traffic network based on the road network traffic flow image R; S6: Splice external factors through the multi-head attention mechanism and assign different weight coefficients to mine the external features of external attribute information; S7: Fusing the spatiotemporal features and the external features to obtain fused features; S8: Establish ST-DDGAN component model; The ST-DDGAN component model includes: a generator G and a discriminator D; The generator G is an autoencoder-decoder structure. The autoencoder replaces the convolutional layer with the residual block in the residual network. Each residual block contains two convolution operations with the same convolution kernel and batch normalization. The discriminator D is a dual discriminator structure, including a global discriminator D G and the local discriminator D L ; S9: Input the fused features and the road network traffic flow image R into the ST-DDGAN component model, perform adversarial training based on the real traffic flow image x of the road network, and use the trained ST-DDGAN component model to complete the missing traffic data.
2. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: Convert the road network into a traffic network structure diagram, including: The road network is converted into a graph G = (V, E, A), where V represents a set of nodes, each node represents a checkpoint that records traffic data, E represents a set of edges, each edge represents a traffic road connecting two checkpoints, and A represents the adjacency matrix of the road network. The value of each element in the adjacency matrix A of the road network represents whether the corresponding nodes are connected.
3. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: According to the road network traffic flow image R, the hidden spatiotemporal features in the traffic network are captured, including: Construct a filter to act on the nodes of the graph, capture the spatial features between nodes through the first-order neighborhood, aggregate the node's own features with the features of its neighboring nodes to update the node's feature representation, and extract more complex topological structures and feature representations by stacking multiple convolutional layers. The output of each convolutional layer is used as the input of the next layer, forming a layer-by-layer feature update process to obtain an improved GCN network. The road network adjacency matrix and the road network traffic flow images R of multiple time steps are input into the improved GCN network. The improved GCN network selects adjacent nodes according to the topological information of the input data. The adjacent nodes and the target nodes are aggregated through a first-order filtering operation. After a series of convolution operations, the high-level spatial features of the road network are gradually extracted, and finally a serialized spatial graph R is generated. s ; The serialized spatial graph R s Input GRU network, GRU network uses reset gate and update gate to learn to control the flow of traffic information in time series, at the current time t, input the spatial map at the current time and the hidden layer state information h at the previous moment t-1 , calculate the hidden layer state information at time t, and according to the hidden layer state information at time t, the output spatiotemporal characteristics at time t can be obtained 4. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: Through the multi-head attention mechanism, external factors are spliced and assigned different weight coefficients to mine the external features of external attribute information, including: The weather, day of the week and time period in the external information are discretized by one-hot encoding and converted into a vector of fixed length. The three external factor vectors are concatenated to obtain the concatenated vector E; Input the vector E into the multi-head attention layer of the multi-head attention mechanism model, and transform the query Q, key K and value V vectors of vector E to the same dimension through linear transformation; Calculate the scaled dot product of Q and K of vector E to mine the connections between weather, day of the week and time period, and capture the internal dependencies of vector E; Incorporate external factors into multiple attention layers, each of which can independently focus on different parts of the external factors, calculate each attention layer separately, and stitch the results together; Combine the results of multiple attention heads into one vector; The results of the multi-head attention are residually connected and normalized through the normalization layer to output the external features Fe E .
5. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: The spatiotemporal features and external features are fused to obtain fused features, including: F=Fe ST ·w ST +Fe E ·w E Among them, F represents the fusion feature, Fe ST Represents the spatiotemporal characteristics, Fe E represents the external features, w ST and w E Represent the weights of spatiotemporal features and external features respectively.
6. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: The fused features and the road network traffic flow image R are input into the ST-DDGAN component model, and adversarial training is performed based on the real traffic flow image x of the road network, including: The fused features F and the road network traffic flow image R are input into the generator G. The encoder of the generator G convolves the road network traffic flow image to obtain the hidden layer features. The decoder of the generator G de-encodes the hidden layer features and the fused features to generate the road network traffic flow image z. The generated road network traffic flow image z and the real traffic flow image x of the road network are input into the discriminator D. The global discriminator D of the discriminator D G Globally distinguish the authenticity of the road network traffic flow image z and the real traffic flow image x, and establish a global discriminator D G The loss function of the discriminator D; the local discriminator D L Analyze the authenticity of the local areas of the road network traffic flow image z and the real traffic flow image x, and establish a local discriminator D L The loss function of the global discriminator D G and the local discriminator D L The discrimination result is fed back to the generator G, which constrains the generator G to generate a more realistic road network traffic flow image. G The loss function and local discriminator D L When the loss of the loss function is minimized, the parameters of the ST-DDGAN component model are fixed to complete the training of the ST-DDGAN component model.
7. The traffic data compensation method based on multi-feature dual discriminator according to claim 6 is characterized in that: The global discriminator D G The loss function and local discriminator D L The loss function includes: Global Discriminator D G The loss function is: Local Discriminator D L The loss function is: in, Denotes the global discriminator D G The loss function is: G represents the generator G, x represents the real road network traffic flow image, G(z) represents the road network traffic flow image z generated by the generator, D G (x) represents the judgment result of the global discriminator on the real road network traffic flow image x, D G (G(z)) represents the judgment result of the global discriminator in generating data G(z), represents the expectation when all data are real data, Indicates that all data are expectations when generating data, p g (x) represents the probability distribution function of the real road network traffic flow image x, p s (z) represents the probability distribution function of the generated road network traffic flow image z; x c Represents the local area of the real road network traffic flow image x, G(z) c Represents the local area of the road network traffic flow image z generated by the generator.
8. The traffic data compensation method based on multi-feature dual discriminator according to claim 1 is characterized in that: The ST-DDGAN component model after training is used to complete the missing traffic data, including: Y'=Recover(R r ,F) Among them, Y' represents the road network traffic flow image after the missing data is completed, R r represents a road network traffic flow image with missing data, F represents the fusion features of the traffic data with missing data, and Recover() represents the ST-DDGAN component performing the completion operation on the missing traffic data at the checkpoint.
Citation Information
Patent Citations
Traffic data restoration method based on graph convolution time sequence generative adversarial network
CN111540193A
Traffic flow data interpolation method based on time-space road network pixelated representation
CN116206443A