Highway bridge carbon emission prediction method based on random forest
Through the random forest-based method, a highway bridge carbon emission prediction model was established, which solved the problem that carbon emissions could not be calculated in the design stage in the existing technology, achieved the prediction and optimization design of highway bridge carbon emissions, and promoted the transportation industry sustainable development.
Patent Information
- Application Number
- CN202411308628.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
The existing technology lacks carbon emission forecasting methods for expressway bridges, cannot calculate carbon emissions in the design stage, and cannot optimize and guide the energy-saving and carbon reduction construction plans in the design stage.
Using a random forest-based method, the carbon emission data of highway bridge engineering projects were collected and preprocessed, correlation analysis and gray correlation analysis were performed, and characteristic variables were selected to construct a carbon emission prediction model, and the grid search and 10-fold cross-validation were used to determine. Decision tree parameters and establish a carbon emission prediction model.
The prediction of highway bridge carbon emissions has been achieved, the data loss in the design stage has been made up for, and optimized energy-saving and carbon reduction design guidance has been provided, which has reduced carbon emissions during the construction period of highway bridges, and promoted the sustainable development of the transportation industry.
Smart Images

Figure CN119250569A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of carbon emission data analysis, and in particular to a method for predicting carbon emission of highway bridges based on random forest. Background Art
[0002] As a special type of transportation infrastructure, bridges have the characteristics of large size and long construction period. Their construction process will generate a large amount of carbon emissions, and the issue of carbon emissions has attracted much attention.
[0003] At present, carbon emission forecasts are mostly for the transportation industry. However, the carbon emissions of highway bridges are mainly calculated from the perspective of the entire life cycle, and there is a lack of carbon emission forecasting methods for highway bridges. At the same time, the existing technology mainly uses the actual energy consumption data during the construction process for statistical accounting, and it is impossible to calculate carbon emissions in the design stage, and it is impossible to optimize the energy-saving and carbon-reducing construction plan in the design stage. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for predicting carbon emissions from highway bridges based on random forests, which effectively solves the problems in the background technology.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is: a method for predicting carbon emissions of highway bridges based on random forest, comprising the following steps:
[0006] S1: Collect carbon emission data of different highway bridge projects and build a carbon emission dataset;
[0007] S2: preprocess the data set;
[0008] S3: Through correlation analysis and grey correlation analysis, the collected data is analyzed for characteristic variables of carbon emission prediction, and characteristic variables are selected as inputs of the bridge carbon emission prediction model;
[0009] S4: Use the selected feature variables to construct and generate the final data set, and divide the data set into a training set and a prediction set;
[0010] S5: Input the data set into the random forest, use grid search and 10-fold cross validation method to determine the optimal number of decision trees T and the maximum depth H of the decision tree in the random forest, and build a carbon emission prediction model;
[0011] S6: Use the training set data to train the carbon emission prediction model to obtain the prediction effect;
[0012] S7: Use the prediction set data to predict the carbon emission prediction model and verify the feasibility of the model.
[0013] Furthermore, the carbon emission data of step S1 includes carbon emission data and characteristic variable data of different bridge engineering projects, including the number of bridge lanes, bridge length, bridge area, pile foundation, bridge abutment, tie beam, pier, prestressed concrete hollow slab, prestressed concrete small box beam, cast-in-place concrete continuous beam, asphalt concrete pavement, cement concrete pavement, bridge bearings, expansion joints, guardrails and nets, and other projects.
[0014] Furthermore, the preprocessing in step S2 includes normalizing the data, that is, mapping it to the range of [0,1], that is:
[0015]
[0016] In the formula, x i(normalized) is the sample data after naturalization; x i is the original sample data; x i(min) is the minimum value of the sample data; x imax is the maximum value of the sample data.
[0017] Furthermore, the correlation analysis in step S3 specifically includes:
[0018] The Spearman rank correlation coefficient was used to analyze the correlation between characteristic variables and carbon emissions, and the correlation coefficient of characteristic variables was calculated:
[0019]
[0020] in, is the correlation coefficient, d i is the difference in rank between each pair of observations, and n is the number of observations;
[0021] Determine whether it passes the 0.01 significance test. If The characteristic variable has no correlation with carbon emissions, so it is not selected; if The characteristic variable is related to carbon emissions, so this characteristic variable is selected.
[0022] Furthermore, the grey relational analysis in step S3 includes calculating the grey relational degree:
[0023]
[0024] in, are the minimum and maximum ranges respectively, and ρ is the resolution.
[0025] Furthermore, when dividing the data set in step S4, 80% of the data set is used as a training set and 20% of the data set is used as a prediction set.
[0026] Furthermore, in step S5, grid search and 10-fold cross validation are used, and the specific process includes:
[0027] The data set is divided into 10 mutually exclusive subsets. One of the subsets is selected in sequence as the model validation set, and the remaining 9 subsets are selected as training sets. The model is learned based on the training set and tested on the validation set. The optimal model parameters are determined by comparing the accuracy of each evaluation indicator of the 10 groups.
[0028] Furthermore, the maximum depth H of the decision tree of the random forest is set to 10, and the number of decision trees T is set to 25.
[0029] Furthermore, in step S6, the carbon emission prediction model is trained using the deterministic coefficient R 2 Determine the accuracy of the carbon emission prediction model, the determination coefficient R 2 It is equal to the ratio of the variation caused by the predicted values in the regression model to the total variation of the actual subset:
[0030]
[0031] Among them, N is the total number of samples in the training set, y i is the predicted value of carbon emissions in the training set, For all training sets y i The average value of is the predicted value of carbon emissions of the i-th sample subset obtained using the random forest regression model.
[0032] Furthermore, in step S7, the mean absolute error, mean square error, and mean absolute percentage error are used to verify and evaluate the effect of the carbon emission prediction model;
[0033] The mean absolute error MAE calculation formula is:
[0034]
[0035] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0036] The mean square error (MSE) calculation formula is:
[0037]
[0038] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0039] The mean absolute percentage error (MAPE) is calculated as:
[0040]
[0041] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0042] Compared with the prior art, the beneficial effects of the present invention are as follows: a random forest-based highway bridge carbon emission prediction method of the present invention can facilitate design units to predict the carbon emissions of newly built highway bridges, and make up for the lack of carbon emission accounting data for current highway bridge construction, and provide optimization guidance for the energy-saving and carbon-reduction design of early construction plans, which will help reduce carbon emissions during the highway bridge construction period and promote the sustainable development of the transportation industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 This is a flow chart of a method for predicting carbon emissions from highway bridges based on random forests in an embodiment of the present invention;
[0045] Figure 2 This is a determination coefficient diagram of the training set prediction results of the carbon emission prediction model in the embodiment of the present invention. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0047] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0049] like Figure 1 As shown, a method for predicting carbon emissions of highway bridges based on random forests includes the following steps:
[0050] S1: Collect and obtain carbon emission data of different highway bridge projects and construct a carbon emission data set; the data comes from the transportation engineering carbon emission calculation and analysis software (CEA-TC1.0). CEA-TC1.0 is the first carbon emission calculation and analysis software for transportation engineering construction projects in China. The software can calculate the carbon emissions of the project and its sub-projects by importing the project budget file, using a total of 107 data.
[0051] S2: preprocess the data set;
[0052] S3: Through correlation analysis and grey correlation analysis, the collected data is analyzed for characteristic variables of carbon emission prediction, and characteristic variables are selected as inputs of the bridge carbon emission prediction model;
[0053] S4: Use the selected feature variables to construct and generate the final data set, and divide the data set into a training set and a prediction set;
[0054] S5: Input the data set into the random forest, use grid search and 10-fold cross validation method to determine the optimal number of decision trees T and the maximum depth H of the decision tree in the random forest, and build a carbon emission prediction model;
[0055] S6: Use the training set data to train the carbon emission prediction model to obtain the prediction effect;
[0056] S7: Use the prediction set data to predict the carbon emission prediction model and verify the feasibility of the model.
[0057] The specific implementation process of the present invention is to first collect and obtain carbon emission data of different highway bridge engineering projects to construct a carbon emission data set; secondly, preprocess the data set; analyze the carbon emission prediction characteristic variables of the collected data through correlation analysis and gray correlation analysis, select characteristic variables as the input of the bridge carbon emission prediction model; use the selected characteristic variables to construct and generate the final data set, and divide the data set into a training set and a prediction set; then input the data set into a random forest, use grid search and 10-fold cross validation method to determine the optimal number of decision trees T and the maximum depth H of the decision tree of the random forest, and construct a carbon emission prediction model; use the training set data to train the carbon emission prediction model to obtain the prediction effect; use the prediction set data to predict the carbon emission prediction model to verify the feasibility of the model. Compared with the prior art, the beneficial effects of the present invention are: a highway bridge carbon emission prediction method based on random forest of the present invention can facilitate the design unit to predict the carbon emissions of the newly built highway bridge, and make up for the lack of carbon emission accounting data of the current highway bridge construction, optimize and guide the energy-saving and carbon-reduction design of the early construction plan, and will help reduce the carbon emissions during the construction period of the highway bridge and promote the sustainable development of the transportation industry.
[0058] In the present invention, the carbon emission data of step S1 includes carbon emission data and characteristic variable data of different bridge engineering projects, including the number of bridge lanes, bridge length, bridge area, pile foundation, bridge abutment, tie beam, pier, prestressed concrete hollow slab, prestressed concrete small box beam, cast-in-place concrete continuous beam, asphalt concrete pavement, cement concrete pavement, bridge bearings, expansion joints, guardrails and nets, and other projects.
[0059] In the present invention, the preprocessing in step S2 includes normalizing the data, that is, mapping it to the range of [0,1], that is:
[0060]
[0061] In the formula, x i(normalized) is the sample data after naturalization; x i is the original sample data; x i(min) is the minimum value of the sample data; x imax is the maximum value of the sample data.
[0062] In the present invention, the Spearman rank correlation coefficient is used to analyze the correlation between the characteristic variables and the carbon emissions, and the correlation coefficient of the characteristic variables is calculated:
[0063]
[0064] in, is the correlation coefficient, d iis the difference in rank between each pair of observations, and n is the number of observations;
[0065] Determine whether it passes the 0.01 significance test. If The characteristic variable has no correlation with carbon emissions, so it is not selected; if The characteristic variable is related to carbon emissions, so this characteristic variable is selected.
[0066] In the present invention, the grey relational analysis in step S3 includes calculating the grey relational degree:
[0067]
[0068] in, are the minimum and maximum ranges respectively, and ρ is the resolution.
[0069] Finally, a total of 15 characteristic variables that passed the significance test and had a grey correlation degree greater than 0.7 were selected, including: bridge length, bridge area, pile foundation, bridge abutment, tie beam, pier, prestressed concrete hollow slab, prestressed concrete small box beam, cast-in-place concrete continuous beam, asphalt concrete pavement, cement concrete pavement, bridge bearings, expansion joints, guardrails and nets, and other projects.
[0070] In the present invention, when the data set is divided in step S4, 80% of the data set is used as a training set and 20% of the data set is used as a prediction set.
[0071] In the present invention, in step S5, the model parameters are optimized using grid search and 10-fold cross validation with the data set, and the specific process includes:
[0072] The data set is divided into 10 mutually exclusive subsets. One of the subsets is selected in sequence as the model validation set, and the remaining 9 subsets are selected as training sets. The model is learned based on the training set and tested on the validation set. The optimal model parameters are determined by comparing the accuracy of each evaluation indicator of the 10 groups.
[0073] As a preferred embodiment of the above embodiment, the maximum depth H of the decision tree is set to 10, the number of decision trees T is optimized using the grid search method, and the optimal parameter is determined to be 25 using 10-fold cross validation; the number of decision trees T is set to 25, the maximum depth H of the decision tree is optimized using the grid search method, and the optimal parameter is determined to be 11 using 10-fold cross validation.
[0074] In the present invention, in step S6, the carbon emission prediction model is trained using the determination coefficient R 2 Determine the accuracy of the carbon emission prediction model, the determination coefficient R 2 It is equal to the ratio of the variation caused by the predicted values in the regression model to the total variation of the actual subset:
[0075]
[0076] Among them, N is the total number of samples in the training set, y i is the predicted value of carbon emissions in the training set, For all training sets y i The average value of is the predicted value of carbon emissions of the i-th sample subset obtained using the random forest regression model;
[0077] R 2 The closer it is to 1, the higher the prediction accuracy of the bridge construction carbon emission prediction model.
[0078] In the present invention, in step S7, the mean absolute error, mean square error, and mean absolute percentage error are used to verify and evaluate the effect of the carbon emission prediction model;
[0079] The mean absolute error MAE calculation formula is:
[0080]
[0081] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0082] The mean square error (MSE) calculation formula is:
[0083]
[0084] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0085] The mean absolute percentage error (MAPE) is calculated as:
[0086]
[0087] Among them, n is the number of samples, y i is the true value, is the predicted value;
[0088] The smaller the MAE value, the better the model prediction effect, the smaller the MSE value, the more stable the prediction result, and the smaller the MAPE value, the better the model prediction performance.
[0089] The test set data was used to analyze the evaluation effect of the random forest carbon emission prediction model, and the XGBoost model and the multivariate linear regression (MLR) model were established using the same training set and test set to verify the feasibility of the random forest carbon emission prediction model. The evaluation effects of various models are shown in Table 1.
[0090] Prediction Model MAE MSE MAPE RF 0.186 0.068 0.23 XGBoost 0.529 0.76 0.35 MLR 0.543 0.53 1.54
[0091] Table 1
[0092] Among them, the random forest carbon emission prediction model has the best prediction accuracy, with MAE, MSE, and MAPE of 0.186, 0.068, and 0.023, respectively. The results show that the random forest carbon emission prediction model has the best prediction performance.
[0093] Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for predicting carbon emissions from highway bridges based on random forests, characterized in that: The steps include: S1: Collect carbon emission data of different highway bridge projects and build a carbon emission dataset; S2: preprocess the data set; S3: Through correlation analysis and grey correlation analysis, the collected data is analyzed for characteristic variables of carbon emission prediction, and characteristic variables are selected as inputs of the bridge carbon emission prediction model; S4: Use the selected feature variables to construct and generate the final data set, and divide the data set into a training set and a prediction set; S5: Input the data set into the random forest, use grid search and 10-fold cross validation method to determine the optimal number of decision trees T and the maximum depth H of the decision tree in the random forest, and build a carbon emission prediction model; S6: Use the training set data to train the carbon emission prediction model to obtain the prediction effect; S7: Use the prediction set data to predict the carbon emission prediction model and verify the feasibility of the model.
2. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: The carbon emission data in step S1 includes carbon emission data and characteristic variable data of different bridge engineering projects.
3. The method for predicting carbon emissions from highway bridges based on random forest according to claim 1 is characterized in that: The preprocessing in step S2 includes normalizing the data, that is, mapping it to the range of [0,1], that is: In the formula, x i(normalized) is the sample data after naturalization; x i is the original sample data; x i(min) is the minimum value of the sample data; x imax is the maximum value of the sample data.
4. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: The correlation analysis in step S3 specifically includes: The Spearman rank correlation coefficient was used to analyze the correlation between characteristic variables and carbon emissions, and the correlation coefficient of characteristic variables was calculated: in, is the correlation coefficient, d i is the difference in rank between each pair of observations, and n is the number of observations; Determine whether it passes the 0.01 significance test. If The characteristic variable has no correlation with carbon emissions, so it is not selected; if The characteristic variable is related to carbon emissions, so this characteristic variable is selected.
5. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: The grey relational analysis in step S3 includes calculating the grey relational degree: in, are the minimum and maximum ranges respectively, and ρ is the resolution.
6. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: When dividing the data set in step S4, 80% of the data set is used as a training set and 20% of the data set is used as a prediction set.
7. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: In step S5, grid search and 10-fold cross validation are used, and the specific process includes: The data set is divided into 10 mutually exclusive subsets, one of which is selected in sequence as the model validation set, and the remaining 9 subsets are selected as training sets. The model is learned based on the training set and tested on the validation set. The optimal model parameters are determined by comparing the accuracy of each evaluation indicator of the 10 groups.
8. The method for predicting carbon emissions from highway bridges based on random forests according to claim 7 is characterized in that: The maximum depth H of the decision tree of the random forest is set to 10, and the number of decision trees T is set to 25.
9. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1 is characterized in that: In step S6, the carbon emission prediction model is trained using the determination coefficient R 2 Judging the accuracy of the carbon emission prediction model, the determination coefficient R 2 It is equal to the ratio of the variation caused by the predicted values in the regression model to the total variation of the actual subset: Among them, N is the total number of samples in the training set, y i is the predicted value of carbon emissions in the training set, For all training sets y i The average value of is the predicted value of carbon emissions of the i-th sample subset obtained using the random forest regression model.
10. The method for predicting carbon emissions from highway bridges based on random forests according to claim 1, characterized in that: In step S7, the mean absolute error, mean square error and mean absolute percentage error are used to verify and evaluate the effect of the carbon emission prediction model.
Citation Information
Cited By
Construction process carbon emission prediction method for intelligent manufacturing
CN120542609A
Construction process carbon emission prediction method for intelligent manufacturing
CN120542609B
Cross-regional mangrove forest carbon sink prediction method based on multi-correlation analysis
CN120745934A
Carbon emission prediction and threshold identification method based on space blocking random forest
CN121563017A