## Abstract

Weirs are a commonly used system to adjust water surface level and to control the flow in canals and hydraulic structures. Labyrinth weirs are a type of weirs that can pass through a certain amount of flow which has a lower upstream water level than the linear weirs, by increasing the effective length. In the present study, the performance of multilayer perceptron (MLP) networks, radial basis function networks and support vector machines with different kernel functions were investigated in order to estimate the discharge coefficient (*C*_{d}) of labyrinth weirs with quarter-round crests. For this purpose, 454 laboratory data were used. The non-dimensional parameters of *L/W*, *a*, *W/P*, and *H*_{t}*/P* were considered as the input, and the non-dimensional parameter of *C*_{d} was regarded as the output in the models. In comparison with the other models, the performance of the MLP model with RMSE, *R*, and DC of 0.019, 0.985, and 0.971, respectively, was more acceptable and closer to the experimental data. Also, the data density plot and the violin plot showed that the dispersion and distribution of the probability of the estimated data to the MLP model with the data obtained from the laboratory have a very close and similar adaptation.

### Similar content being viewed by others

Avoid common mistakes on your manuscript.

## Introduction

Increasing the amount of flow rate in different structures was always a field of interest for researchers. Decreasing sedimentation in reservoirs (Zahabi et al. 2018) and the creation of an opening in a broad-crested weir body to increase the discharge coefficient (Daneshfaraz et al. 2019) are examples of improving the flow rate. The other vital structures that can control the flow rate are weirs. The volume of flow over the weirs depends on the length and shape of the crest of the weir. Many researches have been done on the effect of the hydraulic and geometric parameters on the *C*_{d} and the amount of flow discharged from the weir. One of the effective ways to increase the weir length at a given width is to use weirs with nonlinear plans such as triangular, trapezoidal, circular, and parabolic. These weirs have been known as labyrinth weirs and are usually made in one cycle or several cycles. Through constructing this type of weirs, the volume of the flow through them increases, and a lower free height will be needed upstream in comparison with linear weirs. This issue is critical when they act as flood discharging structures and facilitate the flow of the flood (Crookston and Tullis 2012a).

Study on the labyrinth weirs hydraulics is conducted by the physical and numerical approaches. Crookston and Tullis (2012b) tested some configurations of arced labyrinth weirs and observed increased efficiency. Dabling et al. (2013) investigated the hydraulic performance of labyrinth weirs which consist of two crest elevations as an alternative to multiple-staged labyrinth weir layouts. Kabiri-Samani et al. (2013) performed a combined analytical and experimental investigation on a rectangular labyrinth weir. Their results showed that rectangular labyrinth weir represents an effective alternative and could be five times more efficient than corresponding traditional broad-crested weir. Carollo et al. (2017) studied the dimensionless stage–discharge relation for a sharp-crested triangular labyrinth weir. They found that the length magnification ratio affects the flow magnification ratio.

Recent research efforts have included numerical modeling and CFD as an additional design tool (Seo et al. 2016; Daneshfaraz et al. 2016; Daneshfaraz and Ghaderi 2017). Another way for numerical modeling is related to the use of soft computing techniques for predicting the hydraulic properties of weirs such as discharge coefficient (Azamathulla et al. 2016). In this regard, researchers used an artificial neural network (ANN), group method of data handling (GMDH), gene expression programming (GEP), and adaptive neuro-fuzzy inference system (ANFIS). Juma et al. (2014), using artificial neural network (ANN), analyzed the hydraulic properties of semicircle weirs. They showed that the results of artificial neural networks were in good agreement with laboratory results.

Roushangar et al. (2017) investigated the determination of the *C*_{d} of labyrinth and archery labyrinth weirs with the support vector regression method. Their results showed that the vector support regression method had high efficiency in determining the *C*_{d} of labyrinth weirs. Karami et al. (2018) investigated the rectangular labyrinth weirs with supported vector machine models, artificial neural networks, and genetic algorithms. They compared the results of these models with the experimental data and found out the support vector machines represented better results than the other models.

