Next Article in Journal
The Timing of Sugar Beet Harvesting Significantly Influences Roots Yield and Quality Characteristics
Previous Article in Journal
Greenhouse Gas Emissions and Yield of Durum Wheat Under Organic and Conventional Fertilization in Three Texture Classes
Previous Article in Special Issue
Distribution Characteristics and Ecological Risk Assessment of Pharmaceutical and Personal Care Products (PPCPs) in Different Water Sources, Soil Profiles and Rice Crops Under Rural Domestic Reclaimed Water Irrigations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Assessing Agricultural Reuse Potential of Treated Wastewater: A Hybrid Machine Learning Approach

by
Daniyal Durmuş Köksal
1,
Yeşim Ahi
2,* and
Mladen Todorovic
3
1
General Directorate of State Hydraulic Works (DSI), 06510 Ankara, Turkey
2
Water Management Institute, Ankara University, 06135 Ankara, Turkey
3
Mediterranean Agronomic Institute of Bari (CIHEAM-IAMB), 70010 Valenzano, Italy
*
Author to whom correspondence should be addressed.
Agronomy 2025, 15(3), 703; https://doi.org/10.3390/agronomy15030703
Submission received: 20 January 2025 / Revised: 8 March 2025 / Accepted: 11 March 2025 / Published: 14 March 2025

Abstract

:
Estimating the quality of treated wastewater is a complex, nonlinear challenge that traditional statistical methods struggle to address. This study introduces a hybrid machine learning approach to predict key effluent parameters from an advanced biological wastewater treatment plant and assesses the reuse potential of treated wastewater for irrigation. Three artificial intelligence (AI) models, Artificial Neural Networks (ANNs), Adaptive Neuro-Fuzzy Inference System (ANFIS), and Fuzzy Logic-Mamdani (FLM), were applied to three years of daily inlet and outlet water quality data. Fuzzy Logic was employed to predict the usability potential of treated wastewater, with ANFIS categorizing quality parameters and ANN-based high-performance models (low MSE, 74–99% R2) applied in the fuzzy inference system. The qualitative reuse potential of treated wastewater for agricultural irrigation ranged from 69% to 72% based on the best-performing model. It was estimated that treated wastewater could irrigate approximately 35% of a 20,000-hectare agricultural area. By integrating machine learning models, this research enhances the accuracy and interpretability of wastewater quality predictions, providing a reliable framework for sustainable water resource management. The findings support the optimization of wastewater treatment processes and highlight AI’s role in advancing water reuse strategies in agriculture, ultimately contributing to improved irrigation efficiency and environmental conservation.

1. Introduction

1.1. The Role of Wastewater Reuse in Sustainable Irrigation

The inexorable rise in water demand has led to a growing scarcity of freshwater in many parts of the world. The total usable freshwater supply for ecosystems and humans is 200,000 km3 of water, which is less than 1% of all freshwater resources and only 0.01% of all the water on Earth [1,2]. Water resources are under the threat of climate change, pollution, and scarcity due to factors such as population density, industrialization, urbanization, and overexploitation of natural resources. Moreover, climate change is expected to adversely affect the water resources; thus, water scarcity may become a severe problem in some basins. It is essential to construct better river basin management strategies to achieve sustainable water management. The pressure on conventional water resources is increasing due to growing competition among water user sectors such as agriculture, industry, energy, and household services. In this regard, creating alternative water resources holds great importance.
To address this growing pressure, many countries are increasingly recognizing the potential of wastewater reuse as a sustainable solution. In many countries around the world, the importance of the reuse of treated domestic and industrial wastewater as an alternative resource is gradually increasing. Globally, agriculture is the major consumer of wastewater. The search for alternative irrigation sources is believed to be vital to ensure food safety and to preserve natural water bodies. The safe use of wastewater as an alternative source of irrigation is an acknowledged strategy for the efficient use and prevention of water pollution that is gaining increasing relevance worldwide, especially in countries confronted with water shortages [3].
Beyond its role in addressing water scarcity, wastewater reuse also offers significant environmental and economic benefits. In addition to its technical advantages, the reuse of treated wastewater alleviates pressure on freshwater resources and reduces pollution by preventing the release of untreated wastewater into natural water bodies [4]. In arid and semi-arid regions, where freshwater availability is limited, wastewater reuse presents a viable alternative for sustaining agricultural productivity. Additionally, the economic benefits of wastewater reuse extend to reduced dependency on conventional water sources, lower irrigation costs, and enhanced crop yields [5]. However, the feasibility of wastewater reuse varies under different climatic conditions. For example, regions with high evaporation rates may face increased salinity challenges, necessitating additional treatment processes. Conversely, humid regions may benefit from wastewater reuse without significant modifications. Understanding these environmental and economic factors is crucial for developing adaptable and region-specific wastewater management strategies [6].
As wastewater reuse continues to gain traction, many countries are now focusing on integrating advanced technologies to improve its efficiency and sustainability. Therefore, these nations have begun developing management strategies to support the adoption and assessment of more eco-efficient approaches utilizing treated wastewater in agriculture.

1.2. Artificial Intelligence for Wastewater Quality Prediction and Reuse

One such technological advancement that has shown great promise in wastewater management is artificial intelligence (AI). In recent years, with the increasing integration of technology into agriculture, the use of artificial intelligence (AI) has become more prominent. AI is now actively employed in optimizing the operation and management of wastewater treatment plants (WWTPs), enhancing technological efficiency, and monitoring and predicting water quality. AI-based control systems, such as neural networks and fuzzy logic models, have demonstrated their effectiveness in modeling complex nonlinear systems and have been successfully applied to various nonlinear processes in wastewater treatment [7,8,9,10].
To fully understand AI’s role in wastewater management, it is essential to define its fundamental principles and commonly used techniques. Artificial intelligence (AI) is a set of algorithms that are a series of rules that precisely define a sequence of operations that enable computations, making it possible to perceive, reason, and act [11]. Among the most common approaches are the use of artificial neural networks and genetic algorithms. Various statistical and mathematical models are used to calculate the performance of machine learning (ML) models (Artificial Neural Network (ANN), Decision Tree (DT), Bayesian Model (BM), Instance Based Model (IBM), Support Vector Machine (SVM), etc.) and algorithms (Adaptive-Neuro Fuzzy Inference Systems (ANFISs), Multilayer Perception (MP), Classification and Regression Tree (RT), Gaussian Naive Bayes (GNN), K-Nearest Neighbor (k-NN), Support Vector Regression (SVR), etc.). Proper dataset splitting into training, validation, and testing is key to developing and evaluating machine learning models. After the end of the learning process, the trained model can be used to classify, predict, or cluster new examples (testing data) using the experience obtained during the training process [12].
Traditional modeling approaches for water quality analysis, while useful, often face challenges related to data limitations and processing inefficiencies. In any aquatic system analysis, the modeling water quality parameters are of considerable significance. The traditional modeling methodologies are dependent on datasets that involve a large amount of unknown or unspecified input data and generally consist of time-consuming processes. The implementation of AI leads to a flexible mathematical structure that has the capability to identify nonlinear and complex relationships between input and output data [13]. Therefore, AI methods can serve to set up a wastewater parameter prediction model for better water resource management.
Several studies have explored the effectiveness of AI models in wastewater prediction, highlighting their strengths and potential limitations. In this context, some important studies have identified critical points of AI methods in creating accurate models and predictions. Yao et al. [14] used different simulated algorithms to optimize three key parameters of the support vector machine (SVM). The dataset used in this experiment consisted of 80 historical records from a sewage treatment plant, with 70 records used for training and 10 for testing. The results showed that the SA-SVM model outperformed the GA-SVM model in predicting membrane flux, achieving an average relative error of 0.0311 compared to 0.335.
In addition to predictive accuracy, AI’s ability to uncover hidden relationships in data further enhances its applicability in wastewater management. AI can establish logical connections between input variables and generate output data, providing statistically significant predictions. Supporting this, Kannangara et al. [15] applied two ML algorithms, decision trees and neural networks, to build predictive models. Their results confirmed that ML algorithms can successfully generate wastewater prediction models with good performance, as measured by variations in mean square error (MSE) between training and testing data.
Beyond predicting wastewater quality, AI also plays a crucial role in real-time monitoring and regulatory compliance. One of the key advantages of AI is its ability to predict data under different scenarios. Moral et al. [16] reported that continuous prediction of the cardinal parameters in effluents, such as biological and chemical oxygen demand (BOD, COD), can be required by law to monitor the performance of the treatment systems. This may especially be important in taking actions about the operation of the treatment system in a timely manner if required. Similarly, Abba and Elkiran [17] used artificial neural networks (ANNs) to develop an effluent COD prediction model for wastewater treatment plants, while Wan et al. [7] employed fuzzy subtractive clustering to model suspended solids (SS) and COD removal. Principal component analysis (PCA) was also applied to reduce input variable dimensionality, improving model efficiency.
Recent advancements in AI-driven wastewater research have focused on hybrid modeling frameworks for enhanced prediction reliability. More recent studies, including those by [18,19], have highlighted the integration of AI frameworks for improved wastewater quality prediction. Recently, a mechanistically enhanced hybrid (ME-Hybrid) model presented by Lv et al. [20] combined mechanistic modeling with data-driven approaches to harmonize datasets with varying sampling frequencies and generate synthetic samples for effective sewer management. Also, Yin et al. [21] developed a deep learning model that comprises encoder–decoder long short-term memory (LSTM) networks to enhance the robustness of real-time WWTP effluent quality prediction under shocking load events.
Despite these advancements, opportunities remain to further refine hybrid AI-based methodologies for wastewater prediction and reuse applications. While AI has significantly improved wastewater quality prediction, a gap remains in the development of hybrid methodologies that integrate multiple ML models for wastewater quality assessment and agricultural reuse evaluation. The present study focused on a hybrid model, which is a combination of algorithms, to improve the accuracy of performances of its developed models. To achieve this, the study introduces an innovative AI-based approach that leverages multiple machine learning models for wastewater quality prediction. Specifically, this research integrates three machine learning models—ANN, ANFIS, and Fuzzy Logic—to predict key wastewater quality parameters. In this context, the numerical prediction capability of Fuzzy Logic was utilized to determine the reuse potential of treated wastewater. With the help of ANFIS, categorized rules were generated for each quality parameter. These generated rules and also the quality parameters predicted by ANN served as inputs to Fuzzy Logic.
By adopting this hybrid AI framework, the study enhances both prediction reliability and interpretability while offering practical applications for wastewater management. This research enhances prediction reliability and interpretability through a hybrid modeling framework. Additionally, by incorporating real-time input–output variables from wastewater treatment plants, this study provides a practical evaluation of treated wastewater’s usability for irrigation purposes. These findings contribute to optimizing wastewater management strategies and supporting sustainable irrigation practices and water management.

