Short-term traffic flow prediction method based on deep learning

By constructing a deep learning model and walrus optimization algorithm, combining historical traffic flow and influencing data, the problem of traditional methods ignoring potential characteristics and parameter settings relying on manual experience, achieving accurate prediction of traffic flow and improving traffic management efficiency.

CN119250256APending Publication Date: 2025-01-03HUAIHUA UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411196313.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Traditional traffic flow prediction methods ignore potential characteristics that affect traffic flow, and deep learning model parameter setting relies on manual experience, resulting in inaccurate prediction results.

Method used

Build a short-term traffic flow prediction model based on deep learning, including spatial feature extraction module, spatiotemporal feature extraction module, feature fusion module and full connection prediction layer, combine walrus optimization algorithm to optimize hyperparameters, and use historical traffic flow data and multiple impact data Perform training and prediction.

Benefits of technology

Accurate prediction of traffic flow has been achieved, traffic management efficiency and travel information are improved, and traffic congestion problem has been alleviated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250256A_ABST
    Figure CN119250256A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent traffic, and discloses a short-term traffic flow prediction method based on deep learning, which comprises the following steps: acquiring historical data of a to-be-detected area, constructing a short-term traffic flow prediction model, extracting a hyper-parameter combination included in the short-term traffic flow prediction model, and calculating a short-term traffic flow prediction result; training and evaluating the short-time traffic flow prediction model corresponding to each hyper-parameter combination based on historical data, and taking an evaluation result as an evaluation score corresponding to each hyper-parameter combination; generating a sea elephant population by using each hyper-parameter combination as a sea elephant; performing parameter optimization in the sea elephant population based on the evaluation score corresponding to each hyper-parameter combination in combination with a sea elephant optimization algorithm to obtain an optimal hyper-parameter combination; and executing short-term traffic flow prediction of the to-be-detected area based on the short-term traffic flow prediction model corresponding to the optimal hyper-parameter combination. According to the technical scheme, the historical traffic flow data, various influence data and an advanced sea image optimization algorithm are combined, and accurate prediction of the traffic flow is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent transportation, and in particular relates to a short-term traffic flow prediction method based on deep learning. Background Art

[0002] With the continued rapid development of society and the economy, the number of vehicles has continued to increase, and road traffic volume has also increased accordingly, bringing with it a series of traffic problems. Currently, one of the effective ways to solve traffic problems is to control and guide road traffic status through intelligent traffic control systems. Short-term traffic flow prediction is the primary basis for traffic management and control departments to implement traffic guidance measures. To better reflect traffic conditions in real time, research based on short-term traffic flow prediction models has become a focus of traffic forecasting research in recent decades. With the continuous development of new technologies and the widespread application of intelligent systems, higher requirements are being placed on the processing of big data and the accuracy of traffic prediction models. Real-time and accurate traffic flow prediction can effectively improve traffic efficiency and safety, and facilitate management departments to proactively plan traffic and implement appropriate traffic diversion measures.

[0003] Most traditional traffic flow prediction methods only extract the spatiotemporal characteristics of traffic flow, ignoring the underlying characteristics that influence it. Furthermore, they lack in-depth analysis of traffic flow data, making it difficult to achieve more accurate predictions. Furthermore, deep learning models are often complex, and the setting of various parameters often relies on manual experience. This poses significant challenges to the application of deep learning, making it difficult to achieve accurate predictions. Summary of the Invention

[0004] The purpose of the present invention is to provide a short-term traffic flow prediction method based on deep learning to solve the problems existing in the above-mentioned prior art.

[0005] To achieve the above objectives, the present invention provides a short-term traffic flow prediction method based on deep learning, comprising:

[0006] Acquiring historical data of the area to be measured, wherein the historical data includes historical traffic flow data and traffic flow impact data;

[0007] Constructing a short-term traffic flow prediction model, wherein the short-term traffic flow prediction model includes a spatial feature extraction module, a spatiotemporal feature extraction module, a feature fusion module, and a fully connected prediction layer connected in sequence;

[0008] Extracting hyperparameter combinations included in the short-term traffic flow prediction model, training the short-term traffic flow prediction model corresponding to each hyperparameter combination based on the historical data, and evaluating the training results, using the evaluation results as evaluation scores corresponding to each hyperparameter combination;

[0009] generating a walrus population for the walrus using each of the hyperparameter combinations;

[0010] Based on the evaluation scores corresponding to the hyperparameter combinations and in combination with the walrus optimization algorithm, parameter optimization is performed within the walrus population to obtain the optimal hyperparameter combination;

[0011] The short-term traffic flow prediction of the area to be measured is performed based on the short-term traffic flow prediction model corresponding to the optimal hyperparameter combination.

