Traffic flow prediction method and system based on large model

Through a large-model-based traffic flow prediction method, combined with convolutional neural networks and long-term memory networks, the problems of prediction lag and lack of flexibility in the prior art are solved, and more accurate and efficient traffic flow prediction is achieved.

CN119580480APending Publication Date: 2025-03-07TAIZHOU RES INST ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411533154.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Existing traffic flow prediction technologies ignore spatial and temporal changes, resulting in prediction lag, lack of flexibility, and increase network burden.

Method used

Using a large-model-based traffic flow prediction method, a prediction model is constructed by collecting and processing multi-dimensional data pairs, and combining the deployment of local hardware and cloud servers, a convolutional neural network and a long and short-term memory network are used to extract spatial and temporal features and perform real-time prediction.

Benefits of technology

It improves the accuracy and reliability of the prediction results, reduces delay and network burden, and enhances the flexibility and information security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580480A_ABST
    Figure CN119580480A_ABST
Patent Text Reader

Abstract

The invention relates to a traffic flow prediction method and system based on a large model, and the method comprises the steps: collecting and processing a multi-dimensional data pair, inputting a constructed prediction model through the processed data, and carrying out the training optimization of the model based on output; the traffic flow is predicted through the trained and optimized prediction model and the large model; the system comprises local hardware and a cloud server, a prediction model is deployed in cooperation with the local hardware, and a large model is deployed in the cloud server; and the local prediction model obtains the processed image data and outputs a primary prediction result, the primary prediction result, the time sequence data and the environment variable data are input into the cloud large model, and an output result of the large model is taken as a final prediction result. The method improves the accuracy and reliability of a prediction result, improves the response speed of the whole system, reduces the network burden, saves the computing resources, and enhances the flexibility of the system. The information security is effectively improved, and the risk of privacy information leakage is reduced; and the adjustability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic control systems, and in particular to a traffic flow prediction method and system based on a large model. Background Art

[0002] In recent years, with the development of the automobile manufacturing industry and the increase in per capita income, the rate of private car ownership has continued to increase. However, with the continuous expansion of urban scale and the increasingly complex road traffic conditions, this is in conflict with people's demand for convenience and flexibility in daily travel.

[0003] The urban road traffic system is mainly composed of the road network system, traffic flow and traffic monitoring and control system. The road network system is used as the carrier of traffic flow, and the traffic detection and control system guides the traffic to pass through the conflict points in the road network in an orderly manner. The traditional traffic system mainly relies on traffic signal control, traffic flow monitoring and navigation systems to achieve overall circulation. However, in actual applications, the traffic system still has some limitations, such as insufficient information data collection and processing capabilities, limited prediction and decision-making capabilities, and inability to adjust the control method according to real-time traffic conditions. There is room for improvement in alleviating traffic congestion and preventing traffic accidents.

[0004] One way to solve the above problems is to predict traffic flow and provide avoidance strategies in advance. Traffic flow prediction refers to the use of historical traffic data, mathematical models and machine learning algorithms to estimate the traffic volume on the road in a certain period of time in the future. This technology can not only help relevant departments predict traffic conditions and control vehicle density, but also help private cars make travel plans and adjust driving routes in real time to avoid road congestion.

[0005] However, in the existing technology, the prediction of traffic flow often ignores the impact of spatial and temporal changes on traffic. When the delay is uncontrollable, such prediction is often lagging and lacks the flexibility of adjustment, while also increasing the network burden. Summary of the invention

[0006] The present invention solves the problems existing in the prior art and provides a traffic flow prediction method and system based on a large model.

[0007] The technical solution adopted by the present invention is a traffic flow prediction method based on a large model, the method collects and processes multi-dimensional data pairs, constructs a prediction model, inputs the prediction model with the processed data pairs, and trains and optimizes the model based on the output;

[0008] Traffic flow is predicted using the trained and optimized prediction model and large model.

