Urban traffic flow prediction method based on dynamic adaptive convolutional neural network

By using dynamic adaptive convolutional neural networks in traffic flow prediction to capture the spatiotemporal relationship of traffic data, it solves the problem that existing models are difficult to understand complex spatiotemporal dependencies and dynamics, achieves more accurate traffic flow predictions, and improves traffic flow. Management efficiency and sustainability.

CN118587893BActive Publication Date: 2024-10-18SICHUAN POLICE COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411044400.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-18
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Existing traffic flow prediction models are difficult to fully capture the complex spatiotemporal dependence and dynamics of urban transportation systems, and require large amounts of computing resources and data, making it difficult to adapt to the dynamic spatial complexity of road networks.

Method used

A method based on dynamic adaptive convolutional neural network (DSTACN) is used to capture the spatiotemporal relationship of traffic data through spatiotemporal residual convolution, attention mechanism and deformable convolution, and combine with the temporal attention mechanism to build a dynamic spatiotemporal adaptive convolution network , optimize the model to improve prediction accuracy.

Benefits of technology

It improves the accuracy of traffic flow prediction, helps traffic management departments better predict traffic changes, reduces vehicle waiting time and fuel consumption, reduces carbon emissions, and promotes sustainable urban transportation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587893B_ABST
    Figure CN118587893B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting urban traffic flow based on a dynamic adaptive convolutional neural network, which relates to the fields of traffic engineering and intelligent traffic technology, including: data collection and preprocessing; establishing a neural network model based on spatiotemporal residual convolution; constructing a dynamic adaptive convolution; establishing a spatiotemporal dynamics model and optimizing it; using a stochastic gradient descent algorithm to continuously optimize the dynamic spatiotemporal adaptive convolutional network hyperparameters through training to obtain a traffic state prediction scheme; the present invention uses DSTACN to consider the spatiotemporal dependency in predicting traffic flow, captures the dynamic spatiotemporal relationship in the road network, and makes the prediction result more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traffic engineering and intelligent traffic technology, and in particular to a method for predicting urban traffic flow based on a dynamic adaptive convolutional neural network. Background Art

[0002] As cities expand rapidly, accurate urban traffic flow forecasting is crucial in allocating road resources, urban planning, public safety, and risk assessment. However, traffic flow is affected by many dynamic factors, including infrastructure construction, travel peak hours, and other external conditions, making the forecasting task extremely complex. Traffic flow forecasting faces huge challenges, mainly because these factors generate complex spatiotemporal dependencies.

[0003] Traditional prediction methods mostly rely on statistical models, such as nonlinear regression models, Kalman filters, support vector regression models (SVR), autoregressive integrated moving average (ARIMA), etc., which mainly focus on the periodicity of traffic flow and ignore spatial correlation. In recent years, the development of deep learning has provided new methods for traffic flow prediction, especially recurrent neural networks (RNN) and long short-term memory (LSTM) networks, which can effectively handle long-term and short-term dependencies. Deep learning models conceptualize urban traffic flow as matrices and learn spatiotemporal information from them. For example, deep spatiotemporal residual convolutional networks use convolutional neural networks (CNNs) to extract spatial information and combine LSTM to establish short-term and long-term dependency models. Although these methods perform well, they may not fully consider the dynamic spatial complexity of road networks.

[0004] Existing models still face challenges in understanding the complex spatiotemporal dependencies inherent in traffic dynamics and are difficult to adapt to the dynamics and complexity of urban transportation systems. Despite improvements in deep learning and graph neural network technologies, they still face challenges such as model complexity, large training data requirements, and high computing resource requirements. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a method for urban traffic flow prediction based on a dynamic adaptive convolutional neural network. The present invention uses DSTACN to consider the spatiotemporal dependency in predicting traffic flow, capture the dynamic spatiotemporal relationship in the road network, and make the prediction result more accurate.

[0006] To achieve the above object, the technical solution adopted by the present invention is: a method for predicting urban traffic flow based on a dynamic adaptive convolutional neural network, comprising the following steps:

[0007] Step 1: Data collection and preprocessing: According to the experimental design, the data is processed in different time domains, the data sets are divided, and normalized to obtain the historical traffic data characteristics on the road network and form an input feature matrix;