2. Materials and Methods

2.1. Data Source: Biological Wastewater Treatment Plant

The study is based on the results of the analysis carried out in 2017, 2018, and 2019 at the inlet and effluent wastewater of the Kırklareli Wastewater Treatment Plant (K-WWTP) located in the Thrace region of Turkey (at 41°74′ N latitude and 27°23′ E longitude).
K-WWTP consists of 3 different units, namely Preliminary Treatment Units, Primary Treatment Units, and Biological Treatment Units. There are agricultural irrigation areas with plant patterns such as wheat, sunflower, paddy, and corn around the treatment plant. The study area is characterized by semi-arid climatic conditions with warm, dry summers and cool, wet winters. The long-term averages of annual temperature, relative humidity, wind speed, sunshine duration, and total precipitation are 13.2 °C, 70%, 2.3 m/s, 5.4 h, and 584 mm, respectively [22].
The physical, chemical, and biological parameters analyzed in this study were selected based on the guidelines outlined in the “Agricultural Reuse of Treated Wastewaters and Treatment Requirements” published by the Food and Agriculture Organization (FAO), Rome, Italy [23]. These parameters, including pH, Biochemical Oxygen Demand (BOD), Chemical Oxygen Demand (COD), Electrical Conductivity (EC), and Total Suspended Solids (TSS), are critical for assessing the suitability of treated wastewater for agricultural reuse. The criteria vary depending on the type of reuse, with stricter thresholds established for crops consumed raw compared to those not consumed directly or commercially processed. For instance, BOD limits are set at <10 mg/L for raw consumption and <30 mg/L for other uses, while microbial contamination thresholds for E. coli range from <14 to <200 NMP/100 mL.
Descriptive statistics, including measures like ranges, mean, standard deviation, Kurtosis, and Skewness, are used to summarize the key characteristics of the data in this study and are presented in Table 1. Data of the available parameters of the total set consists of 477 time series. Only 188 datasets were used, considering 10 parameters for the input water quality of the treatment plant and 7 parameters for the output.
It was observed that the pH varies between 6.19 and 8.74 with an average of 7.4 and was not changing periodically. The conductivity was fluctuating and showed high variability in winter periods as 1000–1400 µS/cm, but it was fixed between 1100 and 1085 µS/cm during summer periods. The COD parameter ranged between 150 and 190 mg/L during 2017 and 2018, then it increased to 200–350 mg/L in 2019. DO values were constantly fluctuating between 0.9 and 1.9 mg/L during the last 3-year period, except for the October 2017 and June 2018 periods, when they ranged between 0.3 and 4.0 mg/L, respectively. Similarly, total N, NH4, and NO3 showed variability in the same period. Concerning the TSS, the values fluctuated periodically between 10 and 232 mg/L during the same period. Considering the output parameters of K-WWTP, the pH value was recorded as an average of 7.3 with a 0.356 standard deviation. The salinity, which is an important parameter for agricultural production, recorded an average of 0.46.
In contrast, in K-WWTP output, the minimum measured conductivity was 717 mg/L while the maximum was 1143 mg/L. In addition, TSS observed fluctuation in input water for 3 years, and the output was observed to have a constancy between 1 and 72 mg/L.
The dataset was normalized from 0 to 1 using min-max scaling in Equation (1) (Sinsomboonthong [24]) both to manage the parameters fluctuating over a wide range (such as pH, conductivity, COD, etc.) more accurately and to make the data more flexible by eliminating inconsistent dependency.
Y = X i X m i n X m a x X m i n
where Xi is raw data, Xmin is the minimum value of X, Xmax is the maximum value of X, and Y is the standardized data value. Normalization is a crucial preprocessing step in machine learning that ensures datasets are structured and suitable for analysis.

2.2. Scenarios Based on Wastewater Quality Parameters

Statistical-based feature selection methods, specifically Relief algorithms, were used to improve the model’s performance and select the input variables most strongly related to the target variable [25,26]. The study tested various scenarios by gradually removing less significant features, ensuring the selection of the most effective wastewater quality parameters, and enabling the models to achieve optimal performance without unnecessary noise. Feature selection reduces dimensionality by retaining only the most relevant features while eliminating redundant or irrelevant ones, thereby enhancing model efficiency, mitigating overfitting, and improving interpretability. Relief algorithms rank independent variables based on their weight, which ranges from −1 to +1, where higher values indicate stronger relevance to the target variable. Due to the high fluctuations and nonlinear patterns in raw data, firstly, data normalization (scaling between 0 and 1) was applied to eliminate inconsistencies, standardize feature ranges, and enhance computational stability. After that, the Weight of each independent variable varying from −1 to +1 was obtained by the Relief algorithm; independent variables were ranked according to this weight (Table 2). If the weight of the independent variable is expressed as −1, it means that there is no affinity between the selected instances. In other words, there are attributes between variables that indicate a better predicted result as they rise from −1 to +1. Ten different wastewater quality parameters at the inlet were kept constant, and seven different parameters were examined at the outlet. There is a probabilistic interpretation of the sequence predicted by the ReliefF algorithm. Therefore, 10 scenarios were applied in ascending order of variable weight. In the first scenario, the model was run using all input parameters. Then, in each scenario, the model’s accuracy was re-assessed with one missing parameter. Thus, a total of 70 scenarios were tested, 10 scenarios for each output parameter. By removing noise and focusing on the most informative variables, feature selection contributes to better generalization and predictive performance.

2.3. Artificial Intelligence Algorithms

2.3.1. Artificial Neural Networks

The ANN model [27] has the ability to learn from a training dataset and store the pattern of the data as weighted connections of neurons. It was selected to predict output parameters. The ANN scripts were developed using the MATLAB R2016a (Version 9.0.0.341360) computing environment, a high-level programming platform designed for numerical computing, data analysis, and algorithm development. The number and order of the input layer datasets were applied to the ANN algorithm as a constant for all scenarios, according to Yamaç and Todorovic [28]. Once the input scenarios are created, the entire dataset is randomly divided by a written script. The reason for the random division of the data is that periodic increase–decrease in the values of the parameters is observed. This reduces the performance of artificial neural networks, although it is clear in the literature that they provide more accurate results. Each scenario was tested in the ANN model utilizing three learning algorithms, which are optimization methods used to adjust model parameters for improved accuracy: Bayesian Regularization (BR), Levenberg–Marquardt (L-M), and Scaled Conjugate Gradient (SCG). Different percentages of the dataset were used for training, validation, and testing in each ANN, with the data generally divided randomly: 75–85% for training, 0–10% for validation, and 15–20% for testing. The most suitable scenario for validating the model was selected based on the coefficient of determination (R2) and the mean square error (MSE).

2.3.2. Adaptive Neuro-Fuzzy Inference System (ANFIS)

