Machine Learning-Based Flexural Capacity Prediction of Corroded RC Beams with an Efﬁcient and User-Friendly Tool

: Steel corrosion poses a serious threat to the structural performance of reinforced concrete (RC) structures. Thus, this study evaluates the ﬂexural capacity of RC beams through machine learning (ML)-based techniques with six parameters used as input features: beam width, beam effective depth, concrete compressive strength, reinforcement ratio, reinforcement yield strength, and corrosion level. Four single and ensemble ML models are evaluated; namely, decision tree, support vector machine, adaptive boosting, and gradient boosting. Hyperparameters of each model were optimized using grid search and K-fold cross-validation with root mean squared error used as the performance index. The predictive performance of each model was assessed using four statistical performance metrics. The analysis results demonstrated that the decision tree model exhibited overﬁtting and limited generalization ability. The adaptive boosting model also had a slight overﬁtting issue. In addition, the support vector machine reported comparable accuracy to that of adaptive boosting. Conversely, the proposed gradient boosting ensemble model achieved the best performance with strong generalization ability, as indicated by its lowest mean absolute error of 2.78 kN.m, mean absolute percent error of 13.40%, and root mean squared error of 3.56 kN.m, and the highest coefﬁcient of determination of 97.30% on the test dataset. The optimized gradient boosting model has been deployed into a graphical user interface, allowing for practical implementation of the model and enabling fast, efﬁcient, and intelligent prediction of the ﬂexural capacity of corroded RC beams.


