A method and system for predicting traffic flow of a highway section
By combining a multi-source sparse sensing traffic flow intelligent analysis platform with models, the problem of incomplete traffic data under sparse equipment is solved, enabling efficient traffic feature extraction and parameter optimization, and improving the accuracy of traffic flow prediction and management efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW COMM INVESTMENT (CHENGDU) BIG DATA CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies struggle to collect high-density traffic data for target road areas in sparse image acquisition scenarios, resulting in incomplete traffic feature data that fails to accurately reflect the traffic status relationship between the target area and surrounding road segments. Furthermore, the low efficiency of parameter optimization iteration affects the accuracy of traffic flow prediction.
A multi-source sparse perception traffic flow intelligent analysis platform is adopted, which combines a decoupled graph-enhanced sparse convolutional attention model, a traffic pattern matching dynamic memory network model, and a LightGBM-guided BO-optimized spatiotemporal prediction algorithm. By fusing sparse image data with basic parameters and extracting features, the platform achieves efficient fusion of spatiotemporal features and optimization of hyperparameters, ultimately generating accurate traffic flow prediction results.
It significantly improves the accuracy of traffic feature data in reflecting the traffic status of the target area and surrounding road sections, increases the efficiency of parameter optimization and iteration, enhances the accuracy of future traffic flow prediction for specific areas of roads, meets the needs of accurate prediction in sparse equipment scenarios, and improves the application efficiency of traffic management.
Smart Images