Moreover, support vector machines have been extensively used in various fields (Zhou et al. 2015; Nadiri et al. 2018; Sadeghfam et al. 2019; Azimi et al. 2019).

The prediction of the *C*_{d} of the labyrinth weirs has always been important for the researchers in this area; therefore, several methods including empirical, quasi-empirical, time series, and artificial intelligence models have been developed. Among these, artificial intelligent models by being inspired by nature have been able to estimate the parameters of natural phenomena with acceptable accuracy.

Reviewing the literature has shown that there have been limited studies conducted on artificial models for estimating the *C*_{d} of labyrinth weirs with quarter-round crests. Therefore, in the present study, using the experimental data of Crookston and Tullis (2013), the performance of artificial neural networks (ANNs) and support vector machines (SVMs) with different kernels was examined for estimating the *C*_{d} of labyrinth weirs with quarter-round crests.

## Materials and methods

The dynamic behavior can be described by a set of equations known as the St. Venant equations (Daneshfaraz and Kaya 2008). The one-dimensional equation of flow on labyrinth weirs is a function of the total upstream head (*h*) in meters, weir’s crest length (*L*) in meters and *C*_{d} without dimension, which is obtained from Eq. 1 (Tullis et al. 1995).

Using the dimensional analysis method and considering the geometric, kinematic, and dynamic parameters, the effective parameters on the *C*_{d} in labyrinth weirs included the total upstream head (*h*), inside apex length (*A*), outside apex length (*D*), centerline length of the sidewall (*L*_{c}), number of cycles (*N*), the whole width of the spillway (*W*), the walls’ angles (*a*), the weir’s height (*P*), the wall thickness (*t*_{w}), and the shape of the weir’s crest (*L*_{c} = *N* (*2l*_{c} + *A* + *D*). Crookston and Tullis (2013) conducted studies on labyrinth weirs with quarter-round crests; the effective parameters in them can be seen in Fig. 1.

### Artificial neural networks

Artificial neural network (ANN) is a nonlinear mathematical model that is able to simulate arbitrarily complex nonlinear processes, which relate inputs and outputs of any system. In many complex mathematical problems that lead to solving complex nonlinear equations, multilayer perceptron networks are common types of ANN widely used by researchers (Parsaie 2016; Moazamnia et al. 2019).

Multilayer perceptron (MLP) network is the most commonly used neural network model applied in water engineering issues; for training, this network, a back-propagation learning algorithm which is a learning method with an observer, is used. The purpose of training a neural network is to arrange the network parameters (weights and biases) by providing training patterns, in a way that by representing the same patterns, the resulted error between the optimal response and network is minimized. Generally, in a multilayer perceptron network, there are two types of signals, i.e., signals moving in the going path (from the inner layer to the outer layer) and the other are the return signals (from the outer layer to the inner layer) which are known as the functional signals and error signals, respectively. Arranging the parameters in the multilayer perceptron network is performed by the error signal and input signal. Determining the number of layers and neurons existing in them is one of the most important issues in modeling with artificial neural networks. Tokar and Johnson mentioned sigmoid stimulus and hyperbolic tangent functions as the most commonly used stimulus functions in the back-propagation learning algorithm (Ghorbani et al. 2013).

Radial basis function (RBF) network, like the MLP neural networks model, is another type of neural networks in which the processor units focus on a certain position while processing. This focus is modeled through radial functions. Regarding the overall structure, RBF neural networks are not much different from MLP networks; just the kind of processing that neurons do on their inputs is different. However, RBF networks often have faster learning and preparation processes. In fact, because of the concentration of neurons on a particular functional range, it is easier to adjust them. There are several types of radial basis functions, but the most commonly used is the Gaussian function. Figure 2 shows a view of a multilayer perceptron network and a radial neural network (Ghorbani et al. 2016). In the present study, MLP and RBF models have been used to predict the *C*_{d} of the labyrinth weirs with quarter-round crests.

### Support vector machines

Support vector machines operate based on data mining algorithms and are like other artificial intelligent methods. The first application of this method in water issues which was presented by Dibike et al. (2001) was simulating the rainfall runoff. Later, it was used in different fields of hydrology (e.g., Nadiri et al. 2017) and Hydraulics (e.g., Sadeghfam et al. 2019). Support vector machines are an efficient learning system based on the theory of optimization that uses the inductive principle of minimization of structural errors and lead to a general optimal response.

The SVM algorithm operates through training and testing like most artificial intelligent methods, but unlike the other artificial intelligent methods, instead of reducing the computational errors, it considers the operational risk of incorrect division as the target function and obtains its optimal value. Figure 3 represents the structure of the vector machine.

In the regression model of SVM, a function related to the dependent variable of *y* which itself is a function of several independent variables of *x* is estimated. Similar to the other regression issues, it is assumed that the relationship between the independent and dependent variables is determined by an algebraic function such as *f*(*x*) along with some disturbance (tolerance factor *ε*) (Eq. 2).

where *w* is a weight vector, *b* is biased, and *∅* is also a kernel function, and then, the purpose is to find a functional form for *f*(*x*). This is accomplished by calibrating the SVM model by a series of samples (calibration set). This process involves the sequential optimization of the error function. Depending on the definition of this error function, two types of SVM model have been defined.

SVMs are a set of related supervised learning methods used for classification and regression: SVM regression of type 1 (also known as ε-SVM regression) and SVM regression of type 2 (also known as υ-SVM regression). It is worth noting that in this study, the regression model of ε-SVM was used to predict the discharge coefficient of labyrinth weirs with quarter-round crests because of its extensive application in regression studies.

Support vector machines change the dimensions of the problem through kernel functions for solving nonlinear problems. Applying kernel for SVM depends on the amount of training data and the dimensions of the feature vector. In other words, considering these parameters, a kernel function that can solve the problems of inputs should be selected. Practically, four types of linear kernels including linear, polynomial, sigmoid, and radial basis function (RBF) are used (Kavzoglu and Colkesen 2009; Baofeng and et al. 2008). The equations used in each of them have been given below:

In the present study, the artificial neural networks (ANNs) and SVM models were used to estimate the amount of *C*_{d} of the labyrinth weirs with quarter-round crests with four non-dimensional parameters of *H*_{t}*/P*, *L/W*, *W/P*, and *α*. The data existing in the laboratory were taken, and the total number of the generated data was 454.

In the applied models, four non-dimensional parameters of *H*_{t}*/P*, *L/W*, *W/P*, and *α* were introduced as the input, and the non-dimensional parameter of *C*_{d} was considered as the output. In the applied models, 75% of the total available data were considered for the training period, and 25% of them were used for the testing period. In this study, STATISTICA 12 software was used to estimate the *C*_{d} and the value of the R, DC, and RMSE is determined.

## Evaluation criteria

Three statistical indicators were used for assessing the ability and accuracy of ANNs and SVM models in estimating the *C*_{d}. The assessment criteria for estimating the parameter of the discharge coefficient included the correlation coefficient between the observational estimated values (*R*), root-mean-square error (RMSE) and the linear correlation between the predicted values and the observations (DC); each of them was calculated from Eqs. 8, 9, and 10, respectively. The model which had *R* and DC close to 1 and the root-mean-square close to zero was considered the better model.

In these equations, \(O_{i}\) were the values obtained from the observational values (extracted from the laboratory), \(P_{i}\) were the values obtained from the predictive models’ method, \(\bar{O}\) were the mean values of the observed values, \(\bar{P}\) were the mean values obtained from the predictive models’ method, and *n* was the number of data.

## Results and discussion

The *C*_{d} of the labyrinth weirs with quarter-round crests was analyzed through the results of the ANNs and SVM models. In the present study, Crookston and Tullis (2013) laboratory data were used to evaluate and compare the results obtained from the models.

The non-dimensional parameters of *H*_{t}*/P*, *L/W*, *W/P*, and *α* were considered as the input, and the non-dimensional parameter of *C*_{d} was considered as the output in the models used in this research. In Table 1, the statistical parameters of the dataset have been shown for the training and testing ranges.

The multilayer perceptron (MLP) network and radial basis function (RBF) neural networks with hidden layers and different neurons were used for modeling the *C*_{d} of labyrinth weirs with quarter-round crests.

In this research, a hyperbolic tangent function which has been the most useful form of multilayer perceptron network stimulus functions was used to construct the output layer of the artificial neural networks. Training the multilayer perceptron networks was done through the training back of propagation learning algorithm which is called Lavenberg–Marquart algorithm because of its faster convergence in network training. Also, the Gaussian function was used for the radial basis neural network.

In modeling the *C*_{d}, the neural network had four neurons in the input layer (*H*_{t}*/P*, *L/W*, *W/P*, and *α*) and one neuron in the output layer (*C*_{d}). The value of the correlation coefficient between the observed and estimated values in the training and testing data for the estimated parameters indicated the high capacity of the designed neural network to estimate the discharge coefficient of the labyrinth weirs with quarter-round crests. Various models were evaluated. Finally, the appropriate models of MLP and RBF were calculated based on the statistical parameters according to Table 2.

Table 3 is presented in order to evaluate the efficiency of the method used to estimate the *C*_{d} in labyrinth weirs with quarter-round crests. According to Table 3, it can be claimed that in the present study, the accuracy of the multilayer perceptron (MLP) neural network is greater than the radial basis function (RBF) neural network for estimating the *C*_{d} of the labyrinth weirs with quadrantal crests.

In Fig. 4, the distribution diagram of the observational estimated values of the training and testing stage of the multilayer perceptron (MLP) network model and the radial basis function (RBF) neural network has been shown. As can be observed in Fig. 4, most points are located on or near the line of the bisector, and this shows the acceptability of both models in estimating the amount of *C*_{d}. However, the multilayer perceptron (MLP) network model provided very closer results to the results of the observed values; therefore, it had a very high accuracy in estimating the considered parameter, i.e., the amount of *C*_{d}.

In the present study, the performance of the support vector machines (SVMs) in estimating the *C*_{d} of the labyrinth weirs with quarter-round crests was investigated. Considering the point that choosing the input models in artificially intelligent systems can affect the accuracy of the results in SVM modeling. It was tried to use the inputs of the neural networks’ model, that is, the parameters of (*H*_{t}*/P*, *L/W*, *W/P*, and *α*) in the input layer, and a neuron in the output layer (*C*_{d}) in order to assess the performance of ANNS in comparison with SVM.

To select the suitable kernel function for the support vector machine, the *C*_{d} model with different kernels was assessed. According to Table 4, the results showed that the RBF kernel function with *R*, RMSE, and DC of 0.978, 0.027, and 0.956, respectively, performed better in predicting the *C*_{d}. The sigmoid kernel function with R, RMSE, and DC of 0.697, 0.211, and 0.185, respectively, had the weakest performance. Also, for finding the optimum parameters of the kernel function, the trial-and-error method was used, and by testing different values, the optimal value of these parameters was selected. In order to do so, for the constant value of *γ*, first the optimal values of *ε* and *c* were obtained, and then, the value of *γ* was changed, and by calculating the statistical parameters, its optimum value was calculated.

In Fig. 5, the distribution diagram of the observational estimated values in the training and testing stages of the support vector machine was shown in the best kernel state (RBF kernel). As shown in Table 4, the *R* and the DC were 0.978 and 0.956, respectively, and the RMSE was 0.027 at the testing stage, and it was chosen as the best kernel mode for the SVM model.

In Fig. 6, data dispersion for the test period is shown using the MR linear and MR nonlinear, respectively. In Table 5, the MR linear and MR nonlinear equations are also shown. As can be seen, these equations have almost the same results. It should be noted that in Table 5, *α* unit is radians.

According to Figs. 4, 5, and 6, MLP model has estimated very closely comparable results with respect to observational values compared to other models and therefore has very high accuracy in estimating the desired parameter (*C*_{d}).

Figures 7 and 8 show the density plot and violin plot in the test period for observational data from laboratory tests (Crookston and Tullis 2013) and ANN, SVM, MR linear and MR nonlinear. In this study, the Wolfram Mathematica software has been used to draw the density plot and violin plot. Figure 7 shows the density chart of the rectangular box in which the distribution of points is observed for observational and estimated data. According to Fig. 7, it can be seen that the artificial neural network model has a very close adaptation to observational data. Figure 8 also shows the violin plot of the probability distribution function for the observed and estimated data. According to the violin plot, it is clear that the artificial neural network model has similar results to observational data. For observational and estimated data, with the above methods, the probability values for maximum, 75%, 50%, 25%, and minimum values are obtained, respectively (0.802, 0.618, 0.534, 0.409, and 0. 204), (0.813, 0.625, 0.554, 0.414, and 0. 227), (0.838, 0.607, 0.549, 0.477, and 0. 150), (0.694, 0.564, 0.479, 0.411, and 0. 261), and (0.691, 0.562, 0.481, 0.405, and 0. 247).

The statistical criteria have shown that the multilayer perceptron (MLP) network model had higher accuracy compared with SVM, MR linear and MR nonlinear. It has also been observed that the MLP provided very similar results to the experimental values in predicting the amount of the discharge coefficient (Table 6).

## Conclusion

In the present research, ANN_{S}, SVM, MR linear and MR nonlinear models were used to estimate the *C*_{d} of the labyrinth weirs with quarter-round crests. The values of the *C*_{d} were obtained from Crookston and Tullis (2013)’s laboratory studies. Then, the estimated values *C*_{d} found for the mentioned models were compared using evaluation criteria. It should be noted that random sampling from the total data of 454 for considering 25% and 75% as testing and training data, respectively, was done in a way that after repeating several random choosing among the total available data, the data concerning the conditions with the highest *R* and the least RMSE for the estimation process could be used in the artificial neural network (ANN) model.

The results of this study showed that both artificial intelligent models had better accuracy in estimating *C*_{d}. However, the multilayer perceptron (MLP) network model with *R*, RMSE, and DC of 0.985, 0.043, and 0.8729, respectively, had a remarkably higher accuracy to the other models.

## References

Azamathulla HM, Haghiabi AH, Parsaie A (2016) Prediction of side weir discharge coefficient by support vector machine technique. Water Sci Technol Water Supply 16(4):1002–1016

Azimi H, Bonakdari H, Ebtehaj I (2019) Design of radial basis function-based support vector regression in predicting the discharge coefficient of a side weir in a trapezoidal channel. Appl Water Sci 9(4):78

Baofeng G, Gunn SR, Damper RI, Nelson JDB (2008) Customizing kernel functions for SVM-based hyperspectral image classification. IEEE Trans Image Process 17(4):622–629

Carollo FG, Ferro V, Pampalone V (2017) Testing the outflow process over a triangular labyrinth weir. J Irrig Drain Eng 143(8):06017007

Crookston BM, Tullis BP (2012a) Arced labyrinth weirs. J Hydraul Eng 138(6):555–562

Crookston BM, Tullis BP (2012b) Discharge efficiency of reservoir application specific labyrinth weirs. J Irrig Drain Eng 138(6):773–776

Crookston BM, Tullis BF (2013) Hydraulic design and analysis of labyrinth weirs. I: discharge relationships. J Irrig Drain Eng 139(5):363–370

Dabling MR, Tullis BP, Crookston BM (2013) Staged labyrinth weir hydraulics. J Irrig Drain Eng 139(11):955–960

Daneshfaraz R, Ghaderi A (2017) Numerical investigation of inverse curvature ogee spillway. Civ Eng J 3(11):1146–1156

Daneshfaraz R, Kaya B (2008) Solution of the propagation of the waves in open channels by the transfer matrix method. Ocean Eng 35(11–12):1075–1079

Daneshfaraz R, Joudi AR, Ghahramanzadeh A, Ghaderi A (2016) Investigation of flow pressure distribution over a stepped spillway. Adv Appl Fluid Mech 19(4):811

Daneshfaraz R, Minaei O, Abraham J, Dadashi S, Ghaderi A (2019) 3-D Numerical simulation of water flow over a broad-crested weir with openings. ISH J Hydraul Eng. https://doi.org/10.1080/09715010.2019.1581098

Dibike Y, Velickov S, Solomatine D, Abbott M (2001) Model induction with support vector machines: introduction and applications. J Comput Civ Eng 15(3):208–216

Ghorbani MA, Khatibi R, Hosseini B, Bilgili M (2013) Relative importance of parameters affecting wind speed prediction using artificial neural networks. Theor Appl Climatol 114(1–2):107–114

Ghorbani MA, Ahmad Zadeh H, Terzi IMO (2016) Comparative study of artificial neural network (MLP, RBF) and support vector machine models for river flow prediction. Environ Earth Sci 75(6):461–476

Juma IA, Hussein H, AL-Sarraj M (2014) Analysis of hydraulic characteristics for hollow semi-circular weirs using artificial neural networks. J Flow Meas Instrum 38:49–53

Kabiri-Samani A, Javaheri A, Borghei SM (2013) Discharge coefficient of a rectangular labyrinth weir. Proc Inst Civ Eng Water Manag 166(8):443–451

Karami H, Karimi S, Bonakdari H, Shamshirband S (2018) Predicting discharge coefficient of triangular labyrinth weir using extreme learning machine, artificial neural network and genetic programming. Neural Comput Appl 29(11):983–989

Kavzoglu T, Colkesen I (2009) A kernel functions analysis for support vector machines for land cover classification. Int J Appl Earth Obs Inf 11(5):352–359

Moazamnia M, Hassanzadeh Y, Nadiri AA, Khatibi R, Sadeghfam S (2019) Formulating a strategy to combine artificial intelligence models using Bayesian model averaging to study a distressed aquifer with sparse data availability. J Hydrol 571:765–781

Nadiri AA, Gharekhani M, Khatibi R, Sadeghfam S, Moghaddam Asghari A (2017) Groundwater vulnerability indices conditioned by supervised intelligence committee machine (SICM). Sci Total Environ 574:691–706

Nadiri AA, Sedghi Z, Khatibi R, Sadeghfam S (2018) Mapping specific vulnerability of multiple confined and unconfined aquifers by using artificial intelligence to learn from multiple DRASTIC frameworks. J Environ Manage 227:415–428

Parsaie A (2016) Predictive modeling the side weir discharge coefficient using a neural network. Model Earth Syst Environ 2(2):63

Roushangar K, Alami MT, Majedi Shiri J, Asl M (2017) Determining discharge coefficient of the labyrinth and arced labyrinth weirs using support vector machine. Hydrol Res 49(3):924–938

Sadeghfam S, Daneshfaraz R, Khatibi R, Minaei O (2019) Experimental studies on scour of supercritical flow jets in upstream of screens and modelling scouring dimensions using artificial intelligence to combine multiple models (AIMM). J Hydroinform. https://doi.org/10.2166/hydro.2019.076

Seo IW, Do KY, Park YS, Song CG (2016) Spillway discharges by modification of weir shapes and overflow surroundings. Environ Earth Sci 75(6):496

Tullis JP, Amanian NA, Waldron D (1995) Design of labyrinth spillways. J Hydraul Eng 121(3):247–255

Zahabi H, Torabi M, Alamatian E, Bahiraei M, Goodarzi M (2018) Effects of geometry and hydraulic characteristics of shallow reservoirs on sediment entrapment. Water 10(12):1725

Zhou Q, Zhou H, Zhou Q, Yang F, Luo L, Li T (2015) Structural damage detection based on posterior probability support vector machine and Dempster-Shafer evidence theory. Appl Soft Comput 36:368–374

## Author information

### Authors and Affiliations

### Corresponding author

## Ethics declarations

### Conflict of interest

The authors declare that they have no conflict of interest.

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Norouzi, R., Daneshfaraz, R. & Ghaderi, A. Investigation of discharge coefficient of trapezoidal labyrinth weirs using artificial neural networks and support vector machines.
*Appl Water Sci* **9**, 148 (2019). https://doi.org/10.1007/s13201-019-1026-5

Received:

Accepted:

Published:

DOI: https://doi.org/10.1007/s13201-019-1026-5