Urban road average speed prediction method and system based on CNN-LSTM

By adopting the CNN-LSTM method in urban road velocity prediction, combining historical traffic and weather data, fusion matrix is ​​generated and prediction is solved, and the problems of insufficient data diversity and complexity of dynamic adjacency matrix in the prior art are achieved, and higher prediction accuracy and stability are achieved.

CN119049302BActive Publication Date: 2025-04-15CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411555277.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-04-15
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

The existing urban road vehicle speed prediction method mainly relies on a single data source, and fails to fully utilize the comprehensive impact of multiple factors on road conditions, resulting in inaccurate and limited prediction results, and complex construction and maintenance of dynamic adjacency matrix, high computing resource requirements, but fails to fully utilize multi-source data to improve prediction performance.

Method used

Using a CNN-LSTM-based method, historical traffic timing data and historical weather timing data are synchronized, and a dual-channel CNN is constructed to generate road space feature matrix and weather impact feature matrix respectively. The two are integrated through a cross-modal attention fusion mechanism to generate a fusion matrix, and the LSTM model is used for training to predict the average speed of urban roads.

Benefits of technology

By comprehensively considering a variety of influencing factors, the accuracy and stability of urban road speed prediction are improved, the model's adaptability to complex traffic environments is enhanced, and the prediction accuracy is improved, especially in long-term prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119049302B_ABST
    Figure CN119049302B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for predicting the average speed of urban roads based on CNN-LSTM, and relates to the technical field of urban vehicle speed prediction. The present invention combines CNN and LSTM models. Firstly, historical traffic data and historical weather data are collected and normalized, and dual-channel CNN is used to extract road space features and weather impact features. The weather impact feature matrix and the road space feature matrix are fused through a cross-modal attention mechanism to generate a fusion matrix. Then, an LSTM is constructed for training, and the fusion matrix is ​​used as input and the average speed of urban roads at future moments is used as output, so as to achieve effective prediction of the average speed of urban roads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urban vehicle speed prediction, and in particular to a method and system for predicting average speed of urban roads based on CNN-LSTM. Background Art

[0002] Urban traffic prediction has always been an important research direction in intelligent transportation systems. With the acceleration of urbanization, traffic congestion has become increasingly serious, resulting in a lot of time and energy waste. To solve this problem, a reasonable traffic management strategy needs to be adopted. Accurately predicting the average speed of the road is the key to improving traffic management efficiency. However, traditional prediction methods often only consider a single data source, ignoring the comprehensive impact of multiple factors on road conditions. In addition, complex road networks and uncertain weather changes make traditional methods insufficient in prediction accuracy and real-time performance. Therefore, a method that can comprehensively consider multi-source data is needed to improve the accuracy and stability of urban road speed prediction.

[0003] In the prior art, publication number CN116486611A discloses a method for predicting vehicle speed on urban roads, which includes collecting vehicle speeds at various nodes on urban roads, constructing a sample set, dividing a training set from the sample set, constructing a dynamic adjacency matrix based on the network topology of each node in the training set and the daily vehicle speed probability, dividing the training set into multiple time periods in chronological order, constructing multiple network models based on each time period, and fusing the outputs of multiple network models to obtain a prediction model; training the prediction model based on the training set and the dynamic adjacency matrix; collecting vehicle speeds at nodes to be predicted, selecting samples to be tested in each time period according to the time period to be predicted and the preset number of samples in each time period, and inputting the samples into the trained prediction model to generate the vehicle speed of the time period to be predicted.

[0004] The main problems with the above scheme are: insufficient data diversity. The scheme mainly relies on vehicle speed data and does not make full use of other factors that may affect speed, such as weather, events or infrastructure changes, resulting in inaccurate and limited prediction results; and the construction and maintenance of the dynamic adjacency matrix is ​​complex and requires high computing resources, but it fails to make full use of multi-source data to improve prediction performance, and lacks accuracy in long-term predictions, resulting in limited versatility of the scheme.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for predicting the average speed of urban roads based on CNN-LSTM to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The urban road average speed prediction method based on CNN-LSTM includes the following specific steps:

[0009] Step 1: synchronously collect historical traffic time series data and historical weather time series data, and normalize the data. The historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series. The historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series.

[0010] Step 2: Construct a dual-channel CNN, use historical traffic data as input, and the vehicle density and speed characteristics of the road as labels to train the first channel; use historical weather data as input, and the impact of weather on vehicle density and speed characteristics as labels to train the second channel;

[0011] Step 3: Integrate the vehicle density features and speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, adjust the weights of the weather feature matrix and the road space feature matrix to generate a fusion matrix.

