Evaluation and Prediction of Groundwater Quality for Irrigation Using an Integrated Water Quality Indices, Machine Learning Models and GIS Approaches: A Representative Case Study

: Agriculture has signiﬁcantly aided in meeting the food needs of growing population. In addition, it has boosted economic development in irrigated regions. In this study, an assessment of the groundwater (GW) quality for agricultural land was carried out in El Kharga Oasis, Western Desert of Egypt. Several irrigation water quality indices (IWQIs) and geographic information systems (GIS) were used for the modeling development. Two machine learning (ML


Introduction
The Nubian sandstone aquifer is located within the eastern Sahara desert, which is considered one of the world's largest fossil GW reservoirs. It is shared by Egypt, Libya, Sudan, and Chad and covers an area of more than 2 × 10 6 km 2 . GW is critical to Egypt's economic growth and long-term development, particularly in desert areas [1]. The estimated water storage in the Egyptian side of the aquifer is approximately 40,000 × 10 9 m 3 , but this is nonrenewable due to the negligible GW recharge in the Western Desert [1,2]. The Western Desert's largest oasis was the first to start utilizing Egypt's Nubian sandstone aquifer on a massive basis, and it is anticipated that the amount of GW extracted will be approximately 2.8 × 10 9 m 3 /y by 2020 [1]. GW is the unique resource of the water needed for irrigation and residential usage in El Kharga Oasis. Before 1960, springs and freely flowing shallow wells were used to draw GW for extensive irrigation. Since then, GW use has continuously grown, leading to GW level depletion, necessitating the construction of deeper wells. Because the GW resources in El Kharga Oasis have substantially decreased, proper GW extraction management is strongly advised [3]. Furthermore, a challenge for sustainable GW resource management is the lack of the hydrogeological data required to estimate GW flow and predict the impacts of GW abstraction [3][4][5].
GW is an important water resource for a country's socioeconomic development. Agriculture, on the other hand, is the world's largest GW consumer [1]. Irrigation water supply is the essential factor influencing agricultural output growth in arid and semi-arid countries, influencing both sustainable crop productivity and irrigated area expansion. These water resources are threatened by a number of issues, including the effects of environmental issues, human interventions, and natural occurrences [2,6]. Generally, these factors deteriorate the chemical and physical compositions of GW, rendering it unfit for agricultural use.
GW chemistry studies have been widely applied to evaluate water quality. As a result, the physicochemical elements in irrigation water could have negative impacts on crop productivity and soil depletion [7]. Throughout many hydrochemical investigations, the various water quality indicators have also been compared to established values to assess the GW quality. This assessment does not provide decision makers with immediate information and a comprehensive description of the GW quality, especially when multiple water quality degraders are observed. Application programming interfaces, such as the United States Salinity Laboratory (USSL), Doneen, and Wilcox plots, have aided in determining GW suitability for irrigation water [8][9][10][11][12][13][14][15]. In addition, IWQIs are derived from the chemical composition of water, which are considered effective methods for evaluating the suitability of water by combining multiple water key indicators into a single value, which is intended to assist decision makers in water quality management [16][17][18][19][20][21][22]. The IWQIs for agricultural purposes are typically assessed using various indices and variables in accordance with Food and Agriculture Organization (FAO) guidelines [23]. The IWQI, KI, SAR, SSP, PS, and RSC are all commonly used to classify GW irrigation suitability, which aids in defining the infiltration capacity of the rock formation [11,[24][25][26]. Numerous studies have been conducted worldwide to evaluate the suitability of GW for agricultural purposes by implementing IWQIs and GIS technology, which allow for the separation of quality zones for irrigation by producing GW quality maps [27][28][29][30][31][32][33].
For agricultural production, traditional methods for assessing the quality of irrigation water are frequently expensive and time consuming. This problem can be solved by evaluating and forecasting IWQIs with respect to the physicochemical parameters using ML implementations, such as ANFIS and SVM. In addition, long-term GW management strategies demand the development of fresh, affordable technologies for analyzing and forecasting GW quality. It is essential for secure environmental management to handle this issue through the prediction of water quality indicators. Consequently, a number of deterministic models have been applied in this field recently [13,[34][35][36][37].
In water quality modeling, there are typically a number of characteristics that are either very expensive to measure or cannot be measured at all [38]. With regard to waterrelated issues, a considerable increase has been achieved in the development and use of ML tools. Examples of these tools include ML models. Without knowing the physical behavior explicitly, ML is based on the analysis of data describing the system by mimicking the inter-relationship between the input and output parameters [39]. Traditional models, such as statistical modeling (e.g., ARMA-ARIMA and seasonal ARMA) or ML modeling, such as artificial neural networks (ANNs) and SVM, are examples of ML simulation models [40,41]. The most effective ML models are ANN models, which are often used because of their high predicted accuracy and adaptability [34,35]. The literature reports that ANN models have been effectively used to address a number of challenges in water management [42]. This is because complicated hydrological data and nonlinear functions may be correctly simulated and estimated by these types of models. ANNs have been successfully utilized for forecasting rivers inflows, with a fair level of competence [34,37,38]. Another extensively used ML approach is the SVM model, which is frequently used in modeling hydrology datasets [33,[39][40][41]. The SVM model is a technique for reducing the complexity of dynamic systems, modeling nonlinear behaviors, and collecting the information required for making pertinent decisions with a respectable level of accuracy [42]. There are several studies conducted in the study area that focused on the monitoring of the water level, measuring hydraulic parameters, assessing the health risk from the drinking water, and determining the soil quality deterioration with time. For this reason, El Kharga Oasis requires regular monitoring and assessment of the irrigation water quality to investigate how the rapid drawdown of the water level, the geological composition, and anthropogenic activities could affect the irrigation water quality, which affects the quality of the soil as well as crop production, in order to provide recommendations for the sustainable management of water resources in the study area according to the IWQIs [6,43,44].
The major objectives of this work were to (i) define the GW chemistry, GW categories, and their geochemical controlling processes employing physicochemical metrics and imitative techniques; (ii) evaluate the GW's appropriateness for agricultural purposes utilizing various IWQIs; (iii) investigate the performance of ANFIS and SVM models in the reliable prediction of IWQIs, such as IWQI, SAR, SSP, KI, PS, and RSC.

Site Description and Hydrogeological Settings
El Kharga Oasis is a geomorphologic valley inside the south of the Western Desert ( Figure 1). The depression is situated along an anticline with a major axis that stretches north to south and is associated with the fault zones and an elevation ranges from 0 to 120 m [45]. El Kharga Oasis is among the extremely dry regions of the Eastern Sahara, if not the driest place on the planet [46]. The summer seasons are extremely hot, with maximum daily temperatures exceeding 40 degrees Celsius, but winters are mild, with temperatures dropping below zero in the evening. The rainfall is relatively low, averaging  [47,48]. El Kharga Oasis is a farming community with roughly 11,400 ha of agricultural land, with date palm being the major cash crop in addition to the olive and other fruits [49]. Groundwater is pumped to the surface by 1100 producer shallow wells with an overall abstraction of 8.3 × 10 6 m 3 /y and approximately 300 governmental wells with 198.1 × 10 6 m 3 /y. The wells' locations vary across the considered site, but they are mainly concentrated around main sites, primarily El Kharga, Ghormachine, Paris, and Darb Elarbien [1].
north to south and is associated with the fault zones and an elevation ranges from m [45]. El Kharga Oasis is among the extremely dry regions of the Eastern Sahar the driest place on the planet [46]. The summer seasons are extremely hot, with ma daily temperatures exceeding 40 degrees Celsius, but winters are mild, with temp dropping below zero in the evening. The rainfall is relatively low, averaging <1 though torrential storms do occur on occasion [47,48]. El Kharga Oasis is a farmi munity with roughly 11,400 ha of agricultural land, with date palm being the ma crop in addition to the olive and other fruits [49]. Groundwater is pumped to the by 1100 producer shallow wells with an overall abstraction of 8.3 × 10 6 m 3 /y and a mately 300 governmental wells with 198.1 × 10 6 m 3 /y. The wells' locations vary ac considered site, but they are mainly concentrated around main sites, primarily El Ghormachine, Paris, and Darb Elarbien [1]. This study chose the dry land area of El Kharga Oasis to verify the interaction hydrogeochemical condition and agriculture systems on the hydrochemical chang GW. The research area is situated between the longitudes 30°10′ and 30°48′ E and l 24°0′ and 25°48′ N (Table S1). The production wells were established for sus This study chose the dry land area of El Kharga Oasis to verify the interactions of the hydrogeochemical condition and agriculture systems on the hydrochemical change of the GW. The research area is situated between the longitudes 30 • 10 and 30 • 48 E and latitudes 24 • 0 and 25 • 48 N (Table S1). The production wells were established for sustainable agriculture and drinkable water use. Upper Cretaceous sediments (the Quseir Formation) underpin a large portion of the study region, particularly in the east, while only the northeast has outcrops of Tertiary deposits (marly and chalky limestones). Quaternary formations (sand dunes and sabkha sediments) with thicknesses ranging from 2 to 10 m are found in the western part of the region. Furthermore, Precambrian basement rocks (granites) are exposed in the southeast part of the study area.
The New Valley project is regarded as one of Egypt's significant programs in agriculture development, relying on GW withdrawal from the NSSA. The investigated aquifer represents a relatively small zone from the broad Nubian Aquifer System (NAS), which spans four countries and cover a wide land area (Egypt, Sudan, Libya, and Chad) [50][51][52].
In the study region, the regional direction of the GW flow is a northerly to northeasterly direction ( Figure 2). Furthermore, several GW flow directions were recorded. The GW flow direction in the northern part of the study region comes from the southwest to east direction, while from the west to east direction in the central region. Another local GW flow direction from south to northeast was observed in the southern part of the studied area. Large decreases in the GW heads were recorded in some areas due to the effect of over pumping and rapid drawdown. The study area's severe hydraulic gradients are most likely caused by the region's high GW abstraction rates, the Nubian aquifer's comparatively thin saturation thickness, and the sediments' low hydraulic conductivity [53,54]. The GW is an under unconfined condition in the Baris Oasis and south area of NAS, while it is an under confined system in El Kharga Oasis ( Figure 2). Therefore, the potentiality of the northern parts is less than the northern parts. Excessive GW utilization in these areas might result in significant reductions in the aquifer potentiometric head and the water quality deteriorating. The correlation between the different stratigraphic logs from north to south across El Kharga Oasis showed that the NSSA is located above basement rocks and overly by shale layer. The aquifer thickness increases gradually from the north to south direction of the study area. The NSSA is divided to several layers separated from each other by thin layer of shale, which could be connected through the fault plain ( Figure 2). agriculture and drinkable water use. Upper Cretaceous sediments (the Quseir Formation) underpin a large portion of the study region, particularly in the east, while only the northeast has outcrops of Tertiary deposits (marly and chalky limestones). Quaternary formations (sand dunes and sabkha sediments) with thicknesses ranging from 2 to 10 m are found in the western part of the region. Furthermore, Precambrian basement rocks (granites) are exposed in the southeast part of the study area.
The New Valley project is regarded as one of Egypt's significant programs in agriculture development, relying on GW withdrawal from the NSSA. The investigated aquifer represents a relatively small zone from the broad Nubian Aquifer System (NAS), which spans four countries and cover a wide land area (Egypt, Sudan, Libya, and Chad) [50][51][52].
In the study region, the regional direction of the GW flow is a northerly to northeasterly direction ( Figure 2). Furthermore, several GW flow directions were recorded. The GW flow direction in the northern part of the study region comes from the southwest to east direction, while from the west to east direction in the central region. Another local GW flow direction from south to northeast was observed in the southern part of the studied area. Large decreases in the GW heads were recorded in some areas due to the effect of over pumping and rapid drawdown. The study area's severe hydraulic gradients are most likely caused by the region's high GW abstraction rates, the Nubian aquifer's comparatively thin saturation thickness, and the sediments' low hydraulic conductivity [53,54]. The GW is an under unconfined condition in the Baris Oasis and south area of NAS, while it is an under confined system in El Kharga Oasis ( Figure 2). Therefore, the potentiality of the northern parts is less than the northern parts. Excessive GW utilization in these areas might result in significant reductions in the aquifer potentiometric head and the water quality deteriorating. The correlation between the different stratigraphic logs from north to south across El Kharga Oasis showed that the NSSA is located above basement rocks and overly by shale layer. The aquifer thickness increases gradually from the north to south direction of the study area. The NSSA is divided to several layers separated from each other by thin layer of shale, which could be connected through the fault plain ( Figure  2).

Sampling and Analysis
The GW samples were collected in July 2020 from 140 production wells with depths of GW varying from 8 to 75 m (Table S1), penetrating the Nubian sandstone aquifer. The temperature, pH, EC, and TDS parameters, as well as ground surface elevation, were measured on site. A mobile multimeter was used to monitor the EC and pH (HI 9829 type). After filtration, each sample was taken in polyethylene bottles to investigate chemical parameters, such as Ca 2+ , Mg 2+ , Na + , K + , Cl − , HCO 3 − , CO 3 2− , and SO 4 2− . SO 4 2− and Cl − were analyzed using a spectrophotometer HACH (DR2000 type); however, a flame spectrophotometer was used to monitor K + , Ca + , and Na + . Mg 2+ was analyzed using the complexometric method, and the titrimetric approach was used to measure CO 3 2− and HCO 3 − . According to Equation (1), the charge-balance error (CBE) with a limit of 5% was used to crosscheck the analytic errors of the measured ions concentrations in meq/L −1 [55].
The analytical procedures were verified in terms of quality control by carrying out adequate devices calibrations and evaluating the precision of each sample that was being examined.

Irrigation Water Quality Indices (IWQIs)
The calculations of the IWQIs were performed using the equations presented in Table 1.  [59] Note: All indices are calculated in meq/L, except IWQI in mg/L.

Irrigation Water Quality Index (IWQI)
The IWQI, which is a dimensionless index, has a limit between 0 and 100, and it is calculated using several parameters, including EC, SAR, Na + , Cl − , and HCO 3 2− [60,61], as follows in Equations (2) and (3): Q i is a metric for measuring the quality based on the tolerance limits, and W i is the predefined weight of the parameters ( Table 2).
where X ij is the measured values of the parameters, X inf is the value that refers to the lower limits of the classes, Q imap is the classes amplitudes, and X amp is the classes amplitudes which involve the considered parameter. Finally, W i is obtained as follows: where F is the auto record of element j, A is the mostly limited of parameter i by factor j, i is the number of the selected physicochemical parameters (1 ≤ i ≤ n), and j is the number of the selected factors (1 ≤ j ≤ k. ij). Table 2. Upper and lower limits of the parameters used in the quality evaluation (Q i ).

Simulation Models
Support Vector Machine (SVM) Model SVM is a well-known ML approach that is dependent on mathematical learning theory. It is useful for classifying large amounts of data, identifying features, and performing regression analyses [62]. From the datasets (x, y) provided, SVR sought to create functions where x is the input parameter and y is the output parameter of the "IWQIs".
Equation (5) presents the regression description of the SVM function: where f (x) indicates the output of the SVM, and ϕ(x) indicates a nonlinear mapping function. The weighting array ω and bias factor b, correspondingly, are to be adjusted utilizing the following regularized functions: where C represents the adjustment value needed for the stability component and the normalization component 2 . ξ i and ξ * i are the positive slack variables. Based on Lagrange multipliers, the SVR model is determined by: In this case, the kernel function is K x i , x j , and the positive Lagrange multipliers are a i and a * i , accordingly. The parameters of the SVM are eventually defined after obtaining the desired outcome for the objective function; thus, the following regression formula is used to represent an input vector x.

Adaptive Neuro-Fuzzy Inference System
The ANFIS modeling combines the advantages of FIS with deep learning models [14]. The ANFIS model is hypothesized using various output-input data, and the backpropagation process is then used to update the model's membership criteria. The relationships between the IWQIs and the water quality parameters were derived herein using ANFIS, and they were described as if-then fuzzy rules ( Figure 3). The ANFIS models involved the Sugeno-type FIS of bell input membership functions, with 5 functions for the 9 inputs; however, the outputs had linear memberships functions. Figure 4 illustrates an ANFIS model that has a multilayer feed-forward architecture.
The ANFIS model is hypothesized using various output-input data, and the backpropagation process is then used to update the model's membership criteria. The relationships between the IWQIs and the water quality parameters were derived herein using ANFIS, and they were described as if-then fuzzy rules (Figure 3). The ANFIS models involved the Sugeno-type FIS of bell input membership functions, with 5 functions for the 9 inputs; however, the outputs had linear memberships functions. Figure 4 illustrates an ANFIS model that has a multilayer feed-forward architecture. Figure 5 illustrates the ANFIS model, which has an incoherent x and y input network and a multilayer feed-forward architecture. The rule foundation for the Sugeno model ( Figure 4) is as follows: where A and B are the memberships orders of magnitude, a and b indicate indirect identifying function. p, q, and r are relevant constraints modified in the training algorithm's forward pass, and fi is the output falling inside the inconsistent region determined by the FIS concept. Figure 5 illustrates the five layers that comprise ANFIS where the memberships function of the fuzzy set A and B are and , respectively. Further information regarding ANFIS is provided in Khadr [63].    . The structure of the adaptive neuro-fuzzy inference system model. Figure 4. The structure of the adaptive neuro-fuzzy inference system model. Figure 5 illustrates the ANFIS model, which has an incoherent x and y input network and a multilayer feed-forward architecture. The rule foundation for the Sugeno model ( Figure 4) is as follows: where A and B are the memberships orders of magnitude, a and b indicate indirect identifying function. p, q, and r are relevant constraints modified in the training algorithm's forward pass, and fi is the output falling inside the inconsistent region determined by the FIS concept. Figure 5 illustrates the five layers that comprise ANFIS where the memberships function of the fuzzy set A and B are µA i and µB i , respectively. Further information regarding ANFIS is provided in Khadr [63].

Performance Evaluation of the Simulation Models
The performance of the ANFIS and SVM models in predicting the IWQIs was evaluated using the following statistical measures: (a) Nash-Sutcliffe efficiency coefficient (NSE): (b) The mean absolute error (MAD):

Performance Evaluation of the Simulation Models
The performance of the ANFIS and SVM models in predicting the IWQIs was evaluated using the following statistical measures: (a) Nash-Sutcliffe efficiency coefficient (NSE): (b) The mean absolute error (MAD): (c) The absolute variance fraction, R 2 : (d) The root mean square error (RMSE): where n defines the number of data observations, IW o presents the observed data, IW f presents the predicated data, and IW signifies the average data values.
In this investigation, EC, K + , Na + , Ca 2+ , Mg 2+ , Cl − , SO 4 2− , and HCO 3 − were found to be relatively the most influential parameters to forecast the IWQIs. The model architecture used in the ML algorithms is presented in Figure 6.
(c) The absolute variance fraction, R 2 : (d) The root mean square error (RMSE): where n defines the number of data observations, o presents the observed data, IWf presents the predicated data, and signifies the average data values. In this investigation, EC, K + , Na + , Ca 2+ , Mg 2+ , Cl − , SO4 2− , and HCO3 − were found to be relatively the most influential parameters to forecast the IWQIs. The model architecture used in the ML algorithms is presented in Figure 6.

Physicochemical Parameters of the Groundwater
The subsequent GW classification was performed using physicochemical factors suitabile for irrigation purposes in the NSSA, including T °C, pH, EC, TDS, K + , Na + , Mg 2+ , Ca 2+ , Cl − , SO4 2− , HCO3 − , and CO3 2− , which are affecting soil quality and crops productivity. Table  3 shows the statistical properties of the physical and the chemical parameters for 140 GW samples.

Physicochemical Parameters of the Groundwater
The subsequent GW classification was performed using physicochemical factors suitabile for irrigation purposes in the NSSA, including T • C, pH, EC, TDS, K + , Na + , Mg 2+ , Ca 2+ , Cl − , SO 4 2− , HCO 3 − , and CO 3 2− , which are affecting soil quality and crops productivity. Table 3 shows the statistical properties of the physical and the chemical parameters for 140 GW samples. In accordance with the FAO [23], the max. and min. values were calculated based on statistical evaluations of the water quality. The highest value of the electrical conductivity was 2610 S/cm, which fell below FAO limits (3000 µS/cm). The maximum TDS value was 1870 mg/L, which is within the standard limitations [23]. According to [64], the GW in the actual area of the research ranges from fresh to brackish. The values of pH ranged from 6.1 to 8.1, which is within the acceptable limits based on the irrigation water standard [31].

Groundwater Facies and Controlling Geochemical Processes
For the categorization of the GW hydrochemical facies, a piper plot was established (Figure 7a) [65]. The cationic triangle showed that approximately 82.14% of the total water samples were Na + and K + dominant, while approximately 17.14% were nondominant, and the rest of samples were Mg 2+ dominant. The water samples were divided into five hydrochemical facies based on the presentation of the pipe plot (Figure 7a). One sample fell within the Ca-Mg-SO 4 facies zone (Type 1) with permanent hardness. Approximately 88 samples belonged to the Na-Cl facies (type 2), while five samples belong to the Ca-Mg-HCO 3 facies zone (Type 3), and 15 samples belonged to the mixed Na-Ca-HCO 3 facies zone (Type 4). The rest were in the mixed Ca-Mg-Cl-SO 4 zone (type 5). The majority of the selected samples revealed that the salinity indices (SO 4 2− + Cl − ) were generally higher than the alkalinity (HCO 3 − + CO 3 2− ), and the alkalis (Na + + K + ) were higher than the alkaline earths (Ca 2+ + Mg 2+ ), as the overarching factor dictating the NSSA's hydrochemistry in this region.
The primary dominating geochemical processes controlling the water chemistry was further confirmed using the Chadha diagram, as shown in Figure 7b [66]. According to Chadha diagram, most samples (71.43%) were located in the region of the Na-Cl type, which indicates the dissolution of halite minerals as a significant factor in the GW chemistry. Approximately 14.28% fell in the reverse ion exchange zone (Ca-Mg-Cl/SO 4 ), while 10.72% of the water samples located within the base ion exchange zone (Na-HCO 3 ). The rest of samples 3.57% fell within the recharge water zone (Ca-Mg-HCO 3 ). It is worth noting that the evolution of GW quality and its appropriateness for irrigation water use depends on the control mechanism and geochemical processes. The chemical characteristics of the analyzed GW samples showed Ca-Mg-HCO 3 and Na-HCO 3 water types, which reflects the meteoric/initial water stages in the recharge areas, while the Ca-Mg-Cl/SO 4 water type reflected the intermediate water stages of evolution, especially in the northern and central parts of the study area. Moreover, the majority of samples fell in the Na-Cl water type, indicating last stage of geochemical evolution in the discharge areas, especially in southern parts of the study area with the direction of GW flow. These findings could confirm previous work in the study area through the application of the geochemical modeling to detect the mineral saturation state [53].
Water 2023, 14, x FOR PEER REVIEW 12 of 26 type reflected the intermediate water stages of evolution, especially in the northern and central parts of the study area. Moreover, the majority of samples fell in the Na-Cl water type, indicating last stage of geochemical evolution in the discharge areas, especially in southern parts of the study area with the direction of GW flow. These findings could confirm previous work in the study area through the application of the geochemical modeling to detect the mineral saturation state [53]. The Durov graph may be used to demonstrate three primary processes: ion exchange, mixing/dissolution, and reverse ion exchange (Figure 8). The majority of the samples were located within the mixing/dissolution zone, while the rest fell between the ion exchange and reverse ion exchange zones, confirming the previous statistical explanation.  The Durov graph may be used to demonstrate three primary processes: ion exchange, mixing/dissolution, and reverse ion exchange (Figure 8). The majority of the samples were located within the mixing/dissolution zone, while the rest fell between the ion exchange and reverse ion exchange zones, confirming the previous statistical explanation.
type reflected the intermediate water stages of evolution, especially in the northern and central parts of the study area. Moreover, the majority of samples fell in the Na-Cl water type, indicating last stage of geochemical evolution in the discharge areas, especially in southern parts of the study area with the direction of GW flow. These findings could con firm previous work in the study area through the application of the geochemical modeling to detect the mineral saturation state [53]. The Durov graph may be used to demonstrate three primary processes: ion exchange mixing/dissolution, and reverse ion exchange (Figure 8). The majority of the samples were located within the mixing/dissolution zone, while the rest fell between the ion exchange and reverse ion exchange zones, confirming the previous statistical explanation.  The tatistical analysis was utilized to demonstrate the primary mechanisms governing the GW chemistry in the research region by utilizing the correlations and ratios between the various major ions (Figure 9). Utilizing the link between the EC and Na + /Cl − ratio, the influence of the dissolution and evaporation processes in the research region could be explained [67]. The ratio of Na + /Cl − had an almost constant trend line with the increase in the electrical conductivity owing to halite dissolution; in addition, the samples above and below the 1:1 line indicate direct ion exchange and reverse ion exchange, respectively (Figure 9a). To validate the role of dissolution, direct ion exchange, and reverse ion exchange as key features in the water chemistry of El Kharga Oasis, several ionic plots and a Chadha diagram were used. The tatistical analysis was utilized to demonstrate the primary mechanisms governing the GW chemistry in the research region by utilizing the correlations and ratios between the various major ions (Figure 9). Utilizing the link between the EC and Na + /Cl − ratio, the influence of the dissolution and evaporation processes in the research region could be explained [67]. The ratio of Na + /Cl − had an almost constant trend line with the increase in the electrical conductivity owing to halite dissolution; in addition, the samples above and below the 1:1 line indicate direct ion exchange and reverse ion exchange, respectively (Figure 9a). To validate the role of dissolution, direct ion exchange, and reverse ion exchange as key features in the water chemistry of El Kharga Oasis, several ionic plots and a Chadha diagram were used.  The linear correlations between Na + and Clillustrate that these two ions were in balance, and the majority of the water samples were close to the 1:1 line graph, with the same R 2 = 0.96% because of a similar source, such as halite dissolution (Figure 9b). The influences of halite dissolution, particularly in the unsaturated zone, are characteristic of arid and semi-arid areas that have average annual rainfalls below 600 mm [68,69]. The samples that were found below the 1:1 line graph may have had their chloride levels enriched as a sign of an additional source of chloride ions, or they may have had their sodium levels reduced by eliminating Na + from the GW. The surplus irrigation water from agricultural land and trash disposal are two anthropogenic activities that may be to blame for the high chloride content [70,71] or atmospheric deposition of chloride [72]. The Na + /Cl − ratio in some samples was higher than 1, indicating silicate weathering or ion exchange [73]. The relationship between Na + + K + and Ca 2+ + Mg 2+ (Figure 9c) showed a significant amount of the water samples near the 1:1 line as an indication of the minerals' dissolution and few samples above the line because of reverse ion exchange. The dominance of Na + and K + over Ca 2+ and Mg 2+ in most of the water samples reveals that Ca 2+ and Mg 2+ ions were replaced by Na + and K + ions through the ion exchange process and silicate weathering [74]. Few of the GW samples exceeded the 1:1 line, indicating the reverse ion exchange process, according to a linear graph (Figure 9d) plotting the sum of Ca 2+ and Mg 2+ ions vs. the sum of HCO 3 − and SO 4 2− . Because of the breakdown of gypsum, calcite, and dolomite, the samples crossed the 1:1 line. The relative increase in the number of SO 4 2− + HCO 3 − ions compared to Ca 2+ + Mg 2+ ions resulted from silicate weathering [75], which appears clearly in the ratio of Na/Cl, where the water was enriched in Na + more than Cl − .
The proportion of Ca 2+ + Mg 2+ to HCO 3 − could be utilized to determine the source of calcium and magnesium in the samples (Figure 9e). If the ratio is near 0.5, this indicates that the weathering of carbonate and silicate minerals produced the Ca 2+ + Mg 2+ [76]. If the ratio is less than 0.5, the major cause of the depletion of calcium and magnesium may be ion exchange or bicarbonates enrichment. Most of the water samples had a very high Ca 2+ + Mg 2+ /HCO 3 − ratio that was greater than 0.5, while only a few samples had a ratio that was close to 0.5. Therefore, different hydrochemical processes in addition to the sole dissolution of carbonates (calcite and dolomite) should have an impact on the high levels of Ca 2+ and Mg 2+ . Since the water was in a moderately alkaline condition and the depletion of HCO 3 -(carbonic acid) was not considered to be a contributing factor to the majority of samples falling significantly over the 1:1 line (ratio = 0.5), silicate weathering and/or reverse ion exchange were the main causes [77]. The Ca 2+ + Mg 2+ /HCO 3 − ratio can be used to identify the meteoric nature and the fresh GW recharge. When this ratio is lower than 1, this indicates that the water is meteoric and that GW recharge existed [78]. In the study area, 15% of the GW samples had a ratio less than 1, referring to the meteoric nature and presence of recharge, while 85% of the samples had a value greater than 1, relating to the lack of meteorological activity and GW recharge. The relationship between Na + /Cl − and Cl − (Figure 9f) reveals a reversible link showing that the clay minerals in the aquifer's clay replaced the sodium that was released when the halite disintegrated with calcium and magnesium [75]. The results of the ionic ratio interpretation confirmed with the same findings of the previous study that was conducted by El Osta et al. [53].

Water Quality Indices for Agricultural Purposes
Due to the fact that agricultural practices, soil types, and water quality all impact the most appropriate irrigation techniques [79,80], a number of indices were used herein in order to monitor the water quality suitability for agriculture, including the irrigationspecific IWQI, SAR, SSP, KI, PS, and RSC. These procedures highlight the possibility of soil salinization, as well as negatively the impact of irrigation on soil and plant health. The data from the IWQIs were statistically analyzed, and the water's suitability for agriculture was determined (Tables 4 and 5).

Irrigation Water Quality Index (IWQI)
A comprehensive assessment of GW quality in regard to the irrigation systems were performed utilizing IWQIs. The process of GW evaluation is conducted by utilizing either individual chemical indices [81,82] or a combination of numerous indices [60,83] to evaluate the GW for irrigation purposes using IWQIs. Although GW assessment for irrigation based on individual parameters is important, combined indices provide more valuable information for decision makers. Five hazards' groups were used for the evaluation of the safety of the GW for irrigation purposes [84]. The IWQI values varied from 29.61 to 99.50, with an average of 80.34 (Table 4). According to the IWQI values for the study area, the majority of investigated samples (67.85%) were classified as no restriction range, which prevents crops that tolerate salinity, while approximately 12.84% of the investigated samples were classified from low to moderate restriction, and approximately 19.28% of the samples were classified from high to severe restriction for irrigation, which can be used to irrigate crops that are moderately to severely salt sensitive in loose soil without compacted layers ( Table 5).
The overall index map (Figure 10a) is helpful for validating GW for irrigation, since it shows how suitable water is for irrigation based on physical and chemical criteria. According to the IWQI readings, there was a decline in the water quality in the southern regions of the study area as a result of anthropogenic activities and geogenic sources.

Sodium Adsorption Ratio (SAR)
In irrigation water, the term "SAR parameter" refers to the soil matrix's capability to release Ca 2+ and Mg 2+ and absorb Na + ions at the locations of ion exchange, which spreads soil particles and reduces infiltration capacities [85,86]. Highly saline water can be beneficial for the soil structure by accelerating infiltration, but it puts plants under higher water stress to draw water from the soil in the case that the irrigation water has a high salinity, and plants and crops must expend more energy (water stress condition). The USSL diagram categorizes and demonstrates the relation between SAR and EC ( Figure 11) [54]. Most of the samples fell between C2-S1 and C3-S1 (low SAR and medium to high salinity), 20 samples belonged to C3-S2 class (high salinity and medium SAR), 5 samples of NSSA fell in the C4-S2 class (very high salinity and medium SAR), and only 1 sample was in the C1-S1 class (low salinity and low SAR). The maximum value of SAR, for all of the investigated samples, was less than 10, indicating an excellent class for irrigation (Figure 10b).  and plants and crops must expend more energy (water stress condition). The USSL diagram categorizes and demonstrates the relation between SAR and EC ( Figure 11) [54]. Most of the samples fell between C2-S1 and C3-S1 (low SAR and medium to high salinity), 20 samples belonged to C3-S2 class (high salinity and medium SAR), 5 samples of NSSA fell in the C4-S2 class (very high salinity and medium SAR), and only 1 sample was in the C1-S1 class (low salinity and low SAR). The maximum value of SAR, for all of the investigated samples, was less than 10, indicating an excellent class for irrigation (Figure 10b). The results present that the excessive salinity of the irrigation water will negatively impact plants, although the low to medium SAR values ( Figure 11) and the absence of calcium conditions have no effect on the soil infiltration capacity. The best strategy for managing the use of GW for irrigation in the degraded region is to choose plants and crops that can resist the water's high salinity.

Soluble Sodium Percentage (SSP)
The SSP was used to determine salinity through a comparison between the Mg concentration and the ratio of the sodium to calcium concentrations. A high-level sodium concentration in water compared to calcium and Mg causes harmful substances, which are responsible for deteriorated leaves and dead plant tissues [87]. The SSP values ranged from 3.80 to 66.39 with an average value of 48.54. According to the SSP results, 83.57% of the GW samples fell within the safe category for irrigation, and 16.42% belonged to the unsafe category (Figure 10c). The results present that the excessive salinity of the irrigation water will negatively impact plants, although the low to medium SAR values ( Figure 11) and the absence of calcium conditions have no effect on the soil infiltration capacity. The best strategy for managing the use of GW for irrigation in the degraded region is to choose plants and crops that can resist the water's high salinity.

Soluble Sodium Percentage (SSP)
The SSP was used to determine salinity through a comparison between the Mg concentration and the ratio of the sodium to calcium concentrations. A high-level sodium concentration in water compared to calcium and Mg causes harmful substances, which are responsible for deteriorated leaves and dead plant tissues [87]. The SSP values ranged from 3.80 to 66.39 with an average value of 48.54. According to the SSP results, 83.57% of the GW samples fell within the safe category for irrigation, and 16.42% belonged to the unsafe category (Figure 10c).

Potential Salinity (PS)
The concentration of chloride ions and half of the sulfate concentration are important parameters to assess the suitability of GW for irrigation through the potential salinity index. PS values are generally divided into two categories: unsuitable if greater than three (>3) and suitable (<3) for irrigation [58]. The PS ranged from −0.85 to 12.11, with a mean of 3.41. Based on the PS values, 92 samples fell within the excellent to good category, while the remaining belonged to the good to injurious class (Figure 10d).

Kelley Index (KI)
The Kelley index was calculated to evaluate the suitability of GW for irrigation use, where it was revealed an excess of sodium ions in the water [88]. The KI value varied between 0.08 and 0.62, with an average of 0.25. According to the KI results obtained, 57.85% of the GW samples were categorized as suitable (good class) for irrigation and the rest as not suitable (unsuitable class) ( Table 3). A KI value greater than one (KI > 1) reveals that there is an excess of sodium in the water, while a value less than one (KI < 1) demonstrates that the water is suitable for irrigation [57,89]. The unsuitable GW samples were distributed in the southern parts of the study area (Figure 10e).

Residual Sodium Carbonate (RSC)
An excess of carbonate and bicarbonate concentration levels in relation to calcium and magnesium ions is one popular method for irrigation water determination. By precipitating, alkali metals can lower the quality of the irrigation water, primarily Ca 2+ and Mg 2+ . The Ca 2+ and Mg 2+ precipitations as carbonate minerals could increase the Na + concentration levels and, thus, the SAR values [59]. The soil physical properties can be deteriorated with the high magnitude of the RSC causing the dissociation of organic matter. This leads to a black stain on the soil surface when it is dry [24,90]. The RSC was computed in order to predict the possibility of calcium and magnesium precipitating on soil surface particles and their removal from the soil solution. According to reports, RSC levels in GW are high in dry and semi-arid areas, which results in soil salinization and sodification [91]. Using the RSC value, the GW was divided into three types [91]. Water for irrigation with an RSC less than 1.25 and between 1.25 and 2.5 is acceptable, while water with an RSC greater than 2.5 is not acceptable. In the current investigation, 134 water samples had an RSC value of less than 1.25, indicating that the water was acceptable for irrigation and of good and safe quality. Three samples were in the borderline class, while the other samples were in the unsuitable class (Figure 10f).
According to the IWQIs' results, there was a gradual degradation in the GW quality from north to south of the study area, which can cause sodification, deterioration of the soil's physical properties, dissociation of organic matter, and soil salinization. The best management of the water resources in the southern part of the study area is using calcium fertilizers for the soil that can be affected by sodification and using the plant that can be more resistant for salinity. Additionally, the GW in the research area's southern region can be employed to irrigate crops with moderate to high salt sensitivity on loose soil that does not have any compacted layers. The land resources and soil classification revealed that the soils were classified as fair, poor, and very poor according to the salinity, alkalinity, and texture of the soil, which has been confirmed in previous works [44].

SVM Model
The SVM and ANFIS coding was carried out using MATLAB, and the radial basis function (RFB) the parameters (C, σ, and ε) was implemented for the IWQI prediction. The shuffled complex evolution algorithm (SCE-UA), which is commonly applied in hydrological applications, was implemented herein to achieve the accurate predictive performances for the SVM model [92,93]. The predicted values of the identified IWQIs were computed following the selection of the best performing SVM model during the training procedure, and the predicted and observed records were then compared. The results of the model's performance are presented in Table 6 in terms of the R 2 , RMSE, MAE and E. For the training period of the IWQI, the values of the performance measures were R 2 = 0.97, RMSE = 1.57, MAE = 0.64, and E = 0.98; the values for the testing period were R 2 = 0.76, RMSE = 12.45, MAE = 8.48, and E = 0.70. Figure 12 shows the measured and predicted IWQI values and scatter diagram for the SVM model. A significant drop in the performance level can be noticed, as shown in Figure 12, in terms of the testing results. The results demonstrate further that the SVM model overestimated the values of the predicted IWQI in the testing period. In the case of the SAR index, in the training period the performance measures were R 2 = 0.93, RMSE = 0.57, MAE = 0.28, and E = 0.91; the values for the testing period were R 2 = 0.36, RMSE = 2.23, MAE = 148, and E = 0.20. In general, the performance of the SVM model decreased in the testing period for all indices (Figures 12 and 13).

ANFIS Model
After determining the model with the greatest performance using the ANFIS training, the predicted estimates of the IWQIs were calculated. Figures 14 and 15 compare the predicted values of IWQI and SAR in both the training and testing stages with the actual data. It is apparent that the two curves strongly overlapped and, except for some values that diverged even quite far from the measured values, the trend of both the predicted and observed datasets was closely similar. The significant R 2 value (0.99) shows that there was perfect agreement between the predicted and observed IWQI. The developed ANFIS model had a perfect fit for the IWQIs in both the testing and training stages, as shown by the E values in Table 6, which were more than 0.90. Table 6 illustrates that for all indices, the ANFIS model outperformed the SVM model in terms of the accuracy. From the training to the testing phases, the ANFIS model's performance quality (R 2 , RMSE, and MAD) decreased only slightly. A much more distinctive description arises in Figures 14 and 15, which illustrate the disparity between the forecasted and measured IWQIs in the training and testing phases, as well as the comparative scatter plots. The time series plots reveal that the ANFIS model was adept at identifying the varying patterns of the observed IWQI data.
As one of the main objectives of this study was to evaluate groundwater appropriateness for agricultural purpose utilizing various IWQIs, which are traditionally calculated using classical mathematical equations that are time consuming, especially in calculating IWQIs because of the large amount of data and several steps needed to obtain the final results, we proposed the ANFIS and SVM models to analyze the large amount of data for the nonlinear systems, quickly and accurately identifying patterns, making predictions for the IWQIs with an acceptable accuracy and efficiency, optimizing the processes, and determining the results based on the simulations. Furthermore, simulation models are useful for predicting outcomes in situations where experimentation is not possible or practical.
The results confirm the viability of applying the ANFIS and SVMR models for the assessment and control of the GW quality for irrigation throughout the NSS aquifer in El Kharga Oasis. Finally, combining IWQIs, ANFIS, and SVMR proved to be a useful and practical tool for determining and predicting irrigation water quality in both arid and semi-arid environments.
the ANFIS model outperformed the SVM model in terms of the accuracy. From the training to the testing phases, the ANFIS model's performance quality (R 2 , RMSE, and MAD) decreased only slightly. A much more distinctive description arises in Figures 14 and 15, which illustrate the disparity between the forecasted and measured IWQIs in the training and testing phases, as well as the comparative scatter plots. The time series plots reveal that the ANFIS model was adept at identifying the varying patterns of the observed IWQI data. Figure 14. Results of the simulated IWQI using the ANFIS model.   Table 6, which were more than 0.90. Table 6 illustrates that for all indices, the ANFIS model outperformed the SVM model in terms of the accuracy. From the training to the testing phases, the ANFIS model's performance quality (R 2 , RMSE, and MAD) decreased only slightly. A much more distinctive description arises in Figures 14 and 15, which illustrate the disparity between the forecasted and measured IWQIs in the training and testing phases, as well as the comparative scatter plots. The time series plots reveal that the ANFIS model was adept at identifying the varying patterns of the observed IWQI data. Figure 14. Results of the simulated IWQI using the ANFIS model.

Theoretical and Practical Implications
The impacts of the suggested technique rely on the size of the survey and the availability of the datasets. It might be broadened further to incorporate a regional scope and to offer strategic data to decision makers and stakeholders. To support relevant and accurate outcomes, however, an understanding of the important hydrogeological conditions is always necessary. Decision makers and stakeholders may benefit from using the suggested preliminary assessment process, since it will significantly save their time and resources needed for traditional complex strategies. By creating management strategies specifically for the situations identified by the study, its results might be rendered more valuable. The natural environment and socioeconomic structure of a region may eventually benefit as a result over the long run.

Conclusions
This study used physicochemical parameters, IWQIs, and GIS tools to recognize GW hydrogeochemical classes and their controlling processes to examine the suitability of the GW for the NSSA in El Kharga Oasis for agricultural uses. According to the collected physicochemical data, the hydrochemical facies of the GW resources were of Ca-Mg-SO 4 , mixed Ca-Mg-Cl-SO 4 , Na-Cl, Ca-Mg-HCO 3 , and mixed Na-Ca-HCO 3 types, which reveals silicate weathering, dissolution of gypsum/calcite/dolomite, halite dissolution rock-water interaction, and reverse ion exchange processes. For instance, the IWQI showed that 67.85% of the GW samples were categorized for irrigation purposes into no restriction, 11.42% in the low restriction class, 1.42% in the moderate restriction class, 5% in the high restriction class, and the rest of the samples in the severe restriction class. Two simulation models were developed to predict the IWQIs based on the collected physicochemical parameters. The results of the performance assessment for the proposed simulation models show that the ANFIS model and SVM model were capable of simulating the IWQI with reasonable accuracy in the learning phase (R 2 = 0.99 and 0.97) and validation phase (R 2 = 0.97 and 0.76). The proposed models' accurate performance indicates that they have the potential to be used for IWQI prediction. Therefore, the combination of physicochemical parameters, IWQIs, GIS, and the feasibility of the ML models can contribute in an efficient manner to the utilization of GW for irrigation purposes. The research attempted to overcome the constraints of traditional methods by using ANFIS and SVM models to predict the quality of the GW used for irrigation under extensive salinization. The preliminary findings of this effort will contribute to the provision of knowledge for the coordinated and precise management of water resources in El Kharga Oasis. This work offers a reliable technology for water resources risk contingency plans. Thus, it will be useful to manage the environmental safety of the water environment in the future. Additionally, the method put out in this work has the potential to be further studied to increase its accuracy for GW under various conditions, and it enables decision makers to combine various technologies for water quality management and planning. Because of this, we used ML models in this study to anticipate the groundwater quality for irrigation purposes under significant salinization in an effort to go beyond the constraints of conventional approaches. Finally, the integration of IWQIs, ML, and GIS approaches offers an alternative data analysis approach for acquiring quick results with a less time-consuming process that achieves satisfactory results from the perspective of GW quality management.