[0008] Step 2: Establish a neural network model based on spatiotemporal residual convolution: Combine the processed input feature matrix to construct a basic neural network model based on spatiotemporal residual convolution;

[0009] Step 3: Construct dynamic adaptive convolution: The spatial correlation shown by traffic data is captured by attention-guided dynamic convolution and deformable convolution, which are combined into adaptive convolution;

[0010] Step 4: Establish a spatiotemporal dynamics model and optimize it: the temporal correlation of traffic data is captured by temporal attention, and dynamic temporal attention and dynamic adaptive convolution are integrated into the neural network model based on spatiotemporal residual convolution to synchronously construct the spatiotemporal dynamics model, thereby obtaining a dynamic spatiotemporal adaptive convolution network;

[0011] Step 5: Use the stochastic gradient descent algorithm to continuously optimize the dynamic spatiotemporal adaptive convolutional network hyperparameters through training to obtain a traffic status prediction solution.

[0012] As a further improvement of the present invention, step 1 also includes: integrating holiday information, weather conditions and temperature external factors.

[0013] As a further improvement of the present invention, in step 1, the data is processed in different time domains as follows:

[0014] Dividing urban space blocks and quantifying traffic flow, the urban area is discretized into The grid is composed of squares, divided by longitude and latitude, and each square is represented by its position coordinates in the grid. Unique identifier, Indicates the line, Indicates a column; within a specified time period Inside, through any square The flow inflow and outflow is quantified by the following formula:

[0015] ;

[0016] in, Representing a collection A track in Indicates the trajectory The geospatial coordinates of the points, express Points are located in grid squares Inside, means it is outside the grid square, Indicates the number of different elements in a set;

[0017] let Before Time slots in the unit area The observed flow tensor in ; for any given time interval , The cumulative inflow and outflow of all grid squares in the region are expressed as tensors Representation; First level Indicates inflow, second layer Represents the outflow indicator; the target is based on the end time Historical data to predict the next time slot The traffic passenger flow tensor .

[0018] As a further improvement of the present invention, in step 1, the data set division and normalization processing are specifically performed as follows:

[0019] The dataset is divided into training set, validation set and test set in chronological order; and the MinMax normalization method is applied to normalize the dataset.

[0020] As a further improvement of the present invention, in step 2, the neural network model based on spatiotemporal residual convolution uses a squeeze-excite attention mechanism to perform attention calculation: first, the global spatial information is compressed by a global average pool; then a fully connected layer, ReLU and Softmax operations are used to generate normalized attention weights for convolution kernel and offset learning:

[0021] ;

[0022] in, Represents the result scalar obtained by attention of the feature, Represents the attention scalar Multiply by the channel-wise product of the feature.

[0023] As a further improvement of the present invention, in step 3, the deformable convolution is kept consistent with the road network structure by adjusting the position of the convolution kernel, and the offset of the deformable convolution is learned by using the attention-guided deformable convolution network V2:

[0024] In the input feature map The sample is then sampled using a regular grid and the sampled values ​​are then Weighted summation and adding an offset to the regular grid ; The formula is as follows:

[0025] ;

[0026] here, Represents the pixel position on the feature map, Representative feature map The convolution result of the point, represents the nth position of the convolution kernel, represent The offset learned by the convolution is a floating point number, and The The modulation scalar of the position, Represents the deviation, by inputting feature maps Obtained by applying a single convolutional layer, due to It is a floating point number, so it is transformed by bilinear interpolation.

[0027] As a further improvement of the present invention, in step 3, by aggregating multiple Linear Function To introduce dynamic convolution, as follows:

[0028] ;

[0029] in, is the kth linear function The attention weight. It is not fixed, but changes with each input changes with the changes of.

[0030] As a further improvement of the present invention, in step 4, the temporal attention calculation method is specifically as follows:

[0031] ;

[0032] in, and represents the weight of the time channel, and is the bias term, is the activation function.

[0033] As a further improvement of the present invention, in step 4, the entire network is trained by maximizing the probability of generating accurate future forecasts through time back propagation. Additional information such as continuous variables (temperature, wind speed) and one-hot encoded categorical variables (holidays) are input into the model through a fully connected layer as part of feature extraction.