[0012] Step 4: Construct LSTM, mark the label of the average speed of urban roads at the next acquisition time on the fusion matrix, and input it into LSTM for training to obtain a speed prediction model with the input value being the fusion matrix and the output value being the average speed of urban roads;

[0013] Step 5: Collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, input them into the corresponding channels for processing, and process the processed data according to the method of step 3 to generate a real-time fusion matrix;

[0014] Step 6: Input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads. Furthermore, the formula for normalizing the data is:

[0015] ,

[0016] in, It represents the result of normalizing the collected data. Represents the collected raw data, Represents the maximum value in the original data. Indicates the minimum value in the original data.

[0017] Furthermore, the road space characteristics are vehicle density and vehicle speed, and the weather impact characteristics are the impact of abnormal weather on the road space characteristics. The abnormal weather includes rain, snow, typhoons and other weather that is determined by experts to affect travel.

[0018] Furthermore, the road space feature matrix is:

[0019] ,

[0020] in, represents the road space feature matrix, Indicates The moment road space characteristics, is the index of the collection time, which is also the index of the row number, and , represents the total number of collection moments, Represents the index of road space features, which is also the index of column number, and j=1 or 2, corresponding to vehicle density features and vehicle speed features respectively;

[0021] The weather impact feature matrix is:

[0022] ,

[0023] in, represents the weather impact feature matrix, Indicates The abnormal weather at this moment has an impact on the The influence of various road spatial characteristics.

[0024] Furthermore, the principle for generating the fusion matrix is:

[0025] The similarity of each element in the road space feature matrix and the weather impact feature matrix is ​​generated based on the formula:

[0026]

[0027] in, Represents the similarity matrix Line The element value of the column, Represents the road space feature matrix Line The element value of the column, Represents the weather impact feature matrix Line The element value of the column;

[0028] Arrange the similarities of all elements according to their row and column numbers to generate a matrix, wherein the matrix represents a similarity matrix between the weather impact feature matrix and the road space feature matrix;

[0029] The attention weight is generated according to the similarity matrix, based on the formula:

[0030]

[0031] in, represents the attention weight of the road space feature matrix, represents the attention weight of the weather-affected feature matrix, represents the similarity matrix, represents the transposed matrix of the similarity matrix;

[0032] The formula for generating the fusion matrix is:

[0033]

[0034] in, Represents the fusion matrix.

[0035] Furthermore, a fusion matrix containing road space characteristics and weather influence characteristics at time 1 to n is input into the speed prediction model to generate the predicted average speed of urban roads at time n+1.

[0036] The present invention also provides a system for predicting the average speed of urban roads based on CNN-LSTM, and the system is used to implement the above-mentioned method for predicting the average speed of urban roads based on CNN-LSTM, specifically comprising:

[0037] A data collection module, for synchronously collecting historical traffic time series data and historical weather time series data, and normalizing the data, wherein the historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series, and the historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series;

[0038] The CNN training module is used to construct a dual-channel CNN. The first channel is trained with historical traffic data as input and the vehicle density and speed characteristics of the road as labels. The second channel is trained with historical weather data as input and the impact of weather on vehicle density and speed characteristics as labels.

[0039] The feature fusion module is used to integrate the vehicle density features and vehicle speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and vehicle speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, the weights of the weather feature matrix and the road space feature matrix are adjusted to generate a fusion matrix.

[0040] The model building module is used to build LSTM. After marking the label of the average speed of urban roads at the next acquisition moment on the fusion matrix, it is input into LSTM for training to obtain a speed prediction model whose input value is the fusion matrix and whose output value is the average speed of urban roads.

[0041] The feature generation module is used to collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, and input them into the corresponding channel for processing. The processed data is processed according to the method of the feature fusion module to generate a real-time fusion matrix;

[0042] The prediction output module is used to input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads. Compared with the prior art, the beneficial effects of the present invention are:

[0043] The present invention collects historical traffic data and historical weather data, constructs a dual-channel CNN to generate a road space feature matrix and a weather impact feature matrix respectively, comprehensively considers multiple influencing factors, and provides a rich information basis for model training. Compared with only analyzing a single data source, multi-source data can more comprehensively reflect the actual traffic conditions, and uses dual-channel CNN to process traffic and weather data respectively to generate corresponding feature matrices, thereby improving the model's adaptability to complex traffic environments.

