Bridge technical condition prediction method and system based on machine learning
Through machine learning technology, combined with data preprocessing, feature screening and integrated learning models, the problem of unconsidered correlation of bridge technology status factors is solved, the prediction accuracy and stability are improved, and the decision-making support capabilities of bridge management and maintenance are enhanced.
Patent Information
- Application Number
- CN202411080744.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The failure of existing machine learning methods to effectively consider the correlation of bridge technology conditions factors, resulting in the need to improve prediction accuracy and evaluation level.
Using the bridge technology status prediction method based on machine learning, the integrated learning model is constructed through data preprocessing, feature screening, data balance processing and integrated learning model, combined with the random forest algorithm, SMOTomek method and XGBoost model, the integrated learning model is constructed to achieve the accuracy of the bridge technology status. predict.
It improves the accuracy and stability of bridge technical status prediction, overcomes data imbalance problem, simplifies preprocessing and feature screening processes, enhances decision-making support capabilities, and improves the efficiency and safety of bridge operation and maintenance.
Smart Images

Figure CN118606847B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a method and system for predicting the technical condition of a bridge based on machine learning. Background Art
[0002] As an important part of infrastructure, the safety of bridges is directly related to the safety of people's lives and property and economic development. It is essential to maintain the quality of bridge operations and ensure traffic safety through maintenance strategies. The maintenance life cycle starts with on-site inspection, followed by status diagnosis, maintenance decision-making and maintenance actions. Traditional bridge technical condition assessment usually relies on manual inspection and empirical evaluation. This method has the problems of strong subjectivity, long time consumption, high cost, and is easily affected by human factors. In order to solve these problems, more and more methods for predicting the technical condition of bridges have been proposed. The current prediction models can be roughly divided into three categories, namely deterministic models, stochastic models and artificial intelligence models.
[0003] The deterministic model uses mathematical methods to describe the degradation state of the bridge, and the representative method is regression.
[0004] For example, the paper "Prediction of Bridge Technical Condition Based on Regression Analysis Method" published in the Journal of Beijing University of Civil Engineering and Architecture proposed using regression analysis method to fit the bridge technical condition decline model, and then predict the development trend of bridge technical condition.
[0005] For example, the paper "Research on Prediction Method for Development Trend of Technical Condition Grade of In-service Bridges" published in the journal "Highway and Transportation Research and Development (Applied Technology Edition)" established a development trend model for the technical condition grade of various types of bridges over the operating time by performing linear regression on historical data on the technical condition grade assessment of highway bridges.
[0006] However, the limitation of the regression method is that it ignores the random errors caused by unobserved explanatory variables in the prediction, ignores uncertainty, and only predicts the overall average result.
[0007] A stochastic model is a mathematical model that describes a random process or phenomenon, and the typical method is the Markov chain.
[0008] For example, the paper “Research on Grey Markov Chain Model for Prediction of Bridge Technical Condition” published in the Journal of Wuhan University of Technology (Transportation Science and Engineering Edition) combines the grey model GM(1,1) with the Markov chain to consider the overall changes and local fluctuations in the technical condition of the bridge.
[0009] For example, the paper "Research on Degradation Law of Beam Bridges Based on Markov Process" published in the journal "Journal of Jiamusi University (Natural Science Edition)" uses Markov theory and genetic algorithms of nonlinear programming to study the time-varying laws of the preventive maintenance technology of concrete highway beam bridges.
[0010] However, the Markov chain model requires the assumption of independence between past and future states, which is a serious limitation of this approach.
[0011] With the development of big data and artificial intelligence technology, more and more artificial intelligence technologies are being used in the prediction of bridge technical condition level, which are mainly divided into deep learning-based methods and traditional machine learning-based algorithms.
[0012] Among them, deep learning-based methods usually use multi-layer neural networks to extract features layer by layer and learn complex data representations to predict the technical condition level of bridges.
[0013] For example, the Chinese patent with publication number CN113569908A and titled "Back-calculation method for predicting technical condition and defects of bridges based on deep learning" proposes a back-calculation method for predicting technical condition and defects of bridges using a CPSO-BP neural network model. By optimizing the neural network structure and parameters, the location, type and degree of bridge defects can be accurately predicted.
[0014] For example, the Chinese patent with publication number CN111160528A and titled “Method for Predicting Service Performance Degradation of Reinforced Concrete Bridges” proposes using multiple LSTM neural networks to train and adjust parameters of inspection report data from previous years to accurately predict the technical condition scores of reinforced concrete bridges in the next few years.
[0015] As we all know, neural networks have high accuracy, but they are not very interpretable, are prone to overfitting in small sample conditions, and have high requirements for computing resources.
[0016] Traditional machine learning algorithms rely on feature engineering and model training. Based on the extraction and selection of features, various machine learning algorithms (such as decision trees, support vector machines, random forests, etc.) are used to predict the technical condition level of bridges.
[0017] For example, a Chinese patent with publication number CN114036258A and titled "A method for rapidly identifying the technical condition level of a bridge based on natural language processing" provides a method for rapidly identifying the technical condition level of a bridge based on natural language processing, including extracting text descriptions from bridge health status information, classifying the technical condition level, and using a machine learning algorithm to establish a training model to achieve rapid identification.
[0018] For example, the paper "Technical Condition Assessment of Small and Medium Span Bridges Based on Machine Learning" published in the journal "Journal of Chang'an University (Natural Science Edition)" proposed an intelligent assessment method for the technical condition of bridges based on machine learning. By constructing a bridge status database and machine learning algorithm, it achieved accurate assessment of the technical condition of bridges.
[0019] Although current machine learning methods have overcome some technical limitations of deterministic and stochastic models, current methods rarely take into account the correlation of factors affecting the technical condition of bridges, and the prediction level needs to be further improved. Summary of the invention
[0020] The technical problem to be solved by the present invention is that the current machine learning method does not take into account the correlation of factors affecting the technical condition of the bridge, and the level of accurate prediction and evaluation needs to be further improved. Its purpose is to provide a method and system for predicting the technical condition of the bridge based on machine learning. By conducting a comprehensive analysis of the bridge structure and related data, accurate prediction and evaluation of the technical condition of the bridge can be achieved, the safety and reliability of the bridge can be improved, thereby effectively ensuring the safe operation of the bridge, increasing the service life of the bridge, and effectively utilizing big data and machine learning technology.
[0021] The present invention is achieved through the following technical solutions:
[0022] A bridge technical condition prediction method based on machine learning, the method comprising the following steps:
[0023] Step S101: obtaining the original data of multiple bridges from the bridge inspection database, including basic bridge data, bridge technical condition rating data and bridge disease data, and preprocessing the original data to obtain a bridge inspection data set, wherein the preprocessing process includes outlier removal, missing value processing, data type unification and dimension unification;
[0024] Step S102: using the random forest algorithm to calculate the Gini coefficient of each feature of the bridge detection data set, ranking the features according to the Gini coefficient, determining the top S features in the importance ranking, and calculating the Spearman correlation coefficients of the top S features, selecting a feature from the high-correlation feature pairs whose Spearman correlation coefficients are greater than a set threshold to exclude, and obtaining a screened data set;
[0025] Step S103: using the SMOTETomek method to perform data balancing on the screened data set to obtain a balanced data set;
[0026] Step S104: After tuning the parameters of the XGBoost model through the random search algorithm, the decision tree model is iteratively trained based on the balanced data set, and the objective function is optimized. The optimized decision tree model is integrated into the XGBoost model. During the integration process, the prediction results of multiple decision tree models are integrated through gradient boosting to obtain the final integrated learning model, which is used to accurately predict the technical condition level of the bridge.
[0027] Accordingly, the present invention also proposes a bridge technical condition prediction system based on machine learning, the system comprising:
[0028] The data preprocessing module is used to obtain the original data of multiple bridges from the bridge inspection database, including basic bridge data, bridge technical condition rating data and bridge disease data, and preprocess the original data to obtain the bridge inspection data set. The preprocessing process includes outlier removal, missing value processing, data type unification and dimension unification.
[0029] The feature screening module is used to calculate the Gini coefficient of each feature of the bridge detection data set using the random forest algorithm, sort the features according to the Gini coefficient, determine the top S features in the importance ranking, and calculate the Spearman correlation coefficient of the top S features. A feature is selected from the high-correlation feature pairs whose Spearman correlation coefficient is greater than the set threshold to exclude, and obtain the screened data set;
[0030] A data balancing processing module is used to perform data balancing processing on the screened data set using the SMOTETomek method to obtain a balanced data set;
[0031] The integrated learning model building module is used to iteratively train the decision tree model based on the balanced data set after tuning the parameters of the XGBoost model through the random search algorithm, and optimize the objective function, and integrate the optimized decision tree model into the XGBoost model. During the integration process, the prediction results of multiple decision tree models are integrated through gradient boosting to obtain the final integrated learning model, which is used to accurately predict the technical condition level of the bridge.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] (1) Improving prediction accuracy and stability: Traditional bridge technical condition prediction methods may be limited by problems such as feature selection, data imbalance, and model generalization ability. The present invention adopts a machine learning-based method, combined with data preprocessing, feature screening, data balance processing, and integrated learning model construction, which can effectively improve prediction accuracy and stability, thereby more accurately evaluating the bridge technical condition;
[0034] (2) Improving the generalization ability of the model: The present invention adopts the XGBoost ensemble learning method, which performs well in processing large-scale data and complex features and can effectively prevent overfitting. By tuning the hyperparameters of the XGBoost model, such as the learning rate, subsampling rate, and tree depth, the generalization ability of the model can be further improved, so that it can better adapt to the prediction needs of different bridge technical conditions;
[0035] (3) Overcoming the data imbalance problem: The present invention introduces the SMOTETomek method to balance the data. By generating synthetic samples and eliminating similar samples, the data imbalance problem is effectively overcome, and the model's recognition ability for minority samples is improved, thereby more comprehensively evaluating the technical condition of the bridge.
[0036] (4) Simplified preprocessing and feature screening process: The present invention designs a data preprocessing and feature screening process, wherein the data preprocessing process adopts a variety of methods such as outlier removal, missing value processing, data type unification and dimension unification, while the feature screening process can quickly and efficiently preprocess the data and screen features by sorting the feature importance and excluding highly correlated features, thereby simplifying the preprocessing process and improving the efficiency of model building;
[0037] (5) Enhanced decision-making support capabilities: The bridge technical condition prediction method and system provided by the present invention can not only predict the level of bridge technical conditions, but also provide more reliable technical evaluation and decision-making support for technical personnel through the construction of an integrated learning model, which helps to timely discover and solve bridge technical problems and improve the efficiency and safety of bridge operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:
[0039] Figure 1 is a flow chart of a bridge technical condition prediction method in an embodiment of the present invention;
[0040] Figure 2 is a flow chart of data preprocessing in an embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of the feature importance ranking result in an embodiment of the present invention;
[0042] Figure 4Schematic diagram of feature correlation calculation results in an embodiment of the present invention;
[0043] Figure 5 Schematic diagram of a confusion matrix in an embodiment of the present invention;
[0044] Figure 6 Schematic diagram of ROC curve in an embodiment of the present invention;
[0045] Figure 7 It is a structural schematic diagram of a bridge technical condition prediction system in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. It should be understood that the specific embodiments described are only used to explain the present application and are not used to limit the present application.
[0047] Machine learning technology can analyze a large amount of historical data of bridges and discover patterns and regularities in the data, thereby accurately predicting the technical condition of bridges. The machine learning-based bridge technical condition prediction system has the advantages of automation, high efficiency and high accuracy, which can greatly improve the efficiency of bridge monitoring and maintenance. In addition, by considering the relevance and importance of each feature in the data, designing feature screening and data balancing processing, it is possible to reduce the impact of collinearity, simplify the model complexity, and enhance the generalization ability of the model.
[0048] like Figure 1 As shown, this embodiment provides a method for predicting bridge technical conditions based on machine learning, which includes the following steps S101 to S104.
[0049] Step S101: Data preprocessing. First, the original data of multiple bridges are obtained from the bridge inspection database. The original data obtained include but are not limited to basic bridge data, bridge technical condition rating data and bridge disease data, etc. Then, the original data is preprocessed, including outlier removal, missing value processing, data type unification and dimension unification. After preprocessing, the bridge inspection data set is obtained.
[0050] The original data in this embodiment can be obtained from the bridge inspection database, which stores inspection data of multiple bridges, such as the inspection data of 2,314 bridges in a province in southwest my country, mainly including three aspects: basic information of bridges, rating information of bridge technical conditions, and bridge disease information. For the prediction of the technical condition of bridges, it is necessary to process multiple features including numerical (such as traffic volume, score, bridge length) and textual (such as bridge type, rating, structure type) data. Therefore, feature selection is required before prediction, and the feature data must be processed, including unifying the data format and deciding whether to unify the dimensions based on the nature of the algorithm. The specific data preprocessing process is as follows: Figure 2 shown.
[0051] (1) Outlier removal: Use statistical methods to identify and remove outliers in the data. This embodiment uses the Z-score method to identify and remove outliers in the original data. Specifically, for a certain original value in the original data , by calculating the mean of the corresponding features and standard deviation , data points whose deviation from the mean exceeds a certain threshold are considered outliers and removed.
[0052] ;
[0053] in, is the standard score, which represents the distance of the data point from the mean in standard deviation units. If or ,but are judged as outliers, among which is the set threshold.
[0054] (2) Missing value processing: Linear interpolation is used to fill missing values in the removed data. Linear interpolation is a method of estimating missing values through the linear relationship between known data points. For multidimensional data, linear interpolation can be performed on each dimension separately. Suppose a data point is missing in the original data set. , linear interpolation can be performed using the known data points around the data point.
[0055] Assumptions Missing the The value of the dimension can be obtained by Nearest Neighbor to impute missing values. The linear interpolation formula can be written as:
[0056] ;
[0057] in, is a known data point In the The value of the dimension, Is a missing value In the The estimated value of the dimension, yes arrive In this way, by applying linear interpolation in each dimension, we can estimate the approximate values of missing values in multidimensional data.
[0058] (3) Data type unification: The data types of the padded data are converted into the same format using one-hot encoding and mapping encoding methods according to the data attributes. One-hot encoding converts categorical data into binary vector representation, and mapping encoding maps categorical data into integer values.
[0059] The data in this embodiment is divided into numerical data and nominal data. Numerical features refer to features that are expressed in numerical form in the data set, rather than categories or labels, such as traffic volume, bridge age, etc. Nominal data includes labeled data and ordinal data: labeled data indicates that there is no meaning of size between feature values, such as structure type, superstructure material, design load, etc.; ordinal data indicates that feature values have meaning of size, such as highway grade, assessment grade maintenance time, etc. Specific processing is required for different types of nominal data features.
[0060] Label data preprocessing: Use one-hot encoding to convert label data into n-dimensional 0-1 variables, avoiding the problem of priority between data and solving the problem that classifiers are not good at processing attribute data. The variables generated by this encoding only contain 0 and 1, and different types of data are stored in the vertical space.
[0061] Ordinal data preprocessing: Mapping coding is used to assign a code between [0, n-1] to the n unique values of the variable and convert them into continuous numerical variables. The values are sorted according to their order and converted into numerical values of corresponding priority. The mapped result also reflects this priority in numerical value.
[0062] For example, the highway where the bridge is located is divided into [level 1, level 2, level 3, level 4]. After mapping, each level will be assigned a number between [0, 3] and arranged in priority: level 1 > level 2 > level 3 > level 4.
[0063] (4) Dimensional unification: Standardization methods are used to unify data of different dimensions into the same range. The bridge inspection data in this embodiment includes multiple different numerical data such as traffic volume, construction years, bridge length, etc., and these different variables often have different dimensions. If these data are not dimensioned and directly input into the model, the model may be overly biased towards learning variables with larger values, thereby ignoring the training of data with smaller values, affecting the effect of the model. In this embodiment, numerical features are model features that directly use numbers to represent feature properties, such as traffic volume, bridge age, etc. In order to eliminate the impact of different dimensions on the model, it is necessary to normalize the numerical features.
[0064] In this embodiment, the standardization method is used to unify the data of different dimensions into the same range. The standardization method is to linearly transform the data according to the mean and standard deviation of its characteristics, so that the mean of the data is 0 and the standard deviation is 1. The calculation formula of standardization is as follows:
[0065] For features , the formula for standardization is:
[0066] ;
[0067] in:
[0068] is the standardized eigenvalue;
[0069] is the original eigenvalue;
[0070] is the mean of the eigenvalues;
[0071] is the standard deviation of the eigenvalues.
[0072] This method subtracts the mean from the feature value and then divides it by its standard deviation to ensure that all features have a mean of 0 and a standard deviation of 1.
[0073] Step S102: Feature screening. The Gini coefficient of each feature of the bridge inspection data set is calculated using the random forest algorithm. The features are ranked according to the Gini coefficient, the top S features in the importance ranking are determined, and the Spearman correlation coefficients of the top S features are calculated. A feature is selected from the high-correlation feature pairs whose Spearman correlation coefficients are greater than the set threshold to exclude, reduce multicollinearity in the data, and finally obtain the screened data set.
[0074] The bridge inspection data of this embodiment mainly includes basic bridge information, bridge technical condition rating information, and bridge disease information. In the bridge technical condition prediction method based on machine learning, it is not appropriate to directly use the entire bridge inspection data set as the model input. A feature set that is too small will cause the model to be unable to fully express the problem-related features, while a feature set that is too large will increase the computational cost and model learning difficulty, and may cause overfitting or non-convergence problems. Therefore, in order to determine the key features and reduce the complexity of the model, this embodiment first uses the random forest method to evaluate the importance of the features, that is, the tree-based method in the random forest algorithm is used to calculate the Gini coefficient of each feature in the prediction model; then, the features are sorted in order from large to small according to the Gini coefficient, and the most important features of the top S in importance are determined; finally, the Spearman correlation coefficient is used to calculate the correlation coefficient between the top S features in the importance ranking in the bridge inspection data, and one of the high-correlation features whose Spearman correlation coefficient is greater than the set threshold is excluded to avoid overfitting the model to the data and reduce the impact of noise on the model, making the model more robust and reliable.
[0075] Random forest is an ensemble learning method that improves prediction performance by building multiple decision tree models and combining their prediction results. For feature importance ranking, random forest evaluates the importance of each feature by calculating its Gini coefficient. This example selects the top 14 features in terms of importance. The feature importance ranking results are shown in Figure 2. Figure 3 shown.
[0076] This step calculates the Spearman correlation coefficient and sets a threshold to exclude high correlation features. Spearman correlation coefficient It indicates the degree of correlation between two variables. The calculation formula is as follows:
[0077] ;
[0078] in, represents the gap between two feature levels, Indicates the number of samples. Considering that the number of features in this embodiment is small, the threshold is set to 0.9, and the feature correlation calculation results are as follows: Figure 4 shown.
[0079] Step S103: Data balancing. This step introduces the SMOTETomek method to perform data balancing on the data set after feature screening in step S102, and to increase minority class samples to obtain a balanced data set. The SMOTETomek method uses the SMOTE algorithm to generate synthetic samples, and then uses the Tomek Links method to remove majority class samples around minority class samples to improve the balance of the data set.
[0080] The SMOTETomek method is a comprehensive technology for dealing with unbalanced data sets. It combines the SMOTE (Synthetic Minority Over-sampling Technique) and Tomek Links methods. First, the SMOTE algorithm generates synthetic samples between minority class samples to increase their number, thereby balancing the data set. Specifically, the SMOTE algorithm selects a sample from the minority class sample, and then generates a new synthetic sample based on the difference between its nearest neighbor samples and a random value. This process makes the boundaries between minority class samples more blurred, which helps to improve the model's ability to identify minority class samples. Next, the Tomek Links method is used to remove similar but different class pairs of samples in the data set to reduce overlapping and redundant samples in the data set. In practical applications, first, you need to set the parameters in the SMOTETomek method, including the number of synthetic samples and the number of nearest neighbors in the SMOTE algorithm, as well as the threshold in TomekLinks. Then, the SMOTE algorithm is used to generate synthetic samples, and the majority class samples are removed according to the results of Tomek Links until the data set is balanced. This process ensures that the model learns the characteristics of minority class samples better and reduces the noise and redundant information in the data set. The resulting balanced data set can improve the performance and accuracy of the classifier, making it better suited to the classification task of imbalanced data.
[0081] Taking the bridge technical condition level shown in Table 1 as an example, the number of samples of the five types of bridges is far less than the number of samples of other types, which will have a certain impact on the experimental results. Therefore, the SMOTETomek method is used to balance the data set, in which the SMOTE algorithm is set to automatically select the number of synthetic samples, and the number of nearest neighbors (k_neighbors) is set to 6. The threshold in Tomek Links is set to 0.5, and the Euclidean distance is used to calculate the distance between samples. The balanced results are shown in Table 1. While maintaining a relatively balanced data distribution, the characteristics of the positive samples can be effectively mined to improve the classification performance of the classifier.
[0082] Table 1 Original data of bridge technical condition level and data after balance processing
[0083] Bridge Grade Raw data After balancing the data Category I 1306 1306 Category II 526 1304 Three categories 425 1273 Four categories 40 1259 Five categories 7 1240 .
[0084] Step S104: Building an ensemble learning model: In this step, an XGBoost ensemble learning method is used to build an ensemble learning model, and the ensemble learning model is used to predict the technical condition level of the bridge.
[0085] This embodiment firstly performs parameter tuning of the XGBoost model through a random search algorithm. Then, the decision tree model is iteratively trained based on the balanced data set obtained in step S103, and the objective function is optimized to reduce the model residual. The objective function is a multiclass logarithmic loss function (Multiclass Log Loss), and its formula is as follows:
[0086] ;
[0087] in, represents the total loss function; represents the sample size; Indicates The loss of samples; Indicates The actual labels of the samples; Indicates The predicted value of samples; Indicates the number of trees; Indicates The regularization term for the number of trees.
[0088] For multi-classification problems, assuming there is categories, tags belong , predicted value Indicates samples belong to the category The probability of multi-classification logarithmic loss function can be expressed as:
[0089] ;
[0090] in, represents the indicator function, when The value is 1 when it is, otherwise it is 0; Indicates Samples are predicted as categories probability.
[0091] The regularization term is similar to the binary classification problem and is used to control the complexity of the model and prevent overfitting. The formula for the regularization term is as follows:
[0092] ;
[0093] in, The penalty coefficient representing the number of leaf nodes of the tree is set to 0 in this embodiment; Indicates the number of leaf nodes in the tree; express The weight of the regularization term is set to 1 in this embodiment; Represents a leaf node The weight of express The weight of the regularization term is set to 0 in this embodiment.
[0094] Then, the optimized decision tree model is integrated into the XGBoost model. In the integration process, the prediction results of multiple decision tree models are integrated through the gradient boosting process to obtain the final integrated learning model. The final integrated learning model can accurately predict the technical condition level of the bridge, improve the accuracy and stability of the bridge technical condition prediction, and effectively evaluate the technical condition of the bridge.
[0095] Furthermore, after step S104, the following steps are also included:
[0096] Step S105: Evaluate and verify the integrated learning model using evaluation indicators, where the evaluation indicators include but are not limited to accuracy, precision, recall and F1 score.
[0097] The prediction results of each evaluation index in this embodiment are: accuracy rate is 0.873, precision rate is 0.871, recall rate is 0.871, and F1 score is 0.871. In addition, the confusion matrix and ROC curve of the prediction results are as follows: Figure 5 and Figure 6 shown.
[0098] like Figure 7 As shown, another embodiment of the present invention provides a bridge technical condition prediction system based on machine learning, which includes a data preprocessing module 100, a feature screening module 200, a data balance processing module 300 and an integrated learning model construction module 400.
[0099] The data preprocessing module 100 first obtains the original data of multiple bridges from the bridge inspection database. The obtained original data includes but is not limited to basic bridge data, bridge technical condition rating data and bridge disease data, etc., and then preprocesses the original data, including outlier removal, missing value processing, data type unification and dimension unification. After preprocessing, a bridge inspection data set is obtained.
[0100] The original data in this embodiment can be obtained from the bridge inspection database, which stores the inspection data of multiple bridges, such as the inspection data of 2,314 bridges in a province in southwest my country, mainly including basic information of bridges, rating information of bridge technical conditions, and information of bridge diseases. For the prediction of the technical condition of bridges, it is necessary to process multiple features including numerical data (such as traffic volume, rating, bridge length) and textual data (such as bridge type, rating, structure type). Therefore, feature selection is required before prediction, and feature data is processed, including unifying the data format and deciding whether to unify the dimension based on the nature of the algorithm.
[0101] The data preprocessing module 100 includes a removal submodule, a filling submodule, a data type unification submodule and a dimension unification submodule. The functions of each submodule are described in detail below.
[0102] The elimination submodule is used to identify and remove outliers in the data using statistical methods. In this embodiment, the elimination submodule uses the Z-score method to identify and remove outliers in the original data. Specifically, for a certain original value in the original data , the sub-module is eliminated by calculating the mean of the corresponding features and standard deviation , data points whose deviation from the mean exceeds a certain threshold are considered outliers and removed.
[0103] ;
[0104] in, is the standard score, which represents the distance of the data point from the mean in standard deviation units. If or ,but are judged as outliers, among which is the set threshold.
[0105] The filling submodule is used to fill the missing values of the removed data using the linear interpolation method. The linear interpolation method is a method to estimate the missing values by the linear relationship between known data points. For multidimensional data, linear interpolation can be performed on each dimension separately. Suppose a data point is missing in the original data set , linear interpolation can be performed using the known data points around the data point.
[0106] Assumptions Missing the The value of the dimension can be obtained by Nearest Neighbor to impute missing values. The linear interpolation formula can be written as:
[0107] ;
[0108] in, is a known data point In the The value of the dimension, Is a missing value In the The estimated value of the dimension, yes arrive In this way, by applying linear interpolation in each dimension, we can estimate the approximate values of missing values in multidimensional data.
[0109] The data type unification submodule is used to convert the data type of the filled data into the same format using one-hot encoding and mapping encoding methods according to the data attributes. One-hot encoding converts categorical data into binary vector representation, and mapping encoding maps categorical data to integer values.
[0110] The data in this embodiment is divided into numerical data and nominal data. Numerical features refer to features that are expressed in numerical form in the data set, rather than categories or labels, such as traffic volume, bridge age, etc. Nominal data includes labeled data and ordinal data: labeled data indicates that there is no meaning of size between feature values, such as structure type, superstructure material, design load, etc.; ordinal data indicates that feature values have meaning of size, such as highway grade, assessment grade maintenance time, etc. Specific processing is required for different types of nominal data features.
[0111] Label data preprocessing: The data type unification submodule uses one-hot encoding to convert label data into n-dimensional 0-1 variables, avoiding the priority problem between data and solving the problem that classifiers are not good at processing attribute data. The variables generated by this encoding only contain 0 and 1, and different types of data are stored in the vertical space.
[0112] Ordinal data preprocessing: The data type unification submodule uses mapping coding to assign a code between [0, n-1] to the n unique values of the variable and convert it into a continuous numerical variable. The values are sorted according to their order and converted into numerical values of corresponding priority. The mapped result also reflects this priority in numerical value.
[0113] For example, the highway where the bridge is located is divided into [level 1, level 2, level 3, level 4]. After mapping, each level will be assigned a number between [0, 3] and arranged in priority: level 1 > level 2 > level 3 > level 4.
[0114] The dimension unification submodule is used to unify data of different dimensions into the same range by using a standardized method. The bridge inspection data of this embodiment includes multiple different numerical data such as traffic volume, construction years, bridge length, etc., and these different variables often have different dimensions. If these data are not dimensionally processed and directly input into the model, the model may be overly biased towards learning variables with larger values, thereby ignoring the training of data with smaller values, affecting the effect of the model. In this embodiment, the numerical feature is a model feature that directly uses numbers to represent the characteristic properties, such as traffic volume, bridge age, etc. In order to eliminate the influence of different dimensions on the model, it is necessary to normalize the numerical features.
[0115] In this embodiment, the dimension unification submodule uses a standardization method to unify data of different dimensions into the same range. The standardization method is to linearly transform the data according to the mean and standard deviation of its characteristics so that the mean of the data is 0 and the standard deviation is 1. The calculation formula for standardization is as follows:
[0116] For features , the formula for standardization is:
[0117] ;
[0118] in:
[0119] is the standardized eigenvalue;
[0120] is the original eigenvalue;
[0121] is the mean of the eigenvalues;
[0122] is the standard deviation of the eigenvalues.
[0123] This method subtracts the mean from the feature value and then divides it by its standard deviation to ensure that all features have a mean of 0 and a standard deviation of 1.
[0124] The feature screening module 200 uses the random forest algorithm to calculate the Gini coefficient of each feature of the bridge detection data set, sorts the features according to the Gini coefficient, determines the top S features in the importance sorting, and calculates the Spearman correlation coefficients of the top S features. A feature is selected from the high-correlation feature pairs whose Spearman correlation coefficients are greater than a set threshold and excluded to obtain a screened data set.
[0125] The bridge inspection data of this embodiment mainly includes basic bridge information, bridge technical condition rating information, and bridge disease information. In the bridge technical condition prediction system based on machine learning, it is not appropriate to directly use the entire bridge inspection data set as the model input. A feature set that is too small will cause the model to be unable to fully express the problem-related features, while a feature set that is too large will increase the computational cost and model learning difficulty, and may cause overfitting or non-convergence problems. Therefore, in order to determine the key features and reduce the complexity of the model, the feature screening module 200 first uses the random forest method to evaluate the importance of the features, that is, the tree-based method in the random forest algorithm is used to calculate the Gini coefficient of each feature in the prediction model; then, the features are sorted in order from large to small according to the Gini coefficient, and the most important features of the top S in importance are determined; finally, the Spearman correlation coefficient is used to calculate the correlation coefficient between the top S features in the importance ranking in the bridge inspection data, and one of the high-correlation features whose Spearman correlation coefficient is greater than the set threshold is excluded to avoid overfitting the model to the data and reduce the impact of noise on the model, making the model more robust and reliable.
[0126] Random forest is an ensemble learning method that improves prediction performance by building multiple decision tree models and combining their prediction results. For feature importance ranking, random forest evaluates the importance of each feature by calculating the Gini coefficient. This example selects the top 14 features in importance ranking.
[0127] The feature screening module 200 calculates the Spearman correlation coefficient and sets a threshold to exclude high correlation features. The calculation formula of the Spearman correlation coefficient can be found in the formula in the above method embodiment, which will not be repeated here.
[0128] The data balancing processing module 300 introduces the SMOTETomek method to perform data balancing processing on the data set screened by the feature screening module 200 to obtain a balanced data set. The SMOTETomek method uses the SMOTE algorithm to generate synthetic samples, and then uses the Tomek Links method to remove the majority class samples around the minority class samples to improve the balance of the data set.
[0129] The SMOTETomek method is a comprehensive technology for processing unbalanced data sets, which combines the SMOTE (Synthetic Minority Over-sampling Technique) and Tomek Links methods. First, the SMOTE algorithm balances the data set by generating synthetic samples between minority class samples to increase their number. Specifically, the SMOTE algorithm selects a sample from the minority class samples, and then generates a new synthetic sample based on the difference between its nearest neighbor samples and a random value. This process makes the boundaries between minority class samples more blurred, which helps to improve the model's recognition ability for minority class samples. Next, the Tomek Links method is used to eliminate similar but different class sample pairs in the data set to reduce overlapping and redundant samples in the data set. The data balancing processing module 300 includes a parameter setting submodule and a processing submodule. In practical applications, the parameter setting submodule first needs to set the parameters in the SMOTETomek method, including the number of synthetic samples and the number of nearest neighbors in the SMOTE algorithm, as well as the threshold in Tomek Links. Then, the processing submodule generates synthetic samples through the SMOTE algorithm, and removes the majority class samples according to the results of Tomek Links until the data set is balanced. This process can ensure that the model learns the characteristics of minority class samples better and reduces the noise and redundant information in the data set. The final balanced data set can improve the performance and accuracy of the classifier, making it better adapted to the classification task of unbalanced data. Optionally, when the parameter setting submodule performs parameter setting, the SMOTE algorithm can be set to automatically select the number of synthetic samples, the number of nearest neighbors (k_neighbors) is set to 6, the threshold in TomekLinks is set to 0.5, and the Euclidean distance is used to calculate the distance between samples. The data balance processing module 300 can effectively mine the characteristics of positive class samples while maintaining a relatively balanced data distribution, thereby improving the classification performance of the classifier.
[0130] The integrated learning model construction module 400 uses the XGBoost integrated learning method to construct an integrated learning model, and the integrated learning model is used to predict the technical condition level of the bridge.
[0131] The integrated learning model construction module 400 of this embodiment firstly performs parameter tuning of the XGBoost model through a random search algorithm. Then, the decision tree model is iteratively trained based on the balanced data set obtained by the data balancing processing module 300, and the objective function is optimized to reduce the model residual. The objective function is a multi-class logarithmic loss function (Multiclass Log Loss), and its formula is as follows:
[0132] ;
[0133] in, represents the total loss function; represents the sample size; Indicates The loss of samples; Indicates The actual labels of the samples; Indicates The predicted value of samples; Indicates the number of trees; Indicates The regularization term for the number of trees.
[0134] For multi-classification problems, assuming there is categories, tags belong , predicted value Indicates samples belong to the category The probability of multi-classification logarithmic loss function can be expressed as:
[0135] ;
[0136] in, represents the indicator function, when The value is 1 when it is, otherwise it is 0; Indicates Samples are predicted as categories probability.
[0137] The regularization term is similar to the binary classification problem and is used to control the complexity of the model and prevent overfitting. The formula for the regularization term is as follows:
[0138] ;
[0139] in, The penalty coefficient representing the number of leaf nodes of the tree is set to 0 in this embodiment; Indicates the number of leaf nodes in the tree; express The weight of the regularization term is set to 1 in this embodiment; Represents a leaf node The weight of express The weight of the regularization term is set to 0 in this embodiment.
[0140] Then, the optimized decision tree model is integrated into the XGBoost model. In the integration process, the prediction results of multiple decision tree models are integrated through the gradient boosting process to obtain the final integrated learning model. The final integrated learning model can accurately predict the technical condition level of the bridge, improve the accuracy and stability of the bridge technical condition prediction, and effectively evaluate the technical condition of the bridge.
[0141] Furthermore, the system also includes:
[0142] The evaluation and verification module is used to evaluate and verify the integrated learning model using evaluation indicators, where the evaluation indicators include but are not limited to accuracy, precision, recall and F1 score.
[0143] The specific implementation of each module in this embodiment can refer to the above-mentioned bridge technical condition prediction method embodiment, which will not be described one by one here; it should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0144] In summary, the present invention provides a method and system for predicting the technical condition of bridges based on machine learning. Through the steps of data preprocessing, feature screening, importance ranking, data balance processing and integrated learning, a reliable bridge status prediction model, namely an integrated learning model, is constructed, which provides important decision support for bridge management and maintenance. The present invention adopts advanced technologies such as machine learning, combines a variety of data processing methods and model building techniques, can effectively predict the technical condition of bridges, improves the prediction accuracy and stability, and provides an important scientific basis for bridge management and maintenance. Compared with traditional methods, the present invention has higher efficiency and better prediction performance, and has good application prospects and economic benefits.
[0145] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which shall fall within the protection scope of the present invention.
Claims
1. A bridge technical condition prediction method based on machine learning, characterized in that: The following steps are involved: Step S101: obtaining the original data of multiple bridges from the bridge inspection database, including basic bridge data, bridge technical condition rating data and bridge disease data, and preprocessing the original data to obtain a bridge inspection data set, wherein the preprocessing process includes outlier removal, missing value processing, data type unification and dimension unification; the process of preprocessing the original data includes the following steps: The Z-score method was used to identify and remove outliers from the original data to obtain the eliminated data; The missing values of the eliminated data are filled using the linear interpolation method to obtain the filled data; According to the data attributes, the data type of the filled data is converted by using the one-hot encoding and mapping encoding methods to obtain data with unified data types; The standardization method is used to unify data of different dimensions into the same range; Step S102: using the random forest algorithm to calculate the Gini coefficient of each feature of the bridge detection data set, ranking the features according to the Gini coefficient, determining the top S features in the importance ranking, and calculating the Spearman correlation coefficients of the top S features, selecting a feature from the high-correlation feature pairs whose Spearman correlation coefficients are greater than a set threshold to exclude, and obtaining a screened data set; Step S103: using the SMOTETomek method to perform data balancing on the screened data set to obtain a balanced data set; step S103 includes the following steps: Set the parameters in the SMOTETomek method, including the number of synthetic samples of the SMOTE algorithm, the number of nearest neighbors, and the threshold of the Tomek Links algorithm; Generate synthetic samples through the SMOTE algorithm, and remove the majority class samples according to the results of Tomek Links until the data set is balanced; Step S104: After tuning the parameters of the XGBoost model through the random search algorithm, the decision tree model is iteratively trained based on the balanced data set, and the objective function is optimized. The optimized decision tree model is integrated into the XGBoost model. During the integration process, the prediction results of multiple decision tree models are integrated through gradient boosting to obtain the final integrated learning model, which is used to accurately predict the technical condition level of the bridge.
2. The method for predicting bridge technical conditions based on machine learning according to claim 1 is characterized in that: The following steps are also included: Step S105: Evaluate and verify the integrated learning model using evaluation indicators, where the evaluation indicators include accuracy, precision, recall and F1 score.
3. A bridge technical condition prediction method based on machine learning according to claim 1 or 2, characterized in that: The objective function is a multi-classification logarithmic loss function, and the formula is as follows: Where L(φ) represents the total loss function; n represents the number of samples; represents the loss of the i-th sample; y i represents the actual label of the i-th sample; represents the predicted value of the i-th sample; K represents the number of trees; Q(f k ) represents the regularization term of the k-th tree; For multi-classification problems, suppose there are C categories and the label y i Belongs to {0, 1,..., C-1}, predicted value represents the probability that the i-th sample belongs to category j, then the multi-classification logarithmic loss function is expressed as: Among them, 1(y i =j) represents the indicator function, when y i =j, the value is 1, otherwise it is 0; Represents the probability that the i-th sample is predicted to be category j; The regularization term formula is as follows: Among them, γ represents the penalty coefficient of the number of leaf nodes of the tree; T represents the number of leaf nodes of the tree; λ represents the weight of the L2 regularization term; w j represents the weight of leaf node j; α represents the weight of the L1 regularization term.
4. The method for predicting bridge technical conditions based on machine learning according to claim 3 is characterized in that: The penalty coefficient γ of the number of leaf nodes of the tree is set to 0; the weight λ of the L2 regularization term is set to 1; and the weight α of the L1 regularization term is set to 0.
5. A bridge technical condition prediction system based on machine learning, characterized in that: include: A data preprocessing module (100) is used to obtain the original data of multiple bridges from a bridge inspection database, including basic bridge data, bridge technical condition rating data and bridge disease data, and preprocess the original data to obtain a bridge inspection data set, wherein the preprocessing process includes outlier removal, missing value processing, data type unification and dimension unification; The data preprocessing module (100) comprises: The elimination submodule is used to identify and remove outliers from the original data using the Z-score method to obtain the eliminated data; The filling submodule is used to fill the missing values of the removed data using a linear interpolation method to obtain the filled data; The data type unification submodule is used to convert the data type of the filled data using the one-hot encoding and mapping encoding methods according to the data attributes to obtain data with unified data types; The dimension unification submodule is used to unify data of different dimensions into the same range by using a standardization method; A feature screening module (200) is used to calculate the Gini coefficient of each feature of the bridge detection data set using a random forest algorithm, rank the features according to the Gini coefficient, determine the top S features in the importance ranking, and calculate the Spearman correlation coefficients of the top S features, and select a feature from the high-correlation feature pairs whose Spearman correlation coefficients are greater than a set threshold to exclude, thereby obtaining a screened data set; The data balancing processing module (300) is used to perform data balancing processing on the screened data set using the SMOTETomek method to obtain a balanced data set; the data balancing processing module (300) comprises: The parameter setting submodule is used to set the parameters in the SMOTETomek method, including the number of synthetic samples of the SMOTE algorithm, the number of nearest neighbors, and the threshold of the Tomek Links algorithm; The processing submodule is used to generate synthetic samples through the SMOTE algorithm and remove the majority class samples according to the results of Tomek Links until the data set is balanced; The integrated learning model building module (400) is used to iteratively train the decision tree model based on the balanced data set after tuning the parameters of the XGBoost model through a random search algorithm, and optimize the objective function, and integrate the optimized decision tree model into the XGBoost model. During the integration process, the prediction results of multiple decision tree models are integrated through gradient boosting to obtain a final integrated learning model, which is used to accurately predict the technical condition level of the bridge.
6. The bridge technical condition prediction system based on machine learning according to claim 5 is characterized in that: Also includes: The evaluation and verification module is used to evaluate and verify the integrated learning model using evaluation indicators, where the evaluation indicators include accuracy, precision, recall rate and F1 score.