[0034] As a further improvement of the present invention, it also includes: evaluating the effect of the dynamic spatiotemporal adaptive convolutional network according to existing evaluation indicators.

[0035] The present invention designs a deformable convolution kernel combined with an attention mechanism to extract road information and adapt it to the road network structure. In addition, the present invention also uses the attention mechanism to dynamically aggregate multiple parallel convolution kernels to accurately focus on key areas in the network. From a temporal perspective, the present invention applies a dynamic temporal attention mechanism based on weekly, daily, and recent time data to grasp the key moments in periodic traffic flows. By integrating important temporal and spatial elements, a dynamic spatiotemporal adaptive convolutional network (DSTACN) is constructed.

[0036] The beneficial effects of the present invention are:

[0037] The present invention improves the extraction of spatial features by optimizing the positioning of sampling points within the convolution kernel and dynamically adjusting the parameters of the convolutional neural network in different time frames. This improvement includes using the attention mechanism to guide the deformable convolution kernel towards the area of ​​interest, and dynamically aggregating multiple parallel convolution kernels through attention to enhance adaptability to different inputs.

[0038] 2. The present invention combines attention-based adaptive convolution with dynamic temporal attention mechanism to be suitable for weekly, daily and recent time information extraction, and incorporates it into the DSTACN model.

[0039] 3. Through the improved traffic prediction method, the present invention helps traffic management departments to more accurately predict traffic flow changes, take measures in advance to alleviate traffic congestion, and improve road utilization efficiency. This can not only reduce vehicle waiting time and fuel consumption, but also reduce carbon emissions and promote the development of sustainable urban transportation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flow chart of an embodiment of the present invention;

[0041] Figure 2 Schematic diagram of an adaptive convolution process in an embodiment of the present invention;

[0042] Figure 3 This is a model architecture diagram of a dynamic spatiotemporal adaptive convolutional neural network in an embodiment of the present invention;

[0043] Figure 4 A comparison chart of the model prediction results and actual traffic flow data of the Taxibj data set in an embodiment of the present invention;

[0044] Figure 5 It is a line chart comparison diagram of the RMSE, an evaluation indicator of the prediction result in the embodiment of the present invention;

[0045] Figure 6 It is a line graph comparison diagram of the prediction result evaluation index MAE in the embodiment of the present invention;

[0046] Figure 7 Graph showing the experimental results of adaptive convolutional layer embedding mode parameters in an embodiment of the present invention;

[0047] Figure 8 Graph showing experimental results of dynamic convolution kernel model parameters in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0049] Example

[0050] like Figure 1 As shown in the figure, a method for predicting urban traffic flow based on dynamic adaptive convolutional neural network is used. DSTACN is used to consider the spatiotemporal dependency in predicting traffic flow, capture the dynamic spatiotemporal relationship in the road network, and make the prediction result more accurate. Traffic flow data is collected and preprocessed through step 1, and the dynamic spatiotemporal adaptive convolutional neural network model is constructed through steps 2 to 4. The results are processed and analyzed through steps 5 and 6:

[0051] Step 1: Data collection and preprocessing: According to the experimental design, the data is preprocessed in the time domain, divided into data sets, normalized, etc. to obtain the historical traffic data characteristics on the road network;

[0052] Step 2: Establish a neural network model based on spatiotemporal residual convolution, and combine the processed input feature matrix to construct a basic spatiotemporal residual convolution neural network model framework;

[0053] Step 3: Construct dynamic adaptive convolution. The spatial correlation of traffic data is captured by dynamic convolution and deformable convolution, which are combined into adaptive convolution.

[0054] Step 4: Spatiotemporal dynamics modeling and optimization. The temporal correlation of traffic data is captured by temporal attention. Dynamic temporal attention and dynamic adaptive convolution are integrated into the neural network model obtained in step 2 to synchronously construct a spatiotemporal dynamics model, thereby obtaining the dynamic spatiotemporal adaptive convolution network DSTACN of this embodiment.

[0055] Step 5: Model solution: Establish a model according to the above steps, use the stochastic gradient descent algorithm, continuously optimize the model hyperparameters through training, and obtain a traffic status prediction solution;

[0056] Step 6: Model effect evaluation: evaluate the effect of the proposed model based on the existing evaluation indicators.

[0057] The present invention will be further described below:

[0058] (1) Time domain processing of data:

[0059] First, the urban space is divided into blocks and the traffic flow is quantified. The urban area is discretized into The grid is composed of squares, divided by longitude and latitude. Each square is represented by its position coordinates in the grid. Unique identifier, Indicates the line, Indicates a column. In the specified time period Inside, through any square The flow inflow and outflow is quantified by the following formula:

[0060] ;

[0061] Here Representing a collection A trajectory in which Indicates the trajectory The geospatial coordinates of the points, symbol express Points are located in grid squares Inside, , it is outside the grid square. Indicates the number of distinct elements in a collection.

[0062] let Before Time slots in the unit area The observed flow tensor in . For any given time interval , The cumulative inflow and outflow of all grid squares in the region are expressed as tensors Indicates. First layer Indicates inflow, second layer Represents the outflow indicator. The main goal is to Historical data to predict the next time slot The traffic passenger flow tensor .

[0063] In addition to traffic flow information, the method also integrates external factors such as holiday information, weather conditions and temperature, which can provide more additional information for prediction.

[0064] (2) Data set division and normalization processing:

[0065] In this example, the data set is divided into a training set, a validation set, and a test set in chronological order. The split ratio of the training set to the validation set is 8:2, and the traffic flow of the last 10 days is used as the test set. The MinMax normalization method is used to normalize the data set.

[0066] (3) Residual convolutional neural networks (ResNet) are used in various deep learning tasks because they can effectively avoid the gradient vanishing problem encountered in deep neural networks. This feature is particularly prominent in traffic flow prediction, because both the current traffic conditions (low-level features) and historical trends (high-level features) are important for accurate prediction. In order to explain the problem more comprehensively, Figure 3 As shown in Figure 1, the input of the first residual connection layer is the output of the adaptive convolution layer. Through actual experiments, at most L=12 layers of residual connections are used in the model.

[0067] In order to improve computational efficiency, the squeeze-excite (SE) attention mechanism is used for attention calculation. First, the global spatial information is compressed through global average pooling. Then, fully connected layers, ReLU and Softmax operations are used to generate normalized attention weights for convolution kernel and offset learning.

[0068] ;

[0069] in, Represents the result scalar obtained by attention of the feature, Represents the attention scalar Multiply by the channel-wise product of the feature.

[0070] (4) Step 3: For adaptive convolution modeling, since traditional convolution kernels can only perform conventional information aggregation, it is difficult to effectively capture spatial dependencies. Inspired by the deformable convolution method in object detection, the deformable convolution method is adopted to better align with the road network structure by adjusting the position of the convolution kernel. In order to improve performance, the attention-guided deformable convolution network V2 is also used to learn the offset of the deformable convolution, making full use of the advantages of the attention mechanism.

[0071] The traditional convolution method is to input feature maps The sample is then sampled using a regular grid and the sampled values ​​are then Weighted sum. In the deformable convolution implementation of this model, the regular grid is offset ,in The formula is as follows:

[0072] ;

[0073] here, Represents the pixel position on the feature map, Representative feature map The convolution result of the point, represents the nth position of the convolution kernel, represent The offset learned by the convolution is a floating point number, and The The modulation scalar of the position, Represents the deviation, by inputting feature maps Obtained by applying a single convolutional layer, due to It is a floating point number, so it is transformed by bilinear interpolation.

[0074] In order to address the spatiotemporal changes of a specific location in different time frames, this embodiment draws inspiration from dynamic convolution to address the inherent limitations of traditional convolution methods. This new method combines an attention mechanism to filter multiple parallel convolution kernels based on the input, thereby achieving effective information aggregation in complex road networks.

[0075] The traditional definition of convolution is ,in and Represent the weight matrix and bias vector respectively, is an activation function (such as Tanh). By aggregating multiple Linear Function To introduce dynamic convolution, as follows:

[0076] ;

[0077] in, is the kth linear function The attention weight. It is not fixed, but changes with each input Therefore, compared with the static convolution method, the dynamic convolution method has more advantages in capturing various features.