The primary objective of using a ANFIS in this study is to establish rules by categorizing each of the 7 different parameters fed from the K-WWTP effluent as inputs between 0 and 1, in accordance with FAO recommendations [23]. This method is applied according to the following steps:
Step 1: K-WWTP’s outlet parameters were used as the input layer for the ANFIS. According to FAO recommendations, the output layer was prepared in Excel files as 0 or 1 based on the input layer. For example, the recommended values for pH were 1 between 6.5 and 8.4, and 0 for all other values. These values were then normalized for all parameters.
Step 2: The categorized parameters were applied in different ANFISs. During these operations, different Membership functions were used to minimize the error for each parameter. In the model, membership classes are also defined according to FAO recommendations, and the number of Membership functions is used according to this range. Simultaneously, the dataset was divided and manually applied at different percentages for training, validation, and testing, with the manual portion typically allocated as 80–85% for training and 15–20% for testing.
Step 3: After the network training of the ANFIS, models were selected for all parameters with the lowest error rate. In these models, the ‘If-Then’ rules, the type of Membership functions, and the membership value ranges were collected in a single fuzzy inference system.

2.4. Combined Artificial Intelligence Algorithms

Fuzzy logic, which was first presented by Zadeh [29], is the theory that determines classes by assigning membership values between 0 and 1 to estimate the set of imprecise parameters. Expressing a set of interrelated fuzzy values is challenging because the transition of values within boundaries reflects uncertainty. Therefore, these sets can handle uncertainty, as in wastewater quality parameters, and can even express it as a numerical or weighted average.
This study combines three artificial intelligence models to estimate the usability percentage of treated wastewater in agriculture. First, the ANFIS output properties for each parameter were collected in the Fuzzy Logic Mamdani (FLM) inference system. Thereafter, the ANNs output was estimated for 7 different parameters created by Artificial Neural Networks scenarios from the inlet. Then, the Output of ANNs is linked to the input of Mamdani Fuzzy Logic, which is formed using rules of the ANFIS (Figure 1). Fuzzy logic can handle uncertainty as in wastewater quality parameters and can even express it as a numerical or weighted average.
The selection of ANN, ANFIS, and FLM models for this study was driven by their complementary strengths in addressing the nonlinearity and uncertainty inherent in wastewater quality prediction. Artificial Neural Networks (ANNs) excel in identifying complex patterns within high-dimensional datasets, making them ideal for capturing the dynamic relationships between influent and effluent parameters. Adaptive Neuro-Fuzzy Inference Systems (ANFISs) integrate the learning capabilities of neural networks with the interpretability of fuzzy logic, enabling the formulation of human-readable rules from imprecise data—a critical advantage when aligning predictions with regulatory thresholds. Fuzzy Logic-Mamdani (FLM) further enhances decision-making by translating qualitative expert knowledge (e.g., FAO guidelines) into quantitative usability assessments. While other machine learning techniques like Random Forest or XGBoost are effective for feature importance analysis and ensemble learning, they lack the hybridized structure needed to simultaneously model nonlinear dynamics, handle uncertainty, and provide actionable irrigation suitability metrics. For instance, ANFIS and FLM directly support the categorization of wastewater quality into usability classes (e.g., ‘suitable’ or ‘unsuitable’), which is less straightforward with purely statistical models. This triad of models was thus prioritized to balance predictive accuracy, interpretability, and practical applicability in agricultural reuse planning.

2.5. The Reuse Potential of Treated Wastewater of K-WWTP in Agriculture

One of the most well-known benefits of using wastewater in agriculture is reducing the pressure on freshwater resources. Thus, wastewater serves as an alternative irrigation source. The advantage of this study lies in the development of hybrid algorithms using artificial intelligence, allowing the usefulness of wastewater to be expressed numerically.
In line with this, an agricultural projection was conducted for the Kırklareli Wastewater Treatment Plant, intended for use in agricultural fields in the Kırklareli region. For the agricultural projection, crop patterns, climate parameters, and agricultural areas cultivated in recent years in this region were taken into account.
The crop patterns grown in this area were obtained from the Ministry of Agriculture and Forestry of the Republic of Turkey. The net irrigation water requirement (NIR) for each crop was determined using climate data and crop-specific parameters (Equation (2)).
N I R = E T c R e f f
where NIR is net irrigation requirement (mm), ETc is crop evapotranspiration (mm), and Reff is effective rainfall (mm). Crop evapotranspiration (ETc) was derived from the multiplication of the reference evapotranspiration (ETo), calculated using the Penman–Monteith model based on climatic parameters and the crop coefficients (Kc) [30]. The effective rainfall was assumed to be 80% of the total precipitation.
Moreover, specific discharge (qs) was calculated using Equation (3) in this study so that all plants could acquire all opportunities/advantages and evaluate wastewater by percentage of availability. After this stage, the total irrigation requirement (IR) and irrigable area were calculated using Equations (4) and (5).
q s L s / h a = N I R m m × 10 m 3 h a / m m × 1000 ( l m 3 ) 31 d a y s   x   24 h o u r s   x   60 m i n 60 ( s e c )
I R m 3 h a × y e a r = q s × D u r a t i o n d a y y e a r × 86.4 ( s × m 3 d a y × L )
I r r i g a b l e   a r e a   ( h a ) = D i s c h a r g e   o f   K W W T P m 3 d a y × D u r a t i o n ( d a y y e a r ) I r r i g a t i o n   R e q u i r e m e n t   f o r   o n e   h e c t a r   ( m 3 h a × y e a r )

3. Results

3.1. Performance of ANNs

A total of 70 scenarios were tested, with 10 scenarios for each output parameter, using a different number of hidden neurons, training functions, Epoch numbers, and training/validation/testing ratios. For each output parameter, the first scenario and the model that provided the highest R2 and the lowest MSE are summarized in Table 3. It was found that the best performance of training of models is 80% for the dataset of pH, Conductivity, COD, and total P, 85% for the dataset of total N and Salinity, and 75% for the dataset of TSS. It used 5–10% of the dataset in validation in order to avoid switching to over-learning in those parameters. The remaining part of the dataset was used for the testing of models. As trained networks, Levenberg–Marquardt and Bayesian Regularization algorithms were tried out for each parameter and scenario. As a result, the highest correlation, minimum mean square error, and minimum number of input parameters were taken into account to choose the best model. The biggest advantage of this study is that different output data can be estimated with the same input dataset. In other words, while the same input dataset can be used for salinity and conductivity, their order can be changed according to the importance level. All scenarios and model parameters were examined, and the best one was chosen.
Minimum MSE, almost high correlation, and minimum number of input parameters were obtained in the 9th scenario created for pH. According to salinity and conductivity estimation results, the R2 value reached 0.94 and 0.96 with 0.00006 MSE for salinity and 107.30676 for conductivity. In the scenarios for COD estimation, an R2 value of 0.86 and an MSE of 40.14093 were obtained using all parameters, and COD was estimated against only six input parameters as the R2 value of 0.80 and MSE of 56.55725. The R2 values of scenarios for the total N estimation decreased from 0.96 to 0.91 depending on removing the parameters. When all input parameters were ranked according to importance level for total P, the R2 value and MSE were determined as 0.90 and 0.32555, respectively. However, for only five inputs, R2 values were estimated with 0.74 and 0.67912 MSE and were selected as the best scenario. R2 values varied between 0.92 and 0.85, and MSE values increased from 5.25323 to 33.69808 for all scenarios of TSS estimation. The fifth scenario, which demonstrated the highest performance, was selected.
Verification was carried out with selected scenarios using separated ones. The graphs between predicted and observed values for all seven parameters are shown in Figure 2. The significance level of the R2 values obtained in the prediction models for the selected scenarios is p < 0.01 and 0.05, which is significant, indicating that the models produce predictions close to the measured values.

3.2. Performance of ANFIS

In this study, the main purpose of using ANFIS is to establish boundary-based rules by categorizing each of the seven different parameters fed from the K-WWTP outlet between 0 and 1. The categorized parameters are presented in Table 4.
All parameters were distributed manually, 80% for training and 20% for testing. In the training of ANFIS models, the Membership functions are used to determine the classes of values as well as to detect which class the fuzzy value belongs to. Therefore, the Membership function is of great importance in learning the type of network. The ‘Trapmf’ function, which has the lowest margin of error, was selected using the trial-and-error method for all MF types applied. Three membership functions are developed for each parameter. Later, a total of 21 rules were created using these Membership functions in the system. The ANFIS model generates a value for each rule. As a result, three output Membership functions were formed by ANFIS. Figure 3 shows these output Membership function clusters. Figure 4 shows the performance of the ANFIS model, comparing the observed and categorized outlet wastewater quality parameters against predicted values. It is clear that categorizing the proposed ANFIS model provides high performance for all parameters.

3.3. Fuzzy-Based Assessment of Treated Wastewater Suitability for Irrigation

The main output of this study is to express the percentage of usability in agriculture according to the K-WWTP outlet water quality values. The main features of the rules and Membership functions created using the ANFIS model are classification in terms of wastewater availability (None, Slight to moderate, Severe) and determining how close it is to which class. In the model created by combining different models, the system evaluated all parameters together rather than examining the usability of wastewater one by one. When the AI model trained with FAO recommendations is examined, it is found that the usability of treated wastewater in agriculture is between 53% and 87%. When the usability rate of treated water falls below 53% in the model, the results indicate that this water is not suitable for agricultural use.
In the model, the wastewater quality perspective varied between 69% and 72% during the irrigation season, depending on treated wastewater quality parameters of K-WWTP. It was determined that 87% of the water was usable when K-WWTP carried out the treatment process with optimal efficiency for each parameter (Figure 5). On the other hand, when K-WWTP had the worst performance, this usability rate was found to be 13%, as shown in Figure 6. The evaluation of all parameters in a single fuzzy system and the relationship of all parameters to each other is shown in Figure 7.

