Traffic flow prediction method and device, storage medium and electronic equipment

By constructing a multi-source traffic data pool, using GANs models for data augmentation, and combining the Dropout method to train the model, and deploying it on an FPGA accelerator, the problems of overfitting, low computational efficiency, and real-time performance in existing traffic flow prediction are solved. This achieves real-time and accurate traffic flow prediction, with the effects of reducing costs and enhancing robustness.

CN121483023APending Publication Date: 2026-02-06ANHUI POLYTECHNIC UNIV MECHANICAL & ELECTRICAL COLLEGE
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511606826.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing traffic flow prediction models are prone to overfitting, have low computational efficiency, are not adaptable to new data, have low prediction accuracy, and lack real-time updates, making it difficult to meet the needs of real-time traffic management.

Method used

A multi-source traffic data pool is constructed, data augmentation is performed using GANs models, a traffic flow prediction model is trained using the Dropout method, and the model is deployed on an FPGA accelerator for real-time prediction.

Benefits of technology

It enables real-time and accurate traffic flow prediction, reduces computing costs, enhances model robustness, and promotes the development of smart cities and the wide range of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121483023A_ABST
    Figure CN121483023A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method and device, a storage medium and electronic equipment. The method relates to the technical field of traffic flow analysis, and comprises the following steps: constructing a multi-source traffic data pool, and preprocessing historical traffic data in the multi-source traffic data pool to obtain a target multi-source traffic data pool; performing data enhancement processing on the historical traffic data in the target multi-source traffic data pool by adopting a pre-trained GANs model to obtain an enhanced sample set for training a target traffic flow prediction model; performing model training on an initial traffic flow prediction model by adopting a Dropout method based on the enhanced sample set to obtain a target traffic flow prediction model meeting a preset condition; and performing traffic flow prediction on multi-source traffic data acquired in real time by using the target traffic flow prediction model to obtain a traffic flow prediction result. According to the method, the accuracy of urban traffic flow prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic flow analysis technology, and in particular to a traffic flow prediction method, device, storage medium, and electronic device. Background Technology

[0002] With the acceleration of urbanization and population growth, urban traffic problems are becoming increasingly prominent, such as traffic congestion and frequent traffic accidents. These problems seriously restrict the sustainable development of cities and the quality of life of residents. The emergence and widespread application of big data technology have provided new ideas and methods for solving urban traffic problems. By collecting, processing, and analyzing massive amounts of urban traffic data, it is possible to grasp urban traffic conditions in real time, predict future traffic flow, and design corresponding optimization schemes. In recent years, the development of machine learning algorithms and deep learning technologies has made the analysis and prediction of urban traffic data more accurate and efficient. These algorithms can be trained and predicted using historical and real-time data, providing important support for the construction of smart city transportation.

[0003] Urban traffic flow prediction is a crucial component of intelligent transportation systems, playing a vital role in urban planning, traffic management, and improving traffic efficiency. With the accelerating pace of urbanization, traffic flow prediction faces a series of challenges, including complex road network structures, variable road conditions, the need for processing large amounts of traffic data, and the necessity of real-time prediction. While existing technologies, such as the "Traffic Flow Prediction Model Based on Multi-Source Heterogeneous Spatiotemporal Data Fusion," have made progress in multi-source data fusion, these methods often rely on large amounts of historical data and have high computational complexity, making them difficult to meet the demands of real-time prediction. Furthermore, traditional deep learning models, such as those described in "Urban Area Traffic Flow Prediction Based on CNN and LSTM," are prone to overfitting during training, resulting in insufficient generalization ability when faced with new data.

[0004] Limitations of existing technology: (1) Model overfitting: Traditional prediction models, such as machine learning-based models, are prone to overfitting during training, resulting in poor performance of the model in tests or practical applications.

[0005] (2) Low computational efficiency: With the increase of traffic data, the computational efficiency of traditional models has become a bottleneck, making it difficult to meet the requirements of real-time prediction.

[0006] (3) Strong data dependence: Existing models often rely on a large amount of historical data and are not adaptable to new data or sudden situations.

[0007] (4) Low prediction accuracy: Due to the above reasons, existing technologies often have certain errors in predicting urban traffic flow, which affects traffic management decisions.

[0008] (5) Lack of real-time updates: Existing technologies are insufficient in updating prediction results in real time and are difficult to adapt to real-time changes in traffic flow. Summary of the Invention

[0009] In view of this, this application provides a traffic flow prediction method, device, storage medium, and electronic device, the main purpose of which is to solve the problem that existing traffic flow prediction models are inaccurate in predicting traffic flow.

[0010] To address the above problems, this application provides a traffic flow prediction method, comprising: A multi-source traffic data pool is constructed, and the historical traffic data in the multi-source traffic data pool is preprocessed to obtain the target multi-source traffic data pool. The historical traffic data in the target multi-source traffic data pool is augmented using a pre-trained GAN model to obtain an augmented sample set for training the target traffic flow prediction model. Based on the enhanced sample set, the initial traffic flow prediction model is trained using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. The target traffic flow prediction model includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module. The target traffic flow prediction model deployed on an FPGA accelerator is used to predict traffic flow from real-time multi-source traffic data, and the traffic flow prediction results are obtained.

