1 Introduction

The resistance of the soil for sustaining load (against shearing stresses) reflects soil shear strength (SSS). In many civil/geotechnical engineering projects, the safety and cost of the work are highly dependent on the SSS parameters [1, 2]. Various analytical and numerical methods, up to now, have been proposed for analyzing the SSS and its parameters [3, 4]. Gao et al. [5] investigated the impact of soil type on the SSS. Also, they proposed new equations for unsaturated soil by taking the relationship between the average skeleton stress and the suction over a wide suction range. Likewise, the effect of water content and fractal dimension on the SSS (for red soil in southern China) was evaluated by Zhang et al. [6]. Zhai et al. [7] used soil–water characteristic curve for estimating the SSS. Regarding the complicated relationship between the soil parameters and shear strength, many scholars have recommended the use of machine learning models as more reliable predictors, due to their high capability in the nonlinear analysis [8, 9].

In this sense, different types of artificial intelligence techniques have been successfully used for predicting many geotechnical parameters [9,10,11,12,13,14,15]. Mola-Abasi and Eslami [16] evaluated the efficiency of group method of data handling (GMDH) artificial neural network (ANN) for estimating two parameters of cohesion and friction angle, which are essential in measuring the SSS. Jokar and Mirasi [17] compared the neuro-fuzzy system with empirical approaches in SSS prediction and found that the results of both “c-mean” and “subtractive” clustering models of this system are more accurate than empirical ones. Various attempts for proving the efficiency of ANNs can be found in earlier literature [18,19,20,21,22,23,24,25]. But utilizing the ANNs, sometimes, meets with some computational drawbacks like trapping in local minima. To remedy this problem, scholars have suggested employing metaheuristic search schemes.

By combining metaheuristic algorithm, scholars have achieved powerful predictors for the simulation of soil parameters [26,27,28,29,30,31,32,33,34,35]. Moayedi et al. [9] suggested four wise metaheuristic optimizers including elephant herding optimization (EHO), shuffled frog leaping algorithm (SFLA), wind-driven optimization (WDO), and salp swarm algorithm (SSA) for optimizing the performance of ANN to predict the SSS. Their case study was a local project in Vietnam. Evaluation of the results revealed that the SSA (with the error of 0.0386 and around 82% correlation) is the most powerful optimizer. The foraging behavior of animals (like grasshopper and Harris hawk), invasive weed growing process, and sports league scheduling were studied by Moayedi et al. [36], Nagaraju et al. [37], and Moayedi et al. [38] for predicting the compression coefficient of soil. Samui et al. [39] investigated the efficiency of artificial bee colony algorithm for the same objective and showed that the proposed hybrid model (with a mean absolute percentage error of 12.58% and correlation of 84.1%) outperforms typical ANN. Bui et al. [40] tested the applicability of cuckoo search optimization for adjusting the hyperparameters of an SVM-oriented model. The proposed ensemble was fed by data collected from an expressway project in Vietnam to estimate the SSS. The findings proved the superiority of the algorithm over popular predictors like ANN and regression tree. Further attempts in the field of metaheuristic algorithms for SSS modeling can be found in studies like [41, 42].

This paper suggests the application of a novel notion of recently developed optimizers, namely evaporation rate-based water cycle algorithm (ER-WCA) for the problem of soil shear strength modeling. Going through the literature shows that recent studies have been mostly dedicated to testing new methodologies (e.g., shuffled frog leaping algorithm [43], ant lion optimization [44], genetic algorithm [45]) in order to find the best-fitted SSS predictive model. This paper, therefore, provides supplementary information by evaluating the ER-WCA algorithm. According to the best knowledge of the authors, in spite of high capability [46,47,48,49,50,51], this algorithm has been previously used neither for neural network optimization, nor SSS analysis.

2 Methodology

The steps that need to be taken for fulfilling the objective of the study are shown in Fig. 1. In this regard, after a field survey and providing the soil information, the data are arranged in Excel format. As will be explained in the following, they are then divided into two sets for training and testing the models. On the other side, the WCA algorithm which is modified by evaporation-based relationships is applied to an ANN to create the proposed hybrid tool. After sensitivity analysis and complexity optimization, this model, along with typical ANN, is implemented to predict the SSS. The results are evaluated by popular accuracy criteria, and the effects of the applied metaheuristic algorithm are assessed.

Fig. 1
figure 1

Methodology applied in the current research

2.1 Artificial neural network

Recent advances in soft computing have resulted in the advent of capable predictive models. ANN is almost the most well-known notion of intelligent models, designed by simulating the mechanism of the biological neural system [52, 53]. The main neural processors are called neurons which are completely connected by weights. An ANN originally benefits the Levenberg–Marquardt training algorithm [54] and backpropagation adjustment method [55] for tuning the parameters. In this method, after each completed epoch, the error is calculated and propagated in a backward direction to be reduced. This enhancement in accuracy is achieved by adjusting the weights and biases.

Multilayer perceptron (MLP) [56] is a capable type of ANNs with at least three layers. The neurons are embedded in these layers. Figure 2 shows the calculation process in a neuron. As is seen, after receiving the input (I), a weight factor (W) is assigned, and then, the bias term (b) is added. Depending on the selected activation function (f), the resulted value is then released as the neuron output (O). The structure of the used MLP network will be better discussed in the next section.

Fig. 2
figure 2

General structure of the MLP neural network

2.2 Evaporation rate-based water cycle algorithm

Evaporation rate-based water cycle algorithm (ER-WCA) is one of the most recent search schemes proposed by Sadollah et al. [47]. It presents a modified version of the WCA algorithm [57]. The WCA is a nature-inspired algorithm based on the water cycle process and flowing of water streams toward the sea. In the water (or hydrologic) cycle, water in streams is evaporated and plants transpire it by doing photosynthesis. The vapor moves to the air and generates clouds. Under weather conditions, the water returns to the earth in different forms [58]. The rivers, in this algorithm, are chosen as individuals with high goodness, and the remaining streams are called streams. Assuming K as the problem dimension, the candidate streams will be x1, x2,…, xK. The initial population is randomly generated as follows:

$$ {\text{Total population}} = \left[ {\begin{array}{*{20}c} {{\text{Sea}}} \\ {{\text{ River}}_{{1}} } \\ {{\text{River}}_{{2}} } \\ \vdots \\ {{\text{Stream}}_{{K_{{\text{sr } + \text{ 1}}} }} } \\ {{\text{Stream}}_{{K_{{\text{sr } + \text{ 2}}} }} } \\ \vdots \\ {{\text{Stream}}_{{K_{{{\text{pop}}}} }} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {x_{1}^{1} } & {x_{2}^{1} } & \ldots & {x_{K}^{1} } \\ {x_{1}^{2} } & {x_{2}^{2} } & \ldots & {x_{K}^{2} } \\ \vdots & \vdots & \vdots & \vdots \\ {x_{1}^{{K_{{{\text{pop}}}} }} } & {x_{2}^{{K_{{{\text{pop}}}} }} } & \ldots & {x_{N}^{{K_{{{\text{pop}}}} }} } \\ \end{array} } \right] $$
(1)

where \(K_{{{\text{pop}}}}\) gives the size of the population. The flow intensity is then calculated for each algorithm using Eq. 2:

$$ {\text{Cos}} {\text{t}}_{i} = f(x_{1}^{i} ,x_{1}^{i} ,...,x_{K}^{i} )\quad {\text{I }} = \, 1, \, 2, \ldots ,K_{{{\text{pop}}}} $$
(2)

Among the elite individuals, \(K_{{{\text{sr}}}}\) are selected as rivers, as well as a sea. The number of the rest of the population which may flow to the rivers or the sea is represented by \(K_{{{\text{Stream}}}}\). The volume of the water attracted by the river/sea is varied based on their flow power. The streams assigned to each river and sea are determined as follows:

$$ C_{n} = {\text{Cost}}_{n} - {\text{Cost}}_{{K_{{\text{sr } + \text{ 1}}} }} \quad n = 1, 2, \ldots ,K_{{{\text{sr}}}} $$
(3)
$$ {\text{NS}}_{n} = {\text{round}}\left\{ {\left| {\frac{{C_{n} }}{{\mathop \sum \nolimits_{n = 1}^{{K_{{{\text{sr}}}} }} C_{n} }}} \right| \times K_{{{\text{Streams}}}} } \right\}\quad n = 1,2, \ldots ,K_{{{\text{sr}}}} $$
(4)

where \({\text{NS}}_{n}\) shows the number of streams flowing to the specific sea or rivers. Since the larger number of streams tends to flow to the sea, the fitness function is defined to proportionally hand out the streams among the sea and rivers. In nature, however, some streams join each other and make new rivers.

Among \(K_{{{\text{pop}}}}\) individuals, assuming the presence of one sea and \(K_{{{\text{sr}} - 1}}\) rivers, Fig. 3 depicts how a stream flows toward a river along their connecting paths.

Fig. 3
figure 3

Way in which the stream flows to a specific river

More details about the proposed technique are presented in similar studies like [59,60,61].

3 Data and statistical analysis

For training intelligent models, providing proper data samples is an essential step. In this work, a set of real-world data is used to train the ANN and its hybrid (i.e., ER-WCA–ANN). The soil information is collected by a field survey in the Vinhomes Imperia housing project, constructed in Hai Phong city, Vietnam [42].

The shear strength (target variable) is considered to be a function of 12 influential factors, namely depth of sample (DOP), sand percentage (SP), loam percentage (LP), clay percentage (CP), percentage of moisture content (PMC), wet density (WD), dry density (DD), void ratio (VR), liquid limit (LL), plastic limit (PL), plastic index (PI), and liquidity index (LI). These factors are taken as input data during the training process. The distribution of these parameters versus the SSS is illustrated in Fig. 4. Descriptive statistics are also shown in Table 1. A total of 496 data are provided. With respect to the division ration of 80:20, 397 samples are used to discover the relationship between the SSS and input factors, and the remaining 99 samples are considered as unseen soil conditions to evaluate the generalization power of the applied models.

Fig. 4
figure 4

Graphical description of the used dataset

Table 1 Descriptive statistics of the SSS and input factors

4 Results and discussion

A multilayer perceptron is selected to represent the neural network in this study. This network is supposed to be trained by the ER-WCA algorithm. The MLP, as is known, is composed of at least three layers with a fixed/variable number of computational neurons in them. The number of neurons in the input and output layer is fixed and equals to the number of these variables. But when it comes to the middle layer, this value needs to be determined by a trial and error process. By testing ten different neural networks, it was shown that the MLP which contains seven hidden neurons reflects the most suitable structure. Hence, the structure of the used MLP is depicted in Fig. 5.

Fig. 5
figure 5

Optimal structure of the used LM-ANN

4.1 Hybridizing the MLP using the ER-WCA

The selected MLP is converted to the equation form and fed by considered training data. The variables of this equation are the connecting weights and biases. The ER-WCA is then applied to adjust these parameters according to the relationship between the SSS and influential factors. The ER-WCA is a population-based metaheuristic algorithm that tries to minimize the training error by updating the solution at each iteration. A total of 1000 iterations are set for the created ensemble [62, 63], and root-mean-square error (RMSE) plays the role of the objective function to measure the error. Assuming Zi predicted and Zi observed, respectively, as the modeled and measured SSSs, this function is defined as follows:

$$ {\text{RMSE}} = \sqrt {\frac{1}{K}\sum\limits_{i = 1}^{K} {[(Z_{{i_{{{\text{observed}}}} }} - Z_{{i_{{{\text{predicted}}}} }} )]}^{2} } $$
(5)

where K shows the number of samples.

The size of the acting population (population size), as well as “the number of rivers + sea (RS),” is an important parameter that affects the goodness of the optimization by the ER-WCA algorithm. Like the number of hidden neurons in the MLP, a sensitivity analysis is carried out for each one to achieve the best-fitted ER-WCA–ANN. Nine different population sizes of 10, 25, 50, 75, 100, 200, 300, 400, and 500 are tested where the RS is set 4. The results are shown in Fig. 6. As is seen, the lowest objective function is recorded for the population size = 300. Next, the ER-WCA–ANN with this population size is tested for ten different RS values (1, 2,…, 10). It can be seen that the RS = 5 gives the most accurate understanding of the SSS pattern. Figure 7 illustrates the convergence curve of the selected ER-WCA–ANN. Like many other optimization algorithms, the majority of the error is minimized before the 500th iteration. The obtained RMSE is 0.0433082113478439 for that.

Fig. 6
figure 6

Sensitivity analysis based on the RS and population size of the proposed ER-WCA–ANN

Fig. 7
figure 7

Convergence curve of the proposed ER-WCA–ANN with population size = 300 and RS = 5

4.2 Accuracy evaluation

After the optimization and implementation of the LM-ANN and ER-WCA–ANN models, the results are extracted and evaluated in this section. Along with the RMSE, two other popular accuracy indices of mean square error (MAE) and the coefficient of determination (R2) are defined to measure the learning/prediction error and the correlation between the modeled and measured SSSs. These criteria are expressed by Eqs. 6 and 7.

$$ {\text{MAE}} = \frac{1}{K}\sum\limits_{I = 1}^{K} {|Z_{{i_{{{\text{observed}}}} }} - Z_{{i_{{{\text{predicted}}}} }} |} $$
(6)
$$ R^{2} = 1 - \frac{{\sum\nolimits_{i = 1}^{K} {(Z_{{i_{{{\text{predicted}}}} }} - Z_{{i_{{{\text{observed}}}} }} )^{2} } }}{{\sum\nolimits_{i = 1}^{K} {(Z_{{i_{{{\text{observed}}}} }} - \overline{Z}_{{{\text{observed}}}} )^{2} } }} $$
(7)

The training and testing results of the LM-ANN and ER-WCA–ANN models are first shown in the regression charts of Fig. 8. According to these charts, the correlation of the ANN results is increased from 84.27 to 86.11% in the training phase, as the effect of replacing the LM with ER-WCA. It means that the ANN optimized by the latter algorithm can analyze the relationship between the SSS and influential factors in a more accurate way. As for the testing data, the rise of R2 from 0.7880 to 0.8083 indicates that the hybrid model has produced more consistent results in this phase which indicates the higher capability of this model in predicting the SSS for unseen soil condition.

Fig. 8
figure 8

Correlation of the training and testing results for the a, b LM-ANN and c, d ER-WCA–ANN models

The training and prediction errors are also measured for both applied models. Figure 9 shows the results in three forms: (1) A comparison between the modeled and measured SSSs is shown to compare the real and simulated patterns, (2) the error is defined as the difference between the modeled and measured SSSs and is shown in the second part, and (3) the frequency of these error values is depicted by histogram charts. A comparison between Fig. 9a and Fig. 9c demonstrates that the training SSSs produced by the ER-WCA–ANN are more compatible with real data. The lower RMSE (0.0460 vs. 0.0433) and MAE (0.0370 vs. 0.0349) values confirm this statement. Also, Fig. 9b, d demonstrates that the prediction error of the ANN (RMSE = 0.0528 and MAE = 0.0419) is larger than ER-WCA–ANN (RMSE = 0.0502 and MAE = 0.0405). From this, it can be derived that the weights and biases suggested by the ER-WCA metaheuristic algorithm construct a more reliable MLP in comparison with those adjusted by the typical LM algorithm.

Fig. 9
figure 9

Obtained training and testing errors and a comparison between the results for the a, b LM-ANN and c, d ER-WCA–ANN models

Evaluating the obtained results showed the efficiency of the evaporation rate-based water cycle algorithm in optimal modification of ANN parameters that reveal the relationship between the SSS and DOP, SP, LP, CP, PMC, WD, DD, VR, LL, PL, PI, and LI as the key factors. In comparison with previous efforts, the method of the current study achieved more reliable results. In the study carried out by Moayedi et al. [64], four capable optimizers of elephant herding optimization (EHO), shuffled frog leaping algorithm (SFLA), salp swarm algorithm (SSA), and wind-driven optimization (WDO) were assessed and compared for the same objective. The training MAEs of the models were 0.0471, 0.0449, 0.0368, and 0.0402, respectively. This is while the MAE of our proposed ER-WCA–ANN was 0.0349. In the prediction phase, ER-WCA outperformed the EHO and SFLA algorithms (RMSE of 0.0502 vs. 0.0597 and 0.0546).

In this work, the solution was excerpt among a wide variety of candidates. Based on Fig. 6, (9 + 8 =) 17 different complexities were tested where each one performed for 1000 iterations. In other words, a total of 17,000 solutions were tested to find the most proper one. Also, referring to the structure of the used MLP (Fig. 5), the algorithm has found the optimal values of 99 hyperparameters (91 connecting weights and eight biases) at each iteration. Manually doing such calculations, definitely, is an impossible and time-consuming task. Therefore, we proposed an automatic search scheme which enables engineers to benefit more accurate and time-effective model for predicting the SSS. Figure 10 depicts the calculation time required for implementing the ER-WCA–ANN by different population sizes. As is seen, the time increases by enlarging the population. The used ER-WCA needed around 4017 s (on the operating system at 2.5 GHz and 6 Gigs of RAM) for optimizing the ANN.

Fig. 10
figure 10

Calculation time for different populations sizes of the ER-WCA–ANN

4.3 Presenting the neural predictive formula

Based on the accuracy improvement resulted from incorporating the ER-WCA metaheuristic algorithm, the hybrid model was found to be superior to the unreinforced ANN. Hence, the content of the proposed ER-WCA–ANN is presented in the form of a nonlinear formula to predict the SSS. In fact, the formula is composed of two parts: (1) Eq. 8 which reflects the weights and biases belonging to the unique output neuron of the MLP network and (2) Eq. 9 that gives the same parameters for the neurons in the hidden layer (see Fig. 5). As is seen, calculating the SSS requires obtaining seven middle parameters of R1, R2,, R7 that represent the hidden neurons’ outputs. A Tansig function is also applied for calculating these parameters.

$$ \begin{gathered} {\text{SSS}}_{{{\text{ER}} - {\text{WCA}} - {\text{ANN}}}} = \, 0.3618 \times \, R1 \, + 0.9013 \, \times \, R2 \, - \, 0.8974 \, \times \, R3 \, \hfill \\ + \, 0.1830 \, \times \, R4 \, - \, 0.0226 \, \times \, R5 \, + \, 0.6373 \hfill \\ \, \times \, R6 \, - \, 0.6481 \, \times \, R7 \, + \, 0.5261 \hfill \\ \end{gathered} $$
(8)
$$ \begin{gathered} \left[ {\begin{array}{*{20}c} {R1} \\ {R2} \\ {R3} \\ {R4} \\ {R5} \\ {R6} \\ {R7} \\ \end{array} } \right] = {\text{Tansig}}\left( {\left( {\left[ {\begin{array}{*{20}l} { - \,0.5778} \hfill & {0.3986} \hfill & { - \,0.7759} \hfill & { - \,0.2127} \hfill & {0.4799} \hfill & {0.4383} \hfill \\ { - \,0.4231} \hfill & {0.8404} \hfill & {0.4949} \hfill & { - \,0.2602} \hfill & { - \,0.1691} \hfill & {0.7839} \hfill \\ { - \,0.2714} \hfill & { - \,0.1212} \hfill & {0.3350} \hfill & {0.4114} \hfill & { - \,0.0849} \hfill & {0.7783} \hfill \\ { - \,0.3717} \hfill & { - \,0.5214} \hfill & {0.7293} \hfill & {0.4180} \hfill & { - \,0.5083} \hfill & { - \,0.2739} \hfill \\ {0.1232} \hfill & {0.0498} \hfill & { - \,0.1843} \hfill & {0.0755} \hfill & {0.6224} \hfill & {0.6128} \hfill \\ { - \,0.5162} \hfill & { - \,0.2147} \hfill & { - \,0.6284} \hfill & {0.2924} \hfill & {0.0725} \hfill & { - \,0.6376} \hfill \\ {0.5469} \hfill & { - \,0.6605} \hfill & { - \,0.5301} \hfill & { - \,0.4976} \hfill & { - \,0.3407} \hfill & { - \,0.2957} \hfill \\ \end{array} } \right.} \right.} \right. \hfill \\ \left. {\left. {\left. {\begin{array}{*{20}l} { - \,0.0497} \hfill & {0.2212} \hfill & { - \,0.5651} \hfill & { - \,0.2978} \hfill & {0.7656} \hfill & { - \,0.3209} \hfill \\ { - \,0.4359} \hfill & { - \,0.3317} \hfill & { - \,0.5087} \hfill & {0.5344} \hfill & { - \,0.1592} \hfill & {0.0111} \hfill \\ { - \,0.1021} \hfill & {0.5379} \hfill & { - \,0.0771} \hfill & { - \,0.8058} \hfill & {0.8538} \hfill & {0.2104} \hfill \\ {0.0783} \hfill & { - \,0.6740} \hfill & { - \,0.7385} \hfill & {0.1656} \hfill & { - \,0.4641} \hfill & {0.1103} \hfill \\ { - \,0.5653} \hfill & { - \,0.2727} \hfill & { - \,0.5574} \hfill & { - \,0.6988} \hfill & {0.7255} \hfill & { - \,0.4141} \hfill \\ { - \,0.7007} \hfill & {0.3718} \hfill & {0.2455} \hfill & {0.7242} \hfill & {0.3634} \hfill & {0.4002} \hfill \\ {0.0746} \hfill & { - \,0.2759} \hfill & { - \,0.5003} \hfill & { - \,0.4207} \hfill & { - \,0.8039} \hfill & { - \,0.2969} \hfill \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {{\text{DOS}}} \\ {{\text{SP}}} \\ {{\text{LP}}} \\ {{\text{CP}}} \\ {{\text{PMC}}} \\ {{\text{WD}}} \\ {{\text{DD}}} \\ {{\text{VR}}} \\ {{\text{LL}}} \\ {{\text{PL}}} \\ {{\text{PI}}} \\ {{\text{LI}}} \\ \end{array} } \right]} \right) + \left[ {\begin{array}{*{20}c} {1.6465} \\ {1.0976} \\ {0.5488} \\ {0.0000} \\ {0.5488} \\ { - \,1.0976} \\ {1.6465} \\ \end{array} } \right]} \right) \hfill \\ \hfill \\ \end{gathered} $$
(9)

5 Conclusions

This work investigated the efficiency of a novel metaheuristic technique, namely the evaporation rate-based water cycle algorithm for predicting the soil shear strength which is a highly important geotechnical parameter. The model is applied to a neural network for the first time to modify its computational parameters. The ER-WCA–ANN hybrid model was created, and its results were compared to a typically trained ANN to evaluate the effect of the proposed metaheuristic model. The results of the sensitivity analysis showed that the best population size and the number of rivers and seas for the current problem are 300 and 5, respectively. In the training phase, it was shown that the learning RMSE of the ANN was reduced from 0.0460 to 0.0433 and the correlation rose from 0.8427 to 0.8611. It indicates that the ER-WCA algorithm has adjusted the weights and biases of the ANN more properly than the LM method. The same improvements in the testing phase also revealed the higher capability of the ER-WCA–ANN in predicting the SSS in stranger environments. Therefore, the proposed model can be reliably used for practical projects.