BAT Algorithm-Based ANN to Predict the Compressive Strength of Concrete—A Comparative Study

The number of effective factors and their nonlinear behaviour—mainly the nonlinear effect of the factors on concrete properties—has led researchers to employ complex models such as artificial neural networks (ANNs). The compressive strength is certainly a prominent characteristic for design and analysis of concrete structures. In this paper, 1030 concrete samples from literature are considered to model accurately and efficiently the compressive strength. To this aim, a Feed-Forward (FF) neural network is employed to model the compressive strength based on eight different factors. More in detail, the parameters of the ANN are learned using the bat algorithm (BAT). The resulting optimized model is thus validated by comparative analyses towards ANNs optimized with a genetic algorithm (GA) and Teaching-Learning-Based-Optimization (TLBO), as well as a multi-linear regression model, and four compressive strength models proposed in literature. The results indicate that the BAT-optimized ANN is more accurate in estimating the compressive strength of concrete.


Introduction
Civil engineers have always been interested in estimating the properties of concrete as a composite material by utilizing analytical models, as well as investigating the effect of each component of the mix design on its properties. The first step in all rehabilitation projects is to obtain information about the current conditions of the structure and its analysis. In this regard, using field experiments to perform this evaluation is very important. In these projects, destructive experiments are used to achieve more accurate results, which involve high costs and structure destruction [1]. The application of artificial neural networks and evolutionary optimization algorithms to determine concrete's compressive strength has received a lot of attention in recent years [2].
Many studies on the use of artificial neural networks (ANNs) to assess the compressive strength of concrete (f' c ) have been conducted in recent decades. Artificial neural network models have proved to be superior for the determination of concrete compressive strength in Alto Sulcis Thermal Power Station in Italy [3], in-place concrete strength estimation to facilitate concrete form removal and scheduling for construction [4], prediction of compressive strength of concrete subject to lasting sulfate attack [5], determination of low-, medium-, and high-strength concrete strength [6], accurate assessment of compressive

BAT Algorithm
By utilizing their sophisticated echolocation facilities, bats can avoid obstacles and detect prey. Utilizing the time interval between a pulse emission and its echo, they Figure 1. Architecture of the optimum ANN developed in the present study. This architecture includes eight input nodes, seven nodes in the first hidden layer, four nodes in the second hidden layer, and one node (f' c ) in the output layer.

BAT Algorithm
By utilizing their sophisticated echolocation facilities, bats can avoid obstacles and detect prey. Utilizing the time interval between a pulse emission and its echo, they develop a three-dimensional depiction of their surrounding [27]. Inspired by this behaviour of bats, Yang [28] developed the BAT algorithm. In the algorithm idealization it is assumed that: • bats use echolocation, and they can discern between prey and surroundings; • at any given location x i , they fly randomly with velocity v i and contingent upon the location of prey they adjust their rate of pulse emission; • the loudness of the emitted pulse ranges from A 0 to a minimum value of A min . Firstly, the BAT algorithm initializes a random population of bats, and then updates their frequencies using Equation (1) [29]: where f i is the i-th bat frequency, f min is the min frequency, f max is the max frequency, and β is a random quantity between 0 and 1. The location and velocity of bats are revised according to: where V t i is the i-th bat velocity at recurrence t, x i t is the i-th bat position at recurrence t, and x * is the global best position. Then, the procedure shifts some bats to a vicinity of the top global location as: where A denotes loudness and ε is a random quantity between 0 and 1. The criterion for accepting the new position of each bat is a cost value less than the previous iteration. The algorithm then revises the pulse rate and loudness using Equations (5) and (6): where α is a constant typically selected between zero and one, r 0 i is the initial pulse rate and γ is a constant.
This algorithm can be utilized to train an ANN. In the present application, the weights and biases of the network are considered as the position vector of a bat, and therefore each bat represents a vector of weights of an artificial neural network. The cost function is the prediction error of the network. The final solution of the bat algorithm results in a trained network [29].

Dataset
The dataset utilized in this study was used to follow the schematic procedural steps proposed in Figure 2. More precisely, according to [12], it consists of 1030 concrete compressive strength test results from various sources. The influencing parameters on the concrete compressive strength are cement, blast furnace slag, fly ash, water, superplasticizer, coarse aggregate, and fine aggregate age. Table 1 gives the descriptive statistics of samples from [12]. The selected target value is the 28-day compressive strength of concrete.    Following Figure 3, where the histogram for the 28-day compressive strength for concrete specimens is proposed, it can be observed that 780 samples have compressive strength values ranging from 10 to 50 MPa.  If the ANN input variables have different ranges, the training process can suffer from adverse impacts, such as the optimization divergence of algorithm and increased training time [30]. Using Equation (7), each variable was hence normalized into the range from −1 to 1, that is [31]: where Y is the original value of the variable, Yn is the normalized value, Ymax is the max, and Ymin is its min value. Table 1 shows the minimum and maximum values and the target values of concrete compressive strength used for each of the eight input parameters. It is worth noting that the ANN will undergo training using the normalized data. Therefore, it is essential to feed the network with normalized variables when using the ANN to predict new values and un-normalize the data (i.e., transferring them into their original range, the network outputs).

Performance Measures
Statistical measures are employed to determine the model accuracy. Using the statistical index helps choose the best model with the least error and select the model with the most generalizability.
The statistical measures employed in evaluating the accuracy of different topologies are Mean Error (ME), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) [32]: If the ANN input variables have different ranges, the training process can suffer from adverse impacts, such as the optimization divergence of algorithm and increased training time [30]. Using Equation (7), each variable was hence normalized into the range from −1 to 1, that is [31]: where Y is the original value of the variable, Y n is the normalized value, Y max is the max, and Y min is its min value. Table 1 shows the minimum and maximum values and the target values of concrete compressive strength used for each of the eight input parameters. It is worth noting that the ANN will undergo training using the normalized data. Therefore, it is essential to feed the network with normalized variables when using the ANN to predict new values and un-normalize the data (i.e., transferring them into their original range, the network outputs).

Performance Measures
Statistical measures are employed to determine the model accuracy. Using the statistical index helps choose the best model with the least error and select the model with the most generalizability. The statistical measures employed in evaluating the accuracy of different topologies are Mean Error (ME), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) [32]: where P i and O i represent predicted and observational data, and n represents the number of cases.