Introduction
Steel corrosion puts reinforced concrete (RC) structures at a risk of severe premature deterioration due to its association with drastic damages, lifespan shortening, and costly maintenance [1]. The generation of steel corrosion in RC members occurs mostly in aggressive marine environments [1]. The global maintenance and rehabilitation costs of corroded RC structures are estimated at USD 100 billion [2]. Additional costs estimated at 10 times the maintenance cost are assigned to road closures, traffic diversions, and public disturbance, harshly affecting the countries' economy and population's comfort [3]. Therefore, investigation related to the residual strength of RC members is currently of significant interest to researchers worldwide.
Constructing RC structures in corrosive mediums without considering corrosion susceptibility can lead to detrimental effects on the elements' reinforcement, concrete surface, and bond strength with steel bars, which subsequently degrade the bending capacity of the members [4][5][6]. Particularly, corrosion decreases the cross-sectional area of the rebars, thereby affecting the overall structural performance of the buildings [4]. In addition, corrosion products expand the volume of reinforcement and therefore crack and spall of the concrete cover and, in turn, reduce the effective height and cross-sectional reinforcement area of the RC members [5]. Moreover, the corrosion products generated at the concrete-reinforcement interface reduce the adhesion of the composite and deteriorate the bars' ribs and consequently decrease the bond strength, which can worsen the stress transfer mechanism between concrete and reinforcement and tension stiffening of the corroded elements [6].
Several research studies have explored the potential risk and countermeasures of steel corrosion on the flexural behavior of RC beams and slabs [7][8][9][10][11]. Three types of corroded specimens were considered in the previous studies; namely, specimens exposed to natural corrosive environments, specimens extracted from existing structures, and specimens corroded using the impressed current/voltage techniques with a target corrosion level (C L ). Whereas the first and second specimen types might not be easy to prepare and test, the third method is the easiest and fastest for laboratory investigation [7][8][9][10]. Almusallam et al. [7] reported that RC slabs with a C L of 5% had a reduction of 25% in the flexural strength. However, the drop in the flexural capacity was increased to 60% when the C L increased to 25%. Rodriguez et al. [8] pointed out that the structural capacity of corroded RC beams is reduced due to the spalling and cracking of concrete. Mangat and Elgarf [9] demonstrated that the degradation of the flexural strength is primarily caused by a steel-concrete bond deterioration. Huang and Yang [10] suggested that the reduction of the ultimate strength of corroded RC beams is related to the concrete properties and concrete cracks.
Few analytical models are currently available to evaluate the residual flexural capacity of corroded RC beams [12,13]. Likewise, limited studies have been involved to predict the residual flexural capacity of corroded RC beams from a set of numerical data [2]. Even though the established analytical and numerical models have incorporated factors such as corrosion level, bond strength, and beams' geometries, they still suffer from a lack of prediction accuracy. This is because the models are developed deterministically, based on limited levels of parameters. Therefore, it is vital to develop a more reliable and accurate model to enhance the prediction of the flexural capacity of corroded RC beams. Recently, machine learning (ML) algorithms have emerged as a popular approach for improving the accuracy of predictive models owing to their ability to identify complex and nonlinear relationships between the independent and dependent variables [14][15][16][17][18].
Previous studies have demonstrated the effectiveness of ML models in estimating the structural performance of both concrete [18,19] and steel [20] structures, resilience and livability assessment of smart cities [21], and seismic risk assessment [22]. However, there is a dearth of research employing ML-based models in predicting the flexural capacity of corroded RC beams. Thus, this study aims to evaluate the efficiency of various ML models in predicting the residual flexural capacity of corroded RC beams. A comprehensive dataset of the flexural behavior of corroded RC beams was collected from previous studies [8,12,13,[23][24][25][26][27]. The dataset was then randomly split into 80% training data and 20% test data. Different single and ensemble ML models were then trained and evaluated to select the best predictive model. Finally, the most effective model was integrated into a graphical user interface (GUI) for practical implementation, allowing fast, accurate, and intelligent prediction of the flexural capacity of corroded RC beams.
The remainder of this paper is structured as follows: Section 2 presents the research significance, Section 3 presents the methodology, and Section 4 discusses the results. Lastly, in Section 5, the paper concludes by pointing out the limitations of this study and recommendations for future research.

Research Significance
As has been highlighted in the introduction, steel corrosion is a major threat to the flexural performance of RC beams, and there is a need to consider the corrosion effect in evaluating the residual flexural capacity of corroded RC beams. However, there is currently no available data-driven model for evaluating the flexural capacity of corroded RC beams. Therefore, the novelty of this study lies in the implementation of data-driven ML models to develop accurate predictions for the flexural capacity of corroded RC beams. Furthermore, a novel user-friendly GUI-based tool has been developed for practical implementation of the ML model, enabling fast, accurate, and intelligent prediction of the flexural capacity of corroded RC beams. The main objectives of this study are as follows:

1.
To develop ML predictive models that can accurately estimate the flexural capacity of corroded RC beams.

2.
To evaluate and compare the performance of various ML models using statistical indices such as mean absolute error (MAE), mean absolute percent error (MAPE), root mean squared error (RMSE), and coefficient of determination (R 2 ) and select the most accurate and reliable predictive model.

3.
To develop a graphical user interface for the best predictive model, which facilitates its practical implementation and enables fast, accurate, and intelligent prediction of the flexural capacity of corroded RC beams.

Material and Methods
The methodology adopted in this study is summarized in Figure 1 and discussed in the following subsections.

Research Database
The first step involved compiling a database of the flexural capacity of corroded RC beams, as illustrated in Figure 1. The database developed in this study consisted of the flexural capacity of 115 corroded RC beams obtained from the published literature [8,12,13,[23][24][25][26][27], particularly 16 sets from Rodriguez et al. [8], 24 sets from Azad et al. [12], 36 sets from Azad et al. [13], 5 sets from El Maaddawy et al. [23], 20 sets from Xia et al. [24], 11 sets from Wang et al. [25], 6 sets from Tan and Nguyen [26], and 8 sets from Yalciner et al. [27]. It is worth noting that all the beams in the constructed database were subjected to accelerated corrosion. As illustrated in Figure 2, the database employed included 6 input features with a wide range of concrete and reinforcement characteristics, beam geometry, and mass losses of corroded bars due to the chloride ingress. The input parameters were the beam width (b), beam effective depth (d), concrete compressive strength ( f c ), reinforcement ratio (ρ), reinforcement yield strength (f y ), and corrosion level (C L ).  Reinforcement ratio: the beams' reinforcement ratios ranged between 0.0045% and 1.84%. • Mass loss: the mass loss of the beams, which was expressed as the C L , varied between 0% and 34.8%.
Moreover, statistical measures in terms of the histogram distribution for each parameter and Pearson correlation coefficient (r) between the inputs are provided in a 6 × 6 matrix in Figure 2. In addition, the matrix illustrates the scatter plots of the variables in the upper and lower triangular matrices.
In the subsequent step, the compiled database was randomly split into training and test datasets, comprising 80% and 20% of the complete dataset, respectively. These datasets were then employed to train and evaluate various machine learning models, as depicted in Figure 1. A brief background of the ML models is provided in the following subsection.

Machine Learning Models
This study aimed to identify the most accurate and reliable predictive model for estimating the flexural capacity of corroded RC beams, as depicted in Figure 1, by establishing four ML models. Initially, single ML models such as support vector machine (SVM) and decision tree (DT) were developed to predict the flexural capacity of corroded RC beams. However, due to the complex nature of flexural behavior in RC beams with corrosion, ensemble ML models, specifically adaptive boosting (ADB) and gradient boosting (GB), were employed to improve the predictive capability and reduce the error of the ML models.

Single ML Models Support Vector Machine
SVM is a supervised ML algorithm that can be used for regression and classification problems. The input features in the SVM algorithm are mapped to a high-dimensional space using a fitting procedure. For N number of training datasets (1)) by minimizing the regularized risk function (Equation (2)), which is conditioned by Equations (3)-(5) [28].

SVM estimates the parameters of a regression function (Equation
where ξ i and ξ * i are the slack variables, w is the weight vector, b is the bias, ε is the Vapnik's insensitive loss, and C is the regularization parameter. The prediction of the SVM algorithm is achieved as per Equation (7) [29,30]: where SV stands for support vectors, K(x i , x) is the kernel function, b is a bias, C is the regularization parameters, and α i and α * i are the Lagrange multipliers of the lower and upper SV, respectively.

Decision Tree
The DT algorithm is a widely used supervised algorithm and is considered the base learner for many advanced algorithms. It is a non-parametric algorithm that can be used for classification and regression analyses by constructing a flowchart-like structure [31]. The algorithm is known for its ease of data preprocessing, visualization, and interpretation, as well as being unaffected by outliers. The DT algorithm is composed of three main nodes: root, internal, and leaf. The root node identifies the main characteristic of the data, and the internal and leaf nodes are branched from the root nodes. Each internal node represents a test on an attribute, and the leaf node covers the response prediction.
The tree predictor is developed by iteratively partitioning the input space R N into K distinct subspaces {R 1 , . . . , R K }, in which aggregation occurs for observations with similar targets. This is accomplished by using the Gini Index and mean squared error for classification and regression problems, respectively [32]. A minimal cost-complexity pruning algorithm is then utilized to trim the tree and avoid overfitting the DT model [32]. The DT model can be defined as per Equation (8): where R k is the k th distinct subspace, b k is the prediction of the subspace R k , and I (x R k ) is the indicator function (I (x R k ) = 1 when x ∈ R k ). Single DT algorithms have weaknesses in terms of data generalization, high variance, and bias. To address this problem, ensemble models are employed, as discussed in the following subsection.

Ensemble ML Models
Ensemble algorithms are a more advanced ML technique that seeks to reduce bias and variance and improve the prediction performance of single models. This is accomplished by sequentially combining multiple weak learners (in this study, DT) to create a single strong learner. Boosting ensembles are the most frequently used ensemble models. Details of the boosting ensembles are provided in the following subsections.

Adaptive Boosting
The first boosting algorithm to be developed was ADB. The ADB algorithm trains and reweighs weak learners (DT in this study) iteratively over multiple training rounds to correlate inputs (X) with the output (Y) parameter. The weighting vector is adjusted during each training process to account for misclassified instances from previous iterations (excluding the first iteration). Given a training dataset of Z samples in Equation (9), the ADB algorithm iteratively trains several base learners f t (X) to construct a single improved model F(X), see Equation (10): where X i represents the ith input parameters and Y i is the ith response variable in the training dataset.
where K is the total number of base learners and w k is the weight of kth learner. During the first iteration, the weight is uniformly distributed among the weak learners with a constant weight of {w 1, i = 1/Z, ∀i} [33]. Subsequently, the weighting process of the observations is readjusted by assigning higher weight to the incorrectly predicted observations in the initial iteration. The weight distribution for training step t is adjusted according to Equation (11), where βt ∈ [0, 1] is the parameter related to the distribution update (Equation (12)), and L k is the average loss function (Equation (13)). A linear loss function was also used in this study to assess the performance of the base learner, as shown in Equation (14): Gradient Boosting The gradient boosting (GB) algorithm is another type of boosting algorithms that combines multiple base learners (DT in this study) sequentially and accumulates the results in an additive model. The mathematical expression of the GB algorithm is presented in Equation (15): where K is the number of base learners and f k is all possible base learner (DT in this study). The GB algorithm utilizes the gradient descent method in each sequential iteration to construct new trees from the previous base learners and reduce the loss function. The GB model is initiated in the first iteration using a constant value as per Equation (16) to reduce the loss. Following the first iteration, the GBDT model fits a new DT base learner h k (X) at each iteration t, as shown in Equation (17), to the negative gradient descent (r i, k ) or pseudo-residuals of the previous learner in the sequence, i.e., training set (x i , r i, k ) N i=1 , as presented in Equation (18), which is obtained by solving Equation (19): in which, L(·) and γ k are the training loss and multiplier, respectively.

Hyperparameter Optimization Results
As previously mentioned and depicted in Figure 1, the database was randomly divided into training and testing datasets. The hyperparameters of the models were optimized using the grid search technique, which involves searching through a predefined grid of hyperparameters to find the optimal values of the hyperparameters. Additionally, to address overfitting during the training process, the widely used K-fold cross-validation method was employed. This method divides the dataset into k subsets or folds, trains the model on k-1 folds, and validates it on the remaining one fold. This process is repeated k times, where each subset of the data serves as both the validation and training set. The cross-validated model's performance is then calculated as the average performance across the K validation sets. In this study, the widely used 10-fold cross-validation technique (K = 10) was employed.
The optimization process was performed using RMSE as the evaluation metric. The results of the hyperparameter optimization are presented in Table 1. The optimized SVM utilized a radial basis function (RBF) kernel, with a regularization parameter (C) set to 30 and an epsilon value of 10 −5 . The decision tree was fine-tuned by optimizing its hyperparameters, resulting in a maximum tree depth of five, a maximum of four randomly chosen input features, a minimum sample requirement of two for splitting internal nodes, and a minimum sample requirement of one for leaf nodes. The AdaBoost model was optimized with the number of estimators set to 10, a learning rate of 0.15, and a decision tree as the base learner. For the base decision tree, the maximum tree depth was set to ten, the maximum number of randomly selected input features was three, a minimum of two samples were required to split an internal node, and the minimum number of samples at a leaf node was one, as presented in Table 1. The optimized gradient boosting model used twenty base learners, with a maximum tree depth of five, 30% of the samples used for fitting each base learner, and a learning rate set to 0.25, as listed in Table 1. Figure 3 presents the scatter plots of the experimental (M exp ) and predicted (M pred ) flexural capacities based on the optimized ML models. The green line in the scatter plots shows an ideal match between the predicted and experimental flexural capacities. The results in Figure 3 demonstrate that all ML models achieved high predictive accuracy on the training set, evidenced by their high R 2 , which ranged between 96.8% for DT to 99.8% for ADB. Nevertheless, the predictive accuracy of the models varied markedly on the test set, especially in the case of the DT model, which achieved a low R 2 of 73.3% (Figure 3c). The weak prediction of the DT model indicates overfitting and a lack of generalization ability of the algorithm. Moreover, SVM exhibited the highest accurate prediction among the single ML models with an R 2 of 97.3% and 90.2% for training and test sets, respectively. It can also be seen from Figure 3c,d that integrating decision trees into an ensemble framework, such as ADB and GB models, substantially improved the prediction accuracy and generalization capability of the models. This is evidenced by the improvement achieved in the R 2 of both ensemble models on both databases. In principle, the graphical comparison showed that the accuracy of the ADB model was comparable to that of the SVM on the test database, as evidenced by the close values of R 2 on the test datasets. However, ADB prediction achieved better distribution of the data, as the majority of the data was closer to the error bounds compared to SVM prediction. Furthermore, GB prediction exhibited the highest prediction accuracy compared to all models. This could be exemplified by the R 2 (97.3%) of the test set, which was 7.87%, 32.74%, and 7.51% higher than the SVM, DT, and ADB models, respectively. The outperformance of the GB prediction implies the effectiveness of the GB algorithm in predicting the flexural capacity of corroded RC beams. The performance of the models is further investigated and compared in the following subsection.

Comparison of Predictive Models
The efficiency of the fine-tuned ML models was rigorously evaluated by utilizing four essential statistical performance indicators: MAE, MAPE, RMSE, and R 2 . The evaluation results of the models are summarized in Table 2. Furthermore, Figure 4 presents the performance metrics in spider plots to enable visualization and comparison of the performance of each model against the others. Based on the results presented in Table 2, DT exhibited the least accuracy and a clear case of overfitting, owing to the high statistical error and low R 2 . In particular, the DT recorded MAE of 3.39 kN.m and 8.12 kN.m, MAPE of 14.61% and 37.29%, and RMSE of 5.09 kN and 11.05 kN on the training and test sets, respectively. In addition, the R 2 of the DT on the training set was as high as 96.8%, whereas on the test set, the DT model exhibited a significantly low R 2 of 73.70%. It can also be seen in Figure 4 that the spider plot of the DT prediction on the test set significantly diverged toward a higher MAPE error. This indicates that the DT model is not able to generalize well to new data and suffers from overfitting. Furthermore, it could be seen that the SVM model outperformed the DT model with a higher R 2 of 90.2% on the test dataset compared to the DT's R 2 of 73.7%, as listed in Table 2. The SVM model also exhibited lower MAE, MAPE, and RMSE on test and training datasets compared to the DT model. The SVM has 54.43%, 63.02%, and 39.10% lower MAE, MAPE, and RMSE on the test dataset, respectively, compared to the DT model. The improved accuracy of the SVM prediction can also be revealed in Figure 4, where the spider plot showed a lower error compared to the DT prediction.  On the other hand, the results showed that the ADB model has an MAE of 0.47 kN.m and 3.99 kN.m, MAPE of 1.78% and 13.98%, and RMSE of 1.3 kN.m and 6.64 kN.m on the training and test sets, respectively. Even though the ADB model recorded a high R 2 of 99.8% on the training set, the predictive performance of the model was significantly dropped on the test set, evidenced by the R 2 , which was reduced to 90.50%. This suggests that the ADB model may also be suffering from some overfitting and generalization capability. The GB demonstrated higher performance than the ADB model, with a lower error on both training and testing datasets, as can be seen in Figure 4 and Table 2. The R 2 of the GB model was recorded at 98.5% and 97.30% on the training and test sets, respectively. Furthermore, the GB prediction achieved MAE and RMSE of 2.78 and 3.56 on the test set, which is about 30.33% and 46.39% lower than those of the ADB prediction, respectively. This implies that the GB model fits the data well and performs well on both the training and test sets. Overall, the GB model exhibited the highest prediction accuracy with the highest R 2 and lowest error on the test sets among the investigated models. Thus, it can be used effectively to accurately predict the flexural capacity of corroded RC beams.

An Intelligent Prediction Tool with Fast and Accurate Results
In an earlier discussion, it was observed that the proposed GB model had excellent potential for predicting the flexural capacity of corroded RC beams. However, to make the model practically useful, there was a need to develop a GUI-based software that would be user-friendly. Therefore, a GUI software was developed for the GB model using Python programming language, and a screenshot of the tool is shown in Figure 5. The developed GUI tool is available for download via the following link: https://github.com/ twakjira/GUI-corrodedRCbeam-capacity, accessed on 5 March 2023. Figure 5 provides a visual representation of the proposed model's range of applicability. By utilizing this GUI software, we were able to accurately predict the flexural capacity of corroded beam in specimen B10-05. As shown in Figure 5, the predicted shear capacity of this specimen was 28.16 kN.m, which is highly consistent with the corresponding experimental value (M exp = 29 kN.m [8]).

Conclusions
This paper presents machine learning-based predictive models for estimating the flexural capacity of reinforced concrete beams with corroded bars. Four different ML models were established; namely, SVM, DT, ADB, and GB. The database was preprocessed and randomly divided into training and test datasets using an 80/20 training/test split ratio. The hyperparameters of the models were optimized using grid search and K-fold cross-validation. Four commonly used performance metrics, including MAE, MAPE, RMSE, and R 2 , were employed to evaluate the predictive performance of the models.
The following conclusions can be drawn from the results of this study: Finally, a user-friendly intelligent GUI-based tool has been developed to enable fast and accurate prediction of the flexural capacity of corroded RC beams, thus facilitating the practical implementation of the developed machine learning model. Further research is recommended to focus on the shear capacity of corroded RC beams using machine learning models. Additionally, future research can investigate the failure mode of RC corroded beams and develop classification-based machine learning models to predict the failure modes of the beams. Data Availability Statement: Data will be made available upon request.