[0012] Optionally, the historical traffic flow data includes the number of vehicles, vehicle speed and lane occupancy.

[0013] Optionally, the traffic flow impact data includes weather information, holiday information, road construction information and traffic accident information.

[0014] Optionally, before training the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations based on the historical data, it also includes performing data cleaning, data normalization and time series conversion on the historical data to obtain preprocessed historical data, and training the short-term traffic flow prediction model based on the preprocessed historical data.

[0015] Optionally, training the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations based on the historical data specifically includes:

[0016] Dividing the historical data into a training set, a test set, and a validation set according to a preset ratio;

[0017] The short-term traffic flow prediction model corresponding to each of the hyperparameter combinations is trained based on the training set, and the performance of the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations is verified and evaluated through the validation set, and the evaluation results are used as the evaluation scores corresponding to each of the hyperparameter combinations.

[0018] Optionally, the processing of the short-term traffic flow prediction model specifically includes:

[0019] Inputting the historical data into the short-term traffic flow prediction model, extracting the spatial features of the historical data through the spatial feature extraction module, and extracting the temporal features of the historical data through the spatiotemporal feature extraction module;

[0020] Taking the spatial features and the temporal features as inputs of the feature fusion module to perform feature fusion to obtain fused features;

[0021] The fusion features are input into the fully connected prediction layer to perform traffic flow prediction, and traffic flow prediction data within a preset time period is obtained.

[0022] Optionally, generating a walrus population for the walrus using each of the hyperparameter combinations specifically includes:

[0023] The value range, population size and number of iterations of the hyperparameter combination are set, and the walrus population is generated by using each of the hyperparameter combinations as a walrus in combination with the walrus optimization algorithm.

[0024] Optionally, performing parameter optimization within the walrus population based on the evaluation scores corresponding to the hyperparameter combinations in combination with a walrus optimization algorithm specifically includes:

[0025] Based on the walrus optimization algorithm, multiple iterative updates are performed on each hyperparameter combination in the walrus population. During each iterative update process, the evaluation score corresponding to each hyperparameter combination is calculated. The walrus population is updated based on the evaluation score corresponding to each hyperparameter combination until the number of iterations reaches a preset value and the optimal hyperparameter combination is output.

[0026] The technical effects of the present invention are:

[0027] This invention achieves accurate traffic flow prediction by constructing and optimizing a short-term traffic flow prediction model, combining historical traffic flow data with various influencing data and an advanced walrus optimization algorithm. This not only helps improve traffic management efficiency but also provides the public with more accurate travel information, alleviating traffic congestion. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. 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 paying any creative work.

[0029] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:

[0030] Figure 1 This is a prediction flow chart in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as limiting the present invention, but rather as a more detailed description of certain aspects, features, and embodiments of the present invention.

[0032] It should be understood that the terms described herein are intended only to describe particular embodiments and are not intended to limit the present invention. In addition, for numerical ranges herein, it should be understood that each intermediate value between the upper and lower limits of the range is also specifically disclosed. Each smaller range between any intermediate value within a stated value or stated range and any other stated value or intermediate value within the stated range is also encompassed by the present invention. The upper and lower limits of these smaller ranges may be independently included or excluded within the scope.

[0033] Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. Although only preferred methods are described herein, any method similar or equivalent to that described herein may also be used in the practice or testing of the present invention. All documents mentioned in this specification are incorporated by reference to disclose and describe the methods associated with the documents. In the event of any conflict with any incorporated document, the contents of this specification shall prevail.

[0034] It will be apparent to those skilled in the art that various modifications and variations may be made to the specific embodiments of the present invention without departing from the scope or spirit of the invention. Other embodiments will be apparent to those skilled in the art from the present invention. The present description and examples are intended to be illustrative only.

[0035] The words “include,” “including,” “have,” “contain,” etc. used in this article are open-ended terms, meaning including but not limited to.

[0036] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0037] Example 1

[0038] like Figure 1As shown, this embodiment provides a short-term traffic flow prediction method based on deep learning, including: obtaining historical data of the area to be measured, the historical data including historical traffic flow data and traffic flow impact data; constructing a short-term traffic flow prediction model, the short-term traffic flow prediction model including a spatial feature extraction module, a spatiotemporal feature extraction module, a feature fusion module and a fully connected prediction layer connected in sequence; extracting the hyperparameter combination included in the short-term traffic flow prediction model, training the short-term traffic flow prediction model corresponding to each hyperparameter combination based on the historical data, and evaluating the training results, and using the evaluation results as the evaluation scores corresponding to each hyperparameter combination; generating a walrus population for each hyperparameter combination; performing parameter optimization within the walrus population based on the evaluation scores corresponding to each hyperparameter combination and a walrus optimization algorithm to obtain the optimal hyperparameter combination; and executing short-term traffic flow prediction for the area to be measured based on the short-term traffic flow prediction model corresponding to the optimal hyperparameter combination.

