Differentiated road section traffic volume prediction method based on LGBM algorithm

By applying training strategies such as LGBM algorithms and feature discretization in differentiated toll environments of highways, a strong learner is built, which solves the problems of complex and low accuracy of traffic forecasting in the existing technology, and achieves faster and more accurate traffic forecasting.

CN119723871APending Publication Date: 2025-03-28云南公路联网收费管理有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411777210.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, traffic volume prediction before and after differentiated tolls on expressways is complex, with many model parameters and a long prediction time, which affects the prediction accuracy.

Method used

A differentiated traffic volume prediction method based on LGBM algorithm is adopted to predict traffic volume through training strategies such as feature discretization, histogram construction, leaf-based growth, unilateral gradient sampling and mutually exclusive feature bundling, a strong learner is built to predict traffic volume.

Benefits of technology

It significantly reduces the amount of calculation, improves the training speed of model, and can predict the traffic volume of differentiated road sections more accurately, and obtains more realistic results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723871A_ABST
    Figure CN119723871A_ABST
Patent Text Reader

Abstract

The invention discloses a differentiated road section traffic volume prediction method based on an LGBM algorithm, and belongs to the technical field of machine learning methods and traffic volume prediction.The differentiated road section traffic volume prediction method comprises the steps that traffic volume data before and after differentiation are preprocessed and divided to obtain training sample data and test sample data, model initial parameters are set, and the model initial parameters are set to obtain a model; carrying out model training on the training sample data by adopting a training strategy in an iteration process based on an LGBM algorithm so as to construct an LGBM model; and according to the LGBM model and the test sample data, traffic volume pre-obtaining a predicted traffic volume is carried out, an LGBM model error is further determined, the process of constructing the LGBM model, namely calculating the LGBM model error, is repeated, and the LGBM model with the minimum error is selected as an optimal model for traffic volume prediction. According to the method, the calculation amount can be reduced, the model training speed can be remarkably improved, and a more accurate prediction result of the traffic volume of the differentiated road section which is more fit with the actual situation is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning methods and traffic volume prediction, and in particular relates to a differentiated road section traffic volume prediction method based on an LGBM algorithm. Background Art

[0002] With the gradual promotion of differentiated toll collection on highways, differentiated toll collection schemes have developed in a diversified direction, achieving good results in balancing road network flow, improving traffic efficiency, reducing travel costs, and increasing toll revenue. However, the differentiated toll collection effect on some sections is not significant, and even has negative effects such as reduced toll revenue, which puts great economic pressure on highway owners. With the continuous optimization of the road network structure and the dynamic adjustment of traffic flow, the implementation effect of differentiated toll sections has changed dynamically, and its uncertainty has further increased. By studying the changes in traffic flow on highways under the influence of various differentiated policies, the effects of differentiated implementation are predicted, providing a clear and reliable basis for the formulation of differentiated strategies for sections.

[0003] However, in the existing technology, due to the complexity of differentiated prediction before and after the implementation of highways, many prediction models have been produced, such as time series models, non-parametric regression models, Kalman filter models, LSTM neural networks, etc.; the above models apply machine learning theory to the field of traffic volume prediction and have achieved good results, but under limited computing conditions, these models have more parameters and a long model prediction time, which affects the prediction accuracy. Summary of the invention

[0004] In order to solve the above problems existing in the prior art, the present invention is implemented by the following technical solutions:

[0005] The present invention provides a differentiated road section traffic volume prediction method based on the LGBM algorithm, comprising the following steps:

[0006] Step 1: collect traffic volume data before and after differentiation, perform preprocessing on the data, and obtain preprocessed traffic volume data, and divide the preprocessed traffic volume data into training sample data and test sample data;

[0007] Step 2: Set the initial parameters of the model, and use the training strategy to train the training sample data in iterations based on the LGBM algorithm to build the LGBM model;