[0044] The present invention is also based on a cross-modal attention mechanism, integrating the weather impact feature matrix and the road space feature matrix to generate a fusion matrix. Compared with simple splicing and fusion, the attention mechanism more intelligently utilizes the information between modalities and can dynamically adjust the weights of different feature matrices to improve the adaptability to changeable traffic conditions, making the generated fusion matrix more representative and predictive. Training LSTM to receive the fusion matrix and predicting the average speed at future times based on known real-time speed data can better reflect long-term dependencies and improve the prediction accuracy of the solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a schematic diagram of a method flow chart of an embodiment of the present invention;

[0046] Figure 2 Schematic diagram of system modules according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0048] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0049] Example:

[0050] See also Figure 1 , the present invention provides a technical solution:

[0051] The urban road average speed prediction method based on CNN-LSTM includes the following specific steps:

[0052] Step 1: synchronously collect historical traffic time series data and historical weather time series data, and normalize the data. The historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series. The historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series.

[0053] In this embodiment, the formula for normalizing the data is:

[0054]

[0055] in, It represents the result of normalizing the collected data. Represents the collected raw data, Represents the maximum value in the original data. Indicates the minimum value in the original data.

[0056] Step 2: Construct a dual-channel CNN, use historical traffic data as input, and the vehicle density and speed characteristics of the road as labels to train the first channel; use historical weather data as input, and the impact of weather on vehicle density and speed characteristics as labels to train the second channel;

[0057] In this embodiment, the vehicle density feature of the road is the number of vehicles per unit length of the road, the vehicle speed feature is the real-time vehicle speed at the time of collection, and the impact of weather on road space features represents the change in vehicle density and vehicle speed between abnormal weather and normal weather. The vehicle density and vehicle speed in normal weather are taken as the reference values, and the impact of weather on road space features is the ratio of the vehicle density and vehicle speed to the reference value under abnormal weather. The abnormal weather includes rain, snow, strong wind and other weather that affects travel as determined by experts, and the normal weather refers to no rain, snow, strong wind and other severe weather as determined by experts;

[0058] In this embodiment, the structure of CNN is divided into an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. In the first channel, the output layer receives historical traffic data, establishes a historical traffic data matrix in the convolution layer, extracts road space features, activates through the ReLU function, and outputs a road space feature matrix that can reflect road vehicle density and speed through the output layer;

[0059] In the second channel, the output layer receives historical weather data, and generates the magnitude of the impact of weather data on road vehicle density and speed based on the output road spatial characteristics. The magnitude of the impact is determined by the ratio of vehicle density and speed during abnormal weather to vehicle density and speed during abnormal weather, and the output layer outputs a weather impact feature matrix that reflects the magnitude of the impact of abnormal weather on vehicle density and speed.

[0060] Step 3: Integrate the vehicle density features and speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, adjust the weights of the weather feature matrix and the road space feature matrix to generate a fusion matrix.

[0061] In this embodiment, the road space feature matrix is:

[0062]

[0063] in, represents the road space feature matrix, Indicates The moment road space characteristics, is the index of the collection time, which is also the index of the row number, and , represents the total number of collection moments, Represents the index of road space features, which is also the index of column number, and j=1 or 2, corresponding to vehicle density features and vehicle speed features respectively;

[0064] The weather impact feature matrix is:

[0065]

[0066] in, represents the weather impact feature matrix, Indicates The abnormal weather at this moment has an impact on the The influence of various road spatial characteristics.

[0067] In this embodiment, the principle for generating the fusion matrix is:

[0068] The similarity of each element in the road space feature matrix and the weather impact feature matrix is ​​generated based on the formula:

[0069]

[0070] in, Represents the similarity matrix Line The element value of the column, Represents the road space feature matrix Line The element value of the column, Represents the weather impact feature matrix Line The element value of the column;

[0071] Arrange the similarities of all elements according to their row and column numbers to generate a matrix , the matrix Represents the similarity matrix between the weather impact feature matrix and the road space feature matrix;

[0072] The attention weight is generated according to the similarity matrix, based on the formula:

[0073]

[0074] in, represents the attention weight of the road space feature matrix, represents the attention weight of the weather-affected feature matrix, represents the similarity matrix, represents the transposed matrix of the similarity matrix;

[0075] The purpose of calculating the attention weight through the softmax function is to convert the original relevance score into a probability value ranging from 0 to 1, and to ensure that the sum of all attention weights is 1, so as to ensure that the model reasonably distributes weights between different modalities and avoid the situation where the features of a certain modality are too prominent or ignored.

[0076] The formula for generating the fusion matrix is:

[0077]

[0078] in, Represents the fusion matrix.

