Forecasting the Flow Coefficient of the River Basin Using Adaptive Fuzzy Inference System and Fuzzy SMRGT Method

In hydrology and water resources engineering, predicting the flow coefficient is a crucial task that helps estimate the precipitation resulting in a surface flow. Accurate flow coefficient prediction is essential for efficient water management, flood control strategy development, and water resource planning. This investigation calculated the flow coefficient using models based on Simple Membership functions and fuzzy Rules Generation Technique (SMRGT) and an Adaptive Neuro-Fuzzy Inference System (ANFIS) model. The fuzzy logic methods are used to model the intricate connections between the inputs and the output. Statistical parameters such as the coefficient of determination ( R 2 ), the root mean square error (RMSE), the mean absolute error (MAE), and the mean abso - lute percentage error (MAPE) were used to evaluate the performance of models. The statistical tests outcome for the SMRGT model was (RMSE:0.056, MAE:1.92, MAPE:6.88, R 2 :0.996), and for the ANFIS was (RMSE:0.96, MAE:2.703, MAPE:19.97, R 2 :0.8038). According to the findings, the SMRGT, a physics-based model, exhibited superior accuracy and reliability in predicting the flow coefficient compared to ANFIS. This is attributed to the SMRGT’s ability to integrate expert knowledge and domain-specific information, rendering it a viable solution for diverse issues.


