Skip to content

Original Research

Frontiers in Water ·

Volume 8 - 2026 | https://doi.org/10.3389/frwa.2026.1890874

Robust discharge coefficient modeling in triangular weirs via an enhanced Adam-optimized BP network

  • Guorui Zeng1,2
  • Maosen Xu2,3*corresponding author
  • Yucheng Zheng4
  1. 1Institute of Intelligent Manufacturing, Zhejiang Guangsha Vocational and Technical University of Construction, Jinhua, China
  2. 2College of Metrology Measurement and Instrument, China Jiliang University, Hangzhou, China
  3. 3Department of Mechanical Engineering, National University of Singapore, Singapore, Singapore
  4. 4School of Automation, Jiangsu University of Science and Technology, Zhenjiang, China
Article metrics0 viewsView details

Abstract

Accurate estimation of the discharge coefficient (C d) in triangular weirs is fundamental for data-driven hydrological modeling and the reliable assessment of water resource infrastructure. To achieve robust, high-precision prediction of C d under varying hydraulic conditions, an enhanced Adam-optimized back-propagation neural network (AdaBP-E) was developed. The proposed framework integrates adaptive learning rate adjustment, L2 regularization, Dropout, and an independent early-stopping mechanism to effectively capture the complex nonlinear relationships between weir geometry and flow characteristics. The model was benchmarked against a linear baseline and conventional BP training variants, including gradient descent and Levenberg–Marquardt optimization, to isolate the specific contributions of the proposed enhancements. The AdaBP-E model demonstrated superior predictive performance, achieving a coefficient of determination (R 2) of 0.9697 and a root mean square error (RMSE) of 0.0119 on the test set, while also exhibiting the lowest average sensitivity index (19.51), indicative of enhanced robustness to input perturbations. Stratified Bootstrap validation further confirms its superior stability, with a 77.4% reduction in R 2 standard deviation compared to BP-LM. The AdaBP-E framework offers a robust, interpretable data-driven solution for discharge coefficient modeling, thereby supporting broader integration of machine learning techniques into smart water management, hydrological risk mitigation, and sustainable infrastructure planning.

Keywords

1 Introduction

Weirs are widely used in open channels for flow measurement, regulation, and diversion due to their high discharge capacity (Wang et al., 2022). In particular, triangular weirs are widely used for flow measurement in open channels due to their high sensitivity, especially at low flow rates. Accurate flow measurement is essential. It protects hydraulic infrastructure, supports environmental management, and helps assess flood risk (Cea and Costabile, 2022). Accordingly, precise discharge modeling for triangular weirs is critical in both hydraulic engineering and water resource management. The discharge coefficient (C<sub>d</sub>) is pivotal in characterizing the weir’s capacity, and precise methods for its calculation are of considerable significance for flow prediction. For example, Kumar et al. (2011) introduced several equations to define the discharge coefficient of triangular labyrinth weirs. Subsequent studies built on this through model tests and simulations to determine C<sub>d</sub> and fit empirical formulas (Yildiz et al., 2021; Seyedian et al., 2023).

However, the discharge from a triangular weir is governed by both structural parameters and operating conditions, leading to multiple possible expressions for the discharge coefficient. Empirical formulas are also sensitive to parameter interactions and typically require extensive calibration data (Shen et al., 2024). Moreover, several studies have noted that such formulas, whether derived from physical models or computational fluid dynamics (CFD), often struggle to capture the complex, nonlinear hydraulic behavior of weir flows. They tend to overlook parameter interdependencies and fail to exploit the information contained in experimental data fully (Gharehbaghi et al., 2023; Dhar et al., 2025; Afaridegan et al., 2025).

To address these challenges, researchers have increasingly adopted artificial intelligence techniques, which offer strong nonlinear approximation capabilities. These methods have been successfully applied to predict complex physical characteristics in hydraulic and hydrological systems (Saffar et al., 2021; Fatahi-Alkouhi et al., 2024). A wide range of machine learning (ML) methods, including artificial neural networks (ANNs), support vector machines (SVMs), and extreme learning machines (ELMs), have been applied to predict discharge coefficients for various weir configurations. The results indicate that these methods consistently outperform traditional empirical formulas in terms of accuracy and computational efficiency (Dursun et al., 2012; Norouzi et al., 2019; Razmi et al., 2022; Simsek et al., 2023).

For instance, Roushangar et al. (2017) employed SVM and an adaptive neuro-fuzzy inference system (ANFIS) to evaluate the discharge coefficient of a labyrinth weir. Karami et al. (2018) utilized ANNs, ELMs, and genetic programming (GP) to predict the discharge coefficient of a triangular labyrinth weir, finding that the ELM model offered significant advantages. Bonakdari et al. (2020) applied gene expression programming (GEP) to model the triangular weir discharge coefficient. More recently, Moghadam et al. (2022) adopted a regularized extreme learning machine (RELM) to estimate the discharge coefficient of triangular side orifices, demonstrating improved generalization performance over standard ELM. Balahang and Ghodsian (2023) combined particle swarm optimization with support vector regression (PSO-SVR) to assess the sensitivity of influencing parameters on triangular side weir discharge. These studies collectively underscore the growing potential of data-driven approaches in addressing complex hydrological and hydraulic modeling tasks.

Despite these advances, individual intelligent algorithms may still exhibit limitations when applied to highly nonlinear problems, such as slow convergence rates or susceptibility to local minima (Ahmed et al., 2023). To mitigate these issues, researchers have developed hybrid optimization strategies that enhance the performance of standalone models. For example, Adnan et al. (2024) illustrated the efficacy of hybrid metaheuristic optimization by combining particle swarm optimization (PSO) and the gravitational search algorithm (GSA) to tune an adaptive neuro-fuzzy inference system (ANFIS) for predicting the discharge of combined weir-orifice structures. Azma et al. (2025) integrated support vector regression (SVR) with particle swarm optimization (PSO) and a genetic algorithm (GA), achieving significant improvements in prediction accuracy for the labyrinth gate discharge coefficient. Similarly, Asgharzadeh-Bonab et al. (2025) developed hybrid optimization models (TabNet-MFO and ELM-JFO) for predicting the discharge coefficient of semi-circular labyrinth weirs, demonstrating superior accuracy and stability. Collectively, these studies confirm that integrating advanced optimization algorithms with intelligent models can substantially enhance predictive performance.

The back propagation (BP) neural network is a classical and widely used tool in hydrological prediction due to its well-established nonlinear approximation capabilities (Zhang Y. G. et al., 2021). Efforts to enhance BP performance generally follow two directions: external optimizers, such as evolutionary or swarm intelligence algorithms (e.g., GA, PSO, SSA) and statistical learning methods (e.g., SVR, SVM), which treat the network as a black box; and internal optimizers (e.g., Adam, RMSProp), which improve the training dynamics directly within the gradient-based learning framework (Tang et al., 2021; Elshamy et al., 2023; Xia et al., 2026). While external approaches have been extensively explored, internal optimization offers the advantages of lighter computational overhead, more stable convergence, and seamless integration with regularization techniques.

This study develops an enhanced BP neural network (AdaBP-E) that integrates Adam optimization, L2 regularization, Dropout, and a decoupled early-stopping mechanism to improve the prediction of triangular weir discharge coefficients. The model is benchmarked against linear regression and two standard BP training variants (gradient descent and Levenberg–Marquardt), allowing a controlled assessment of the specific enhancements. Model performance is evaluated through comprehensive statistical metrics, cross-validation, and sensitivity analysis. The findings aim to provide a robust, interpretable data-driven framework for hydrological modeling and hydraulic infrastructure risk assessment.

2 Materials and methods

2.1 Data source and description

The data used in this study to predict the discharge coefficient C<sub>d</sub> were obtained from the hydraulic model tests of a triangular weir reported by Kumar et al. (2011). The experiments were conducted in a rectangular flume measuring 12 m in length, 0.28 m in width, and 0.41 m in depth. The triangular weir was positioned 11 m from the upstream end of the flume, and a grille was installed upstream to prevent vortices and reduce surface disturbances. Measurements were taken using a point gauge with an accuracy of ±1 mm. Figure 1 shows a schematic plan view of the triangular weir arrangement. Key parameters considered in the experiments included the weir crest angle θ, weir crest length L, weir height w, and weir crest water depth h, among others. A total of 123 sets of corresponding discharge coefficient data were obtained. Of these, 70% of the data (86 sets) were randomly allocated for model training, while the remaining 30% (37 sets) were reserved for model testing.

Plan layout of the triangular weir.
Figure 1. Plan layout of the triangular weir.