[0079] The fusion matrix is ​​a fusion of the weather impact feature matrix and the road space feature matrix to generate a comprehensive and more informative feature representation, reflecting the correlation between different features. Each element in the fusion matrix represents the correlation between the weather impact feature and the road space feature at the corresponding moment, and the higher the attention weight, the higher the correlation between the two. Step 4: Construct LSTM, mark the label of the average speed of urban roads at the next acquisition moment on the fusion matrix, and input it into LSTM for training to obtain a speed prediction model with the input value being the fusion matrix and the output value being the average speed of urban roads;

[0080] In this embodiment, the principle on which LSTM is constructed is:

[0081] The input features are road space feature matrices, including vehicle speed and vehicle density. After being adjusted by the input gate, cell states are introduced. The cells are used to store long-term information and control the retention and discarding of information.

[0082] The formula used by the input gate to determine what information needs to be written into the cell state is:

[0083]

[0084] in, represents the input gate, represents the index of the time step, represents the sigmoid activation function, represents the input gate weight matrix, represents the hidden state at the previous time step, represents the data of the current time step, represents the bias term;

[0085] According to the set time step, the forget gate determines which information needs to be discarded and activates it through the sigmoid function. The formula is:

[0086]

[0087] in, represents the forget gate, represents the weight matrix, Represents the bias term of the forget gate;

[0088] For the calculated forget gate , whose value is between 0 and 1, values ​​closer to 1 are retained in the cell, and values ​​closer to 0 are removed;

[0089] The cell state is updated using new information and past states, according to the formula:

[0090]

[0091] in, represents the updated cell state, represents the cell state at the previous time step, represents the new candidate value of information, represents the weight matrix of tanh, represents the bias term, and tanh represents the hyperbolic tangent activation function, which is used to compress the value between -1 and 1;

[0092] The output term is determined by the output gate, based on the formula:

[0093]

[0094] in, represents the output gate, represents the weight matrix of the output layer, represents the bias term, Represents the hidden state of the current time step, that is, the output item;

[0095] At the beginning of model training, the weight matrix is ​​randomly initialized. During the training process, the error gradient is calculated by the back propagation algorithm, and the weight matrix is ​​adjusted by the Adam optimization algorithm to minimize the loss function.

[0096] Each item of the road space feature matrix is ​​processed by LSTM to generate a road space time series feature matrix with time characteristics.

[0097] Step 5: Collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, and input them into the corresponding channels for processing. The processed data is processed according to the method of step 3 to generate a real-time fusion matrix.

[0098] Step 6: Input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads.

[0099] In this embodiment, the input features of the deep learning network include: a fusion matrix;

[0100] The structure of the deep learning network is:

[0101] Input layer: contains 1 neuron, which is used to receive the input of the fusion matrix;

[0102] The first hidden layer: contains 64 neurons and uses the ReLU activation function;

[0103] The second hidden layer: contains 32 neurons and uses the ReLU activation function;

[0104] Output layer: contains 1 neuron, uses a linear activation function, and is used to output the average speed of urban roads;

[0105] The speed prediction model is fed with a fusion matrix containing road spatial characteristics and weather influence characteristics at time 1 to n to generate the predicted average speed of urban roads at time n+1.

[0106] See also Figure 2 The present invention also provides a system for predicting the average speed of urban roads based on CNN-LSTM, and the system is used to implement the above-mentioned method for predicting the average speed of urban roads based on CNN-LSTM, specifically comprising:

[0107] A data collection module, for synchronously collecting historical traffic time series data and historical weather time series data, and normalizing the data, wherein the historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series, and the historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series;

[0108] The CNN training module is used to construct a dual-channel CNN. The first channel is trained with historical traffic data as input and the vehicle density and speed characteristics of the road as labels. The second channel is trained with historical weather data as input and the impact of weather on vehicle density and speed characteristics as labels.

[0109] The feature fusion module is used to integrate the vehicle density features and vehicle speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and vehicle speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, the weights of the weather feature matrix and the road space feature matrix are adjusted to generate a fusion matrix.

[0110] The model building module is used to build LSTM. After marking the label of the average speed of urban roads at the next acquisition moment on the fusion matrix, it is input into LSTM for training to obtain a speed prediction model whose input value is the fusion matrix and whose output value is the average speed of urban roads.

[0111] The feature generation module is used to collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, and input them into the corresponding channel for processing. The processed data is processed according to the method of the feature fusion module to generate a real-time fusion matrix;

[0112] The prediction output module is used to input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads.