[0078] (5) Step 4 combines the spatiotemporal residual convolutional neural network with adaptive convolution to model spatiotemporal dynamics. This paper solves the spatial dependency problem through adaptive convolution (including attention-based deformable convolution and dynamic convolution), and uses the temporal attention mechanism to manage temporal dependency. The schematic process of adaptive convolution is as follows Figure 2 As shown in Figure 1. This process involves learning the input feature map through a dynamic convolution kernel while taking into account the position offset. This achieves the fusion of dynamic convolution and attention-based deformable convolution. The formula integrates the bias and weight obtained in the dynamic convolution, thereby establishing the framework of adaptive convolution.

[0079] The temporal attention mechanism can effectively filter recent traffic flow patterns in different time intervals, including daily and weekly cycles, so that the model can prioritize important time periods such as peak hours and noteworthy weekdays. The temporal attention calculation method is as follows:

[0080] ;

[0081] in, and represents the weight of the time channel, and is the bias term, is the activation function. The DSTACN model was established by integrating the above spatiotemporal dynamic modeling architecture. The entire network was trained by maximizing the probability of generating accurate future predictions through time back propagation. Additional information such as continuous variables (temperature, wind speed) and one-hot encoded categorical variables (holidays) were input into the model through the fully connected layer as part of feature extraction.

[0082] In order to verify the performance of the proposed model, this embodiment conducts experiments on three real traffic datasets. First, the data preprocessing of the dataset is introduced, and then several selected benchmark models are introduced.

[0083] This embodiment tests the model on real traffic flow data of various modes, area sizes and data volumes. Specifically, Beijing taxi, New York bicycle and New York taxi data sets are used to represent different traffic modes. The Beijing taxi data set includes the trajectory and meteorological data of Beijing taxis in multiple time intervals. According to longitude and latitude, Beijing is divided into a grid map of 32 by 32 squares. The New York City bicycle data set contains the travel records of the city's bicycle system in 2014. Each vehicle record includes the duration of the vehicle, the station ID, and the start and end time. In addition, the driving records of New York City taxis in 2014 are also used. These records include the date, time and location of pick-up and drop-off.

[0084] The dataset is divided into training, validation, and test sets. The last ten days are designated as the test set, and the rest of the days are divided into training and validation sets in a ratio of 8:2. Maximum and minimum normalization is used to scale the output to [-1,1]. The proposed model and baselines are implemented using PyTorch and trained on an RTX 4090 GPU with 128GB of RAM and 24GB of GPU memory. The hyperparameters of the model are set as follows: learning rate of 0.0005, 200 training epochs (early stopping epochs set to 30), using L1 loss function and automatic learning rate decay.

[0085] Secondly, in order to evaluate the effect of this embodiment, the following widely used interpolation method is used as a benchmark model:

[0086] 1) HA: Historical average model, which uses the historical average as the forecast value for the corresponding period.

[0087] 2) ARIMA: Autoregressive Integrated Moving Average is a widely used time series forecasting model that can apply historical information to predict the future.

[0088] 3) ConvLSTM: The convolutional LSTM network uses the convolution operation of each gate in the LSTM unit to replace the matrix multiplication, and can capture the basic spatial features in variable-dimensional data through convolution operations.

[0089] 4) ST-ResNet: The framework uses convolutional units and residual networks to effectively model the dynamics of time-varying data and extract spatial dependencies at multiple scales.

[0090] 5) STDN: It adopts flow gating mechanism and cyclic transition attention mechanism to address the problems of dynamic spatial dependency and long-term periodic temporal variation.

[0091] 6) SA-ConvLSTM: A self-attention memory module is introduced to extract large-scale spatial dependency features.

[0092] 7) STGSP: Utilizes global spatial semantic information to systematically extract urban flow features through representation learning methods.

[0093] (1) Experimental results:

[0094] Table 1 compares various methods in three datasets (TaxiBJ, BikeNYC, and TaxiNYC) based on three metrics: RMSE, MAE, and MAPE, where lower values ​​indicate higher prediction accuracy. Overall, the proposed DSTACN method outperforms all other methods on all three datasets, indicating that it has the highest prediction accuracy. This suggests that DSTACN can capture complex spatiotemporal dependencies more effectively than other models.

[0095]