[0009] Preferably, the data pairs include real-time and historical image data, time series data and environmental variable data.

[0010] Preferably, the data pairs are dimensionally segmented and labels are added, wherein the dimensions include a time dimension, a geographic location dimension, and a special situation dimension.

[0011] Preferably, processing the data pair includes cleaning the data, standardizing the data, and establishing a time window to obtain a time series.

[0012] Preferably, the prediction model includes a convolution module, a long short-term memory module and a fully connected module arranged in sequence, and the fully connected module is connected to a large cloud model;

[0013] The image data is input into the convolution module, the fully connected module outputs the primary prediction result, the primary prediction result, the time series data and the environmental variable data are input into the cloud-based large model, and the result output by the cloud-based large model is the final prediction result.

[0014] Preferably, the convolution module includes three convolution blocks connected in sequence and an output block, any of the convolution blocks includes two convolution layers and a maximum pooling layer connected in sequence, and the output block includes a Flatten layer and a linear layer.

[0015] Preferably, a batch normalization layer and a Dropout layer are sequentially arranged between the convolution layer and the maximum pooling layer of any of the convolution blocks, and a Dropout layer is arranged at the very end of the output block.

[0016] Preferably, the loss function of the prediction model is mean square error MSE; the model is trained with RMSprop optimizer and the learning rate is adjusted; L2 regularization is added to the model to limit the complexity of the prediction model.

[0017] Preferably, the performance of the prediction model is measured by the mean absolute error; the optimization includes the optimization of data features and the optimization of the prediction model.

[0018] A system using the traffic flow prediction method based on a large model, the system comprising local hardware and a cloud server, the prediction model is deployed in conjunction with the local hardware, and the large model is deployed in the cloud server;

[0019] The local prediction model obtains the processed image data and outputs the primary prediction result. The primary prediction result, time series data and environmental variable data are input into the big model in the cloud, and the result output by the big model is the final prediction result.

[0020] The present invention relates to a traffic flow prediction method and system based on a large model. The method collects and processes multidimensional data pairs, constructs a prediction model, inputs the prediction model with processed data pairs, and trains and optimizes the model based on the output; the traffic flow is predicted by the trained and optimized prediction model and the large model; the system includes local hardware and a cloud server, the prediction model is deployed in conjunction with the local hardware, and the large model is deployed in the cloud server; the local prediction model obtains the processed image data and outputs a primary prediction result, the primary prediction result, time series data and environmental variable data are input into the large model on the cloud, and the result output by the large model is the final prediction result.

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

[0022] (1) The local model consists of a convolutional neural network and a long short-term memory network. It fully utilizes the spatial feature extraction capability of the convolutional neural network and the time series processing capability of the long short-term memory network. It is well adapted to the task of real-time traffic flow prediction, and enables the neural network model to capture both the spatial and temporal characteristics of traffic flow, thereby improving the accuracy and reliability of the prediction results.

[0023] (2) Compared with directly inputting all data into a large model, the existence of a prediction model can reduce latency, improve the response speed of the entire system, reduce network burden, save computing resources, and enhance system flexibility;

[0024] (3) Building a local model can effectively improve information security and reduce the risk of privacy information leakage;

[0025] (4) Strong adjustability: With algorithm optimization and hardware upgrades, the local model can be updated, or a more powerful cloud-based model can be connected to improve prediction accuracy while keeping the overall process unchanged. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of the system structure of the present invention;

[0027] Figure 2 is a schematic diagram of an embodiment of the present invention;

[0028] Figure 3 Schematic diagram of the convolution module of the present invention. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below in conjunction with embodiments, but the protection scope of the present invention is not limited thereto.

[0030] The present invention relates to a traffic flow prediction method based on a large model, wherein the method collects and processes multidimensional data pairs, constructs a prediction model, inputs the processed data pairs into the prediction model, and trains and optimizes the model based on the output;