[0039] By building and optimizing a short-term traffic flow prediction model, combining historical traffic flow data with various influencing data and an advanced walrus optimization algorithm, we achieve accurate traffic flow prediction. This not only helps improve traffic management efficiency, but also provides the public with more accurate travel information, alleviating traffic congestion.

[0040] The specific solutions of this embodiment include:

[0041] Obtain historical traffic flow data and auxiliary data. Historical traffic flow data comes from traffic monitoring equipment, traffic flow statistics systems, etc., including vehicle count, speed, and lane occupancy;

[0042] Auxiliary data comes from multiple channels such as meteorological departments, government departments, and traffic management departments, including weather information (such as temperature, humidity, rainfall, etc.), holiday information (such as holiday type, number of holidays, etc.), road construction information (construction location, construction time, construction impact range, etc.) and traffic accident information (accident location, accident time, accident level, etc.).

[0043] Before training the model, the collected historical data needs to be cleaned (to remove erroneous or abnormal data), normalized (to adjust all data to the same level for easy model processing), and time series converted (to organize the data into a time series form to reflect the changing trend over time).

[0044] Data cleaning: Process missing values ​​and outliers. For missing values, use interpolation (such as the average of the previous and next adjacent values) to fill them; for outliers, statistical methods (such as box plots) can be used to identify them and replace them with reasonable values.

[0045] Data normalization: Convert data of different dimensions to the same scale to eliminate the impact of the dimension on model training. Common normalization methods include minimum-maximum normalization and Z-score normalization.

[0046] Time series conversion: The traffic flow data is segmented according to time intervals (such as 5 minutes, 10 minutes) to form time series data.

[0047] Construction and training of prediction models:

[0048] Build a deep learning model that integrates CNN and LSTM. This model combines the spatial feature extraction capability of CNN and the time series modeling capability of LSTM. It includes an input layer, a CNN module, an LSTM module, a fusion layer, and a prediction layer connected in sequence.

[0049] Input layer: receives processed traffic flow data and auxiliary data as input.

[0050] CNN module: used to extract spatial features of traffic flow;

[0051] LSTM module: used to extract time series features of traffic flow.

[0052] Fusion layer: Fusion of features extracted by CNN and LSTM.

[0053] Prediction layer: Based on the fused features, a fully connected layer (Dense layer) is used to make predictions and output the short-term traffic flow in the future.

[0054] The historical data to be predicted is input into the short-term traffic flow prediction model. The spatial features of the historical data, namely the differences and correlations in traffic flow between different road sections or regions, are extracted using the CNN module. The temporal features of the historical data, such as the daily and weekly periodicity of traffic flow, are extracted using the LSTM module. The spatial and temporal features are then fused together using a fusion layer to generate fused features containing more comprehensive information. This step can be achieved through simple concatenation, weighted summation, or more complex attention mechanisms. The fused features are then input into the fully connected prediction layer for traffic flow prediction, resulting in traffic flow prediction data for a preset time period.

[0055] By integrating spatial and temporal features, the model captures multidimensional information in traffic flow data. Spatial features reflect the differences and correlations in traffic flow across different road sections or regions, while temporal features reveal the trends and cyclical nature of traffic flow over time. This fusion allows the model to comprehensively consider the influence of both spatial and temporal dimensions during prediction, thereby improving the accuracy and completeness of prediction results.

[0056] The historical data is divided into a training set, a test set, and a validation set according to a preset ratio. The validation set is used to prevent model overfitting during the training phase. Finally, an appropriate model is selected to predict the target data.

[0057] The training set is divided into time windows to generate training samples. Each sample contains traffic flow data for a period of time and corresponding auxiliary data. The model is trained on the training set, and the mean squared error (MSE) is selected as the loss function to guide the model training process. At the end of each round of training, the model error on the validation set is used to determine whether the model is overfitting.

[0058] Extract all adjustable hyperparameter combinations from the model. Hyperparameters are mainly divided into two categories. One is training hyperparameters (the model is trained using a small batch random algorithm by default), which mainly include learning rate, batch size, and number of training rounds. The other is the model's structural hyperparameters. Different models often have different structural hyperparameters.

[0059] The value range, population size and number of iterations of the hyperparameter combination are set, and the walrus population is generated by using each of the hyperparameter combinations as a walrus in combination with the walrus optimization algorithm.

[0060] The short-term traffic flow prediction model corresponding to each of the hyperparameter combinations is trained based on the training set, the model is trained on the training set, and the mean square error (MSE) is selected as the loss function to guide the model training process.

