Road section flow space-time prediction method based on double-layer deep learning model
Through a two-layer deep learning model, combined with long and short-term memory networks and convolutional neural networks, the spatiotemporal characteristics of traffic flow are extracted, and the problem that existing prediction methods are difficult to capture complex spatiotemporal characteristics is solved, achieving higher precision traffic flow prediction.
Patent Information
- Application Number
- CN202510326431.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-06
AI Technical Summary
Existing traffic flow prediction methods are difficult to accurately capture spatiotemporal features, resulting in limited prediction accuracy, especially when facing complex nonlinear and dynamic traffic flow scenarios.
The dual-layer deep learning model is adopted to extract time series features and convolutional neural networks through long and short-term memory networks to capture spatial structural features, and combine spatial and temporal features for weighted fusion to predict short-term traffic on road sections.
It significantly improves the prediction accuracy of short-term traffic on road sections, and can more effectively integrate spatiotemporal information and adapt to changes in different traffic scenarios.
Smart Images

Figure CN120108189A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for spatiotemporal prediction of road section flow based on a double-layer deep learning model. Background Art
[0002] Accurate prediction of road traffic flow is the core means to achieve intelligent transportation, which is closely related to the efficiency of urban traffic management and the optimal allocation of resources.
[0003] Traditional traffic flow forecasting methods are mainly based on statistical models and linear models. For example, time series analysis makes predictions by analyzing the trends and periodicity of historical traffic data; models based on linear regression attempt to establish a linear relationship between traffic flow and related factors.
[0004] However, in reality, traffic flow is affected by many complex factors, such as weather conditions, road conditions (such as road construction, road damage, etc.) and special events (such as large-scale sports events, concerts, etc.), which make traffic flow show obvious nonlinear and dynamic characteristics. Therefore, the traditional linear and stable assumptions are difficult to accurately describe the actual traffic flow change law, resulting in a large deviation between the prediction results and the actual situation.
[0005] Currently, deep learning technology has made breakthrough progress in many fields with its powerful nonlinear modeling capabilities, and has also brought new opportunities for traffic flow prediction, but it has also encountered many challenges.
[0006] First, because traffic flow data has significant spatiotemporal coupling characteristics, the flow changes in the time dimension and the flow between different road sections in the spatial dimension are closely intertwined. Existing prediction methods based on deep learning technology often only focus on one aspect of time series information or spatial information, and fail to fully explore the intrinsic connection between the two, resulting in limited prediction accuracy.
[0007] Secondly, the current model is faced with highly dynamic and uncertain traffic flows, making it difficult to quickly and accurately adjust prediction results.
[0008] Furthermore, there are large differences in traffic flow patterns between different cities or different road networks within the same city. Factors such as city size, functional layout, and residents' travel habits will lead to different traffic flow patterns. For example, the traffic flow changes in tourist cities during the peak and off-seasons are completely different from those in industrial cities; the peak hours and flow rates of traffic in the city's central business district and residential areas are also very different. Existing traffic flow prediction models are insufficient in terms of versatility and adaptability, and it is difficult to achieve good prediction results in different traffic scenarios.
[0009] In summary, improving the accuracy, reliability and adaptability of traffic flow prediction based on deep learning technology is still a topic that needs to be solved urgently. Summary of the invention
[0010] In order to solve the above technical problems, the present invention provides a road section flow spatiotemporal prediction method based on a two-layer deep learning model, the method comprising the following steps: S1. Collect historical cross-sectional flow data and real-time cross-sectional flow data of the target road; S2. Capturing the spatiotemporal characteristics of the cross-sectional flow prediction of the target road through a two-layer deep learning model to predict the short-term cross-sectional flow of the target road; wherein the spatiotemporal characteristics include time series characteristics and spatial structure characteristics; S3, establishing a parameter matrix according to the time series characteristics and the spatial structure characteristics, and obtaining a short-term cross-sectional flow prediction result of the target road by weighted fusion; S4. Compare the short-term section flow prediction result with the real-time section flow through the loss function and fit and optimize the parameters of the two-layer deep learning model.
[0011] Further: The time series feature is used to capture the time dependency of the historical cross-section flow data of the target road; The spatial structure feature is used to capture the spatial correlation between the target road sections.
[0012] Furthermore, the S2 further includes: S21, preprocessing the historical section flow data by second-order difference and scaling; mining the temporal correlation of the preprocessed historical section flow data based on an optimized long short-term memory network to extract the time series features; S22. Capture the spatial correlation between the target road sections based on an optimized convolutional neural network combined with a ReLU activation function to extract the spatial structural features.
[0013] Furthermore, the historical cross-sectional flow data is preprocessed by second-order difference and scaling in S21, specifically including: The second-order difference is used to improve the smoothness of the historical cross-sectional flow data, which satisfies the expression: ,in, Representation of cross section The daily cycle data series, Representation of cross section Initial cross-sectional flow data; The data after the second-order difference processing is scaled and the extreme values are truncated.
[0014] Furthermore, each unit of the long short-term memory network includes a forget gate, an input gate and an output gate, and the input of the forget gate is the hidden layer state of the previous unit. And the input of the section flow of the day ,in: The output of the forget gate satisfies the expression ; The output of the input gate satisfies the expression ; The output of the output gate satisfies the expression ; in, express Always forget the input of the gate; Represents the sigmoid function; Represents the weight matrix of the forget gate; Represents the vector consisting of the hidden state at the previous moment and the input at the current moment; , as well as All are bias terms; represents the output of the input gate; Represents a new candidate cell state.
[0015] Furthermore, the output dimension of the LSTM network is compressed by global average pooling to prevent overfitting.
[0016] Furthermore, the optimized convolutional neural network combined with the ReLU activation function in S22 captures the spatial correlation between the target road sections, specifically including: Using the optimized convolutional neural network, the spatial position relationship between different time periods of the section of the target road and different sections of the same line is mapped into a two-dimensional grid, wherein the horizontal direction of the two-dimensional grid is the time period, and the vertical direction of the two-dimensional grid is the spatial association between the sections; Extracting local spatial structural features through convolution kernels; The ReLU activation function is used to assist in learning the spatiotemporal features between the target road sections.
[0017] Furthermore, the optimized operation formula of the convolutional neural network is: , Among them, the function is the input function, function is the convolution kernel function, is the feature map, and represents the input spatiotemporal two-dimensional data, and Indicates the position of the input signal.
[0018] Furthermore, the short-term cross-sectional flow prediction result outputted finally is recorded as , which satisfies the formula: , in, Represents the prediction results based on the time series model, Represents the prediction results based on the spatial convolution model; is the activation function; represents the Hadamard product; is the activation function; and are the time parameter matrix and spatial parameter matrix to be learned respectively.
[0019] Furthermore, the loss function satisfies the formula: , in, is the loss function, represents the weight coefficient, represents the compensation coefficient, It is a cross section The real flow rate, It is a cross section The predicted flow rate, represents the total number of sections in the road network, Indicates a specific cross section.
[0020] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: The road traffic flow spatiotemporal prediction method based on double-layer deep learning proposed in the present invention combines the advantages of spatial feature extraction and time series modeling, and adopts a double-layer network structure to process spatiotemporal features, that is, extracting spatial features in the first layer and modeling temporal features in the second layer. It can effectively integrate spatiotemporal information and significantly improve the prediction accuracy of short-term flow of target road sections. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flowchart of the process disclosed in the present invention; Figure 2 Schematic diagram of the basic architecture of the two-layer deep learning model disclosed in the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0024] See also Figure 1 The present invention aims to provide a spatiotemporal prediction method for road section flow based on a double-layer deep learning model, so as to extract spatiotemporal features of complex road traffic networks and accurately predict the short-term flow of target road sections.
[0025] Step 1. Data collection and preprocessing 1.1. Data collection Collect historical section flow data and real-time section flow of target roads.
[0026] Among them, real-time section traffic also includes adjacent section traffic and input and output traffic of surrounding traffic areas (such as surrounding commercial areas and residential areas).
[0027] Those skilled in the art further explain that in an urban road traffic network, the downlink cross-sectional flow of an intersection is not only affected by the flow of the previous sections and the input and output flows of other sections, but is also related to the input and output flows of the traffic areas on both sides of the road. Therefore, the present invention assumes the input flow of the surrounding traffic areas as the adjacent virtual cross-sectional flow of the intersection.
[0028] The convolution feature matrix integrates the flow data recorded by the sensor and the actual cross-sectional flow, thereby improving the ability to extract the characteristics of the urban road traffic network. The prediction of the next cross-sectional flow at an intersection with a traffic zone channel requires the upstream cross-sectional flow and the traffic zone flow as input data.
[0029] Those skilled in the art further explain that the statistics and prediction of the cross-section flow of urban traffic road networks belong to discrete data analysis. The statistical standard of the cross-section flow of road networks is the flow of the cross-section between adjacent intersections within fifteen minutes. Therefore, the prediction of the cross-section flow of the target road only needs to be based on the number of vehicles passing through a time period and the average vehicle passenger capacity at a time granularity, which satisfies the formula:
[0030] In the formula, x represents the cross-sectional flow of section i in time period t; n represents the number of vehicles passing through section i in time period t; m represents the average passenger capacity of vehicles passing through section i in time period t.
[0031] In the two-layer deep learning model below, the input data is the number of vehicles and the average vehicle passenger capacity with labels for different time periods.
[0032] The cross-section flow prediction between intersections is an obvious spatiotemporal feature sequence prediction data, where spatiotemporal features include time series features and spatial structure features.
[0033] The time series feature is reflected in the regularity presented in the historical data, that is, the time series feature is used to capture the time dependency of the historical section flow data of the target road.
[0034] The spatial structural features are reflected in the positional relationship and mutual influence between sections or intersections, that is, the spatial structural features are used to capture the spatial correlation between target road sections.
[0035] Data Preprocessing First, the historical section flow data is preprocessed by second-order difference and scaling, where the second-order difference is used to improve the smoothness of the historical section flow data, which satisfies the expression:
[0036] In the formula, Representation section The daily cycle data series, Representation section Initial cross-sectional flow data.
[0037] Then, the data after second-order difference processing is scaled and the extreme values are truncated to reduce the impact of large extreme values in the data on the prediction accuracy of the neural network, such as sudden changes in traffic volume caused by traffic accidents.
[0038] Step 2. Two-layer deep learning model (DSLSTM-RCNN) See also Figure 2 ,The spatiotemporal characteristics of the cross-sectional flow prediction of the target road are captured through a two-layer deep learning model, and the short-term cross-sectional flow of the target road is predicted.
[0039] The two-layer deep learning model uses a two-layer network architecture to process spatiotemporal feature information. This two-layer architecture can effectively integrate spatiotemporal feature information by extracting spatial structural features in the first layer and modeling time series features in the second layer; it can significantly improve the model prediction accuracy by combining the advantages of spatial structural feature extraction and time series modeling.
[0040] Step 2.1. Time series prediction of cross-sectional flow The temporal correlation of preprocessed historical section flow data is mined based on the optimized long short-term memory network to extract time series features.
[0041] Specifically, the core model used for time series prediction of section flow is the long short-term memory model (LSTM), which uses the historical daily cycle data of the section for time series prediction.
[0042] Those skilled in the art further explain that the long short-term memory model is a recurrent neural network with a gated structure, which has a long memory function and is suitable for time series modeling. Its most prominent advantage is that it solves the problem of gradient vanishing and gradient exploding when learning and predicting data characteristics. This advantage is very important for passenger flow prediction based on a single data source such as section flow, avoiding the impact of sudden changes in data on a certain day or section.
[0043] The structure of the LSTM model is composed of recurrent units connected in sequence according to a time series.
[0044] The present invention uses the daily periodic historical data of the section as the input of a unit of the long-short term memory model to learn the time characteristics of the section flow.
[0045] The long short-term memory model learning and selection of cross-sectional flow data mainly rely on the computing unit composed of three gates, C t and C t-1 It transmits the characteristic information of flow in chronological order, connecting units representing different daily cycles. Each unit state contains the cross-sectional flow information characteristics learned from the hidden layer of the previous day. This extracted data information feature will affect the output of the current time step and the unit state of the next time step.
[0046] In the long short-term memory model, each unit is composed of a forget gate, an input gate, and an output gate, and the three gates are internally connected in sequence.
[0047] The main function of the forget gate, input gate, and output gate is to add or delete the data information in the unit. With the help of activation functions, these three gates can integrate historical cross-sectional traffic data that can be effectively learned.
[0048] The long short-term memory model first uses the forget gate to filter and delete abnormal cross-section traffic. The input of the forget gate is the hidden layer state of the previous unit. And the input of the section flow of the day The forget gate uses the Sigmoid activation function to represent the forget state. In this function, 1 means that the data information is completely remembered, and 0 means that the data information is completely forgotten. The final output is:
[0049] The input gate consists of two stages. The first stage is to filter the cross-sectional flow data that needs to be updated in the unit state; the second stage is to preliminarily select the cross-sectional flow data that can be added to the unit. The formula is as follows:
[0050]
[0051] The above method realizes accurate identification of effective section flow data.
[0052] In a further scheme, first the previous time step And the output of the forget gate Each element is multiplied one by one; then the result of the input gate is calculated and its Hadamard product is calculated The final result is the time series characteristics of the cross-sectional flow extracted in the t time period, and these characteristic data information are used as new data information added to the unit state, which satisfies the formula:
[0053] Finally, the output gate is used to filter and extract the data information in the unit to predict the traffic flow for the next day.
[0054] First, the tanh layer is used to extract the cross-sectional passenger flow that needs to be output from the unit state; then, the predicted value that can be output is screened in the sigmoid layer; finally, the Hadamard product is performed on the two and the result is output, which satisfies the formula:
[0055]
[0056] The output dimension of the long short-term memory network is compressed by global average pooling to avoid overfitting of cross-sectional flow data.
[0057] Step 2.2. Prediction of spatial structure of cross-sectional flow The optimized convolutional neural network combined with the ReLU activation function captures the spatial correlation between target road sections to extract spatial structural features.
[0058] Those skilled in the art further explained that a convolutional neural network is an artificial neural network that achieves network structure data learning through convolution operations. It has a deep structure and is better for processing two-dimensional grid data. The convolution kernel parameter sharing in the hidden layer of the convolutional neural network and the sparsity of the inter-layer connection enable the convolutional neural network to perform grid features with a smaller amount of calculation. Its three important structural features are local connection, parameter sharing, and downsampling.
[0059] The convolutional neural network first completes the mapping of the initial grid data through feature extraction, and then uses activation functions such as ReLU and Tanh for nonlinear mapping.
[0060] Specific: Firstly, an optimized convolutional neural network is used to map the spatial position relationship between different time periods of the target road section and different sections of the same line into a two-dimensional grid, where the horizontal direction of the two-dimensional grid is the time period and the vertical direction of the two-dimensional grid is the spatial relationship between the sections.
[0061] Then, the local spatial structure features are extracted through the convolution kernel.
[0062] Furthermore, the ReLU activation function is used to assist in learning the spatiotemporal features between target road sections.
[0063] Those skilled in the art further explained that road traffic flow is a discrete variable. In the convolution operation, one-dimensional convolution data is relatively simple, usually for time series and language sequence data; two-dimensional convolution data includes plane trajectories, traffic flow distribution between traffic areas and other data; three-dimensional convolution data includes Euclidean space data; more dimensional convolution data is the dimensional superposition analysis of the above types of data.
[0064] The present invention mainly takes two-dimensional convolution as an example for analysis, and the two-dimensional convolution formula is as follows:
[0065] However, when the actual convolutional neural network is imported into the computer for operation, direct convolution is not actually performed for the convenience of operation. The present invention uses a cross-correlation operation that is very similar to the convolution operation, and its principle is almost the same as the convolution operation. Its operation formula is as follows:
[0066] In the formula, the function is the input function, function is the convolution kernel function, is the feature map, and represents the input spatiotemporal two-dimensional data, and Indicates the position of the input signal.
[0067] After the convolution kernel, the linear rectification function ReLU is used as the activation function to assist in learning the complex spatiotemporal characteristics between sections. At the same time, it can also avoid the gradient vanishing and gradient exploding problems of traditional convolutional neural networks to a certain extent. The formula is as follows:
[0068] In the formula, is the activation function; Represents the prediction results based on the spatial convolution model.
[0069] In a further solution, the present invention uses two consecutive groups of convolution units for feature learning in the hope of obtaining deep learning results. The regularity of the convolution layer based on the spatiotemporal characteristics of the cross section is not easy to extract, so the present invention connects a fully connected layer at the terminal to nonlinearly combine the extracted spatiotemporal characteristics of the cross section to output the results more accurately.
[0070] Step 3. Model training and dynamic update Step 3.1. Create parameter matrix A parameter matrix is established based on the time series characteristics and spatial structure characteristics, and the short-term section flow prediction results of the target road are obtained by weighted fusion.
[0071] The final output short-term cross-sectional flow prediction result is: , which satisfies the formula:
[0072] In the formula, Represents the prediction results based on the time series model, Represents the prediction results based on the spatial convolution model; is the activation function; represents the Hadamard product; is the activation function; and are the time parameter matrix and spatial parameter matrix to be learned respectively.
[0073] Step 3.2. Optimize model parameters In order to fully consider the real-time changes in traffic, the present invention finally adopts MSE as the loss function to learn the real-time cross-sectional traffic change characteristics. The real-time cross-sectional traffic and the prediction results are input into the loss function for iterative training of weight coefficients and compensation coefficients. The error results will be returned to the two-layer deep learning model for real-time passenger flow change feature learning.
[0074] The short-term section flow prediction results are compared with the real-time section flow through the loss function and the parameters of the two-layer deep learning model are fitted and optimized. The loss function satisfies the formula:
[0075] In the formula, is the loss function, represents the weight coefficient, represents the compensation coefficient, It is a cross section The real flow rate, It is a cross section The predicted flow rate, represents the total number of sections in the road network, Indicates a specific cross section.
[0076] Although 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 the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A road section flow spatiotemporal prediction method based on a two-layer deep learning model, characterized in that: The method comprises the following steps: S1. Collect historical cross-sectional flow data and real-time cross-sectional flow data of the target road; S2. Capturing the spatiotemporal characteristics of the cross-sectional flow prediction of the target road through a two-layer deep learning model to predict the short-term cross-sectional flow of the target road; wherein the spatiotemporal characteristics include time series characteristics and spatial structure characteristics; S3, establishing a parameter matrix according to the time series characteristics and the spatial structure characteristics, and obtaining a short-term cross-sectional flow prediction result of the target road by weighted fusion; S4. Compare the short-term section flow prediction result with the real-time section flow through the loss function and fit and optimize the parameters of the two-layer deep learning model.
2. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 1 is characterized in that: The time series feature is used to capture the time dependency of the historical cross-section flow data of the target road; The spatial structure feature is used to capture the spatial correlation between the target road sections.
3. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 1 is characterized in that: The S2 further includes: S21, preprocessing the historical section flow data by second-order difference and scaling; mining the temporal correlation of the preprocessed historical section flow data based on an optimized long short-term memory network to extract the time series features; S22. Capture the spatial correlation between the target road sections based on an optimized convolutional neural network combined with a ReLU activation function to extract the spatial structural features.
4. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 3 is characterized in that: In S21, the historical cross-section flow data is preprocessed by second-order difference and scaling, specifically including: The second-order difference is used to improve the smoothness of the historical cross-sectional flow data, which satisfies the expression: ,in, Representation of cross section The daily cycle data series, Representation section Initial cross-sectional flow data; The data after the second-order difference processing is scaled and the extreme values are truncated.
5. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 3 is characterized in that: Each unit of the long short-term memory network includes a forget gate, an input gate and an output gate, and the input of the forget gate is the hidden layer state of the previous unit. And the input of the section flow of the day ,in: The output of the forget gate satisfies the expression ; The output of the input gate satisfies the expression ; The output of the output gate satisfies the expression ; in, express Always forget the input of the gate; Represents the sigmoid function; Represents the weight matrix of the forget gate; Represents the vector consisting of the hidden state at the previous moment and the input at the current moment; , as well as All are bias terms; represents the output of the input gate; Represents a new candidate cell state.
6. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 1 or 5, characterized in that: The output dimension of the LSTM network is compressed by global average pooling to prevent overfitting.
7. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 3 is characterized in that: The optimized convolutional neural network combined with the ReLU activation function in S22 captures the spatial correlation between the target road sections, specifically including: Using the optimized convolutional neural network, the spatial position relationship between different time periods of the cross section of the target road and different cross sections of the same line is mapped into a two-dimensional grid, wherein the horizontal direction of the two-dimensional grid is the time period, and the vertical direction of the two-dimensional grid is the spatial association between the cross sections; Extracting local spatial structural features through convolution kernels; The ReLU activation function is used to assist in learning the spatiotemporal features between the target road sections.
8. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 7 is characterized in that: The operation formula of the optimized convolutional neural network is: , Among them, the function is the input function, function is the convolution kernel function, is the feature map, and represents the input spatiotemporal two-dimensional data, and Indicates the position of the input signal.
9. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 1 is characterized in that: The short-term cross-sectional flow prediction result outputted in the end is: , which satisfies the formula: , in, Represents the prediction results based on the time series model, Represents the prediction results based on the spatial convolution model; is the activation function; represents the Hadamard product; is the activation function; and are the time parameter matrix and spatial parameter matrix to be learned respectively.
10. The method for spatiotemporal prediction of road section flow based on a double-layer deep learning model according to claim 1, characterized in that: The loss function satisfies the formula: , in, is the loss function, represents the weight coefficient, represents the compensation coefficient, It is a cross section The real flow rate, It is a cross section The predicted flow rate, represents the total number of sections in the road network, Indicates a specific cross section.