INTRODUCTION
The flow coefficient is an important parameter in hydrology that describes the flow ratio to the total amount of rainfall (Chow et al., 1988). It is typically used in hydrological models to estimate the amount of surface flow from a catchment or watershed. Accurate estimation of the flow coefficient is essential for various hydrological applications, including flood forecasting, water resources management, environmental impact assessment, and designing efficient stormwater management systems, flood control structures, and urban drainage systems. Therefore, there is ongoing research on developing and evaluating new methods for modeling this parameter. There are various methods for estimating the flow, including empirical methods, such as the Soil Conservation Service (SCS) method (USDA-NRCS, 1972), and physically based methods, such as the Green-Ampt model (Green & Ampt, 1911). The choice of method depends on the availability and quality of data and the complexity of the modeled hydrological system.
In recent years, researchers have explored the use of Machine Learning (ML) techniques such as ANN and fuzzy logic methods for improving the accuracy of hydrologic modeling estimation, such as; (Hsu et al., 1995;Hu et al., 2007) demonstrated the effectiveness of artificial neural networks in modeling the rainfall-flow process. This investigation used fuzzy logic-based models to calculate the flow coefficient rate for the Aksu River basin in Antalya-Turkey. Fuzzy logic-based methods are preferred in modeling hydrological events due to their ability to handle uncertainty and imprecision inherent in hydrological systems. Hydrological systems are complex, and data on hydrological variables such as precipitation, evapotranspiration, and soil moisture are often limited and uncertain. Fuzzy logic-based methods provide a way to represent and analyze this uncertainty using linguistic variables and rules. It uses membership functions to describe the degree of membership of a variable in a set, such as dry, wet, or moderate. Fuzzy rules developed based on expert knowledge and data represent the relationships between input and output variables in the hydrological system.
Fuzzy logic-based methods have been extensively used in various hydrological applications, including flood forecasting, water resources management, and groundwater modeling. In a review article by (Kambalimath and Deka, 2020), the authors discuss the potential of fuzzy logic in hydrology. (Nurul et al., 2020) applied a fuzzy inference system to rainfall-runoff modeling. (Dhaoui et al., 2023) Modeled groundwater quality using a fuzzy inference system, and (Nayak et al., 2004) Used fuzzy-based modeling hydrological time series, while (Santos and Silva, 2014) used different artificial neural network algorithms and wavelet transforms for daily streamflow forecasting. (Pesti et al., 1996) employed such systems for drought evaluation, while (Abebe et al., 2000) utilised them for rainfall pattern forecasting and reconstructing missing precipitation events. (Vernieuwe et al., 2005) utilised it for modeling the dynamics of rainfall streamflow. Finally, to investigate flood forecasting and risk assessment, as explored in the studies conducted by (Jiang et al., 2008;Mao and Wang, 2002;Nayak et al., 2005).
ANFIS and SMRGT models were used in this research to estimate the flow coefficient accurately. ANFIS stands for Adaptive Neuro-Fuzzy Inference System, a hybrid intelligent system combining the strengths of fuzzy logic and artificial neural networks (ANNs) to create a powerful tool for modeling and control applications. ANFIS was first introduced by (Jang, 1993) has since become popular in various fields, including engineering, finance, and medicine. ANFIS has several advantages over traditional ANNs and fuzzy logic systems. First, it can handle numerical and linguistic input variables, making it suitable for modeling complex systems. Second, it can automatically learn the optimal fuzzy rules and membership functions from data, reducing the need for expert knowledge. Finally, ANFIS can approximate any nonlinear function with arbitrary accuracy, making it a versatile tool for modeling and control applications. Several studies have demonstrated the effectiveness of ANFIS in flow estimation in river basins. For example, (Ullah and Choudhury, 2013) used ANFIS models to forecast common downstream flow rates and depths in a river system with multiple inflows. In another study, (Keskin and Taylan, 2009) applied the ANFIS method to estimate the river flow of the Manavgat watershed in southern Turkey. They found that missing or unmeasured data can be accurately predicted with the ANFIS model. (Firat, 2007) used ANFIS, GRNN, and FFNN methods for flow forecasting, the author observed that the ANFIS model was more successful than other used models.
The absence of a conclusive approach for ascertaining the appropriate quantity of fuzzy rules and membership functions (MF) needed for each rule is a notable limitation of ANFIS and other fuzzy systems (Jang, 1993). Furthermore, there is a lack of a learning algorithm to enhance the accuracy of MF by minimising the output error. Accordingly, (Toprak, 2009) introduced the Simple Membership functions and fuzzy Rules Generation Technique (SMRGT), a physic-based fuzzy model. The new approach was proposed to assist those who have difficulty deciding the number and shape of membership functions and fuzzy rules. It is a flexible technique that can be adapted to various applications. Using simple membership functions and fuzzy rules generation techniques allows for incorporating expert knowledge and domainspecific information, making it suitable for many problems. The SMRGT approach has demonstrated its capacity to generate precise and dependable approximations across various fields, particularly in scenarios where conventional techniques may be constrained by the accessibility of data or the intricacy of the hydrologic system such as; (Toprak et al. 2013) employed the aforementioned method to quantify the volume of water wastage in distribution networks. The research was conducted in Diyarbakir, Turkey. (Yalaz et al., 2015) utilised it for the generation of fuzzy time series data. The study conducted by (Toprak et al., 2017) analysed the benefits and drawbacks of the aforementioned approach, as well as its practical uses. The study by (Altas et al., 2018) examined the open channel water surface profiles utilising the SMRGT method under varying hydraulic conditions. The application of seismic floor classification was documented in a study conducted by (Bayri, 2018).
In their study, (Unes et al., 2020) employed various computational techniques, including multiple linear regression (MLR), artificial neural network (ANN), M5 decision tree (M5T), adaptive neurofuzzy inference system (ANFIS), soft computingbased regression and genetic programming technique (SMRGT), and Mamdani-fuzzy logic (M-FL), to estimate river flow. The flow coefficient of the Kalecik basin was determined by (Sevgin, 2021). The study's authors arrived at the conclusion that the fuzzy SMRGT approach is uncomplicated, lucid, and yields superior outcomes. The existing literature reveals a dearth of research that has integrated the SMRGT and ANFIS models to predict flow coefficient, which is imperative in developing flood protection strategies for both urban and agricultural areas. Also, this parameter plays a vital role in the calculation of the maximum allowable water extraction from a river for irrigation or water supply purposes in the study area, the Aksu River Basin, which is a prominent region in Antalya, Turkey, where the primary concerns are agriculture, tourism, and industry. The Turkish State Meteorological Service (TSMS) has also released data indicating that the Mediterranean region is among the most susceptible areas to precipitation and flooding between 2020 and 2021. Therefore, this study can be regarded as the initial endeavor in this respect.
Temperature and wind data are used for flow coefficient estimation, as they can provide information about the meteorological conditions that affect the hydrological cycle, specifically evapotranspiration, and an important component of the water balance equation.
The primary aim of this study is to 1) achieve precise flow coefficient rate predictions in the Aksu River basin and 2) investigate the prediction potential of the two fuzzy models (ANFIS and SMRGT).

Study area and data used
Aksu River Basin locates 36-38 degrees north latitude and 30-31 degrees east longitude. The geographical boundaries of the Mediterranean Region encompass the basin. The length of the Aksu River is approximately 370 km (230 miles), with a total width at its mouth of 100 meters (330 feet). Based on ArcGIS measurements, the basin drains an area of approximately 7505 km 2 . The Aksu River originates in the Taurus Mountains, a mountain range in southern Turkey. It flows through the Aksu Canyon and into the Mediterranean Sea. The monthly average temperatures and wind speeds from 1990 to 2019 were used to compile the dataset. The information was collected from the Turkish state meteorological service.