Experimental Model Generation Utilizing ANNs and BAT Algorithm
Eight input factors, influencing the concrete compressive strength, are used in the suggested model. Thus, trained artificial neural networks have eight nodes in the input layer and one node in the output layer ( Figure 2). Networks with one or two hidden layers have been used for modelling. A network can have a very high performance in the training phase but may not show the same accuracy in the testing phase. Hence, it is better to randomly bifurcate the data and with a suitable ratio for each stage [33]. To this end, the data were randomly split into two groups to reduce overfitting effects. For training, 70% of data (721 samples) were used and the remaining 30% (309 pieces) were used to test network performance. For an artificial neural network model, the number of hidden layers and the total number of nodes in the hidden layers depends on the problem [34]. Accordingly, trial-and-error was used to obtain the ideal topology (i.e., the topology that best represents the data). A common formula for the total number of nodes in an ANN is given in Equation (12) [35]: where N H is the number of neurons in the hidden layer and N I is the number of inputs to the network. Since there are eight factors, the equation indicates that the number of hidden layer nodes must be less than 17. Thus, different architectures have a maximum of two hidden layers and a maximum of 17 trained neurons. In mode one, the network hidden layer has a maximum of 17 neurons in the hidden layer. In mode two, the hidden layer has one to nine neurons. A total of 89 different architectures were selected for training. The topologies used are given in Table 2. Note: n 1 -n 2 format for topologies denotes n 1 neurons in the first hidden layer, and n 2 neurons in the second hidden layer. The tanh function was picked as the transfer function of the nodes in the hidden layer in all the ANNs. Meanwhile, the identity relation was selected as the transfer function of the nodes in the output layer. The bat algorithm was then used to refine the parameters of the artificial neural network to result in the least predictive error. The bat algorithm and ANNs were developed using MATLAB [36]. The hyperparameters of the bat algorithm used for training the 89 ANN topologies are given in Table 3.

Experimental Model Assessment
The number of used models was set to 89. In addition, one-layer and two-layer artificial neural networks were used. The bat optimization algorithm is used to refine the weights of the network. The transfer function for all networks is the tanh function. Among the models trained to determine concrete compressive strength, four models were selected as the best models based on parameters presented in Section 3.2. The error metrics of these models in the training phase are given in Table 4. The test results of the models are given in Table 5. Note: ANN-BAT-(m)L (n 1 -n 2 ) format denotes m hidden layers, n 1 neurons in the first hidden layer and n 2 neurons in second hidden layer.  and test data, respectively. The predictions of the network are near the identity function values, which suggests that the network is highly accurate.
According to Tables 4 and 5, the ANN-BAT-2L (7-4) network has the lowest MSE, ME, MAE, and RMSE indices. For this network, the value in the training and testing phases is equal to 0.9395 and 0.9134, respectively, supporting the model's high precision. The test phase values in MSE, ME, MAE, and RMSE indices are equal to 27.624, −0.664, 3.847 and 5.256, respectively, indicating high modelling precision in forecasting the concrete's compressive strength. Error metrics for samples are given based on the original range of variables.
To visualize the accuracy of ANN-BAT-2L (7-4), the experimental model predicted values versus their values from the experiment are shown in Figures 4 and 5 for the train and test data, respectively. The predictions of the network are near the identity function values, which suggests that the network is highly accurate.

Comparison with Other Methods
To assess the accuracy of the model trained using bat optimization, three models have also been trained using other methods. Two models are ANNs trained with the genetic algorithm (GA) and Teaching-Learning-Based-Optimization (TLBO). The third is an MLR model.
The genetic algorithm is an optimization technique based on genetics and natural selection theories. It commences by generating a population of individuals and evolves them under specific selection, cross-over, and mutation rules to minimize the cost function. In this paper, individuals were the parameters of the ANN, and the final solution was the trained network.
Inspired by the teaching-learning process, the TLBO algorithm generates a population of students and designates the one with least cost to be the teacher. The remaining students then learn from the teacher, i.e., move toward the teacher's position in solution space. In the next phase, students learn by interacting with each other, i.e., a given student (solution) interacts randomly with another student and if the second student has more knowledge (has lower cost), the first student moves towards the second [37]. In the present study, the parameters of ANN were designated as students, and the final iteration of the TLBO algorithm resulted in a trained ANN. The 89 topologies presented in Table 2 were used to train ANNs using the GA and TLBO to find the best ANN topology. The hyperparameters of these two algorithms are listed in Table 6.

Comparison with Other Methods
To assess the accuracy of the model trained using bat optimization, three models have also been trained using other methods. Two models are ANNs trained with the genetic algorithm (GA) and Teaching-Learning-Based-Optimization (TLBO). The third is an MLR model.
The genetic algorithm is an optimization technique based on genetics and natural selection theories. It commences by generating a population of individuals and evolves them under specific selection, cross-over, and mutation rules to minimize the cost function. In this paper, individuals were the parameters of the ANN, and the final solution was the trained network.
Inspired by the teaching-learning process, the TLBO algorithm generates a population of students and designates the one with least cost to be the teacher. The remaining students then learn from the teacher, i.e., move toward the teacher's position in solution space. In the next phase, students learn by interacting with each other, i.e., a given student (solution) interacts randomly with another student and if the second student has more knowledge (has lower cost), the first student moves towards the second [37]. In the present study, the parameters of ANN were designated as students, and the final iteration of the TLBO algorithm resulted in a trained ANN.

Genetic Algorithm and Teaching-Learning-Based-Optimization Models
The 89 topologies presented in Table 2 were used to train ANNs using the GA and TLBO to find the best ANN topology. The hyperparameters of these two algorithms are listed in Table 6. The TLBO algorithm-trained ANN with 5-6 topologies and the GA-trained ANN with the 3-5 topologies have the highest performance, as shown by the statistical indices in Table 7.  The hyperparameters of these models were set by trial-and-error. Their values are provided in Table 7. These two networks that are optimized using GA and TLBO algorithms have a much higher prediction error compared to bat-trained neural networks. To visualize the performance of GA and TLBO, the predicted values of the experimental model versus their values from the experiments are shown in Figures 6 and 7 for test data. Note: ANN-(A)-(m)L (n1-n2) format denotes algorithm A, m hidden layers, n1 neurons in the first hidden layer and n2 neurons in second hidden layer.    Note: ANN-(A)-(m)L (n1-n2) format denotes algorithm A, m hidden layers, n1 neurons in the first hidden layer and n2 neurons in second hidden layer.

Multi Linear Regression Model
As suggested by Nikoo et al. [38], an MLR model was developed using the Minitab software as an easy-to-use classical model [39]. According to the model, each factor influence can be estimated by examining the regression coefficient values [40][41][42] In Equation (13) The statistical metrics of the MLR model are given in Table 8, and Figure 8 depicts the results obtained for observed versus predicted test data.