The four dimensionless parameters that serve as model inputs, the crest angle θ, the Froude number F<sub>r</sub>, and the geometric ratios L/w and L/h-will be formally derived through dimensional analysis in Section 2.2. To provide a statistical overview of the input feature space prior to model development, Table 1 summarizes the minimum, maximum, mean, and standard deviation of these four variables across the entire dataset. The broad ranges observed-F<sub>r</sub> from 0.609 to 3.262 (covering both subcritical and supercritical flows), L/w from 2.685 to 11.761, and L/h from 3.889 to 135.250-indicate that the experimental data encompass substantial variations in both flow regimes and weir geometries, which is advantageous for constructing a generalizable predictive model.

Table 1. Statistical summary of dimensionless input parameters used in the model development.

Input ParameterUnitMinimumMaximumMeanStd. deviation
θdegrees30180102.4450.365
Fr/0.6093.2621.1940.713
L/w/2.68511.7614.9793.163
L/h/3.889135.25019.85623.504

2.2 Dimensional analysis procedure

The discharge formula of the triangular weir can be expressed in the following form (Equation 1) (Shen et al., 2022):

Q = C d L 2 g h 3 2 (1)

Where C<sub>d</sub> is the discharge coefficient; L is the length of the dam crest; g is the acceleration due to gravity; H is the head of the weir crest.

Based on previous studies, Equation 2 can be derived from the analysis of the discharge formula, and Equation 3 can be derived from the analysis of the Buckingham π theorem (Barenblatt, 1987; Achour and Amara, 2022; Hoseini, 2014; Nicosia and Ferro, 2022).

C d = f 1 ( L − w − h − θ − v − g − ρ − σ − μ ) (2)

C d = f 2 ( θ − F r − L / w − L / h − Re − We ) (3)

Where w is the height of the weir, in meters; θ is the crest angle of the weir; v is flow velocity; ρ is the density of the liquid; μ is the dynamic viscosity of the liquid; σ is surface tension; F<sub>r</sub> is the upstream Froude number.

Due to the large range of Reynolds number (Re) values in practice, its influence on C<sub>d</sub> can be ignored when considering liquid viscosity; the water head h > 2.5 cm on the weir, the influence of Weber number (We) on C<sub>d</sub> can also be ignored when considering surface tension (Rao and Shukla, 1971). Therefore, the value of C<sub>d</sub> can be determined by modeling its relationship with the dimensionless parameters in Equation 4, namely the crest angle θ, the upstream Froude number F<sub>r</sub>, and the geometric ratios L/w and L/h.

C d = ( θ − F r − L / w − L / h ) (4)

Physically, F<sub>r</sub> characterizes the upstream flow regime and directly influences the streamline curvature over the weir, while L/w and L/h represent geometric constraints that affect flow contraction and energy dissipation. These parameters collectively govern the discharge behavior of the triangular weir.

2.3 Theoretical models

2.3.1 Linear regression model

The principle of linear regression model can be represented by the following matrix (Equation 5, Equation 6, Equation 7, Equation 8, Equation 9):