[0011] Optionally, the step of constructing a multi-source traffic data pool and preprocessing the historical traffic data in the multi-source traffic data pool to obtain a target multi-source traffic data pool specifically includes: Acquire historical traffic data from different data sources collected by different acquisition devices; The historical traffic data is collected and aligned in time and space using the NTP network time protocol and GIS geographic information system, respectively, to obtain the multi-source traffic data pool. The historical traffic data in the multi-source traffic data pool is cleaned to obtain the first traffic data. The data cleaning method includes deleting duplicate data, correcting erroneous data, and integrating inconsistent data. The first traffic data is processed to obtain the second traffic data. The missing value processing methods include deletion, interpolation and data filling. The second traffic data is then subjected to data standardization and normalization to obtain the third traffic data; The third traffic data is classified and coded to obtain the target multi-source traffic data pool.

[0012] Optionally, before performing data augmentation processing on the historical traffic data in the target multi-source traffic data pool using a pre-trained GANs model, the method further includes: constructing a GANs model; The construction of GANs models specifically includes: Step 1: Initialize the generator and discriminator of the GANs model; Step 2: Based on the historical traffic data as training samples, perform the first training on the discriminator to obtain the first discriminator for the first training cycle; Step 3: Based on the historical traffic data as training samples, the generator is trained a second time using the first discriminator to obtain the generator for the first training cycle. Step 4: Repeat steps 2 and 3 until the model converges, thus constructing the GANs model.

[0013] Optionally, the step of using a pre-trained GAN model to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool to obtain an augmented sample set for training the target traffic flow prediction model specifically includes: Identify the missing scenarios in the target multi-source traffic data pool; Based on the conditional information of the missing scenario, the target generator of the GANs model is used to generate samples to obtain synthetic traffic data; The synthetic traffic data is labeled to obtain a synthetic sample dataset; An enhanced sample set for training the target traffic flow prediction model is obtained by combining the historical traffic data in the target multi-source traffic data pool with the synthetic sample dataset.

[0014] Optionally, the step of training the initial traffic flow prediction model using the Dropout method based on the enhanced sample set to obtain the target traffic flow prediction model that meets preset conditions specifically includes: Step 1: Divide the augmented sample set into two parts at an 8:2 ratio to obtain a training sample set and a validation sample set; Step 2: Apply the initial traffic flow prediction model to the training sample set to perform forward propagation prediction processing to obtain the initial prediction results corresponding to the training sample set; Step 3: Update the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction results and the actual traffic flow values ​​corresponding to the training sample set; Step 4: Repeat steps 2 to 3 until the loss of the initial traffic flow prediction model updated after three consecutive iterations is less than or equal to a preset threshold when predicting the validation sample set, then determine the current initial traffic flow prediction model as the target traffic flow prediction model.

[0015] Optionally, the step of performing forward propagation prediction processing on the training sample set using the initial traffic flow prediction model to obtain the initial prediction result corresponding to the training sample set specifically includes: The training sample set is preprocessed using the input layer of the initial traffic flow prediction model to obtain a data tensor; The spatiotemporal convolutional module of the initial traffic flow prediction model extracts spatial features from the data tensor based on a first dropout rate to obtain spatial features. The temporal modeling module of the initial traffic flow prediction model captures the spatial features temporally based on the first discard rate to obtain temporal features; The feature fusion module of the initial traffic flow prediction model performs feature fusion on the time-series features based on the second dropout rate to obtain the initial prediction result corresponding to the training sample set.

[0016] Optionally, updating the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction results and the actual traffic flow values ​​corresponding to the training sample set specifically includes: The loss value is obtained by calculating based on the initial prediction result and the actual flow value shown. Based on the loss value, the gradient of each module parameter with respect to the loss value is calculated using the backpropagation algorithm. The gradient is clipped; The Adam optimizer is used to update the parameters of each layer of the model that were not dropped by Dropout based on the clipped gradients.

[0017] To address the aforementioned problems, this application provides a traffic flow prediction device, comprising: The construction module is used to construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool. The data augmentation module is used to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool using a pre-trained GANs model, so as to obtain an augmented sample set for training the target traffic flow prediction model. The model training module is used to train the initial traffic flow prediction model based on the enhanced sample set using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. The target traffic flow prediction model includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module. The traffic flow prediction module is used to predict traffic flow from real-time multi-source traffic data using the target traffic flow prediction model deployed on the FPGA accelerator, and obtain the traffic flow prediction result.

[0018] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the traffic flow prediction method described above.

[0019] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the traffic flow prediction method described above.

[0020] The beneficial effects of this application are as follows: By combining Dropout technology, FPGA, and GANs, this application effectively addresses the limitations of existing urban traffic flow prediction technologies, achieving real-time and accurate prediction. It also offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0021] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0022] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a traffic flow prediction method provided in an embodiment of this application is shown. Figure 2 A flowchart illustrating a traffic flow prediction method according to another embodiment of this application is shown; Figure 3A structural block diagram of a traffic flow prediction device according to another embodiment of this application is shown. Detailed Implementation