Adaptive neuro-fuzzy inference system (ANFIS)
ANFIS is a hybrid intelligent system that combines the learning capabilities of neural networks and the linguistic representation of fuzzy logic to create a model for data classification, prediction, and decision-making. ANFIS was first proposed by (Jang, 1993) and has since been used in various applications, including image processing, robotics, and finance. ANFIS uses a hybrid learning algorithm that combines gradient descent and least-squares estimation to adjust the system's parameters. The gradient descent algorithm is used to update the membership function parameters, while the least-squares estimation is used to adjust the output layer parameters. Typically, ANFIS has five different layers: • Layer 1 -according to the first layer, the membership function can be any suitable parameterized membership function, such as B. Generalized bell-shaped function.
where: {a i , b i , c i } -the parameter set. The parameters in this layer are called prerequisite parameters. Each node (i) in this layer is an adaptive node with a node function: • Layer 2 -in this layer, each node is a fixed node with an output equal to the sum of all input signals: The output of each node represents the trigger strength of each rule. In this layer, other t-norm operators that perform fuzzy AND (for example, min) can be used as node functions.
• Layer 4 -this layer's node I is an adaptive node with a node function.
where: w i -the normalized layer three firepowers, p i , q i , r i is the node's parameter set.
• Layer 5 -a single fixed node in this layer, denoted, computes the total output as the sum of all input signals: In the ANFIS model, ten-year data were utilized, and different ranges were attempted (80:20, 70:30, 60:40) for the training and testing phase. The range (70%:30%) was selected as it produces the best prediction. The input variables consisted of temperature and wind speed data from (2010-2019), and the training data was chosen from January 2010 to December 2016 (7 years). In contrast, the testing data was from January 2017 to December 2019 (3 years). A membership function, such as the generalized bell-shaped membership function (gbellmf) (see Fig. 2), is used for training and   (8) where: x̅ -the normalized data; x -the original data; l, h -the highest and lowest possible values in the original data.

Simple membership functions and fuzzy rules generation technique (SMRGT)
Simple Membership functions and fuzzy Rules Generation Technique (SMRGT) is used in fuzzy logic systems for generating membership functions and fuzzy rules. Membership functions in fuzzy logic determine the degree to which a particular input belongs to a fuzzy set. In SMRGT, the membership functions are created by defining simple functions that map the input values to a degree of membership in the fuzzy set. These simple functions can be linear or nonlinear and take various forms, such as triangular, trapezoidal, or Gaussian. Once the membership functions are defined, fuzzy rules can be generated using a set of if-and-then statements. In SMRGT, fuzzy rules are generated by analyzing the relationship between input and output variables. The rules are generated based on expert knowledge or by analyzing data and can take the form of linguistic statements such as "if the temperature is high, and wind speed is high, then the flow coefficient is low".
This approach simplifies the process of adding the physics of the event to a fuzzy model. The following are the steps involved in the SMRGT procedure: 1. Defining input and output variables: The first step in designing a fuzzy logic system is determining the inputs and outputs. This study used two inputs (temperature and wind speed) to generate a single output (flow coefficient). The maximum and minimum values for each input were then established, with a temperature range of 0-50 and a wind speed range of 0-10.

Determining the membership functions (MFs):
MFs map input values to fuzzy sets. Seven MFs were employed and were labelled as Very very low, Very low, Low, Medium, High, Very high, and Very very high. Also, in this step, a triangular membership function shape was selected (see Fig. 3). to output values, fuzzy rules were created, each comprising an antecedent (input) and a consequent (output). In this stage, 49 rules were established using physical conditions such as "IF," "AND," and "THEN." 5. The developed model was executed using MAT-LAB software, and the Mamdani algorithm was used as an operator, with the centroid method chosen for defuzzification. The input and output files were arranged and added to the program in the.dat format. The prepared program was loaded with the.fis extension. A. m extension file was also created to run the program and obtain results. This approach helped save time during the experimentation process. A fuzzy set table was also created as part of the procedure.

Performance measurements
To assess the effectiveness of a machine learning model, it is crucial to evaluate its performance using appropriate statistical metrics. The selection of evaluation metrics largely depends on the problem's characteristics and the data used in the model. Choosing the correct evaluation metrics is essential to ensure the model performs optimally. The present study employed four evaluation parameters, including Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), coefficient of determination (R 2 ), and Mean Absolute Relative Error (MARE), to assess the model's performance. They were given in Eq. (9-11).