[0096] HA and ARIMA perform poorly in all datasets and metrics because these models are relatively simple and cannot capture complex spatiotemporal patterns well. The performance of state-of-the-art methods such as ST-ResNet, STDN, SA-ConvLSTM, and STGSP has improved, which shows the importance of considering spatiotemporal dependencies in prediction. The analysis shows that the DSTACN model has an advantage in predicting traffic flow on the urban traffic dataset: compared with STGSP, DSTACN's RMSE improved by 11.98% and MAE decreased by 8.41%, highlighting its higher accuracy in all evaluation metrics. SA-ConvLSTM significantly reduced the MAE and MAPE metrics of the dataset. However, DSTACN leads with the lowest RMSE and MAPE, reducing RMSE by 8.6% over STGSP. In the New York City Taxi dataset, both STDN and STGSP performed well. However, DSTACN surpassed these models in terms of overall effectiveness across all datasets and metrics. For example, the RMSE and MAE of DSTACN are 17.63 and 10.26, respectively, which are 6.02% and 2.38% lower than the RMSE18.76 and MAE10.51 of STGSP.

[0097] These results highlight the clear advantages of DSTACN over baseline methods. Figure 5 , 6 The visualization in further proves this point. Figure 4 The comparison between the prediction results of the proposed method and the actual situation is also shown in Figure 2. The comparison shows the prediction results generated by the proposed method and the real traffic data of nodes (8,26) in the grid. By observing the enlarged sub-graph, it is obvious that DSTACN shows higher accuracy in predicting both peak traffic flow and overall trend. This intuitive representation emphasizes the effectiveness of DSTACN in capturing the complex dynamics of traffic flow patterns.

[0098] (2) Ablation experiment:

[0099] The ablation study results of the DSTACN experiments are summarized in Table 2. Different variants are tested by isolating specific submodules from the DSTACN architecture to understand their unique contributions. The evaluation metric RMSE of each variant is then analyzed on the taxiBJ dataset.

[0100]

[0101] The results show that each submodule of DSTACN plays an indispensable role, although their functional contributions vary. The performance of the module without dynamic convolution and deformable convolution drops most significantly, with an RMSE increase of 15.84%.

[0102] Dynamic temporal attention makes up for the lack of time dependency in convolutional neural networks by pinpointing key time points in different time dimensions. Dynamic attention convolution and dynamic temporal attention enable the model to adaptively focus on relevant spatial and temporal features, enhancing the ability to capture complex spatiotemporal patterns in the data. Therefore, removing any of these components will weaken the model's ability to learn from the input data.

[0103] (3) Parameter and model structure experiments:

[0104] exist Figure 7 The analysis performed in sheds light on the impact of using adaptive convolutions on the RMSE metric at different model layers. The results show that the accuracy improves as more adaptive convolution layers are incorporated into the architecture. Notably, the best accuracy is achieved by deploying adaptive convolutions in all three layers. Furthermore, in cases where only one layer can take advantage of adaptive convolutions, incorporating it in the last convolutional layer yields the most favorable performance.

[0105] like Figure 8 As shown in the figure, as the number of dynamic convolution kernels increases, the RMSE of the DSTACN model decreases, but the RMSE changes slowly when the number of convolution kernels exceeds 4. The reason for this phenomenon is that when a large number of convolution kernels are dynamically convolved to give the model stronger representation capabilities, the optimization process becomes extremely challenging due to the need to train multiple convolution kernels and attention mechanisms at the same time, thereby increasing the possibility of model overfitting.

[0106] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for predicting urban traffic flow based on dynamic adaptive convolutional neural network, characterized in that: The following steps are involved: Step 1: Data collection and preprocessing: According to the experimental design, the data is processed in different time domains, the data sets are divided, and normalized to obtain the historical traffic data characteristics on the road network and form an input feature matrix; Step 2: Establish a neural network model based on spatiotemporal residual convolution: Combine the processed input feature matrix to construct a basic neural network model based on spatiotemporal residual convolution; Step 3: Construct dynamic adaptive convolution: The spatial correlation shown by traffic data is captured by attention-guided dynamic convolution and deformable convolution, which are combined into adaptive convolution; In step 3, the deformable convolution is kept consistent with the road network structure by adjusting the position of the convolution kernel, and the offset of the deformable convolution is learned using the attention-guided deformable convolution network V2: Use a regular grid on the input feature map x Sampling is performed, and then the sampled values ​​are weighted by w and summed, and the regular grid is given Add an offset {Δp n |n=1,…,N}; the formula is as follows: Here, p represents the pixel position on the feature map, y(p) represents the convolution result of point p on the feature map, and p n represents the nth position of the convolution kernel, Δp n represents the offset learned by convolution at position n, which is a floating point number, and Δm n is the modulation scalar at the nth position, b represents the bias, obtained by applying a single convolutional layer to the input feature map x. Since p+p n +Δp n It is a floating point number, so it needs to be transformed by bilinear interpolation; In step 3, by aggregating multiple linear functions To introduce dynamic convolution, as follows: Among them, π k is the kth linear function The attention weight, represents the original weight and bias of the kth convolution kernel, Represents the dynamic convolution weights and biases after attention calculation, through the post-attention weights {π k (x)} is not fixed, but changes with each input x; Step 4: Establish a spatiotemporal dynamics model and optimize it: the temporal correlation of traffic data is captured by temporal attention, and dynamic temporal attention and dynamic adaptive convolution are integrated into the neural network model based on spatiotemporal residual convolution to synchronously construct the spatiotemporal dynamics model, thereby obtaining a dynamic spatiotemporal adaptive convolution network; Step 5: Use the stochastic gradient descent algorithm to continuously optimize the dynamic spatiotemporal adaptive convolutional network hyperparameters through training to obtain a traffic status prediction solution.

2. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 1 is characterized in that: Step 1 also includes: integrating holiday information, weather conditions and temperature external factors.

3. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 1 is characterized in that: In step 1, the data is processed in different time domains as follows: Dividing urban space blocks and quantifying traffic flow, the urban area is discretized into a grid consisting of I×J squares, divided by longitude and latitude. Each square is uniquely identified by its position coordinates (i, j) in the grid, i represents the row and j represents the column; within the specified time period t, the flow inflow and outflow through any square (i, j) is quantified by the following formula: Among them, Tr:g1→g2→…→g |Tr| Representing a collection A trajectory in f represents the fth th The geographic coordinates of the point, g f ∈(i,j) represents g f The point is located in the grid square (i,j), indicates that it is outside the grid square, and |·| indicates the number of distinct elements in the set; Let {X t |t=1,2,..,n} represents the flow tensor observed in the unit area R in the first n time slots; for any given time interval t, the cumulative inflow and outflow of all grid squares in the I×J area are expressed as tensors Representation; First level Indicates inflow, second layer represents the outflow indicator; the goal is to predict the traffic passenger flow tensor X at the next time slot n+1 based on the historical data up to time T t+1 .

4. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 1 is characterized in that: In step 1, the data set is divided and normalized as follows: The dataset is divided into training set, validation set and test set in chronological order; and the MinMax normalization method is applied to normalize the dataset.

5. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 1 is characterized in that: In step 2, the spatiotemporal residual convolution-based neural network model uses a squeeze-and-excite attention mechanism to perform attention calculation: first, the global spatial information is compressed through global average pooling; then the fully connected layer, ReLU and Softmax operations are used to generate normalized attention weights for convolution kernel and offset learning: π(X)=Softmax(W2·ReLU(W1·Pool(X))) Among them, π(X) represents the scalar result obtained by attention of the feature, f scale represents the channel product of the attention scalar π(X) and the feature, and W represents the model weight.

6. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 1 is characterized in that: In step 4, the temporal attention calculation method is as follows: h=tanh(W c X+b c ) y=Softmax(W′ i h+b' i ) Among them, W c and W' i represents the weight of the time channel, b c and b' i is the bias term and tanh is the activation function.

7. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to claim 6 is characterized in that: In step 4, the dynamic spatiotemporal adaptive convolutional network is trained by maximizing time back propagation; Additional information about continuous variables and one-hot encoded categorical variables is fed into the model through fully connected layers as part of feature extraction.

8. The urban traffic flow prediction method based on dynamic adaptive convolutional neural network according to any one of claims 1 to 7, characterized in that: Also includes: The effect of dynamic spatiotemporal adaptive convolutional network is evaluated according to existing evaluation indicators.

Citation Information

Patent Citations

  • Traffic space-time sequence single-step prediction method and system and storage medium

    CN112559585A

  • Traffic flow prediction method based on fusion of space-time adaptive graph learning and dynamic graph convolution

    CN117392846A