[0008] Step 3: Predict the traffic volume according to the LGBM model and the test sample data to obtain the predicted traffic volume, and obtain the LGBM model error according to the predicted traffic volume and the actual traffic volume;

[0009] Step 4, repeat steps 2 to 3 until the iteration stop condition is met, and select the LGBM model with the smallest LGBM model error as the optimal model;

[0010] Step 5: Use the optimal model and the newly collected and pre-processed traffic volume data before and after differentiation to perform traffic volume prediction and output the prediction results.

[0011] Furthermore, the training strategies in step 2 include a histogram algorithm consisting of feature discretization and histogram construction, leaf-based growing, unilateral gradient sampling, and mutually exclusive feature bundling.

[0012] Furthermore, the histogram algorithm consisting of feature discretization and histogram construction includes:

[0013] Feature discretization: obtain the feature value range in the training sample data, traverse the feature values ​​of all samples in the training sample data, and divide the feature value corresponding to each sample into the corresponding interval to form a feature histogram;

[0014] Histogram construction: During each node splitting process, the feature histogram is reconstructed for each feature in the training sample data subset corresponding to each node to be split.

[0015] Furthermore, the leaf-based growth includes: analyzing the training sample data subsets covered by the current leaf nodes, and selecting the most potential features therein for splitting.

[0016] Furthermore, the one-sided gradient sampling includes: the one-sided gradient sampling includes: calculating the gradient values ​​corresponding to all samples in the training sample data before each round of iterative training starts, sorting the training sample data according to the absolute values ​​of the gradient values, retaining the proportion of the training sample data with large absolute values ​​of the gradient values ​​and selecting the training sample data according to the proportion.

[0017] Furthermore, exclusive feature bundling includes: performing mutually exclusive identification on features in the training sample data, and bundling the mutually exclusive features to form new composite features.

[0018] Furthermore, the traffic volume is predicted based on the LGBM model and the test sample data to obtain the predicted traffic volume. The formula for the LGBM model error is obtained based on the predicted traffic volume and the actual traffic volume:

[0019]

[0020] Among them, RMSE is the root mean square error, n is the number of test sample data, y i is the predicted traffic volume obtained based on the features in the LGBM and test sample data, y1 i is the actual traffic volume corresponding to the test sample data.

[0021] Compared with the prior art, the present invention has the following beneficial effects:

[0022] On the one hand, the present invention discretizes the eigenvalues ​​through a histogram algorithm, and puts them into discretized intervals to construct a feature histogram. When looking for the best splitting point, it only needs to be calculated based on these limited discrete intervals. Compared with the traditional method of traversing all possible values ​​of the feature to calculate the splitting gain, the amount of calculation is greatly reduced, thereby significantly improving the model training speed; on the other hand, by integrating multiple decision trees to form a strong learner, as the number of decision trees increases and the training process is iterated, the model can continuously capture the complex nonlinear relationship between the input features and the traffic volume in the traffic data, and the prediction results of the traffic volume of differentiated sections can be more in line with the actual situation and more accurate.

[0023] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flowchart of a differentiated road section traffic volume prediction method based on the LGBM algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the scheme according to the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0026] The above and other technical contents, features and effects of the present invention are clearly presented in the following detailed description of the specific implementation modes in conjunction with the accompanying drawings. Through the description of the specific implementation modes, the technical means and effects adopted by the present invention to achieve the predetermined purpose can be more deeply and specifically understood. However, the attached drawings are only for reference and explanation purposes and are not used to limit the technical solutions of the present invention.