[0113] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0114] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. The urban road average speed prediction method based on CNN-LSTM is characterized by: The specific steps include: Step 1: synchronously collect historical traffic time series data and historical weather time series data, and normalize the data. The historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series. The historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series. Step 2: Construct a dual-channel CNN, use historical traffic data as input, and the vehicle density and speed characteristics of the road as labels to train the first channel; use historical weather data as input, and the impact of weather on vehicle density and speed characteristics as labels to train the second channel; Step 3: Integrate the vehicle density features and speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, adjust the weights of the weather feature matrix and the road space feature matrix to generate a fusion matrix. Step 4: Construct LSTM, mark the label of the average speed of urban roads at the next acquisition time on the fusion matrix, and input it into LSTM for training to obtain a speed prediction model with the input value being the fusion matrix and the output value being the average speed of urban roads; Step 5: Collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, input them into the corresponding channels for processing, and process the processed data according to the method of step 3 to generate a real-time fusion matrix; Step 6: Input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads; The road space feature matrix is: , in, represents the road space feature matrix, Indicates The moment road space characteristics, is the index of the collection time, which is also the index of the row number, and , represents the total number of acquisition moments, Represents the index of road space features, which is also the index of column number, and j=1 or 2, corresponding to vehicle density features and vehicle speed features respectively; The weather characteristics matrix is: , in, represents the weather feature matrix, Indicates The abnormal weather at this moment has an impact on the The influence of various road spatial characteristics; The principle for generating the fusion matrix is: The similarity of each element in the road space feature matrix and the weather feature matrix is ​​generated based on the formula: , in, Represents the similarity matrix Line The element value of the column, Represents the road space feature matrix Line The element value of the column, Represents the weather feature matrix Line The element value of the column; Arrange the similarities of all elements according to their row and column numbers to generate a matrix , the matrix Represents the similarity matrix between the weather feature matrix and the road space feature matrix; The attention weight is generated according to the similarity matrix, based on the formula: , in, represents the attention weight of the road space feature matrix, represents the attention weight of the weather feature matrix, represents the similarity matrix, represents the transposed matrix of the similarity matrix; The formula for generating the fusion matrix is: , in, Represents the fusion matrix.

2. The urban road average speed prediction method based on CNN-LSTM according to claim 1, characterized in that: The formula for normalizing the data in step 1 is: , in, It represents the result of normalizing the collected data. Represents the collected raw data, Represents the maximum value in the original data. Indicates the minimum value in the original data.

3. The urban road average speed prediction method based on CNN-LSTM according to claim 1, characterized in that: In step 3, the road space characteristics are vehicle density characteristics and vehicle speed characteristics, and the weather characteristics are the impact of abnormal weather on the road space characteristics. The abnormal weather includes rain, snow, typhoons and other weather that is determined by experts to affect travel.

4. The urban road average speed prediction method based on CNN-LSTM according to claim 1, characterized in that: The speed prediction model is fed with a fusion matrix containing road spatial characteristics and weather characteristics at time 1 to n to generate the predicted average speed of urban roads at time n+1.

5. The urban road average speed prediction system based on CNN-LSTM is characterized by: The system is used to execute the urban road average speed prediction method based on CNN-LSTM according to any one of claims 1 to 4: A data collection module, for synchronously collecting historical traffic time series data and historical weather time series data, and normalizing the data, wherein the historical traffic time series data includes the number of lanes, the number of vehicles on the lanes, and the length of the lanes arranged along the time series, and the historical weather time series data includes the temperature, precipitation, snowfall, and wind speed arranged along the time series; The CNN training module is used to construct a dual-channel CNN. The first channel is trained with historical traffic data as input and the vehicle density and speed characteristics of the road as labels. The second channel is trained with historical weather data as input and the impact of weather on vehicle density and speed characteristics as labels. The feature fusion module is used to integrate the vehicle density features and vehicle speed features at n consecutive collection moments to form a road space feature matrix, and integrate the impact of weather on vehicle density features and vehicle speed features at the corresponding collection moment to form a weather feature matrix. Based on the cross-modal attention fusion mechanism, the weights of the weather feature matrix and the road space feature matrix are adjusted to generate a fusion matrix. The model building module is used to build LSTM. After marking the label of the average speed of urban roads at the next acquisition moment on the fusion matrix, it is input into LSTM for training to obtain a speed prediction model whose input value is the fusion matrix and whose output value is the average speed of urban roads. The feature generation module is used to collect the traffic time series data and weather time series data of the predicted area at n consecutive collection times in real time, and input them into the corresponding channel for processing. The processed data is processed according to the method of the feature fusion module to generate a real-time fusion matrix; The prediction output module is used to input the real-time fusion matrix into the trained speed prediction model to predict the average speed of urban roads.

Citation Information

Patent Citations

  • Urban road vehicle speed prediction method

    CN116486611A

  • Urban vehicle speed prediction method and system based on graph attention network and weather weight

    CN115204489A