Multi Linear Regression Model
As suggested by Nikoo et al. [38], an MLR model was developed using the Minitab software as an easy-to-use classical model [39]. According to the model, each factor influence can be estimated by examining the regression coefficient values [40][41][42]. The resulting regression equation is as follows: In Equation (13) The statistical metrics of the MLR model are given in Table 8, and Figure 8 depicts the results obtained for observed versus predicted test data.

Comparison on All Data
The ANN-BAT-2L (7-4) is compared with the GA-and TLBO-based ANNs to validate its accuracy on all data. The MLR model is also employed as a statistical model for comparison. The results are given in Table 9.

Comparison on All Data
The ANN-BAT-2L (7-4) is compared with the GA-and TLBO-based ANNs to validate its accuracy on all data. The MLR model is also employed as a statistical model for comparison. The results are given in Table 9.  Table 9 highlights that the ANN-TLBO model performs better than the ANN-GA model, and the MLR model has the weakest results. However, the ANN-BAT model offers the highest accuracy in determining the compressive strength of concrete of all models. The comparison between observed and predicted compressive strength of all models are shown in Figures 9-12.  Table 9 highlights that the ANN-TLBO model performs better than the ANN-GA model, and the MLR model has the weakest results. However, the ANN-BAT model offers the highest accuracy in determining the compressive strength of concrete of all models. The comparison between observed and predicted compressive strength of all models are shown in Figures 9-12.     Table 9 highlights that the ANN-TLBO model performs better than the ANN-GA model, and the MLR model has the weakest results. However, the ANN-BAT model offers the highest accuracy in determining the compressive strength of concrete of all models. The comparison between observed and predicted compressive strength of all models are shown in Figures 9-12.

Comparative Analysis with Models Proposed in Literature
The developed experimental model is compared to four proposed models in literature using the same sample data. The comparison is over all data and is not divided into training and testing groups. The description of models used is given in Table 10, and the error metrics of various models are given in Table 11. As it can be seen from Table 11, the ANN-BAT-2L (7-4) model outperforms the other four models proposed in literature.

Predictive Model and ANN Weights
The best model presented in this study is ANN-BAT-2L . To calculate the output of this model manually, the matrices of network parameters are needed. The network input must be scaled using Equation (7) into −1 to 1 range, and the predicted value must then be unscaled into its original range. The input is an 8 × 1 vector called a 1 , where the eight parameters are cement, blast furnace slag, fly ash, water, superplasticizer, coarse aggregate, and fine aggregate age respectively. The following equations can be utilized to produce the ANN-BAT-2L (7-4) model predictions: where a j and ϑ j matrices represent the outputs and weights of layer j respectively and b j vector represents its biases. tanh is the hyperbolic tangent function, and T superscript represents transpose operator. f predict is the predicted value of compressive strength, and f max and f min are the min and max compressive strengths of data given in Table 1. Table 12 provides the weights and biases of the neural network.

Conclusions
The use of accurate models plays a vital role in the design and analysis of civil engineering structural members and systems. In this regard, the present study focused on the prediction of the compressive strength of concrete based on efficient and accurate ANNs. The learning of the ANN parameters was done using the bat optimization algorithm by using 1030 experimental results published literature. Several ANN models were in fact trained (89 in total) using the bat algorithm. The top performing model was then compared with networks trained using GA and TLBO algorithms, MLR model, and four proposed compressive strength models published in literature. The main results can be summarized as follows: 1.
The top-performing bat-based ANN model, ANN-BAT-2L (7-4), yielded a mean squared error of 27.624 on testing data.

2.
Due to its simplicity, a classical MLR model was presented for predicting compressive strength; however, it is less accurate than the proposed ANN-BAT model.

3.
The top-performing bat algorithm-based ANN was compared with ANNs trained using GA and TLBO algorithms. The top models based on these algorithms were ANN-GA-2L (3-5) and ANN-TLBO 2L (5-6); however, they were less accurate than the ANN-BAT-2L (7-4) model. The next best performing ANN was the TLBO-based, followed by GA-based, and the MLR model.

4.
The top-performing bat algorithm-based ANN was compared with four predictive models proposed in literature for compressive strength of concrete. The bat-based ANN outperformed all four. 5.
The network parameters, i.e., weights and biased of the ANN-BAT-2L (7-4) model were provided in tabular format for manual calculation of network prediction. Thus, for desired and new concrete samples, the compressive strength can be estimated by providing the presented formulas with sample inputs.
Author Contributions: This research paper results from a joint collaboration of all the involved authors. All authors contributed to the paper drafting. All authors have read and agreed to the published version of the manuscript.
Funding: This research study did not receive financial funding.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Data will be shared upon request.