1. Introduction
Groundwater constitutes a vital resource for both irrigation and household needs. Assessing its chemical and physical characteristics is essential to ensure sustainable utilization and effective resource planning. With the growing pressure on water supplies, proactive evaluation of groundwater quality is crucial to secure its suitability for long-term human use [
1,
2]. Numerous investigations have employed computational, probabilistic, and analytical approaches to assess indicators of water quality [
3,
4]. The salinity of groundwater is typically assessed through total dissolved solids (TDS), a key metric reflecting water quality. In hyper-arid desert environments, salinization stands out as a critical challenge, posing a significant threat to the long-term viability of deep, stress-impacted aquifer systems [
5]. Desert aquifers under extreme stress face heightened vulnerability due to limited natural recharge and persistent exposure to intense evaporation and salinity accumulation.
In deep desert-stressed aquifers, salinization is driven primarily by natural geochemical processes and prolonged hydrological isolation. The dissolution of soluble minerals such as halite, gypsum, and other evaporites into the groundwater matrix increases ionic concentrations over time. Upward leakage or migration of deeper, highly mineralized water layers through faults or fractures can further elevate salinity levels in overlying aquifers. In hyper-arid climates, minimal recharge combined with intense evapoconcentration accelerates the accumulation of salts, while the long residence time of groundwater prevents dilution and promotes progressive mineralization.
Anthropogenic pressures can exacerbate these natural mechanisms. Excessive abstraction for irrigation and domestic supply can alter hydraulic gradients, facilitating the upward movement of saline water from deeper strata. Agricultural return flows, especially when using marginal-quality water, can leach salts from the soil back into the aquifer system. The over-application of fertilizers introduces additional dissolved ions, while land-use changes may reduce natural infiltration areas, disrupting the balance between recharge and discharge. These combined pressures lead to a gradual but persistent rise in groundwater salinity, which diminishes its suitability for human consumption, irrigation, and industrial use, and may degrade soil productivity in dependent agricultural zones.
In such environments, deep freshwater reserves are particularly at risk from upward migration of saline water from underlying layers. Moreover, rapid demographic growth and intensified agricultural and industrial demands in arid zones further strain these already fragile groundwater systems [
6]. Reliable forecasting of salinity trends is vital for preserving the integrity of freshwater aquifers. An increase in salinity levels can severely limit the usability of groundwater for both drinking purposes and agricultural irrigation. As a result, simulating salinity variations is fundamental to effective water resource management, strategic hydrological planning, and the promotion of sustainable groundwater utilization [
7].
Groundwater quality assessment often relies on numerical and deterministic modeling techniques [
4,
8]. Nonetheless, the inherent complexity of aquifer systems, characterized by spatial heterogeneity, dynamic hydrochemical interactions, and variability over time and space, introduces major obstacles to achieving accurate predictions through conventional, model-driven approaches [
9]. These complexities have been addressed by employing a range of strategies to investigate groundwater quality, including on-site measurements, laboratory-based analyses, and simulation-based modeling of aquifer behavior [
10,
11].
Recently, cutting-edge artificial intelligence (AI) and machine learning (ML) methods have increasingly gained global recognition for their ability to predict groundwater quality [
10,
12,
13,
14]. These approaches offer superior accuracy, user accessibility, cost-effectiveness, and faster processing times compared to traditional numerical modeling [
15]. They utilize a variety of input data, including both chemical and physical variables, to build robust predictive models [
16]. Extensive studies have shown that nitrate concentrations are among the most accurately monitored and forecasted parameters, followed by electrical conductivity (ElC), water quality index (WaQIx), and salinity [
12,
14]. Vulnerability assessments for these indicators have been carried out using diverse ML-based approaches [
17,
18,
19,
20], although most work has focused on single-model applications rather than integrated or hybrid approaches [
21,
22,
23,
24,
25].
Machine learning (ML) has become an essential tool for predicting groundwater salinity variations across spatial and temporal scales. Early studies employed conventional models such as linear regression (LR) [
20,
26,
27], naïve Bayes (NB) [
28,
29,
30], k-means clustering [
31,
32], and the perceptron algorithm [
20,
33], which, while foundational, often struggled with overfitting, convergence to local minima, and limited ability to model complex non-linear interactions [
18,
25]. To overcome these shortcomings, recent research has shifted toward hybrid and ensemble machine learning (H-EML) techniques, which capture complex patterns more effectively and show improved predictive resilience. Intelligent optimization strategies, including evolutionary computation and swarm intelligence, have also been applied to fine-tune model parameters [
34] in advanced frameworks such as deep belief networks (DBNs) [
28,
35,
36], probabilistic neural networks (PNNs) [
25,
28,
33], fuzzy systems (FSs) [
10,
18,
25,
37,
38], and relevance vector machines (RVMs) [
28,
39].
Several recent studies have demonstrated that H-EML can enhance the performance of ensemble decision tree models (EdTE-ML) [
28,
30,
40,
41,
42]. However, these improvements have sometimes been accompanied by overfitting and excessive overprediction of nitrate concentrations [
40,
41]. One key limitation is the incompatibility of certain optimization strategies with EdTE-ML frameworks that use discrete hyperparameter spaces [
28,
42]. Alternative approaches such as particle swarm optimization (PSO) and simulated annealing (SA) may provide more effective tuning for EdTE-ML hyperparameters [
40,
41]. Despite promising results, the application of EdTE-ML models for groundwater salinity prediction remains underexplored. Notable algorithms in this category include CatBoost Regressor (CatBR-m), ExtraTrees Regressor (ExTR-m), and Bootstrapping Regressor (BsTR-m) [
40,
41,
42,
43,
44], which have shown strong performance in other engineering domains but limited testing in salinity modeling. These models often outperform standalone algorithms such as gradient boosting machines (GBM) and extreme gradient boosting (XGBoost) [
25,
28,
43,
44], especially in arid-zone aquifers where data scarcity is a challenge.
Feature selection and model optimization are also critical. The random decision forest (RDF) algorithm is widely recognized for identifying relevant features [
10,
28,
44], while CatBoost excels in handling high-dimensional and categorical data [
40,
41,
43,
44]. ExtraTrees Regressor is valued for its simplicity and consistent performance [
40,
41,
44], and Bootstrapping Regressor is effective at minimizing overfitting and boosting prediction precision [
43]. However, detailed sensitivity analyses of hyperparameters in groundwater salinity prediction are still rare [
40,
41,
42]. GridSearchCV (GSCV) remains a popular and effective method for tuning EdTE-ML models in small datasets [
25,
38,
43,
44], due to its ease of implementation and ability to systematically explore parameter spaces.
This study advances current methods by using optimized ensemble decision tree-based machine learning (EdTE-ML) algorithms to predict groundwater salinity in deep desert aquifers. In harsh arid environments with limited and sparse groundwater quality data, groundwater often serves as the primary, and sometimes sole, freshwater source, but is heavily threatened by salinization driven by natural mineral dissolution, limited recharge, high evaporation, and over-extraction. These stresses are acute in desert aquifers, where very low recharge means even small salinity increases can cause irreversible water quality degradation, affecting drinking water, agriculture, and long-term socio-economic stability. A key innovation here is a dual-stage modeling strategy that improves prediction accuracy and robustness, especially under data-scarce conditions. The first tier employs CatBoost (CatBR-m) and ExtraTrees Regressor (ExTR-m) models to generate initial salinity predictions, which are then combined by the Ensemble Bootstrapping Regressor (BsTR-m) in the second tier to produce a more precise and robust final output. This study contributes by (i) demonstrating the effectiveness of optimized EdTE-ML models in delivering high-precision predictions despite small and weak datasets, and (ii) proposing a novel, structured modeling strategy specifically designed for groundwater salinity prediction in deeply stressed desert aquifers.
The primary objectives of this research are fivefold: (i) using the random decision forest (RDF) algorithm for feature selection to identify the most relevant groundwater quality parameters for salinity prediction; (ii) conducting a thorough sensitivity analysis with GridSearchCV (GSCV) to find optimal hyperparameters for EdTE-ML models; (iii) applying a two-tier modeling strategy with optimized EdTE-ML algorithms to improve predictive accuracy; (iv) assessing and comparing the performance of individual EdTE-ML models against their combined forms within the dual-stage framework; and (v) generating a detailed spatial distribution map to visualize and predict groundwater salinity across the study area, addressing challenges posed by scarce and limited-quality data.
2. Study Area and Data Collection
2.1. Study Area
The study area is located in the East Kebili region of southwestern Tunisia (oasis area), a deep desert environment where groundwater resources play a critical role in sustaining life and agricultural activity. This arid region is geographically bounded by the saline depressions of Chott El Djerid and Chott El Fejej (
Figure 1). These chotts, acting as terminal discharge zones for regional groundwater flow, not only influence the hydraulic regime but also intensify the risk of groundwater salinization through upward leakage of mineralized water and surface evaporation-driven salt accumulation [
6,
45,
46].
The East Kebili region is marked by extreme climatic conditions, with high interannual temperature variability ranging from 13 °C in winter to over 32 °C during summer months. Annual precipitation is sparse and erratic, generally below 100 mm. These factors reinforce a hyper-arid hydrological context where natural groundwater recharge is severely constrained [
45,
46].
Despite these challenges, the region supports the most extensive and productive oases in Tunisia. Traditional date palm cultivation and the recent expansion of greenhouse agriculture are highly dependent on the extraction of deep groundwater, mainly from the Complex Terminal (CT) aquifer. This aquifer, consisting of Upper Cretaceous carbonates and Tertiary continental sediments, reaches depths of over 300 m and thicknesses up to 200 m. Water temperatures in these deep reservoirs range from 27 °C to over 45 °C and often require cooling prior to irrigation use [
45].
Geologically, the East Kebili region lies on the northern edge of the Saharan Platform and is composed of a thick sedimentary sequence ranging from the Jurassic to the Quaternary. Deep boreholes reveal Jurassic carbonates, mainly limestones and dolomites with marl layers, unconformably overlain by Lower Cretaceous fluvio-deltaic deposits of clays, sandstones, and evaporites. These are succeeded by Upper Cretaceous marine carbonates and shales, marking a major transgressive event, followed by a regional unconformity caused by tectonic uplift during the Paleocene-Eocene. Overlying this are Neogene and Quaternary continental deposits, unconsolidated sands and gravels, forming the Plio-Quaternary aquifer with limited recharge capacity. Structurally, the region is affected by NE–SW and E–W trending fault systems related to Mesozoic and Alpine tectonic activity [
45,
46]. These faults, along with horst–graben structures, influence aquifer geometry and facilitate upward migration of saline water, particularly near the Chott El Djerid and Chott El Fejaj depressions. The interplay between lithological variation and structural complexity governs groundwater flow, salinization risk, and the connectivity of deep desert aquifer systems in the region [
6,
45,
46].
The hydrogeological framework of the region is characterized by a complex multilayer aquifer system composed of three vertically interconnected units: the Plio-Quaternary, the Complex Terminal (CT), and the Continental Intercalary (CI) aquifers [
45,
46]. These aquifers collectively form one of the most important groundwater reserves in the region, supporting extensive agricultural activities, particularly oasis cultivation. However, despite their substantial storage capacity, these aquifers exhibit limited natural recharge rates due to the arid climate, low precipitation, and high evaporation typical of the region. Consequently, the balance between recharge and discharge is fragile, making these groundwater resources highly vulnerable to overexploitation and salinization. The increasing groundwater extraction to meet agricultural and domestic demands, coupled with natural salinity inputs, poses a significant risk to the long-term sustainability of local oasis agriculture and the livelihoods it supports.
In the study area, the Plio-Quaternary aquifer and the Complex Terminal (CT) aquifer are hydraulically connected, forming a single multilayered aquifer. In the Chott Djerid region, the Mio-Plio-Quaternary formations are generally not differentiated in hydrogeological investigations and are, in most cases, considered part of a multilayered aquifer system hydraulically attached to the CT aquifer. Groundwater exchange between these units occurs through semi-permeable layers, enabling vertical mixing of waters of different ages and salinities. All water samples analyzed in this study were collected from wells tapping into this multilayered Mio-Plio-Quaternary–CT aquifer; therefore, the TDS values presented in
Figure 2 reflect the integrated water quality of this combined system rather than that of a single stratigraphic unit [
47].
Hydrodynamically, groundwater flow within the Complex Terminal aquifer is driven predominantly by recharge occurring in the elevated southern ranges of the Algerian Atlas, where infiltration is facilitated by more favorable climatic and geological conditions. From these recharge zones, groundwater migrates northward through permeable sedimentary formations towards discharge areas located in the chott depressions—large endorheic salt basins characterized by high evaporation rates [
45,
46]. This natural flow regime, essential for replenishing aquifers and maintaining water quality, is increasingly disrupted by intensive groundwater pumping for irrigation. The excessive abstraction exceeds the natural recharge capacity, resulting in declining piezometric levels across many monitoring wells. This decline enhances the risk of vertical flow reversals, whereby deeper, more saline waters migrate upwards into shallower aquifer layers, further degrading water quality. The combined effect is a progressive increase in salinity levels, reflected by rising total dissolved solids (TDS) concentrations, which compromises the usability of groundwater for both irrigation and potable use.
Unlike coastal aquifers, where seawater intrusion commonly drives salinization, the main factors influencing groundwater quality deterioration in the East Kebili oasis area are related to anthropogenic and natural hydrogeochemical processes. Intensive groundwater abstraction concentrates dissolved salts through evaporation in shallow aquifers, while saline water from deeper or adjacent formations intrudes upward along preferential pathways, particularly near the margins of the Chott El Djerid and Chott El Fejej basins.
The presence of naturally brackish or saline zones within the sedimentary sequence, coupled with long groundwater flow paths through mineral-rich strata, further contributes to the salinity problem. This situation is exacerbated by the region’s arid climate, which promotes evaporative concentration of salts near the surface. As a result, older oasis areas and regions adjacent to the chotts exhibit elevated TDS levels, often exceeding thresholds suitable for irrigation and human consumption (
Figure 2) [
45,
46]. Without the implementation of integrated groundwater management strategies that balance abstraction with sustainable recharge, alongside the adoption of water-saving irrigation technologies, the region faces an increasing risk of irreversible degradation of its critical groundwater resources.
2.2. Data Collection
A comprehensive groundwater sampling campaign was conducted between 2022 and 2024 across the East Kebili region to investigate the hydrochemical characteristics of the deep desert aquifer system and to assess the progression of groundwater salinization. Given the highly arid and desert nature of the study area, groundwater resources are extremely scarce and localized, predominantly occurring near oasis zones where natural conditions allow for sustainable water extraction and human settlement. In these regions, boreholes are strictly limited to existing agricultural and inhabited areas, with no permission granted for new drilling outside these zones, due to both environmental constraints and regulatory restrictions designed to protect the fragile desert ecosystem.
To support this study, groundwater samples were collected from a network of 41 wells distributed across the study area, representing different aquifer levels and hydrogeological settings. The wells were selected to capture spatial variability and cover both recharge and discharge zones. Sampling campaigns were conducted between 2022 and 2024, following standardized protocols to ensure data quality. Hydrogeochemical analyses included measurement of major ions (Na+, K+, Ca2+, Mg2+, Cl−, SO42−, HCO3−, CO32−), total dissolved solids (TDS), pH, and sodium adsorption ratio (SAR), performed using ICP-MS, ion chromatography, and titration protocols. Quality control procedures and replicates were used to verify the reliability of the results. These data provide a robust foundation for characterizing groundwater chemistry and understanding the processes controlling salinization.
The well depths range from 71 m to 210 m, targeting different hydrostratigraphic units within the Plio-Quaternary and Complex Terminal aquifers. Well locations and screened intervals were documented using GPS coordinates and drilling logs, ensuring precise spatial referencing. The majority of wells are production wells actively used for irrigation, while a subset includes dedicated monitoring boreholes installed to track groundwater quality over time.
As a result, the number and spatial distribution of sampling points are inherently constrained, leading to a relatively small and clustered dataset centered around these oasis areas, comprising a total of 41 groundwater samples.
Field data collection focused on measuring key in situ parameters, including static water level, total well depth, groundwater temperature, pH, salinity, and electrical conductivity (EC), to establish the physical and chemical status of the resource. Groundwater samples were retrieved from a network of deep private wells currently exploited for irrigation purposes, as well as from selected observation boreholes installed specifically for monitoring. Extraction methods were adapted to the well type: operational production wells were sampled directly through electric pumping systems, while monitoring wells were sampled using a stainless-steel bailer after purging to ensure representative water quality data. The active use of these wells during the campaign period confirms that the sampled points are reflective of the water actively supplying the oases and agricultural zones, thereby providing critical insights despite the limited geographic spread.
At each sampling site, two separate groundwater aliquots were carefully collected in sterile, contamination-free plastic containers to ensure sample integrity and avoid cross-contamination. The first aliquot was immediately preserved using appropriate acidification techniques to stabilize dissolved cations and trace metals for subsequent laboratory analysis. This preservation step is crucial to prevent precipitation, adsorption, or transformation of sensitive metal species during storage and transport. The second aliquot was left untreated to allow accurate assessment of anions and general chemical parameters, which could be influenced by chemical preservation agents.
Immediately after collection, all samples were clearly labeled with unique identifiers and metadata, including date, time, and well characteristics, to maintain traceability. They were then stored in cooled containers, typically refrigerated at 4 °C, to inhibit microbial activity and chemical alteration before analysis. These precautions ensured the chemical composition remained as representative as possible of in situ groundwater conditions.
The comprehensive hydrochemical characterization encompassed a wide range of major ions essential for understanding water quality and salinization processes. Cations analyzed included sodium (Na
+), magnesium (Mg
2+), potassium (K
+), and calcium (Ca
2+), while key anions comprised chloride (Cl
−), sulfate (SO
42−), carbonate (CO
32−), bicarbonate (HCO
3−), and nitrate (NO
3−). In addition to these, critical indicators of salinization such as total dissolved solids (TDS), electrical conductivity (EC), and sodium adsorption ratio (SAR) were measured to evaluate the degree of mineralization and potential impacts on soil and crop health (
Table 1).
Alkalinity was also quantified to better understand the buffering capacity of the groundwater system and the carbonate equilibrium, which are important factors influencing the geochemical evolution and stability of the aquifer. To ensure the reliability of the analytical data, an ion balance was systematically calculated by comparing the sum of measured cations and anions. Most samples exhibited acceptable charge balance within ±5%, confirming the accuracy and consistency of the laboratory results and validating the data for subsequent interpretation and modeling.
While it is true that the northern part of the study area remains largely unsampled due to the absence of accessible wells, reflecting the natural scarcity of exploitable groundwater and the prohibition on drilling in these desert expanses, this limitation is inherent to the environmental and regulatory context of deep desert aquifers. The sampled points thus represent the only feasible and sustainable groundwater sources currently utilized, making them the most relevant for assessing the hydrochemical status and salinization trends within the system. This focused sampling approach ensures that the collected dataset, although limited in spatial extent, is both representative and valuable for understanding water quality variations where human and agricultural activity depend on groundwater availability.
The main goal of this research is to address the challenge of groundwater salinization prediction in such harsh desert environments where data are scarce and the database is limited. To this end, this study integrates advanced artificial intelligence (AI) and machine learning (ML) techniques to leverage the limited available data effectively, improving prediction accuracy and providing a valuable tool for resource management despite data constraints.
This integrated chemical dataset forms a critical component of salinity monitoring in the East Kebili region, offering insights into water–rock interactions, geochemical evolution, and the mobilization of salts under intensive groundwater abstraction. The results help trace salinization trends both laterally and vertically within the aquifer system, revealing zones where water quality degradation is accelerating. Ultimately, this approach supports the development of diagnostic tools for the sustainable management of deep groundwater reserves that underpin oasis agriculture in arid environments.
4. Data Processing Framework for Predicting Salinity
The methodological framework for groundwater salinity prediction is structured into four comprehensive stages, each playing a critical role in ensuring robust and reliable model outcomes.
At the outset, the key objective of this framework is to progressively transform raw hydrogeochemical data into actionable spatial predictions of groundwater salinity, particularly in an area characterized by a limited database. This proposed AI and machine learning approach is specifically designed to predict salinization in data-poor zones and serves as a more advanced and accurate tool for interpolation and spatial prediction compared to standard methods.
First, dataset conceptualization involves the careful selection of fundamental hydro-physical and geochemical parameters to be used as input features for modeling. These parameters are chosen based on their known influence on groundwater quality and salinity processes, such as concentrations of major ions, salinity indicators, and relevant physical characteristics like well depth and water table levels.
The initial dataset (input) comprised 41 groundwater samples, each characterized by concentrations of major ions (Na+, Cl−, SO42−, Ca2+, Mg2+, K+, HCO3−, CO32−, NO3−), along with physical parameters including sampling depth and location coordinates.
To systematically evaluate and prioritize these input variables, an initial screening is conducted using the random decision forest (RDF) algorithm in a preliminary stage (Stage 0). This step ranks features according to their relative importance, helping to reduce dimensionality, avoid overfitting, and focus the modeling effort on the most influential predictors.
The outcome of this stage (output) was a ranked list of hydrochemical and physical variables, allowing the model to prioritize inputs that significantly control salinity variations.
Second, enhanced ensemble decision tree models (EdTE-ML) are employed to model the complex and often nonlinear relationships between input parameters and groundwater salinity. In Stage 1, two powerful algorithms—CatBoost (CatBR-m) and ExtraTrees Regressor (ExTR-m)—are independently trained on the selected dataset. Both models are designed to handle nonlinear interactions and feature dependencies effectively, each bringing complementary strengths to the analysis. CatBoost excels in dealing with categorical variables and reducing prediction bias, while ExtraTrees emphasizes variance reduction through randomization in tree construction.
Following this, Stage 2 implements the Bootstrapping Regressor (BsTR-m), an ensemble combiner that aggregates predictions from the base models to reduce variance, mitigate overfitting, and improve overall model stability.
The models were trained using 30 samples and tested on 11 samples, demonstrating robust predictive capacity and improved accuracy through ensemble learning.
This dual-tier modeling approach enables a more nuanced and resilient prediction framework capable of capturing the intricate patterns influencing salinity distribution.
Results at this stage included reduced prediction errors and enhanced model generalization compared to single-model approaches.
Third, a rigorous hyperparameter optimization process is performed using the GridSearchCV (GSCV) technique. This automated tuning systematically explores a predefined range of hyperparameter values for each model to identify the optimal configuration that maximizes predictive accuracy while minimizing error.
This optimization ensures that the models are neither underfit nor overfit and that they generalize well to unseen data, which is particularly important given the limited and sparse nature of groundwater datasets in arid desert environments.
Through this process, optimal hyperparameters were selected that balanced model complexity and performance, as validated by improved metrics during cross-validation.
Fourth, the predictive performance of the models is thoroughly evaluated using multiple statistical metrics. These include mean absolute error (MAE), which measures average prediction errors; adjusted R2, indicating the proportion of variance explained while accounting for model complexity; Kling–Gupta efficiency (KGE), which assesses model skill by integrating correlation, bias, and variability; and normalized root mean square error (nRMSE), which provides a scale-independent error measure.
This multi-metric evaluation offers a comprehensive view of model reliability and accuracy.
Evaluation results confirmed the strong performance of the ensemble approach, with high explanatory power (adjusted R2), low prediction errors (MAE, nRMSE), and balanced model skill (KGE).
Finally, the optimized and validated ensemble model is used to produce a high-resolution groundwater salinity prediction map of the study area, as illustrated in
Figure 3. This spatial output is a critical tool for visualizing salinization patterns, guiding resource management, and supporting decision-making processes aimed at sustainable groundwater use in deep desert aquifers with scarce data availability.
The final and most important finding of this study is the successful prediction of groundwater salinization patterns in a data-scarce environment, demonstrating the effectiveness of the proposed machine learning framework for salinity assessment under limited dataset conditions.
4.1. Initial Structuring of Feature Variables
To investigate the statistical distribution of the groundwater dataset and assess the relationships between salinity and geochemical indicators, kernel density estimation (KDE) was applied, as shown in
Figure 4. Prior to model training, input variables were standardized using the Z-score normalization method, which centers the data around a mean of zero and scales it to unit variance.
This standardization approach is widely recognized for improving algorithmic convergence, minimizing overfitting tendencies, and enhancing model robustness.
These preprocessing steps ensured that all input features were on comparable scales and that the machine learning algorithms could effectively learn the underlying patterns without bias toward variables with larger numeric ranges.
The machine learning algorithms, CatBR-m, ExTR-m, and BsTR-m (employed in Stage 2), were subsequently developed and evaluated using a total of 41 groundwater samples, with 30 samples allocated for training and 11 for testing.
This data split allowed for robust model training while preserving a subset for unbiased evaluation of predictive performance.
The selection of hydrochemical parameters for this study was based on their established relevance to groundwater salinity processes and their diagnostic value in arid environments. Major ions such as sodium (Na+), chloride (Cl−), sulfate (SO42−), calcium (Ca2+), magnesium (Mg2+), potassium (K+), bicarbonate (HCO3−), carbonate (CO32−), and nitrate (NO3−) are critical in characterizing the geochemical signature of groundwater. These ions influence salinity levels through natural processes such as mineral dissolution, ion exchange, and evaporation concentration.
For instance, Na+ and Cl− are primary contributors to salinity, often elevated due to rock–water interactions and evaporative concentration in desert aquifers. Sulfate and bicarbonate concentrations provide insight into redox conditions and carbonate equilibria, which affect water chemistry stability. Trace metals and cations also serve as indicators of anthropogenic impact and mineralogical sources, which may contribute to salinity variations.
Moreover, the selection was informed by previous hydrogeological studies in arid and semi-arid regions, where these parameters have proven effective in detecting and monitoring salinization trends.
By incorporating a comprehensive suite of ions and chemical indicators, the model can capture both direct salinity drivers and indirect factors influencing groundwater quality. This holistic approach improves the predictive power and interpretability of the machine learning models, allowing for better discrimination of spatial and temporal salinity patterns within the limited dataset.
4.2. Identification and Matching
To identify the most effective combination of input parameters for predictive modeling, a random decision forest (RDF) algorithm was employed as a feature selection mechanism [
10,
28,
44]. The accuracy and efficiency of any machine learning-based predictive model heavily depend on the quality and relevance of the selected input variables. Incorporating unnecessary or redundant attributes can significantly complicate the model without enhancing its predictive power [
44]. Given the absence of a universal protocol for input variable selection in machine learning applications for groundwater salinity forecasting, especially under data-scarce conditions, RDF was chosen for its robustness. This approach is particularly well-suited to limited datasets, as it efficiently handles nonlinear relationships and interdependencies among the variables with minimal sensitivity to data volume.
At this stage, the task was to systematically reduce the dimensionality of the input dataset by ranking variables according to their predictive importance.
Using 41 groundwater samples, RDF analysis revealed the most influential hydrochemical and physical parameters contributing to salinity variations, allowing the model to focus on these key predictors.
This selection process improved model interpretability and reduced the risk of overfitting due to redundant or irrelevant features.
4.3. Selection of Optimal Hyperparameters
The GridSearchCV (GSCV) approach was employed to fine-tune the hyperparameters of ensemble decision tree-based machine learning (EdTE-ML) models, applied across two tiers of the modeling framework [
25,
38,
43,
44]. Selecting an appropriate optimization algorithm is critical to prevent entrapment in local minima and to enhance the convergence rate. The effectiveness of an optimization strategy is influenced by factors such as dataset size, problem complexity, and the dimensionality of the hyperparameter space. GSCV proved to be a robust method for EdTE-ML optimization, particularly when dealing with a limited set of hyperparameters and seeking the most effective parameter combinations [
44].
The task at this stage was to systematically explore the hyperparameter space to identify optimal model configurations that improve prediction accuracy and generalization.
During the initial stage of the optimization procedure, all potential parameters were integrated into the GridSearchCV (GSCV) space for comprehensive evaluation. Subsequently, the two most impactful hyperparameters from each model, those that demonstrated variability in outcomes, were identified and retained. Parameters that showed negligible influence or remained constant within the search space were excluded from further analysis [
43,
44]. The selected top two hyperparameters for each modeling tier were then subjected to an in-depth sensitivity analysis across their respective value ranges. Investigating multiple hyperparameters within a broad search space can significantly increase both computational time and data collection costs.
For the CatBR-m model, critical parameters such as tree depth and learning rate were optimized through iterative grid-based trial-and-error exploration.
Adjusting the learning rate proved vital for balancing convergence speed and prediction stability, while tree depth controlled model complexity and overfitting risk.
Similarly, for ExTR-m and BsTR-m algorithms, the total number of estimators and the maximum number of features considered per split were the dominant tuning parameters affecting model performance.
Tree depth again played a key role in shaping the predictive behavior and generalization capacity of these models.
Furthermore, the structural depth of the trees was found to play a pivotal role in shaping the model’s predictive behavior and generalization capacity. The dominant tuning parameters for each EdTE-ML model were identified through the GridSearchCV framework, which employed a repeated data-splitting validation method with fold numbers varying from 2 to 6 in two-step intervals. This resampling strategy offers a consistent and reliable way to assess how well the ensemble models generalize to unseen data. Such iterative partitioning techniques are widely used in hyperparameter optimization to improve performance estimation, reduce overfitting risk, and ensure robust model validation on external datasets.
The results of this hyperparameter tuning and validation process were optimized model versions with enhanced predictive accuracy and robustness, crucial for reliable salinity forecasting under limited data conditions.
4.4. Assessment of Predictive Performance
Model performance was assessed using a range of statistical indicators to identify the most accurate predictive model. These included the mean absolute error (MAE), adjusted coefficient of determination (adjusted R
2), Kling–Gupta efficiency (KGE), and normalized root mean square error (nRMSE) [
25,
38,
43,
44]. The MAE, adjusted R
2, and KGE metrics are particularly suited for evaluating machine learning algorithms applied to relatively small datasets, while nRMSE offers the advantage of normalizing prediction errors relative to the observed data variability. The selection of these evaluation criteria was guided by considerations such as minimizing both over- and underestimation, effectively representing extreme values, and achieving an optimal balance between accuracy and model interpretability. The mathematical formulations of these metrics are provided in Equations (6)–(9).
The primary task in this stage was to quantitatively evaluate and compare model predictions against observed groundwater salinity data using multiple complementary metrics.
This multi-criteria approach ensures a robust understanding of model strengths and weaknesses, particularly in relation to prediction accuracy, bias, and variability representation.
where
n denotes the total count of observations in the dataset,
yi represents the true observed value corresponding to the
ith data point, and
ŷi signifies the predicted value produced by the model for the same
ith instance.
where
n represents the total number of observations,
p indicates the number of predictor variables, and
R2 denotes the conventional coefficient of determination.
where
r denotes the linear correlation coefficient between observed and predicted values,
β represents the bias ratio, and
γ signifies the variability ratio.
Applying these metrics to the testing subset of groundwater samples allowed for an objective assessment of the predictive performance under limited data availability.
Model outputs were evaluated to determine whether they met commonly accepted thresholds in hydrogeological modeling, providing confidence in their practical applicability.
In hydrogeological and groundwater research, models are generally considered satisfactory when the normalized root mean square error (nRMSE) is below 10% and the Kling–Gupta efficiency (KGE) is equal to or exceeds 0.7.
The results showed that the developed ensemble models achieved nRMSE values below this 10% threshold and KGE values greater than 0.7, confirming their reliability in predicting groundwater salinity despite the challenges posed by the small dataset.
This outcome validates the proposed modeling framework as an effective tool for salinization assessment in data-scarce desert aquifers.
5. Results
A comprehensive overview of hydro-physical and geochemical parameters from groundwater samples in the desert aquifer of Kebili oases highlights both concentration ranges and statistical variability (
Table 2 and
Figure 5). Major ions such as sodium (Na), calcium (Ca), chloride (Cl), sulfate (SO
4), and bicarbonate (HCO
3) exhibit relatively stable concentrations, evidenced by low coefficients of variation around 0.2, indicating minor fluctuations across the study area. Magnesium (Mg) displays moderate variability (CV ~0.3), while potassium (K) and nitrate (NO
3) show high variability (CVs of 0.8 and 1.0, respectively), suggesting localized or episodic influences. Chloride’s large variance and standard deviation reveal significant spatial differences in salinity, typical of arid environments. Carbonate (CO
3) has the highest variability (CV = 2.5) due to many low or zero values and a few elevated measurements, reflecting uneven distribution. Total dissolved solids (TDS) and sodium adsorption ratio (SAR) demonstrate moderate variation (CV ~0.4), consistent with fluctuating salinity and sodium hazard levels. The pH remains quite stable, with low variance and CV (0.1), indicating consistently slightly alkaline groundwater. Overall, these data reflect groundwater chemistry shaped by evaporation-driven concentration, mineral dissolution, and ion exchange processes typical of desert aquifers, with some parameters showing homogeneity and others reflecting geological and hydrological heterogeneity.
The spatial distribution of sodium (Na) concentrations in the study area reveals clear variability, with the highest levels (>60 mg/L) predominantly located in the central-western region, forming an irregular zone of elevated sodium (
Figure 6a). Surrounding this core, moderate concentrations (40–60 mg/L) extend toward the north and southeast, while the eastern and western fringes exhibit much lower Na concentrations (<40 mg/L). This pattern suggests localized sources or accumulation processes influencing sodium levels centrally, with a gradual to sometimes steep gradient toward the periphery.
Magnesium (Mg) concentrations show a similar spatial pattern to sodium, with the highest values (>40 mg/L) concentrated in the central-western part and overlapping with Na-rich zones (
Figure 6b). Moderate Mg levels (20–40 mg/L) spread into central and northern parts, whereas the eastern and southwestern boundaries have consistently lower concentrations (<20 mg/L). The strong spatial correlation between Mg and Na implies shared hydrogeochemical processes or sources affecting both ions.
Potassium (K) distribution differs markedly, with most of the study area, especially the central, eastern, and southern parts, showing low to moderate concentrations (<2.5 mg/L) (
Figure 6c). However, several isolated pockets in the central-northern and southeastern areas display elevated K levels (2–5.5 mg/L), including a very localized, intense hotspot (>5.5 mg/L) in the central-northern sector. This patchy distribution suggests potassium enrichment is limited to specific geological or anthropogenic factors, distinct from the broader patterns seen for Na and Mg.
Calcium (Ca) concentrations resemble those of sodium and magnesium, with high values (>40 mg/L) clustered mainly in the central-western area and extending northward (
Figure 6d). Lower Ca concentrations (<30 mg/L) dominate the eastern and southwestern edges. Gradual transitions with intermediate zones (30–40 mg/L) imply that the geological or hydrogeological settings promoting elevated Na and Mg similarly favor increased Ca levels.
Chloride (Cl) also follows the spatial trends of Na, Mg, and Ca, with the highest concentrations (>200 mg/L) forming a large contiguous zone in the central-western region (
Figure 6e). Surrounding this core, moderately high Cl levels (140–200 mg/L) cover much of the central and northern portions, while the peripheries to the east and southwest maintain lower chloride (<140 mg/L). The prominent chloride concentrations reinforce the significance of salinity influences in the central-western sector.
Sulfate (SO
4) displays a distribution pattern consistent with other major ions, showing the highest concentrations (>90 mg/L) in the central-western zone, with orange and yellow concentration ranges extending broadly into central and northern parts (
Figure 6f). Lower SO
4 values (<60 mg/L) are found near the eastern and southwestern boundaries. This extensive high-sulfate area supports the interpretation of mineral dissolution or evaporite influence shaping groundwater chemistry centrally.
In contrast, carbonate (CO
3) concentrations exhibit a markedly different pattern, with very low levels (<0.4 mg/L) dominating most of the study area, especially the central, eastern, and southern parts (
Figure 6g). Small, isolated pockets of slightly higher concentrations (0.4–1.2 mg/L) appear in central-northern and southeastern zones, including a localized intense spot (>1.2 mg/L) mirroring the pattern seen in potassium. This patchy distribution indicates that carbonate enrichment is localized, likely linked to specific geological formations or processes not widespread across the region.
Bicarbonate (HCO
3) presents an inverse spatial pattern relative to major ions like sodium, chloride, and sulfate. The highest bicarbonate concentrations (>16 mg/L) are primarily located in the central-eastern part of the study area, extending northeast, surrounded by moderate levels (10–16 mg/L) (
Figure 6h). Lower bicarbonate values (<10 mg/L) are found in the central-western and southwestern parts, which coincide with areas of elevated salinity. This inverse relationship suggests differing dominant geochemical processes or hydrogeological regimes, with bicarbonate-rich zones corresponding to less saline, more alkaline conditions.
Nitrate (NO
3) concentrations are generally low throughout the area (<4 mg/L), with scattered, isolated pockets of higher values (4–8 mg/L) primarily in the central-northern and southeastern parts, including a small intense hotspot (>8 mg/L) (
Figure 6i). These localized nitrate enrichments likely reflect specific contamination sources such as agriculture or septic inputs rather than natural background levels.
The sodium adsorption ratio (SAR) spatial pattern closely follows that of sodium, magnesium, calcium, chloride, and sulfate. Highest SAR values (>16) are concentrated in the central-western region, indicating elevated sodium hazard for soils and agriculture, with moderate to high values extending into the central and northern zones (
Figure 6j). Conversely, lower SAR values (<8) dominate the eastern and southwestern peripheries, consistent with their lower major ion concentrations and reduced sodium hazard.
Finally, the pH distribution varies across the study area, with lower values (<7) observed mainly in the central-western and southwestern parts, overlapping with zones of high salinity and SAR (
Figure 6k). Higher pH levels (7.5–8 and above) are found in the central-eastern and northern sectors, corresponding to regions with higher bicarbonate and lower major ion concentrations. This pattern indicates different geochemical environments, where bicarbonate buffering leads to alkaline conditions, while areas of high salinity tend to have slightly lower pH values.
Overall, the spatial distributions reveal a central-western zone characterized by elevated concentrations of major ions (Na, Mg, Ca, Cl, SO4), high sodium hazard, and lower pH, likely driven by mineral dissolution, evaporation, and salinity influences typical of arid aquifers. In contrast, peripheral areas, particularly to the east and southwest, show lower salinity, higher bicarbonate, and more alkaline conditions, reflecting distinct hydrogeochemical regimes and geological heterogeneity within the study area.
The correlation analysis of the groundwater dataset (
Figure 7) reveals distinct geochemical relationships that reflect both natural mineralization processes and specific sources of chemical constituents. Total dissolved solids (TDS) appears as the central integrator of water chemistry, showing very strong positive correlations with chloride (Cl), sodium (Na), calcium (Ca), magnesium (Mg), and sulfate (SO
4), indicating that these ions are the principal contributors to overall salinity. Such a pattern is characteristic of mineralization dominated by rock–water interactions, particularly the dissolution of evaporitic minerals such as halite, which supplies Na and Cl, and gypsum or anhydrite, which contribute Ca and SO
4, as well as the dissolution of carbonate rocks supplying Ca and Mg.
The strong association between Na and Cl, and the positive link between Cl and SO4, suggest a common origin from evaporitic strata or possible mixing with saline groundwater of marine influence. The sodium adsorption ratio (SAR) is also strongly correlated with Na and, to a slightly lesser degree, with TDS and Cl, confirming that sodium enrichment in these waters is a dominant driver of SAR values and that high-sodium waters tend to be more mineralized.
In contrast, bicarbonate (HCO3) exhibits weaker correlations with most major ions, implying that its variability is more closely related to carbonate equilibria and CO2-driven weathering processes than to the same salinity sources influencing Cl and Na. The pH values also display generally low correlations with major ions, suggesting that alkalinity–acidity balance is primarily controlled by buffering mechanisms rather than ionic strength. Nitrate (NO3) shows little to no correlation with the major ions and TDS, indicating an origin largely independent from geogenic mineralization, most likely linked to localized anthropogenic inputs such as agricultural fertilizers or wastewater infiltration.
Overall, the correlation structure points to the presence of two main hydrogeochemical signatures: a salinity-driven group formed by TDS, Cl, Na, SO4, Ca, Mg, and SAR, which reflects mineralization from rock dissolution and potential saline mixing, and a second group comprising HCO3, NO3, and pH, which is influenced by carbonate buffering and anthropogenic contamination, largely independent from the processes controlling overall salinity.
The results from the random decision forest (RDF) model reveal that among various input combinations tested for predicting groundwater salinity (
Table 3 and
Table 4), the configuration containing potassium (K) and chloride (Cl) consistently yielded the best performance with the lowest mean absolute error (MAE) of 0.0138. Adding other key ions such as sodium (Na), calcium (Ca), nitrate (NO
3), and sulfate (SO
4), along with parameters like pH and sodium adsorption ratio (SAR), improved prediction accuracy to some extent, as seen in configurations including multiple variables (e.g., C5 and C9), but the gains diminished with larger input configurations. Conversely, relying on sodium alone resulted in the poorest performance, highlighting its limited predictive power when used in isolation. The rankings demonstrate that while incorporating a balanced combination of major cations, anions, and hydrochemical parameters enhances model reliability, including too many variables may introduce noise without significantly reducing error. These findings emphasize the critical role of K and Cl in salinity prediction and provide guidance for selecting the most informative and efficient input parameters for groundwater quality modeling in arid environments.
The optimization process at the initial modeling stage, conducted through the GridSearchCV (GSCV) algorithm, revealed distinct patterns in parameter behavior across both models. In the CatBoost regressor (CatBR-m), variations in learning rate had a pronounced effect on performance: data-splitting validation (DSV) scores rose rapidly to a maximum at moderate learning rates, followed by a slow decline as the rate increased further. Regarding tree depth, the validation accuracy exhibited a steady decrease with deeper models, while training accuracy remained unaffected, indicating potential overfitting at greater depths. In the ExtraTrees regressor (ExTR-m), increasing the number of estimators initially led to a sharp improvement in DSV performance during testing, peaking at an optimal point before gradually declining with further additions. In contrast, the training performance curve remained largely stable regardless of estimator count. These trends underscore the importance of precise hyperparameter tuning to enhance model reliability and avoid performance degradation.
In the second-stage Bootstrapping Regressor model (BsTR-m), both the training and testing phases displayed closely aligned performance patterns. Initially, the data-splitting validation (DSV) scores rose significantly with an increasing number of estimators, eventually reaching a plateau where further additions no longer enhanced performance. The consistently high DSV scores across key parameters suggest that the BsTR-m model in Stage 2 was effectively calibrated to ensure robust generalization during testing. Overall, the findings confirm that the predictive performance of the CatBoost (CatBR-m), ExtraTrees (ExTR-m), and Stage-2 BsTR-m models exhibited notable sensitivity to hyperparameter configurations, highlighting the importance of careful tuning in the modeling process.
In the training phase (
Table 5), the performance of the three enhanced ensemble decision tree machine learning models (EdTE-ML)—CatBoost Regressor (CatBR-m) and ExtraTrees Regressor (ExTR-m) in Stage 1, and Bootstrapping Regressor (BsTR-m) in Stage 2—was evaluated using four metrics: mean absolute error (MAE), adjusted R
2 (R
2adj), Kling–Gupta efficiency (KGE), and normalized root mean square error (nRMSE). The CatBR-m model demonstrated excellent performance, with an MAE of 0.0034, R
2adj of 0.9979, a perfect KGE of 1.0, and a very low nRMSE of 0.0042, indicating highly accurate learning of the training data. The ExTR-m model showed even more extreme values, with near-zero MAE and nRMSE, and perfect scores for R
2adj and KGE—suggesting a complete fit to the training data. The BsTR-m model in Stage 2 also achieved ideal metrics across all indicators, with all error measures reduced to zero and perfect fit scores. This progression from CatBR-m to BsTR-m reflects a refinement in predictive learning across stages. However, the nearly flawless performance of ExTR-m and BsTR-m raises concerns about overfitting, highlighting the need for rigorous validation to ensure model generalization beyond the training dataset.
The validation phase (
Table 6) provides a comprehensive assessment of the predictive performance of the EdTE-ML models, clearly illustrating the benefits of the two-stage modeling approach. In Stage 1, the CatBoost Regressor (CatBR-m) demonstrates reasonable predictive capacity, with an MAE of 0.04295, an adjusted R
2 of 0.9457, a KGE of 0.9965, and an nRMSE of 0.05385. These values suggest that while the model captures the general trend of the data, it still exhibits notable deviations from the observed salinity values. The ExtraTrees Regressor (ExTR-m), also in Stage 1, outperforms CatBR-m, yielding lower error values (MAE = 0.01953, nRMSE = 0.02449) and a higher adjusted R
2 of 0.9671, indicating improved alignment between predicted and actual data and better robustness. However, it is in Stage 2 that the Bootstrapping Regressor (BsTR-m) achieves the most accurate results, with the lowest MAE (0.01382), the highest adjusted R
2 (0.9937), and the lowest nRMSE (0.01732), coupled with a near-perfect KGE of 0.9998. These performance gains highlight the added value of integrating predictions from Stage 1 models into a refined secondary modeling process, allowing BsTR-m to leverage prior information for more accurate generalization. Overall, the progressive enhancement across the modeling stages confirms the strength of the two-tier EdTE-ML strategy in capturing complex salinity patterns within desert aquifer systems.
A comparative assessment of machine learning models for groundwater salinity prediction was carried out using both training and testing datasets. During the model training phase, predictions generated by CatBR-m (Stage 1), BsTR-m (Stage 1), and BsTR-m (Stage 2) showed nearly identical values to the actual salinity measurements, indicating high accuracy and effective model calibration. However, it is important to note that training data alone are insufficient to fully assess the predictive capabilities of these models. In the independent testing phase, which included 20 validation samples (samples 29 to 31), slight overestimations of salinity concentrations were observed in only three instances, specifically with CatBR-m and BsTR-m from Stage 1. On the other hand, BsTR-m (Stage 2) demonstrated a remarkable ability to replicate observed salinity levels with minimal deviation, highlighting its superior generalization performance compared to the Stage 1 models.
A detailed analysis of relative errors in salinity prediction revealed that, during the model training stage, all tested algorithms produced minimal deviations, with errors closely approaching zero. However, performance distinctions became more apparent in the testing phase. Among all models, the BsTR-m (Stage 2) exhibited the lowest relative error, clearly surpassing the others in predictive precision. Evaluation of the models using statistical performance indicators, as presented in
Table 4, confirmed that BsTR-m (Stage 2) achieved the highest ranking, followed by CatBR-m and BsTR-m (Stage 1), respectively. These findings underscore the enhanced reliability and accuracy of the BsTR-m (Stage 2) model, particularly in generalizing to unseen data within the adopted dual-phase modeling strategy.
The predicted salinity distribution maps generated from the different modeling approaches reveal distinct variations in spatial accuracy. The first-stage models, CatBR-m and BsTR-m, exhibited noticeable tendencies toward overprediction and underprediction of groundwater salinity across the study area. In contrast, the BsTR-m model developed in Stage 2 demonstrated a marked improvement by effectively integrating the strengths of both preceding models. Its spatial output showed a high level of agreement with known patterns of saline and non-saline groundwater zones. This spatial consistency aligned with the performance rankings derived from the statistical evaluation summarized in
Table 4. The implementation of ensemble-based hybrid modeling in this work clearly outperformed single-model approaches, particularly in terms of mapping precision. As such, the BsTR-m (Stage 2) model proves to be a valuable tool for generating reliable salinity maps, especially under data-scarce conditions where predictive robustness is essential.
6. Discussion
Although the CatBoost (CatBR-m) and ExtraTrees (ExTR-m) models exhibit comparable statistical metrics for normalized root mean square error (nRMSE) and Kling–Gupta efficiency (KGE), as presented in
Table 4 and
Table 5 and illustrated in
Figure 8a,b, distinct discrepancies between the two models are evident upon visual inspection. The two-stage machine learning modeling strategy proved essential for capturing and analyzing the patterns and discrepancies illustrated in
Figure 8a,b. In the second stage, the customized Bootstrapping Regressor model (BsTR-m) utilized the salinity predictions generated by the first-stage models—CatBoost (CatBR-m) and ExtraTrees (ExTR-m)—as input features, while the normalized salinity measurements served as the predictive target, enhancing the model’s ability to refine and improve the accuracy of salinity estimation. The outputs generated by the BsTR-m model in Stage 2 represent learned values that encapsulate information derived from both the input features and target salinity data. As such, the BsTR-m framework effectively leverages or conditions the salinity predictions obtained from Stage 1 models to enhance overall predictive accuracy. Considering the variability in observed contaminant levels, this modeling approach demonstrates adaptability by incorporating and learning from all available contaminant parameters included in the training process.
The findings of this research validate the concept of applying machine learning to extract deeper insights by integrating two advanced variants of ensemble decision tree models (EdTE-ML), namely CatBoost (CatBR-m) and ExtraTrees (ExTR-m), alongside normalized salinity data. While CatBR-m and ExTR-m, commonly employed as decision-support tools across various engineering disciplines [
40,
41,
42,
43,
44], yielded results in Stage 1 that may be considered insufficiently robust or conclusive by some, the implementation of the Bootstrapping Regressor model (BsTR-m) in Stage 2 offers a more justifiable and reliable alternative. This defensibility is grounded in two key aspects: (i) the convergence of predictions from Stage 1 models contributed to improved statistical metrics, particularly high nRMSE and adjusted R
2 values; and (ii) the clear differentiation between model outputs, as visualized in
Figure 8, underscores the added value of the two-stage learning approach.
In comparison with other hybrid models previously applied for groundwater salinity prediction worldwide, the BsTR-m model in Stage 2 achieved superior performance, with an adjusted R
2 value of 0.9937, surpassing recent hybrid approaches such as deep belief networks (DBNs), probabilistic neural networks (PNNs), fuzzy systems (FSs), and relevance vector machines (RVMs) [
10,
18,
25,
28,
33,
35,
36,
37]. This marked improvement is primarily attributed to the BsTR-m model’s ability to extract more informative signal patterns from the outputs of CatBoost (CatBR-m) and ExtraTrees (ExTR-m), as opposed to the aforementioned studies, where metaheuristic optimization algorithms were employed solely to tune hyperparameters of DBNs, PNNs, FSs, and RVMs in order to prevent convergence to local optima. In contrast, the present study employed GridSearchCV (GSCV) for effective hyperparameter tuning, while the Stage 2 BsTR-m model further enhanced the predictive accuracy by learning from and refining Stage 1 outputs. Moreover, the resampling nature of the BsTR-m framework contributes to minimizing both variance and bias, an essential advantage when dealing with limited datasets in environmental modeling contexts [
25,
38,
43,
44].
Implementing the EdTE-ML algorithms through a two-stage modeling strategy demonstrated outstanding predictive accuracy, rapid convergence, and strong performance with limited datasets. This innovative framework thus offers a valuable and practical tool for researchers and policymakers aiming to safeguard groundwater from salinization in severely arid, desert-stressed aquifer systems worldwide. Nonetheless, the success of such models depends heavily on the availability of extensive and high-quality data. Expanding the collection of large-scale datasets remains essential to strengthening model robustness. Continuous monitoring of target contaminants within the watershed is also crucial, as their concentrations can vary significantly over time due to processes such as hydrodynamic dispersion and the inflow of water carrying dissolved substances [
48].
The spatial distribution characteristics of groundwater salinization observed in the Kebili oasis region can be attributed to several hydrogeological and anthropogenic factors. Firstly, natural processes such as mineral dissolution from the aquifer matrix, limited recharge in arid desert conditions, and high evaporation rates at the surface contribute to the progressive increase in salinity, especially in low-lying or stagnant groundwater zones. The proximity of boreholes to the oasis zones, where groundwater extraction is concentrated, further intensifies salinization by inducing saltwater intrusion and altering the natural groundwater flow regime. Additionally, excessive pumping for irrigation exacerbates the depletion of fresher water layers, causing the upward migration of deeper saline water. The limited recharge and scarce rainfall typical of desert environments reduce the natural dilution capacity, causing salts to accumulate over time.
Furthermore, geological heterogeneities, such as fault zones or variations in aquifer permeability, influence the spatial variability of salinity by creating preferential pathways or barriers to flow, which affect solute transport. Anthropogenic factors like land-use changes, improper irrigation practices, and lack of effective drainage systems contribute to local salinity hotspots. These combined natural and human-driven mechanisms explain why salinity patterns are not uniform across the region but exhibit clear spatial heterogeneity, with certain areas more vulnerable to quality degradation. Understanding these causes is critical for designing targeted mitigation strategies and guiding sustainable groundwater management.
A key achievement of the proposed methodology is its successful application in predicting aquifer salinization despite the constraints posed by a limited and spatially clustered database. The proposed AI and machine learning approach is specifically designed to predict salinization in poor database zones, serving successfully as a more advanced and accurate tool for interpolation and spatial prediction compared to standard models. This capability demonstrates the strength of advanced artificial intelligence and machine learning techniques in effectively handling weak datasets typical of arid and data-scarce environments. By leveraging available hydrogeochemical data from a restricted well network, the methodology provides reliable salinization forecasts that can inform sustainable groundwater management across the entire study area, including unsampled regions. This success highlights the potential of data-driven approaches to overcome traditional limitations in groundwater quality assessment, offering a valuable tool for monitoring and mitigating salinity risks in similar desert aquifer systems worldwide.
Based on the spatial predictions of groundwater salinity provided by the proposed EdTE-ML framework, several practical recommendations can be considered to mitigate salinization risks in the deep aquifer system of the Kebili oasis region. These include optimizing groundwater extraction patterns to reduce stress on vulnerable zones, promoting the use of controlled irrigation techniques to limit saline water intrusion, and encouraging crop selection based on salt tolerance. In parallel, managed aquifer recharge and improved drainage infrastructure could help reduce salt accumulation over time. The identification of high-risk areas also supports better land-use planning and the prioritization of monitoring efforts. Looking ahead, future research could focus on integrating remote sensing indicators (e.g., vegetation indices or land surface temperature) and time-series climatic variables to improve the temporal resolution of predictions. Furthermore, incorporating additional hydrogeological and geophysical data, such as aquifer permeability or fault mapping, may enhance model performance. Testing the transferability of the two-stage EdTE-ML framework to other arid aquifer systems and developing GIS-based decision support tools would also contribute to broader regional applications and more informed groundwater governance in salinity-prone desert environments.