3.4. Quantitative Reuse Potential of K-WWTP Discharge in Agriculture

In this part of the study, an agricultural projection was prepared for the crops that can be irrigated in terms of water availability to reduce the pressure on the decreasing water resources. For the realization of the agricultural projection, the crop pattern grown in the region has been taken into consideration. The main purpose of this process is to focus on the areas that can be irrigated with K-WWTP discharge.
Therefore, the irrigation module was calculated for each crop; parallel to this, the irrigation requirement for one hectare was found. Finally, in light of these data, the amount of irrigable area for each individual crop was calculated according to the flow rate of K-WWTP. The results are shown in Table 5.
In the K-WWTP basin, the total area of crops such as maize, barley, oat, triticale, chickpea, canola, sunflower, rice, potato, sugarbeet, and clover grown under rain-fed and irrigated conditions is 220,305 hectares, of which about half is irrigated crops and the total water requirement is estimated at 3.02 billion m3. In the near future, it is estimated that yield reductions parallel to climate change will necessitate supplemental irrigation even for crops like wheat and sunflower.
According to the results of the irrigable land assessment, an area of 20,925.7 hectares near the city center where the treatment plant is located is classified as irrigable. The average amount of water discharged from the treatment plant outlet is 17,300 m3 per day, and it has been concluded that the K-WWTP has the potential to serve an area of 7301 hectares. This means that approximately 35% of the 21,000 hectares of agricultural land in the city center could be irrigated using treated wastewater.

4. Discussion

According to the FAO recommendation [23] and Wastewater Treatment Plants Technical Procedures Communiqué Annex-7 of Turkey [31], the wastewater quality variables could be categorized into three main groups: chemical, physical, and biological. In this study, K-WWTP output water quality was examined in order to make recommendations for agricultural irrigation. Different water quality variables, such as COD, DO, pH, TSS, and EC, have been modeled using machine learning methodologies. The pH value recorded was 7.3, with 0.356 as the standard deviation. The salinity, which is an important parameter for agricultural production, recorded an average of 46%. In contrast, in K-WWTP output, the minimum measured conductivity was 717 mg/L, while the maximum was 1143 mg/L. The COD parameters ranged between 14.2 and 125 mg/L. In addition, similarly, it was observed that TSS fluctuated in the influent water over three years, while the effluent remained stable between 1 and 72 mg/L.
For model development, data normalization was performed to make the data dimensionless and keep it within a specific range, as this approach yields more accurate results [32]. Most studies have shown that nonlinear functions often have different boundaries, and due to the weakness of making predictions with raw data, several researchers have scaled the data to the following ranges: [−1, 1], [0.1, 0.9], and [0, 1] [33,34,35,36,37]. Normalization and standardization are techniques used to adjust datasets. Normalization is suitable for data that do not follow a Gaussian distribution, while standardization works well for data resembling a Gaussian distribution. However, neither method guarantees improved model performance or universal applicability. The choice between normalization and standardization depends on the specific machine learning algorithm. Since no definitive rule exists for selecting the best method, it is recommended to fit models using raw, normalized, and standardized data and then compare their performance to determine the most effective approach. For example, the integration of advanced normalization techniques, such as those utilizing adaptive learning algorithms, has been shown to improve model precision in predicting water quality parameters, as evidenced by studies using BiLSTM models [19]. Similarly, the combination of normalization with machine learning frameworks has proven effective in controlling effluent quality, particularly when leveraging Random Forests for variable importance analysis [18].
There are various aims in building a model. It is clear in the literature that, especially in the agricultural field, the purposes of creating scenarios can be evaluating model performance or achieving good results with fewer parameters in order to reach high-quality data, which is called data mining. In particular, the objective is to produce summarized data in a convenient and relatively simple form. In this study, the reason behind proposing these scenarios is to estimate wastewater quality for models with descending input parameters by machine learning. For example, according to Yamaç and Todorovic [28], the purpose of scenarios was to test the performance of three machine learning techniques with different combinations of weather input data. Moreover, another study operated on rules derived from data mining obtained from an optimization model and found high concordance, especially for two datasets [38]. This approach aligns with the findings of Najah et al. [39], who demonstrated that advanced AI systems like WDT-ANFIS improve water quality parameter estimation accuracy by minimizing the number of input variables while maintaining high performance. In a similar study, Fu et al. [40] employed wavelet-ANFIS, ANN, and MLR methods for wastewater quality monitoring and prediction. Their findings indicated that the wavelet-ANFIS model achieved superior performance, predicting TDS and EC with R2 values of 0.987 and 0.985, respectively. Furthermore, according to Hong et al. [41], ANFIS-based predictive models are effective in determining the optimum polymer dose required to achieve efficient dewatering performance. Additionally, Farhi et al. [42] emphasized the role of LSTM models in accurately predicting deviations in key parameters, further validating the importance of such scenario-based methodologies.
In this study, ANFIS and Fuzzy Logic were used in an integrated manner. The quality of domestic treated wastewater should be known in terms of its usability in agriculture. In this context, previously applied methods for water quality classification [43,44,45] are insufficient as they consider fewer parameters. Therefore, it is inevitable to apply current methods equipped with advanced technology. In this study, three different artificial intelligence methods were combined using seven different water quality parameters, and the suitability of water quality was expressed as a percentage. According to the model results trained with FAO recommendations, the usability of domestic treated wastewater in agriculture varies between 53% and 87%. This indicates that when the usability rate of treated water in the model drops below 53%, the water is not suitable for agricultural use. The wastewater quality perspective in the current study varied between 69% and 72% during the irrigation season, depending on the developed combined model. Since it was above the allowable limit, it was determined that it is applicable for every crop in the cropping pattern. Another advantage of this study is the graphical representation of the relationship of one parameter with all other parameters. Recent studies have highlighted the need for comprehensive multi-criteria decision-making tools, as traditional methods often fail to address the complexity of modern water quality assessments [46]. For instance, the incorporation of adaptive AI frameworks, as seen in the work by Sheik et al. [47], offers enhanced predictive capabilities across diverse environmental datasets.
Many studies have been conducted to estimate water quality or treated wastewater quality parameters using artificial intelligence [48,49,50]. It is clear that the common point of these studies is to find correlations between input parameters and output parameters and their numerical estimation. Other studies have focused on various methods, such as water quality classification or WQI, and have been estimated using different artificial intelligence models. Additionally, Support Vector Machine (SVM) and genetic algorithms have been used to reduce the volume of the anoxic tank. In another study, Random Forests (RFs) were applied for micro-pollutant removal during ozonation, as seen in the practice, and machine learning was used to optimize wastewater treatment systems. Machine learning models, including Decision Trees (DTs) and XGBoost, have been used [51,52,53].
ANNs have been widely applied in wastewater treatment studies due to their ability to model complex and nonlinear relationships. Consistent with previous research, the ANN models in this study achieved high accuracy (R2 values of 0.70–0.96) and low mean square error (MSE) values for predicting parameters such as pH, salinity, and conductivity. Studies by Antanasijević et al. [48] and Wu and Wang [49] have reported similar capability of ANNs to effectively predict water quality parameters with minimal input data, which reinforces the findings of this study. The choice of training algorithms, including Levenberg–Marquardt and Bayesian Regularization, was crucial for minimizing overfitting and enhancing generalizability. These algorithms have also been highlighted in the literature for their robust performance in environmental modeling [50]. The ability of ANNs to estimate multiple output parameters using a unified input dataset further underscores their utility, as previously noted by Sharma et al. [54] in multi-parameter soil and water quality assessments.
During the training of ANN models, the initial weights are typically selected randomly, which can lead to the model converging to local minima—a well-known limitation of ANN learning. This issue can be mitigated through the use of momentum term methods. Despite their advantages, AI models face several challenges, including (1) poor repeatability due to randomly assigned weights and biases, (2) a tendency to converge to local optima, (3) sensitivity to data size, and (4) potential bias arising from imbalanced or unrepresentative datasets, as well as difficulties in selecting appropriate data. Consequently, selecting the most suitable algorithm and function based on the specific problem context is essential for achieving optimal predictive performance [55]. To overcome these challenges, in this study, the datasets of different sizes were first normalized, and the Relief algorithm was used to rank the importance of each parameter based on its weight factors. The obtained scenarios were used to create models with multiple hidden layers and training functions, and performance criteria were assessed to select the best models.
The ANFIS models provided a complementary approach to ANNs by incorporating a rule-based fuzzy logic system for categorizing wastewater quality. Similar to findings by Chen et al. [56], the use of Membership functions (e.g., ‘Trapmf’) enabled precise classification of water quality parameters, with high performance across all scenarios. ANFIS’s ability to define boundary-based rules aligns with the literature highlighting its suitability for multi-criteria decision-making in wastewater reuse [57]. The categorization of treated wastewater usability into classes (e.g., None, Slight to Moderate, Severe) provides actionable insights for agricultural applications. Similarly, advanced models, including LSTM-based systems, have successfully classified water quality data, further supporting the methodology of this study [42]. The categorization techniques used here facilitate actionable insights for wastewater reuse through fuzzy logic and rule-based approaches.
The fuzzy-based integration of ANFIS outputs provided a holistic evaluation of treated wastewater’s agricultural usability, addressing multiple quality parameters simultaneously. This aligns with FAO recommendations [23], which stress the need for comprehensive assessments that consider salinity, nutrient content, and other factors. The usability predictions (53–87%) underscore the variability in agricultural potential based on treatment performance, as noted in previous studies. The finding that up to 87% of treated wastewater could be utilized during optimal operation and such holistic approaches to water quality evaluation are in line with global standards, as emphasized in studies by Wang et al. [18], where multi-parameter assessments were crucial for improving effluent quality control. Additionally, the high usability rates observed in this study align with findings on optimal wastewater treatment efficiencies reported by Najah et al. [39].
Further studies aim to strongly predict various water quality parameters with different artificial intelligence methods. For instance, Kisi and Ay [58] developed models for low, medium, and high values of pH and other water quality parameters using the Mann–Kendall trend method with data recorded at five different stations on the Kızılırmak River in Turkey. Additionally, two models were produced using genetic programming (GP) and ANFIS to model river water quality. In this study, a high correlation was achieved in the 9th scenario, which included pH and TSS, and was created with a minimum number of input parameters. It can be concluded that the observed differences are not only due to the quality and randomness of the dataset but also the success of ANNs in predicting water quality. It was proven by Kingston et al. [59] that the ANN model predicted salinity concentrations with a high R-square of 0.962 and a minimum RMSE of 35.90. Moreover, according to another study by Anmala et al. [60], it was found for salinity prediction, an R-square equal to 0.62 using Neural Network Model Predictions for Water Quality Parameter Distribution for a Stream Network in Green and Trade Water River Basin. Moreover, Burchard-Levine et al. [61] and Najah et al. [39] predicted COD with low mean squared errors. The latter study developed five scenarios for COD prediction and produced estimates with the lowest error and highest correlation in a scenario using parameters such as COD, conductivity, total nitrogen, salinity, TSS, and pH as inputs, achieving an R2 value of 0.80 and an MSE of 0.00460690. The total suspended solids (TSS) indication of wastewater plant performance is also important for drip irrigation. For instance, Tümer and Edebali [62] predicted the TSS with an R2 of 0.85 and an MSE of 0.00668480 using a model based on daily records from the Konya wastewater treatment plant, with pH, temperature, COD, TSS, and BOD parameters as inputs. It was concluded in some studies that some parameters in wastewater provide benefits in terms of fertilization [63,64,65]. Therefore, the model was applied to estimate the total nitrogen and total phosphorus in wastewater by artificial intelligence. As a result, the R2 values of scenarios for the total N estimation decreased from 0.96 to 0.91, depending on removing the parameters. When all input parameters were ranked according to importance level using relief algorithms for total P, the R2 and MSE values were determined as 0.74 and 0.6791209439, respectively.
Another valuable outcome of the study is the quantitative determination of the potential for using domestic treated wastewater. The estimation that K-WWTP discharge could irrigate 7301 hectares, covering 35% of the local agricultural area, underscores the significant role of treated wastewater in alleviating water scarcity. This finding aligns with Bouwer [66], who emphasized the potential of treated wastewater as a reliable alternative for irrigation in arid and semi-arid regions. Furthermore, the study’s projection of increasing irrigation needs due to climate change echoes concerns raised in global assessments [67], highlighting the urgency of integrating treated wastewater into agricultural water management strategies.
While this study demonstrates the efficacy of ANN, ANFIS, and FLM in predicting wastewater quality, several limitations should be acknowledged. First, the dataset, though comprehensive (3 years of daily data), originates from a single treatment plant in a semi-arid region. This limits the generalizability of the models to other climatic zones or treatment configurations. For example, regions with high industrial discharge or seasonal monsoons may exhibit parameter fluctuations that are not captured here. Second, potential biases may arise from the manual categorization of parameters in ANFIS (e.g., FAO thresholds), which assumes uniform crop sensitivities and does not account for site-specific agronomic practices. Additionally, the exclusion of microbial contaminants (e.g., E. coli) and heavy metals–critical for certain reuse applications–simplifies the agricultural suitability assessment. Future work should expand data collection across diverse geographic and operational contexts, integrate advanced regularization techniques to mitigate overfitting in smaller datasets, and incorporate multi-criteria decision frameworks to address region-specific agricultural and environmental priorities.