{ y 1 = β 0 + β 1 x 11 + β 2 x 21 … + β p x p 1 + ε 1 y 2 = β 0 + β 1 x 12 + β 2 x 22 … + β p x p 2 + ε 2 ⋮ y n = β 0 + β 1 x 1 n + β 2 x 2 n … + β p x pn + ε n (5)

Y = ( y 1 y 2 … y n ) T (6)

X = ( 1 x 11 x 21 … x p 1 1 x 12 x 22 … x p 2 ⋮ 1 x 1 n x 2 n … x pn ) (7)

β = ( β 0 β 1 … β p ) T (8)

ε = ( ε 1 ε 2 … ε n ) T (9)

Where Y is the observed vector, X is the design matrix containing features and constant terms, β is the parameter vector to be estimated, and ε is the error vector. Therefore, linear regression can be summarized in matrix form as Y = Xβ+ε, with the model assuming the expected condition E(Y|X) = Xβ, predicting the target variable by fitting a linear relationship.

2.3.2 BP neural network

The BP neural network is capable of handling complex pattern classification and multi-dimensional function mapping, and this network has been widely used in different studies (Li et al., 2020; Mojtahedi et al., 2025). A BP neural network consists of three parts: the input layer, the hidden layer, and the output layer. Among them, the input layer is used to receive external data, the output layer outputs the predicted target results, and the middle hidden layer is used for feature extraction and transformation of the input data. The BP neural network mainly includes two processes: forward transmission and backward feedback. This network is a classic multi-layer feedforward network algorithm for error backpropagation. The topology structure of the BP neural network is shown in Figure 2.

Schematic diagram of BP neural network topology structure.
Figure 2. Schematic diagram of BP neural network topology structure.

During training, the input signal propagates from the input layer to the output layer via the hidden layer. During the forward propagation of working signals, the weights and offsets of the network remain constant, and the state of each layer of neurons only affects the state of the next layer of neurons. When the output layer output deviates from the target value, the difference can be converted into an error signal for backpropagation. When the reverse signal is fed back, the error is propagated backward through the hidden layer, allocated to each layer and unit, and the error signal is used to adjust the weights of each unit. Through repeated iterations, the error progressively decreases until the training terminates when the specified convergence criterion is satisfied (Jin et al., 2000; Zhang et al., 2018).

2.3.3 Adam optimization algorithm

Traditional optimization algorithms, such as SGD (Stochastic Gradient Descent), have achieved good results in different studies. However, there are certain challenges in choosing the appropriate initial learning rate for such algorithms (Haji and Abdulazeez, 2021). Adam (Adaptive Moment Estimation) is a learning rate optimization algorithm that combines the stability of the momentum method and the adaptability of RMSProp. It can automatically adjust the learning rate for different parameters during training without being limited by pre-specified learning rate annealing rules (Reyad et al., 2023). The core principle is as follows:

Calculate the first-order moment estimation of gradients, which involves processing momentum. This process maintains a gradient exponential moving average vector m<sub>t</sub>, simulates physical momentum, accelerates gradient descent, and reduces oscillations (Equation 10). Calculate the second-order moment estimation of the gradient, which involves processing the adaptive learning rate and maintaining the exponential moving average vector v<sub>t</sub> of the gradient squared to adjust the learning rate of each parameter (Equation 11). Due to the two moving average vectors being biased toward zero in the initial stage, bias correction can be performed using Equations 12, 13, and the model parameter θ<sub>t</sub> can be updated based on the corrected moment estimation results (Equation 14).

m t = β 1 m t − 1 + ( 1 − β 1 ) g t (10)

v t = β 2 v t − 1 + ( 1 − β 2 ) g t 2 (11)

m ̂ t = m t / ( 1 − β 1 t ) (12)

v ̂ t = v t / ( 1 − β 2 t ) (13)

θ t = θ t − 1 − α ⋅ m ̂ t / v ̂ t + ε (14)

Where β<sub>1</sub> is the first-order moment decay rate; β<sub>2</sub> is the second-order moment decay rate; t represents the time step (number of iterations); g<sub>t</sub> is the current gradient, α is the learning rate; ε is a small constant that prevents zero division.

According to modern machine learning practices, the performance of optimizers is highly dependent on regularization, initialization, and training strategies. Using Adam optimizer alone often makes it difficult to achieve stable generalization performance on complex tasks (Liu et al., 2019; Bian and Priyadarshi, 2024). Given that solving the nonlinear relationship between the discharge coefficient of a triangular weir and its structural parameters is a complex problem, the Adam optimizer will integrate strategies such as Xavier initialization, L2 regularization, Dropout, and early stopping in the study.

In summary, the key difference between the Adam-optimized BP network and the conventional BP network lies in the weight update strategy. Conventional BP typically relies on stochastic gradient descent (SGD) with a fixed learning rate, which often leads to slow convergence. In contrast, Adam adaptively adjusts the learning rate for each parameter using first- and second-order moment estimates of the gradients, enabling faster convergence and more stable training dynamics.

2.4 Model parameter configuration and evaluation method

To ensure the fairness and reproducibility of the experiment, a unified parameter configuration was applied to the different models in this study. The specific key parameter settings are shown in Table 2. All models were trained under the same data partitioning strategy and preprocessing method (Z-score normalization), with a fixed random seed of 42. Several optimizations were introduced in the AdaBP-E model to enhance its nonlinear expressive capability and prevent overfitting.

Table 2. Configuration of key model parameters.

ParameterLRBP-GDBP-LMAdaBP-E
Network architecture/4–10-14-8-4-1
Optimization algorithmLeast squares methodTraingdxTrainlmAdam(β1 = 0.9, β2 = 0.999)
Learning rate/0.01Initial 0.01 (dynamic)
Regularization//L2(λ = 0.0005) + Dropout(0.1)
Activation functionLinearSigmoidReLU
Training ControlAnalytical solutionMaximum 2000 roundsI Early stopping (patient = 50), share counterII Early stopping (patient = 100), independent counter
Learning rate adjustment patience = 50, attenuation coefficient 0.98
Maximum 2000 rounds
Convergence condition/1e-3Verify optimal loss

The hyperparameters of AdaBP-E were primarily determined through preliminary experiments on the validation set. The network structure (4–8–4-1) was chosen considering the trade-off between model capacity and overfitting risk given the limited sample size. The Dropout rate (0.1) and L2 coefficient (0.0005) were adjusted based on validation performance, and the initial learning rate (0.01) follows the default setting for the Adam optimizer with a patience-based decay strategy applied during training (Wen et al., 2017; Garbin et al., 2020). This dynamic adjustment accelerates convergence during early training and stabilizes the optimization process in later stages by gradually reducing the step size as the validation loss plateaus.

In the parameter configuration of the AdaBP-E model, two comparative strategies were set up to explore the impact of early stopping mechanism design on training stability: the shared counter mechanism (learning rate adjustment and early stopping sharing the counter) and the independent counter mechanism (separation of the two counters). This design aims to verify through experimental comparison whether independent counters can effectively solve potential logical conflicts in shared counters, and evaluate the impact of different strategies on the convergence process and final performance of the model.

To further evaluate model generalizability under limited sample size, a stratified Bootstrap resampling strategy was additionally employed. Conventional Bootstrap performs random sampling with replacement across the entire dataset, which may inadvertently alter the distribution of key hydraulic parameters in individual training sets (Tsamardinos et al., 2018). To address this, the present study stratified the data according to the crest angle θ (three intervals: 30°-60°, 90°-120°, 150°-180°) and the Froude number F<sub>r</sub> (three intervals: <1.0, 1.0–1.5, >1.5), yielding nine distinct strata. Within each stratum, independent sampling with replacement was performed with the number of drawn samples equal to the stratum size, ensuring that each training set preserves the original proportion of hydraulic conditions. The samples not drawn in each iteration served as the test set. This procedure was repeated 50 times to obtain statistically stable estimates. This stratified design provides a more stringent assessment of model generalization than conventional random splitting. Considering the limited sample size (123 instances), Bootstrap resampling was preferred over conventional k-fold cross-validation to maintain a sufficiently large training set in each iteration. The stability of the Bootstrap results also serves as an empirical indicator that overfitting is not a major concern with the current dataset.

The evaluation method of the model will use statistical methods such as the coefficient of determination (R2), root mean square error (RMSE), and mean relative error (MRE) to determine the quantitative performance of the model. The size of the coefficient of determination indicates the predictive performance of the model. The range of R2 values is [0, 1], and the closer the value is to 1, the better the model’s predictive performance; the magnitude of RMSE and MRE indicates the difference between predicted data and actual data. The smaller the value, the smaller the model error and the higher the accuracy (Chicco et al., 2021).

In addition, the study also added the perturbation analysis method to calculate the sensitivity index (SI), as shown in Equation 15. By applying a 10% perturbation to each input feature, the degree of change in the model output response is quantified, and the SI value reflects the importance of the feature. The calculation formula is the ratio of the average relative output change to the perturbation ratio. In most engineering application scenarios, when pursuing model generalization ability, it is generally believed that models with lower SI have a certain degree of robustness (Saltelli et al., 2004).

S I j = 1 N ∑ i = 1 N ∣ f ( x i , perturbed j ) − f ( x i ) ∣ ∣ f ( x i ) ∣ × 100 p (15)

Where SI<sub>j</sub> is the sensitivity index of the j-th feature; N is the number of test samples; f (x) is the model prediction function; x i , perturbed j is the input of the j-th feature of the i-th sample to the disturbance; p is the disturbance setting ratio (set to 10%).

For additional benchmarking, three widely used machine learning models-Support Vector Machine (SVM), Random Forest (RF), and Extreme Learning Machine (ELM)-were also implemented with default parameter settings and the same data split for comparison.

The computational cost of AdaBP-E was evaluated to assess its practical feasibility. The model contains 81 trainable parameters, slightly more than BP-LM (61) but substantially fewer than typical deep learning architectures. Based on 50 stratified Bootstrap iterations, the average training time per run was approximately 0.33 s, with convergence achieved within about 250 epochs-considerably fewer than the preset maximum of 2000-benefiting from the independent early-stopping mechanism. The inference time per sample was approximately 0.004 milliseconds, indicating that the model is sufficiently lightweight for real-time hydraulic monitoring. Integration can be achieved by embedding the trained model weights into edge devices or cloud-based platforms, enabling instantaneous prediction once new field measurements are acquired.

3 Results and discussion

3.1 Comparative analysis of overall predictive performance of models

3.1.1 Comparison between four models

Table 3 summarizes the performance of four prediction models (LR, BP-GD, BP-LM, and AdaBP-E) on the training and testing sets.

Table 3. Summary of model performance comparison.

Indicator methodTrainingTesting
RMSER2MAEMRE(%)RMSER2MAEMRE(%)
LR0.02700.85280.02233.150.03580.72670.02623.56
BP-GD0.01810.93360.01522.150.01740.93590.01361.87
BP-LM0.01130.97400.00901.260.01490.95260.00991.33
AdaBP-E0.01060.97740.00851.180.01190.96970.00951.31

To improve the training control mechanism, this study compared two early stopping strategies of the AdaBP-E model (as described in section 2.4). In actual results, the two strategies showed consistent performance in prediction accuracy, and the independent counter strategy (AdaBP-E (II)) was more reasonable in the training process control. Unless otherwise specified, AdaBP-E (II) was used as the representative in subsequent analysis. The differences in the dynamic training process between the two strategies will be analyzed in detail in sections 3.3 and 3.6.4.

Overall, the performance of the training and testing sets shows a significant gradient across the four models. LR performs the weakest on both the training and testing sets, with an RMSE of 0.0358 and an R2 of 0.7267 on the testing set. This result reflects the fundamental flaw of the linear regression model when applied to complex nonlinear systems in the field of discharge coefficient prediction, which may have overlooked the mutual influence among θ, F<sub>r</sub>, L/w, L/h, and C<sub>d</sub> during the application process. Therefore, the applicability of LR models for predicting C<sub>d</sub> of triangular weirs with certain requirements for prediction accuracy is relatively low.

All three neural network models are significantly better than LR, reflecting the advantages of neural networks in handling nonlinear and high-dimensional data. Among them, BP-GD has an RMSE of 0.0174 and an R2 of 0.9359 on the test set, indicating good predictive stability; BP-LM was further optimized, with the RMSE of the test set reduced to 0.0149 and the R2 increased to 0.9526, indicating that the LM algorithm outperforms traditional gradient descent in terms of convergence speed and accuracy.

The optimal model is AdaBP-E, with an RMSE of only 0.0119 and an R2 of 0.9697 on the test set. Both MAE and MRE are the lowest. The contributions of individual components and the role of Dropout in ensuring predictive stability are further examined in Section 3.6.3. Compared to the BP-LM neural network model, AdaBP-E reduced the RMSE, MAE, and MRE of the test set by approximately 20.13, 4.04, and 1.50%, respectively, and increased R2 by approximately 1.80% relative to that of BP-LM (from 0.9526 to 0.9697). In predicting the discharge coefficient of a triangular weir, lower errors can guide the setting of more accurate thresholds, thereby ensuring that, within a reasonable parameter range, efficiency reduction caused by overly conservative predictions can be avoided.

Table 4 and Figure 3 present the stratified Bootstrap validation results. AdaBP-E achieves the highest mean R2 (0.9269), surpassing BP-LM (0.9164), while exhibiting substantially lower variability (σ = 0.0431 vs. 0.1911), corresponding to a 77.4% reduction in standard deviation. The cumulative distribution functions in Figure 3b further confirm this stability advantage, with AdaBP-E’s R2 values concentrated within a narrow high-performance range, whereas BP-LM shows considerably greater dispersion. Additionally, AdaBP-E exhibits the lowest RMSE variability (σ = 0.0052 vs. 0.0122 for BP-LM), further confirming its predictive consistency. These findings demonstrate that AdaBP-E not only delivers competitive accuracy but also provides superior predictive reliability across diverse training samples. The superior stability of AdaBP-E is particularly valuable in hydraulic applications, where the discharge coefficient is sensitive to variations in upstream flow conditions (reflected by F<sub>r</sub>) and weir geometry (reflected by L/w and L/h).

Table 4. Stratified Bootstrap validation results for the three models (50 iterations).

ModelRMSE (Mean ± Std)R2 (Mean ± Std)
BP-GD0.0403 ± 0.02610.5271 ± 0.6451
BP-LM0.0164 ± 0.01220.9164 ± 0.1911
AdaBP-E0.0178 ± 0.00520.9269 ± 0.0431
Stratified bootstrap validation results: **(a)** Mean *R<sup>2</sup>* with ±1 standard deviation; **(b)** Cumulative distribution functions of *R<sup>2</sup>*.
Figure 3. Stratified bootstrap validation results: (a) Mean R<sup>2</sup> with ±1 standard deviation; (b) Cumulative distribution functions of R<sup>2</sup>.

The standard deviations derived from the 50 Bootstrap iterations provide an empirical estimate of prediction uncertainty. The relatively small σ values for AdaBP-E (0.0431 for R2 and 0.0052 for RMSE) indicate consistent predictive performance across repeated resampling, suggesting low uncertainty in model predictions on this dataset.

A paired Wilcoxon signed-rank test was conducted on the R2 values from the 50 Bootstrap iterations to compare AdaBP-E with BP-LM. The test yielded a p-value of 1.000 (mean difference = 0.0105, 95% CI: −0.0442 to 0.0653), indicating no statistically significant difference in mean accuracy between the two models. This further confirms that AdaBP-E achieves accuracy comparable to BP-LM, while its stability advantage (77.4% reduction in standard deviation) remains the key differentiator.

Furthermore, combining the results of Table 3 and Figure 4, it can be intuitively seen that except for the BP-GD model performing better on the test set than on the training set [usually due to the randomness of data partitioning or moderate early stopping during model training, which is an unconventional performance of generalization gap (Zhang C. et al., 2021)], the bar charts of different performance indicators of the remaining models on the test set are slightly higher than those on the training set, indicating that the models all have a certain degree of generalization gap.

Comparative analysis of model performance indicators: **(a)** RMSE; **(b)** R<sup>2</sup>; **(c)** MRE; **(d)** MAE.
Figure 4. Comparative analysis of model performance indicators: (a) RMSE; (b) R2; (c) MRE; (d) MAE.

The BP-GD model has the closest bar chart heights between the training and testing sets on RMSE and R2 (0.0007 and 0.0023, respectively), indicating that its optimization process (gradient descent) may result in relatively stable prediction consistency for the square of the overall error. However, the RMSE and R2 differences of AdaBP-E on the training and testing sets are also at a low level, and its MRE and MAE bar charts are the closest and overall lowest (0.001 and 0.13%, respectively), indicating that its adaptive mechanism may be more effective in controlling the deviation level between the predicted C<sub>d</sub> and the true C<sub>d</sub>, making it more robust on different datasets. This difference suggests that different models may have unique generalization characteristics in different error measurement dimensions. The high consistency demonstrated by AdaBP-E in key practical application indicators (MAE, MRE) further confirms its potential to provide reliable predictions in predicting the C<sub>d</sub> of triangular weirs.

The AdaBP-E model demonstrates strong generalization ability, suggesting that it effectively captures the nonlinear mechanisms of turbulent flow and the interactions among hydraulic parameters under varying conditions of the triangular weir structure parameters, thereby ensuring that the prediction bias of the discharge coefficient can be controlled at a lower level when facing new conditions. The high accuracy of the model can provide assistance for the subsequent optimization of the triangular weir structure, effectively reducing the unreasonable structural design caused by inaccurate predictions.

Three additional models-SVM, RF, and ELM-were evaluated on the same dataset using identical preprocessing and data split. The results are summarized in Table 5. Among the compared methods, AdaBP-E yields the lowest RMSE (0.0119) and the highest R2 (0.9697) on this dataset. This result shows the potential of the internal optimizer in predicting performance in hydraulic scenarios.

Table 5. Comparison with additional machine learning models.

ModelRMSER2
SVM0.02110.9057
Random Forest0.03200.7818
ELM0.03690.7101
BP-LM0.01490.9526
AdaBP-E0.01190.9697

SVM, RF, and ELM were implemented with default parameters without dataset-specific tuning.

3.1.2 Comparison with previous studies

In previous studies, Kumar et al. (2011) fitted the discharge coefficient formula as shown in Equation 16:

C d = ( − 0.065 θ 3 + 0.318 θ 2 − 0.537 θ + 1.190 ) + ( 0.090 θ 3 − 0.570 θ 2 + 1.460 θ − 1.670 ) h w (16)

The research results indicate that the empirical formula has R2 = 0.9249 and RMSE = 0.0192. The AdaBP-E model achieves an R2 of 0.9697 and an RMSE of 0.0119, compared to the empirical formula values of 0.9249 and 0.0192. This corresponds to a relative improvement of approximately 4.84% in R2 and 38.02% in RMSE, indicating that the proposed model offers substantially better predictive accuracy and generalization than the traditional empirical formula.

3.2 Visualization of prediction results and error distribution

3.2.1 Comparison of scatter points between predicted and actual values

Figure 5 shows scatter plots comparing predicted and true values for different models: Figure 5a shows the training set results, and Figure 5b shows the testing set results. For different datasets, the scatter points of AdaBP-E are closest to the ideal line, indicating that its prediction accuracy is relatively high; BP-LM shows the second highest accuracy, while LR and BP-GD exhibit the highest degree of dispersion, especially showing more significant prediction errors at both ends of the numerical distribution, reflecting their limited generalization ability and nonlinear adaptability. Overall, all models show a relatively concentrated distribution in the middle-value region, with a systematic bias between the low- and high-value regions.

Comparison between predicted values and actual values: **(a)** training set; **(b)** test set.
Figure 5. Comparison between predicted values and actual values: (a) training set; (b) test set.

The comparison between Figures 5a,b shows that on the training set, the prediction points of each model are close to the ideal line, and AdaBP-E and BP-LM fit well; on the test set, all model prediction points appear with relatively significant dispersion, and the deviation between LR and BP-GD is the most obvious. This shows that the model (especially the traditional method) has insufficient generalization and an overfitting tendency, but AdaBP-E introduces an adaptive mechanism that keeps it relatively optimal on the test set.

3.2.2 Box plot analysis of prediction error distribution

Figure 6 shows the boxplots of the absolute errors for each model prediction. On the training set, LR has the widest error distribution and limited ability to capture nonlinearity; the errors of BP-GD, BP-LM, and AdaBP-E were narrowed.

Distribution of prediction errors: **(a)** training set; **(b)** test set.
Figure 6. Distribution of prediction errors: (a) training set; (b) test set.

On the test set, LR shows a significant negative outlier and exhibits the worst generalization; BP-GD displays a wide box, while BP-LM presents an outlier in the boxplot; the span of AdaBP-E box is in the middle, the median is close to 0, and there is no extreme outlier, indicating that AdaBP-E maintains consistent prediction accuracy across different operating conditions. On the whole, the BP model is better than LR, while AdaBP-E performs best in stability and generalization, which verifies the effectiveness of improving the robustness of the hydrological model.

3.3 Dynamic analysis of model training process

Figure 7 shows the changes in loss curves of different models during training. Among them, the loss of BP-GD (Figure 7a) decreased rapidly in the first 20 steps, and then the convergence rate slowed down. It has undergone 90 rounds of training in total. This process verifies that the loss decreases synchronously, reflecting the characteristics of steady optimization of traditional gradient descent in iteration (which may be conducive to the model gradually learning the mapping relationship between discharge coefficient and structural parameters), but the overall convergence process is relatively slow, which may reduce the efficiency of dealing with variable flow regimes. The BP-LM (Figure 7b) achieves the fastest convergence, with both training and validation loss decreasing to near zero within 10 epochs, and finally goes through 16 rounds, reflecting its efficiency in small sample scenarios; however, its rapid convergence also indicates that under complex flow regimes, it is necessary to be vigilant against the risk of falling into local optimum or being overly sensitive to accidental noise in the training data.

Comparison of neural network training processes: **(a)** BP-GD; **(b)** BP-LM; **(c)** AdaBP-E(I); **(d)** AdaBP-E(II).
Figure 7. Comparison of neural network training processes: (a) BP-GD; (b) BP-LM; (c) AdaBP-E(I); (d) AdaBP-E(II).

Figures 7c,d show that AdaBP-E offers significant advantages in predicting the C<sub>d</sub> of the triangular weir. Since the initial stage of training, the loss curve has rapidly declined and stabilized at a low level, which indicates that the model can quickly capture the core mapping relationship with the C<sub>d</sub> from different dimensionless input data. Although the final prediction accuracy of AdaBP-E(I) and AdaBP-E(II) is completely the same, the training process efficiency is very different.

The independent counter strategy (AdaBP-E(I)) effectively triggered the early stopping in the 195th round after verifying that the loss remained unchanged. However, due to a conflict between the learning rate adjustment and the early stopping logic of the shared counter strategy (AdaBP-E(II)), the counter was repeatedly reset, and the early stopping conditions were not consistently met. Finally, the preset maximum of 2000 training rounds was exhausted. Both strategies experienced loss oscillation after about 100 rounds when entering the parameter flat area. However, the independent counter strategy reduced training epochs by more than 90% while maintaining the same accuracy as the shared counter strategy, demonstrating a clear advantage in training efficiency.

3.4 Analysis of model response characteristics

In predicting C<sub>d</sub> at the triangular weir, complex synergistic or antagonistic effects often occur among structural parameters (Nouri and Hemmati, 2020). To visually show the ability of different models to depict the relationship between input characteristics and outputs, Figure 8 presents a 3D response surface diagram. Feature selection follows the following principles: Based on the absolute-value ranking of the LR model’s coefficients, select the two features with the greatest impact on the output for visualization. In this study, the absolute values of the linear regression coefficients for features 2 and 3 (F<sub>r</sub> and L/w) are the largest (Table 6), indicating that they are the main factors affecting the output and are selected as the coordinate axes of the response surface.

Comparative analysis of three-dimensional response surfaces (with other features fixed at their average values): **(a)** LR; **(b)** BP-GD; **(c)** BP-LM; **(d)** AdaBP-E.
Figure 8. Comparative analysis of three-dimensional response surfaces (with other features fixed at their average values): (a) LR; (b) BP-GD; (c) BP-LM; (d) AdaBP-E.

Table 6. Input characteristic coefficient results.

Parameterβ 0β 1β 2β 3β 4
Coefficient value0.56880.00040.4876−0.0914−0.0010

β0 is the intercept term, and β1-β4 correspond to input characteristics 1–4, respectively.

The response surface of LR presents a simple plane, indicating that it can only capture the linear superposition effect of features. It is difficult to explain the nonlinear phenomena, such as the joint effect of characteristic structural parameters, such as weir crest angle and weir crest length, on discharge coefficient, which may lead to the failure of prediction under complex working conditions.

The response surface of the BP-GD model exhibits a smooth, nonlinear shape, which better fits the distribution of the training data. The output range is between 0.6–0.9, and the surface transition is natural, showing a certain generalization potential; the local fitting accuracy of BP-LM model response surface is high, and the fitting degree in the training data intensive area is better than LR, but the overall surface is still relatively flat, and the output range is between 0 and 1.5, which improves the ability to capture the nonlinear relationship, but the response variation is limited in the area far away from the data points.

In contrast, the response surface of the AdaBP-E model shows a complex, smooth topology, with an output range of 0.5–0.9 (the prediction range of C<sub>d</sub> is more concentrated, with relatively small fluctuations). However, the nonlinear curvature of the surface reflects the inherent complexity of the flow-weir interaction, where the combined effects of F<sub>r</sub> and L/w on C<sub>d</sub> cannot be adequately captured by a linear superposition.

3.5 Sensitivity analysis and model robustness evaluation

3.5.1 Analysis of model sensitivity distribution characteristics

The sensitivity index (SI) quantifies the response of model output to input perturbations, which can also be interpreted as a measure of feature importance, where higher SI values indicate greater influence on predictions. The sensitivity analysis results, presented in Figure 9a, reveal distinct responses to input perturbations across different models, an important consideration for assessing model robustness in data-driven hydrological applications. Among them, the sensitivity values of feature2 under LR, BP-GD, BP-LM, and AdaBP-E models are 72.86, 41.43, 61.33, and 22.40, respectively, which are at a high level as a whole, and are the most significant features affecting the model output; feature3 followed, with sensitivity values of 55.81, 30.70, 48.21, and 30.93, respectively. The sensitivity values of feature1 and feature4 are significantly lower than those of other features, and feature4 has the weakest impact on the model output. The results are consistent with the results of feature importance selection in model response characteristics. From a hydraulic standpoint, the dominant influence of F<sub>r</sub> is expected, as it governs the transition between subcritical and supercritical flow regimes, which directly alters the discharge efficiency. The high sensitivity of L/w is also physically meaningful, since it reflects the geometric constraint that modulates flow contraction and energy losses over the weir.

Sensitivity distribution and comparison: **(a)** Sensitivity analysis heatmap; **(b)** Model average sensitivity comparison.
Figure 9. Sensitivity distribution and comparison: (a) Sensitivity analysis heatmap; (b) Model average sensitivity comparison.

From the comparison of average sensitivity in Figure 9b, the average sensitivity of the BP-LM model is the highest (33.40), indicating that it is the most sensitive to the change of input characteristics; the average sensitivity of the AdaBP-E model is the lowest (19.51), and its robustness to input disturbance is relatively stronger. The average sensitivity of LR (34.53) and BP-GD (25.14) was in the middle range. In general, the sensitivity of different models to input characteristics varies significantly. BP-LM is more susceptible to input changes, while AdaBP-E shows outstanding stability in triangular weir flow prediction and is better suited to variable, noisy flow regime data in the actual hydrological monitoring environment.

3.5.2 Correlation analysis between sensitivity and prediction performance

Figure 10 shows that the average sensitivity of the model is positively correlated with RMSE of the test set (Figure 10a) and negatively correlated with R2 (Figure 10b). AdaBP-E has the lowest sensitivity, so RMSE is the lowest, R2 is close to 1, and the prediction accuracy is the highest; LR has the highest sensitivity, RMSE is the highest, R2 is only 0.7, and the fitting is the worst, indicating that too high sensitivity amplifies the disturbance. In the ranking comparison (Figure 10c), AdaBP-E ranked first in sensitivity and performance indicators, which confirmed that moderate sensitivity control was conducive to balance fitting and generalization, and improved the robustness of triangular weir flow prediction.

Analysis of the relationship between sensitivity and performance: **(a)** Relationship between sensitivity and test error; **(b)** Relationship between sensitivity and model fitting; **(c)** Ranking of sensitivity indicators and performance ranking.
Figure 10. Analysis of the relationship between sensitivity and performance: (a) Relationship between sensitivity and test error; (b) Relationship between sensitivity and model fitting; (c) Ranking of sensitivity indicators and performance ranking.

3.6 Analysis of AdaBP-E model training mechanism

3.6.1 Dynamic monitoring and analysis of AdaBP-E training process

Figure 11a shows that the AdaBP-E model with an independent counter strategy triggered an early stopping in the 195th round. At this time, the verification loss has not reached a new low for 100 consecutive rounds and has remained stable, indicating that the model terminated training in time without over-fitting. The learning rate is maintained at 0.01 in the early stage to converge rapidly. When the verification loss has not improved for 50 consecutive rounds, it will be gradually reduced according to the preset attenuation coefficient (0.98): it is reduced to 0.0098 at the 145th round and eventually to 0.0096. The dynamic adjustment mechanism effectively alleviates parameter oscillation in the later stage, promotes stable convergence of the training process, and balances convergence efficiency and numerical stability in predicting the C<sub>d</sub> of the triangular weir.

Monitoring the dynamic training process of the AdaBP-E model: **(a)** loss curve and dynamic adjustment of learning rate; **(b)** gradient norm variation; **(c)** neuron activation rate variation; **(d)** loss convergence speed.
Figure 11. Monitoring the dynamic training process of the AdaBP-E model: (a) loss curve and dynamic adjustment of learning rate; (b) gradient norm variation; (c) neuron activation rate variation; (d) loss convergence speed.

Figure 11b shows that the gradient norm dropped to 0.2 in the first 100 rounds, rose to 2 in the 101st round due to Dropout, and then dropped to 0.4, indicating that the model converged to a better parameter area after disturbance. In Figure 11c, the activation rate of layer1/2 rose to 64%/80% in the early stage, and then dropped to 46%/58% after the oscillation. The trend is synchronous, indicating that ReLU and Dropout promote network pruning redundancy and form an efficient feature extraction path. Figure 11d shows that the loss convergence rate decreased slowly from 0.02 to 0, the 101 round mutation was −0.03, and then oscillated around 0, indicating that the disturbance made the model jump out of local stability, enter robust fine-tuning, and improve the generalization performance.

Overall, the AdaBP-E model realizes an efficient and robust training process through dynamic learning rate adjustment, early stopping mechanism, and stable gradient update, which not only ensures the convergence speed but also avoids the risk of over-fitting.

3.6.2 Statistical characteristics analysis of weight distribution in AdaBP-E network

Figure 12 shows the distribution of network weights across the layers of the AdaBP-E model. Figure 12a shows that the weight of the first layer is concentrated in the range of −0.5 to 0.5, with a peak near −0.5, indicating that the response of this layer to the input characteristics is relatively concentrated, and the main hydraulic model can be extracted stably. In Figure 12b, the weight distribution of the second layer exhibits a multimodal distribution, indicating that it undergoes a complex nonlinear transformation during feature reorganization to meet the prediction requirements of different flow regimes. Figure 12c shows that the output layer’s weight distribution is sparse, with all frequencies equal to 1, reflecting the model’s obvious sparsity and effectively reducing redundant parameters, thereby improving the model’s generalization ability and prediction stability.

AdaBP-E model network weight distribution: **(a)** First-layer; **(b)** Second-layer; **(c)** Output-layer.
Figure 12. AdaBP-E model network weight distribution: (a) First-layer; (b) Second-layer; (c) Output-layer.

Tables 7, 8 present the weight matrices from the input layer to the first hidden layer (w1) and from the first hidden layer to the second hidden layer (w2), respectively. Table 9 provides the weight vector between the second hidden layer and the output layer (w3) and statistical information for each weight matrix.

Table 7. Weight matrix of the first layer of AdaBP-E (w1).

H1<sub>1</sub>H1<sub>2</sub>H1<sub>3</sub>…H1<sub>8</sub>
x<sub>1</sub>−0.2208−0.67080.1217…−1.3490
x<sub>2</sub>0.4117−0.01550.4838…−0.2716
x<sub>3</sub>0.3647−1.1183−0.5851…−0.4178
x<sub>4</sub>0.40260.69321.0373…−0.6472

xj represents the j-th input feature, and H1m represents the m-th neuron in the first hidden layer.

Table 8. Weight matrix of the second layer of AdaBP-E (w2).

H2<sub>1</sub>H2<sub>2</sub>H2<sub>3</sub>H2<sub>4</sub>
H1<sub>1</sub>0.94440.06710.00690.3397
H1<sub>2</sub>0.8844−0.40261.4358−0.7924
H1<sub>3</sub>0.42130.60410.5293−0.1798
……………
H1<sub>8</sub>−0.45850.0429−0.74010.3837

H2k represents the k-th neuron in the second hidden layer.

Table 9. Comparison of weight statistics for each layer of AdaBP-E model.

ParameterFirst layerSecond layerOutput layer
Dimension4 × 88 × 44 × 1
Weight valuew 1w 2[0.1268, −0.6571, 0.5089, −1.1925]
Minimum−1.3490−0.8581−1.1925
Maximum1.03731.43580.5089
Mean−0.08620.1793−0.3035
Standard deviation0.61340.59790.7660
Skewness−0.24820.3167−0.1123
Kurtosis2.36182.59591.4326
Mean absolute value0.50520.48060.6213

Based on the weight statistics in Table 9, the AdaBP-E model’s weight distribution exhibits the following characteristics: reasonable weight ranges across layers, no extreme values, and a mean close to 0, indicating that L2 regularization effectively controls weight amplitudes and prevents overfitting. The standard deviation remains between 0.6 and 0.8, and the output layer is slightly higher (0.7660), indicating that the weights exhibit some degree of discreteness, but no gradient anomalies have occurred. The absolute values of skewness are all less than 0.5, indicating a distribution that is basically symmetrical. The kurtosis value is below 3 (w3 is only 1.43), indicating that the weight distribution is flatter than the normal distribution, which improves the model’s expression ability. The output layer weight vector contains positive and negative values (−1.1925 to 0.5089), reflecting the differential contribution of the second hidden layer neurons to the discharge coefficient. The overall weight statistical characteristics indicate that the model achieves a good balance between nonlinear mapping and regularization constraints, which is beneficial for generalization performance.

3.6.3 Ablation analysis of AdaBP-E components

To evaluate the contribution of each component in AdaBP-E, a series of ablation experiments was conducted. The performance of five variants-full AdaBP-E, w/o Adam, w/o Dropout, w/o L2, and w/o Early Stopping-was compared on the same test split. The results are summarized in Table 10.

Table 10. Ablation study results of AdaBP-E components on the test set.

VariantRMSER2Training epochs
Full AdaBP-E0.01190.9697195
w/o Adam0.02490.8677978
w/o Dropout0.01030.9773353
w/o L20.01440.9560193
w/o Early Stopping0.01190.96972000

Table 10 reveals the distinct roles of each component. Removing Adam caused the most significant performance degradation, with RMSE increasing from 0.0119 to 0.0249 and R2 decreasing from 0.9697 to 0.8677, confirming its critical role in enabling stable and efficient optimization. Removing L2 led to moderate performance decline, with RMSE increasing from 0.0119 to 0.0144 and R2 decreasing from 0.9697 to 0.9560, demonstrating its regularization effect. Removing Early Stopping preserved accuracy but increased training epochs from 195 to 2000, highlighting its importance for computational efficiency.

The role of Dropout requires further examination. As shown in Table 11, removing Dropout from a single-split evaluation slightly improved test accuracy, with RMSE decreasing from 0.0119 to 0.0103 and R2 increasing from 0.9697 to 0.9773. To determine whether this improvement reflects genuine generalization or overfitting to a particular data split, stratified Bootstrap resampling (50 iterations) was performed to compare the stability of the full model and the variant without Dropout.

Table 11. Comparison of Bootstrap results with and without dropout (50 iterations).

VariantRMSE (Mean ± Std)R2 (Mean ± Std)R2 WorstR2 Range
Full AdaBP-E0.0178 ± 0.00520.9269 ± 0.04310.78390.1908
w/o Dropout0.0150 ± 0.00590.9453 ± 0.05180.66480.3164

The Bootstrap comparison reveals a clear trade-off between mean accuracy and predictive stability. Without Dropout, the model achieves slightly higher mean R2 (0.9453 vs. 0.9269), but this comes at the cost of substantially reduced reliability: the worst-case R2 dropped from 0.7839 to 0.6648, and the performance range widened considerably (0.1908 vs. 0.3164). This indicates that removing Dropout increases the risk of poor predictions in unfavorable data conditions. The complete AdaBP-E, by contrast, maintains consistent performance across diverse training samples, which is particularly valuable in hydraulic engineering applications where stable and trustworthy predictions are essential for decision-making and risk assessment.

3.6.4 Visualization comparison of 3D training trajectory of AdaBP-E model

Figures 13a,b show the 3D training dynamic trajectories of two models, AdaBP-E(I) and AdaBP-E(II). The 3D coordinates are the training loss, learning rate, and gradient norm, as well as the color mapping training progress (Epoch proportion) of process points, transitioning from blue (early training stage) to red (late training stage).

Visualization of 3D dynamic processes and model comparison: **(a)** 3D dynamic trajectory of AdaBP-E(I) training process; **(b)** 3D dynamic trajectory of AdaBP-E(II) training process; **(c)** 3D comparison of model performance, sensitivity, and complexity.
Figure 13. Visualization of 3D dynamic processes and model comparison: (a) 3D dynamic trajectory of AdaBP-E(I) training process; (b) 3D dynamic trajectory of AdaBP-E(II) training process; (c) 3D comparison of model performance, sensitivity, and complexity.

AdaBP-E(I) adopts a single counter early stopping mechanism, and the training path gradually converges from the high loss region. The learning rate adjustment range is wide, and the convergence rhythm is gentle, simulating the multi-round exploration of complex flow states in traditional methods. AdaBP-E(II) adopts an independent dual counter mechanism, separating learning rate adjustment from early stopping. The training trajectory is more compact, the learning rate adjustment interval is narrower, the convergence speed is faster, and the final state is more concentrated. AdaBP-E(II) exhibits more stable and efficient training characteristics. This indicates a stronger capacity to capture the complex nonlinear relationship between the discharge coefficient and structural parameters. The approach also reduces overfitting risk and provides more efficient predictions across varying hydraulic conditions.

The results in Figure 13c compare the performance (R2), sensitivity, and complexity of four models in 3D, including the ideal region (defined by the green color block: R2 is 0.9 times the maximum value to the maximum value, sensitivity is half the minimum value to the minimum value, and complexity is 0.8 times the minimum complexity).

In the typical nonlinear fitting problem of predicting the C<sub>d</sub> of a triangular weir, the LR model has the lowest complexity due to its linear structure (only 5 parameters), but its R2 performance is poor, and its sensitivity is high, indicating that it is difficult to characterize the complex nonlinear relationships between multiple factors. The R2 of BP-GD and BP-LM models (61 parameters) have entered the ideal region, indicating their good fitting ability. However, the BP-LM model exhibits high sensitivity, which means it is more sensitive to changes in input parameters and may have weaker robustness in practical applications.

The AdaBP-E model (with 81 parameters) achieved the best balance in three dimensions. Its R2 is the highest and also located in the ideal area. The sensitivity is the lowest among the compared models, indicating enhanced robustness to input perturbations. Its generalization capability has been discussed in earlier sections through stratified Bootstrap validation. Despite its relatively high complexity, the increase in parameter count has resulted in a stronger ability to characterize complex flow patterns, and the built-in regularization mechanism effectively controls the risk of overfitting. Therefore, AdaBP-E is the closest choice to the ideal region, achieving the optimal balance between prediction accuracy, model robustness, and engineering practicality-qualities that are essential for reliable water resource management and hydraulic infrastructure assessment.

4 Conclusion

This study focuses on the nonlinear prediction of the discharge coefficient of triangular weirs, and compares and analyzes LR, BP-GD, BP-LM, and the proposed AdaBP-E model. Through multidimensional verification, AdaBP-E has significant advantages in accuracy, robustness, and efficiency. The main conclusions are as follows:

  • AdaBP-E has the best prediction accuracy. The RMSE of the test set is 0.0119, and the R2 reaches 0.9697. Compared with BP-LM, the RMSE decreases by 20.1%, and the R2 increases by 1.8%; improved by 4.8% compared to the empirical formula R2, it can more accurately depict complex nonlinear relationships.
  • AdaBP-E(II) adopts an independent counter that decouples learning rate and early stopping While maintaining accuracy, the training epochs are reduced by more than 90% compared to the coupling strategy, and the convergence is efficient and robust, making it more suitable for engineering applications.
  • AdaBP-E has the lowest average sensitivity (19.51) and the smallest fluctuation in the input disturbance output. Combined with a low error rate and no outliers, this indicates strong adaptability to measurement noise and changes in operating conditions.
  • From the comprehensive evaluation of R2, sensitivity, and complexity in three dimensions, AdaBP-E is the closest to the ideal model area, achieving a balance of accuracy, stability, efficiency, and interpretability with 81 parameters. It provides a reliable, intelligent solution for predicting the discharge coefficient of triangular weirs, supporting data-driven hydrological modeling, flood risk mitigation, and sustainable water resource management.

A limitation of this study is the reliance on a single experimental dataset. While the stratified Bootstrap provides rigorous internal validation, future work should focus on collecting broader experimental data and applying transfer learning to other weir configurations. Additionally, model compression and edge deployment remain challenging but important directions for facilitating real-time hydraulic monitoring.

Generative AI statement

The author(s) declared that Generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Footnotes

Edited by: Meysam Salarijazi, Gorgan University of Agricultural Sciences and Natural Resources, Iran

Reviewed by: Sagar Tomar, Central Building Research Institute (CSIR), India

Mrinmoy Dhar, ICFAI University, India

Statements

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Funding

The author(s) declared that financial support was received for this work and/or its publication. This work was financially supported by the Science and Technology Plan Project Special Fund of Zhejiang Provincial Education Department (Project No. Y202249406), the Scientific Research Fund of Zhejiang Provincial Education Department (Project No. Y202559321), and the financial support from the China Scholarship Council (CSC).

Data availability

The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.

Author contributions

GZ: Project administration, Conceptualization, Funding acquisition, Validation, Writing – original draft, Methodology, Software, Writing – review & editing, Formal analysis. MX: Writing – review & editing, Supervision, Funding acquisition, Resources, Project administration. YZ: Methodology, Writing – review & editing, Formal analysis, Resources.

References

  1. Achour B., Amara L. (2022). Flow measurement using a triangular broad crested weir theory and experimental validation. Flow Meas. Instrum. 83: 102088. doi: doi:10.1016/j.flowmeasinst.2021.102088
  2. Adnan R. M., Khosravinia P., Kisi O., Nikpour M. R., Dai H. L., Osmani M.. (2024). Predicting discharge coefficient of weir-orifice in closed conduit using a neuro-fuzzy model improved by multi-phase PSOGSA. Appl Water Sci 14: 40. doi: doi:10.1007/s13201-023-02094-y
  3. Afaridegan E., Amanian N., Goodarzi M. R. (2025). Hybrid machine learning models for discharge coefficient prediction in hydrofoil-crested stepped spillways. Arch. Comput. Methods Eng. 32, 4413 – 4445. doi: doi:10.1007/s11831-025-10274-z
  4. Ahmed S. F., Alam M. S. B., Hassan M., Rozbu M. R., Ishtiak T., Rafa N.. (2023). Deep learning modelling techniques: current progress, applications, advantages, and challenges. Artif. Intell. Rev. 56, 13521 – 13617. doi: doi:10.1007/s10462-023-10466-8
  5. Asgharzadeh-Bonab A., Bijanvand S., Parsaie A., Afaridegan E. (2025). Machine learning-based estimation of discharge coefficient for semicircular labyrinth weirs. Sci. Rep. 15: 33002. doi:, doi:10.1038/s41598-025-18230-4
  6. Azma A., Borthwick A. G., Ahmadian R., Liu Y., Zhang D. (2025). Modeling the discharge coefficient of labyrinth sluice gates using hybrid support vector regression and metaheuristic algorithms. Phys. Fluids 37. doi: doi:10.1063/5.0260738
  7. Balahang S., Ghodsian M. (2023). Evaluating performance of various methods in predicting triangular sharp-crested side weir discharge. Appl Water Sci 13: 171. doi: doi:10.1007/s13201-023-01971-w
  8. Barenblatt G. I. (1987). Dimensional Analysis. CRC Press.
  9. Bian K., Priyadarshi R. (2024). Machine learning optimization techniques: a survey, classification, challenges, and future research issues. Arch. Comput. Methods Eng. 31, 4209 – 4233. doi: doi:10.1007/s11831-024-10110-w
  10. Bonakdari H., Ebtehaj I., Gharabaghi B., Sharifi A., Mosavi A. (2020). “ Prediction of discharge capacity of labyrinth weir with gene expression programming,” in Proceedings of SAI Intelligent Systems Conference, (Springer), 202 – 217.
  11. Cea L., Costabile P. (2022). Flood risk in urban areas: modelling, management and adaptation to climate change. A review. Hydrology 9: 50. doi: doi:10.3390/hydrology9030050
  12. Chicco D., Warrens M. J., Jurman G. (2021). The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. Peerj computer science 7: e623. doi:, doi:10.7717/peerj-cs.623
  13. Dhar M., Sapkota S. C., Saha P., Arora S. (2025). Evaluating discharge coefficient of rectangular sharp crested weirs using machine learning models. Water Resour. Manag. 39, 4151 – 4171. doi: doi:10.1007/s11269-025-04152-3
  14. Dursun O. F., Kaya N., Firat M. (2012). Estimating discharge coefficient of semi-elliptical side weir using ANFIS. J. Hydrol. 426, 55 – 62. doi: doi:10.1016/j.jhydrol.2012.01.010
  15. Elshamy R., Abu-Elnasr O., Elhoseny M., Elmougy S. (2023). Improving the efficiency of RMSProp optimizer by utilizing Nestrove in deep learning. Sci. Rep. 13: 8814. doi:, doi:10.1038/s41598-023-35663-x
  16. Fatahi-Alkouhi R., Afaridegan E., Amanian N. (2024). Discharge coefficient estimation of modified semi-cylindrical weirs using machine learning approaches. Stoch. Environ. Res. Risk Assess. 38, 3177 – 3198. doi: doi:10.1007/s00477-024-02739-7
  17. Garbin C., Zhu X., Marques O. (2020). Dropout vs. batch normalization: an empirical study of their impact to deep learning. Multim. Tools Appl. 79, 12777 – 12815. doi: doi:10.1007/s11042-019-08453-9
  18. Gharehbaghi A., Ghasemlounia R., Afaridegan E., Haghiabi A., Mandala V., Azamathulla H. M.. (2023). A comparison of artificial intelligence approaches in predicting discharge coefficient of streamlined weirs. J. Hydroinf. 25, 1513 – 1530. doi: doi:10.2166/hydro.2023.063
  19. Haji S. H., Abdulazeez A. M. (2021). Comparison of optimization techniques based on gradient descent algorithm: a review. PalArch’s J. Archaeol. Egypt/Egyptology 18, 2715 – 2743.
  20. Hoseini S. H. (2014). Experimental investigation of flow over a triangular broad-crested weir. ISH J. Hydraul. Eng. 20, 230 – 237. doi: doi:10.1080/09715010.2014.884359
  21. Jin W, Li ZJ, Wei LS, Zhen H The improvements of BP neural network learning algorithm WCC 2000-ICSP 2000. 2000 5th International Conference on signal Processing Proceedings. 16th World Computer Congress 2000 (2000) IEEE 1647 – 1649
  22. 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. & Applic. 29, 983 – 989. doi: doi:10.1007/s00521-016-2588-x
  23. Kumar S., Ahmad Z., Mansoor T. (2011). A new approach to improve the discharging capacity of sharp-crested triangular plan form weirs. Flow Meas. Instrum. 22, 175 – 180. doi: doi:10.1016/j.flowmeasinst.2011.01.006
  24. Li J., Yao X., Wang X., Yu Q., Zhang Y. (2020). Multiscale local features learning based on BP neural network for rolling bearing intelligent fault diagnosis. Measurement 153: 107419. doi: doi:10.1016/j.measurement.2019.107419
  25. Liu J., Gao F., Luo X. (2019). Survey of deep reinforcement learning based on value function andpolicy gradient. Chin. J. Comput. 42: 33. doi: doi:10.11897/SP.J.1016.2019.01406
  26. Moghadam R. G., Yaghoubi B., Rajabi A., Shabanlou S., Izadbakhsh M. A. (2022). Evaluation of discharge coefficient of triangular side orifices by using regularized extreme learning machine. Appl Water Sci 12: 145. doi: doi:10.1007/s13201-022-01665-9
  27. Mojtahedi F. F., Yousefpour N., Chow S., Cassidy M. (2025). Deep learning for time series forecasting: review and applications in geotechnics and geosciences. Arch. Comput. Methods Eng. 32, 3415 – 3445. doi: doi:10.1007/s11831-025-10244-5
  28. Nicosia A., Ferro V. (2022). A new approach for deducing the stage-discharge relationship of a triangular broad-crested device. Flow Meas. Instrum. 85: 102160. doi: doi:10.1016/j.flowmeasinst.2022.102160
  29. Norouzi R., Daneshfaraz R., Ghaderi A. (2019). Investigation of discharge coefficient of trapezoidal labyrinth weirs using artificial neural networks and support vector machines. Appl Water Sci 9: 148. doi: doi:10.1007/s13201-019-1026-5
  30. Nouri M., Hemmati M. (2020). Discharge coefficient in the combined weir-gate structure. Flow Meas. Instrum. 75: 101780. doi: doi:10.1016/j.flowmeasinst.2020.101780
  31. Rao S. S., Shukla M. K. (1971). Characteristics of flow over weirs of finite crest width. J. Hydraul. Div. 97, 1807 – 1816. doi: doi:10.1061/jyceaj.0003138
  32. Razmi M., Saneie M., Basirat S. (2022). Estimating discharge coefficient of side weirs in trapezoidal and rectangular flumes using outlier robust extreme learning machine. Appl Water Sci 12: 176. doi: doi:10.1007/s13201-022-01698-0
  33. Reyad M., Sarhan A. M., Arafa M. (2023). A modified Adam algorithm for deep neural network optimization. Neural Comput. & Applic. 35, 17095 – 17112. doi: doi:10.1007/s00521-023-08568-z
  34. Roushangar K., Alami M. T., Majedi Asl M., Shiri J. (2017). Modeling discharge coefficient of normal and inverted orientation labyrinth weirs using machine learning techniques. ISH J. Hydraul. Eng. 23, 331 – 340. doi: doi:10.1080/09715010.2017.1327333
  35. Saffar S., Babarsad M. S., Shooshtari M. M., Riazi R. (2021). Prediction of the discharge of side weir in the converge channels using artificial neural networks. Flow Meas. Instrum. 78: 101889. doi: doi:10.1016/j.flowmeasinst.2021.101889
  36. Saltelli A., Tarantola S., Campolongo F., Ratto M. (2004). Sensitivity Analysis in Practice: a guide to Assessing scientific Models, vol. 1 Wiley Online Library.
  37. Seyedian S. M., Haghiabi A., Parsaie A. (2023). Reliable prediction of the discharge coefficient of triangular labyrinth weir based on soft computing techniques. Flow Meas. Instrum. 92: 102403. doi: doi:10.1016/j.flowmeasinst.2023.102403
  38. Shen G., Cao D., Parsaie A. (2024). Discharge coefficient prediction and sensitivity analysis for triangular broad-crested weir using machine learning methods. River 3, 316 – 323. doi: doi:10.1002/rvr2.95
  39. Shen G., Li S., Li G. (2022). Research on prediction of discharge coefficient of triangle weir based on machine learning. Chin. Q. Mech. 43, 691 – 699. doi: doi:10.15959/j.cnki.0254-0053.2022.03.021
  40. Simsek O., Gumus V., Ozluk A. (2023). Prediction of discharge coefficient of the trapezoidal broad-crested weir flow using soft computing techniques. Neural Comput. & Applic. 35, 17485 – 17499. doi: doi:10.1007/s00521-023-08615-9
  41. Tang J., Liu G., Pan Q. (2021). A review on representative swarm intelligence algorithms for solving optimization problems: applications and trends. IEEE/CAA J. Autom. Sin. 8, 1627 – 1643. doi: doi:10.1109/jas.2021.1004129
  42. Tsamardinos I., Greasidou E., Borboudakis G. (2018). Bootstrapping the out-of-sample predictions for efficient and accurate cross-validation. Mach. Learn. 107, 1895 – 1922. doi:, doi:10.1007/s10994-018-5714-4
  43. Wang F., Zheng S., Ren Y., Liu W., Wu C. (2022). Application of hybrid neural network in discharge coefficient prediction of triangular labyrinth weir. Flow Meas. Instrum. 83: 102108. doi: doi:10.1016/j.flowmeasinst.2021.102108
  44. Wen W., Xu C., Yan F., Wu C., Wang Y., Chen Y.. (2017). Terngrad: Ternary Gradients to reduce Communication in Distributed deep Learning. Advances in Neural Information Processing Systems, Long Beach, CA, USA 30.
  45. Xia J., Huang Z., Zhu Y., Li X., Zhu J. (2026). An improved Adam algorithm for BP neural network feedforward compensation control. Proc. Inst. Mech. Eng. C J. Mech. Eng. Sci. 240, 1681 – 1698. doi: doi:10.1177/09544062251400654
  46. Yildiz A., Marti A. I., Gogus M. (2021). Determination of hydraulic characteristics of flow over a triangular sectioned weir by using experimental and numerical modeling. J. Comput. Appl. Mech. 52, 215 – 232. doi: doi:10.22059/jcamech.2021.318239.594
  47. Zhang C., Bengio S., Hardt M., Recht B., Vinyals O. (2021). Understanding deep learning (still) requires rethinking generalization. Commun. ACM 64, 107 – 115. doi:, doi:10.1145/3446776
  48. Zhang Y. G., Tang J., Liao R. P., Zhang M. F., Zhang Y., Wang X. M.. (2021). Application of an enhanced BP neural network model with water cycle algorithm on landslide prediction. Stoch. Environ. Res. Risk Assess. 35, 1273 – 1291. doi: doi:10.1007/s00477-020-01920-y
  49. Zhang L., Wang F., Sun T., Xu B. (2018). A constrained optimization method based on BP neural network. Neural Comput. & Applic. 29, 413 – 421. doi: doi:10.1007/s00521-016-2455-9

Citation

Zeng, G., et al. (2026). Robust discharge coefficient modeling in triangular weirs via an enhanced Adam-optimized BP network. Frontiers in Water, Volume 8. https://doi.org/
Received
Accepted
Published
Volume
8 - 2026

Copyright

Copyright © 2026 Zeng, Xu and Zheng.

License: https://creativecommons.org/licenses/by/4.0/

*Correspondence: Maosen Xu

Article metrics

Views
0
Downloads
0
Citations
0
Shares
0