[0061] And when each round of training is completed, the error of the model on the validation set is used to determine whether the model is overfitting, and the error evaluation result is used as the evaluation score corresponding to each of the hyperparameter combinations.

[0062] Based on the evaluation scores corresponding to the hyperparameter combinations and the walrus optimization algorithm, parameter optimization is performed within the walrus population:

[0063] Based on the walrus optimization algorithm, multiple iterative updates are performed on each hyperparameter combination in the walrus population. During each iterative update process, the evaluation score corresponding to each hyperparameter combination is calculated, and the walrus population is updated based on the evaluation score corresponding to each hyperparameter combination. By simulating natural behaviors such as walrus migration and aggregation, the hyperparameters of the candidates are updated and adjusted to generate a new walrus population. The above evaluation, sorting, updating and selection processes are repeated until a preset number of iterations is reached or other stopping conditions are met (such as the evaluation score no longer significantly improves), and the optimal hyperparameter combination is output.

[0064] Using the short-term traffic flow prediction model trained with the optimal hyperparameter combination, we can predict short-term traffic flow in the test area. The prediction results can provide strong decision-making support for traffic management departments, helping to alleviate traffic congestion and improve road efficiency.

[0065] Through the above detailed steps, an efficient and accurate short-term traffic flow prediction model can be constructed, and the walrus optimization algorithm can be used to optimize the model's hyperparameters to further improve the model's prediction performance.

[0066] The above description is merely a preferred embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A short-term traffic flow prediction method based on deep learning, characterized in that: include: Acquire historical data of the area to be tested, wherein the historical data includes historical traffic flow data and traffic flow impact data; Constructing a short-term traffic flow prediction model, wherein the short-term traffic flow prediction model includes a spatial feature extraction module, a spatiotemporal feature extraction module, a feature fusion module and a fully connected prediction layer connected in sequence; Extracting the hyperparameter combinations included in the short-term traffic flow prediction model, training the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations based on the historical data, and evaluating the training results, using the evaluation results as the evaluation scores corresponding to each of the hyperparameter combinations; generating a walrus population for the walrus using each of the hyperparameter combinations; Based on the evaluation scores corresponding to the hyperparameter combinations and in combination with the walrus optimization algorithm, parameter optimization is performed in the walrus population to obtain the optimal hyperparameter combination; The short-term traffic flow prediction of the area to be tested is performed based on the short-term traffic flow prediction model corresponding to the optimal hyperparameter combination.

2. According to claim 1, a short-term traffic flow prediction method based on deep learning is characterized in that: The historical traffic flow data includes the number of vehicles, vehicle speed and lane occupancy.

3. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: The traffic flow impact data includes weather information, holiday information, road construction information and traffic accident information.

4. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: Before training the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations based on the historical data, it also includes performing data cleaning, data normalization and time series conversion on the historical data to obtain pre-processed historical data, and training the short-term traffic flow prediction model based on the pre-processed historical data.

5. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: Training the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations based on the historical data specifically includes: Dividing the historical data into a training set, a test set, and a validation set according to a preset ratio; The short-term traffic flow prediction model corresponding to each of the hyperparameter combinations is trained based on the training set, and the performance of the short-term traffic flow prediction model corresponding to each of the hyperparameter combinations is verified and evaluated through the verification set, and the evaluation result is used as the evaluation score corresponding to each of the hyperparameter combinations.

6. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: The processing process of the short-term traffic flow prediction model specifically includes: Inputting the historical data into the short-term traffic flow prediction model, extracting the spatial features of the historical data through the spatial feature extraction module, and extracting the temporal features of the historical data through the spatiotemporal feature extraction module; Taking the spatial feature and the temporal feature as inputs of the feature fusion module to perform feature fusion to obtain a fusion feature; The fused features are input into the fully connected prediction layer to perform traffic flow prediction, and traffic flow prediction data within a preset time period is obtained.

7. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: Generate a walrus population for the walrus using each of the hyperparameter combinations, specifically including: The value range, population size and number of iterations of the hyperparameter combination are set, and the walrus optimization algorithm is combined to use each of the hyperparameter combinations as a walrus to generate the walrus population.

8. The short-term traffic flow prediction method based on deep learning according to claim 1 is characterized in that: Based on the evaluation scores corresponding to the hyperparameter combinations and in combination with the walrus optimization algorithm, parameter optimization is performed within the walrus population, specifically including: Based on the walrus optimization algorithm, each hyperparameter combination in the walrus population is iteratively updated multiple times. In each iterative update process, the evaluation score corresponding to each hyperparameter combination is calculated, and the walrus population is updated based on the evaluation score corresponding to each hyperparameter combination, until the number of iterations reaches a preset value, and the optimal hyperparameter combination is output.