5. Conclusions

This study demonstrates the effectiveness of a hybrid machine learning approach in assessing the agricultural reuse potential of treated wastewater. By integrating Artificial Neural Networks (ANNs), Adaptive Neuro-Fuzzy Inference Systems (ANFISs), and Fuzzy Logic-Mamdani (FLM), the research provides a robust framework for predicting wastewater quality parameters and evaluating their suitability for irrigation. The ANN model exhibited superior predictive accuracy, with R2 values ranging from 0.74 to 0.96, while ANFIS-based classification and fuzzy logic modeling ensured a comprehensive usability assessment aligned with FAO recommendations.
The findings indicate that the treated wastewater from the Kırklareli Wastewater Treatment Plant (K-WWTP) has an agricultural usability ranging from 69% to 72%, with a potential to irrigate approximately 35% of a 20,000-hectare agricultural area. These results highlight the role of machine learning in optimizing wastewater treatment processes and promoting sustainable water resource management. By leveraging AI-driven approaches, this study contributes to improving irrigation efficiency, mitigating freshwater scarcity, and supporting environmental conservation efforts. The proposed model has enabled real-time monitoring and predictive analysis of wastewater quality parameters. The findings of this study can be applied in real-world wastewater treatment plants (WWTPs) with similar characteristics and agricultural lands by various stakeholders, including WWTP operators, policymakers, and water resource managers. Most importantly, by demonstrating the potential use of this water in irrigation, it helps prevent uncontrolled discharges and contributes to sustainable environmental management. Furthermore, it serves as a foundation for AI technology developers to develop new models based on different climatic conditions and wastewater treatment configurations. Future research could also focus on integrating deep learning to enhance model accuracy and robustness.
However, the proposed AI techniques have certain limitations, including their reliance on the quality and quantity of training data, which may affect generalizability. Since the facility where the study was conducted utilized three years of daily live data for input parameters, the learning process was completed with high performance. Even in a scenario where water quality deteriorates, the model will maintain high predictive power, which will affect the water’s usability rate. However, for other treatment plants wishing to integrate this hybrid methodology for the same purpose, the model will need to be retrained using reliable historical datasets. Additionally, the interpretability of complex models like ANN and ANFIS remains a challenge, requiring further refinement for practical decision-making. Therefore, future research should explore the integration of additional parameters, such as microbial contaminants and heavy metals, to further refine wastewater reuse assessments. Investigating the socio-economic impacts of wastewater reuse, including farmer acceptance and cost-effectiveness, will further support practical implementation. Additionally, expanding the temporal and spatial scope of the analysis can address seasonal and regional variations in wastewater quality and demand.

Author Contributions

D.D.K. contributed to data curation, formal analysis, investigation, methodology, resources, visualization, writing—original draft. Y.A. and M.T. contributed to conceptualization, methodology, supervision, validation, writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

The author(s) received no specific funding for this work.

Data Availability Statement

The data can be requested from the authors.

Acknowledgments