[0023] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0024] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0025] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0026] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0027] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0028] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0029] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0030] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0031] This application provides a traffic flow prediction method, such as... Figure 1 As shown, it includes: Step S101: Construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool; In the specific implementation process, historical traffic data from different data source types collected by different acquisition devices are acquired; the historical traffic data is aligned in time and space using the NTP network time protocol and a GIS geographic information system, respectively, to obtain the multi-source traffic data pool; the historical traffic data in the multi-source traffic data pool is cleaned to obtain first traffic data, and the data cleaning methods include deleting duplicate data, correcting erroneous data, and integrating inconsistent data; the first traffic data is processed for missing values ​​to obtain second traffic data, and the missing value processing methods include deletion, interpolation, and data filling; the missing value processing of the second traffic data includes data standardization and normalization to obtain third traffic data; the third traffic data is classified and coded to obtain the target multi-source traffic data pool.

[0032] Step S102: Use a pre-trained GANs model to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool to obtain an augmented sample set for training the target traffic flow prediction model; In the specific implementation process, the missing scenarios of the target multi-source traffic data pool are determined; based on the condition information of the missing scenarios, the target generator of the GANs model is used to generate samples to obtain synthetic traffic data; the synthetic traffic data is labeled to obtain a synthetic sample dataset; and an augmented sample set for training the target traffic flow prediction model is obtained by combining the historical traffic data in the target multi-source traffic data pool and the synthetic sample dataset.

[0033] Step S103: Based on the enhanced sample set, the initial traffic flow prediction model is trained using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions; In the specific implementation process, Step 1: Divide the enhanced sample set into a training sample set and a validation sample set according to an 8:2 ratio; Step 2: Perform forward propagation prediction processing on the training sample set using the initial traffic flow prediction model to obtain the initial prediction result corresponding to the training sample set; Step 3: Update the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction result and the actual traffic flow value corresponding to the training sample set; Step 4: Repeat Steps 2 to 3 until the loss of the updated initial traffic flow prediction model used for three consecutive iterations to predict the validation sample set is less than or equal to a preset threshold, at which point the current initial traffic flow prediction model is determined as the target traffic flow prediction model, which includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module.

[0034] Step S104: Use the target traffic flow prediction model deployed on the FPGA accelerator to predict traffic flow from the real-time collected multi-source traffic data, and obtain the traffic flow prediction result.

[0035] In the specific implementation process, the input layer of the initial traffic flow prediction model is used to preprocess the training sample set to obtain a data tensor; the spatiotemporal convolution module of the initial traffic flow prediction model is used to extract spatial features from the data tensor based on a first dropout rate to obtain spatial features; the temporal modeling module of the initial traffic flow prediction model is used to capture the spatial features temporally based on the first dropout rate to obtain temporal features; and the feature fusion module of the initial traffic flow prediction model is used to fuse the temporal features based on a second dropout rate to obtain the initial prediction result corresponding to the training sample set.

[0036] This application effectively addresses the limitations of existing urban traffic flow prediction technologies by combining Dropout technology, FPGA, and GANs. It achieves real-time and accurate prediction, and offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0037] This application provides a traffic flow prediction method, such as... Figure 2 As shown, it includes: Step S201: Construct a multi-source traffic data pool; In this step, historical traffic data from different data sources collected by various acquisition devices are acquired. These devices include fixed road sensors, traffic monitoring cameras, GPS floating cars, and traffic signal control systems. Data sources from fixed road sensors include vehicle counts, speed, and occupancy. Data sources from traffic monitoring cameras include vehicle type and lane occupancy. Data sources from GPS floating cars include real-time driving trajectories and average vehicle speeds. Data sources from traffic signal control systems include traffic light phases and switching durations. Coverage is ensured for urban arterial roads, secondary roads, and key congested sections. The historical traffic data is aligned in time and space using the NTP (Network Time Protocol) and a GIS (Geographic Information System) to obtain the multi-source traffic data pool. Data acquisition time and space standards are established: the Network Time Protocol (NTP) is used to unify the timestamps of all devices, accurate to the millisecond level, to avoid data misalignment due to time deviations; the GIS matches the data collected by each device with actual road coordinates, clarifying the corresponding road segment and lane number, thus achieving spatial alignment. Deploy real-time data transmission channels: Build a dedicated data transmission network, using edge computing nodes to initially aggregate raw data collected by sensors, cameras, and other devices, and then transmit it to the data center in real time via 5G or fiber optic networks to avoid data transmission delays; simultaneously, enable local caching mechanisms to prevent data loss due to network interruptions. Archive and store historical data: Categorize the collected real-time data by "date-time period-road segment" and store it in a big data warehouse (such as the Hadoop Distributed File System). Regularly perform integrity checks on historical data, deleting invalid and duplicate historical records to ensure that historical data can be used for subsequent model training and trend analysis.