[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. In the absence of more restrictions, the elements defined by the statement "including one..." do not exclude the existence of other identical elements in the article or device including the elements.

[0028] like Figure 1As shown, a differentiated road section traffic volume prediction method based on the LGBM algorithm provided by an embodiment of the present invention includes the following specific steps:

[0029] Step 1: Collect traffic volume data before and after differentiation and perform preprocessing to obtain preprocessed traffic volume data, and divide the preprocessed traffic volume data into training sample data and test sample data.

[0030] Step 1.1, determine the scope of specific expressway sections where the differentiation policy is implemented, and collect traffic volume data before and after the implementation of the differentiation on these specific sections. The sources of data acquisition include but are not limited to the database of the traffic management department, the data of the electronic toll collection system (ETC), and the data of road monitoring equipment.

[0031] Step 1.1.2: Preprocess the traffic volume data before and after differentiation. Specifically, remove unreasonable large or small outliers in the traffic volume data and fill in the missing values ​​using mean filling.

[0032] Step 1.1.3: Extract 80% of the preprocessed traffic data as training sample data for the LGBM model training phase, and the other 20% as test sample data to evaluate the performance of the trained model.

[0033] Step 2: Set the initial parameters of the model, and use the training strategy to train the model in iterations based on the LGBM algorithm to build the LGBM model.

[0034] Step 2.1, set the initial parameters of the model, set the learning rate, the maximum depth of the tree, the minimum number of samples of leaf nodes, the sampling ratio in single-side gradient sampling (GOSS), and the feature combination bundled in exclusive feature bundling (EFS).

[0035] Step 2.2, the training strategy includes a histogram algorithm consisting of feature discretization and histogram construction, leaf-based growing, unilateral gradient sampling, and mutually exclusive feature bundling.

[0036] The histogram algorithm, which consists of feature discretization and histogram construction, includes: (1) feature discretization: obtaining the feature value range in the training sample data, traversing the feature values ​​of all samples in the training sample data, and dividing the feature value corresponding to each sample into the corresponding interval to form a feature histogram; (2) histogram construction: in each node splitting process, reconstructing the feature histogram for each feature in the training sample data subset corresponding to each node to be split.

[0037] Leaf-based growth includes: analyzing the subset of training sample data covered by the current leaf nodes, selecting the most promising features for splitting, so that the tree can have a higher depth and build a more complex model structure, thereby better fitting the data.

[0038] Single-sided gradient sampling includes: calculating the gradient values ​​corresponding to all samples in the training sample data before each round of iterative training, sorting the training sample data according to the absolute value of the gradient value, retaining the proportion of training sample data with large absolute value of gradient value and selecting training sample data according to the proportion.

[0039] Exclusive feature bundling includes: mutually exclusive identification of features in the training sample data, bundling the mutually exclusive features to form new composite features, thereby reducing the dimension of the feature space and further reducing the amount of calculation and memory consumption.

[0040] The training strategy is used in iterations to process the training set data for model training and build the LGBM model.

[0041] Step 3: Predict the traffic volume according to the LGBM model and the test sample data to obtain the predicted traffic volume. According to the predicted traffic volume and the actual traffic volume, the LGBM model error is obtained. The LGBM model error adopts the root mean square error. Specifically, the root mean square error calculation formula is:

[0042]

[0043] Among them, RMSE is the root mean square error, n is the number of test sample data, y i is the predicted traffic volume obtained based on the features in the LGBM and test sample data, y1 i is the actual traffic volume corresponding to the test sample data.

[0044] Step 4: Repeat steps 2 to 3 until the iteration stop condition is met, and select the LGBM model with the smallest LGBM model error as the optimal model.

[0045] The iteration stopping condition is that the root mean square error is less than the set threshold or reaches the set maximum number of iterations.

[0046] Since the LGBM algorithm has multiple hyperparameters (learning rate, maximum tree depth, minimum number of leaf node samples, sampling ratio in GOSS, and bundled feature combinations in EFB), multiple groups of different hyperparameter combinations are formed by systematically changing the values ​​of these hyperparameters. For each group of hyperparameter combinations, the above steps 2 to 3, i.e., model training and RMSE calculation using test data, are repeated. The RMSE values ​​of the models corresponding to each group of hyperparameter combinations on the test sample data are recorded in detail, and the model with the minimum LGBM model error, i.e., the minimum RMSE root mean square error, is found to be the optimal model.

[0047] Step 5: Use the optimal model and the newly collected and pre-processed traffic volume data before and after differentiation to perform traffic volume prediction and output the prediction results.

[0048] New traffic data sample data of a specific road section where a differentiated policy is implemented is obtained and preprocessed to obtain preprocessed new traffic sample data, the new traffic sample data is input into the optimal model, and the traffic volume is predicted through the calculation of the optimal model to output the prediction result.

[0049] The present embodiment provides a method for predicting differentiated road section traffic volume based on the LGBM algorithm, which pre-processes the traffic volume data before and after the differentiation and divides them into training sample data and test sample data, sets the initial parameters of the model, and uses the training strategy to train the training sample data in each iteration based on the LGBM algorithm to build the LGBM model; predicts the traffic volume based on the LGBM model and the test sample data to obtain the predicted traffic volume, further determines the LGBM model error, repeats the process of constructing the LGBM model, i.e., calculating the LGBM model, and selects the LGBM model with the smallest LGBM model error as the optimal model for traffic volume prediction. The present invention can greatly reduce the amount of calculation, significantly improve the speed of model training, and at the same time can obtain a prediction result of differentiated road section traffic volume that is more in line with the actual situation and more accurate.

[0050] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A differentiated road section traffic volume prediction method based on LGBM algorithm, characterized in that: The following steps are involved: Step 1: collect traffic volume data before and after differentiation, perform preprocessing on the data, and obtain preprocessed traffic volume data, and divide the preprocessed traffic volume data into training sample data and test sample data; Step 2: Set the initial parameters of the model, and use the training strategy to train the training sample data in iterations based on the LGBM algorithm to build the LGBM model; Step 3: Predict the traffic volume according to the LGBM model and the test sample data to obtain the predicted traffic volume, and obtain the LGBM model error according to the predicted traffic volume and the actual traffic volume; Step 4, repeat steps 2 to 3 until the iteration stop condition is met, and select the LGBM model with the smallest LGBM model error as the optimal model; Step 5: Use the optimal model and the newly collected and pre-processed traffic volume data before and after differentiation to perform traffic volume prediction and output the prediction results.

2. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 1 is characterized in that: The training strategy in step 2 includes a histogram algorithm consisting of feature discretization and histogram construction, leaf-based growth, unilateral gradient sampling, and mutually exclusive feature bundling.

3. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 2 is characterized in that: The histogram algorithm consisting of feature discretization and histogram construction includes: Feature discretization: obtain the feature value range in the training sample data, traverse the feature values ​​of all samples in the training sample data, and divide the feature value corresponding to each sample into the corresponding interval to form a feature histogram; Histogram construction: During each node splitting process, the feature histogram is reconstructed for each feature in the training sample data subset corresponding to each node to be split.

4. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 2 is characterized in that: The leaf-based growth includes: analyzing the training sample data subsets covered by the current leaf nodes, and selecting the most potential features therein for splitting.

5. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 2 is characterized in that: The unilateral gradient sampling includes: calculating the gradient values ​​corresponding to all samples in the training sample data before each round of iterative training starts, sorting the training sample data according to the absolute values ​​of the gradient values, retaining the proportion of the training sample data with large absolute values ​​of the gradient values ​​and selecting the training sample data according to the proportion.

6. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 2 is characterized in that: The mutually exclusive feature bundling includes: performing mutually exclusive identification on features in the training sample data, and packaging and bundling the mutually exclusive features to form new composite features.

7. The differentiated road section traffic volume prediction method based on the LGBM algorithm according to claim 1 is characterized in that: The traffic volume is predicted based on the LGBM model and the test sample data to obtain the predicted traffic volume. The formula for obtaining the LGBM model error based on the predicted traffic volume and the actual traffic volume is: Among them, RMSE is the root mean square error, n is the number of test sample data, y i is the predicted traffic volume obtained based on the features in the LGBM and test sample data, y1 i is the actual traffic volume corresponding to the test sample data.