The authors extend their gratitude to the relevant institutions for their scientific support in this study, which was carried out in collaboration between the Mediterranean Agronomic Institute of Bari (CIHEAM-Bari) and Ankara University.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Gleick, H.P. Water and conflict: Fresh water resources and international security. Int. Secur. 1993, 18, 79–112. [Google Scholar] [CrossRef]
  2. Shiklomanov, I.A. World Water Resources: A New Appraisal and Assessment for the 21st Century; United Nations Educational, Scientific and Cultural Organization (UNESCO): Paris, France, 1998; pp. 4–27. [Google Scholar]
  3. Jaramillo, M.F.; Restrepo, I. Wastewater reuse in agriculture: A review about its limitations and benefits. Sustainability 2017, 9, 1734. [Google Scholar] [CrossRef]
  4. Reznik, A.; Dinar, A.; Hernández-Sancho, F. Treated wastewater reuse: An efficient and sustainable solution for water resource scarcity. Environ. Resour. Econ. 2019, 74, 1647–1685. [Google Scholar] [CrossRef]
  5. Salem, H.S. Socioeconomic, environmental, and health impacts of reusing treated wastewater in agriculture in some Arab countries, including occupied Palestine, in view of climate change. Nat. Resour. Conserv. Res. 2023, 6, 2229. [Google Scholar] [CrossRef]
  6. Arena, C.; Genco, M.; Mazzola, M. Environmental benefits and economical sustainability of urban wastewater reuse for irrigation—A cost-benefit analysis of an existing reuse project in Puglia, Italy. Water 2020, 12, 2926. [Google Scholar] [CrossRef]
  7. Wan, J.; Huang, M.; Ma, Y.; Guo, W.; Wang, Y.; Zhan, H.; Sun, X. Prediction of effluent quality of a paper mill wastewater treatment using an adaptive network-based fuzzy inference system. Appl. Soft Comput. J. 2011, 11, 3238–3246. [Google Scholar] [CrossRef]
  8. Essahlaoui, F.; Elhajrat, N.; Halimi, M.; El Abbassi, A. New approach to monitoring a wastewater irrigation system controlled by the artificial neural network (ANN). Groundw. Sustain. Dev. 2023, 23, 100999. [Google Scholar] [CrossRef]
  9. Alprol, A.E.; Mansour, A.T.; Ibrahim, M.E.E.D.; Ashour, M. Artificial Intelligence Technologies Revolutionizing Wastewater Treatment: Current Trends and Future Prospective. Water 2024, 16, 314. [Google Scholar] [CrossRef]
  10. Shah, S.M.H.; Yassin, M.A.; Abba, S.I.; Lawal, D.U.; Aliyu, F.; Al-Qadami, E.H.H.; Mustaffa, Z.; Pande, C.B.; Sammen, S.S.; Aljundi, I.H. Treated Wastewater Assessment to Optimize Agricultural Water Reuse in Al-Qatif Region Saudi Arabia Using Hybrid Machine Learning Techniques. Preprints 2024. [Google Scholar] [CrossRef]
  11. Niel, O.; Bastard, P. Artificial intelligence in nephrology: Core concepts, clinical applications, and perspectives. Am. J. Kidney Dis. 2019, 74, 803–810. [Google Scholar] [CrossRef]
  12. Liakos, K.G.; Busato, P.; Moshou, D.; Pearson, S.; Bochtis, D. Machine learning in agriculture: A review. Sensors 2018, 18, 2674. [Google Scholar] [CrossRef]
  13. Ahmed, A.N.; Dawal, S.Z.; Hassan, M.R.; Muniandy, S. Machine learning methods for better water quality prediction. J. Hydrol. 2019, 578, 124084. [Google Scholar] [CrossRef]
  14. Yao, Y.; Liang, S.; Li, X.; Chen, J.; Liu, S.; Jia, K.; Roupsard, O. Improving global terrestrial evapotranspiration estimation using support vector machine by integrating three process-based algorithms. Agric. For. Meteorol. 2017, 242, 55–74. [Google Scholar] [CrossRef]
  15. Kannangara, M.; Dua, R.; Ahmadi, L.; Bensebaa, F. Modeling and prediction of regional municipal solid waste generation and diversion in Canada using machine learning approaches. Waste Manag. 2018, 74, 3–15. [Google Scholar] [CrossRef] [PubMed]
  16. Moral, H.; Aksoy, A.; Gokcay, C.F. Modeling of the activated sludge process by using artificial neural networks with automated architecture screening. Comput. Chem. Eng. 2008, 32, 2471–2478. [Google Scholar] [CrossRef]
  17. Abba, S.I.; Elkiran, G. Effluent prediction of chemical oxygen demand from the wastewater treatment plant using artificial neural network application. Procedia Comput. Sci. 2017, 120, 156–163. [Google Scholar] [CrossRef]
  18. Wang, D.; Thunéll, S.; Lindberg, U.; Yu, Z.; Chen, S. A machine learning framework to improve effluent quality control in wastewater treatment plants. Sci. Total Environ. 2021, 784, 147138. [Google Scholar] [CrossRef]
  19. Sheik, A.G.; Kumar, A.; Jain, A.; Bux, F.; Kumari, S. Prediction of wastewater quality parameters using adaptive and machine learning models: A South African case study. J. Water Process Eng. 2024, 67, 106185. [Google Scholar] [CrossRef]
  20. Lv, J.Q.; Yin, W.X.; Xu, J.M.; Cheng, H.Y.; Li, Z.L.; Yang, J.X.; Wang, A.J.; Wang, H.C. Augmented machine learning for sewage quality assessment with limited data. Environ. Sci. Ecotech. 2025, 23, 100512. [Google Scholar] [CrossRef]
  21. Yin, H.; Chen, Y.; Zhou, J.; Xie, Y.; Wei, Q.; Xu, Z. A probabilistic deep learning approach to enhance the prediction of wastewater treatment plant effluent quality under shocking load events. Water Res. X 2025, 26, 100291. [Google Scholar] [CrossRef]
  22. TSMS 2019. Turkish State Meteorological Service, Tekirdağ Provincial Meteorological Data Records. Available online: https://bulut.mgm.gov.tr/share/ (accessed on 5 March 2023).
  23. Pescod, M.B. Wastewater Treatment and Use in Agriculture-FAO Irrigation and Drainage Paper 47; FAO: Rome, Italy, 1992; 128p. [Google Scholar]
  24. Sinsomboonthong, S. Performance Comparison of New Adjusted Min-Max with Decimal Scaling and Statistical Column Normalization Methods for Artificial Neural Network Classification. Int. J. Math. Math. Sci. 2022, 1, 3584406. [Google Scholar] [CrossRef]
  25. Kira, K.; Rendell, L.A. The feature selection problem: Traditional methods and a new algorithm. In Proceedings of the 10th National Conference on Artificial Intelligence, San Jose, CA, USA, 12–16 July 1992; AAAI Press: Atlanta, Georgia, 1992; pp. 129–134. [Google Scholar]
  26. Robnik-Šikonja, M.; Kononenko, I. Theoretical and empirical analysis of ReliefF and RReliefF. Mach. Learn. 2003, 53, 23–69. [Google Scholar] [CrossRef]
  27. Boger, Z.; Guterman, H. Knowledge extraction from artificial neural network models. In Proceedings of the 1997 IEEE International Conference on Systems, Man, and Cybernetics, Orlando, FL, USA, 12–15 October 1997; pp. 3030–3035. [Google Scholar]
  28. Yamaç, S.S.; Todorovic, M. Estimation of daily potato crop evapotranspiration using three different machine learning algorithms and four scenarios of available meteorological data. Agric. Water Manag. 2020, 228, 105875. [Google Scholar] [CrossRef]
  29. Zadeh, L.A. Fuzzy sets. Inf. Control 1965, 8, 338–353. [Google Scholar] [CrossRef]
  30. Allen, R.G.; Pereira, L.S.; Raes, D.; Smith, M. Crop Evapotranspiration-Guidelines for Computing Crop Water Requirements-FAO Irrigation and Drainage Paper 56; FAO: Rome, Italy, 1998; 156p. [Google Scholar]
  31. Annex 7. Atıksu Arıtma Tesisleri Teknik Usuller Tebliği. Available online: https://www.mevzuat.gov.tr/mevzuat?MevzuatNo=13873&MevzuatTur=9&MevzuatTertip=5 (accessed on 8 June 2023).
  32. Rajaee, T.; Khani, S.; Ravansalar, M. Artificial intelligence-based single and hybrid models for prediction of water quality in rivers: A review. Chemom. Intell. Lab. Syst. 2020, 200, 103978. [Google Scholar] [CrossRef]
  33. Wen, X.; Fang, J.; Diao, M. Artificial neural network modeling of dissolved oxygen in the Heihe River, Northwestern China. Environ. Monit. Assess. 2013, 185, 4361–4371. [Google Scholar] [CrossRef]
  34. Ravansalar, M.; Rajaee, T.; Ergil, M. Prediction of dissolved oxygen in River Calder by noise elimination time series using wavelet transform. J. Exp. Theor. Artif. Intell. 2015, 28, 689–706. [Google Scholar] [CrossRef]
  35. Zounemat-Kermani, M.; Scholz, M. Modeling of dissolved oxygen concentrations using an extreme learning machine. Environ. Sci. Pollut. Res. 2013, 20, 5078–5087. [Google Scholar]
  36. Singh, K.P.; Gupta, S.; Rai, P. Predicting dissolved oxygen concentration using kernel regression modeling approaches with nonlinear hydro-chemical data. Environ. Monit. Assess. 2014, 186, 2749–2765. [Google Scholar] [CrossRef]
  37. Jafar, R.; Awad, A.; Jafar, K.; Shahrour, I. Predicting effluent quality in full-scale wastewater treatment plants using shallow and deep artificial neural networks. Sustainability 2022, 14, 15598. [Google Scholar] [CrossRef]
  38. Sattari, M.T.; Joudi, A.R.; Kusiak, A. Estimation of water quality parameters with data-driven model. J. Am. Water Works Assoc. 2016, 108, E232–E239. [Google Scholar] [CrossRef]
  39. Najah, A.; El-Shafie, A.H.A.H.; Karim, O.A.; Jaafar, O.; El-Shafie, A.H. An application of different artificial intelligences techniques for water quality prediction. Int. J. Phys. Sci. 2011, 6, 5298–5308. [Google Scholar]
  40. Fu, Z.; Cheng, J.; Yang, M.; Batista, J. Prediction of industrial wastewater quality parameters based on wavelet de-noised ANFIS model. In Proceedings of the IEEE 8th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA, 8–10 January 2018; pp. 301–306. [Google Scholar]
  41. Hong, E.; Yeneneh, A.M.; Sen, T.K.; Ang, H.M.; Kayaalp, A. ANFIS based modelling of dewatering performance and polymer dose optimization in a wastewater treatment plant. J. Environ. Chem. Eng. 2018, 6, 1957–1968. [Google Scholar] [CrossRef]
  42. Farhi, N.; Kohen, E.; Mamane, H.; Shavitt, Y. Prediction of wastewater treatment quality using LSTM neural network. Environ. Technol. Innov. 2021, 23, 101632. [Google Scholar] [CrossRef]
  43. USSL. Diagnosis and improvement of saline and alkali soils. In U.S. Department of Agriculture Handbook No. 60; U.S. Department of Agriculture: Washington, DC, USA, 1954. [Google Scholar]
  44. Scofield, C.S. The Salinity of Irrigation Water; U.S. Government Printing Office: Washington, DC, USA, 1936.
  45. Wilcox, L.V. The quality of water for irrigation use. In Technical Bulletin 962; U.S. Department of Agriculture: Washington, DC, USA, 1948. [Google Scholar]
  46. Ching, P.M.; So, R.H.; Morck, T. Advances in soft sensors for wastewater treatment plants: A systematic review. J. Water Proc. Eng. 2021, 44, 102367. [Google Scholar] [CrossRef]
  47. Shiek, A.G.; Machavolu, V.R.K.; Seepana, M.M.; Ambati, S.R. Design of control strategies for nutrient removal in a biological wastewater treatment process. Environ. Sci. Pollut. Res. 2021, 28, 12092–12106. [Google Scholar] [CrossRef]
  48. Antanasijević, D.; Pocajt, V.; Perić-Grujić, A.; Ristić, M. Modelling of dissolved oxygen in the Danube River using artificial neural networks and Monte Carlo simulation uncertainty analysis. J. Hydrol. 2014, 519, 1895–1907. [Google Scholar] [CrossRef]
  49. Wu, J.; Wang, Z. A hybrid model for water quality prediction based on an artificial neural network, wavelet transform, and long short-term memory. Water 2022, 14, 610. [Google Scholar] [CrossRef]
  50. Maier, H.R.; Jain, A.; Dandy, G.C.; Sudheer, K.P. Methods used for the development of neural networks for the prediction of water resource variables in river systems: Current status and future directions. Environ. Model. Softw. 2010, 25, 891–909. [Google Scholar] [CrossRef]
  51. Fang, F.; Ni, B.; Li, W.; Sheng, G.; Yu, H. A simulation-based integrated approach to optimize the biological nutrient removal process in a full-scale wastewater treatment plant. Chem. Eng. 2011, 174, 2–3, 635–643. [Google Scholar] [CrossRef]
  52. Cha, D.; Park, S.; Kim, M.S.; Kim, T.; Hong, S.W.; Cho, K.H.; Lee, C. Prediction of oxidant exposures and micropollutant abatement during ozonation using a machine learning method. Environ. Sci. Technol. 2021, 55, 709–718. [Google Scholar] [CrossRef] [PubMed]
  53. Zhu, M.; Wang, J.; Yang, X.; Zhang, Y.; Zhang, L.; Ren, H.; Wu, B.; Ye, L. A review of the application of machine learning in water quality evaluation. Eco-Environ. Health 2022, 1, 107–116. [Google Scholar] [CrossRef]
  54. Sharma, L.K.; Singh, R.; Umrao, R.K.; Sharma, K.M.; Singh, T.N. Evaluating the modulus of elasticity of soil using soft computing system. Eng. Comput. 2017, 33, 497–507. [Google Scholar] [CrossRef]
  55. Xu, W.L.; Wang, Y.J.; Wang, Y.T.; Li, J.G.; Zeng, Y.N.; Guo, H.W.; Liu, H.; Dong, K.L.; Zhang, L.Y. Application and innovation of artificial intelligence models in wastewater treatment. J. Contam. Hydrol. 2024, 267, 104426. [Google Scholar] [CrossRef] [PubMed]
  56. Chen, W.; Panahi, M.; Khosravi, K.; Pourghasemi, H.R.; Rezaie, F.; Parvinnezhad, D. Spatial prediction of groundwater potentiality using ANFIS ensembled with teaching-learning-based and biogeography-based optimization. J. Hydrol. 2019, 572, 435–448. [Google Scholar] [CrossRef]
  57. Okeke, O.P.; Aminu, I.; Rotimi, A.; Najashi, B.G.; Jibril, M.M.; Ibrahim, A.S.; Bashir, A.; Malami, S.I.; Habibu, M.A.; Magaji, M.M. Performance analysis and control of wastewater treatment plant using adaptive neuro-fuzzy inference system (ANFIS) and multi-linear regression (MLR) techniques. GSC Adv. Eng. Technol. 2022, 4, 1–16. [Google Scholar] [CrossRef]
  58. Kisi, O.; Ay, M. Comparison of Mann–Kendall and innovative trend method for water quality parameters of the Kizilirmak River, Turkey. J. Hydrol. 2014, 513, 362–375. [Google Scholar] [CrossRef]
  59. Kingston, G.B.; Maier, H.R.; Lambert, M.F. Bayesian model selection applied to artificial neural networks used for water resources modelling. Water Resour. Res. 2008, 44, W04419. [Google Scholar] [CrossRef]
  60. Anmala, J.; Meier, O.W.; Meier, A.J.; Grubbs, S. GIS and Artificial Neural Network–Based Water Quality Model for a Stream Network in the Upper Green River Basin, Kentucky, USA. J. Environ. Eng. 2014, 141, 04014082. [Google Scholar] [CrossRef]
  61. Burchard-Levine, A.; Liu, S.; Vince, F.; Li, M.; Ostfeld, A. A hybrid evolutionary data-driven model for river water quality early warning. J. Environ. Manag. 2014, 143, 8–16. [Google Scholar] [CrossRef]
  62. Tümer, A.E.; Edebali, S. An artificial neural network model for wastewater treatment plant of Konya. Int. J. Intell. Syst. Appl. Eng. 2015, 3, 131. [Google Scholar] [CrossRef]
  63. Pedrero, F.; Kalavrouziotis, I.; Alarcón, J.J.; Koukoulakis, P.; Asano, T. Use of treated municipal wastewater in irrigated agriculture—Review of some practices in Spain and Greece. Agric. Water Manag. 2010, 97, 1233–1241. [Google Scholar] [CrossRef]
  64. Cirelli, G.L.; Consoli, S.; Licciardello, F.; Aiello, R.; Giuffrida, F.; Leonardi, C. Treated municipal wastewater reuse in vegetable production. Agric. Water Manag. 2012, 104, 163–170. [Google Scholar] [CrossRef]
  65. Urbano, V.R.; Mendonça, T.G.; Bastos, R.G.; Souza, C.F. Effects of treated wastewater irrigation on soil properties and lettuce yield. Agric. Water Manag. 2017, 181, 108–115. [Google Scholar] [CrossRef]
  66. Bouwer, H. Integrated water management: Emerging issues and challenges. Agric. Water Manag. 2000, 45, 217–228. [Google Scholar] [CrossRef]
  67. IPCC. Climate change 2014: Mitigation of climate change. In Contribution of Working Group III to the Fifth Assessment Report of the Intergovernmental Panel on Climate Change; Cambridge University Press: Cambridge, UK, 2014. [Google Scholar]