Figure CN121904995B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic flow prediction technology, and in particular to a method and system for predicting traffic flow at highway cross-sections. Background Technology
[0002] In the current field of road traffic management, due to constraints such as equipment deployment costs and roadside topography, the distribution of image acquisition devices used to obtain traffic information in road networks is generally sparse, making it difficult to achieve full-time, high-density traffic data collection coverage of target road areas. To effectively predict future traffic flow trends in specific road areas and provide reliable data for traffic management and resource allocation decisions, a specialized multi-source perception and analysis system is needed. This system should integrate image information collected by sparse image acquisition devices with basic traffic data such as past traffic flow, vehicle speed, vehicle type ratio, and distance between surrounding road segments in the target area. A complete technical process should be constructed, from data collection and integration, traffic feature extraction, spatiotemporal correlation information fusion, to parameter adjustment and optimization, and prediction result screening. This will solve the problem of incomplete traffic data in sparsely acquired scenarios, meet the practical needs for accurate prediction of future traffic flow in specific road areas, and improve the application effectiveness of prediction results in traffic management practice.
[0003] Existing technologies for predicting traffic flow in specific areas of future roads have two significant drawbacks: First, they are weak in processing sparse image information and multi-source basic traffic data, failing to construct a traffic feature extraction and enhancement mechanism that matches the characteristics of the road network structure. This prevents the full exploitation of spatial correlation information between road areas contained in sparse data, resulting in traffic feature data that fails to accurately reflect the traffic status correlation between the target area and surrounding road segments, negatively impacting the effectiveness of subsequent spatiotemporal correlation information fusion. Second, they lack synergy between parameter optimization and the application of historical traffic patterns. They lack a scientific method for determining the parameter optimization range based on the importance of key influencing factors of traffic features, and in the process of matching current traffic conditions with historical traffic patterns, they fail to effectively connect dynamic information updates with accurate similarity calculations. This results in low efficiency in parameter optimization iterations, making it difficult to fully leverage the supporting role of historical traffic patterns in predicting future traffic flow, thus affecting the accuracy of the final prediction results. Summary of the Invention
[0004] In order to overcome the shortcomings and deficiencies of existing technologies, this invention provides a method and system for predicting traffic flow at highway cross-sections.
[0005] The technical solution adopted in this invention is a method for predicting traffic flow at highway cross-sections, comprising:
[0006] Step S1: Collect sparse image data and basic traffic flow parameters of the target section and related road sections of the highway through the multi-source sparse perception traffic flow intelligent analysis platform. The basic traffic flow parameters include the traffic volume of the section, vehicle speed, vehicle type ratio, and distance between adjacent sections.
[0007] Step S2: Input the sparse image data and traffic flow basic parameters collected in step S1 into the decoupled graph-enhanced sparse convolutional attention model to construct the highway network topology map, extract and enhance the spatial features of the sparse data, and generate a traffic flow feature matrix with enhanced spatial dimensions.
[0008] Step S3: Input the traffic flow feature matrix with enhanced spatial dimension output in step S2 into the traffic pattern matching dynamic memory network model, call the historical traffic pattern database built into the model, and perform similarity matching and feature fusion between the input feature matrix and historical traffic patterns through the dynamic memory unit to output the spatiotemporal fusion feature vector.
[0009] Step S4: Input the spatiotemporal fusion feature vector output in step S3 into the LightGBM-guided BO-optimized spatiotemporal prediction algorithm. Use the LightGBM model to rank the importance of the calibrated influencing factors in the feature vector and determine the initial search space and hyperparameter range of the BO-optimized spatiotemporal prediction algorithm.
[0010] Step S5: Based on the initial search space and hyperparameter range determined in step S4, the hyperparameter combination is iteratively updated using the BO optimization spatiotemporal prediction algorithm. The updated hyperparameters are then input into the prediction model for training to generate multiple sets of candidate prediction results.
[0011] Step S6: Select the optimal prediction result from the multiple candidate prediction results generated in step S5, and use it as the traffic flow prediction result for the target section of the highway.
[0012] Furthermore, the expression for the decoupled graph-enhanced sparse convolutional attention model is: ,in, This represents the traffic flow feature matrix after spatial dimension enhancement. This represents the Sigmoid activation function. Indicates the number of target sections of the highway. Indicates the number of associated road segments. Indicates the first The target section and the first Spatial attention weights for each associated road segment This represents the weight matrix of the feature mapping of the road network topology. Indicates based on the first Traffic flow data at each cross section With the Road network adjacency matrix of each road segment The graph convolution operation function, Represents the sparse data augmentation coefficient. This represents the weight matrix for sparse convolution feature extraction. Indicates based on the first Traffic flow data at each cross section With convolution kernel The sparse convolution operation function.
[0013] Furthermore, the expression for the traffic pattern matching dynamic memory network model is: ,in, Represents the spatiotemporal fusion feature vector. This represents the hyperbolic tangent activation function. Represents the memory fusion weight matrix. Indicates the dynamic memory unit at time... The memory state matrix, This represents element-wise multiplication. Traffic flow feature matrix with enhanced spatial dimensions Historical traffic pattern feature matrix The similarity calculation function, This represents the memory fusion bias vector.
[0014] Furthermore, the expression for the LightGBM-guided BO-optimized spatiotemporal prediction algorithm is as follows: ,in, This represents the optimal combination of hyperparameters. This indicates finding the parameter corresponding to the minimum value. Let represent the hyperparameter search space determined by the LightGBM model, and let Loss represent the prediction loss function. Indicated based on hyperparameters Traffic flow forecast, This represents the actual traffic flow value; and the hyperparameter search space. satisfy:
[0015] ,
[0016] in, Indicates the first One hyperparameter, , They represent the first The minimum and maximum values of each hyperparameter. The number of hyperparameters is determined by the importance ranking of traffic flow characteristic factors in the LightGBM model.
[0017] Furthermore, the data fusion expression of the multi-source sparse sensing traffic flow intelligent analysis platform is as follows: ,in, This represents the fused multi-source data matrix. , , Representing sparse image data respectively Traffic flow data Vehicle speed data The fusion weights, and satisfying , , , .
[0018] Furthermore, the final prediction expression for highway cross-sectional traffic flow forecasting is: ,in, This indicates the predicted traffic flow at the target section of the highway. This represents the final predicted weight matrix. Represents the spatiotemporal fusion feature vector. This represents the optimal combination of hyperparameters. This represents element-wise multiplication. This represents the final prediction bias term.
[0019] Further, step S3 includes the following sub-steps: S31, calling the historical traffic pattern database built into the traffic pattern matching dynamic memory network model, which stores the historical traffic flow feature matrices and corresponding traffic pattern labels of each section of the highway under different date types, time periods, and weather conditions; S32, performing feature standardization processing on the traffic flow feature matrix with enhanced spatial dimension output in step S2 to obtain a standardized feature matrix, wherein the standardization processing is achieved by calculating the difference between the feature values and the mean values of the corresponding features in the historical database; S33, using the cosine similarity calculation method, performing similarity calculation on the standardized feature matrix and the historical traffic pattern feature matrix one by one to obtain multiple similarity values; S34, sorting the similarity values from high to low, selecting the top 5 corresponding historical traffic pattern feature matrices, and performing element-wise weighted summation with the standardized feature matrix to obtain a spatiotemporal fusion feature vector.
[0020] Further, step S4 includes the following sub-steps: S41, inputting the spatiotemporal fusion feature vector output in step S3 into the LightGBM model, which calculates the split gain for each feature dimension in the feature vector by constructing a decision tree ensemble structure; S42, ranking the feature dimensions by importance based on the split gain calculation results, and selecting the top 10 feature dimensions by importance score as calibration influence factors; S43, determining the initial search space of the BO optimized spatiotemporal prediction algorithm based on the value range of the calibration influence factors and historical hyperparameter tuning experience, which includes the value range of hyperparameters such as learning rate, number of iterations, and number of hidden layer nodes; S44, inputting the initial search space and calibration influence factor information into the prior distribution model of the BO optimized spatiotemporal prediction algorithm to complete the initial configuration of the BO optimized spatiotemporal prediction algorithm.
[0021] Further, step S5 includes the following sub-steps: S51, based on the initial search space and prior distribution model, the BO optimization spatiotemporal prediction algorithm uses a Gaussian process model to probabilistically model the prediction performance of hyperparameter combinations, obtaining the mean and variance prediction values of the hyperparameter combinations; S52, using the expected improvement criterion, the improvement value of each candidate hyperparameter combination is calculated based on the mean and variance prediction values, and the hyperparameter combination with the largest improvement value is selected; S53, the selected hyperparameter combination is input into the traffic flow prediction model for training, obtaining the prediction result and loss value corresponding to the hyperparameter combination; S54, the loss value obtained from training is fed back to the Gaussian process model to update the prior distribution of the model, and steps S51-S53 are repeated until the number of iterations reaches a preset threshold, at which point the iteration stops and all hyperparameter combinations and their corresponding loss values are recorded.
[0022] A highway cross-sectional traffic flow prediction system, which is applied to a highway cross-sectional traffic flow prediction method, includes:
[0023] The multi-source sparse data acquisition and transmission unit is used to acquire sparse image data and basic traffic flow parameters of the target section and related road sections of the highway, and transmit the acquired data to the multi-source data preprocessing and fusion unit.
[0024] The multi-source data preprocessing and fusion unit is connected to the multi-source sparse data acquisition and transmission unit. It performs fusion processing on the received data, generates a fused multi-source data matrix, and transmits it to the spatial feature extraction and enhancement unit.
[0025] The spatial feature extraction and enhancement unit is connected to the multi-source data preprocessing and fusion unit. It uses a decoupled graph-enhanced sparse convolutional attention model to extract and enhance spatial features from the fused data, and outputs the traffic flow feature matrix with enhanced spatial dimensions to the spatiotemporal feature fusion unit.
[0026] The spatiotemporal feature fusion unit, connected to the spatial feature extraction and enhancement unit, fuses spatial enhancement features with historical traffic patterns through a traffic pattern matching dynamic memory network model, and outputs the spatiotemporal fusion feature vector to the hyperparameter optimization and prediction unit.
[0027] The hyperparameter optimization and prediction unit is connected to the spatiotemporal feature fusion unit. It uses LightGBM to guide the BO optimization spatiotemporal prediction algorithm to determine the optimal hyperparameter combination and complete the traffic flow prediction. It then outputs the candidate prediction results to the optimal result filtering unit.
[0028] The optimal result screening unit, connected to the hyperparameter optimization and prediction unit, selects the optimal prediction result from the candidate prediction results and uses it as the traffic flow prediction result for the target section of the highway.
[0029] Beneficial Effects: This invention proposes a method and system for predicting traffic flow at highway cross-sections. By adapting the feature extraction and enhancement mechanism to the road network structure, it fully mines the spatial correlation information between road areas, significantly improving the accuracy of traffic feature data in reflecting the correlation between the target area and the traffic status of surrounding road sections. This enhances the effect of the spatiotemporal correlation information fusion process and solves the problem of insufficient feature quality caused by incomplete traffic data in sparse equipment acquisition scenarios. The method determines the parameter optimization range based on the importance of key influencing factors of traffic features, while effectively connecting dynamic information updates with accurate similarity calculations, greatly improving the efficiency of parameter optimization iterations. It fully leverages the supporting role of historical traffic patterns in prediction, further improving the accuracy of future traffic flow prediction results for specific areas of the road. Furthermore, the overall technical process can improve the application efficiency of prediction results in traffic management and scheduling, road resource allocation, and other management decisions, fully meeting the actual needs for accurate traffic flow prediction in sparse equipment scenarios and providing more reliable data support for road traffic management. Attached Figure Description
[0030] Figure 1 This is a flowchart of the method steps of the present invention;
[0031] Figure 2 This is a diagram showing the system unit composition of the present invention. Detailed Implementation
[0032] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] like Figure 1 As shown, a method for predicting traffic flow at a highway cross-section includes:
[0034] Step S1: Collect sparse image data and basic traffic flow parameters of the target section and related road sections of the highway through the multi-source sparse perception traffic flow intelligent analysis platform. The basic traffic flow parameters include the traffic volume of the section, vehicle speed, vehicle type ratio, and distance between adjacent sections.
[0035] Specifically, the implementation process of step S1 is as follows: Data collection is completed through a multi-source sparse sensing traffic flow intelligent analysis platform. This platform integrates various sensing devices such as high-definition cameras, microwave radar, and coil detectors. The high-definition camera's acquisition frame rate is set to 25 frames / second, and the image resolution is 1920×1080 pixels. The deployment spacing is determined to be 1.5-3 kilometers / unit based on the characteristics of the highway section, ensuring coverage of the target section and related road sections within a 5-kilometer radius. The basic traffic flow parameters collected specifically include: traffic flow data of the target section over the past 15, 30, and 60 minutes, with a collection cycle of once every 5 minutes; vehicle speed data is collected according to the classification of small cars, medium cars, and large cars, with speed acquisition accuracy controlled within ±1km / h; the proportion of vehicle types is statistically analyzed using image recognition technology, with an accuracy rate of over 95%; the distance between adjacent sections is measured using GPS positioning, with a measurement error not exceeding 5 meters. This step provides foundational data support for subsequent predictions. By collaboratively collecting and classifying statistical parameters from multiple sources, the comprehensiveness and accuracy of the data are ensured, avoiding weak prediction foundations due to single device failures or data gaps. At the same time, clear data collection standards and accuracy requirements ensure consistency and comparability of data collected at different times and on different road sections, laying a reliable data foundation for subsequent model processing.
[0036] Step S2: Input the sparse image data and traffic flow basic parameters collected in step S1 into the decoupled graph-enhanced sparse convolutional attention model to construct the highway network topology map, extract and enhance the spatial features of the sparse data, and generate a traffic flow feature matrix with enhanced spatial dimensions.
[0037] Specifically, the implementation process of step S2 is as follows: The sparse image data collected in step S1 and the basic traffic flow parameters are input into the decoupled graph-augmented sparse convolutional attention model. First, a highway network topology diagram is constructed. This diagram uses the target section as the core node and the detection points of the associated road segments as child nodes. The connection weights between nodes are determined based on the actual distance between road segments and the traffic flow transmission efficiency. The closer the distance and the higher the traffic flow transmission efficiency, the greater the connection weight. The weight values range from 0.1 to 0.9. The model processes the sparse image data using a regional convolution operation. The convolution window size is set to 3×3 pixels, and the stride is 1. The system extracts features from vehicle target areas in images, assigning different weights to these features using an attention mechanism. Feature weights are set to 0.6-0.8 for densely populated vehicle areas and 0.2-0.4 for sparsely populated areas. For traffic flow parameters, a feature concatenation method is used, transforming parameters such as traffic volume, classification speed, and vehicle type proportions at different time periods into feature vectors. The vector dimension is determined to be 12-18 dimensions depending on the parameter type. These vectors are then fused with the features extracted from the image, ultimately generating a 256×256 spatially enhanced traffic flow feature matrix. This step addresses the problem of unclear spatial features in sparse data by constructing a road network topology and using an attention mechanism to strengthen the feature representation of key areas and important parameters. This enhances the feature matrix's ability to reflect the spatial distribution patterns of traffic, providing high-quality spatial feature data for subsequent spatiotemporal fusion. It avoids spatial feature loss or distortion caused by sparse data, ensuring the accurate understanding of traffic spatial conditions by the prediction model.
[0038] Step S3: Input the traffic flow feature matrix with enhanced spatial dimension output in step S2 into the traffic pattern matching dynamic memory network model, call the historical traffic pattern database built into the model, and perform similarity matching and feature fusion between the input feature matrix and historical traffic patterns through the dynamic memory unit to output the spatiotemporal fusion feature vector.
[0039] Specifically, the implementation process of step S3 is as follows: The traffic flow feature matrix with enhanced spatial dimension output from step S2 is input into the traffic pattern matching dynamic memory network model. The model's built-in historical traffic pattern database includes traffic data from the past three years, categorized and stored by weekdays, weekends, and public holidays. Each category of dates is further divided into time periods: morning peak (7:00-9:00), off-peak (9:00-17:00), evening peak (17:00-19:00), and nighttime (19:00-7:00 the next day). Each time period corresponds to 1000-1500 sets of historical traffic pattern feature matrices. The model calls the data. First, based on the current predicted date type and time period, a subset of historical patterns is selected. Then, a dynamic memory unit calculates the similarity between the input spatial enhanced feature matrix and the historical pattern subset using a cosine similarity algorithm, with the calculation precision retained to four decimal places. The historical pattern feature matrices with a similarity greater than 0.85 are further filtered, selecting the top 20 groups as matching samples. A weighted fusion method is then used to fuse the input feature matrix with the matching samples. The fusion weights are allocated according to the similarity, with higher similarity resulting in greater weights, and the total weights are 1. The final output is a spatiotemporal fusion feature vector with a dimension of 512. This step introduces historical traffic patterns to enhance the spatiotemporal correlation of features. By using a categorized historical database and precise similarity matching, current spatial features are effectively combined with historical spatiotemporal patterns, compensating for the lack of temporal dimension information in single spatial features. Simultaneously, the dynamic memory unit ensures adaptability to traffic patterns across different time periods and date types, improving the feature vector's ability to encompass traffic spatiotemporal changes and providing more comprehensive feature support for subsequent prediction algorithms.
[0040] Step S4: Input the spatiotemporal fusion feature vector output in step S3 into the LightGBM-guided BO-optimized spatiotemporal prediction algorithm. Use the LightGBM model to rank the importance of the calibrated influencing factors in the feature vector and determine the initial search space and hyperparameter range of the BO-optimized spatiotemporal prediction algorithm.
[0041] Specifically, the implementation process of step S4 is as follows: The spatiotemporal fusion feature vector output from step S3 is input into the LightGBM-guided BO optimization spatiotemporal prediction algorithm. First, the LightGBM model evaluates the importance of each dimension of the feature vector. The model sets the number of decision trees to 100-200, the tree depth to 8-12 layers, and the learning rate to 0.05-0.1. The model ranks the feature importance by calculating the information gain of each feature dimension during the decision tree splitting process. The information gain calculation uses the Gini coefficient method, and the top 30% of feature dimensions with the highest importance scores are retained as key influencing factors. Key influencing factors typically include historical traffic flow at the target section, etc. The initial search space for the BO optimization spatiotemporal prediction algorithm is determined based on the actual range of key influencing factors and industry experience in hyperparameter tuning. This search space includes hyperparameters such as learning rate, number of iterations, number of hidden layer nodes, and regularization coefficient. The learning rate ranges from 0.01 to 0.2, the number of iterations is 500-1000, the number of hidden layer nodes is 64-256, and the regularization coefficient is 0.001-0.01. The initial search space and key influencing factor information are then input into the prior distribution model of the BO optimization spatiotemporal prediction algorithm. The prior distribution uses a Gaussian process distribution, and the kernel function is a radial basis function, thus completing the algorithm initialization configuration. This step optimizes the hyperparameter search direction by prioritizing feature importance, avoiding the BO-optimized spatiotemporal prediction algorithm from falling into blind search and reducing unnecessary computation. At the same time, the clear hyperparameter search range and scientific prior distribution settings ensure the rationality of algorithm initialization, improve the efficiency and accuracy of subsequent hyperparameter optimization, lay the foundation for the prediction model to find the optimal parameter combination, and avoid the decline in prediction performance due to improper hyperparameter settings.
[0042] Step S5: Based on the initial search space and hyperparameter range determined in step S4, the hyperparameter combination is iteratively updated using the BO optimization spatiotemporal prediction algorithm. The updated hyperparameters are then input into the prediction model for training to generate multiple sets of candidate prediction results.
[0043] Specifically, the implementation process of step S5 is as follows: Based on the initial search space and hyperparameter range determined in step S4, the BO optimization spatiotemporal prediction algorithm begins iteratively updating the hyperparameter combinations. In the initial stage of iteration, 50 sets of hyperparameter combinations are randomly generated as initial samples. Each set of samples includes the specific values of all hyperparameters, such as the learning rate and the number of iterations. Each set of initial samples is input into the traffic flow prediction model for training. The training process uses cross-validation, dividing the dataset into a training set and a validation set in a 7:3 ratio. The number of training rounds is consistent with the number of iterations in the hyperparameters. After each training round, the prediction loss value of the validation set is calculated. The loss value uses the mean squared error index and retains a decimal. The training loss value is fed back to the Gaussian process model of the BO-optimized spatiotemporal prediction algorithm. The model updates the probability distribution of hyperparameter combinations based on the loss value, recalculates the expected improvement value of each hyperparameter combination, and selects the 20 hyperparameter combinations with the largest expected improvement value as the samples for the next iteration. The above training, feedback, and sampling process is repeated, with the number of iterations set to 30-50. After each iteration, the loss value of the hyperparameter combination must decrease by at least 0.001 compared to the previous round; otherwise, the search space range is adjusted. After the iteration, 1000-1500 sets of candidate prediction results are generated, each set including the corresponding hyperparameter combination and the corresponding prediction loss value. This step finds the optimal hyperparameter combination through iterative optimization. With the help of the probabilistic modeling and expected improvement criterion of the BO algorithm, the hyperparameter space is searched efficiently, avoiding the inefficiency of traditional grid search or random search. At the same time, the cross-validation and loss value feedback mechanism ensure the generalization ability of the hyperparameter combination. The setting of the number of iterations and the loss value reduction threshold ensures the convergence of the optimization process. The multiple sets of candidate prediction results generated provide sufficient samples for subsequent optimal result selection, improving the reliability of the final prediction result.
[0044] Step S6: Select the optimal prediction result from the multiple candidate prediction results generated in step S5, and use it as the traffic flow prediction result for the target section of the highway.
[0045] Specifically, the implementation process of step S6 is as follows: From the multiple candidate prediction results generated in step S5, the optimal prediction result is selected. First, all candidate results are sorted by prediction loss value from smallest to largest, excluding abnormal results with a loss value greater than 0.1. A consistency check is performed on the sorted candidate results. The standard deviation of the predicted values of the first 50 results is calculated. Results with a standard deviation less than 5 are considered consistent. If the standard deviation is greater than 5, the selection range is expanded to the first 100 groups, and the calculation is repeated until the standard deviation is acceptable. After consistency is acceptable, the prediction result with the smallest loss value and a predicted value within ±3% of the average of the first 50 results is selected as the optimal result. If multiple results meet the conditions, the variance of the predicted values of these results is calculated, and the result with the smallest variance is selected. Finally, the traffic flow prediction value corresponding to the optimal result is output at 15-minute intervals to generate traffic flow prediction data for the target section of the highway within the next 2-4 hours. The prediction data retains integer values, and the corresponding hyperparameter combinations and loss values are recorded for subsequent model optimization reference. This step ensures the accuracy and stability of the prediction results through multiple rounds of screening. Loss value sorting and outlier exclusion avoid interference from inferior results. Consistency checks guarantee the reliability of the results. Average and variance screening further enhances the representativeness of the optimal results. The final output time-sharing prediction data meets the actual needs of traffic management for the prediction period. At the same time, the recorded hyperparameters and loss values provide data support for model iteration and optimization, forming a closed-loop improvement mechanism for the prediction process and continuously improving prediction performance.
[0046] Preferably, the expression for the decoupled graph-enhanced sparse convolutional attention model is: ,in, This represents the traffic flow feature matrix after spatial dimension enhancement. This represents the Sigmoid activation function. Indicates the number of target sections of the highway. Indicates the number of associated road segments. Indicates the first The target section and the first Spatial attention weights for each associated road segment This represents the weight matrix of the feature mapping of the road network topology. Indicates based on the first Traffic flow data at each cross section With the Road network adjacency matrix of each road segment The graph convolution operation function, Represents the sparse data augmentation coefficient. This represents the weight matrix for sparse convolution feature extraction. Indicates based on the first Traffic flow data at each cross section With convolution kernel The sparse convolution operation function.
[0047] Specifically, when processing data, the decoupled graph-enhanced sparse convolutional attention model first determines the number of target cross-sections and associated road segments on the highway. The number of target cross-sections is determined to be 5-10 based on the road network planning of the predicted area, and the number of associated road segments is defined as 8-15 within a 5-kilometer radius of the target cross-sections. The spatial attention weights are calculated based on the actual traffic flow transmission intensity and distance relationship of the road segments. The weights for adjacent cross-sections and target cross-sections are set to 0.6-0.8, and the weights for non-adjacent associated road segments are set to 0.1-0.3. The dimension of the road network topology feature mapping weight matrix is determined according to the number of cross-sections and road segments as (10×). 15) Matrix elements are calculated through historical traffic flow correlation analysis; higher correlation results in larger element values, ranging from 0.2 to 0.9. The sparse data augmentation coefficient is adjusted based on the deployment density of sparse image devices; the coefficient is set to 0.7-0.9 when the device spacing is 1.5-2 km, and 0.5-0.7 when the spacing is 2-3 km. The convolution kernel size for sparse convolution operations is set to 3×3, with a stride of 1. The kernel parameters are determined through iterative optimization using training data, with 300-500 iterations. After each iteration, the feature extraction accuracy is calculated, and iteration stops when the accuracy reaches 92% or higher. Through multi-dimensional parameter control, the model's ability to extract spatial features from sparse data is enhanced, addressing the problem of incomplete spatial information in sparse data. Dynamic adjustment of the weight matrix and augmentation coefficients ensures the model adapts to different road network density scenarios, improving the accuracy of the feature matrix after spatial dimension augmentation. This provides high-quality spatial feature support for subsequent spatiotemporal fusion, avoiding prediction errors caused by insufficient spatial feature extraction.
[0048] Preferably, the expression for the traffic pattern matching dynamic memory network model is: ,in, Represents the spatiotemporal fusion feature vector. This represents the hyperbolic tangent activation function. Represents the memory fusion weight matrix. Indicates the dynamic memory unit at time... The memory state matrix, This represents element-wise multiplication. Traffic flow feature matrix with enhanced spatial dimensions Historical traffic pattern feature matrix The similarity calculation function, This represents the memory fusion bias vector.
[0049] Specifically, the update frequency of the dynamic memory units in the traffic pattern matching dynamic memory network model is consistent with the data acquisition cycle, set to update once every 5 minutes. The dimension of the memory state matrix is determined based on the number of historical traffic pattern features, which is (512×1000). The matrix elements store the feature intensity values under different historical patterns, with values ranging from 0.1 to 0.9. For similarity calculation, the feature matrix with enhanced spatial dimensions and the historical traffic pattern feature matrix are first standardized, with the standardization range controlled between 0 and 1. After processing, a specific algorithm is used to calculate the similarity value between the two, which is retained to four decimal places. The filtering threshold is set to 0.85. Historical patterns below this threshold will be excluded. The dimension of the memory fusion weight matrix is determined based on the dimension of the spatiotemporal fusion feature vector (512×512). The matrix elements are obtained through training with historical matching data. The training process uses cross-validation, with a training set to validation set ratio of 7:3. The validation set matching accuracy must reach over 90%. The dimension of the memory fusion bias vector is the same as the feature vector, 512-dimensional. The vector elements are determined based on the deviation values of traffic patterns in different time periods: 0.2-0.4 for morning peak hours, 0.1-0.2 for off-peak hours, 0.3-0.5 for evening peak hours, and 0.05-0.1 for nighttime hours. Through dynamic memory units and precise similarity matching, the effective fusion of current features and historical patterns is achieved. The memory state update frequency and time-based bias vector ensure that the model adapts to traffic patterns at different times, improving the ability of the spatiotemporal fusion feature vector to reflect changes in traffic conditions. This provides comprehensive spatiotemporal feature data for subsequent prediction algorithms, avoiding insufficient prediction stability due to a lack of historical information support.
[0050] Preferably, the expression for the LightGBM-guided BO-optimized spatiotemporal prediction algorithm is: ,in, This represents the optimal combination of hyperparameters. This indicates finding the parameter corresponding to the minimum value. Let represent the hyperparameter search space determined by the LightGBM model, and let Loss represent the prediction loss function. Indicated based on hyperparameters Traffic flow forecast, This represents the actual traffic flow value; and the hyperparameter search space. satisfy:
[0051] ,
[0052] in, Indicates the first One hyperparameter, , They represent the first The minimum and maximum values of each hyperparameter. The number of hyperparameters is determined by the importance ranking of traffic flow characteristic factors in the LightGBM model.
[0053] Specifically, the LightGBM-guided BO optimization spatiotemporal prediction algorithm uses the following method during training: The number of decision trees is determined by the feature vector dimension: 100-200 trees; 100-150 trees for 12-18 dimension features; and 150-200 trees for 18-25 dimension features. The tree depth is controlled at 8-12 layers, with the number of layers adjusted based on feature importance and discriminative power: 8-10 layers for high discriminative power and 10-12 layers for low discriminative power. The learning rate is adjusted based on the amount of training data: 0.05-0.08 for 5000-10000 data points and 0.08-0.1 for 10000-20000 data points. The feature importance ranking is calculated using multiple... The test rounds determined the effectiveness of different methods in feature discrimination, ultimately selecting the method with the highest discrimination. The top 30% of features were retained as key influencing factors, with the number of key influencing factors controlled between 5 and 8. In the initial search space of the BO-optimized spatiotemporal prediction algorithm, the range of hyperparameter values was determined based on the fluctuation range of the key influencing factors. The learning rate range corresponded to ±20% of the factor fluctuation. The number of iterations was set according to the model's training convergence speed: 500-700 iterations for fast convergence and 700-1000 iterations for slow convergence. The kernel function parameters of the prior distribution model were determined through training with historical hyperparameter optimization data, with 200-300 training iterations. After each iteration, the probability distribution fit was calculated, and training stopped when the fit reached 95% or higher. The LightGBM model accurately screened key features, clarifying the search direction for the BO-optimized spatiotemporal prediction algorithm. The scientific setting of the hyperparameter range and prior distribution reduced ineffective searches, improved algorithm optimization efficiency, and ensured that the optimal hyperparameter combination suitable for the current traffic data was found, avoiding performance degradation caused by blindly setting hyperparameters.
[0054] Preferably, the data fusion expression of the multi-source sparse sensing traffic flow intelligent analysis platform is: ,in, This represents the fused multi-source data matrix. , , Representing sparse image data respectively Traffic flow data Vehicle speed data The fusion weights, and satisfying , , , .
[0055] Specifically, when fusing data, the multi-source sparse sensing traffic flow intelligent analysis platform first determines the fusion weights of each data source. The weight of sparse image data is adjusted according to the image recognition accuracy: 0.4-0.5 for an accuracy of 95%-98%, and 0.3-0.4 for an accuracy of 92%-95%. The weight of traffic flow data is determined based on the accuracy of the acquisition equipment: data acquired by loop detectors has high accuracy and is weighted at 0.3-0.4, while data acquired by microwave radar is weighted at 0.2-0.3. The weight of vehicle speed data is adjusted according to the speed acquisition error. The weighting is set to 0.2-0.3 for ±1km / h and 0.1-0.2 for ±2km / h. The fusion process uses a weighted summation method. Each data source is first converted into a matrix of a unified dimension (20×30), determined by the number of data collection points. Then, element-wise weighted calculations are performed. The fused data matrix undergoes validity verification, with verification indicators including data completeness and consistency. The data missing rate must be less than 5%, and the data deviation for the same collection point from different data sources must be less than 8%. If these requirements are not met, the weights are readjusted and the fusion is repeated until they are satisfied. By dynamically adjusting the fusion weights, the advantages of each data source are fully utilized. Image data weights change with recognition accuracy to ensure effective use of visual information, while traffic flow and speed data weights are adjusted according to equipment accuracy to ensure data reliability. The validity verification process further improves the quality of the fused data, providing complete and consistent multi-source data for subsequent model processing and avoiding feature extraction deviations caused by improper data fusion.
[0056] Preferably, the final prediction expression for highway cross-sectional traffic flow is: ,in, This indicates the predicted traffic flow at the target section of the highway. This represents the final predicted weight matrix. Represents the spatiotemporal fusion feature vector. This represents the optimal combination of hyperparameters. This represents element-wise multiplication. This represents the final prediction bias term.
[0057] Specifically, in the final prediction stage of the highway cross-section traffic flow prediction model, the dimension of the final prediction weight matrix is determined to be (1×512) based on the dimensions of the spatiotemporal fusion feature vector and the prediction result. The matrix elements are optimized through training with historical prediction data. The training process uses the gradient descent method, with a learning rate set to 0.01-0.05 and 400-600 iterations. After each iteration, the prediction error is calculated using the mean absolute error index, and training stops when the error drops below 8%. The final prediction bias term is adjusted according to the baseline values of traffic flow in different time periods, with the morning peak period set as follows: The traffic flow is set at 50-80 km / h during off-peak hours (30-50 km / h), 60-90 km / h during evening peak hours (60-90 km / h), and 10-30 km / h during nighttime hours. During prediction, the spatiotemporal fusion feature vector and the optimal hyperparameter combination are first performed element-wise. The result is then multiplied with the prediction weight matrix. Finally, a bias term is added to obtain the final predicted value. The predicted value undergoes a reasonableness check, with the check standard being the deviation range between the predicted value and the actual value for the same period in history. The deviation must be controlled within ±10%. If the deviation exceeds this range, the weight matrix and bias term are readjusted, and the predicted value is recalculated until it meets the requirements. By optimizing the prediction weight matrix and the time-specific bias term, the accuracy of the final prediction result is improved. Gradient descent training ensures that the weight matrix adapts to historical data patterns, the time-specific bias term compensates for differences in basic traffic flow at different times, and the reasonableness check further ensures the reliability of the predicted value. This provides accurate traffic flow prediction data for traffic management, avoiding the impact of prediction deviations on traffic decision-making.
[0058] Preferably, step S3 includes the following sub-steps: S31, calling the historical traffic pattern database built into the traffic pattern matching dynamic memory network model, which stores the historical traffic flow feature matrices and corresponding traffic pattern labels of each section of the highway under different date types, time periods, and weather conditions; S32, performing feature standardization processing on the traffic flow feature matrix with enhanced spatial dimension output in step S2 to obtain a standardized feature matrix, wherein the standardization processing is achieved by calculating the difference between the feature values and the mean values of the corresponding features in the historical database; S33, using the cosine similarity calculation method, performing similarity calculation on the standardized feature matrix and the historical traffic pattern feature matrix one by one to obtain multiple similarity values; S34, sorting the similarity values from high to low, selecting the top 5 corresponding historical traffic pattern feature matrices, and performing element-wise weighted summation with the standardized feature matrix to obtain a spatiotemporal fusion feature vector.
[0059] Specifically, step S3 is implemented in the following steps: S31 calls the historical traffic pattern database built into the traffic pattern matching dynamic memory network model. This database stores traffic data from the past 5 years, categorized by date type into three main categories: weekdays, weekends, and statutory holidays. Each date type is further subdivided into six time periods: morning peak (6:30-9:30), morning off-peak (9:30-12:00), midday (12:00-14:30), afternoon off-peak (14:30-17:30), evening peak (17:30-20:30), and nighttime (20:30-6:30 the next day). Each time period stores 2000-3000 sets of historical traffic flow feature matrices and corresponding traffic pattern labels, including classification information such as flow level and congestion status; S32 performs feature standardization processing on the traffic flow feature matrix output from step S2, which has enhanced spatial dimensions. Based on the mean value of features corresponding to the time period and cross section in the historical database, the difference between each element in the current feature matrix and the mean value is calculated to obtain a standardized feature matrix, ensuring that the value range of all elements in the matrix is controlled between -1 and 1. S33 uses the cosine similarity calculation method to calculate the similarity between the standardized feature matrix and the historical traffic pattern feature matrix one by one. When calculating, the cosine value of the angle between vectors is calculated row by row, and four decimal places are retained as the similarity value. S34 sorts the similarity values from high to low, selects the historical traffic pattern feature matrices corresponding to the top 5 similarity values, and allocates fusion weights according to the similarity value ratio. The matrix with the highest similarity has a weight ratio of 40%, the second highest has a weight ratio of 30%, the third has a weight ratio of 15%, the fourth has a weight ratio of 10%, and the fifth has a weight ratio of 5%. The standardized feature matrix and these 5 historical matrices are summed element-wise according to their weights to generate a spatiotemporal fusion feature vector with unified dimensions. By subdividing dates and time periods, performing precise standardization, and weighted fusion, we ensure efficient matching between current features and historical patterns, improve the fit of spatiotemporal fusion feature vectors to traffic patterns, and provide more valuable feature data for subsequent predictions.
[0060] Preferably, step S4 includes the following sub-steps: S41, inputting the spatiotemporal fusion feature vector output in step S3 into the LightGBM model, which calculates the split gain for each feature dimension in the feature vector by constructing a decision tree ensemble structure; S42, ranking the feature dimensions by importance based on the split gain calculation results, and selecting the top 10 feature dimensions by importance score as calibration influence factors; S43, determining the initial search space of the BO optimized spatiotemporal prediction algorithm based on the value range of the calibration influence factors and historical hyperparameter tuning experience, which includes the value range of hyperparameters such as learning rate, number of iterations, and number of hidden layer nodes; S44, inputting the initial search space and calibration influence factor information into the prior distribution model of the BO optimized spatiotemporal prediction algorithm to complete the initial configuration of the BO optimized spatiotemporal prediction algorithm.
[0061] Specifically, step S4 is implemented in the following steps: S41: Input the spatiotemporal fusion feature vector output from step S3 into the LightGBM model. The model constructs a decision tree ensemble structure, with the initial number of decision trees set to 150, the tree depth set to 10 layers, and the learning rate set to 0.07. The gradient boosting decision tree algorithm is used to calculate the split gain for each feature dimension in the feature vector. The split gain calculation uses the mean squared error as the loss function, and the feature dimension with the largest gain is selected as the split node for each split. S42: Based on the split gain calculation results, all feature dimensions are ranked by importance, arranged from largest to smallest gain value. The importance score ratio of each feature dimension is calculated, and the top 10 feature dimensions with a cumulative ratio of 70% are selected as key influencing factors. Key influencing factors typically include the 5-minute interval traffic flow at the target section, the traffic transmission delay between adjacent sections, and vehicle type. The initial search space for the BO optimization spatiotemporal prediction algorithm is determined based on the value range of key influencing factors and the hyperparameter tuning experience of the past three years. The learning rate ranges from 0.02 to 0.15, the number of iterations is 600 to 900, the number of hidden layer nodes is 80 to 220, the regularization coefficient is 0.002 to 0.008, and the interval of each hyperparameter is set according to the parameter sensitivity. The interval is smaller for parameters with high sensitivity and larger for parameters with low sensitivity. The initial search space and key influencing factor information are input into the prior distribution model of the BO optimization spatiotemporal prediction algorithm. The prior distribution adopts a Gaussian process distribution, the kernel function is selected as the squared exponential kernel function, the length scale parameter of the kernel function is set to 0.5-1.2, and the noise variance is set to 0.01-0.03, thus completing the initial configuration of the BO optimization spatiotemporal prediction algorithm. By employing refined feature importance screening and scientific hyperparameter space settings, a foundation for efficient search is laid for the BO-optimized spatiotemporal prediction algorithm, reducing invalid computations and improving the accuracy and efficiency of subsequent hyperparameter optimization.
[0062] Preferably, step S5 includes the following sub-steps: S51. Based on the initial search space and prior distribution model, the BO optimization spatiotemporal prediction algorithm uses a Gaussian process model to probabilistically model the prediction performance of hyperparameter combinations, obtaining the mean and variance prediction values of the hyperparameter combinations; S52. Using the expected improvement criterion, the improvement value of each candidate hyperparameter combination is calculated based on the mean and variance prediction values, and the hyperparameter combination with the largest improvement value is selected; S53. The selected hyperparameter combination is input into the traffic flow prediction model for training, obtaining the prediction result and loss value corresponding to the hyperparameter combination; S54. The loss value obtained from training is fed back to the Gaussian process model to update the prior distribution of the model. Steps S51-S53 are repeated until the number of iterations reaches a preset threshold, at which point the iteration stops and all hyperparameter combinations and their corresponding loss values are recorded.
[0063] Specifically, step S5 is implemented in the following steps: S51 Based on the initial search space and prior distribution model, the BO optimization spatiotemporal prediction algorithm uses a Gaussian process model to probabilistically model the prediction performance of hyperparameter combinations. During modeling, the hyperparameter combination is used as the input variable, and the prediction loss is used as the output variable. The mean prediction value and variance prediction value of each hyperparameter combination are calculated. The mean prediction value reflects the expected performance of the combination, and the variance prediction value reflects the uncertainty of the performance. Both are rounded to six decimal places. S52 Using the expected improvement criterion, the improvement value of each candidate hyperparameter combination is calculated based on the mean prediction value and the variance prediction value. The improvement value calculation formula needs to comprehensively consider the current optimal loss value and the potential performance improvement space of the candidate combination, selecting the top 3 with the largest improvement values. S53 selects a hyperparameter combination as the combination to be validated in this round; S54 inputs the selected hyperparameter combination into the traffic flow prediction model for training. The training dataset is divided into training and validation sets in an 8:2 ratio. The number of training rounds is consistent with the number of iterations in the hyperparameters. After each training round, the mean absolute error of the validation set is calculated as the loss value, and the loss change curve for each training round is recorded; S55 feeds the loss value obtained from the training back to the Gaussian process model to update the model's prior distribution parameters, making the model's prediction of hyperparameter performance more realistic. Steps S51-S55 are repeated, with an iteration threshold of 40 times. If the loss value decreases by less than 0.0001 for 5 consecutive iterations, the iteration is stopped early. Finally, all hyperparameter combinations and their corresponding loss values are recorded. Through probabilistic modeling and iterative feedback mechanisms, efficient optimization of hyperparameters is achieved, ensuring that the optimal hyperparameter combination suitable for the current data is found, providing key parameter support for improving the accuracy of prediction results.
[0064] The decoupled graph-enhanced sparse convolutional attention model is the core model in this invention for processing sparse traffic data and extracting spatial features. It is a technical framework that strengthens key regional features by decoupling road network topology construction and sparse convolution operations, combined with an attention mechanism. The model's implementation process is as follows: First, using the highway target section as the core node and related road segment detection points as child nodes, node connection weights of 0.1-0.9 are set according to road segment distance and traffic flow efficiency to construct a road network topology graph. Next, sparse image data is subjected to regional convolution using a 3×3 pixel convolution window and a 1-pixel stride. An attention mechanism is used to assign a weight of 0.6-0.8 to features in densely trafficked areas and 0.2-0.4 to features in sparse areas. Simultaneously, traffic flow parameters are transformed into 12-18 dimensional feature vectors, which are fused with image features to generate a 256×256 spatial enhancement feature matrix. The model addresses the problem of unclear spatial features in sparse data by mining spatial correlation information in the road network through topology construction and an attention mechanism, thereby strengthening the expression of key features. This provides high-quality spatial feature data for subsequent spatiotemporal fusion, avoids the loss of spatial features due to sparse data, ensures the accurate understanding of traffic spatial status by the prediction model, and lays a reliable spatial feature foundation for the overall prediction process.
[0065] The Traffic Pattern Matching Dynamic Memory Network Model is a key model for fusing current spatial features with historical traffic patterns to generate spatiotemporal fusion features. It's a technical system that relies on dynamic memory units and a historical database to achieve spatiotemporal feature synergy. The model's implementation process is as follows: It has a built-in historical database categorized by weekdays, weekends, and holidays over the past three years, further subdivided into six time periods, each storing 1000-1500 sets of historical feature matrices. When invoked, a subset of historical patterns is first filtered by the current date and time period. The similarity between the current spatial enhancement features and historical patterns is calculated using a cosine similarity algorithm (retaining four decimal places), selecting the top 20 samples with a similarity > 0.85. Then, the dynamic memory unit assigns weights based on similarity (summing up to 1), weighting and fusing the current features with historical samples to output a 512-dimensional spatiotemporal fusion feature vector. The memory unit updates its state every 5 minutes. The model's function is to compensate for the lack of temporal dimension information in single spatial features, integrating historical traffic patterns into the current features. Enhancing the ability of feature vectors to capture the spatiotemporal patterns of traffic changes, and ensuring that the model adapts to traffic patterns at different times and dates through dynamic memory and precise matching, provides comprehensive spatiotemporal feature support for subsequent prediction algorithms and avoids insufficient prediction stability due to a lack of historical information.
[0066] The LightGBM-guided BO optimization spatiotemporal prediction algorithm is an optimization algorithm used to determine the optimal hyperparameters of the prediction model and improve prediction accuracy. It is a collaborative technical solution combining LightGBM feature selection and BO algorithm iterative optimization. The implementation process of this algorithm is as follows: First, the spatiotemporal fusion feature vector is input into the LightGBM model, and 100-200 decision trees, 8-12 tree depths, and a learning rate of 0.05-0.1 are set. The feature splitting gain is calculated using the Gini coefficient method, and the top 30% (5-8) key influencing factors are selected according to their importance. Then, the initial search space of the BO algorithm is determined based on the range of factor values and experience, with a learning rate of 0.01-0.2, 500-1000 iterations, 64-256 hidden layer nodes, and a regularization coefficient of 0.001-0.01. The Gaussian process distribution is used as the prior distribution of the BO algorithm. The algorithm is trained with 50 initial samples, and the loss value is fed back. The iteration is repeated 30-50 times, and the 20 hyperparameters with the largest expected improvement value are selected each time until the loss value decreases to the target. The algorithm optimizes the hyperparameter search direction through feature selection, reduces unnecessary computation, and efficiently finds the optimal hyperparameter combination. It avoids the performance degradation caused by blind searching and improper hyperparameter settings in the BO algorithm, improves the efficiency and accuracy of hyperparameter optimization, provides the optimal parameter configuration for the prediction model, and directly ensures the accuracy of the final prediction results.
[0067] The Multi-Source Sparse Sensing Traffic Flow Intelligent Analysis Platform is a fundamental support platform for collecting and fusing multi-source traffic data. It is a hardware and software integration system that integrates various sensing devices to achieve collaborative data processing. The platform's implementation process involves: integrating high-definition cameras (25 frames / second, 1920×1080 pixels, 1.5-3 km / unit), microwave radar, loop detectors, and other devices to collect sparse image data and traffic flow parameters (traffic flow recorded every 5 minutes, vehicle speed classification with ±1 km / h accuracy, and vehicle type percentage with over 95% accuracy); during fusion, image data weights are set to 0.3-0.5 based on image recognition accuracy (92%-98%), traffic flow data weights are set to 0.2-0.4 based on device accuracy, and vehicle speed data weights are set to 0.1-0.3 (totaling 1); the data sources are converted into a unified dimensional matrix for weighted fusion, and a fused data matrix is generated through data integrity (missing rate <5%) and consistency (deviation <8%) checks. The platform's function is to solve the problem of incomplete data collection under sparse device conditions, integrate multi-source data, and ensure data quality. Providing complete and consistent basic data for subsequent model processing, and fully leveraging the advantages of each data source through dynamic weight adjustment, avoids feature extraction bias caused by improper data fusion. It is the basic data guarantee for the entire prediction process and directly affects the effectiveness of all subsequent technical steps.
[0068] like Figure 2As shown, a highway cross-section traffic flow prediction system is applied to a highway cross-section traffic flow prediction method. The system includes: a multi-source sparse data acquisition and transmission unit, used to acquire sparse image data and basic traffic flow parameters of the highway target cross-section and associated road sections, and transmit the acquired data to a multi-source data preprocessing and fusion unit; a multi-source data preprocessing and fusion unit, connected to the multi-source sparse data acquisition and transmission unit, performs fusion processing on the received data to generate a fused multi-source data matrix, and transmits it to a spatial feature extraction and enhancement unit; a spatial feature extraction and enhancement unit, connected to the multi-source data preprocessing and fusion unit, uses a decoupled graph-enhanced sparse convolutional attention model to extract and enhance spatial features from the fused data. The output spatially enhanced traffic flow feature matrix is sent to the spatiotemporal feature fusion unit. The spatiotemporal feature fusion unit, connected to the spatial feature extraction and enhancement unit, fuses the spatial enhanced features with historical traffic patterns through a traffic pattern matching dynamic memory network model, and outputs the spatiotemporal fusion feature vector to the hyperparameter optimization and prediction unit. The hyperparameter optimization and prediction unit, connected to the spatiotemporal feature fusion unit, uses LightGBM-guided BO optimization spatiotemporal prediction algorithm to determine the optimal hyperparameter combination and complete traffic flow prediction, and outputs candidate prediction results to the optimal result selection unit. The optimal result selection unit, connected to the hyperparameter optimization and prediction unit, selects the optimal prediction result from the candidate prediction results as the traffic flow prediction result for the highway target section.
[0069] A method and system for predicting traffic flow at highway cross-sections is proposed. By constructing a multi-source perception and analysis system, it efficiently integrates sparse image information with basic traffic data such as past traffic flow, vehicle speed, and vehicle type proportion. Then, relying on feature extraction and enhancement mechanisms adapted to the highway network structure, it fully explores the spatial correlation information between the target cross-section and surrounding related road sections. This not only improves the accuracy of traffic feature data in reflecting the correlation of regional traffic conditions, but also effectively compensates for the data incompleteness caused by sparse equipment acquisition, providing high-quality data support for subsequent spatiotemporal fusion, thereby improving the reliability of basic data in the overall prediction process.
[0070] Another core advantage of this method and system is that it overcomes the challenge of insufficient synergy between parameter optimization and the application of historical traffic patterns in existing technologies, significantly improving prediction efficiency and accuracy. Based on the importance of key influencing factors of traffic characteristics, the parameter optimization range is scientifically determined, avoiding blind adjustments. Simultaneously, through the effective integration of dynamic information updates and precise similarity calculations, historical traffic patterns can be more fully utilized in the current prediction process. This improves the iterative efficiency of parameter optimization, reduces invalid calculations, and strengthens the supporting role of historical data in prediction, ultimately significantly improving the accuracy of future road section traffic flow predictions. Furthermore, the overall process enhances the adaptability of prediction results to actual traffic management needs, allowing prediction data to more efficiently serve decisions such as traffic management and resource allocation, further highlighting the value of the technology.
[0071] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," "link," and "fix" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0072] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method of forecasting traffic flow on a highway cross section, characterized by, include: Step S1: Collect sparse image data and basic traffic flow parameters of the target section and related road sections of the highway through the multi-source sparse perception traffic flow intelligent analysis platform. The basic traffic flow parameters include the traffic volume of the section, vehicle speed, vehicle type ratio, and distance between adjacent sections. Step S2: Input the sparse image data and traffic flow basic parameters collected in step S1 into the decoupled graph-enhanced sparse convolutional attention model to construct the highway network topology map, extract and enhance the spatial features of the sparse data, and generate a traffic flow feature matrix with enhanced spatial dimensions. Step S3: Input the traffic flow feature matrix with enhanced spatial dimension output in step S2 into the traffic pattern matching dynamic memory network model, call the historical traffic pattern database built into the model, and perform similarity matching and feature fusion between the input feature matrix and historical traffic patterns through the dynamic memory unit to output the spatiotemporal fusion feature vector. Step S4: Input the spatiotemporal fusion feature vector output in step S3 into the LightGBM-guided BO-optimized spatiotemporal prediction algorithm. Use the LightGBM model to rank the importance of the calibrated influencing factors in the feature vector and determine the initial search space and hyperparameter range of the BO-optimized spatiotemporal prediction algorithm. Step S5: Based on the initial search space and hyperparameter range determined in step S4, the hyperparameter combination is iteratively updated using the BO optimization spatiotemporal prediction algorithm. The updated hyperparameters are then input into the prediction model for training to generate multiple sets of candidate prediction results. Step S6: Select the optimal prediction result from the multiple candidate prediction results generated in Step S5 as the traffic flow prediction result for the highway target section. Specifically: First, sort all candidate prediction results by prediction loss value from smallest to largest; perform a consistency test on the sorted candidate prediction results, calculate the standard deviation of the predicted values of the first N groups of results. If the standard deviation is less than the set value, it is considered to be consistent. If the standard deviation is greater than the set value, expand the selection range to the first 2N groups and recalculate until the standard deviation is less than the set value; select the candidate prediction result with the smallest loss value and the predicted value within the fluctuation range of the average value of the candidate prediction results in the first X groups as the optimal result. If there are multiple results that meet the conditions, calculate the variance of the predicted values of these results and select the result with the smallest variance as the traffic flow prediction data result.
2. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, The expression for the decoupled graph-enhanced sparse convolutional attention model is: ,in, This represents the traffic flow feature matrix after spatial dimension enhancement. This represents the Sigmoid activation function. Indicates the number of target sections of the highway. Indicates the number of associated road segments. Indicates the first The target section and the first Spatial attention weights for each associated road segment This represents the weight matrix of the feature mapping of the road network topology. Indicates based on the first Traffic flow data at each cross section With the Road network adjacency matrix of each road segment The graph convolution operation function, Represents the sparse data augmentation coefficient. This represents the weight matrix for sparse convolution feature extraction. Indicates based on the first Traffic flow data at each cross section With convolution kernel The sparse convolution operation function.
3. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, The expression for the traffic pattern matching dynamic memory network model is: ,in, Represents the spatiotemporal fusion feature vector. This represents the hyperbolic tangent activation function. Represents the memory fusion weight matrix. Indicates the dynamic memory unit at time... The memory state matrix, This represents element-wise multiplication. Traffic flow feature matrix with enhanced spatial dimensions Historical traffic pattern feature matrix The similarity calculation function, This represents the memory fusion bias vector.
4. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, The expression for the LightGBM-guided BO-optimized spatiotemporal prediction algorithm is as follows: ,in, This represents the optimal combination of hyperparameters. This indicates finding the parameter corresponding to the minimum value. Let represent the hyperparameter search space determined by the LightGBM model, and let Loss represent the prediction loss function. Indicated based on hyperparameters Traffic flow forecast, This represents the actual traffic flow value; and the hyperparameter search space. satisfy: , in, Indicates the first One hyperparameter, , They represent the first The minimum and maximum values of each hyperparameter. The number of hyperparameters is determined by the importance ranking of traffic flow characteristic factors in the LightGBM model.
5. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, The data fusion expression of the multi-source sparse sensing traffic flow intelligent analysis platform is: ,in, This represents the fused multi-source data matrix. , , Representing sparse image data respectively Traffic flow data Vehicle speed data The fusion weights, and satisfying , , , .
6. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, The final prediction expression for highway cross-sectional traffic flow forecasting is: ,in, This indicates the predicted traffic flow at the target section of the highway. This represents the final predicted weight matrix. Represents the spatiotemporal fusion feature vector. This represents the optimal combination of hyperparameters. This represents element-wise multiplication. This represents the final prediction bias term.
7. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, Step S3 includes the following sub-steps: S31, calling the historical traffic pattern database built into the traffic pattern matching dynamic memory network model. This database stores the historical traffic flow feature matrices and corresponding traffic pattern labels of each section of the highway under different date types, time periods, and weather conditions; S32, performing feature standardization processing on the traffic flow feature matrix with enhanced spatial dimension output in step S2 to obtain a standardized feature matrix. The standardization processing is achieved by calculating the difference between the feature values and the mean values of the corresponding features in the historical database; S33, using the cosine similarity calculation method, performing similarity calculation on the standardized feature matrix and the historical traffic pattern feature matrix one by one to obtain multiple similarity values; S34, sorting the similarity values from high to low, selecting the top 5 corresponding historical traffic pattern feature matrices, and performing element-wise weighted summation with the standardized feature matrix to obtain a spatiotemporal fusion feature vector.
8. The method for predicting traffic flow at a highway cross-section according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41, input the spatiotemporal fusion feature vector output from step S3 into the LightGBM model, which calculates the split gain for each feature dimension in the feature vector by constructing a decision tree ensemble structure; S42, sort the feature dimensions by importance based on the split gain calculation results, and select the top 10 feature dimensions by importance score as calibration influence factors; S43, based on the value range of the calibration influence factors and historical hyperparameter tuning experience, determine the initial search space of the BO optimized spatiotemporal prediction algorithm, which includes the value range of hyperparameters such as learning rate, number of iterations, and number of hidden layer nodes; S44. Input the initial search space and calibrated influence factor information into the prior distribution model of the BO optimization spatiotemporal prediction algorithm to complete the initial configuration of the BO optimization spatiotemporal prediction algorithm.
9. The method for predicting traffic flow at a highway cross-section according to claim 8, characterized in that, Step S5 includes the following sub-steps: S51. Based on the initial search space and prior distribution model, the BO optimization spatiotemporal prediction algorithm uses a Gaussian process model to probabilistically model the prediction performance of hyperparameter combinations, obtaining the mean and variance prediction values of the hyperparameter combinations; S52. Using the expected improvement criterion, the improvement value of each candidate hyperparameter combination is calculated based on the mean and variance prediction values, and the hyperparameter combination with the largest improvement value is selected; S53. The selected hyperparameter combination is input into the traffic flow prediction model for training, obtaining the prediction result and loss value corresponding to the hyperparameter combination; S54. The loss value obtained from training is fed back to the Gaussian process model to update the prior distribution of the model. Steps S51-S53 are repeated until the number of iterations reaches a preset threshold, at which point the iteration stops and all hyperparameter combinations and their corresponding loss values are recorded.
10. A highway cross-sectional traffic flow prediction system, characterized in that, The highway cross-section traffic flow prediction system is used to implement the highway cross-section traffic flow prediction method according to any one of claims 1 to 9, including: The multi-source sparse data acquisition and transmission unit is used to acquire sparse image data and basic traffic flow parameters of the target section and related road sections of the highway, and transmit the acquired data to the multi-source data preprocessing and fusion unit. The multi-source data preprocessing and fusion unit is connected to the multi-source sparse data acquisition and transmission unit. It performs fusion processing on the received data, generates a fused multi-source data matrix, and transmits it to the spatial feature extraction and enhancement unit. The spatial feature extraction and enhancement unit is connected to the multi-source data preprocessing and fusion unit. It uses a decoupled graph-enhanced sparse convolutional attention model to extract and enhance spatial features from the fused data, and outputs the traffic flow feature matrix with enhanced spatial dimensions to the spatiotemporal feature fusion unit. The spatiotemporal feature fusion unit, connected to the spatial feature extraction and enhancement unit, fuses spatial enhancement features with historical traffic patterns through a traffic pattern matching dynamic memory network model, and outputs the spatiotemporal fusion feature vector to the hyperparameter optimization and prediction unit. The hyperparameter optimization and prediction unit is connected to the spatiotemporal feature fusion unit. It uses LightGBM to guide the BO optimization spatiotemporal prediction algorithm to determine the optimal hyperparameter combination and complete the traffic flow prediction. It then outputs the candidate prediction results to the optimal result filtering unit. The optimal result screening unit, connected to the hyperparameter optimization and prediction unit, selects the optimal prediction result from the candidate prediction results and uses it as the traffic flow prediction result for the target section of the highway.