[0038] Step S202: Preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool; In this step, the historical traffic data in the multi-source traffic data pool is cleaned to obtain the first traffic data. The data cleaning method includes deduplication, error correction, and inconsistent data integration. Deduplication involves comparing the device number, timestamp, and vehicle unique identifier (e.g., license plate information) of each data entry. If all three are identical, the data is considered duplicated, the earliest record is retained, and the remaining duplicates are deleted. Error correction involves secondary verification based on vehicle model profile feature databases to correct vehicle model labels for camera recognition errors (e.g., misidentifying a truck as a car). Abnormal sensor values ​​(e.g., negative speed or vehicle counts far exceeding road segment capacity) are replaced or marked as invalid data by referencing adjacent time periods and adjacent device data. Inconsistent data integration involves prioritizing camera data that has undergone multiple verifications when there are discrepancies between sensor and camera data for the same road segment (e.g., sensor counts are more than 5% higher than camera counts). If the discrepancy is too large, weighted correction is performed using historical data from the same period to ensure data consistency. Missing value processing is performed on the first traffic data to obtain the second traffic data. Missing value processing methods include deletion, interpolation, and data imputation. For small amounts of missing values: if the missing value ratio for a certain road segment in a certain time period is less than 5%, records containing missing values ​​are directly deleted to avoid data distortion due to imputation. For large amounts of missing values: if the missing value ratio exceeds 5%, interpolation methods (such as linear interpolation, estimating missing values ​​based on valid data before and after the missing time period) or imputation based on similar road segment data (selecting data from adjacent road segments of the same type and traffic level during the same period as a reference) are used. The missing value processing of the second traffic data includes data standardization and normalization to obtain the third traffic data. Standardization: for continuous data such as vehicle speed and travel time, the Z-score standardization formula is used (converting the data into a distribution with a mean of 0 and a standard deviation of 1) to eliminate differences in data magnitude. The formula is: Standardized data = (Original data - Mean of data for that road segment) / Standard deviation of data for that road segment. Normalization: For data such as vehicle counts and lane occupancy rates, Min-Max normalization is used to scale them to the 0-1 range. The formula is: Normalized data = (Original data - Minimum value of the data) / (Maximum value of the data - Minimum value of the data), ensuring that the data fits the model input range. The third traffic data is then classified and encoded to obtain the target multi-source traffic data pool. One-hot encoding: For traffic light states (red, green, yellow), each state is converted into a binary vector, such as red corresponding to [1,0,0], green corresponding to [0,1,0], and yellow corresponding to [0,0,1], to prevent the model from misclassifying classified data as ordered data. Label encoding: For data with fixed categories such as days of the week (Monday to Sunday) and weather types (sunny, rainy, snowy), each category is mapped to a unique integer (e.g., Monday = 1, Tuesday = 2...Sunday = 7), simplifying the data dimension.

[0039] Step S203: Construct GANs models; In the specific implementation process of this step, Step 1: Initialize the generator and discriminator of the GANs model; adopt a "fully connected layer + deconvolutional layer" structure, with input being a random noise vector (dimension set to 100) and conditional information (such as day of the week, weather, time of day). Three fully connected layers map the input dimension to the target feature dimension, and two deconvolutional layers output synthetic data with the same dimension as real traffic data (such as a tensor with dimensions of "time step × number of road segments × number of features"). The weights are initialized using a He normal distribution. Alternatively, adopt a "convolutional layer + fully connected layer" structure, with input being real traffic data or synthetic data produced by the generator. Combining the same conditional information as the generator, two convolutional layers extract data features, and three fully connected layers output a scalar (representing the probability that the input data is real data). The weights are initialized using a Xavier uniform distribution. Step 2: Based on the historical traffic data as training samples, perform the first training iteration of the discriminator to obtain the first discriminator for the first training cycle; the first iteration can be five times, and each training iteration of the discriminator includes the following steps: Step 1: Randomly sample a batch of real traffic data from the historical data pool (batch size set to 32), and at the same time obtain the condition information of the corresponding batch of data (e.g., if the sampled data is "Monday morning rush hour rainy weather", then the condition information is marked as "Monday + morning rush hour + rainy weather").

[0040] Step 2: Randomly sample a batch of noise vectors from the generator's latent space, input them into the generator, and combine them with the same conditional information to generate a batch of synthetic traffic data.

[0041] Step 3: Input real data and synthetic data into the discriminator respectively. The discriminator outputs the "real probability" of the two types of data. Calculate the discriminator loss (using the WGAN-GP loss function to avoid the instability problem of traditional GAN ​​training). The loss objective is to maximize the difference between the "real data probability" and the "1 - synthetic data probability".

[0042] Step 4: Calculate the gradient of the parameters of each layer of the discriminator through backpropagation, update the discriminator weights using the Adam optimizer (learning rate set to 0.0001), complete one discriminator training, and repeat this process 5 times to enhance the discriminator's discrimination ability.

[0043] Step 3: Based on the historical traffic data as training samples, the generator is trained a second time using the first discriminator to obtain the generator for the first training cycle; the process of training the generator includes the following steps: Step 1: Sample the noise vector again from the latent space, input it into the generator and combine it with the conditional information to generate new synthetic data.

[0044] Step 2: Input the synthetic data into the discriminator that has been trained 5 times, obtain the discriminator's "true probability" of the synthetic data, and calculate the generator loss (WGAN-GP loss function). The loss objective is to minimize "1 - synthetic data probability", that is, to make the synthetic data as close as possible to the real data.

[0045] Step 3: Backpropagation is used to calculate the gradient of the parameters of each layer of the generator, and the generator weights are updated using the Adam optimizer (with the same learning rate as the discriminator) to complete one generator training cycle.

[0046] Step 4: Repeat steps 2 and 3 until the model converges, thus constructing the GANs model. Repeat the alternating process of "5 discriminator training cycles + 1 generator training cycle." After every 10 training cycles, use the FID (Frecheinception Distance) metric to evaluate the similarity between the synthetic data and the real data. A smaller FID value indicates higher quality synthetic data. When the FID value changes by less than 0.05 for three consecutive training cycles, and the synthetic data visually (e.g., traffic trend, time period distribution) matches the real data, the GANs training is considered converged, and the generator parameters are fixed.

[0047] Step S204: Use a pre-trained GANs model to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool to obtain an augmented sample set for training the target traffic flow prediction model; In this step, for specific scenarios missing from the real dataset (such as "evening rush hour around the stadium on holidays" or "congestion on elevated roads during heavy rain"), a corresponding conditional information input generator is set up to generate more than 1,000 synthetic data entries in batches. Pseudo-labels are then added to the synthetic data (e.g., labeling the "traffic level" as "high" based on the "evening rush hour" condition; labeling the "average vehicle speed" as "low" based on "heavy rain"). The synthetic data is then mixed with preprocessed real data to form an enhanced training set.

[0048] Step S205: Divide the augmented sample set into a training sample set and a validation sample set according to an 8:2 ratio; In this step, the enhanced training set is divided into a training subset and a validation subset in an 8:2 ratio. The training subset is further divided into multiple training batches with a batch size of 32. The weights of each layer of the model are initialized (He normal distribution for convolutional layers and Xavier uniform distribution for fully connected layers). The number of training epochs is set to 50, and MSE is used as the loss function and Adam as the optimizer (learning rate 0.001).

[0049] Step S206: For the training sample set, the initial traffic flow prediction model is used to perform forward propagation prediction processing to obtain the initial prediction result corresponding to the training sample set; In this step, the input layer of the initial traffic flow prediction model is used to preprocess the training sample set to obtain a data tensor, ensuring that the dimension matches the model input. The spatiotemporal convolution module of the initial traffic flow prediction model extracts spatial features from the data tensor based on a first dropout rate, obtaining spatial features. The data enters the spatiotemporal convolution module, where the graph convolutional layer extracts spatial features and generates a binary mask matrix with the same dimension as the output features (elements are 0 with a probability of 0.3 and 1 with a probability of 0.7). The mask is applied to the spatial features through element-wise multiplication and then divided by (1-0.3) (Inverted Dropout operation) to obtain the processed spatial features. The temporal modeling module of the initial traffic flow prediction model performs temporal capture on the spatial features based on the first dropout rate, obtaining temporal features. The spatial features are input into the temporal modeling module, where the GRU layer captures temporal dependencies and generates a mask matrix with the same dimension as the output of the GRU hidden layer (dropout rate 0.3). This mask is then multiplied element-wise and divided by (1-0.3) to obtain the temporal features. The feature fusion module of the initial traffic flow prediction model performs feature fusion on the temporal features based on the second dropout rate to obtain the initial prediction result corresponding to the training sample set. The temporal features are input into the feature fusion module, and after the fully connected layer integrates the features, a mask matrix with the same dimension as the output of the fully connected layer (dropout rate 0.2) is generated. After multiplying each element and dividing by (1-0.2), the initial traffic flow prediction result for this batch of data is finally output.

[0050] Step S207: Update the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction results and the actual traffic flow values ​​corresponding to the training sample set; In this step, based on the initial prediction result and the actual traffic value, a loss value is calculated. The MSE loss between the prediction result and the actual traffic value of the batch is calculated (loss = 1 / batch size × Σ(predicted value - actual value)²), and the prediction error of the current batch is evaluated. Based on the loss value, the backpropagation algorithm is used to calculate the gradient of each module parameter with respect to the loss value. Starting from the output layer, the gradient of each module parameter with respect to the loss is calculated, retaining only the gradient of neuron connections with a mask of 1 during forward propagation (the gradient of connections with a mask of 0 is set to 0) to avoid invalid gradients affecting parameter updates. The gradients are pruned; the absolute value of the gradient is limited to no more than 5 to prevent gradient explosion and ensure training stability. The Adam optimizer is used to update the parameters of each layer of the model that were not dropped by Dropout based on the pruned gradients. The Adam optimizer updates the parameters of each layer of the model that were not dropped by Dropout (such as convolutional kernel weights, GRU hidden layer weights, and fully connected layer weights) based on the pruned gradients to minimize the prediction error of the next batch.

[0051] Step S208: Repeat steps S206 to S207 until the loss of the updated initial traffic flow prediction model after three consecutive iterations is less than or equal to a preset threshold, then determine the current initial traffic flow prediction model as the target traffic flow prediction model. In this step, the process of "single-batch forward propagation to backpropagation and parameter update" is repeated. One round of training is completed by traversing all batches of the training subset. After each round of training, the validation subset is input into the model, and the MSE loss and prediction accuracy of the validation subset are calculated. If the MSE loss of the validation subset no longer decreases after three consecutive rounds, or the validation accuracy reaches 90% or higher, the learning rate is adjusted to 1 / 10 of the original (for fine-tuning the parameters), and training continues for five more rounds. If there is still no optimization after adjustment, the model training is considered converged, training is stopped, and the optimal model parameters are saved. The target traffic flow prediction model includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module.

[0052] Step S209: Deploy the target traffic flow prediction model using an FPGA accelerator; In this step, the trained prediction model is quantized (from 32-bit floating-point to 16-bit fixed-point) to reduce computational load and storage requirements. Based on the FPGA hardware architecture (e.g., Xilinx Zynq series), the data interfaces between model layers are adjusted to ensure data transmission within the FPGA is adapted to the hardware bandwidth. For the spatiotemporal convolution module, a parallel computing unit is designed to simultaneously process spatial feature extraction from multiple road segments. The FPGA's lookup tables (LUTs) and flip-flops (FFs) are used to implement pipelined convolution operations, reducing computational latency. FPGA hardware logic design: For the GRU network in the temporal modeling module, a dedicated register set is designed to store the GRU hidden states. Parallel adders and multipliers are used to optimize gating computation (reset gate, update gate, candidate hidden states), improving the speed of temporal feature processing. Dropout inference optimization: Because Inverted Dropout is used during training, there is no need to generate a mask matrix during the inference stage; the trained weights are directly loaded for calculation, simplifying the FPGA logic design and further reducing latency. FPGA and Data Center Data Interaction Design: A high-speed data interaction channel is established between the FPGA and the data center, using a PCIe 4.0 interface for real-time data transmission. The data center packages pre-processed real-time traffic data in a fixed format and sends the data to the FPGA once per second (ensuring real-time performance). After processing, the FPGA sends the prediction results back to the data center. Real-time Prediction and Dynamic Resource Adjustment: After receiving real-time data, the FPGA performs inference calculations according to the "spatiotemporal convolution - temporal modeling - feature fusion" process. The processing time for each batch of data is controlled within 100 milliseconds, ensuring 10 prediction results are output per second (covering real-time changes in traffic flow). The FPGA has a built-in resource monitoring module that monitors the current utilization rate of computing resources (such as LUT utilization and DSP utilization) in real time. When the amount of traffic flow data increases (such as doubling the data volume during the morning peak hours), it automatically calls up backup computing units to increase processing capacity; when the amount of data decreases (such as during late-night hours), it shuts down some idle units to reduce power consumption. System integration and application of prediction results: The prediction results output by FPGA are connected to the urban traffic management center system and linked with the signal control system and emergency response system. If it is predicted that a certain road segment will be congested in the next 10 minutes, the signal control system will automatically adjust the green light duration of the traffic lights on that road segment (extend it by 20%), and the emergency response system will push congestion warnings to the navigation APP in advance to guide vehicles to detour.

[0053] Step S210: Use the target traffic flow prediction model to predict traffic flow from the real-time collected multi-source traffic data to obtain the traffic flow prediction result.

[0054] In this step, the spatiotemporal convolution module of the target traffic flow prediction model extracts spatial features from the data tensor based on a first dropout rate to obtain target spatial features; the temporal modeling module of the target traffic flow prediction model captures the target spatial features temporally based on the first dropout rate to obtain target temporal features; and the feature fusion module of the target traffic flow prediction model fuses the target temporal features based on a second dropout rate to obtain the target prediction result for the future preset time period corresponding to the real-time collected multi-source traffic data.

[0055] This application effectively addresses the limitations of existing urban traffic flow prediction technologies by combining Dropout technology, FPGA, and GANs. It achieves real-time and accurate prediction, and offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0056] Another embodiment of this application provides a traffic flow prediction device, such as... Figure 3 As shown, it includes: Module 1 is used to construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain a target multi-source traffic data pool. Data augmentation module 2 is used to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool using a pre-trained GANs model to obtain an augmented sample set for training the target traffic flow prediction model; Model training module 3 is used to train the initial traffic flow prediction model based on the enhanced sample set using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. Traffic flow prediction module 4 is used to predict traffic flow from real-time multi-source traffic data using the target traffic flow prediction model, and obtain traffic flow prediction results.

[0057] In the specific implementation process, the construction module 1 is specifically used for: acquiring historical traffic data of different data source types collected by different acquisition devices; using the NTP network time protocol and GIS geographic information system to perform time and spatial alignment of the historical traffic data respectively to obtain the multi-source traffic data pool; cleaning the historical traffic data in the multi-source traffic data pool to obtain first traffic data, the data cleaning method including deleting duplicate data, correcting erroneous data, and integrating inconsistent data; handling missing values ​​in the first traffic data to obtain second traffic data, the missing value handling method including deletion, interpolation, and data filling; the missing value handling process of the second traffic data includes data standardization and normalization to obtain third traffic data; and classifying and encoding the third traffic data to obtain the target multi-source traffic data pool.

[0058] In the specific implementation process, the device also includes a GANs model construction module, specifically used for: Step 1, initializing the generator and discriminator of the GANs model; Step 2, performing a first training iteration on the discriminator based on the historical traffic data as training samples to obtain a first discriminator for the first training cycle; Step 3, performing a second training iteration on the generator using the first discriminator based on the historical traffic data as training samples to obtain a generator for the first training cycle; Step 4, repeating steps 2 and 3 until the model converges, thus constructing the GANs model.

[0059] In the specific implementation process, the data augmentation module 2 is specifically used to: determine the missing scenarios of the target multi-source traffic data pool; generate samples using the target generator of the GANs model according to the condition information of the missing scenarios to obtain synthetic traffic data; label the synthetic traffic data to obtain a synthetic sample dataset; and combine the historical traffic data in the target multi-source traffic data pool and the synthetic sample dataset to obtain an augmented sample set for training the target traffic flow prediction model.

[0060] In the specific implementation process, the model training module 3 is specifically used for: Step 1, dividing the augmented sample set into a sample set at an 8:2 ratio to obtain a training sample set and a validation sample set; Step 2, performing forward propagation prediction processing on the training sample set using the initial traffic flow prediction model to obtain an initial prediction result corresponding to the training sample set; Step 3, updating the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction result and the actual traffic flow value corresponding to the training sample set; Step 4, repeating steps 2 to 3 until the loss of the updated initial traffic flow prediction model used for three consecutive iterations to predict the validation sample set is less than or equal to a preset threshold, at which point the current initial traffic flow prediction model is determined as the target traffic flow prediction model.

[0061] In the specific implementation process, the model training module 3 is further used to: preprocess the training sample set using the input layer of the initial traffic flow prediction model to obtain a data tensor; extract spatial features from the data tensor using the spatiotemporal convolution module of the initial traffic flow prediction model based on a first dropout rate to obtain spatial features; capture the spatial features temporally using the temporal modeling module of the initial traffic flow prediction model based on the first dropout rate to obtain temporal features; and fuse the temporal features using the feature fusion module of the initial traffic flow prediction model based on a second dropout rate to obtain an initial prediction result corresponding to the training sample set.

[0062] In the specific implementation process, the model training module 3 is also used to: perform calculation processing based on the initial prediction result and the actual traffic value to obtain the loss value; calculate the gradient of each module parameter with respect to the loss value using the backpropagation algorithm according to the loss value; prune the gradient; and use the Adam optimizer to update the parameters of each layer of the model that were not dropped by Dropout according to the pruned gradient.

[0063] This application effectively addresses the limitations of existing urban traffic flow prediction technologies by combining Dropout technology, FPGA, and GANs. It achieves real-time and accurate prediction, and offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0064] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps: Step 1: Construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool. Step 2: Use a pre-trained GANs model to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool to obtain an augmented sample set for training the target traffic flow prediction model; Step 3: Based on the enhanced sample set, the initial traffic flow prediction model is trained using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. Step 4: Use the target traffic flow prediction model to predict traffic flow from the real-time collected multi-source traffic data to obtain the traffic flow prediction results.

[0065] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0066] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0067] The specific implementation process of the above method steps can be found in the embodiments of any of the above traffic flow prediction methods, and will not be repeated here.

[0068] This application effectively addresses the limitations of existing urban traffic flow prediction technologies by combining Dropout technology, FPGA, and GANs. It achieves real-time and accurate prediction, and offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0069] Another embodiment of this application provides an electronic device, which can be a server. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the program is executed by the processor, it implements the functions or steps of a traffic flow prediction method on the server side.

[0070] In one embodiment, an electronic device is provided, which can be a client. The electronic device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When the program of the electronic device is executed by the processor, it implements the functions or steps of a traffic flow prediction method on the client side.

[0071] Another embodiment of this application provides an electronic device, including at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, performs the following method steps: Step 1: Construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool. Step 2: Use a pre-trained GANs model to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool to obtain an augmented sample set for training the target traffic flow prediction model; Step 3: Based on the enhanced sample set, the initial traffic flow prediction model is trained using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. Step 4: Use the target traffic flow prediction model to predict traffic flow from the real-time collected multi-source traffic data to obtain the traffic flow prediction results.

[0072] The specific implementation process of the above method steps can be found in the embodiments of any of the above traffic flow prediction methods, and will not be repeated here.

[0073] This application effectively addresses the limitations of existing urban traffic flow prediction technologies by combining Dropout technology, FPGA, and GANs. It achieves real-time and accurate prediction, and offers significant advantages such as reduced computational costs, enhanced robustness, promotion of smart city development, and wide applicability. It possesses high practical value and socio-economic benefits, contributing to solving urban traffic problems, improving traffic efficiency, and promoting the development of smart cities.

[0074] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. A traffic flow prediction method, characterized in that, include: A multi-source traffic data pool is constructed, and the historical traffic data in the multi-source traffic data pool is preprocessed to obtain the target multi-source traffic data pool. The historical traffic data in the target multi-source traffic data pool is augmented using a pre-trained GAN model to obtain an augmented sample set for training the target traffic flow prediction model. Based on the enhanced sample set, the initial traffic flow prediction model is trained using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. The target traffic flow prediction model includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module. The target traffic flow prediction model deployed on an FPGA accelerator is used to predict traffic flow from real-time multi-source traffic data, and the traffic flow prediction results are obtained.