Figure 1. A model based on three combined artificial intelligence methods.
Figure 1. A model based on three combined artificial intelligence methods.
Agronomy 15 00703 g001
Figure 2. Verification of each parameter. R2: determination coefficient; Syx: standard deviation; d*: statistically significant at the 5% level (p < 0.05); **: statistically significant at the 1% level (p < 0.01).
Figure 2. Verification of each parameter. R2: determination coefficient; Syx: standard deviation; d*: statistically significant at the 5% level (p < 0.05); **: statistically significant at the 1% level (p < 0.01).
Agronomy 15 00703 g002
Figure 3. ANFIS rules with output membership function sets generated by the model (ag) refer to pH, EC, salinity, COD, total N, total P, and TSS, respectively.
Figure 3. ANFIS rules with output membership function sets generated by the model (ag) refer to pH, EC, salinity, COD, total N, total P, and TSS, respectively.
Agronomy 15 00703 g003
Figure 4. Performance of generated ANFIS model: Comparison of observed and predicted values.
Figure 4. Performance of generated ANFIS model: Comparison of observed and predicted values.
Agronomy 15 00703 g004
Figure 5. Performance of Fuzzy Logic: Best efficiency (the red line refers to the assigned value).
Figure 5. Performance of Fuzzy Logic: Best efficiency (the red line refers to the assigned value).
Agronomy 15 00703 g005
Figure 6. Performance of Fuzzy Logic: Low efficiency (the red line refers to the assigned value).
Figure 6. Performance of Fuzzy Logic: Low efficiency (the red line refers to the assigned value).
Agronomy 15 00703 g006
Figure 7. Three-dimensional representations for variables with concatenated rules.
Figure 7. Three-dimensional representations for variables with concatenated rules.
Agronomy 15 00703 g007
Table 1. Descriptive statistics of wastewater treatment plant inlet and outlet parameters.
Table 1. Descriptive statistics of wastewater treatment plant inlet and outlet parameters.
Parameters Statistical Data
RangesMeanSDSkewnessKurtosis95.0 % CIUnits
InletpH6.198.747.420.35−0.362.71(7.37, 7.47)-
EC998.001615.001107.9095.222.227.02(1094.3, 1121.5)μS/cm
Salinity0.320.810.520.071.113.92(0.51, 0.53)%
DO0.015.871.471.221.341.67(1.30, 1.64)mg/L
COD114.00368.00227.5057.220.59−0.20(219.3, 235.7)mg/L
Total N21.40169.0052.5725.371.332.18(48.94, 56.20)mg/L
NH412.6073.1037.4211.130.520.69(35.83, 39.01)mg/L
NO30.303.390.970.661.441.32(0.88, 1.06)mg/L
Total P1.7714.405.992.321.081.42(5.66, 6.32)mg/L
TSS10.00232.0082.7746.981.040.56(76.05, 89.49)mg/L
OutletpH6.179.527.380.361.119.39(7.33, 7.43)-
EC717.001143.00887.9781.180.680.40(876.37, 899.57)μS/cm
Salinity0.350.710.460.061.162.63(0.45, 0.47)%
COD14.20125.0057.0920.470.560.54(54.16, 60.02)mg/L
Total N4.2289.9024.4519.201.651.90(21.71, 27.19)mg/L
Total P0.288.952.242.111.351.03(1.94, 2.54)mg/L
TSS172.0019.0614.911.411.66(16.93, 21.19)mg/L
pH: Potential of hydrogen; EC: Electrical conductivity; COD: Chemical oxygen demand; DO: Dissolved oxygen; N: Nitrogen; NH4: Ammonium; NO3: Nitrate; P: Phosphorus; TSS: Total soluble solids; CI: Confidence interval.
Table 2. The weight of each independent variable obtained by the ReliefF algorithms.
Table 2. The weight of each independent variable obtained by the ReliefF algorithms.
Output
Parameters
Input Parameters
pHECSalinityDOCODTotal NTotal PTSSNH4NO3
pH0.038150.005050.004470.011420.008120.010410.001720.011760.003680.00170
EC0.003550.003210.073570.008750.010420.014760.000770.005260.007720.01075
Salinity0.002900.051630.010890.003200.009140.019360.000830.007510.005170.00054
COD0.009160.024050.011310.009160.027250.011380.000790.010200.001320.00649
Total N0.022910.026000.021180.008240.006810.051310.019280.008100.002450.00012
Total P0.008100.022900.026010.002450.021180.051310.006810.019280.008240.00012
TSS0.010790.012400.009160.002020.027160.009310.003680.015730.001250.00073
pH: Potential of hydrogen; EC: Electrical conductivity; DO: Dissolved oxygen; COD: Chemical oxygen demand; DO: Dissolved oxygen; N: Nitrogen; NH4: Ammonium; NO3: Nitrate; P: Phosphorus; TSS: Total soluble solids.
Table 3. Performance of first and selected scenarios based on ANNs for each output parameter.
Table 3. Performance of first and selected scenarios based on ANNs for each output parameter.
Output ScenariosInput ParametersTrain
(%)
Validation
(%)
Test
(%)
MSER2
pH1pH, TSS, DO, Total N, COD, EC, Salinity, NH4, Total P, NO3805150.012790.89
9pH, TSS7510150.011450.83
EC1Salinity, Total N, NO3, COD, DO, NH4, TSS, pH, EC, Total P80-2031.286460.97
9Salinity, Total N80-20107.306760.96
Salinity1EC, Total N, Salinity, COD, TSS, NH4, DO, pH, Total P, NO3805150.000060.96
6Conductivity, Total N, Salinity, COD, TSS85-150.000070.94
COD1COD, EC, Total N, Salinity, TSS, pH, DO, NO3, NH4, Total P8051540.140930.86
5COD, Conductivity, Total N, Salinity, TSS, pH8051556.557250.80
Total N1Total N, EC, pH, Salinity, Total P, DO, TSS, COD, NH4, NO385-151.829250.96
3Total N, EC, pH, Salinity, Total P, DO, TSS, COD85-159.839230.91
Total P1Total N, Salinity, EC, COD, TSS, NH4, pH, Total P, DO, NO3805150.325550.90
6Total N, Salinity, Conductivity, COD, TSS805150.679120.74
TSS1COD, TSS, EC, pH, Total N, Salinity, Total P, DO, NH4, NO37510155.253230.92
5COD, TSS, Conductivity, pH, Total N, Salinity75101533.698080.85
pH: Potential of hydrogen; EC: Electrical conductivity; COD: Chemical oxygen demand; DO: Dissolved oxygen; N: Nitrogen; NH4: Ammonium; NO3: Nitrate; P: Phosphorus; TSS: Total soluble solids; MSE: Mean square error; R2: Variance coefficient.
Table 4. Results of the ANFIS models for the categorized parameters.
Table 4. Results of the ANFIS models for the categorized parameters.
Input ParameterRank of Categorized
Parameters
Training (%)Testing (%)MF
Type
Number of MFsTraining RMSETesting RMSER2
pH6<≤6–8≥>88020Trapmf300.00030.99
010
EC<700≤700–900≥900>8020Trapmf30.00050.00070.97
10.50
Salinity<0.7≤0.7–1.5≥1.5>8020Trapmf3001
10.50
COD<50≤50–100≥100>8020Trapmf3001
10.50
Total N<7.5≤7.5–15≥15>8020Trapmf30.0900.0910.92
10.50
Total P<1≤1–2≥2>8020Trapmf30.0360.0360.96
10.50
TSS<15≤15–30≥30>8020Trapmf30.0450.0450.90
10.51
pH: Potential of hydrogen; EC: Electrical conductivity; COD: Chemical oxygen demand; N: Nitrogen; P: Phosphorus; TSS: Total soluble solids; RMSE: Root mean square error; MF: Membership function; R2: Variance coefficient.
Table 5. Irrigable area of crop to be irrigated by treated wastewater.
Table 5. Irrigable area of crop to be irrigated by treated wastewater.
CropsAreaArea of CentreProductionYieldTotal
ETc
Total
Reff
Cropping PatternGrowing DaysqIrrigable Area
(ha)(ha)(t)(t/ha)(mm)(mm)(%)(day)(L/s/ha)(ha)
Sunflower74,05117,661.1210,9302.85558188.833.61501.3784145
Maize10,7652431.5503,52546.77717231.84.91601.8115110
Canola370046.213,8753.75407391.21.72500.05893394
Rice21094.417,7458.41689231.81.01701.7069117
Clover1725500.033,18219.24777277.40.82101.8652107
Sugar Beat141252.067,33447.68736296.60.61901.6405122
Oat78734.427543.505241890.42601.2507160
Triticale982180.040414.125134930.42700.07462681
Chickpea888.41191.353571890.11200.6272319
Potato757.7153220.32555188.80.11501.3672146
Total95,69420,925.7 11.78117301
ETc: Crop evapotranspiration; Reff: Effective rainfall; q: Irrigation modules.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Köksal, D.D.; Ahi, Y.; Todorovic, M. Assessing Agricultural Reuse Potential of Treated Wastewater: A Hybrid Machine Learning Approach. Agronomy 2025, 15, 703. https://doi.org/10.3390/agronomy15030703

AMA Style

Köksal DD, Ahi Y, Todorovic M. Assessing Agricultural Reuse Potential of Treated Wastewater: A Hybrid Machine Learning Approach. Agronomy. 2025; 15(3):703. https://doi.org/10.3390/agronomy15030703

Chicago/Turabian Style

Köksal, Daniyal Durmuş, Yeşim Ahi, and Mladen Todorovic. 2025. "Assessing Agricultural Reuse Potential of Treated Wastewater: A Hybrid Machine Learning Approach" Agronomy 15, no. 3: 703. https://doi.org/10.3390/agronomy15030703

APA Style

Köksal, D. D., Ahi, Y., & Todorovic, M. (2025). Assessing Agricultural Reuse Potential of Treated Wastewater: A Hybrid Machine Learning Approach. Agronomy, 15(3), 703. https://doi.org/10.3390/agronomy15030703

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop