1 Introduction

Concrete is an excellent man-made mixture which plays an essential role in the construction sector. As is known, various elements (e.g., water, cement, fly ash, etc.) are mixed with different ratios (i.e., dosages) to produce the concrete. Regarding the strength and performance of the concretes, they can be classified in several groups like HSCs (high-strength concretes) and SCCs (self-compacting concretes). Due to the advantages of this material, it ensures a high level of compressive stress [1]. As the most significant mechanical characteristic, the compressive strength of the concrete (CSC) is a determinant factor in evaluating the quality of this non-linear material [2]. Note that it is usually measured for 28-day concrete specimens. Up to now, many scholars have used various traditional models to evaluate and estimate the mechanical characteristics of concrete, such as CSC [3, 4].

More recently, intelligent predictive models like artificial neural network (ANN), as well as fuzzy-based systems, have received growing attention for diverse prediction aims [5,6,7]. They have also shown high robustness for simulating the CSC [8,9,10,11,12]. Khademi and Jamal [13] compared the applicability of adaptive neuro-fuzzy inference system (ANFIS) and multiple linear regression (MLR) models in estimating the 28-day CSC. Their findings revealed the superiority of the ANFIS, due to the capability of non-linear modeling of this tool. Likewise, Keshavarz and Torkian [14] showed the efficiency of ANN and ANFIS in estimating the CSC using five critical factors of cement, sand, gravel, water to cement ratio, and microsilica. Referring to the obtained correlations of 0.942 and 0.923, respective for the ANN and ANFIS, they concluded that the ANN performs more efficiently. Mandal et al. [1] introduced the ANN as a capable model for predicting the CS of HSC. They compared the results with an MLR model and showed that the ANN (with nearly 95% correlation) outperforms the MLR.

Moreover, looking for more reliable predictive models, lots of researchers have employed hybrid metaheuristic algorithms in various engineering fields [15,16,17,18]. As for the CSC simulation, these techniques have been extensively used for optimizing the performance of regular intelligent models [19,20,21]. In this sense, Behnood and Golafshani [22] used multi-objective grey wolf optimization to optimize the ANN for predicting the CS of silica fume concrete. Also, Bui et al. [23] combined the ANN with a modified firefly algorithm to develop a fast and efficient model for approximating tensile and compressive strength of high-performance concrete. Moreover, Sadowski et al. [24] coupled a multilayer perceptron (MLP) neural network with imperialist competitive algorithm (ICA) to enhance its efficiency in estimating the CSC. The results indicated the superiority of the proposed ICA-ANN model compared to particle swarm optimization (PSO) and genetic algorithm (GA).

As explained in the literature above, hybrid intelligence has been widely used for the problem of CSC estimation. The main focus of this research is to present a novel optimization of ANN, namely whale optimization algorithm (WOA) for fine-tuning the computational parameters of this model. Also, two benchmark algorithms of ant colony optimization (ACO) and dragonfly algorithm (DA) are considered to be compared with the WOA. A population-based sensitivity analysis is executed to determine the most effective structure of the proposed models, and the results are evaluated in several ways to determine the elite neural ensemble.

2 Methodology

The overall methodology that is taken to achieve the goal of this research is depicted in Fig. 1. In this regard, after providing the dataset, it is randomly divided into the training and testing samples with the well-known proportion of 80:20 [25,26,27]. In other words, out of 103 data, 82 samples are used to train the proposed models, and the remaining 21 samples are put aside as unseen concrete conditions for evaluating the generalization capability of the developed models. The WOA algorithm as well as the ACO and DA (as benchmark models) are then synthesized with the MLP neural network to adjust the computational parameters. Note that the best-fitted structure of the mentioned models is determined through a trial-and-error process. Finally, the accuracy of the WOA-NN, ACO-NN, and DA-NN predictive tools is evaluated by means of three well-known criteria. As Eq. 1 denotes, the determination coefficient (R2) is used to measure the correlation between the actual and predicted CSC. Also, root mean square error (RMSE), as well as mean absolute error (MAE), is used to measure the error of the prediction. Equations 2 and 3 define the formulation of the MAE and RMSE, respectively.

Fig. 1
figure 1

The graphical methodology of the present study

$$R^{2} = 1 - \frac{{\sum\limits_{i = 1}^{N} {(Y_{{i_{\text{predicted}} }} - Y_{{i_{\text{observed}} }} )^{2} } }}{{\sum\limits_{i = 1}^{N} {(Y_{{i_{\text{observed}} }} - \overline{Y}_{\text{observed}} )^{2} } }},$$
(1)
$${\text{MAE}} = \frac{1}{N}\sum\limits_{I = 1}^{N} {|Y_{{i_{\text{observed}} }} - Y_{{i_{\text{predicted}} }} |} ,$$
(2)
$${\text{RMSE}} = \sqrt {\frac{1}{N}\sum\limits_{i = 1}^{N} {[(Y_{{i_{\text{observed}} }} - Y_{{i_{\text{predicted}} }} )]}^{2} } ,$$
(3)

where \(Y_{{i_{\text{predicted}} }}\), \(Y_{{i_{\text{observed}} }}\), and \(\bar{Y}_{\text{observed}}\) are the predicted, actual, and the average of the actual values of the CSC. Besides, the term N denotes the number of samples.

The description of the used algorithms is presented below:

2.1 Whale optimization algorithm

The name whale optimization algorithm (WOA) indicates a new metaheuristic technique that is inspired by the bubble-net hunting conduction of humpback whales (Fig. 2) [28]. It is known as a swarm-based intelligent approach designed for solving various complex optimization issues with continuous domain [29,30,31]. The whales in the swarm seek their prey within a multidimensional space. The location of each relation is demonstrated as the decision variable, where the cost function is defined as the distance between each whale concerning the prey position. The function of time-constraint as a location for the whales can be evaluated using the below operational steps [28, 32]:

Fig. 2
figure 2

The humpback whales bubble-net feeding (after [28])

  1. (a)

    Shrinking encircling hunt,

  2. (b)

    Exploitation phase (i.e., the bubble-net attacking)

  3. (c)

    Exploration phase (i.e., searching for the prey).

As Fig. 3 illustrates, when the position of the proposed prey is recognized, the humpback whales begin to encircle it through moving in nine shapes. The WOA remarks the target prey as the most appropriate candidate solution (or close to the elite solution) because it has no information about the optimal location of the prey within the search area. It takes into consideration every possible attempt for finding the elite search agent. Notably, other involved relations aim to update their positions close to the elite one.

Fig. 3
figure 3

The spiral updating process

$$\vec{D} = \left| {C \cdot \overrightarrow {{X^{*} }} (t) - \vec{X}(t)} \right|,$$
(4)
$$\vec{X}(t + 1) = \overrightarrow {{X^{*} }} (t) - A \cdot \vec{D},$$
(5)
$$A = 2 \cdot a \cdot r - a,$$
(6)
$$C = 2 \cdot r,$$
(7)

in which \(\vec{X}\) indicates the whale location, \(\vec{X}^{*}\) stands for the universal elite position, and t demonstrates the recent try. Also, a is decreased from 2 to 0 linearly, and r stands for a random number which is distributed equally between 0 and 1. The stages are explained in the following:

  1. (a)

    Exploitation:

Figure 4 illustrates the bubble-net hunting conduct of the WOA algorithm. The equidistance between the positions of the whale and the prey is detected by applying a spiral mathematical approach. The position of the whale (in a helix environment) is aimed to be adjusted after each movement [33]:

Fig. 4
figure 4

Exploitation phase

$$\vec{X}(t + 1) = e^{bk} \cdot { \cos }\left( {2\pi k} \right) \cdot \overrightarrow {{D^{\prime} }} + \overrightarrow {{X^{*} }} (t),$$
(8)
$$\overrightarrow {D'} = \left| {\overrightarrow {{X^{*} }} (t) - \vec{X}(t),} \right|$$
(9)

where b and k show constant and arbitrary numbers, notably, b symbolizes the logarithmic spiral shape and k is distributed equally from − 1 to 1.

  1. (b)

    Exploration

As Fig. 5 shows, when A > 1 or A < − 1, the search agent upgraded by a randomly selected colleague at the location of the elite agent:

Fig. 5
figure 5

Exploration phase

In this way we have

$$\vec{X}(t + 1) = \overrightarrow {{X_{\text{rand}} }} - A \cdot \overrightarrow {{D^{\prime}}} ,$$
(10)
$$\overrightarrow {{D^{\prime\prime}}} = \left| {\vec{C} \cdot \overrightarrow {{X_{\text{rand}} }} - \vec{X}(t)} \right|,$$
(11)

in which \(C \cdot \overrightarrow {{X_{\text{rand}} }}\) shows arbitrarily of whales for the proposed iteration. It has been better detailed in [28]. Also, the pseudocode of this algorithm is presented in Fig. 6.

Fig. 6
figure 6

The pseudocode of the WOA algorithm

2.2 Benchmark hybrids algorithms

As mentioned, two other natural-inspired population-based metaheuristic algorithms, namely the dragonfly algorithm (DA) and ant colony optimization (ACO), are considered as the benchmark models to be compared with the proposed WOA algorithm. As their name connotes, these algorithms are inspired by the herding behavior of natural dragonflies and ants. The DA was introduced by Mirjalili [34] in 2016, and the idea of the ACO algorithm was first presented by Colorni et al. [35] in the early 1990s. With the flowchart being similar to other optimization techniques, these methods get started by producing a random population. In the following, the fitness of the suggested solution is evaluated by an objective function. The solution requires to be updated and improved in iteration, which means higher accuracy for the problem. The algorithms continue this process until a stopping criterion (e.g., the desired accuracy or the maximum number of repetitions) is met. These methods are well detailed in earlier studies, like [36, 37] for ACO, and [38, 39] for DA.

3 Data collection and statistical analysis

The reference work for the used dataset is research by Yeh [40], which gathered the information of 103 concrete tests for simulating the slump of concrete. The used dataset is available here. As well as slump, this dataset consists of flow and 28-day compressive strength of concrete as output variables. We selected the compressive strength (MPa) to model in this work. The considered influential variables (i.e., input factors) are cement, slag, water, fly ash, superplasticizer (SP), fine aggregate (FA), and coarse aggregate (CA). Figure 7 illustrates the graphical relationship between the CSC and its influential factors. Moreover, the results of statistical analysis of the mentioned parameters are presented in Table 1.

Fig. 7
figure 7

The graphical description of the CSC influential factors

Table 1 Statistical description of the used dataset

4 Results and discussion

As mentioned, this study addresses a novel optimization of artificial neural networks for predicting the compressive strength of concrete. To this end, the whale optimization algorithm is considered as the metaheuristic algorithm for optimizing the structure of a back-propagation MLP network. Moreover, the performance of the proposed WOA algorithm is evaluated by comparing with two benchmark methods which are inspired by the herding behavior of artificial ants and dragonflies. More clearly, these algorithms are applied to the mathematical ruling relationship of the MLP to find the most suitable options for the connecting weights as well as the biases. This process is carried out using the programming language of MATLAB 2014. This is worth noting that, based on the authors’ experience as well as a trial-and-error process, five hidden neurons were found to be the most appropriate number of the hidden computational units.

4.1 Optimizing the MLP using ACO, DA, and WOA conventional techniques

A population-based sensitivity analysis is executed to acquire the best architecture of the used models. In this sense, nine different complexities of the models (i.e., nine population sizes of 10, 25, 50, 75, 100, 200, 300, 400, and 500) are tested within 1000 repetitions. Also, the RMSE is considered as the objective function to measure the error at the end of each iteration. Figure 8a–c illustrates the convergence curves of the optimization process of the used ACO-NN, DA-NN, and WOA-NN ensembles, respectively. As is seen, all three algorithms show different behaviors in optimizing the MLP. The ACO keeps decreasing the error until the last try, while the DA and WOA perform the majority of the error reduction within the first 400 iterations, and remain more and less steady after that. The results showed that the optimal values of the RMSE were 1.96184548, 1.849893333, and 1.357585418, obtained for the ACO-NN, DA-NN, and WOA-NN with population sizes of 10, 400, and 400, respectively.

Fig. 8
figure 8

The sensitivity analysis based on the model complexity for the a ACO-NN, b DA-NN, and c WOA-NN

The calculation time of the implemented models (the selected structures) is depicted in Fig. 9. From this figure, it can be seen that executing the ACO-NN took the lowest time (nearly 600 s). Moreover, the WOA- and DA-based neural ensembles, which used the same complexities (i.e., population sizes), took approximately 5271 and 7620 s, respectively. On the other hand, due to the lower objective function obtained for the WOA-NN, it can be concluded that this algorithm outperforms the DA-NN in terms of time-effectiveness. Remarkably, the proposed models were implemented on the operating system at 2.5 GHz and 6 Gigs of RAM.

Fig. 9
figure 9

The computation time of the used ensembles

4.2 Accuracy assessment of the implemented predictive models

After determining the best structures, the results of the models were evaluated and compared by means of the RMSE, MAE, and R2 indices. The products of the training and testing phases were compared with the desired targets to measure the accuracy of the results. Figure 10 shows the regression of the results alongside the histogram of the errors for the training phase. Note that, in this figure, the error is calculated as the difference between the observed and predicted CSCs. Likewise, the testing results are presented in Fig. 11. Based on these figures, all three used models performed satisfactorily for predicting the CSC. This is also deduced that all three models had higher accuracy in discerning the relationship between the CSC and the mentioned influential factors (i.e., the training dataset), in comparison with estimating the CSC with unseen conditions (i.e., the testing dataset).

Fig. 10
figure 10

The training results obtained for a, b ACO-NN, c, d DA-NN, and e, f WOA-NN predictions

Fig. 11
figure 11

The testing results obtained for a, b ACO-NN, c, d DA-NN, and e, f WOA-NN predictions

Based on the presented histogram charts, the frequency of the errors around 0 seems higher in the result of the WOA-based ensemble in both training and testing phases. This claim can also be supported by considering the obtained values of the standard error (SE). Accordingly, the SE is calculated 1.9739 and 3.5301 for the ACO-NN, and 1.8612 and 3.3716 for the DA-NN, respectively, in the training and testing samples. This is while these values are obtained as 1.3659 and 2.6387 for the WOA-NN.

Moreover, Table 2 summarizes the obtained values of RMSE, MAE, and R2 for all three used models. According to this table, the proposed WOA surpassed the benchmark algorithms of ACO and DA in both training and testing stages. More clearly, the WOA-NN (RMSE = 1.3576 and MAE = 1.0757) presented a higher learning quality (i.e., in the training phase), compared to the ACO-NN (RMSE = 1.9618 and MAE = 1.5282) and DA-NN (RMSE = 1.8499 and MAE = 1.4786). Moreover, the obtained values of R2 (0.9410, 0.9443, and 0.9700, respectively, for the ACO-NN, DA-NN, and WOA-NN ensembles) showed a higher correlation between the products of the WOA-based neural network and the actual CSCs. It was also deduced that the DA was more successful than ACO in optimizing the MLP. Investigating the testing result showed that the generalization power of the models is directly related to the learning capability. In other words, the calculated testing RMSEs (3.4452, 3.3325, and 2.6985), as well as the MAEs (2.8843, 2.5138, and 2.0746), revealed that the WOA estimated the CSC more accurately than ACO and DA. Referring to the obtained values of R2 (0.8000, 0.8209, and 0.8976), the WOA produced the most reliable results, followed by the DA and ACO algorithms.

Table 2 The calculated accuracy criteria for the performance of the implemented models

In overall, the results indicated the superiority of the developed WOA-NN technique in both training and testing phases and it could be a robust alternative to traditional model in CSC evaluation. It provides an inexpensive yet accurate predictive model for investigating the relationship between this crucial characteristic of concrete and influential factors. Also, the higher learning accuracy of the model indicates the more capability in generalizing the learned pattern. In other words, there was no discrepancy between the performance of all three models in the learning and predicting the pattern of the CSC in this study. Moreover, considering the calculation time as another determinant factor for the efficiency of the used models, it was deduced that the WOA is more time-effective compared to the DA.

5 Conclusions

Due to the crucial role of concrete in building construction, having a reliable approximation of the characteristics of this material is essential. In this work, the compressive strength of concrete was modeled using a novel hybrid predictive model. In this way, the MLP neural network was coupled with WOA optimization technique to develop the WOA-NN ensemble. Also, the ACO-NN and DA-NN tools were used as the benchmark models. The results of the sensitivity analysis revealed that both DA-NN and WOA-NN presented the best results with population sizes of 400, while the ACO-NN with the least population (i.e., population size = 10) outperformed other similar networks. According to the results, the proposed WOA-NN model predicted the CSC with high accuracy. Besides, in comparison with the benchmark methods, the WOA algorithm (RMSE = 2.6985 and R2 = 0.8976) surpassed the ACO (RMSE = 3.4452 and R2 = 0.8000) and DA (RMSE = 3.3325 and R2 = 0.8209) evolutionary techniques in optimizing the MLP. Moreover, other than the higher accuracy, the WOA needed less calculation time than DA. Last, evaluating the performance of the WOA in comparison with other well-known hybrid algorithms is a good idea for future studies.