Bridge cluster post-earthquake rapid evaluation method based on improved XGBoost
By improving the XGBoost model combined with Latin hypercube sampling and SMOTE algorithm, the time-consuming and labor-intensive problem of traditional bridge post-seismic evaluation methods is solved, and the fast and accurate safety status evaluation of bridge clusters is achieved, providing efficient decision-making support.
Patent Information
- Application Number
- CN202411773567.2
- 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
The traditional fast post-seismic safety assessment method of bridges is time-consuming and labor-intensive, and it is difficult to meet the demand for rapid assessment in earthquake disasters. Especially in bridge clusters, how to quickly and efficiently classify post-seismic states has become an urgent problem.
A fast post-seismic evaluation method based on improved XGBoost was adopted to generate uniformly distributed parameter samples through Latin hypercube sampling, and key response features were extracted in combination with finite element analysis, and the data set category distribution was balanced using the SMOTE algorithm, and finally the rapid classification evaluation of the post-seismic state of the bridge was achieved through the optimized XGBoost model.
It realizes efficient and accurate assessment of the safety status of bridges after earthquakes, significantly improves the accuracy and efficiency of the classification model. It has higher reliability and practicality than traditional methods, and can quickly output the safety classification label of bridges after earthquakes, providing a scientific basis for post-disaster decision-making.
Smart Images

