Heterogeneous regional flow prediction method
Through the combination of band-shaped convolutional layer, extended causal convolutional layer, adaptive graph convolutional layer and cross-channel space attention layer, the problem of low traffic flow prediction accuracy in heterogeneous areas is solved, and high-precision and high-speed flow prediction is achieved, which is suitable for multi-region road monitoring.
Patent Information
- Application Number
- CN202510202320.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-22
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-02-22
AI Technical Summary
The prior art has poor accuracy in traffic flow prediction in heterogeneous areas, making it difficult to effectively capture the hidden traffic relationship between traffic nodes in heterogeneous areas, and the spatial and temporal map modeling is unstable, resulting in data spatial structure loss.
A neural network module consisting of band-shaped convolution layer, extended causal convolution layer, adaptive graph convolution layer and cross-channel space attention layer are used to process spatiotemporal information through jump connections and residual connections. Combined with spatiotemporal aggregation module, the road connection relationship and temporal correlation of heterogeneous regions are extracted to generate high-precision traffic prediction results.
It improves the accuracy and speed of traffic flow prediction in heterogeneous areas, and has strong compatibility, and is suitable for road flow monitoring issues in various areas.
Smart Images

Figure BDA0005284219730000043 
Figure BDA0005284219730000044 
Figure BDA0005284219730000052
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a heterogeneous regional traffic flow prediction method. Background Art
[0002] The accuracy of traffic flow prediction by existing artificial intelligence solutions has been greatly improved.
[0003] Among them, the common technical means of artificial intelligence solutions for traffic flow prediction are as follows:
[0004] 1. Through a convolutional neural network, spatio-temporal features in traffic flow data can be automatically extracted, which is suitable for processing traffic data with spatial correlation, such as road network structure and traffic flow distribution.
[0005] 2. Through recurrent neural networks such as long short-term memory networks (LSTM) and gated recurrent units (GRU), the time series features and long-term dependence relationships of traffic flow can be effectively captured, and it has high accuracy for short-term traffic flow prediction.
[0006] 3. Graph neural networks introduce a graph structure for the road network topology, which can fully consider the spatio-temporal correlation of traffic flow data and is suitable for traffic flow prediction of large-scale complex road networks.
[0007] However, in the means of graph neural network processing of the above artificial intelligence solutions, since the input of the spatio-temporal graph is dynamic, the existing methods are unstable for spatio-temporal graph modeling, and it is also difficult to capture the hidden relationships of traffic node flows in heterogeneous regions (adjacent regions but with different traffic flow distributions). In the graph structure, the dimensionality increase and decrease of data are likely to cause loss of the data spatial structure, resulting in poor traffic flow prediction accuracy for heterogeneous regions. Summary of the Invention
[0008] The purpose of the present invention is to overcome the above defects in the prior art and provide a heterogeneous regional traffic flow prediction method for solving the problem of poor traffic flow prediction accuracy in heterogeneous regions.
[0009] To achieve the above purpose, the present invention provides a heterogeneous regional traffic flow prediction method, which includes the following steps:
[0010] S1: The traffic monitoring module obtains the initial road traffic data through road network node deployment and transmits it to the feature analysis module;
[0011] S2: The feature analysis module analyzes the initial road traffic data, excludes abnormal data values, converts the initial traffic data into a feature matrix that can be input into the neural network, and inputs the feature matrix into the neural network traffic prediction module;
[0012] S3: The computing system in the neural network traffic prediction module performs prediction processing on the feature matrix in S2 through a number of stacked spatio-temporal modules. The number of spatio-temporal modules combines spatio-temporal information at different depths through skip connections and residual connections. The steps of their combination include the following sub-steps:
[0013] S31: The strip convolution layer stabilizes the spatial data structure through strip convolution. After expanding the spatial dimension through two-dimensional convolution, the strip blocks are used to connect the space and preprocess the spatial data;
[0014] S32: Use the extended causal convolution as the time convolution layer to obtain the time correlation between road network nodes;
[0015] S33: Imitate the road connection relationship between heterogeneous regions through the adaptive graph convolution layer, analyze spatial features, use the spatio-temporal aggregation module when facing the choice of vehicle flow convergence areas, effectively combine traffic node information in time and space after completing the inference of time steps, embed the predicted time step information into traffic nodes, and combine this spatio-temporal aggregation module to make the adaptive graph convolution layer pay attention to the change of time information;
[0016] S34: Learn the connectivity relationship of adjacent roads through the cross-channel spatial attention layer;
[0017] S35: Aggregate spatial and time information through residual connections and fully connected layers to obtain the traffic flow prediction result;
[0018] S4: Display the traffic flow prediction result through the traffic information visualization module, and display the traffic flow status and regulation plan of the monitoring area in real time.
[0019] Preferably, in step S31, the strip convolution layer connects long-distance spatial data in the input. Among them, the spatial features clustered by the point structure and the edge structure are used, and one-dimensional convolutions are performed in parallel on the inputs of the node and edge structures respectively using a convolution kernel of size 3. The output result Z is as follows:
[0020] Z = X ⊙ σ(g(x N ,x D ))
[0021] Among them, X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, ⊙ represents the Hadamard product operation of the matrix, σ is the sigmoid function, which maps the feature to the 0-1 interval, and the function g(-,-) represents the combination of the one-dimensional convolutions of the inputs at two positions respectively.
[0022] Preferably, in step S32, dilated causal convolution is used as the temporal convolutional layer to obtain the temporal correlation between road network nodes. Among them, the gated mechanism is selected for the temporal convolutional layer to control the flow of temporal information between layers. Among them, the first temporal convolutional module uses dilated causal convolution and the hyperbolic tangent activation function to learn the sequence feature representation. On the other hand, the second temporal convolutional module uses dilated causal convolution and the Sigmoid activation function to generate the gating signal, controlling the proportion of the features learned by the first temporal convolutional module passed to the next layer. The expression is as follows:
[0023] Z = tanh(Φ1 * X + c1) ⊙ σ(Φ2 * X + c2)
[0024] Among them, Z represents the output information, X represents the input information, Φ1, Φ2, c1, and c2 are model parameters, and tanh is the activation function, which keeps the data stable within the range of (-1, 1) to avoid the influence of gradient disappearance or gradient explosion.
[0025] Preferably, in step S33, the adaptive graph convolutional layer is a basic operation for extracting the given node structure information through convolution. Spatially, the graph convolution operation uses the information of the adjacent nodes around the road network nodes, and forms a new signal by smoothing the signal of the central node itself to a certain extent, increasing the robustness of the signal. Let X represent the input signal, and let represent the self-loop normalized adjacency matrix, Z ∈ R N×M represent the output signal, and W ∈ R D×M represent the learnable system parameter matrix. Define its graph convolution as:
[0026]
[0027] The adaptive graph convolutional layer generates an adaptive adjacency matrix by randomly initializing two learnable embedding nodes, so that the connection strength between nodes can be quantified and the spatial dependence relationship is explored. The specific method is as follows:
[0028]
[0029] Among them, G1 is named the source node embedding, and G2 is named the target node embedding. By multiplying G1 and G2, the spatial dependence weight between the source node and the target node is obtained. The ReLU activation function is used to eliminate the weak connections and retain the required road network relationships. The SoftMax function is used to normalize the adaptive adjacency matrix A adp Therefore, the normalized adaptive adjacency matrix A adp can be regarded as the node transition matrix in the graph convolution diffusion process.
[0030] Among them, the following adaptive graph convolutional layers are used to simulate the diffusion propagation process of graph signals for k finite steps:
[0031] Z = ∑P k XW k1 + ∑A adp XW k2
[0032] Among them, P k is the power of the transfer matrix.
[0033] Preferably, in step s33, the spatio-temporal aggregation module includes the following steps:
[0034] The temporal state embedding models the node state transition relationship P across time steps through a four-way tensor operation, and its calculation process satisfies:
[0035]
[0036] Among them, X is the traffic node feature matrix, M1, M2, and M3 are trainable time parameter matrices, V is the input vehicle flow speed vector, b P is the bias term, and the four-way tensor models the node state transition relationship P across time steps, which can dynamically adjust the weights of the affected areas in subsequent time steps;
[0037] Generate matrix D through dynamic spatial relationship modeling, and its calculation process satisfies:
[0038]
[0039] Among them, X is the traffic node feature matrix, L1, L2, and L3 are trainable spatial parameter matrices, V is the input vehicle flow speed vector, b D is the bias term, and the dynamic spatial relationship modeling generates matrix D through a chain product Construct a dimensionality reduction space interaction operator, which is combined with the adaptive graph convolution module to obtain the output spatio-temporal aggregation feature Z:
[0040] Z = DA adp WXP T
[0041] The spatio-temporal aggregation feature Z performs matrix multiplication on the dynamic spatial relationship modeling generated matrix D and the adaptive adjacency matrix A adp to generate a spatial correlation feature that fuses the real-time vehicle speed, performs matrix multiplication on the node state transition relationship matrix P and the input feature matrix X, realizes the joint encoding of the vehicle flow speed and the spatio-temporal state, and the finally output spatio-temporal aggregation feature Z simultaneously includes the road network topology constraint and the vehicle flow propagation delay characteristics.
[0042] Preferably, in step S34, the cross-channel spatial attention layer learns the connectivity between each input channel X and adjacent channels through the weight matrix H, avoiding the impact of dimensionality reduction on the spatial channels, eliminating the dimensionality reduction operation, optimizing the channel learning mechanism, and adaptively learning different weights for each channel through one-dimensional convolution. Its output result Z is expressed as:
[0043] Z = σ(HX)
[0044] Moreover, the size of the one-dimensional convolution kernel is determined according to the number of channels, and the mapping relationship Υ between the size θ of the convolution kernel and the number of channels Q is obtained. The relationship between the number of channels Q and the convolution kernel is logarithmically fitted, and the adaptive convolution kernel θ is generated according to the number of channels using the function Υ. This attention mechanism only uses the θ parameter, analyzes the spatial relationship through one-dimensional convolution, and retains the spatial structure of the high-dimensional channels. The expression of its processing steps is as follows
[0045]
[0046] ω = σ(Cov1 θ X),
[0047] where b1 and b2 respectively represent bias parameters, ω represents the processing result, {} od represents taking the odd number closest to X to ensure that the convolution size is odd, Cov1 θ X represents one-dimensional convolution with the convolution kernel θ, and σ(·) represents the sigmoid activation function.
[0048] Preferably, in step S35, the results of each module are fused through skip connections and residual connections, and then fed into the fully connected layer to obtain the final traffic flow prediction output. Among them, the mean absolute error is selected as the training objective after combining several spatio-temporal modules, and its definition is:
[0049]
[0050] where t represents the total number of time steps, X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, L(X (t+1):(t+T) ) is used as an overall output X (t+1):(t+T) , rather than generating X recursively through t t , which solves the problem that the model makes predictions for one step during training and testing and attempts to make predictions for multiple steps during inference. Its prediction results and real-time traffic flow conditions are uploaded to the visualization server through a wired network or a 5G network.
[0051] Preferably, in step S1, the traffic monitoring module deploys a variety of sensors and devices integrated at road network nodes. The variety of sensors and devices includes cameras and / or lidars and / or infrared sensors and / or pressure sensors. The variety of sensors and devices can accurately detect and analyze road traffic in different areas and obtain initial road traffic data.
[0052] Preferably, in step S2, the feature analysis module is deployed in an edge computing center relatively close to the transportation hub. The feature analysis module applies at least one central processing unit (CPU) and at least one graphics processing unit (GPU). The central processing unit (CPU) is used to call the graphics processing unit (GPU). The graphics processing unit (GPU) is used to process the initial road traffic data into a read mode of the neural network. The feature analysis module obtains the real-time initial road traffic data transmitted by each traffic monitoring module through 5G communication, obtains time data and spatial data, and generates a feature matrix to be transmitted to the neural network traffic prediction module;
[0053] In step S3, the computing system in the neural network traffic prediction module is deployed in an edge computing center relatively close to the transportation hub. The neural network traffic prediction module applies at least one central processing unit (CPU) and at least four graphics processing units (GPU). The central processing unit is used to call the graphics processing unit (GPU). The graphics processing unit (GPU) is used to run the traffic flow prediction neural network, receive the feature matrix from the real-time line and analyze it.
[0054] Preferably, in step S4, the traffic information visualization module retrieves the real-time traffic data and the data related to the prediction results of the neural network traffic prediction module, integrates the obtained real-time data and the prediction results. The traffic information visualization module deploys at least one display, one central processing unit (cpu) and at least one memory. The display is used to view the final traffic prediction result and the real-time traffic flow situation. The central processing unit (cpu) is used to generate visualization data. The memory is used to record the prediction results and the traffic flow trend.
[0055] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0056] 1. In the present invention, the computing system in the neural network traffic prediction module predicts and processes the feature matrix by a number of stacked spatio-temporal modules. These spatio-temporal modules combine spatio-temporal information at different depths through skip connections and residual connections, effectively dealing with different levels of spatio-temporal dependence relationships;
[0057] The neural network traffic prediction module combines the cross-channel spatial attention mechanism with graph convolution. Each graph convolution layer (striped convolution layer, temporal convolution layer (which includes an extended causal convolution layer), adaptive graph convolution layer (which includes a spatio-temporal aggregation module), cross-channel spatial attention layer, fully connected layer) processes the spatial dependencies of node information extracted by dilated random convolution layers at different granularity levels.
[0058] A striped convolution layer is introduced to minimize the impact of data amplification and enhance the spatial structure. This striped convolution layer is combined with the cross-channel spatial attention layer to avoid the impact of size reduction (of the model) and cope with spatial heterogeneity. The adaptive graph convolution layer is used to extract the nodes and road traffic relationships in the heterogeneous space, improving both the prediction accuracy and prediction speed. Further, when facing the selection of vehicle flow convergence areas, the spatio-temporal aggregation module can further reduce spatial heterogeneity in the way of spatio-temporal aggregation.
[0059] Moreover, the entire traffic prediction method has strong compatibility and can be applied to various regional road traffic monitoring and prediction problems.
[0060] 2. In summary, a heterogeneous regional traffic prediction method provided by the present invention not only effectively improves the traffic prediction accuracy, but also effectively improves the prediction speed, and has strong compatibility. Specific Embodiments
[0061] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are one embodiment of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0062] The embodiments of the present invention provide a heterogeneous regional traffic prediction method, which includes the following steps:
[0063] S1: The traffic monitoring module obtains the initial road traffic data through the deployment of road network nodes and transmits it to the feature analysis module;
[0064] In step S1, the main function of the traffic monitoring module is to collect traffic flow data in real time, including but not limited to information such as vehicle flow, vehicle speed, traffic density, etc. By deploying and integrating various sensors and devices at road network nodes, the various sensors and devices include cameras and / or lidars and / or infrared sensors and / or pressure sensors. The various sensors and devices can accurately detect and analyze the road traffic in different regions and obtain the initial road traffic data.
[0065] S2: The feature analysis module analyzes the initial road traffic data, excludes abnormal data values, converts the initial traffic data into a feature matrix that can be input into the neural network, and inputs the feature matrix into the neural network traffic prediction module;
[0066] In step S2, the feature analysis module is deployed in an edge computing center relatively close to a transportation hub (the transportation hub can be located at a key node among many road network nodes). The feature analysis module applies at least one central processing unit (CPU) and at least one image processing unit (GPU). The central processing unit (CPU) is used to call the image processing unit (GPU), and the image processing unit (GPU) is used to process the initial road traffic data into a reading mode of the neural network, with certain data calculation functions. The feature analysis module obtains the real-time initial road traffic data transmitted by each traffic monitoring module through 5G communication, obtains time data and spatial data, and generates a feature matrix to be transmitted to the neural network traffic prediction module.
[0067] S3: The computing system in the neural network traffic prediction module performs prediction processing on the feature matrix in S2 through a number of stacked spatio-temporal modules;
[0068] In step S3, the computing system in the neural network traffic prediction module is deployed in an edge computing center relatively close to a transportation hub. The neural network traffic prediction module applies at least one central processing unit (CPU) and at least four image processing units (GPU). The central processing unit is used to call the image processing unit (GPU), and the image processing unit (GPU) is used to run the traffic flow prediction neural network, receive the feature matrix from the real-time line and perform analysis;
[0069] In step S3, the specific processing steps of the neural network traffic prediction module are as follows:
[0070] A number of spatio-temporal modules (a number of spatio-temporal modules include the following strip convolutional layer, temporal convolutional layer, adaptive graph convolutional layer, cross-channel spatial attention layer, fully connected layer) combine spatio-temporal information of different depths through skip connections and residual connections, and effectively process spatio-temporal dependence relationships at different levels. The steps of combining them include the following sub-steps:
[0071] S31: The strip convolutional layer stabilizes the spatial data structure through strip convolution. After expanding the spatial dimension through two-dimensional convolution, it uses strip blocks to connect the space and preprocess the spatial data;
[0072] In step S31, the strip convolutional layer connects long-distance spatial data in the input as a method of modeling spatial correlation. Among them, using spatial features of point structure and edge structure clustering, one-dimensional convolution is performed in parallel on the inputs of node and edge structures respectively using a convolutional kernel of size 3, and the output result Z is as follows:
[0073] Z = X ⊙ σ(g(x N , x D ))
[0074] Wherein, X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, ⊙ represents the Hadamard product operation of matrices, σ is the sigmoid function that maps features to the 0-1 interval, and the function g(-, -) represents the combination after one-dimensional convolution of the inputs at two positions respectively. Compared with global average pooling, this strip convolution layer takes into account the enhancement of correlation preservation and space retention, and avoids the entire feature mapping.
[0075] S32: Use extended causal convolution as the temporal convolution layer to obtain the temporal correlation between road network nodes;
[0076] In step S32, extended causal convolution is used as the temporal convolution layer to obtain the temporal correlation between road network nodes. Among them, the temporal convolution layer is selected to use a gating mechanism to control the flow of temporal information between layers. Among them, the first temporal convolution module uses extended causal convolution and the hyperbolic tangent activation function to learn sequence feature representations. On the other hand, the second temporal convolution module uses extended causal convolution and the sigmoid activation function to generate a gating signal to control the proportion of the features learned by the first temporal convolution module passed to the next layer. Through this gating mechanism, the model can learn to decide when to suppress the feature representation by itself to enhance the model's ability to model the sequence context relationship. The gated spatio-temporal convolution network is more extensible in capturing temporal sequence dependencies and stable forms of feature representations, and its expression is as follows:
[0077] Z = tanh(Φ1 * X + c1) ⊙ σ(Φ2 * X + c2)
[0078] Wherein, Z represents the output information, X represents the input information, Φ1, Φ2, c1, and c2 are model parameters, and tanh is the activation function that keeps the data stable within the range of (-1, 1) to avoid the influence of gradient disappearance or gradient explosion.
[0079] S33: Imitate the road connection relationship between heterogeneous regions through the adaptive graph convolution layer to analyze spatial features. When facing the selection of vehicle flow convergence regions, use the spatio-temporal aggregation module. After completing the inference of the time step, effectively combine the traffic node information in time and space, embed the predicted time step information into the traffic nodes, and combine this spatio-temporal aggregation module to make the adaptive graph convolution layer pay attention to the change of time information, thereby reducing the spatial heterogeneity in the way of spatio-temporal aggregation;
[0080] In step S33, the adaptive graph convolutional layer is a basic operation for extracting the structural information of given nodes through convolution. Spatially, the graph convolution operation utilizes the information of adjacent nodes around the road network nodes, smooths the signal of the central node itself to a certain extent, and forms a new signal to increase the robustness of the signal. Let X represent the input signal, and use to represent the self-loop normalized adjacency matrix. Let Z ∈ R N×M represent the output signal, and W ∈ R D×M represent the learnable system parameter matrix. Define its graph convolution as:
[0081]
[0082] The adaptive graph convolutional layer generates an adaptive adjacency matrix by randomly initializing two learnable embedded nodes, enabling the strength of the connection relationship between nodes to be quantified and exploring spatial dependency relationships. The specific method is as follows:
[0083]
[0084] Among them, name G1 as the source node embedding and G2 as the target node embedding. By multiplying G1 and G2, obtain the spatial dependency weights between the source node and the target node. Use the ReLU activation function to eliminate weak connections and retain the required road network relationships. Use the SoftMax function to normalize the adaptive adjacency matrix A adp . Therefore, the normalized adaptive adjacency matrix A adp can be regarded as the node transition matrix in the graph convolution diffusion process.
[0085] Among them, the following adaptive graph convolutional layer is used to simulate the diffusion propagation process of the graph signal for k finite steps:
[0086] Z = ∑P k XW k1 + ∑A adp XW k2
[0087] Among them, P k is the power of the transfer matrix.
[0088] In step s33, the spatio-temporal aggregation module includes the following steps:
[0089] The temporal state embedding models the node state transition relationship P across time steps through a four-dimensional tensor operation, and its calculation process satisfies:
[0090]
[0091] Among them, X is the traffic node feature matrix, M1, M2, and M3 are trainable time parameter matrices, V is the input vehicle flow speed vector, and bP is the bias term. The four - dimensional tensor models the node state transition relationship P across time steps, which can dynamically adjust the weights of the affected area in subsequent time steps;
[0092] Generate matrix D through dynamic spatial relationship modeling, and its calculation process satisfies:
[0093]
[0094] where X is the traffic node feature matrix, L1, L2, L3 are trainable spatial parameter matrices, V is the input vehicle flow speed vector, and b D is the bias term. The matrix D generated by dynamic spatial relationship modeling is constructed by the chain product Construct a dimensionality reduction space interaction operator. Compared with the static adjacency matrix or the fully - connected weight matrix, the dimensionality reduction design of the chain product can avoid the prior assumption of explicitly defining the spatial relationship, and is more adaptable to the dynamically changing traffic network. It is combined with the adaptive graph convolution module to obtain the output spatio - temporal aggregation feature Z:
[0095] Z = DA adp WXP T
[0096] The spatio - temporal aggregation feature Z performs matrix multiplication on the matrix D generated by the dynamic spatial relationship modeling and the adaptive adjacency matrix A adp to generate a spatial correlation feature that fuses the real - time vehicle speed, and performs matrix multiplication on the node state transition relationship matrix P and the input feature matrix X to realize the joint encoding of the vehicle flow speed and the spatio - temporal state. The finally output spatio - temporal aggregation feature Z contains both the road network topology constraint and the vehicle flow propagation delay characteristics.
[0097] S34: Learn the connectivity of adjacent roads through the cross - channel spatial attention layer to avoid data loss caused by the dimensionality reduction of the neural network channels;
[0098] In step S34, the cross - channel spatial attention layer learns the connectivity between each input channel X and adjacent channels through the weight matrix H, avoids the impact of dimensionality reduction on the spatial channels, omits the dimensionality reduction operation, optimizes the channel learning mechanism, and adaptively learns different weights for each channel through one - dimensional convolution. Its output result Z is expressed as:
[0099] Z = σ(HX)
[0100] Moreover, determine the size of the one - dimensional convolution kernel according to the number of channels, obtain the mapping relationship Υ between the size θ of the convolution kernel and the number of channels Q, perform logarithmic fitting on the relationship between the number of channels Q and the convolution kernel, generate an adaptive convolution kernel θ using the function Υ according to the number of channels. This attention mechanism only uses the θ parameter, analyzes the spatial relationship through one - dimensional convolution, and retains the spatial structure of the high - dimensional channels. The expression of its processing steps is as follows
[0101]
[0102] ω = σ(Cov1 θ X),
[0103] where b1 and b2 represent bias parameters respectively, ω represents the processing result, {} od represents taking the odd number closest to X to ensure that the convolution size is odd, Cov1 θ X represents a one-dimensional convolution with a convolution kernel of θ, and σ(·) represents the sigmoid activation function.
[0104] S35: Aggregate spatial and temporal information through residual connection and fully connected layer to obtain the traffic flow prediction result;
[0105] In step S35, the results of each module are fused through skip connection and residual connection, and then fed into the fully connected layer to obtain the final traffic flow prediction output. Among them, the mean absolute error (MAE) is selected as the training objective after combining several spatio-temporal modules, and its definition is:
[0106]
[0107] where t represents the total number of time steps, X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, L(X (t+1):(t+T) ) as an overall output X (t+1):(t+T) , rather than generating X recursively through t t , which solves the problem that the model makes predictions for one step during training and testing and attempts to make predictions for multiple steps during inference. The prediction results and real-time traffic flow conditions are uploaded to the visualization server through a wired network or a 5G network.
[0108] S4: Display the traffic flow prediction result through the traffic information visualization module, and display the traffic flow status and regulation plan of the monitoring area in real time.
[0109] In step S4, the traffic information visualization module retrieves the real-time traffic flow data and the data related to the prediction results of the neural network traffic prediction module, integrates the obtained real-time data with the prediction results. The traffic information visualization module deploys at least one display, one central processing unit (CPU), and at least one memory. The display is used to view the final traffic prediction results and the real-time traffic flow situation. The central processing unit (CPU) is used to generate visualization data, and the memory is used to record the prediction results and the traffic flow trend. Among them, the traffic information visualization module uses the Python language for data processing, the Pandas library for data cleaning and processing, and NumPy for numerical calculations. A data server is built through a Web framework such as Flask or Django for the front end to request real-time traffic flow and prediction results. On the front end, JavaScript and a visualization library are used to draw real-time traffic flow diagrams, vehicle flow prediction diagrams, and error analysis diagrams, and the front and back ends are integrated and hosted using a Web server to ensure that the system can remain smooth during multi-user concurrent access.
[0110] In an embodiment of the present invention, a heterogeneous regional traffic prediction method is provided. In the calculation system of the neural network traffic prediction module, the feature matrix is predicted and processed by stacked spatio-temporal modules. These spatio-temporal modules combine spatio-temporal information of different depths through skip connections and residual connections, effectively dealing with spatio-temporal dependency relationships at different levels.
[0111] The neural network traffic prediction module combines the cross-channel spatial attention mechanism with graph convolution. Each graph convolution layer processes the spatial dependency of node information extracted by dilated random convolution layers at different granularity levels.
[0112] And by introducing a banded convolution layer, the impact of data magnification is minimized and the spatial structure is enhanced. This banded convolution layer is combined with the cross-channel spatial attention layer to avoid the impact of size reduction (of the model) and cope with spatial heterogeneity. An adaptive graph convolution layer is used to extract the nodes in the heterogeneous space and the relationship between road traffic flows, improving both prediction accuracy and prediction speed.
[0113] And this heterogeneous regional traffic prediction system has strong compatibility and can be applied to various regional road traffic flow monitoring and prediction problems.
[0114] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A heterogeneous regional traffic prediction method, characterized in that, It includes the following steps: S1: The traffic monitoring module obtains the initial road traffic data through the deployment of road network nodes and transmits it to the feature analysis module; S2: The feature analysis module analyzes the initial road traffic data, excludes abnormal data values, converts the initial traffic data into a feature matrix that can be input into the neural network, and inputs the feature matrix into the neural network traffic prediction module; S3: The computing system in the neural network traffic prediction module performs prediction processing on the feature matrix in S2 through a number of stacked spatio-temporal modules. The number of spatio-temporal modules combines spatio-temporal information of different depths through skip connections and residual connections. The steps of combining them include the following sub-steps: S31: The strip convolution layer stabilizes the spatial data structure through strip convolution. After expanding the spatial dimension through two-dimensional convolution, it uses strip blocks to connect the space and preprocesses the spatial data; S32: Use the dilated causal convolution as the time convolution layer to obtain the temporal correlation between road network nodes; S33: Imitate the road connection relationship between heterogeneous regions through the adaptive graph convolution layer, analyze spatial features, use the spatio-temporal aggregation module when facing the choice of vehicle flow intersection areas, effectively combine the traffic node information in time and space after completing the inference of the time step, embed the predicted time step information into the traffic nodes, and combine this spatio-temporal aggregation module to make the adaptive graph convolution layer pay attention to the change of time information; S34: Learn the connectivity relationship between adjacent roads through the cross-channel spatial attention layer; S35: Aggregate spatial and temporal information through residual connections and fully connected layers to obtain the traffic flow prediction result; S4: Display the traffic flow prediction result through the traffic information visualization module, and display the traffic flow status and regulation plan of the monitoring area in real time.
2. The heterogeneous regional traffic prediction method according to claim 1, wherein In step S31, the strip convolution layer connects long-distance spatial data in the input. Among them, using the spatial features clustered by the point structure and edge structure, one-dimensional convolutions are performed in parallel on the inputs of the node and edge structures respectively using a convolution kernel of size 3, and the output result Z is as follows: Z = X ⊙ σ(g(x N , x D )) Where X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, ⊙ represents the Hadamard product operation of the matrix, σ is the sigmoid function, mapping the feature to the 0-1 interval, and the function g(-,-) represents the combination after performing one-dimensional convolution on the inputs of two positions respectively.
3. A heterogeneous regional traffic prediction method according to claim 1, characterized in that In step S32, use the dilated causal convolution as the time convolution layer to obtain the temporal correlation between road network nodes. Among them, the time convolution layer is selected to use a gating mechanism to control the flow of temporal information between layers. Among them, the first time convolution module uses the dilated causal convolution and the hyperbolic tangent activation function to learn the sequence feature representation. On the other hand, the second time convolution module uses the dilated causal convolution and the sigmoid activation function to generate a gating signal to control the proportion of the features learned by the first time convolution module passed to the next layer. Its expression is as follows: Z = tanh(Φ1*X + c1)⊙σ(Φ2*X + c2) Among them, Z represents the output information, X represents the input information, Φ1, Φ2, c1, and c2 are model parameters, tanh is the activation function, which keeps the data stable within the range of (-1, 1) to avoid the influence of gradient vanishing or gradient explosion.
4. A heterogeneous regional traffic prediction method according to claim 1, characterized in that In step S33, the adaptive graph convolutional layer is a basic operation for extracting the structural information of given nodes through convolution. Spatially, the graph convolution operation uses the information of adjacent nodes around the road network nodes to smooth the signal of the central node itself to a certain extent, forming a new signal to increase the robustness of the signal. Let X represent the input signal, and let represent the self-loop normalized adjacency matrix, Z ∈ R N×M represent the output signal, and W ∈ R D×M represent the learnable system parameter matrix. Define its graph convolution as: The adaptive graph convolutional layer generates an adaptive adjacency matrix by randomly initializing two learnable embedding nodes, enabling the connection strength between nodes to be quantified and exploring spatial dependence relationships. The specific method is as follows: Among them, G1 is named as the source node embedding, and G2 is named as the target node embedding. By multiplying G1 and G2, the spatial dependence weight between the source node and the target node is obtained. The ReLU activation function is used to eliminate weak connections and retain the required road network relationships. The SoftMax function is used to normalize the adaptive adjacency matrix A adp for normalization. Therefore, the normalized adaptive adjacency matrix A adp can be regarded as the node transition matrix in the graph convolution diffusion process Among them, the following adaptive graph convolutional layer is used to simulate the diffusion propagation process of graph signals in k finite steps: Z = ∑P k XW k1 + ∑A adp XW k2 where P k is the power of the transfer matrix.
5. The heterogeneous regional traffic prediction method according to claim 3, wherein, In step s33, the spatio-temporal aggregation module includes the following steps: The temporal state embedding models the node state transition relationship P across time steps through a four-dimensional tensor operation, and its calculation process satisfies: P = tanh(V·σ(X T M1M2XM3 + b P )) where X is the traffic node feature matrix, M1, M2, and M3 are trainable time parameter matrices, V is the input vehicle flow speed vector, and b P is the bias term. The four-dimensional tensor models the node state transition relationship P across time steps and can dynamically adjust the weights of the affected area in subsequent time steps; The matrix D is generated through dynamic spatial relationship modeling, and its calculation process satisfies: D = tanh(V·σ(XL1L2(L3X) T + b D )) where X is the traffic node feature matrix, L1, L2, and L3 are trainable spatial parameter matrices, V is the input vehicle flow speed vector, and b D is the bias term. The dynamic spatial relationship modeling generation matrix D is constructed by the chain product L2(L3) T to construct a dimensionality reduction space interaction operator, which is combined with the adaptive graph convolution module to obtain the output spatio-temporal aggregation feature Z: Z = DA adp WXP T The spatio-temporal aggregation feature Z models the dynamic spatial relationship to generate a matrix D and an adaptive adjacency matrix A adp Perform matrix multiplication operations to generate spatial correlation features that incorporate real-time vehicle speeds. Perform matrix multiplication operations on the node state transition relation matrix P and the input feature matrix X to achieve joint encoding of vehicle flow speeds and spatio-temporal states. The finally output spatio-temporal aggregation feature Z simultaneously includes road network topology constraints and vehicle flow propagation delay characteristics.
6. The heterogeneous regional traffic prediction method according to claim 1, wherein In step S34, the cross-channel spatial attention layer learns the connectivity between each input channel X and adjacent channels through the weight matrix H, avoids the influence of dimensionality reduction on the spatial channels, omits the dimensionality reduction operation, optimizes the channel learning mechanism, and adaptively learns different weights for each channel through one-dimensional convolution. Its output result Z is expressed as: Z = σ(HX) Moreover, the size of the one-dimensional convolution kernel is determined according to the number of channels to obtain the mapping relationship Υ between the size θ of the convolution kernel and the number of channels Q. The relationship between the number of channels Q and the convolution kernel is logarithmically fitted, and the adaptive convolution kernel θ is generated using the function Υ according to the number of channels. This attention mechanism only uses the θ parameter, analyzes the spatial relationship through one-dimensional convolution, and retains the spatial structure of the high-dimensional channels. The expression of its processing steps is as follows ω = σ(Cov1 θ X), Among them, b1 and b2 respectively represent bias parameters, and ω represents the processing result, {} od means taking the odd number closest to X to ensure that the convolution size is odd, Cov1 θ X represents a one-dimensional convolution with a convolution kernel of θ, and σ(·) represents the sigmoid activation function.
7. A heterogeneous regional traffic prediction method according to claim 1, characterized in that, In step S35, the results of each module are fused through skip connections and residual connections, and then fed into the fully connected layer to obtain the final traffic flow prediction output. Among them, the mean absolute error is selected as the training target after combining several spatio-temporal modules, and its definition is: where t represents the total number of time steps, X represents a feature matrix input, N and D are the components of the feature matrix in two directions respectively, and L(X (t+1):(t+T) ) outputs X as a whole (t+1):(t+T) , rather than generating X recursively through t t , which solves the problem that the model makes predictions step by step during training and testing and attempts to make multi-step predictions during inference, and the prediction results and real-time traffic flow conditions are uploaded to the visualization server through a wired network or a 5G network.
8. A heterogeneous regional traffic prediction method according to claim 1, characterized in that In step S1, the traffic flow monitoring module deploys a variety of sensors and devices at road network nodes. The variety of sensors and devices include cameras and / or lidars and / or infrared sensors and / or pressure sensors. The variety of sensors and devices can accurately detect and analyze the road traffic flow in different areas and obtain the initial road traffic flow data.
9. A heterogeneous regional traffic prediction method according to claim 1, characterized in that In step S2, the feature analysis module is deployed at the edge computing center closer to the transportation hub. The feature analysis module applies at least one central processing unit CPU and at least one image processing unit GPU. The central processing unit CPU is used to call the image processing unit GPU, and the image processing unit GPU is used to process the initial road traffic flow data into the reading mode of the neural network. The feature analysis module obtains the real-time initial road traffic flow data transmitted by each traffic flow monitoring module through 5G communication, obtains time data and spatial data, and generates a feature matrix to transmit to the neural network traffic flow prediction module; In step S3, the computing system in the neural network traffic prediction module is deployed in an edge computing center relatively close to the transportation hub. The neural network traffic prediction module applies at least one central processing unit (CPU) and at least four graphics processing units (GPUs). The central processing unit is used to call the graphics processing unit GPU, and the graphics processing unit GPU is used to run the traffic flow prediction neural network, receive the feature matrix from the real-time line and perform analysis.
10. A heterogeneous regional traffic prediction method according to claim 1, characterized in that, In step S4, the traffic information visualization module retrieves the real-time traffic data and the data related to the prediction results of the neural network traffic prediction module, integrates the obtained real-time data with the prediction results. The traffic information visualization module deploys at least one display, one central processing unit (cpu) and at least one memory. The display is used to view the final result of traffic prediction and the real-time traffic flow situation. The central processing unit cpu is used to generate visualization data, and the memory is used to record the prediction results and traffic flow trends.
Citation Information
Patent Citations
Short-term traffic flow prediction method and system, electronic device and storage medium
CN112435462A
Space-time diagram convolution rainfall-runoff interval prediction method
CN115688561A
Space-time normalized graph convolutional neural network traffic flow prediction method and system, and medium
CN117392830A
Remote sensing image road extraction method, system and equipment based on large kernel convolution and direction stripe convolution, and medium
CN117789028A
Traffic state prediction method based on adaptive dynamic space-time diagram convolutional network
CN118116194A
Cited By
Traffic flow speculation method fusing curvature gradient
CN121838472A