RESULTS AND DISCUSSION
This study aimed to estimate the flow coefficient in the Aksu river basin using two fuzzy models: Adaptive Neural Fuzzy Inference System (ANFIS) and Simple membership functions and fuzzy Rules Generation Technique (SMRGT). The ANFIS analysis involved using generalized bell 20×15 Membership Functions (MFs) (see Fig. 6), and Grid partition section with 100 iterations, assuming the output as linear. The dataset was divided into the training and testing phases, and the 70% -30% range was used. For training, the monthly average temperature and wind speed data from 2010-2016 was selected, and for testing from 2017-2019. Variation and scatter graphs were used to visualize the ANFIS method's results, as shown in Fig. (6-9). The coefficient of determination for each training, testing, and all data was calculated to be (R 2 :0.893, R 2 :0.656, and R 2 :0.803), respectively. They indicated a fair correlation. The results of the ANFIS model were observed to be not too close to the actual values, as depicted in the figures below.   The SMRGT model used the Mamdani method as the fuzzy inference system and the centroid method as the defuzzification procedure. According to (Toprak, 2009), the centroid method is more suitable for fuzzy SMRGT. To construct the membership functions for each independent variable, seven different membership functions were created, and key values were assigned for each MF. Table 1 shows the calculated key values for inputs. These values are the input of the model.
The flow coefficient's smallest and biggest value ranges are regarded as 0 and 1, respectively. The minimum and maximum values of the flow coefficient are shown in Figures 10 and 11, respectively. The graphs demonstrate that the flow coefficient equals 0 when the temperature is very high (50 °C) and the wind speed is very high (10 m/s), while it equals 0.98 when the temperature is low (0.9 °C), and the wind speed is low (0.899 m/s). These results indicate that the model is mathematically and physically accurate. This finding is backed by research reported in (Bayri, 2018;Karakaya, 2018;Sevgin, 2021). In fact, when the temperature is low and the wind speed is low, the flow coefficient tends to increase because the lower temperature results in less evaporation, and the lower wind speed reduces the amount of water carried away by the wind, and leads to a higher proportion of the rainfall running off the surface, resulting in a higher flow coefficient. Conversely, when the temperature is high and the wind speed is high, the flow coefficient tends to decrease because the higher temperature results in more evaporation, and the higher wind increases the amount of water carried away by the wind, and leads to a lower proportion of the rainfall running   The models were compared by evaluating their statistical criteria and calculated using the methodology described in the previous section. The evaluation indicated that the SMRGT model produced the best results according to RMSE, MAE, MARE, and R 2 . A summary of the statistical findings is presented in Table 2.

CONCLUSIONS
The application of fuzzy logic theory can be advantageous in assessing conventional systems that are relatively less complex and do not involve significant uncertainties or problems. ANFIS and SMRGT fuzzy methods have been widely used in various hydrological applications. The ANFIS method is based on adaptive neural networks and fuzzy inference systems, which can handle complex and nonlinear relationships in the data. On the other hand, the SMRGT method uses   simple membership functions and fuzzy rules to capture the uncertain and imprecise nature of the data. Both methods have their strengths and limitations, and the choice of method depends on the specific characteristics of the river basin and the available data. Both methods have shown promising results in accurately predicting the flow coefficient, but SMRGT performance was better than ANFIS. The neutrality and linearity of the SMRGT model results in the scatter plot, high coefficient of determination between the model and the data, and low values of MARE, MAE, and RMSE all demonstrate that the SMRGT model is reliable, accurate, and can be used with confidence for flow coefficient calculations which is an important parameter in hydrological modeling and water resources management. Further research is needed to explore the potential of these models in different hydrological settings and to develop improved calibration and validation techniques.
However, it is important to note that using fuzzy logic-based methods in hydrology is still an active research area, and further studies are needed to evaluate their performance in various hydrological systems and under different climatic conditions. Applying ANFIS and SMRGT methods in flow coefficient prediction can provide valuable insights for water resources planning and management, especially in data-scarce regions where accurate hydrological modeling is critical for sustainable water management.
Moreover, it is important to note that other factors, such as the slope of the surface, the type of surface, and the intensity and duration of the rainfall, also influence the flow coefficient. Therefore, a comprehensive analysis of the flow coefficient should consider all relevant factors to predict the amount of flow from a surface accurately.
From the comprehensive study, we can conclude that the choice of method depends on the availability and quality of data and the complexity of the modeled hydrological system.