A concrete crack width prediction method, device and equipment based on LightGBM-Transformer and a medium
Patent Information
- Application Number
- CN202411944987.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]然而,在实际工况中,运行工况复杂多变,难以获取极为全面且充足的历史数据,故而建立精度较高的预测模型存在一定难度
[0045]1、本发明针对实际工况中,很难取得非常全面充足的历史数据,难以有效建立精度较高的预测模型的背景下,首先运用LightGBM算法并结合公开的大样本数据对混凝土强度进行预测,以此达到扩充现有数据集的目的,进而增强现有数据集的预测权重;接着,基于Transformer网络对混凝土裂缝宽度进行预测;不仅在理论上具有创新性,而且在实际应用中也展现出了卓越的性能,通过这种双层架构设计,有效改善了实际工况数据集中存在的数据量少及数据耦合关系弱的现象,进而提高了混凝土裂缝宽度的预测准确率。
Smart Images

Figure CN122903739A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of concrete crack width prediction technology, specifically to a method, apparatus, equipment, and medium for predicting concrete crack width based on LightGBM-Transformer. Background Technology
[0002] Crack width is one of the key indicators for assessing the safety of concrete structures. Wider cracks often indicate potential safety hazards and negatively impact the structure's load-bearing capacity and durability. Accurate prediction of crack width allows for timely maintenance and reinforcement measures to ensure the structure's safety and serviceability.
[0003] In recent years, with the continuous development of computer technology and artificial intelligence, machine learning methods such as neural networks and support vector machines have been gradually applied to the prediction of concrete crack width. Many scholars both domestically and internationally are increasingly using machine learning to predict relevant concrete properties. Zheng Jianjun of Zhejiang University of Technology used machine learning algorithms to predict the chloride resistance of concrete, and the results showed that the constructed model has high accuracy in predicting the chloride ion attack resistance of concrete. Li Yanyan of Hebei University of Technology established a beam diagonal crack width prediction model using a BP network algorithm. Research shows that the simulation results of this network model are in good agreement with the experimental results, and a functional relationship between the shear diagonal crack width of high-strength reinforced concrete beams and its influencing factors has been successfully established. These methods fully demonstrate that deep learning methods have excellent application effects in the prediction of concrete crack width.
[0004] However, in actual operating conditions, the processes are complex and varied, making it difficult to obtain comprehensive and sufficient historical data. Therefore, establishing a highly accurate prediction model presents a significant challenge. Consequently, researching a crack width prediction system that meets the needs of actual operating conditions and possesses high accuracy is crucial for ensuring effective project management. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method, apparatus, device, and medium for predicting concrete crack width based on LightGBM-Transformer. It utilizes the LightGBM algorithm combined with publicly available large-sample data to predict concrete strength, thereby expanding the existing dataset and enhancing its prediction weights. Then, it predicts concrete crack width based on a Transformer network. This two-layer architecture effectively improves the limited data volume and weak data coupling in actual working condition datasets, thus enhancing prediction accuracy.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a method for predicting the width of concrete cracks based on LightGBM-Transformer, the key of which includes the following steps:
[0008] Step 1: Preprocess the acquired concrete dataset;
[0009] Step 2: Use the trained LightGBM model to predict the concrete strength at the first level, and use the optimized data to construct a new dataset;
[0010] Step 3: Based on the new dataset, use the trained Transformer network model to predict the width of concrete cracks and obtain the prediction results of concrete crack width.
[0011] Furthermore, the data preprocessing includes the following steps:
[0012] Step 1.1: Remove outliers from the obtained concrete dataset;
[0013] Step 1.2: Fill in the missing values in the removed concrete dataset;
[0014] Step 1.3: Normalize the concrete dataset after filling treatment;
[0015] Step 1.4: Perform correlation analysis on the normalized concrete dataset and construct a high-dimensional feature matrix.
[0016] Furthermore, in step 1.1, the K-means algorithm is used to remove outliers; in step 1.2, the KNN algorithm is used to fill in missing values; in step 1.3, the Z-score standardization method is used for normalization; and in step 1.4, the maximum information coefficient method is used for correlation analysis.
[0017] Furthermore, the steps for imputing missing values using the KNN algorithm are as follows:
[0018] Step A1: Select the K value;
[0019] Step A2: Identify missing data points;
[0020] Step A3: Find the nearest neighbor;
[0021] Step A4: Calculate the mean or median;
[0022] Step A5: Fill in missing values by assigning the calculated mean or median to the location of the missing value;
[0023] Step A6: Iterate until all missing values are filled.
[0024] Furthermore, the training steps for the LightGBM model described in step 2 are as follows:
[0025] Step 2.1: Obtain the first sample dataset and perform data preprocessing;
[0026] Step 2.2: Randomly divide the preprocessed first sample dataset into a first training set, a first validation set, and a first test set;
[0027] Step 2.3: Construct the LightGBM model by inputting the first training set and the first validation set, and training the LightGBM model using a random search algorithm;
[0028] Step 2.4: Input the first test set into the trained LightGBM model to perform performance testing and obtain a LightGBM model that meets the performance requirements.
[0029] Furthermore, the training steps for the Transformer network model that has been trained as described in step 3 are as follows:
[0030] Step 3.1: Obtain the second sample dataset, divide the second sample dataset into three parts: the second training set, the second validation set, and the second test set, and perform normalization processing;
[0031] Step 3.2: Initialize the Transformer network parameters, and set the value range and search range of the hyperparameters in the Transformer network to be optimized;
[0032] Step 3.3: Establish a Transformer network model based on the values of the hyperparameters in the initialized Transformer network, determine the loss function of the Transformer network model, and train and predict the Transformer network model by inputting the second training set, the second validation set, and the second test set respectively.
[0033] Step 3.4: After several iterations, obtain the optimal combination of hyperparameters for the Transformer network model. The Transformer network model with the optimal combination of hyperparameters is the Transformer network model that has been trained.
[0034] Furthermore, the Transformer network model includes a location embedding module, a multi-head attention module, and a feedforward network module connected in sequence, wherein:
[0035] The location embedding module is used to perform location embedding processing on the data;
[0036] The multi-head attention module is used to perform multi-head self-attention analysis on the data after position embedding processing using a Transformer encoder;
[0037] The feedforward network module is used to predict the width of concrete cracks based on the data after multi-head self-attention analysis.
[0038] Secondly, the present invention provides a concrete crack width prediction device based on LightGBM-Transformer, the device comprising a data acquisition module, a data preprocessing module, and a data prediction module;
[0039] The data input module is used to acquire a data set from the measuring device;
[0040] The data preprocessing module is used to preprocess the acquired data set;
[0041] The data prediction module is used to predict the concrete strength of the first layer using the LightGBM algorithm, and to use the optimized data to construct a new dataset. It is also used to predict the concrete crack width using the Transformer network to obtain the concrete crack width prediction result.
[0042] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of a concrete crack width prediction method based on LightGBM-Transformer as described in the first aspect.
[0043] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the concrete crack width prediction method based on LightGBM-Transformer as described in the first aspect above.
[0044] The significant effects of this invention are:
[0045] 1. This invention addresses the challenge of obtaining comprehensive and sufficient historical data in actual working conditions, making it difficult to establish highly accurate prediction models. First, it utilizes the LightGBM algorithm combined with publicly available large-sample data to predict concrete strength, thereby expanding the existing dataset and enhancing its prediction weight. Next, it predicts concrete crack width based on a Transformer network. This approach is not only theoretically innovative but also demonstrates superior performance in practical applications. This two-layer architecture effectively addresses the limitations of limited data volume and weak data coupling in actual working condition datasets, thus improving the accuracy of concrete crack width prediction.
[0046] 2. In the data preprocessing steps of this invention, outliers in the data matrix are first removed using the K-means algorithm, and missing values are filled using the KNN algorithm. Then, normalization is performed. Finally, by mining the linear and nonlinear coupling characteristics in concrete features, a highly correlated high-dimensional feature matrix is selected, laying the foundation for improving the accuracy of the prediction model. This avoids the defects in concrete crack prediction, such as variable working conditions, complex coupling relationships of multiple factors, and numerous nonlinear relationships between data, which lead to low prediction accuracy.
[0047] 3. The LightBGM model can effectively capture key features in the data and use these features to accurately predict the concrete strength. This result provides strong data support for subsequent experiments.
[0048] 4. The Transformer model has significant advantages in the task of predicting concrete crack width. Its ability based on the self-attention mechanism enables the model to capture long-term dependencies and complex patterns in the data, proving the effectiveness of the algorithm in time-series feature sequences. Attached Figure Description
[0049] Figure 1 This is a flowchart of the method described in this invention;
[0050] Figure 2 It is the MIC heatmap of the feature sequence;
[0051] Figure 3 This is a graph showing the loss results during the training process of the Transformer network model;
[0052] Figure 4 This is a comparison chart of the test sample results;
[0053] Figure 5 This is a schematic block diagram of the device described in this invention;
[0054] Figure 6 This is a schematic block diagram of the device described in this invention. Detailed Implementation
[0055] The specific embodiments and working principles of the present invention will be further described in detail below with reference to the accompanying drawings. It should be noted that the embodiments shown represent only a part of the content of this specification, and not all of it.
[0056] This specification provides a method, apparatus, device, and medium for predicting concrete crack width based on LightGBM-Transformer. Using publicly available concrete strength data and laboratory-measured concrete data as examples, prediction is performed through a two-layer architecture of LightGBM-Transformer. The examples demonstrate the effectiveness and practicality of this method.
[0057] Table 1 shows a portion of the sample data from the Kaggle Concrete dataset. This public dataset records a total of 1031 measurement data points, including nine feature dimensions such as cement content, slag, and fly ash, as detailed in Table 1.
[0058] Table 1. Meaning of the Kaggle Concrete Dataset
[0059]
[0060] Table 2 shows some sample cases collected in the laboratory under simulated actual working conditions. The laboratory dataset records a total of 216 measurement data points, including 15 feature dimensions such as cement content, slag, and fly ash. Some concrete strength data are missing.
[0061] Table 2 Meaning of Laboratory Simulation Dataset
[0062]
[0063] Analysis of publicly available Kaggle concrete datasets and laboratory datasets reveals that the Kaggle dataset has a relatively large number of samples, while the laboratory dataset simulating actual working conditions has a smaller number of samples. Therefore, the algorithm described in this invention can be used to organize these two datasets, thereby enabling the prediction of concrete crack width under actual working conditions.
[0064] Example 1:
[0065] like Figure 1 As shown in the figure, this embodiment proposes a method for predicting concrete crack width based on LightGBM-Transformer, which includes three main process steps, which will be described one by one below:
[0066] Step 1: Perform data preprocessing on the acquired concrete dataset, including the following steps:
[0067] Step 1.1: Use the K-means algorithm to remove outliers from the obtained concrete dataset;
[0068] The K-means algorithm is a clustering algorithm whose core idea is to divide n objects in a dataset into K clusters. Among the resulting clusters, the one with fewer outliers is considered an outlier. In this embodiment, the K-means algorithm performs outlier processing on multiple data elements in the dataset, dividing them into two clusters. After clustering, the one with fewer outliers is identified as an outlier.
[0069] Step 1.2: Use the KNN algorithm to fill in the missing values in the removed concrete dataset;
[0070] The KNN algorithm is a distance-based method that can be used to fill in missing values. The specific steps are as follows:
[0071] Step A1: Choose a value for K to determine how many nearest neighbor data points to use to fill in the missing values. The choice of K depends on the size of the dataset and the distribution of the features;
[0072] Step A2: Identify missing data points and determine which data points in the dataset have missing values.
[0073] Step A3: Find the nearest neighbors: For each missing value, find the K most similar data points in the dataset based on some distance metric;
[0074] Step A4: Calculate the mean or median. For categorical data, the mode of the nearest neighbor can be used to fill in missing values; for numerical data, the mean or median of the K nearest neighbor data points can be used to fill in missing values.
[0075] Step A5: Fill in missing values by assigning the calculated mean or median to the location of the missing value;
[0076] Step A6: Iterative processing. Repeat the above steps until all missing values are filled.
[0077] Step 1.3: Normalize the concrete dataset after filling using the Z-score normalization method;
[0078] The Z-score standardization method is used to standardize all the data, i.e., to remove dimensions and normalize the data. Specifically, the calculation formula is as follows:
[0079]
[0080] In the formula, μ represents the mean of the data, and δ represents the standard deviation of the data.
[0081] In this embodiment, 0-1 normalization is used to eliminate the dimensions of the data, but other normalization methods can also be used.
[0082] Step 1.4: Perform correlation analysis on the normalized concrete dataset using the Maximum Information Coefficient (MICfa) method to construct a high-dimensional feature matrix.
[0083] Concrete crack prediction is an extremely complex process due to the interaction of various material properties and environmental factors. These factors include the content of cement, slag, fly ash, chlorides, water, superplasticizers, coarse and fine aggregates, as well as the age and compressive strength of the concrete. In the problem of concrete crack width prediction, the working conditions are highly variable, and the coupling relationships between multiple factors are complex. Not only are there linear relationships between the data, but also numerous nonlinear relationships, which cannot be simply described by mathematical formulas. The MIC method can quantify the strength of linear and nonlinear correlations between data. By evaluating the relationships between different types of load data, it helps to reveal a wider range of relationship types. This method, by evaluating the relationships between different types of data, helps to reveal a wider range of relationship types, which is crucial for understanding and predicting crack formation and development. Through MIC analysis, researchers can identify the features that have the most influence on crack width prediction, thereby constructing more accurate prediction models. Figure 2 The image shows a heatmap of the MICs in the collected data.
[0084] Figure 2 The legend on the right side of the figure shows the correlation between the major features, with values ranging from [0, 1]. When the value is less than 0.2, it indicates a weak correlation between the two features; when the value is greater than 0.8, it indicates a strong correlation between the two features.
[0085] like Figure 2 As shown, the four indicators of cement content, water content, superplasticizer, and age are strongly correlated with concrete strength, while the four indicators of slag, fly ash, coarse aggregate, and fine aggregate are weakly correlated with concrete strength. Since slag and fly ash are necessary factors in the next experiment, they are retained as characteristic selection factors, while coarse aggregate and fine aggregate are discarded.
[0086] Based on MIC data analysis, this chapter selects seven features—cement content, water content, superplasticizer, age, slag, and fly ash—as inputs to form the input feature set. The specific list is shown in Table 3.
[0087] Table 3 Input Feature Set List
[0088]
[0089] In this step, outliers in the data matrix are first removed using the K-means algorithm, and missing values are filled using the KNN algorithm. Then, normalization is performed. Finally, by mining the linear and nonlinear coupling characteristics in concrete features, a highly correlated high-dimensional feature matrix is selected, which lays the foundation for improving the accuracy of the prediction model. This avoids the shortcomings of low prediction accuracy caused by the variable working conditions, complex coupling relationships of multiple factors, and the existence of not only linear relationships but also many nonlinear relationships between data in concrete crack prediction.
[0090] Step 2: Use the trained LightGBM model to predict the concrete strength at the first level, and use the optimized data to construct a new dataset;
[0091] The concrete strength prediction process based on the LightGBM model mainly consists of three parts: data preprocessing and feature extraction, LightGBM model training and tuning, and model prediction evaluation. In this embodiment, the training steps of the LightGBM model are as follows:
[0092] Step 2.1: Obtain concrete data from a public dataset as the first sample dataset, and perform data preprocessing, such as noise removal, missing value filling, and data standardization, to ensure data quality and accuracy.
[0093] Step 2.2: Randomly divide the preprocessed first sample dataset into the first training set, the first validation set, and the first test set in a ratio of 8:1:1 to lay the foundation for model construction and evaluation;
[0094] Step 2.3: Construct the LightGBM model. Input the first training set and the first validation set, and use a random search algorithm to train the LightGBM model to optimize the model's performance and accuracy.
[0095] During each iteration, it is necessary to determine whether the model has converged and met the convergence criteria. This embodiment uses an Intel 13700KF CPU and an NVIDIA RTX 4060 GPU as the experimental platform, and the PyTorch deep learning framework is built and implemented in Python.
[0096] The hyperparameter results of the LightGBM model are as follows:
[0097] Table 4. Hyperparameter settings for the model
[0098]
[0099] Step 2.4: Input the first test set into the trained LightGBM model to perform performance testing and obtain a LightGBM model that meets the performance requirements.
[0100] The model achieved an R² score of 98.6 on the first test set, demonstrating its high interpretability for the given dataset. This significant statistical result indicates that the constructed LightBGM model effectively captures key features in the data and utilizes these features to accurately predict concrete strength. This result provides strong data support for subsequent experiments.
[0101] Step 3: Based on the new dataset, use the trained Transformer network model to predict the width of concrete cracks and obtain the prediction results of concrete crack width.
[0102] In this embodiment, the training steps for the Transformer network model that has been trained in step 3 are as follows:
[0103] Step 3.1: Obtain the second sample dataset, divide the second sample dataset into three parts in an 8:1:1 ratio: the second training set, the second validation set, and the second test set, and perform normalization processing.
[0104] Since concrete data comes from various working conditions, such as natural conditions, carbonation conditions, and brine conditions, the second sample dataset in this example uses cooling cycles of 0 days, 7 days, 14 days, and 28 days, relying on the 15-dimensional features of the first-layer concrete prediction values from LightGBM.
[0105] The data is then normalized using 0-1 normalization, as shown in the formula below:
[0106]
[0107] In the formula, y represents the normalized data of the original data x; x max The maximum value among all samples; x min It is the minimum value among all samples.
[0108] Step 3.2: Initialize the Transformer network parameters, and set the value range and search range of the hyperparameters in the Transformer network to be optimized;
[0109] Step 3.3: Establish a Transformer network model based on the values of the hyperparameters in the initialized Transformer network, determine the loss function of the Transformer network model, and train and predict the Transformer network model by inputting the second training set, the second validation set, and the second test set respectively.
[0110] The Transformer network model includes a location embedding module, a multi-head attention module, and a feedforward network module connected in sequence, wherein:
[0111] The location embedding module is used to perform location embedding processing on the data;
[0112] The multi-head attention module is used to perform multi-head self-attention analysis on the data after position embedding processing using a Transformer encoder;
[0113] The feedforward network module is used to predict the width of concrete cracks based on the data after multi-head self-attention analysis.
[0114] To enhance positional information in long sequences, this embodiment introduces a position embedding mechanism, and the positional encoding equation is defined as:
[0115] PE (pos,2i) =sin(pos / 10000) 2i / d (3)
[0116] PE (pos,2i+1) =cos(pos / 10000) 2i / d (4)
[0117] In the formula, pos represents the position of the current word in the sentence, d is the embedding size of the node load, and i is the i-th time step. It can be seen that sine coding is used for even positions, and cosine coding is used for odd positions.
[0118] The input to a self-attention network needs to include a positional encoding variable:
[0119]
[0120] In the formula: E t [i,:] represents the load information of a single node, PE t For PE t .
[0121] Then, Q, K, and V are calculated using the linear transformation matrix, i.e.:
[0122]
[0123] In the formula: Q is the query vector matrix; K is the key vector matrix, used to calculate the relevance between data; V is the value vector matrix representing historical data; W... q W k W v This is the weight matrix, where q, k, and v are the query vector, key vector, and value vector, respectively. Word embedding.
[0124] Transformer's multi-head attention mechanism can highlight key features between feature vectors, making it highly effective for handling the load of strongly coupled multi-node systems. The attention calculation formula is as follows:
[0125]
[0126] H matt =W matt [H att1 H att2 ,…,H attn (10)
[0127] In the formula, d is the model dimension; h is the number of attention heads, specifically the load correlation analysis between time points is completed from the perspective of h attention heads.
[0128] To ensure good accuracy and generalization ability during model training, appropriate parameters need to be selected during Transformer network training. Details on parameter selection in the Transformer model are as follows:
[0129] (1) Loss Function. The loss function is used to evaluate the difference between the true value and the predicted value during model training. The smaller the loss function value, the better the model's performance during training. Common loss functions mainly include MAE and MSE. MSE is a loss function commonly used in regression prediction problems. It is less sensitive to noise and outliers. Since the data sample in this embodiment is small, MSE is used as the network's loss function in this embodiment.
[0130] (2) Algorithm Optimization. The correct use of optimization algorithms can effectively improve the training speed and prediction accuracy of the model. Currently, commonly used optimization algorithms include Adam, RMSprop, and SGD. The Adam optimization algorithm is a widely used deep learning optimization algorithm that combines the ideas of momentum and RMSProp. It adjusts the learning rate of each parameter by calculating the first and second moment estimates of the gradient, thereby achieving more efficient network training. This embodiment uses the Adam algorithm to train the network model, and the experimental loss results are as follows: Figure 3 As shown in the figure, the Adam algorithm can achieve good model convergence.
[0131] (3) Other hyperparameters.
[0132] Multiple parameter adjustments are required to determine the values of other hyperparameters using the single-variable control method.
[0133] Finally, Mean Absolute Percentage Error (MAPE) is used as the primary metric to measure the predictive performance of each model, supplemented by Mean Absolute Error (MAE) as a secondary evaluation standard. The formulas for calculating MAPE and MAE are as follows:
[0134]
[0135] In equations (11) and (12): y t This is based on actual operating conditions; For predicted operating conditions; is the mean of the values taken under actual working conditions; n is the number of data samples.
[0136] After multiple parameter adjustments, the final optimized parameters are shown in Table 5.
[0137] Table 5. Hyperparameter settings of the model
[0138]
[0139]
[0140] Step 3.4: After several iterations, obtain the optimal combination of hyperparameters for the Transformer network model. The Transformer network model with the optimal combination of hyperparameters is the Transformer network model that has been trained.
[0141] The method described in this embodiment obtains the test sample performance comparison by evaluating the model on a second test set. Figure 4 As shown.
[0142] In this embodiment, a Transformer network model was used to predict concrete crack width, and the actual and predicted values were fitted experimentally. Statistically, the Mean Absolute Percentage Error (MAPE) was 0.1056, and the Mean Absolute Error (MAE) was 0.0104. Specifically, the low MAPE value indicates a small deviation between the model's predicted and actual values, meaning the model can predict crack width with high reliability. The low MAE value, another indicator of prediction accuracy, further confirms the model's prediction accuracy, as it reflects the proportion of prediction error to the actual value.
[0143] A comprehensive analysis of these statistical indicators demonstrates that the Transformer network model has significant advantages in predicting concrete crack width. Its self-attention mechanism enables the model to capture long-term dependencies and complex patterns in the data, which is crucial for accurate crack width prediction.
[0144] Example 2:
[0145] like Figure 5 As shown in the figure, this embodiment of the invention provides a concrete crack width prediction device based on LightGBM-Transformer. The device includes: a data acquisition module, a data preprocessing module, a data prediction module, a data storage module, and a data output module. Specifically:
[0146] The data input module is used to acquire a data set from the measuring device;
[0147] The data preprocessing module is used to preprocess the acquired data set;
[0148] The data prediction module is used to predict the concrete strength of the first layer using the LightGBM algorithm, and to use the optimized data to construct a new dataset. It is also used to predict the concrete crack width using the Transformer network to obtain the concrete crack width prediction result.
[0149] The data storage module is used to evaluate and store the concrete crack width prediction model;
[0150] The data output module is responsible for receiving the prediction results generated by the model and displaying them on the device terminal in an appropriate format. This module ensures the visual presentation of the prediction results, enabling users to intuitively understand and interpret the data output by the model.
[0151] It should be understood that the steps in the embodiments of the prediction device correspond to those in the embodiments of the prediction method.
[0152] Example 3:
[0153] like Figure 6 As shown, this embodiment provides a computer device, including a memory, a processor, a multimedia component, an I / O interface, a communication component, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a concrete crack width prediction method based on LightGBM-Transformer as described in Embodiment 1.
[0154] Example 4:
[0155] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a concrete crack width prediction method based on LightGBM-Transformer as described in Embodiment 1 above.
[0156] In summary, this invention addresses the challenge of obtaining comprehensive and sufficient historical data in real-world working conditions, making it difficult to establish highly accurate prediction models. First, it utilizes the LightGBM algorithm combined with publicly available large-sample data to predict concrete strength, thereby expanding the existing dataset and enhancing its prediction weight. Next, it predicts concrete crack width based on a Transformer network. This approach is not only theoretically innovative but also demonstrates superior performance in practical applications. This two-layer architecture effectively addresses the limitations of limited data volume and weak data coupling in real-world working condition datasets, thus improving the accuracy of concrete crack width prediction.
[0157] The technical solution provided by this invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make several improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of the claims of this invention.
Claims
1. A method for predicting concrete crack width based on LightGBM-Transformer, characterized in that, Includes the following steps: Step 1: Preprocess the acquired concrete dataset; Step 2: Use the trained LightGBM model to predict the concrete strength at the first level, and use the optimized data to construct a new dataset; Step 3: Based on the new dataset, use the trained Transformer network model to predict the width of concrete cracks and obtain the prediction results of concrete crack width.
2. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 1, characterized in that: The data preprocessing includes the following steps: Step 1.1: Remove outliers from the obtained concrete dataset; Step 1.2: Fill in the missing values in the removed concrete dataset; Step 1.3: Normalize the concrete dataset after filling treatment; Step 1.4: Perform correlation analysis on the normalized concrete dataset and construct a high-dimensional feature matrix.
3. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 2, characterized in that: In step 1.1, the K-means algorithm is used to remove outliers; in step 1.2, the KNN algorithm is used to fill in missing values; in step 1.3, the Z-score standardization method is used for normalization; and in step 1.4, the maximum information coefficient method is used for correlation analysis.
4. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 3, characterized in that: The steps for imputing missing values using the KNN algorithm are as follows: Step A1: Select the K value; Step A2: Identify missing data points; Step A3: Find the nearest neighbor; Step A4: Calculate the mean or median; Step A5: Fill in missing values by assigning the calculated mean or median to the location of the missing value; Step A6: Iterate until all missing values are filled.
5. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 1, characterized in that: The training steps for the LightGBM model described in step 2 are as follows: Step 2.1: Obtain the first sample dataset and perform data preprocessing; Step 2.2: Randomly divide the preprocessed first sample dataset into a first training set, a first validation set, and a first test set; Step 2.3: Construct the LightGBM model by inputting the first training set and the first validation set, and training the LightGBM model using a random search algorithm; Step 2.4: Input the first test set into the trained LightGBM model to perform performance testing and obtain a LightGBM model that meets the performance requirements.
6. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 1, characterized in that: The training steps for the Transformer network model that has been trained as described in step 3 are as follows: Step 3.1: Obtain the second sample dataset, divide the second sample dataset into three parts: the second training set, the second validation set, and the second test set, and perform normalization processing; Step 3.2: Initialize the Transformer network parameters, and set the value range and search range of the hyperparameters in the Transformer network to be optimized; Step 3.3: Establish a Transformer network model based on the values of the hyperparameters in the initialized Transformer network, determine the loss function of the Transformer network model, and train and predict the Transformer network model by inputting the second training set, the second validation set, and the second test set respectively. Step 3.4: After several iterations, obtain the optimal combination of hyperparameters for the Transformer network model. The Transformer network model with the optimal combination of hyperparameters is the Transformer network model that has been trained.
7. The method for predicting concrete crack width based on LightGBM-Transformer according to claim 6, characterized in that: The Transformer network model includes a location embedding module, a multi-head attention module, and a feedforward network module connected in sequence, wherein: The location embedding module is used to perform location embedding processing on the data; The multi-head attention module is used to perform multi-head self-attention analysis on the data after position embedding processing using a Transformer encoder; The feedforward network module is used to predict the width of concrete cracks based on the data after multi-head self-attention analysis.
8. A concrete crack width prediction device based on LightGBM-Transformer, characterized in that: The device includes a data acquisition module, a data preprocessing module, and a data prediction module; The data input module is used to acquire a data set from the measuring device; The data preprocessing module is used to preprocess the acquired data set; The data prediction module is used to predict the concrete strength of the first layer using the LightGBM algorithm, and to use the optimized data to construct a new dataset. It is also used to predict the concrete crack width using the Transformer network to obtain the concrete crack width prediction result.
9. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1-7.