Figure CN119720757A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a bridge cluster post-earthquake rapid assessment method based on improved XGBoost, belonging to the technical field of measuring bridge damage degree and post-earthquake safety assessment. Background Art
[0002] Rapid safety assessment of bridges after an earthquake is an important part of earthquake-resistant engineering research. It aims to quickly determine the safety status of bridges after an earthquake and provide a scientific basis for post-disaster rescue and traffic recovery. As a key node in the transportation system, the post-earthquake status of bridges directly affects the efficiency of rescue and the recovery capacity of the transportation network. Traditional assessment methods mainly rely on on-site detection and manual judgment. Although these methods are reliable, they are time-consuming and labor-intensive and cannot meet the needs of rapid assessment in earthquake disasters. The response characteristics (such as displacement, acceleration, curvature, etc.) and structural parameters (such as material properties, geometric dimensions, etc.) of bridges are crucial for post-earthquake assessment. However, due to the diversity of bridge design and earthquake input, these characteristics are highly nonlinear and random, making it difficult for traditional methods to balance efficiency and accuracy. Especially when there are a large number of regional bridges, how to quickly and efficiently classify the post-earthquake status of bridge clusters has become an urgent problem to be solved. Data-driven machine learning methods provide a new solution for rapid post-earthquake assessment of bridges. By establishing a mapping relationship between bridge parameters and post-earthquake safety status, rapid classification and prediction of post-earthquake status can be achieved. However, uneven data distribution and model parameter selection often affect the accuracy of classification results. For example, insufficient samples of the minority class will lead to the model's bias towards the majority class and reduce the recognition ability of the minority class. In addition, how to generate uniformly distributed samples of bridge model parameters is also a key issue in bridge evaluation.
[0003] Therefore, a bridge cluster post-earthquake rapid safety assessment method based on improved XGBoost can be proposed. This method generates uniformly distributed parameter samples through Latin hypercube sampling, extracts key response features (such as curvature and peak acceleration) using finite element analysis, and combines the SMOTE algorithm to balance the distribution of data set categories. Finally, the optimized XGBoost model is used to achieve rapid classification and assessment of the post-earthquake status of bridges, providing efficient and accurate technical support for post-disaster decision-making. Summary of the invention
[0004] In view of the above problems, the present invention proposes a bridge cluster post-earthquake rapid assessment method based on improved XGBoost. The method expands the key modeling parameters of the bridge through Latin hypercube sampling to ensure the uniform distribution of parameter samples in space, and establishes a bridge finite element model based on the expanded parameter samples, performs moment curvature analysis and nonlinear time history analysis, and thus extracts output parameters related to bridge behavior (such as curvature and peak acceleration). The output parameters are combined with the preset safety level standard to define the safety status label of the bridge, and the classification of the safety status of the bridge after the earthquake is realized by constructing a data set containing bridge parameter samples, output parameters and classification labels. In view of the problem of uneven distribution of categories in the training set, the present invention introduces the SMOTE algorithm to expand the minority category samples and balance the category distribution, thereby generating a new training set. Subsequently, the improved XGBoost model is used to train the classification model of the expanded data set. By adjusting the SMOTE sampling ratio combination and model parameters, and taking the overall classification accuracy of the test set as the optimization target, the best sampling ratio combination and model parameters are selected to determine the final model. Based on the trained XGBoost model, the bridge parameters and seismic motion data are used as input to quickly output the bridge post-earthquake safety classification label. The method of the present invention can efficiently and accurately realize the rapid assessment of the safety status of bridges after earthquakes, and provide a scientific basis for the emergency repair of bridges and traffic restoration after earthquakes. At the same time, the present invention uses the SMOTE algorithm to solve the problem of uneven distribution of sample categories, and the improved XGBoost model significantly improves the accuracy and efficiency of classification, which has higher reliability and practicality than traditional methods.
[0005] The above purpose is achieved through the following technical solutions:
[0006] A bridge cluster post-earthquake rapid assessment method based on improved XGBoost, the method comprises the following steps:
[0007] S1, bridge cluster classification and parameter sample generation: classify the bridge clusters in the selected area, select a bridge type as the research object, determine the range and distribution type of key modeling parameters according to the modeling requirements of the selected bridge type, and use the Latin hypercube sampling method to expand the parameter samples to ensure the uniform distribution of samples in the parameter space;
[0008] S2, finite element model establishment and analysis: based on the parameter samples generated by the Latin hypercube sampling method in step S1, a bridge finite element model is established, and the moment curvature analysis and nonlinear time history analysis are performed on the bridge finite element model to extract output parameters (curvature and peak acceleration) related to the bridge behavior to provide input data for subsequent classification;
[0009] S3, label definition: according to the output parameters related to the bridge behavior extracted in step S2, the bridges are divided into three categories according to the preset safety level standards, corresponding to different safety states, as bridge classification labels;
[0010] S4, data expansion: The parameter samples generated by the expansion of step S1 using the Latin hypercube sampling method, the peak acceleration output by step S2, and the bridge classification label of S3 together form a data set. The data set is divided into a training set and a test set in a ratio of 7:3. The SMOTE algorithm is applied to each type of sample in the training set, and it is expanded in proportion to ensure the balance of the category distribution. The various types of samples expanded by the SMOTE algorithm are combined into a new training set;
[0011] S5, model training and optimization: Use the XGBoost model to train the classification model of the new training set obtained in step S4, and adjust the sampling ratio combination and XGBoost model parameters; take the overall classification accuracy of the test set as the optimization goal, select the best sampling ratio combination and XGBoost model parameters, and finally determine the XGBoost model;
[0012] S6, using the XGBboost model determined in step S5, taking the bridge parameters and the ground motion data as input, and outputting classification labels as post-earthquake evaluation indicators / evaluation basis.
[0013] Furthermore, the bridges are divided into three categories according to the preset safety level standard in step S3, and the specific steps are as follows:
[0014] S311: Use standard ATC-13 to classify the post-earthquake safety level of bridges into three levels: green, yellow and red;
[0015] S312: Make a judgment based on the output parameters related to the bridge behavior extracted in step S2: yield curvature, spalling curvature and maximum curvature; when the maximum curvature is less than the yield curvature, it is marked as green; when the maximum curvature is between the yield curvature and the spalling curvature, it is marked as yellow; when the maximum curvature is greater than the spalling curvature, it is marked as red.
[0016] Furthermore, the step S4 described in which each type of sample in the training set is applied with the SMOTE algorithm and expanded in proportion is to gradually expand the three types of labeled samples divided in the training set in proportions of 1.1, 1.2, 1.3, ... 2.0, respectively, and generate a corresponding number of synthetic samples by the SMOTE method to expand the size of the data set of each category. The specific steps are:
[0017] S411, for each sample in each category of label samples, calculate its k nearest neighbor samples in the feature space;
[0018] S412, randomly select a neighbor point among the k nearest neighbor samples as a reference point for generating a new sample;
[0019] S413, randomly interpolate between the original sample and the selected neighbor point to generate a new sample, and the interpolation formula is:
[0020] X new =X i +λ·(X j -X i )
[0021] Among them, X i is the original sample, X j is a neighbor sample, λ is a random weight between 0 and 1, which is used to control the position of the new sample;
[0022] S414, repeating the above steps for each sample according to the target expansion ratio requirement until the required number of new samples is generated;
[0023] S415, merging the generated new samples with the original training data set to form an expanded balanced data set;
[0024] S416, for each category sample in the training set, execute the above steps one by one according to the set expansion ratio range to generate a data set with different sampling ratio combinations.
[0025] Furthermore, the XGBoost model described in step S5 is used to perform classification model training on the new training set obtained in step S4, and the specific steps are:
[0026] S511, importing the data set in step S4 and checking the integrity of the format and content to ensure that the data is not damaged or missing;
[0027] S512, perform quality checks on the target variable y and the feature variable X, and handle missing values and inconsistent items;
[0028] S513, encode the target variable category into a numerical form, using One-Hot Encoding:
[0029] yencode d =OneHotEncoded(y)
[0030] S514, randomly shuffle the data set to eliminate sequential interference:
[0031] X, y = shuffle(X, y)
[0032] S515, dividing the data randomly shuffled in step S514 into a training set and a test set according to a ratio r:
[0033] Train,Test=split(X,y,ratio=r)
[0034] S516, ensure that the target variable category distribution is consistent after division:
[0035] P Train,c =P Test,c (c)
[0036] S517, using the SMOTE algorithm to balance the training set category distribution obtained in step S515, given the minority class sample x minority and its neighboring samples x neighbo , generate new samples x new :
[0037] x new =x minority +λ·(x neighbor -x minority )
[0038] Combine the training set with all new samples into a new enhanced training set;
[0039] S518, check the enhanced training set to ensure that the features match the category labels;
[0040] S519, initialize the XGBoost model, set the number of trees, maximum depth, learning rate, subsample ratio and regularization parameters;
[0041] S520, train the XGBoost model using the enhanced training set:
[0042]
[0043] where y i,m is the true category of sample i, P i,m is the predicted probability of category m, N represents the total number of samples, and M represents the total number of categories;
[0044] S521, set early stopping conditions to avoid overfitting and monitor the loss on the validation set:
[0045]
[0046] in represents the loss on the validation set in round t+1, where represents the loss on the validation set in the tth round, and k represents the number of rounds in which the validation loss is allowed to remain unchanged for k consecutive times; S522, adjust the XGBoost hyperparameters, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters;
[0047] S523, use grid search to optimize parameter combinations:
[0048]
[0049] Where θ represents the hyperparameter combination, represents the loss function value of a certain hyperparameter combination θ on the validation set, θ best represents the hyperparameter combination with the lowest validation set loss in the grid search;
[0050] S524, different from the traditional grid search, in the present invention, the optimal parameter combination is finally selected according to the classification accuracy of the test set, and the parameter combination with the highest classification accuracy of the test set is used as the parameters of the final XGBoost model.
[0051] Accuracy calculation formula:
[0052]
[0053] in:
[0054] TP (True Positive): The number of samples whose true category is positive and whose model prediction is also positive;
[0055] TN (True Negative): The number of samples whose true category is negative and whose model prediction is also negative;
[0056] FP (False Positive): The number of samples where the true category is negative but the model incorrectly predicts it as positive;
[0057] FN (False Negative): The number of samples whose true category is positive but the model incorrectly predicts them to be negative;
[0058] S525, applying the final XGBoost model to the test set and generating prediction results;
[0059] S526, calculate the confusion matrix and obtain the classification performance index:
[0060]
[0061] S527, compare the test set performance of the original data and the enhanced data to evaluate the enhancement effect;
[0062] S528, export the final XGBoost model and parameter configuration:
[0063]
[0064] in Represents the final trained model;
[0065] S529, records key experimental results, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters.
[0066] Furthermore, the confusion matrix described in step S526 has the following specific information:
[0067] For three-class classification problems, the confusion matrix is usually a 3x3 matrix, plus the row and column accuracies to form a 4x4 matrix; in the 4x4 matrix: the rows represent the actual categories, the columns represent the predicted categories; the elements on the diagonal represent the number of correct classifications of a certain category; the off-diagonal elements represent misclassifications.
[0068] Beneficial Effects
[0069] The present invention adopts a bridge cluster post-earthquake rapid assessment method based on improved XGBoost, so that the method can efficiently and accurately complete the assessment of the safety status of bridges after earthquake. By introducing Latin hypercube sampling technology, the key modeling parameter samples are expanded and evenly distributed, ensuring the comprehensive coverage of data in the parameter space, and providing a solid foundation for the finite element modeling and subsequent analysis of bridges. At the same time, by analyzing the moment curvature and nonlinear time-history response of the bridge finite element model, the characteristic output parameters that can accurately reflect the behavior of the bridge are extracted, and combined with the safety level standard, the safety status categories of the bridge are scientifically divided, providing a clear classification basis for post-earthquake assessment. The SMOTE algorithm is further used to expand the data, fundamentally solving the classification bias problem caused by category imbalance. Combined with the improved XGBoost model, by optimizing the sampling ratio and model parameters, the classification accuracy of the test set is taken as the goal, and the accuracy and robustness of the classification model are greatly improved. Compared with traditional methods, the present invention not only significantly reduces the complexity and computational cost of data modeling, but also enhances the model's adaptability to non-uniform data distribution, making the post-earthquake assessment results more scientific and reliable.
[0070] In addition, this method starts from the actual needs of post-earthquake bridge safety assessment, takes bridge parameters and seismic data as input, and quickly outputs the safety status classification label of the bridge, which not only achieves a rapid response after the earthquake, but also provides effective decision support for bridge repair and traffic restoration. Compared with traditional post-earthquake assessment technology, this invention greatly shortens the assessment time and ensures the accuracy and feasibility of the assessment results, providing an efficient and intelligent technical solution for the post-earthquake safety assessment of bridge clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a flowchart of the bridge cluster post-earthquake rapid assessment method based on improved XGBoost;
[0072] Figure 2 Numerical simulation diagrams of the construction for bridge modeling;
[0073] Figure 3 for column capacities and associated label plots;
[0074] Figure 4 The following is a comparison of the confusion matrix diagrams of the four bridges. Figure 4 (a) is the confusion matrix of the original training set of the OI bridge type, (b) is the confusion matrix of the test set of the OI bridge type, (c) is the confusion matrix of the original training set of the OS bridge type, (d) is the confusion matrix of the test set of the OS bridge type, (e) is the confusion matrix of the original training set of the TI bridge type, (f) is the confusion matrix of the test set of the TI bridge type, (g) is the confusion matrix of the original training set of the TS bridge type, (h) is the confusion matrix of the test set of the TS bridge type, (i) is the confusion matrix of the SMOTE training set of the OI bridge type, and (j) is the confusion matrix of the OI bridge type. (k) is the confusion matrix of the SMOTE training set corresponding to the OS bridge type, (l) is the confusion matrix of the test set corresponding to the OS bridge type, (m) is the confusion matrix of the SMOTE training set corresponding to the TI bridge type, (n) is the confusion matrix of the test set corresponding to the TI bridge type SMOTE training set, (o) is the confusion matrix of the SMOTE training set corresponding to the TS bridge type, and (p) is the confusion matrix of the test set corresponding to the TS bridge type SMOTE training set. DETAILED DESCRIPTION
[0075] The present invention is further described in detail below in conjunction with the examples and specific implementation methods. However, this should not be understood as the scope of the present invention being limited to the following examples, and all technologies implemented based on the present invention belong to the scope of the present invention.
[0076] Example
[0077] Taking four classic two-span box girder bridges as examples, the bridge cluster post-earthquake rapid assessment method based on improved XGBoost in this embodiment includes the following steps:
[0078] S1, bridge cluster classification and parameter sample generation: classify the bridge clusters in the selected area, select one of the bridge types as the research object, determine the range and distribution type of key modeling parameters according to the modeling requirements of the selected bridge type, and use the Latin hypercube sampling method to expand the parameter samples to ensure the uniform distribution of samples in the parameter space;
[0079] S2, finite element model establishment and analysis: based on the parameter samples generated by the Latin hypercube sampling method in step S1, a bridge finite element model is established, and the moment curvature analysis and nonlinear time history analysis are performed on the bridge finite element model to extract output parameters (curvature and peak acceleration) related to the bridge behavior to provide input data for subsequent classification;
[0080] S3, label definition: according to the output parameters related to the bridge behavior extracted in step S2, the bridges are divided into three categories according to the preset safety level standards, corresponding to different safety states, as bridge classification labels;
[0081] S4, data expansion: The parameter samples generated by the expansion of step S1 using the Latin hypercube sampling method, the peak acceleration output by step S2, and the bridge classification label of S3 together form a data set. The data set is divided into a training set and a test set in a ratio of 7:3. The SMOTE algorithm is applied to each type of sample in the training set, and it is expanded in proportion to ensure the balance of the category distribution. The various types of samples expanded by the SMOTE algorithm are combined into a new training set;
[0082] S5, model training and optimization: Use the XGBoost model to train the classification model of the new training set obtained in step S4, and adjust the sampling ratio combination and XGBoost model parameters; take the overall classification accuracy of the test set as the optimization goal, select the best sampling ratio combination and XGBoost model parameters, and finally determine the XGBoost model;
[0083] S6, using the XGBboost model determined in step S5, taking the bridge parameters and the ground motion data as input, and outputting classification labels as post-earthquake evaluation indicators / evaluation basis.
[0084] The bridge cluster classification and parameter sample generation described in step S1 include the following details:
[0085] The bridge type selected by the present invention is a combination of single-column piers and double-column piers, integrally cast abutments and sitting abutments. Figure 2 As shown in the figure, the four types of combined bridges are: a combination of single-column pier and integrally cast abutment (denoted as OI); a combination of single-column pier and seated abutment (denoted as OS); a combination of double-column pier and integrally cast abutment (denoted as TI); a combination of double-column pier and seated abutment (denoted as TS).
[0086] The parameter samples are shown in Table 1:
[0087] Table 1
[0088]
[0089] Some parameters in Table 1 are explained as follows:
[0090] The maximum span of the bridge can be 70.1m, the minimum span can be 22.86m, and the average span is 41.15m.
[0091] The maximum compressive strength of concrete is 39.09MPa, the minimum is 22.75MPa, and the average compressive strength is 31.37MPa. The yield strength of steel bars is 551.6MPa, the minimum is 399.9MPa, and the average yield strength is 475.7MPa.
[0092] The maximum clear column height is 9.75m, the minimum is 5.18m, and the average clear column height is 7.13m.
[0093] The maximum longitudinal reinforcement ratio of the column is 0.03, the minimum reinforcement ratio is 0.01, and the average reinforcement ratio is 0.02.
[0094] The maximum transverse reinforcement ratio of the column is 0.013, the minimum reinforcement ratio is 0.004, and the average reinforcement ratio is 0.009.
[0095] The maximum lateral to longitudinal rotational stiffness ratio is 1.5, the minimum rotational stiffness ratio is 0.67, and the average rotational stiffness ratio is 1.
[0096] The foundation backfill soil is made of sand or clay, with a maximum mass coefficient of 1.15, a minimum mass coefficient of 0.95, and an average mass coefficient of 1.05.
[0097] The maximum damping ratio is 0.07, the minimum damping ratio is 0.02, and the average damping ratio is 0.045.
[0098] The maximum longitudinal gap of the expansion joint is 55.9mm, the minimum gap is 7.6mm, and the average gap is 23.3mm.
[0099] The maximum lateral gap of the expansion joint is 38.1mm, the minimum gap is 0mm, and the average gap is 19.1mm.
[0100] The shear key bearing capacity acceleration is 1.2g, the minimum acceleration is 0.8g, and the average acceleration is 1g.
[0101] After the parameters were determined, the Latin hypercube sampling technique was used to expand the parameter samples of each bridge type to 480 groups according to the parameter range and distribution function.
[0102] The finite element model establishment and analysis described in step S2 specifically includes the following steps:
[0103] 480 bridge pier models were generated using the parameter samples generated in S1, and the bending curvature analysis was performed on them to obtain the yield curvature and spalling curvature of the bridge pier column. When calculating the seismic capacity, circular columns were selected so that the seismic capacity obtained was the same regardless of the direction of loading. The bending curvature analysis of each model was performed in OpenSees to obtain the yield curvature and spalling curvature of the bridge pier column. The longitudinal steel fiber was simulated by Steel 02 material, with a constant elastic modulus of 210GPa and a late hardening rate of 0.005. The protective layer concrete fiber was simulated by Concrete 02 material, with a strength corresponding strain of 0.002 and an ultimate strain of 0.004.
[0104] When calculating the seismic demand, the present invention selects four ground motions (Set-1a, Set-1b, Set2, Set3) developed by Baker et al. as ground motion kits, each of which contains 40 sets of ground motion data, which are then allocated to the ground motion data with coefficients of 1.0, 1.5, and 2.0 respectively. After that, the generated 480 sets of ground motion data are randomly paired with 480 bridge models of the four bridge types, and nonlinear time history analysis is performed in OpenSees to obtain the maximum curvature and peak acceleration of the column.
[0105] The label definition described in step S3, the specific step information is:
[0106] The standard ATC-13 is used to divide the post-earthquake safety level of bridges into three levels: green, yellow and red. The output parameters related to bridge behavior extracted in step S2: yield curvature, spalling curvature and maximum curvature are used for judgment. When the maximum curvature is less than the yield curvature, it is marked as green; when the maximum curvature is between the yield curvature and the spalling curvature, it is marked as yellow; when the maximum curvature is greater than the spalling curvature, it is marked as red ( Figure 3 ).
[0107] The data expansion described in step S4 includes the following specific steps:
[0108] S411, the parameter samples generated by expanding step S1 using the Latin hypercube sampling method, the peak acceleration output by step S2, and the bridge classification label in S3 form a data set. For each sample in each type of label sample, calculate its k nearest neighbor samples in the feature space (default k = 5). The selection of the nearest neighbor samples is based on the Euclidean distance or other distance measurement methods suitable for the feature space;
[0109] S412, randomly select a neighbor point among the k nearest neighbor samples as a reference point for generating a new sample;
[0110] S413, randomly interpolate between the original sample and the selected neighbor point to generate a new sample. The interpolation formula is:
[0111] X new =X i +λ·(X j -X i )
[0112] Among them, X i is the original sample, X j is a neighbor sample, λ is a random weight between 0 and 1, which is used to control the position of the new sample;
[0113] S414, repeat the above steps for each sample according to the target expansion ratio requirement until the required number of new samples is generated. For example, if the original number of samples of the target category is 100 and the expansion ratio is set to 1.5, then 100×(1.5-1)=50 new samples need to be generated;
[0114] S415, merging the generated new samples with the original training data set to form a new enhanced data set;
[0115] S416, for each category sample in the training set, perform the above steps one by one according to the set expansion ratio range to generate data sets with different sampling ratio combinations. There are three categories in the training set: green, yellow, and red. Each category is expanded according to the ratio of 1.1, 1.2, 1.3, ... 2.0, and the expanded data of different categories are combined in turn to form multiple sets of candidate training data sets.
[0116] The model training and optimization described in step S5 includes the following specific steps:
[0117] S511, importing the data set in step S4 and checking the integrity of the format and content to ensure that the data is not damaged or missing;
[0118] S512, perform quality checks on the target variable y (bridge label) and the feature variable X (bridge parameter), and handle missing values and inconsistent items;
[0119] S513, encode the target variable category into a numerical form, using One-Hot Encoding. The present invention encodes the three categories into 1, 2, and 3.
[0120] S514, randomly shuffle the data set to eliminate sequential interference;
[0121] S515, dividing the data into a training set and a test set in a ratio of 7:3;
[0122] S516, ensuring that the target variable category distribution is consistent after division;
[0123] S517, use SMOTE to balance the training set category distribution. Given a minority class sample xminority and its neighboring samples x neighbor , generate new samples x new :
[0124] x new =x minority +λ·(x neighbor -x minority )
[0125] Combine the training set with all new samples into a new enhanced training set;
[0126] S518, check the enhanced training set to ensure that the features match the category labels;
[0127] S519, initialize the XGBoost model, set the number of trees, maximum depth, learning rate, subsample ratio and regularization parameters;
[0128] S520, train the XGBoost model using the enhanced training set:
[0129]
[0130] where y i,m is the true category of sample i, p i,m is the predicted probability of category m, N represents the total number of samples, and M represents the total number of categories 3;
[0131] S521, set early stopping conditions to avoid overfitting and monitor the loss on the validation set:
[0132]
[0133] in represents the loss on the validation set in round t+1, where represents the loss on the validation set in round t, and k represents the number of rounds in which the loss is allowed to remain unchanged for k consecutive validations;
[0134] S522, adjust XGBoost hyperparameters, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters;
[0135] S523, use grid search to optimize parameter combinations:
[0136]
[0137] Where θ represents the hyperparameter combination, represents the loss function value of a certain hyperparameter combination θ on the validation set, θ best represents the hyperparameter combination with the lowest validation set loss in the grid search;
[0138] The grid parameters selected by the present invention and their meanings are as follows:
[0139] n_estimators: The number of base learners, used to control model complexity, ranging from 50 to 300.
[0140] max_depth: The maximum depth of the tree, used to prevent overfitting, ranges from 3 to 10.
[0141] min_child_weight: The sum of the minimum sample weights in the child nodes, used to control the complexity of the model, set to 1 to 10.
[0142] subsample: The sample ratio used to train each tree to prevent overfitting, set to 0.5 to 1.
[0143] colsample bytree: The proportion of features randomly sampled by each tree, used to control the randomness of feature selection, set to 0.3 to 1.
[0144] learning rate: The learning rate controls the step size of each update and can be set to 0.001 to 0.3.
[0145] alpha: The weight of the L1 regularization term, used to enhance the sparsity of the model, set to 0 to 10.
[0146] lambda: The weight of the L2 regularization term, which is used to control the complexity of the model and can be set from 0 to 10.
[0147] These parameter combinations are traversed one by one through grid search, and the model parameters with the best performance on the test set are selected to optimize the model effect.
[0148] S524, different from the traditional grid search, in the present invention, the optimal parameter combination is finally selected according to the classification accuracy of the test set, and the parameter combination with the highest classification accuracy of the test set is used as the parameters of the final XGBoost model.
[0149] Accuracy calculation formula:
[0150]
[0151] in:
[0152] TP (True Positive): The number of samples whose true category is positive and whose model prediction is also positive;
[0153] TN (True Negative): The number of samples whose true category is negative and whose model prediction is also negative;
[0154] FP (False Positive): The number of samples where the true category is negative but the model incorrectly predicts it as positive;
[0155] FN (False Negative): The number of samples whose true category is positive but the model incorrectly predicts them to be negative;
[0156] S525, applying the final XGBoost model to the test set and generating prediction results;
[0157] S526, calculate the confusion matrix and obtain the classification performance index:
[0158]
[0159] S527, the original training set model and the enhanced training set model are applied to the test set and a confusion matrix of the prediction results is generated, such as Figure 4 , compare the training set and test set performance of the original data and enhanced data (such as comparing the original data (a) OI-training set and the enhanced data (i) OI-SMOTE training set) to evaluate the enhancement effect;
[0160] S528, export the final XGBoost model and parameter configuration:
[0161]
[0162] in Represents the final trained model.
[0163] S529, records key experimental results, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters.
[0164] The confusion matrix described in step S524, the specific information is:
[0165] S5241, each element represents the number of samples that actually belong to a certain category among the number of samples predicted by the model. For a three-category problem, the confusion matrix is usually a 3x3 matrix (for three categories: G (green), Y (yellow), R (red)), plus the accuracy of rows and columns, forming a 4x4 matrix; in a 3x3 matrix, rows represent actual categories, columns represent predicted categories; elements on the diagonal represent the number of correctly classified categories. Off-diagonal elements represent misclassifications. Figure 4 As shown, the rows represent the actual categories of the three labels, and the columns represent the predicted categories of the three labels.
[0166] The right side and bottom of the confusion matrix add row and column accuracy information, which further refines and explains the model's prediction performance, where:
[0167] Row Accuracy: refers to the proportion of samples predicted to be of a certain category that actually belong to that category, reflecting the accuracy of the model when predicting a certain category;
[0168] Column Accuracy: refers to the proportion of samples of a certain actual category that are correctly classified, reflecting the prediction accuracy of the model for a certain actual category;
[0169] Recall: From the perspective of the columns of the confusion matrix, precision indicates how many samples the model can correctly identify in a certain category;
[0170] Precision: From the perspective of the rows of the confusion matrix, recall indicates how many of the results predicted by the model for a certain category are true.
[0171] Overall Accuracy: indicates the overall accuracy of the model for all categories;
[0172] The XGBboost model determined in step S5 described in step S6 has the following specific information:
[0173] The XGBboos model determined in step S5, that is, the model parameters determined by grid search, is used to input bridge parameters and earthquake motion data, and three classification labels are output as post-earthquake evaluation indicators / evaluation basis for bridges.
Claims
1. A bridge cluster post-earthquake rapid assessment method based on improved XGBoost, characterized in that: The method comprises the following steps: S1, bridge cluster classification and parameter sample generation: classify the bridge clusters in the selected area, select a bridge type as the research object, determine the range and distribution type of key modeling parameters according to the modeling requirements of the selected bridge type, and use the Latin hypercube sampling method to expand the parameter samples to ensure the uniform distribution of samples in the parameter space; S2, finite element model establishment and analysis: based on the parameter samples generated by the Latin hypercube sampling method in step S1, a bridge finite element model is established, and the moment curvature analysis and nonlinear time history analysis are performed on the bridge finite element model to extract output parameters (curvature and peak acceleration) related to the bridge behavior to provide input data for subsequent classification; S3, label definition: according to the output parameters related to the bridge behavior extracted in step S2, the bridges are divided into three categories according to the preset safety level standards, corresponding to different safety states, as bridge classification labels; S4, data expansion: The parameter samples generated by the expansion of step S1 using the Latin hypercube sampling method, the peak acceleration output by step S2, and the bridge classification label of S3 together form a data set. The data set is divided into a training set and a test set in a ratio of 7:
3. The SMOTE algorithm is applied to each type of sample in the training set, and it is expanded in proportion to ensure the balance of the category distribution. The various types of samples expanded by the SMOTE algorithm are combined into a new training set; S5, model training and optimization: Use the XGBoost model to train the classification model of the new training set obtained in step S4, and adjust the sampling ratio combination and XGBoost model parameters; take the overall classification accuracy of the test set as the optimization goal, select the best sampling ratio combination and XGBoost model parameters, and finally determine the XGBoost model; S6, using the XGBboost model determined in step S5, taking the bridge parameters and the ground motion data as input, and outputting classification labels as post-earthquake evaluation indicators / evaluation basis.
2. The bridge cluster post-earthquake rapid assessment method based on improved XGBoost according to claim 1 is characterized in that: The step S3 of classifying bridges into three categories according to the preset safety level standard comprises the following specific steps: S311: Use standard ATC-13 to classify the post-earthquake safety level of bridges into three levels: green, yellow and red; S312: making a judgment based on the output parameters related to the bridge behavior extracted in step S2: yield curvature, spalling curvature and maximum curvature; when the maximum curvature is less than the yield curvature, it is marked in green; When the maximum curvature is between the yield curvature and the spalling curvature, it is marked in yellow; when the maximum curvature is greater than the spalling curvature, it is marked in red.
3. The bridge cluster post-earthquake rapid assessment method based on improved XGBoost according to claim 1 is characterized in that: The step S4 described in which each type of sample in the training set is applied with the SMOTE algorithm and expanded in proportion is to expand the three types of labeled samples divided in the training set step by step in proportions of 1.1, 1.2, 1.3, ... 2.0, generate a corresponding number of synthetic samples by the SMOTE method, and expand the size of the data set of each category. The specific steps are: S411, for each sample in each category of label samples, calculate its k nearest neighbor samples in the feature space S412, randomly select a neighbor point among the k nearest neighbor samples as a reference point for generating a new sample; S413, randomly interpolate between the original sample and the selected neighbor point to generate a new sample, and the interpolation formula is: X new =X i +λ·(X j -X i ) Among them, X i is the original sample, X j is a neighbor sample, λ is a random weight between 0 and 1, which is used to control the position of the new sample; S414, repeating the above steps for each sample according to the target expansion ratio requirement until the required number of new samples is generated; S415, merging the generated new samples with the original training data set to form an expanded balanced data set; S416, for each category sample in the training set, execute the above steps one by one according to the set expansion ratio range to generate a data set with different sampling ratio combinations.
4. The bridge cluster post-earthquake rapid assessment method based on improved XGBoost according to claim 1 is characterized in that: The XGBoost model described in step S5 is used to train the classification model on the new training set obtained in step S4, and the specific steps are: S511, importing the data set in step S4 and checking the integrity of the format and content to ensure that the data is not damaged or missing; S512, perform quality checks on the target variable y and the feature variable X, and handle missing values and inconsistent items; S513, encode the target variable category into a numerical form, using One-Hot Encoding: y encoded =OneHotEncoded(y) S514, randomly shuffle the data set to eliminate sequential interference: X,y=shuffle(X,y) S515, dividing the data randomly shuffled in step S514 into a training set and a test set according to a ratio r: Train,Test=split(X,y,ratio=r) S516, ensure that the target variable category distribution is consistent after division: P Train,c =P Test,c (c) S517, using the SMOTE algorithm to balance the training set category distribution obtained in step S515, given the minority class sample x minority and its neighboring samples x neighbor , generate new samples x new : x new =x minority +λ·(x neighbor -x minority ) Combine the training set with all new samples into a new enhanced training set; S518, check the enhanced training set to ensure that the features match the category labels; S519, initialize the XGBoost model, set the number of trees, maximum depth, learning rate, subsample ratio and regularization parameters; S520, train the XGBoost model using the enhanced training set: where y i,m is the true category of sample i, p i,m is the predicted probability of category m, N represents the total number of samples, and M represents the total number of categories; S521, set early stopping conditions to avoid overfitting and monitor the loss on the validation set: in represents the loss on the validation set in round t+1, where represents the loss on the validation set in round t, and k represents the number of rounds in which the loss is allowed to remain unchanged for k consecutive validations; S522, adjust XGBoost hyperparameters, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters; S523, use grid search to optimize parameter combinations: Where θ represents the hyperparameter combination, represents the loss function value of a certain hyperparameter combination θ on the validation set, θ best represents the hyperparameter combination with the lowest validation set loss in the grid search; S524, select the optimal parameter combination according to the classification accuracy of the test set, and use the parameter combination with the highest classification accuracy of the test set as the parameters of the final XGBoost model. The accuracy calculation formula is: in: TP (True Positive): The number of samples whose true category is positive and whose model prediction is also positive; TN (True Negative): The number of samples whose true category is negative and whose model prediction is also negative; FP (False Positive): The number of samples where the true category is negative but the model incorrectly predicts it as positive; FN (False Negative): The number of samples where the true category is positive but the model incorrectly predicts it to be negative; S525, applying the final XGBoost model to the test set and generating prediction results; S526, calculate the confusion matrix and obtain the classification performance index: S527, compare the test set performance of the original data and the enhanced data to evaluate the enhancement effect; S528, export the final XGBoost model and parameter configuration: in Represents the final trained model; S529, records key experimental results, including the number of trees, maximum depth, learning rate, subsample ratio, and regularization parameters.
5. The bridge cluster post-earthquake rapid assessment method based on improved XGBoost according to claim 1 is characterized in that: The confusion matrix described in step S526, the specific information is: For three-class classification problems, the confusion matrix is usually a 3x3 matrix, plus the row and column accuracies to form a 4x4 matrix; in the 4x4 matrix: the rows represent the actual categories, the columns represent the predicted categories; the elements on the diagonal represent the number of correct classifications of a certain category; the off-diagonal elements represent misclassifications.
Citation Information
Cited By
Bridge prestressed reinforcement post-tensioning method tensioning sequence prediction method based on machine learning
CN120724787A
Machine learning based method and system for predicting seismic residual displacement of a seismic mitigation bridge
CN122635141A