2. The method as described in claim 1, characterized in that, The construction of a multi-source traffic data pool and the preprocessing of historical traffic data in the multi-source traffic data pool to obtain a target multi-source traffic data pool specifically include: Acquire historical traffic data from different data sources collected by different acquisition devices; The historical traffic data is collected and aligned in time and space using the NTP network time protocol and GIS geographic information system, respectively, to obtain the multi-source traffic data pool. The historical traffic data in the multi-source traffic data pool is cleaned to obtain the first traffic data. The data cleaning method includes deleting duplicate data, correcting erroneous data, and integrating inconsistent data. The first traffic data is processed to obtain the second traffic data. The missing value processing methods include deletion, interpolation and data filling. The second traffic data is then subjected to data standardization and normalization to obtain the third traffic data; The third traffic data is classified and coded to obtain the target multi-source traffic data pool.

3. The method as described in claim 1, characterized in that, Before performing data augmentation processing on the historical traffic data in the target multi-source traffic data pool using a pre-trained GANs model, the method further includes: constructing a GANs model; The construction of GANs models specifically includes: Step 1: Initialize the generator and discriminator of the GANs model; Step 2: Based on the historical traffic data as training samples, perform the first training on the discriminator to obtain the first discriminator for the first training cycle; Step 3: Based on the historical traffic data as training samples, the generator is trained a second time using the first discriminator to obtain the generator for the first training cycle. Step 4: Repeat steps 2 and 3 until the model converges, thus constructing the GANs model.

4. The method as described in claim 1, characterized in that, The process involves using a pre-trained GAN model to perform data augmentation on historical traffic data in the target multi-source traffic data pool, resulting in an augmented sample set for training the target traffic flow prediction model. Specifically, this includes: Identify the missing scenarios in the target multi-source traffic data pool; Based on the conditional information of the missing scenario, the target generator of the GANs model is used to generate samples to obtain synthetic traffic data; The synthetic traffic data is labeled to obtain a synthetic sample dataset; An enhanced sample set for training the target traffic flow prediction model is obtained by combining the historical traffic data in the target multi-source traffic data pool with the synthetic sample dataset.

5. The method as described in claim 1, characterized in that, The step of training the initial traffic flow prediction model using the Dropout method based on the enhanced sample set to obtain the target traffic flow prediction model that meets preset conditions specifically includes: Step 1: Divide the augmented sample set into two parts at an 8:2 ratio to obtain a training sample set and a validation sample set; Step 2: Apply the initial traffic flow prediction model to the training sample set to perform forward propagation prediction processing, and obtain the initial prediction results corresponding to the training sample set. Step 3: Update the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction results and the actual traffic flow values ​​corresponding to the training sample set; Step 4: Repeat steps 2 to 3 until the loss of the initial traffic flow prediction model updated after three consecutive iterations is less than or equal to a preset threshold when predicting the validation sample set, then determine the current initial traffic flow prediction model as the target traffic flow prediction model.

6. The method as described in claim 5, characterized in that, The step of performing forward propagation prediction processing on the training sample set using the initial traffic flow prediction model to obtain the initial prediction result corresponding to the training sample set specifically includes: The training sample set is preprocessed using the input layer of the initial traffic flow prediction model to obtain a data tensor; The spatiotemporal convolutional module of the initial traffic flow prediction model extracts spatial features from the data tensor based on a first dropout rate to obtain spatial features. The temporal modeling module of the initial traffic flow prediction model captures the spatial features temporally based on the first discard rate to obtain temporal features; The feature fusion module of the initial traffic flow prediction model performs feature fusion on the time-series features based on the second dropout rate to obtain the initial prediction result corresponding to the training sample set.

7. The method as described in claim 5, characterized in that, The step of updating the model parameters of the initial traffic flow prediction model using the backpropagation algorithm based on the initial prediction results and the actual traffic flow values ​​corresponding to the training sample set specifically includes: The loss value is obtained by calculating and processing the initial prediction result and the actual flow value. Based on the loss value, the gradient of each module parameter with respect to the loss value is calculated using the backpropagation algorithm. The gradient is clipped; The Adam optimizer is used to update the parameters of each layer of the model that were not dropped by Dropout based on the clipped gradients.

8. A traffic flow prediction device, characterized in that, include: The construction module is used to construct a multi-source traffic data pool and preprocess the historical traffic data in the multi-source traffic data pool to obtain the target multi-source traffic data pool. The data augmentation module is used to perform data augmentation processing on the historical traffic data in the target multi-source traffic data pool using a pre-trained GANs model, so as to obtain an augmented sample set for training the target traffic flow prediction model. The model training module is used to train the initial traffic flow prediction model based on the enhanced sample set using the Dropout method to obtain the target traffic flow prediction model that meets the preset conditions. The target traffic flow prediction model includes an input layer, a spatiotemporal convolution module, a temporal modeling module, a feature fusion module, and an output module. The traffic flow prediction module is used to predict traffic flow from real-time multi-source traffic data using the target traffic flow prediction model deployed on the FPGA accelerator, and obtain the traffic flow prediction result.

9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the traffic flow prediction method according to any one of claims 1-7.

10. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the traffic flow prediction method according to any one of claims 1-7.

Citation Information

Cited By

  • Traffic jam prediction control method based on quality perception and multi-source data fusion

    CN122050157A

  • Traffic congestion prediction control method based on quality perception and multi-source data fusion

    CN122050157B

  • A regional signal macro-micro integrated simulation control method and system based on adversarial enhanced reinforcement learning

    CN122392335A