A method for rapid assessment of bridge collision damage based on conditional variational autoencoder
Patent Information
- Application Number
- CN202610884398.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-09-11
Smart Images

Figure CN122734699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a rapid assessment method for bridge collision damage based on a conditional variational autoencoder, belonging to the technical field of damage assessment after a bridge-vehicle collision. Background Technology
[0002] As a core component of transportation infrastructure, the structural safety of bridges directly impacts road network efficiency and public safety. Vehicle collisions are a common and sudden risk during bridge operation. Impacts from heavily loaded or out-of-control vehicles can easily cause damage such as cracks, spalling, and decreased stiffness in critical components like piers and beams. Failure to promptly and accurately assess the damage can lead to structural failure or even collapse. Traditional bridge collision damage assessment relies primarily on manual on-site inspections and structural mechanics simulations. Manual inspections are heavily influenced by environmental conditions and professional experience, resulting in low efficiency, strong subjectivity, and risks of missed or incorrect assessments. Mechanical simulations require the construction of complex finite element models with stringent parameter settings, making them unsuitable for the rapid assessment needs of different bridge types and collision conditions, and failing to meet the real-time and accuracy requirements of modern bridge health monitoring.
[0003] With the development of sensor and data acquisition technologies, obtaining bridge collision-related data (such as collision load, structural dimensions, material properties, and damage manifestations) has become increasingly convenient, providing a foundation for data-driven damage classification. Machine learning technology, with its powerful feature learning and pattern recognition capabilities, has been gradually applied to the field of bridge damage identification. However, bridge collision damage scenarios typically suffer from difficulties in sample collection and high costs of manual annotation. Due to these pain points, the monitoring feature data related to bridge collision damage often exhibits high dimensionality. The combination of high-dimensional data and limited samples easily leads to data redundancy and complexity, significantly increased computational difficulty, poor model generalization ability, and insufficient assessment accuracy in subsequent data processing, severely restricting the practical application of bridge collision damage assessment technology. To address the shortcomings of existing technologies, the main innovation of this invention lies in the efficient dimensionality reduction processing of high-dimensional damage feature data. By using a reasonable dimensionality reduction algorithm to remove redundant features and retain core damage information, it effectively solves the problem of difficult damage feature extraction in scenarios with small samples and high-dimensional data, thereby improving the accuracy, efficiency, and practicality of bridge collision damage assessment and lowering the technical application threshold.
[0004] The development of generative deep learning has provided a new path to solve the above problems. Conditional Variational Autoencoders (cVAEs), as typical generative models, combine the advantages of feature extraction and probabilistic modeling, making them suitable for applications with small sample sizes and high-dimensional data. cVAEs use damage state labels as constraints, establishing a mapping relationship between features and damage levels based on a small number of labeled samples. This enhances the model's adaptability in scenarios with few or imbalanced samples, ensuring the stability and accuracy of classification results. Furthermore, cVAEs integrate reconstruction loss and... The optimization mechanism of divergence loss can improve the reliability of classification results while ensuring the feature representation ability.
[0005] This invention creatively introduces a conditional variational autoencoder model into the field of bridge and vehicle collision damage state classification. Using damage state labels as constraints, this model, with its accurate capture of key features of bridge collision damage and a collaborative constraint optimization training scheme combining reconstruction loss and KL divergence loss, can stably function in real-world engineering scenarios with few and imbalanced samples. It precisely overcomes the technical bottlenecks of traditional damage identification methods, which rely on human experience, have low discrimination accuracy, and weak generalization ability, achieving automated and high-precision intelligent discrimination of bridge collision damage levels. This model can provide rapid and reliable decision-making basis for emergency response, graded maintenance, and structural safety assessment after bridge collisions, and has significant practical value for improving the efficiency of bridge lifecycle operation and maintenance management and reducing infrastructure safety risks. Summary of the Invention
[0006] This invention proposes a rapid bridge collision damage assessment method based on a conditional variational autoencoder, aiming to address the problems of traditional collision classification, such as reliance on manual detection, insufficient capture of nonlinear collision features, and low classification accuracy, thereby significantly improving the efficiency and accuracy of collision result classification. The method first extracts vehicle and bridge collision datasets from target literature, then divides the datasets into training, validation, and test sets to ensure that the samples cover different collision scenarios, providing a high-quality data foundation for model training.
[0007] The innovation of this invention in the model training phase lies in the deep integration of the cVAE model with the classification task. The encoder extracts nonlinear features from the data, outputting the mean and log-variance of latent variables, which are then reparameterized to generate new latent variables. Based on these latent variables, an independent classification branch is constructed, mapping them to the log probability of the damage state category. This log probability is then converted into class probabilities using classification cross-entropy loss and the Softmax function. Simultaneously, the decoder's input feature reconstruction branch is retained, and a joint loss function consisting of reconstruction loss, KL divergence loss, and classification loss is used to optimize the model parameters. This dual-branch design enables the model to simultaneously learn the overall distribution characteristics of the collision data and accurately fit the classification task objective, maintaining classification accuracy even with a small number of labeled samples.
[0008] Compared to traditional methods, this invention leverages the label constraints and classification capabilities of the cVAE model, combined with collaborative processing of high-dimensional data encoding / dimensionality reduction and decoding / reconstruction, to significantly reduce reliance on large-scale labeled samples. Dimensionality reduction removes redundant information from damage features while retaining core damage data, thus reducing the workload of sample labeling and compressing the human and time costs. Dimensionality increase maps and enhances core damage features, uncovering potential damage correlation information. Finally, the trained cVAE model, combined with bridge collision monitoring data, and after collaborative optimization through encoding / dimensionality reduction and decoding / reconstruction, can quickly output damage state classification labels. This method not only effectively improves accuracy compared to traditional models but also solves the problem of insufficient discrimination accuracy in high-dimensional, small-sample scenarios. It can provide scientific and reliable decision support for collision accident handling and bridge maintenance, possessing broad application prospects and significant practical value.
[0009] The above objectives are achieved through the following technical solutions:
[0010] This invention discloses a rapid bridge collision damage assessment method based on a conditional variational autoencoder, comprising the following steps:
[0011] S1. Dataset Extraction: Obtain the vehicle-bridge collision dataset, extract the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and use the damage state category of the bridge as the output label;
[0012] S2. Sample partitioning: Using a stratified random sampling method, the dataset from step S1 is divided into a training set, a validation set, and a test set according to the bridge damage status to ensure that the data distribution of each dataset remains consistent.
[0013] S3.cVAE Model Training: The cVAE model is trained using a hierarchically randomly partitioned training set. The encoder reduces and purifies the high-dimensional features, and the decoder restores the high-dimensional features to achieve effective representation. At the same time, the damage classification task is combined for end-to-end training, which sequentially completes feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update. The grid search is used to optimize the hyperparameters and determine the optimal cVAE model.
[0014] S4. Practical Application: Input the vehicle load parameters and bridge structural parameters to be evaluated into the optimal cVAE model trained in step S3, and output the damage state classification label after the bridge collision.
[0015] Furthermore, the steps described in step S1, namely obtaining the vehicle-bridge collision dataset, extracting the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and using the bridge damage state category as the output label, are as follows:
[0016] S111, Input Feature Extraction: Extract the structural parameters of the bridge and the vehicle state parameters as input features of the dataset;
[0017] S112, Output Label Classification: The damage status of the bridge after the collision is divided into minor damage, moderate damage, severe damage, and collapse damage status, and represented by D1, D2, D3, and D4, where:
[0018] Minor damage D1: Tensile cracks or sporadic spalling of the concrete cover occur, but the structural load-bearing capacity is not impaired;
[0019] Moderate damage D2: Shear cracks appear, longitudinal reinforcement and stirrups yield, there is lateral displacement at the impact location, but the axial bearing capacity is basically maintained;
[0020] Severe damage D3: oblique shear crack propagation, stirrup fracture, lateral displacement concentration, and significant decrease in axial bearing capacity;
[0021] Collapse Damage D4: Concrete is broken, longitudinal reinforcement and stirrups are broken, the overall lateral displacement is too large, and the structure completely loses its load-bearing capacity.
[0022] S113, Dataset: The bridge damage status divided in step S112 is used as the output label of the dataset.
[0023] Furthermore, in step S2, a stratified random sampling method is used to divide the dataset from step S1 into a training set, a validation set, and a test set according to the bridge damage state, specifically as follows:
[0024] S211, First, a stratified random sampling method is used to divide the initial dataset into a training set and a test set in a 9:1 ratio according to the bridge damage state;
[0025] S212. In order to better leverage the learning sufficiency of the training set and the evaluation independence of the test set in small-sample engineering scenarios, a stratified random sampling method is used to split the validation set from the original training set according to the bridge damage state. Finally, the entire dataset is divided into training set, validation set and test set in a ratio of 8:1:1 to ensure that the distribution of bridge damage state categories in each dataset is completely consistent with the original dataset.
[0026] Further, in step S3, the cVAE model is trained using a hierarchically randomly partitioned training set. The encoder performs dimensionality reduction and purification of high-dimensional features, and the decoder restores these features to achieve effective representation. Simultaneously, end-to-end training is performed in conjunction with a damage classification task, and grid search is used to optimize hyperparameters and determine the optimal cVAE model. The specific steps are as follows:
[0027] S311, Training set preprocessing: The formula text in the feature column of the training set is numerated, the missing values are supplemented by the mean of the feature column, the mean and standard deviation are calculated based on the training set to complete the feature standardization, the damage label is encoded into a numerical type, and converted into the adaptation format of the cVAE model.
[0028] Formula text to numerical conversion: Parse the formula text in the feature column and calculate it, then convert it into pure numerical values;
[0029] Mean imputation for missing values: Fill missing values in the corresponding columns with the mean of the valid data in each feature column;
[0030] Feature standardization: Calculate the mean and standard deviation of each feature based on the training set, thereby eliminating differences in units;
[0031] S312 divides the preprocessed training set samples from S311 into several batches according to a preset batch size. A data loader is built using DataLoader to randomly read samples batch by batch in each round of training. Then, the preprocessed high-dimensional training set features are reduced to low-dimensional latent vectors by the cVAE encoder and then reconstructed into high-dimensional features of the same dimension as the preprocessed training set by the decoder, thus achieving dimensionality reduction and high-dimensional reproduction.
[0032] S313, multi-round training of the training set: The training set is traversed according to the preset training rounds. In each round, the training set samples are read in batches and feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update are completed in sequence.
[0033] S314, Calculate the reconstruction error of the model based on the input training set samples. Reconstruction error Calculated using the following formula: in, Represents batch size. As the feature dimension, for any sample, and They are the first The first sample The formula calculates the mean squared error between the original and reconstructed feature values, thereby quantifying the degree to which the model retains the original information.
[0034] S315, Calculation model based on input training set samples Divergence loss :
[0035] Divergence loss is used to make the latent space distribution of cVAE closer to the standard normal distribution, avoiding model overfitting and improving the generalization ability of low-dimensional features. Divergence loss Calculated using the following formula: in, Represents the potential spatial dimension. Represents the latent dimension index, for any sample, Indicates the first The sample at the th Log-variance of each latent dimension and These are the mean, squared value, and variance of the sample in the corresponding latent dimension, respectively. This formula calculates the deviation of the mean and variance of each latent dimension from a standard normal distribution with a mean of 0 and a variance of 1, then sums and normalizes the results over all samples and dimensions to obtain the mean of the entire batch. Divergence loss value;
[0036] S316, Calculate the classification cross-entropy loss of the model based on the input training set samples. :
[0037] The classification cross-entropy loss helps the model learn the differences between the four damage states of a bridge. By continuously correcting the deviation between the predicted results and the actual damage states, it improves the accuracy and reliability of the model's judgment of bridge damage categories. The classification cross-entropy loss is calculated using the following formula: in, This represents the total number of samples in the updated training set. Represents the number of categories. For any sample, and The first The corresponding sample of the th sample The true label and predicted probability of the category are calculated by the formula, which quantifies the bias of the model's classification results by calculating the cross-entropy between the true label and the predicted probability.
[0038] S317, combined with the joint loss function The parameters of the model are updated using the backpropagation algorithm:
[0039] Joint loss function It is used to unify and optimize the three objectives of "feature reconstruction, latent space regularization, and damage classification". Weighting coefficients satisfy ∈(0.1,0.2), joint loss function Calculated using the following formula: .
[0040] S318, Grid Search Training: Traverse the preset hyperparameter combinations including hidden layer dimension, latent space dimension, and learning rate, execute the training process of S313, and record the optimal validation set accuracy corresponding to each set of preset parameters. Finally, compare the optimal validation set accuracy of all preset parameters to select the hyperparameter combination corresponding to the optimal accuracy and the saved model parameters.
[0041] S319, Based on the optimal hyperparameter combination and model parameters determined by grid search, load the cVAE model and input the preprocessed bridge collision samples to be classified into the model;
[0042] S320 uses the trained cVAE model to perform forward computation of "encoding-reparameterization-classifier-classification prediction" and outputs a numerical classification code;
[0043] Encoding: The encoder receives the preprocessed bridge features and outputs the mean and standard deviation of the features in the latent space, compressing the high-dimensional features into probability distribution parameters;
[0044] Reparameterization: The latent vector is generated according to "mean + standard deviation × random noise", which solves the problem of gradient not being able to backpropagate while preserving randomness and ensures that the model is trainable;
[0045] Classifier: The classifier achieves accurate classification of damage states based on the latent feature vectors output by the encoder;
[0046] Classification prediction: The classifier receives the latent vector, combines it with known damage information, outputs the probability of each type of damage, and finally determines the damage category of the bridge.
[0047] S321 converts the numerical code output by the model into a specific and understandable damage state;
[0048] S322, Classification effect verification: The test set is used for verification, and the accuracy of the classification results is verified by quantitative indicators such as accuracy and confusion matrix.
[0049] S323, compare the accuracy of the model on the test set under different parameters. The accuracy calculation formula is: in: ( ): The number of samples where the true class is positive and the model prediction is also positive; ( ): The number of samples where the true class is negative and the model prediction is also negative; ( ): The number of samples where the true class is negative but the model incorrectly predicted it as positive; ( ): The number of samples where the true class is positive but the model incorrectly predicted it as negative; By comparing the accuracy under different parameters, the combination of hyperparameters with the highest accuracy is determined.
[0050] S324 compares the confusion matrices under different parameters, uses the confusion matrices to conduct a detailed analysis of the classification performance of the cVAE model, and calculates the accuracy. and recall rate : The model was analyzed using precision, recall, and confusion matrix to assess its ability to identify and differentiate between different damage categories.
[0051] S325, based on S319 to S320, comprehensively considers the overall accuracy, precision of each category, recall rate and confusion matrix to select the hyperparameter combination with the best classification effect, thereby deriving the final cVAE model and its corresponding optimal parameter configuration.
[0052] Furthermore, the confusion matrix mentioned in step S320 has the following specific information:
[0053] For a four-class classification problem, the confusion matrix is usually a 4x4 matrix. By adding a precision row and a recall column, it can be formed into a 5x5 matrix. The rows represent the actual class and the columns represent the predicted class. The elements on the diagonal represent the number of correctly classified classes. The off-diagonal elements represent misclassifications.
[0054] Beneficial effects
[0055] This invention proposes a rapid post-collision assessment method for bridges based on a conditional variational autoencoder (cVAE), which can efficiently and accurately determine the degree of bridge damage. The cVAE model integrates the probabilistic latent space representation mechanism and conditional constraint mechanism of the variational autoencoder. It can use damage state labels to guide feature learning, extract low-dimensional latent features from bridge collision data through the encoder, and constrain the latent space distribution by combining reconstruction loss and KL divergence loss, thereby accurately capturing the deep feature correlations of bridge damage data and effectively improving the model's ability to identify complex damage patterns.
[0056] Compared to traditional machine learning classification methods, the cVAE model, with its strong nonlinear feature extraction capability, probabilistic latent space representation capability, and reconstruction constraint mechanism, maintains excellent classification performance even in small sample scenarios, especially demonstrating higher recognition accuracy for easily confused categories such as mild damage (D1) and collapse damage (D4). This model achieves higher recognition accuracy by encoding dimensionality reduction to remove redundant and interfering features and decoding dimensionality increase to reconstruct constraints while preserving core damage information, effectively solving the problem of inaccurate classification of easily confused categories in traditional methods. Simultaneously, the model enhances its adaptability to noisy data and complex damage patterns through joint optimization of reconstruction error, KL divergence loss, and classification cross-entropy loss, reducing classification errors caused by feature redundancy or data bias.
[0057] To further optimize model performance, this invention adjusts key parameters such as latent space dimension, reconstruction loss weight, KL divergence loss weight, and learning rate. It combines a joint optimization mechanism of encoding dimensionality reduction, decoding reconstruction constraints, and classification loss to retain the core damage features of bridge collisions while improving the stability of the latent space distribution and the discriminative power of classification boundaries, thus ensuring the reliability of damage state discrimination results. In practical applications, key influencing factors such as vehicle load and bridge design parameters are used as inputs. After preprocessing, encoding dimensionality reduction, latent space constraints, decoding reconstruction constraints, and classifier discrimination, the trained cVAE model can quickly output damage state labels at levels D1-D4, achieving automated and refined classification of bridge damage. This significantly improves the efficiency and accuracy of damage identification, providing a scientific basis for bridge structural health monitoring, disease early warning, and maintenance decisions. It is suitable for damage surveys and long-term operation and maintenance management of large-scale bridge groups. Attached Figure Description
[0058] Figure 1 A flowchart for classifying bridge collisions using the cVAE model;
[0059] Figure 2 Clustering scatter plot of damage states for training set
[0060] Figure 3 Clustering scatter plot of damage states for the test set
[0061] Figure 4 The confusion matrix diagram of the optimal cVAE model;
[0062] Figure 5 A diagram showing the confusion matrix relative to the training set;
[0063] Figure 6 Confusion matrix diagram for the test set;
[0064] Figure 7 The ROC-AUC curve of the optimal cVAE model;
[0065] Figure 8 The ROC-AUC curve is plotted relative to the training set.
[0066] Figure 9 ROC-AUC curve for the test set; Detailed Implementation
[0067] The present invention will be further described in detail below with reference to embodiments and specific implementation methods. However, this should not be construed as limiting the scope of the present invention to the following embodiments; all technical solutions implemented based on the content of the present invention fall within the scope of the present invention.
[0068] Taking a typical bridge collision as an example, this embodiment of a rapid bridge collision damage assessment method based on a conditional variational autoencoder includes the following steps:
[0069] S1. Dataset Extraction: Obtain the vehicle-bridge collision dataset, extract the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and use the damage state category of the bridge as the output label;
[0070] S2. Sample partitioning: Using a stratified random sampling method, the dataset from step S1 is divided into a training set, a validation set, and a test set according to the bridge damage status to ensure that the data distribution of each dataset remains consistent.
[0071] S3.cVAE Model Training: The cVAE model is trained using a hierarchically randomly partitioned training set. The encoder reduces and purifies the high-dimensional features, and the decoder restores the high-dimensional features to achieve effective representation. At the same time, the damage classification task is combined for end-to-end training, which sequentially completes feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update. The grid search is used to optimize the hyperparameters and determine the optimal cVAE model.
[0072] S4. Practical Application: Input the vehicle load parameters and bridge structural parameters to be evaluated into the optimal cVAE model trained in step S3, and output the damage state classification label after the bridge collision.
[0073] Furthermore, the steps described in step S1, namely obtaining the vehicle-bridge collision dataset, extracting the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and using the bridge damage state category as the output label, are as follows:
[0074] S111, Input Feature Extraction: Extract the structural parameters of the bridge and the vehicle state parameters as input features of the dataset; the input features selected in this embodiment are: vehicle mass, total mass, driving speed, pier component height, pier diameter, concrete axial compressive strength, ratio of longitudinal reinforcement, yield strength of longitudinal reinforcement, diameter of transverse stirrups, spacing of reinforcement, and yield strength of stirrups, as shown in Table 1.
[0075] Table 1. Distribution of the 11 input features
[0076] S112, Output Label Classification: The damage status of the bridge after the collision is divided into minor damage, moderate damage, severe damage, and collapse damage status, and represented by D1, D2, D3, and D4, where:
[0077] Minor damage D1: Tensile cracks or sporadic spalling of the concrete cover occur, but the structural load-bearing capacity is not impaired;
[0078] Moderate damage D2: Shear cracks appear, longitudinal reinforcement and stirrups yield, there is lateral displacement at the impact location, but the axial bearing capacity is basically maintained;
[0079] Severe damage D3: oblique shear crack propagation, stirrup fracture, lateral displacement concentration, and significant decrease in axial bearing capacity;
[0080] Collapse Damage D4: Concrete is broken, longitudinal reinforcement and stirrups are broken, the overall lateral displacement is too large, and the structure completely loses its load-bearing capacity.
[0081] S113, Dataset: The bridge damage status divided in step S112 is used as the output label of the dataset.
[0082] Furthermore, in step S2, a stratified random sampling method is used to divide the dataset from step S1 into a training set, a validation set, and a test set according to the bridge damage state, specifically as follows:
[0083] S211, First, a stratified random sampling method is used to divide the initial dataset into a training set and a test set in a 9:1 ratio according to the bridge damage state;
[0084] S212. In order to better leverage the learning sufficiency of the training set and the evaluation independence of the test set in small-sample engineering scenarios, a stratified random sampling method is used to split the validation set from the original training set according to the bridge damage state. Finally, the entire dataset is divided into training set, validation set and test set in a ratio of 8:1:1 to ensure that the distribution of bridge damage state categories in each dataset is completely consistent with the original dataset.
[0085] Further, in step S3, the cVAE model is trained using a hierarchically randomly partitioned training set. The encoder performs dimensionality reduction and purification of high-dimensional features, and the decoder restores these features to achieve effective representation. Simultaneously, end-to-end training is performed in conjunction with a damage classification task, and grid search is used to optimize hyperparameters and determine the optimal cVAE model. The specific steps are as follows:
[0086] S311, Training set preprocessing: The formula text in the feature column of the training set is numerated, the missing values are supplemented by the mean of the feature column, the mean and standard deviation are calculated based on the training set to complete the feature standardization, the damage label is encoded into a numerical type, and converted into the adaptation format of the cVAE model.
[0087] Formula text to numerical conversion: Parse the formula text in the feature column and calculate it, then convert it into pure numerical values;
[0088] Mean imputation for missing values: Fill missing values in the corresponding columns with the mean of the valid data in each feature column;
[0089] Feature standardization: The mean and standard deviation of each feature are calculated based on the training set, thereby eliminating dimensional differences.
[0090] S312 divides the preprocessed training set samples into 32 according to the set batch size. A data loader is built through DataLoader. Samples are read randomly in batches in each round of training. Then, the preprocessed 11-dimensional high-dimensional features are reduced to 8-dimensional low-dimensional latent vectors by cVAE encoder and then reconstructed into 11-dimensional high-dimensional features by decoder, thus realizing dimensionality reduction and purification and high-dimensional reproduction.
[0091] The encoder receives preprocessed 11-dimensional high-dimensional input features, extracts nonlinear features through a neural network, and outputs key parameters of the latent space. ) and variance ( The method compresses 11 high-dimensional features into 8-dimensional latent vectors, which exist in the latent space of cVAE in the form of a probability distribution, thereby achieving dimensionality reduction from high to low dimensions. The core of this method is to retain the core features related to damage and filter out redundant noise.
[0092] During the reparameterization process, latent vectors are generated based on the mean and standard deviation of the latent space using the formula "mean + standard deviation × random noise". This approach preserves the randomness of the probability distribution in the latent space while resolving the issue of gradients failing to backpropagate due to random sampling, thus ensuring the end-to-end trainability of the model.
[0093] The decoder receives the reparameterized 8-dimensional low-dimensional latent vector, reconstructs its high-dimensional features through a neural network, and outputs 11-dimensional reconstructed features with the same dimension as the original input features, thus completing the feature reproduction from low-dimensional to high-dimensional. This process is constrained by the reconstruction error to ensure that the core feature information is not lost during the aforementioned dimensionality reduction process.
[0094] S313, multi-round training of the training set: The training set is traversed according to the preset training rounds. In each round, the training set samples are read in batches and feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update are completed in sequence.
[0095] S314, Calculate the reconstruction error of the model based on the input training set samples. Reconstruction error Calculated using the following formula: in, Represents batch size. As the feature dimension, for any sample, and They are the first The first sample The formula calculates the mean squared error between the original and reconstructed feature values, thereby quantifying the degree to which the model retains the original information.
[0096] The preprocessed training set was divided into batches of 32 samples, which were then input into the model in batches. The model performed dimensionality reduction on each batch of input samples, encoding and compressing the 11-dimensional original features into an 8-dimensional feature vector containing the core damage patterns. Based on this vector, the model was then decoded and reconstructed to produce 11-dimensional features with the same dimensions as the original. Finally, the reconstruction error was obtained by calculating the numerical deviation between the reconstructed features and the original input features.
[0097] S315, Calculation model based on input training set samples Divergence loss :
[0098] Divergence loss is used to make the latent space distribution of cVAE closer to the standard normal distribution, avoiding model overfitting and improving the generalization ability of low-dimensional features. Divergence loss Calculated using the following formula: in, Represents the potential spatial dimension. Represents the latent dimension index, for any sample, Indicates the first The sample at the th Log-variance of each latent dimension and These are the mean, squared value, and variance of the sample in the corresponding latent dimension, respectively. This formula calculates the deviation of the mean and variance of each latent dimension from a standard normal distribution with a mean of 0 and a variance of 1, then sums and normalizes the results over all samples and dimensions to obtain the mean of the entire batch. Divergence loss value;
[0099] After reducing the 11-dimensional high-dimensional features to 8-dimensional latent vector features, the cVAE model is used to check whether the distribution of these 8 core feature vectors conforms to the standard normal distribution. The greater the deviation of the feature distribution from the standard normal distribution, the higher the corresponding divergence loss value. This invention constrains the rationality and stability of the feature extraction process in this way.
[0100] S316, Calculate the classification cross-entropy loss of the model based on the input training set samples. :
[0101] The classification cross-entropy loss helps the model learn the differences between the four damage states of a bridge. By continuously correcting the deviation between the predicted results and the actual damage states, it improves the accuracy and reliability of the model's judgment of bridge damage categories. The classification cross-entropy loss is calculated using the following formula:
[0102] in, This represents the total number of samples in the updated training set. Represents the number of categories. For any sample, and The first The corresponding sample of the th sample The true label and predicted probability of the category are calculated by the formula, which quantifies the bias of the model's classification results by calculating the cross-entropy between the true label and the predicted probability.
[0103] Based on the 8-dimensional core feature vector, the bridge damage state is predicted, and the prediction results are compared with the actual damage labels of the samples to calculate the classification cross-entropy loss.
[0104] S317, combined with the joint loss function The parameters of the model are updated using the backpropagation algorithm:
[0105] Joint loss function It is used to unify and optimize the three objectives of "feature reconstruction, latent space regularization, and damage classification". Weighting coefficients satisfy Joint loss function Calculated using the following formula: After the three types of loss are fused according to their weights to obtain the total loss, the model automatically adjusts its internal feature weights and other parameters based on the total loss value to complete the parameter update for that batch. After all batches of samples in a round have completed the data input, loss calculation and parameter update process, the next round of training begins, until 200 rounds of training are completed.
[0106] S318, Grid Search Training: Traverse the preset hyperparameter combinations including hidden layer dimension, latent space dimension, and learning rate, execute the training process of S313, and record the optimal validation set accuracy corresponding to each set of preset parameters. Finally, compare the optimal validation set accuracy of all preset parameters to select the hyperparameter combination corresponding to the optimal accuracy and the saved model parameters.
[0107] The hyperparameter combinations corresponding to the optimal accuracy are shown in Table 2.
[0108] Table 2. Optimal Hyperparameter Combination Table batch_size 32 dropout_rate 0.2 epochs 200 hidden_dim 128 kl_loss_weight 0.1 latent_dim 8 learning_rate 0.001 weight_decay 0.0001 Optimal Validation Accuracy 0.9600
[0109] S319, Based on the optimal hyperparameter combination and model parameters determined by grid search, load the cVAE model and input the preprocessed bridge collision samples to be classified into the model;
[0110] S320 uses the trained cVAE model to perform forward computation of "encoding-reparameterization-classifier-classification prediction" and outputs a numerical classification code;
[0111] Encoding: The encoder receives the preprocessed bridge features and outputs the mean and standard deviation of the features in the latent space, compressing the high-dimensional features into probability distribution parameters;
[0112] Reparameterization: The latent vector is generated according to "mean + standard deviation × random noise", which solves the problem of gradient not being able to backpropagate while preserving randomness and ensures that the model is trainable;
[0113] Classifier: The classifier achieves accurate classification of damage states based on the latent feature vectors output by the encoder;
[0114] Classification prediction: The classifier receives the latent vector, combines it with known damage information, outputs the probability of each type of damage, and finally determines the damage category of the bridge.
[0115] S321 converts the numerical code output by the model into a specific and understandable damage state;
[0116] S322, Classification effect verification: The test set is used for verification, and the accuracy of the classification results is verified by quantitative indicators such as accuracy and confusion matrix.
[0117] Depend on Figure 2 As can be seen, the training cluster plot visually presents the distribution characteristics of the four damage samples (D1, D2, D3, and D4) in the two-dimensional feature space. All four types of samples form relatively independent and compact clusters. The D1 (mild damage) sample cluster has clear boundaries and no obvious diffusion; the D2 (moderate damage) sample is clearly separated from the D1 and D3 clusters; the D3 (severe damage) sample has no significant overlap with the D2 and D4 clusters; and the D4 (collapse damage) sample is highly clustered and has a relatively independent feature space range. The arrangement of the four clusters closely matches the gradient change pattern of damage severity, verifying that the damage features in the training set possess extremely strong intra-class clustering and inter-class discriminative power, accurately representing the unique characteristics of bridge damage of different levels. This lays a reliable feature foundation for the subsequent damage classification training of the model and also confirms the model's effective ability to identify damage levels during the feature extraction stage.
[0118] Depend on Figure 3 As can be seen, the scatter plot of the test set shows the two-dimensional feature space distribution of the four types of damage samples D1, D2, D3, and D4 in the test set. The four types of test samples still maintain good clustering characteristics and have relatively obvious separation between each other. There is no obvious cluster fusion or mixing phenomenon overall, which verifies that the damage features extracted by the cVAE model of this invention have excellent generalization ability and robustness, and can effectively identify different damage levels in new test samples. This provides key practical verification basis for the application of the model in bridge damage detection and level classification in actual engineering scenarios, and at the same time proves the stability and reliability of the model feature extraction.
[0119] S323, compare the accuracy of the model on the test set under different parameters. The accuracy calculation formula is: in: ( ): The number of samples where the true class is positive and the model prediction is also positive; ( ): The number of samples where the true class is negative and the model prediction is also negative; ( ): The number of samples where the true class is negative but the model incorrectly predicted it as positive; ( ): The number of samples where the true class is positive but the model incorrectly predicted it as negative; The model's accuracy was 0.846, indicating that the overall classification performance of the model was good.
[0120] S324 compares the confusion matrices under different parameters, uses the confusion matrices to conduct a detailed analysis of the classification performance of the cVAE model, and calculates the accuracy. and recall rate : from Figure 4-6 The confusion matrix shows that the cVAE model of this invention achieves an overall accuracy of 0.920 on the training set in the bridge collision damage classification task, with recall rates for each class all above 0.786. Furthermore, the recall rates for classes D1 and D4 are close to 1, reflecting the model's excellent stability in identifying minor and collapse damage. The confusion matrix between the test set and the optimal model shows that both maintain an overall accuracy of 0.846, with recall and precision for classes D1 and D4 both at 1, indicating strong robustness in identifying these two types of damage. For classes D2 and D3, although their recall and precision are slightly lower than D1 and D4, they remain at an acceptable level, thus validating the model's effective ability to distinguish between different damage categories.
[0121] Figure 7-9 This paper demonstrates that the cVAE model constructed in this invention exhibits good recognition performance for bridge collision damage states of types D1-D4. The closer the curve is to the upper left corner, the better the model's performance. The AUC value is used to quantitatively evaluate the classification performance of bridge collision damage states, and the closer the AUC value is to 1, the better the classification effect. As shown in the figure, the ROC curves corresponding to D1 and D4 are closely attached to the upper left corner of the coordinate graph, and the D2 curve also significantly approaches the upper left corner, indicating that the model has a high recognition ability for D1, D2, and D4 damage types and a relatively outstanding damage differentiation ability. The AUC quantitative evaluation shows... Figure 8 On the training set, the AUC values of D1 and D4 are close to 1, and D2 reaches 0.984. Figure 7 and Figure 9 The AUC values of D1 and D4 are both above 0.98, the AUC value of D2 is also stable above 0.96, and the AUC value of D3 is significantly higher than the random classification benchmark of 0.5. This proves that the model of the present invention can not only accurately identify various types of bridge collision damage, but also has good generalization and robustness.
[0122] Based on the above indicators, we can conclude that the cVAE model demonstrates high accuracy (test set accuracy of 0.846), strong generalization ability (mean AUC of 0.927), and accurate class discrimination ability (AUC ≥ 0.99 for extreme damage) in bridge collision damage classification examples. This fully proves that the cVAE model achieves a unity of "technical rigor, performance accuracy, and engineering practicality" in bridge collision damage classification, fully meets the efficiency and accuracy requirements of modern bridge health monitoring, and has broad application value.
[0123] S325, based on S319 to S320, comprehensively considers the overall accuracy, precision of each class, recall rate and confusion matrix to select the hyperparameter combination with the best classification effect, thereby deriving the final cVAE model and its corresponding optimal parameter configuration.
[0124] Furthermore, the confusion matrix mentioned in step S320 has the following specific information:
[0125] For a four-class classification problem, the confusion matrix is usually a 4x4 matrix. By adding a precision row and a recall column, it can be formed into a 5x5 matrix. The rows represent the actual class and the columns represent the predicted class. The elements on the diagonal represent the number of correctly classified classes. The off-diagonal elements represent misclassifications. The results show that on the training set, the overall accuracy of the model reaches 0.920. The recall rates for D1 (minor damage) and D4 (collapse damage) are 0.970 and 0.981, respectively, and the precision rates are 0.942 and 0.929, respectively. The proportion of diagonal elements is significantly higher than that of off-diagonal elements, reflecting that the model has fully learned the features of these two typical damage types and has high classification accuracy. In the test set and the optimal model validation, the overall accuracy remains stable at 0.846, and the precision and recall rates for D1 and D4 are still 1, indicating that the model has excellent generalization ability for these two damage types. The recall rate for D2 (moderate damage) on the test set is 0.857 and the precision rate is 0.857, verifying the stability of the model in classifying moderate damage. The overall results verify that the cVAE model of this invention has both efficient feature learning ability and stable generalization ability in bridge collision damage classification tasks, and can provide reliable technical support for the accurate identification of damage status in engineering practice.
Claims
1. A rapid post-collision assessment method for bridges based on conditional variational autoencoders, comprising the following steps: S1. Dataset Extraction: Obtain the vehicle-bridge collision dataset, extract the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and use the damage state category of the bridge as the output label; S2. Sample partitioning: Using a stratified random sampling method, the dataset from step S1 is divided into a training set, a validation set, and a test set according to the bridge damage status to ensure that the data distribution of each dataset remains consistent. S3.cVAE Model Training: The cVAE model is trained using a hierarchically randomly partitioned training set. The encoder reduces and purifies the high-dimensional features, and the decoder restores the high-dimensional features to achieve effective representation. At the same time, the damage classification task is combined for end-to-end training, which sequentially completes feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update. The grid search is used to optimize the hyperparameters and determine the optimal cVAE model. S4. Practical Application: Input the vehicle load parameters and bridge structural parameters to be evaluated into the optimal cVAE model trained in step S3, and output the damage state classification label after the bridge collision.
2. The method for rapid bridge collision assessment based on conditional variational autoencoder according to claim 1, wherein step S1 involves obtaining the vehicle-bridge collision dataset, extracting the structural parameters of the bridge and the vehicle state parameters as input features for machine learning, and using the bridge damage state category as the output label, specifically as follows: S111, Input Feature Extraction: Extract the structural parameters of the bridge and the vehicle state parameters as input features of the dataset; S112, Output Label Classification: The damage status of the bridge after the collision is divided into minor damage, moderate damage, severe damage, and collapse damage status, and represented by D1, D2, D3, and D4, where: Minor damage D1: Tensile cracks or sporadic spalling of the concrete cover occur, but the structural load-bearing capacity is not impaired; Moderate damage D2: Shear cracks appear, longitudinal reinforcement and stirrups yield, there is lateral displacement at the impact location, but the axial bearing capacity is basically maintained; Severe damage D3: oblique shear crack propagation, stirrup fracture, lateral displacement concentration, and significant decrease in axial bearing capacity; Collapse Damage D4: Concrete is broken, longitudinal reinforcement and stirrups are broken, the overall lateral displacement is too large, and the structure completely loses its load-bearing capacity. S113, Dataset: The bridge damage status divided in step S112 is used as the output label of the dataset.
3. The bridge collision rapid assessment method based on conditional variational autoencoder according to claim 2, wherein step S2 employs a stratified random sampling method to divide the dataset from step S1 into a training set, a validation set, and a test set according to the bridge damage state, specifically as follows: S211, First, a stratified random sampling method is used to divide the initial dataset into a training set and a test set in a 9:1 ratio according to the bridge damage state; S212. In order to better leverage the learning sufficiency of the training set and the evaluation independence of the test set in small-sample engineering scenarios, a stratified random sampling method is used to split the validation set from the original training set according to the bridge damage state. Finally, the entire dataset is divided into training set, validation set and test set in a ratio of 8:1:1 to ensure that the distribution of bridge damage state categories in each dataset is completely consistent with the original dataset.
4. The bridge collision rapid assessment method based on conditional variational autoencoder according to claim 3, wherein step S3 involves training a cVAE model using a hierarchically randomly partitioned training set, reducing and refining high-dimensional features through the encoder, and restoring them to high-dimensional features through the decoder to achieve effective representation; simultaneously, end-to-end training is performed in conjunction with a damage classification task, and grid search is used to optimize hyperparameters to determine the optimal cVAE model, the specific steps of which are as follows: S311, Training set preprocessing: The formula text in the feature column of the training set is numerated, the missing values are supplemented by the mean of the feature column, the mean and standard deviation are calculated based on the training set to complete the feature standardization, the damage label is encoded into a numerical type, and converted into the adaptation format of the cVAE model. Formula text to numerical conversion: Parse the formula text in the feature column and calculate it, then convert it into pure numerical values; Mean imputation for missing values: Fill missing values in the corresponding columns with the mean of the valid data in each feature column; Feature standardization: Calculate the mean and standard deviation of each feature based on the training set, thereby eliminating differences in units; S312 divides the preprocessed training set samples from S311 into several batches according to a preset batch size. A data loader is built using DataLoader to randomly read samples batch by batch in each round of training. Then, the preprocessed high-dimensional training set features are reduced to low-dimensional latent vectors by the cVAE encoder and then reconstructed into high-dimensional features of the same dimension as the preprocessed training set by the decoder, thus achieving dimensionality reduction and high-dimensional reproduction. S313, multi-round training of the training set: The training set is traversed according to the preset training rounds. In each round, the training set samples are read in batches and feature encoding, reparameterization, feature reconstruction, damage classification, loss calculation and parameter update are completed in sequence. S314, Calculate the reconstruction error of the model based on the input training set samples. Reconstruction error Calculated using the following formula: in, Represents batch size. For any sample, the feature dimension is... and They are the first The first sample The formula calculates the mean squared error between the original and reconstructed feature values, thereby quantifying the degree to which the model retains the original information. S315, Calculate the cVAE model based on the input training set samples. Divergence loss : Divergence loss is used to make the latent space distribution of the cVAE model closer to the standard normal distribution, avoiding overfitting and improving the generalization ability of low-dimensional features. Divergence loss Calculated using the following formula: in, Represents the potential spatial dimension. Represents the latent dimension index, for any sample, Indicates the first The sample at the th Log-variance of each latent dimension and These are the mean, squared value, and variance of the sample in the corresponding latent dimension, respectively. This formula calculates the deviation of the mean and variance of each latent dimension from a standard normal distribution with a mean of 0 and a variance of 1, then sums and normalizes the results over all samples and dimensions to obtain the mean of the entire batch. Divergence loss value; S316, Calculate the classification cross-entropy loss of the model based on the input training set samples. : The classification cross-entropy loss is calculated using the following formula: in, This represents the total number of samples in the updated training set. Represents the number of categories. For any sample, and The first The corresponding sample of the th sample The true label and predicted probability of the category are calculated by the formula, which quantifies the bias of the model's classification results by calculating the cross-entropy between the true label and the predicted probability. S317, combined with the joint loss function The model parameters are updated using the backpropagation algorithm: Joint loss function It is used to unify and optimize the three objectives of "feature reconstruction, latent space regularization, and damage classification". Weighting coefficients satisfy ∈(0.1,0.2), joint loss function Calculated using the following formula: S318, Grid Search Training: Traverse the preset hyperparameter combinations including hidden layer dimension, latent space dimension, and learning rate, execute the training process of S313, and record the optimal validation set accuracy corresponding to each set of preset parameters. Finally, compare the optimal validation set accuracy of all preset parameters to select the hyperparameter combination corresponding to the optimal accuracy and the saved model parameters. S319, Based on the optimal hyperparameter combination and model parameters determined by grid search, load the cVAE model and input the preprocessed bridge collision samples to be classified into the model; S320 uses the trained cVAE model to perform forward computation of "encoding-reparameterization-classifier-classification prediction" and outputs a numerical classification code; Encoding: The encoder receives the preprocessed bridge features and outputs the mean and standard deviation of the features in the latent space, compressing the high-dimensional features into probability distribution parameters; Reparameterization: The latent vector is generated according to "mean + standard deviation × random noise", which solves the problem of gradient not being able to backpropagate while preserving randomness and ensures that the model is trainable; Classifier: The classifier achieves accurate classification of damage states based on the latent feature vectors output by the encoder; Classification prediction: The classifier receives the latent vector, combines it with known damage information, outputs the probability of each type of damage, and finally determines the damage category of the bridge. S321 converts the numerical code output by the model into a specific and understandable damage state; S322, Classification effect verification: The test set is used for verification, and the accuracy of the classification results is verified by quantitative indicators such as accuracy and confusion matrix. S323, compare the accuracy of the model on the test set under different parameters. The accuracy calculation formula is: in: ( ): The number of samples where the true class is positive and the model prediction is also positive; ( ): The number of samples where the true class is negative and the model prediction is also negative; ( ): The number of samples where the true class is negative but the model incorrectly predicted it as positive; ( ): The number of samples where the true class is positive but the model incorrectly predicted it as negative; By comparing the accuracy under different parameters, the combination of hyperparameters with the highest accuracy is determined. S324 compares the confusion matrices under different parameters, uses the confusion matrices to conduct a detailed analysis of the classification performance of the cVAE model, and calculates the accuracy. and recall rate : The model was analyzed using precision, recall, and confusion matrix to assess its ability to identify and differentiate between different damage categories. S325, based on S319 to S320, comprehensively considers the overall accuracy, precision of each category, recall rate and confusion matrix to select the hyperparameter combination with the best classification effect, thereby deriving the final cVAE model and its corresponding optimal parameter configuration.
5. The bridge collision rapid evaluation method based on conditional variational autoencoder according to claim 3, wherein the confusion matrix mentioned in step S320 has the following specific information: For a four-class classification problem, the confusion matrix is usually a 4x4 matrix. By adding a precision row and a recall column, it can be formed into a 5x5 matrix. The rows represent the actual class and the columns represent the predicted class. The elements on the diagonal represent the number of correctly classified classes. The off-diagonal elements represent misclassifications.