[0031] Traffic flow is predicted using the trained and optimized prediction model and large model.

[0032] In the present invention, the prediction model is deployed locally and consists of a convolutional neural network (CNN) and a long short-term memory (LSTM) network. CNN extracts spatial features from input data and captures spatial correlations in the data, while LSTM processes time series data and captures temporal dependencies in the data. The spatial feature extraction capability of CNN and the time series processing capability of LSTM are utilized to predict traffic flow in real time, thereby improving the accuracy and reliability of the prediction results.

[0033] The data pairs include real-time and historical image data, time series data, and environmental variable data.

[0034] The data pairs are divided into dimensions and labels are added, wherein the dimensions include a time dimension, a geographic location dimension, and a special situation dimension.

[0035] Processing the data pair includes cleaning the data, standardizing the data, and establishing a time window to obtain a time series.

[0036] In the present invention, for the task of traffic flow prediction, the influence of various factors is taken into account when collecting training data. For example, traffic flow data has a strong time correlation and periodicity, and there will be a more obvious growth trend in certain fixed time periods, including but not limited to morning and evening peaks, holidays, etc., and the geographical location also has a great influence on traffic flow. The traffic flow in different areas has its own significant characteristics. For example, the traffic flow in the working area will decrease on weekends, while the traffic flow in the entertainment area and the resort area will increase. At the same time, weather factors will also affect the traffic situation. Extreme weather such as heavy rain, heavy snow, typhoon, etc. will significantly reduce the traffic flow. Special road conditions, such as traffic jams and traffic accidents, will also affect the traffic flow.

[0037] Based on this, the data of the present invention comes from real-time traffic flow data and some historical data such as past traffic flow records from traffic cameras, clocks, sensors, GPS and other devices;

[0038] The time range is for various time periods and is sufficient to cover different traffic conditions, such as morning and evening rush hours, holidays, special weather conditions, etc.

[0039] Collect traffic data from different geographical locations to reflect the traffic flow characteristics of different areas;

[0040] Collect traffic flow data when special situations such as traffic jams and traffic accidents occur to make the features more comprehensive.

[0041] Specifically, traffic image data captured in real time by traffic cameras is used for prediction of local models; data collected in real time by devices such as clocks, sensors, GPS, etc. is used as time series data and environmental variable data for prediction of large cloud models; historical image data, such as past traffic flow records, are used to train local models.

[0042] In the present invention, the collected data is cleaned, including but not limited to removing outliers or erroneous data, and standardizing the data so that the features are within the same value range, which helps to speed up the training process and improve the model performance;

[0043] For the processed data, a time series is constructed, and the time window covers at least one complete periodic time period, such as the morning and evening rush hours of the day, but the time window cannot be too large to avoid increasing the computational burden or introducing unnecessary noise. In the specific implementation process, the data of the past 3 hours are basically used to predict the traffic flow of the next hour.

[0044] The prediction model includes a convolution module, a long short-term memory module and a fully connected module arranged in sequence, and the fully connected module is connected to a large cloud model;

[0045] The image data is input into the convolution module, the fully connected module outputs the primary prediction result, the primary prediction result, the time series data and the environmental variable data are input into the cloud-based large model, and the result output by the cloud-based large model is the final prediction result.

[0046] The convolution module includes three convolution blocks connected in sequence and an output block, any of the convolution blocks includes two convolution layers and a maximum pooling layer connected in sequence, and the output block includes a Flatten layer and a linear layer.

[0047] A batch normalization layer and a Dropout layer are sequentially arranged between the convolution layer and the maximum pooling layer of any of the convolution blocks, and a Dropout layer is arranged at the end of the output block.

[0048] The loss function of the prediction model is the mean square error (MSE). The model is trained with the RMSprop optimizer to adjust the learning rate. L2 regularization is added to the model to limit the complexity of the prediction model.

[0049] In the present invention, the convolution module processes the image data, extracts the spatial features, and outputs the feature map Y, satisfying,

[0050] Y=σ(W i *X+b i )

[0051] Among them, σ is the Rule activation function, W i is the convolution kernel, * represents the convolution operation, X is the input feature map, b iis the bias value.

[0052] In the present invention, the number of parameters of the neural network is reduced, the number of convolution blocks is reduced to 3, all convolution layers are reduced to 6, and the number of fully connected modules is also reduced to 1. At the same time, the number of output channels of each convolution layer is reduced, and the model complexity is reduced as much as possible while retaining the feature extraction capability. A batch normalization layer (BatchNorm) and a Dropout layer are set in each convolution block, and some output features of the layer are randomly discarded during the training process, thereby forcing the network to learn a more robust feature representation instead of relying on specific features in the training data, which can reduce the risk of overfitting, improve the generalization ability of the model, and facilitate gradient propagation, improve stability, thereby realizing a deeper neural network.

[0053] In the present invention, the long short-term memory module processes time series data and extracts temporal dependencies. t , input gate i t and output gate o t The calculation formula is as follows:

[0054] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0055] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0056] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0057] Among them, σ is the sigmoid activation function, W is the weight parameter matrix of each gate, and h t-1 is the hidden state of the previous time step, x t is the input of the current time step, and b is the bias value of each gate;

[0058] Candidate value vector Cell State C t and the hidden state h t The calculation formula is as follows:

[0059]

[0060]

[0061] h t =o t ⊙tanh(C t )

[0062] Where W $ is the weight parameter matrix of the candidate value vector, b $ is the bias value of the candidate value vector, and ⊙ represents the principal element multiplication.

[0063] In the present invention, the output layer of the fully connected module uses a linear activation function so that the model can predict values ​​in any range.

[0064] In the present invention, mean square error (MSE) is used as the loss function of the model.

[0065]

[0066] In the formula, MSE is the mean square error, n is the number of samples, and y i is the actual value of the ith observation, is the predicted value of the ith observation; its error sensitivity helps to improve the accuracy of the model for traffic flow prediction and reduce the frequency of large errors.

[0067] In the present invention, the RMSprop optimizer is used to train the model. The RMSprop optimizer adjusts the learning rate according to the square moving average of the gradient. The learning rate can be adaptively adjusted at different training stages to improve the training efficiency. By calculating the square moving average of the gradient, the RSMprop optimizer can reduce the problems of gradient explosion and disappearance. The learning rate adjustment formula is as follows:

[0068]

[0069]

[0070] In the formula, v t is the cumulative value of the square of the gradient at the current moment, γ is a coefficient between 0 and 1, g t is the gradient at the current moment, η is the learning rate, ∈ is a small constant, and θ t is the parameter at the current moment.

[0071] In the present invention, a simple model is a model with a smaller entropy of parameter value distribution, which is less prone to overfitting than a complex model. In order to reduce overfitting and improve the generalization ability of the model, a regularization layer is added. Specifically, a cost proportional to the square of the weight coefficient is added to the model loss function, forcing the model to take only smaller values, thereby limiting the complexity of the model, which makes the distribution of weight values ​​more regular.

[0072] The performance of the prediction model is measured by the mean absolute error; optimization includes optimization of data features and optimization of the prediction model.

[0073] In the present invention, the performance of the prediction model can be evaluated to understand the performance of the model on unknown data. The mean absolute error (MAE) is used as an indicator to measure the performance of the model, and the average value of the absolute value of the difference between the predicted value and the true value is calculated;

[0074] Improving the model based on its performance indicators is an iterative process that involves adjustments and optimizations at multiple levels:

[0075] At the data level, add new features or transform existing features, such as road construction conditions, holiday signs, number of traffic lights, etc., to help the model capture more factors that affect traffic flow;

[0076] At the model architecture level, add more CNN layers or LSTM layers to capture higher-level features, or use residual connections to alleviate the gradient vanishing problem and help train deeper networks;

[0077] At the model evaluation level, K-fold cross-validation is used to more accurately estimate the generalization ability of the model and avoid evaluation bias caused by improper data segmentation.

[0078] The present invention also relates to a system using the traffic flow prediction method based on a large model, wherein the system includes local hardware and a cloud server, wherein the prediction model is deployed in conjunction with the local hardware, and the large model is deployed in the cloud server;

[0079] The local prediction model obtains the processed image data and outputs a primary prediction result. The primary prediction result, time series data and environmental variable data are input into a large model in the cloud, and the result output by the large model is the final prediction result.

[0080] In the present invention, the data obtained in the data collection stage are divided into two categories, one is the image data captured by the camera, and the other is the time series data and environmental variable data collected by clocks, sensors, GPS locators and other devices. First, the image data is input into the local model to obtain a preliminary prediction result, and then the prediction result, time series data and environmental variable data are input into the cloud-based large model to obtain the final prediction result, thereby improving the prediction accuracy, reducing the prediction time of the large model and improving the prediction efficiency; the local hardware and cloud-based servers here are contents that are easy for technicians in this field to understand, and those skilled in the art can build them based on actual conditions.

[0081] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0085] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0086] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A traffic flow prediction method based on a large model, characterized by: The method collects and processes multidimensional data pairs, constructs a prediction model, inputs the processed data pairs into the prediction model, and trains and optimizes the model based on the output; Traffic flow is predicted using the trained and optimized prediction model and large model.

2. The traffic flow prediction method based on a large model according to claim 1 is characterized by: The data pairs include real-time and historical image data, time series data, and environmental variable data.

3. The traffic flow prediction method based on a large model according to claim 2 is characterized by: The data pairs are divided into dimensions and labels are added, wherein the dimensions include a time dimension, a geographic location dimension, and a special situation dimension.

4. The traffic flow prediction method based on a large model according to claim 2 is characterized in that: Processing the data pair includes cleaning the data, standardizing the data, and establishing a time window to obtain a time series.

5. The traffic flow prediction method based on a large model according to claim 2 is characterized in that: The prediction model includes a convolution module, a long short-term memory module and a fully connected module arranged in sequence, and the fully connected module is connected to a large cloud model; The image data is input into the convolution module, the fully connected module outputs the primary prediction result, the primary prediction result, the time series data and the environmental variable data are input into the cloud-based large model, and the result output by the cloud-based large model is the final prediction result.

6. The traffic flow prediction method based on a large model according to claim 5 is characterized by: The convolution module includes three convolution blocks connected in sequence and an output block, any of the convolution blocks includes two convolution layers and a maximum pooling layer connected in sequence, and the output block includes a Flatten layer and a linear layer.

7. The traffic flow prediction method based on a large model according to claim 6 is characterized by: A batch normalization layer and a Dropout layer are sequentially arranged between the convolution layer and the maximum pooling layer of any of the convolution blocks, and a Dropout layer is arranged at the end of the output block.

8. The traffic flow prediction method based on a large model according to claim 1 is characterized by: The loss function of the prediction model is the mean square error (MSE). The model is trained with the RMSprop optimizer to adjust the learning rate. L2 regularization is added to the model to limit the complexity of the prediction model.

9. The traffic flow prediction method based on a large model according to claim 1 is characterized by: The performance of the prediction model is measured by the mean absolute error; optimization includes optimization of data features and optimization of the prediction model.

10. A system using the large model-based traffic flow prediction method according to any one of claims 1 to 9, characterized in that: The system includes local hardware and cloud servers, with the prediction model deployed in conjunction with the local hardware and the large model deployed in the cloud server; The local prediction model obtains the processed image data and outputs a primary prediction result. The primary prediction result, time series data and environmental variable data are input into a large model in the cloud, and the result output by the large model is the final prediction result.