Skip to main content
Wiley Open Access Collection logoLink to Wiley Open Access Collection
. 2026 Aug 6;98(8):e70521. doi: 10.1002/wer.70521

A Comprehensive Risk Assessment Framework for Groundwater Quality: Integrating Natural Background Levels, Threshold Values, and Machine Learning‐Based Hydrochemical Facies Classification

Vahab Amiri 1,✉, Peiyue Li 2,✉, Mehdi Torabi‐Kaveh 1
PMCID: PMC13445643  PMID: 42559847

ABSTRACT

Groundwater is a critical freshwater resource increasingly affected by anthropogenic activities. This study introduces an innovative and integrated framework for assessing the groundwater quality of the Qazvin aquifer, Iran, by combining iterative statistical methods and advanced machine learning (ML) algorithms. Three complementary statistical techniques, i.e., Iterative 2σ, cumulative distribution function (CDF), and iterative Grubbs test (IGT), were employed to determine natural background levels (NBLs) and threshold values (TVs) for key physicochemical parameters, supported by validation through ProUCL 5.2. The IGT method proved most effective in eliminating anthropogenic outliers and capturing the true geogenic baseline. Temporal and spatial variations of NBLs indicated the combined effects of geological, climatic, and human factors on groundwater chemistry. Hydrochemical facies were subsequently classified using four ML models (SVM‐ and CatBoost‐based) integrated with a compositional log‐ratio (7hlr) transformation. The SVM‐based models achieved the highest classification accuracy (> 93%) and Kappa coefficients (> 0.85), outperforming classical graphical approaches. The key innovation of this study lies in the dual integration of iterative statistical tools and ML‐driven classification, offering a more accurate distinction between geogenic and anthropogenic processes. This framework provides a robust and transferable approach for evaluating groundwater quality and supports evidence‐based strategies for sustainable aquifer management.

Keywords: hydrochemical facies, iterative Grubbs test, machine learning, natural background level, threshold value

Summary

  • Iterative Grubbs test (IGT) effectively removes anthropogenic outliers, providing realistic natural background levels validated by ProUCL 5.2.

  • SVM and CatBoost models with 7hlr log‐ratio transformation achieve > 93% accuracy in hydrochemical facies classification.

  • The integrated statistical‐ML framework reliably distinguishes geogenic baseline chemistry from human impacts (e.g., agriculture and wastewater).

  • NBL/TV estimation supports evidence‐based threshold setting for sustainable aquifer management under environmental pressure.

  • The dual‐method approach enhances contamination detection and provides a transferable tool for global groundwater quality assessment.


Integrating iterative statistics (IGT) and machine learning (SVM/CatBoost with log‐ratio transformation) accurately distinguishes geogenic from anthropogenic groundwater impacts. This framework establishes robust natural background levels and threshold values, achieving > 93% classification accuracy to support sustainable aquifer management.

graphic file with name WER-98-e70521-g008.jpg

1. Introduction

Groundwater is a vital resource supporting human consumption, agriculture, industry, and ecosystem services worldwide. Approximately one‐third of global freshwater withdrawals originate from aquifers (Wang et al. 2021; Gao, Qian, Huo, et al. 2020), and over two billion people depend on groundwater for drinking water (Barbieri et al. 2023). However, groundwater quantity and quality are increasingly threatened by both natural processes and human activities (Ascott et al. 2017; Rufino et al. 2019; Khosravi et al. 2021). The superimposed impacts of agriculture, urbanization, waste disposal, and industrial discharges further exacerbate degradation (Busico et al. 2019). Ensuring reliable access to safe water has therefore become a strategic priority for many governments, making the quantitative and qualitative management of groundwater essential for public health protection (Amiri, Ali, et al. 2023; Amiri et al. 2024).

Determining natural background levels (NBLs) has emerged as a key approach for understanding intrinsic geochemical conditions and distinguishing natural from anthropogenic influences (Gao, Qian, Wang, et al. 2020; Zhou et al. 2023). NBLs represent the concentrations of chemical constituents derived from geological sources, atmospheric inputs (Edmunds et al. 2003), and biogeochemical processes occurring during infiltration and groundwater flow (Ducci et al. 2016). These values vary according to precipitation chemistry, water–rock interactions, redox conditions, residence time, and interactions with other water bodies (Huang et al. 2023) and are generally unaffected by human activities (Molinari et al. 2012; Coetsiers et al. 2009). Computed NBLs are used to define threshold values (TVs) that represent upper limits of natural variability (European Commission 2006), providing a scientifically defensible basis for groundwater quality assessment (Busico et al. 2024).

Various tools have been developed for determining NBLs and identifying anthropogenic impacts, including graphical analyses, geochemical modeling, GIS‐based techniques, remote sensing, and especially statistical and probabilistic approaches (Machiwal and Jha 2010; Machiwal et al. 2018). Statistical methods such as Grubbs' test (Amiri et al. 2021; Rahman et al. 2021), component separation (Wendland et al. 2005; Molinari et al. 2012), empirical cumulative distribution functions (Edmunds and Shand 2008; Bondu et al. 2022), Dixon tests (Parrone et al. 2019), 4δ‐outlier methods (Gao, Qian, Huo, et al. 2020), probability plots (Rahman et al. 2021), Gaussian mixture models (Herms et al. 2021), PCA (Herms et al. 2021), kriging (Adhikary et al. 2011; Dalla Libera et al. 2017; Guadagnini et al. 2020), cokriging (Dalla Libera et al. 2017), and IDW (Ducci et al. 2016; Gong et al. 2014) are among the most widely applied.

Despite their usefulness, many studies rely on preselection of samples to exclude potentially contaminated data (Molinari et al. 2019; Parrone et al. 2022; Amiri et al. 2024; Cruz and Andrade 2015; Bondu et al. 2022). While effective in pristine settings, preselection can drastically reduce dataset size (Apollaro et al. 2022; Zanotti et al. 2022) and lead to inaccurate NBLs in heavily impacted aquifers. Eliminating preselection enables a more comprehensive evaluation of natural and anthropogenic contributions, which is crucial in complex hydrogeochemical environments (Busico et al. 2024).

Several authors have demonstrated that natural versus anthropogenic controls can be identified through distribution functions and normality assessments (Wendland et al. 2008; Molinari et al. 2019). Parametric approaches such as cumulative distribution functions (CDF) and 2σ/4σ tests assume normal or log‐normal distributions and detect anomalies that deviate from these patterns. Matschullat et al. (2000) showed that using the 4σ test removes few data points and may overestimate NBLs, whereas CDF and 2σ approaches yield more accurate results when sample sizes exceed 30. Many recent studies have applied iterative outlier removal and CDF‐based methods for NBL estimation in groundwater and soils (Rodrigues et al. 2013; Urresti‐Estala et al. 2013; Preziosi, Parrone, and Del Bon 2014; Preziosi, Parrone, Del Bon, and Ghergo 2014; Salomão et al. 2018, 2019; Bulut et al. 2020; Gao, Qian, Huo, et al. 2020; Gao, Qian, Wang, et al. 2020; Amiri et al. 2021, 2024; Zhang et al. 2024).

Beyond baseline assessments, classifying groundwater into hydrochemical facies is fundamental for interpreting dominant geochemical processes. Traditional tools such as the Piper diagram (Piper 1944) and its modifications (Durov 1948; Stiff 1951; Handa 1965; Lloyd 1965; Stuyfzand 1989) remain widely used. However, these diagrams lack clear boundaries between hydrochemical facies, assume linear mixing, and are affected by closure and constant‐sum constraints inherent to compositional data (Verma et al. 2021). These limitations reduce their statistical robustness and may yield misleading interpretations (Haselbeck et al. 2019).

To overcome these issues, log‐ratio transformations have been proposed as more rigorous alternatives for analyzing compositional hydrochemical datasets (Verma et al. 2020; Verma et al. 2021). Shelton et al. (2018) demonstrated the applicability of these transformations, whereas Verma (2015) showed that bivariate diagrams combined with linear discriminant and canonical analyses outperform ternary diagrams for hydrochemical interpretation. Studies applying isometric and hierarchical log‐ratio (hlr) transformations have shown both can yield comparable results when combined with discrimination algorithms (Verma and Armstrong‐Altrin 2013; Verma et al. 2016; Verma et al. 2020).

Recent advances in machine learning (ML) further enhance hydrochemical facies classification and groundwater quality assessment. ML techniques have been applied extensively across hydrological sciences, including water quality prediction, runoff estimation, flood susceptibility mapping, and evapotranspiration modeling (Wang et al. 2017; Melesse et al. 2020; Liang et al. 2020; Abba et al. 2020; Nachappa et al. 2020; Wu et al. 2019). Models such as SVM, random forest, XGBoost, and hybrid frameworks (e.g., XGB‐GMM) have shown high predictive capability for both hydrological variables and groundwater quality (Yu et al. 2020; Díaz‐González et al. 2021; Aju et al. 2024). Recent evaluations demonstrate that SVM and XGB often outperform other ML approaches in terms of accuracy and robustness (Basharat et al. 2025; Xie et al. 2025).

Building upon recent advances, this study proposes an integrated groundwater quality assessment framework that combines statistically robust estimation of NBLs and TVs with ML‐based hydrochemical facies classification. Unlike previous studies that generally considered these components independently, the proposed methodology integrates iterative statistical techniques, ProUCL‐based validation, compositional log‐ratio transformation, and advanced SVM‐ and CatBoost‐based classification models into a unified workflow. This integration provides a more reliable basis for distinguishing natural geogenic processes from anthropogenic impacts, improves the interpretation of hydrochemistry, and supports scientifically sound decision‐making for groundwater monitoring, contamination assessment, and sustainable aquifer management.

2. Study Area

2.1. Location of the Area

The Qazvin aquifer is located in a plain with an approximate area of 5059 km2 (Figure 1). This basin features highlands in the northern, southern, and western parts, and a dense network of surface streams conveys water from precipitation, which is the most significant source, to the plain and the Qazvin aquifer, recharging the groundwater resources. Considering the land surface topography and the geometry of this aquifer, the surface water flows of this plain, as well as the general groundwater flow direction, tend to move toward the southern and southwestern parts.

FIGURE 1.

FIGURE 1

Geographical location of the Qazvin aquifer area.

2.2. Geological Setting

The Qazvin area features diverse geological structures, including gentle to tight folds, active faults, and intrusive igneous bodies. In terms of rock units, the eastern and western parts of the plain are primarily composed of Precambrian to Cenozoic formations with low permeability (Figure S1). In the east, Precambrian formations, including dolomite and shale, are exposed. In the west, Paleozoic units such as sandstone, shales, and dolomite are developed. Mesozoic units, including dolomitic limestones and sandstone formations, are observed in the south and southeast. Cenozoic formations, comprising volcanic and pyroclastic units, are also present along the western and southern margins (Geological Survey and Mineral Exploration of Iran 2002).

The most significant hydrogeological unit in the region is the Quaternary sediments, which cover a vast area of the plain and include conglomerates, terraces, and alluvial fans. In the north and northwest, alluvial fans from various rivers, characterized by relatively well‐sorted coarse grains, have increased permeability and formed the main aquifer zones. In contrast, the southern and southeastern parts of the plain consist of low‐permeability clay and silt deposits and salt flats, which impede groundwater infiltration and storage (Toos Ab 2010).

2.3. Climate

Qazvin has a temperate continental climate. The average annual temperature is about 14°C, with summer and winter temperatures reaching approximately 35°C and −5°C, respectively. Precipitation is relatively low, averaging around 350 mm annually, with most rainfall occurring in spring and autumn (QRWC 2024).

2.4. Qazvin Aquifer

The Qazvin aquifer, covering an area of approximately 3952 km2, lies between 49°10′ to 50°40′ E longitude and 35°20′ to 36°20′ N latitude (Figure 1). As one of the most significant aquifers in Iran in terms of size and water supply capacity, it plays an important role in the region's agriculture and industry. The saturated thickness of the aquifer varies, ranging from less than 50 m to over 350 m. Groundwater generally flows from the north and northwest toward the south and southwest. The average annual groundwater level decline over the past 25 years has been about 1.28 m, with a total decline of approximately 31.92 m (QRWC 2024).

3. Materials and Methods

3.1. Monitoring Network of Physicochemical Components of Groundwater

In this study, a monitoring network for assessing variations in the physicochemical components of groundwater was utilized, featuring a well‐distributed set of sampling points. The available data cover the hydrological years from 2010–2011 to 2022–2023 (QRWC 2024). During most of the mentioned years, this monitoring network provided measurements of the main physicochemical parameters, including EC, TDS, pH, Na, K, Ca, Mg, SO4, HCO3, and Cl at 117 monitoring points (Figure 2 and Table S1).

FIGURE 2.

FIGURE 2

Monitoring network of major physicochemical variables of groundwater (left) and nitrate (right).

In addition to the physicochemical variables, the nitrate (NO3) concentration in groundwater for the 2022–2023 hydrological year was also available (QRWC 2024) (Figure 2, right). Accordingly, monitoring networks with varying numbers of measurement points were used, and in some cases, the accompanying parameters were limited. Nevertheless, data on NO3, pH, EC, and TDS concentrations were available for 78 deep wells and 11 shallow wells recorded in 2023 (statistical summary in Table S2).

Another dataset includes NO3 concentration along with pH, EC, BOD, COD, Na, Ca, and P in 112 samples collected in June and July 2023, primarily from the deeper parts of the aquifer (Table S3). In addition, data from 167 samples collected during the 2021–2022 hydrological year from the drinking water supply network, where EC, Na, Cl, and TH were measured, were also used (QRWC 2024). In this dataset, 138 samples also include the mentioned variables along with NO3 (Table S4).

3.2. Calculation of NBL and TV

To determine reliable NBLs and TVs for key physicochemical parameters in the Qazvin aquifer, a multimethod statistical approach was applied. Three primary methods were used:

Iterative 2σ : This parametric method assumes normal distribution of natural component concentrations (Matschullat et al. 2000). The process iteratively calculates mean ± 2σ, removing outliers suspected of anthropogenic influence until all data fall within this range. The resulting dataset defines the NBL, with the upper limit considered the TV (Nakic et al. 2007; Rodrigues et al. 2013). Normality was assessed using the Lilliefors test and a t‐test (α = 0.05, 95% confidence interval) to ensure the method's applicability (Urresti‐Estala et al. 2013).

Cumulative distribution function (CDF): A nonparametric method that excludes values above the median, assuming the lower half of the dataset represents natural conditions (Matschullat et al. 2000). Remaining values define the NBL. For both the Iterative 2σ and CDF methods, bin size for all parameters was determined using Sturges' Rule (Salomão et al. 2019).

Iterative Grubbs test (IGT): A robust parametric outlier detection method, which applies iteratively the Grubbs statistic (Equation 1) until no outliers remain:

Gt=xs–μ/σ (1)

where μ is the sample mean, σ is the standard deviation, xs is the suspected or tested value, and Gt is the Grubbs statistic (Rahman et al. 2021; He et al. 2022).

Determination of TVs: TVs derived from NBLs and reference standards (REF, e.g., drinking water or EQS), using (1) TV = (REF + NBL)/2 if NBL < REF, (2) TV = NBL if NBL ≥ REF, or (3) TV = 2 × NBL if NBL < (1/3) REF (Muller et al. 2006; Wendland et al. 2008).

Validation of NBL and TV calculations: NBLs and TVs were cross‐checked using ProUCL 5.2 (USEPA 2022), employing parametric and nonparametric estimators, outlier detection, and Monte Carlo simulations to provide robust background assessments. Its key features include calculating the upper confidence limit (UCL) for the mean, conducting outlier detection tests (such as Rosner and Dixon tests), fitting various statistical distributions (normal, log‐normal, and gamma), and specifically for NBL estimation, applying advanced data analysis methods such as nonparametric UCLs, nonparametric estimators for percentiles, and the bootstrap method. Additionally, Monte Carlo simulation techniques are used to determine the distribution of background concentrations.

3.3. Potential Anthropogenic Contribution (PAC) Index

The PAC index quantifies anthropogenic influence based on NBL (Equation 2):

PACij=Cij–NBLj/Cij (2)

where C ij is the measured concentration of parameter j in sample i, and NBL j is the natural background level for the same parameter. PAC values near zero indicate concentrations close to NBL, positive values suggest anthropogenic impact, and negative values indicate concentrations below natural levels (Ambrosino et al. 2025).

3.4. Identification of Hydrochemical Facies Using ML

For the advanced classification of groundwater samples into hydrochemical facies, an ML‐based methodology was implemented.

3.4.1. Data Preprocessing and Log‐Ratio (lr) Transformation

Concentrations of eight major ions (Ca, Mg, Na, K, SO4, Cl, HCO3, and CO3) were converted to mM/L and transformed using geometric mean–based compositional log‐ratios (hlr) to account for compositional constraints. Seven hlr ratios (hlr2–hlr8) were computed for cations and anions. The specific computational procedure for this hlr transformation is comprehensively detailed in Verma et al. (2021).

3.4.2. ML‐Based Water Classification Models

Four models were implemented: CatBoost (WClassCB) and three SVM‐based models (WClassVL, WClassVP, and WClassVR) using linear, polynomial, and RBF kernels. CatBoost applies sequential decision trees with One‐vs‐Rest for multiclass classification (Prokhorenkova et al. 2018). SVM constructs optimal hyperplanes using support vectors with One‐vs‐One for multiclass classification. Probabilities from submodels are combined to assign final hydrochemical facies, allowing up to 256 hydrochemical categories (Díaz‐González et al. 2021; Pedregosa et al. 2011). The CatBoost and SVM‐based models are collectively available as WaterClaSys_ML on the public server (https://github.com/usju/water‐classification‐ML) (Díaz‐González et al. 2021).

3.4.3. Intermodel Agreement Assessment Using Kappa Statistics

Agreement among ML‐based groundwater quality classification models and a reference (e.g., greater cation and anion molar concentrations—GMC) was quantified using Cohen's Kappa (pairwise) and Fleiss' Kappa (overall) statistics, ranging from −1 to +1, with higher values indicating stronger agreement (Cohen 1960; Fleiss 1971; McHugh 2012; Kuhn and Johnson 2013).

4. Results and Discussion

4.1. General Status of Groundwater Chemistry

The statistical summary of groundwater physicochemical variables for 2011–2023 (Table S5) shows wide concentration ranges, reflecting diverse sources, flow paths, and possible anthropogenic impacts (Freeze and Cherry 1979). EC varies from 232 to 9837 μS/cm, whereas major ions such as Na (0.92–1452 mg/L) and Cl (3.9–2552 mg/L) display similarly broad ranges, indicative of heterogeneous aquifer or multiple contamination inputs (Fetter 2001).

For most parameters (NO3, Ca, Mg, K, Na, Cl, SO4, and EC), median values lie closer to the first quartile, indicating right‐skewed distributions (Helsel et al. 2020). This pattern suggests that while many samples reflect natural low‐background conditions, a smaller portion shows elevated concentrations due to processes such as evaporation, pollution, or mixing with saline waters (Matiatos 2016). pH exhibits a relatively symmetric distribution (6.5–8.8; median: 7.7), characteristic of neutral to slightly alkaline groundwater typical of carbonate settings (Appelo and Postma 2005). The lower bound (6.5) may reflect acid precipitation or sulfide oxidation (Nordstrom 2011). HCO3 also shows a narrower and more symmetric range, indicating stable buffering capacity.

Based on medians, the dominant anion sequence is HCO3 > SO4 > Cl > NO3, consistent with silicate and carbonate weathering (Piper 1944). In higher salinity samples (≥ Q3), the order shifts to Cl > SO4 > HCO3, reflecting evaporite dissolution or influence from industrial/urban brines (Hounslow 1995). Among cations, Na > Ca > Mg > K predominance suggests advanced silicate weathering or contributions from wastewater sources (Drever 1997).

NO3 concentrations (median: 17.3 mg/L) are generally below the WHO drinking water limit (50 mg/L; WHO 2017). However, the maximum value (82 mg/L) and the 95th percentile (52.68 mg/L) exceed this threshold, indicating that roughly 5% of samples are impacted by anthropogenic contamination (Rivett et al. 2008).

4.2. Calculation of NBL and TV of Physicochemical Variables

Since the Iterative 2σ and CDF methods aim to normalize the dataset after removing outliers, normality was evaluated using the Jarque–Bera, Lilliefors, and Anderson–Darling tests before NBL calculation. All variables exhibited non‐normal distributions (Table S6), which is also evident in their Q–Q plots (Figure S2).

After defining the usable dataset, NBLs were calculated using the Iterative 2σ, CDF, and IGT methods, as well as three ProUCL 5.2 approaches: parametric 95% UTL, nonparametric 95% UTL, and bootstrap UTL. In the first step, Iterative 2σ and CDF were applied. Lilliefors test results (Table 1) show that, except for NO3, all variables are non‐normal based on the t < tcrit criterion. This widespread non‐normality likely reflects anthropogenic influences such as wastewater inputs or agricultural fertilizers that increase concentrations and create right‐skewed distributions (Reimann et al. 2008; Helsel et al. 2020). High t values for SO4, K, Na, and Cl may indicate wastewater impacts, irrigation return flow, or saline intrusion (Wakida and Lerner 2005).

TABLE 1.

Overall results of applying the Iterative 2σ and CDF methods in calculating the TV and NBL values for the 2011–2023 dataset.

Variable Iterative 2σ CDF
Treshold limit tcrit t Treshold limit tcrit t
EC (μS/cm) 1128.3 0.028 0.067 1996.5 0.020 0.095
SO4 (mg/L) 441.5 0.024 0.130 424.6 0.022 0.121
Cl (mg/L) 71.3 0.031 0.039 165.7 0.021 0.090
pH (−) 8.2 0.022 0.241 8.4 0.020 0.145
HCO3 (mg/L) 302.8 0.027 0.044 367.4 0.023 0.058
Ca (mg/L) 106.4 0.026 0.045 131.5 0.022 0.053
K (mg/L) 3.2 0.025 0.103 3.8 0.020 0.120
Mg (mg/L) 41.4 0.029 0.056 67.3 0.022 0.080
Na (mg/L) 165.6 0.026 0.075 241.7 0.021 0.055
NO3 (mg/L) 25.2 0.069 0.051 30.5 0.059 0.056

Note: Lilliefors test statistic (a = 0.05).

Another key reason for non‐normality is mixing of waters from geologically distinct formations, which produces multimodal distributions. Nonlinear hydrogeochemical processes such as evaporation, ion exchange, or preferential mineral dissolution can further distort parameter relationships and shift distributions away from normality.

Unlike other variables, the non‐normality of pH stems from its logarithmic nature and carbonate buffering, which restricts its range and produces a truncated, inherently non‐normal distribution (Appelo and Postma 2005).

NO3 is the only variable exhibiting a normal distribution. While NO3 data were available for 227 samples, which is considerably fewer than other variables (1551–1919 samples), its normality may reflect the efficient removal of extreme contamination‐related outliers by the Iterative 2σ and CDF methods. In some aquifers, NO3 contamination is widespread and relatively uniform, forming a new population with low variability and a mean far above NBLs (Mastrocicco et al. 2012). The calculated upper threshold for NO3 (25–30 mg/L), much higher than typical natural values (< 10 mg/L), supports this interpretation (Capri and Civita 2009). Although the smaller dataset may contribute to the observed normality, the Lilliefors test remains reliable for limited sample sizes (Razali and Wah 2011).

For NBL estimation, when only one of the Iterative 2σ or CDF methods yields normally distributed data, the corresponding upper threshold is taken as the NBL. If both methods satisfy the T < Tcrit criterion, the final NBL is the maximum of their thresholds (Amiri et al. 2021, 2024). If neither method produces normality, the deterministic 95th percentile is used (Urresti‐Estala et al. 2013; Bulut et al. 2020). Table 2 and Figure S3 present the calculated NBL ranges. Because probabilistic methods often failed to normalize the data, the 95th percentile was applied for most variables. In general, the resulting NBLs were higher than REF values.

TABLE 2.

Calculated NBL values using the CDF and Iterative 2σ methods for the 2011–2023 period.

Parameter Iterative 2σ CDF NBL (iterative 2σ, CDF, 95th perc.) REF NBL/REF TV
Min. Max. Ave. 95th perc. Min. Max. Ave. 95th perc.
EC 272.00 1126.00 699.70 1075.80 232.00 1942.00 1087.00 1748.95 1748.95 1500 1.17 1748.6
SO4 6.24 439.95 188.22 380.40 6.24 378.00 192.12 353.02 380.40 250 1.52 380.4
Cl 3.90 71.25 37.38 67.36 3.90 153.14 78.52 139.32 139.32 250 0.56 194.7
pH 7.20 8.21 7.70 8.14 7.10 8.30 7.70 8.20 8.20 8.5 0.96 8.4
HCO3 157.90 302.33 230.21 290.42 106.49 367.20 236.84 326.81 326.81 300 1.09 326.8
Ca 17.03 106.41 60.54 101.20 17.03 130.06 73.55 118.85 118.85 200 0.59 159.4
K 0.02 3.13 1.53 3.13 0.07 3.84 1.96 3.52 3.52 12 0.29 7.0
Mg 4.25 41.43 22.84 38.84 3.04 66.46 34.75 59.07 59.07 150 0.39 104.5
Na 0.92 165.53 75.51 151.73 0.92 223.69 112.31 212.90 212.90 200 1.06 212.9
NO3 4.20 25.10 14.68 23.40 4.20 30.40 17.30 28.57 30.40 50 0.61 40.2

Note: REF (reference value) is the MPL (maximum pollution limit for drinking water).

The calculated NBLs and TVs (2011–2023) from the Iterative 2σ and CDF methods show strong consistency, particularly for EC and SO4. The NBLs of EC (1748.95 μS/cm) and SO4 (380.4 mg/L) exceed standard limits (1500 and 250 mg/L, respectively), indicating dominant geogenic sources such as dissolution of gypsum and anhydrite (Mondal et al. 2020; Gao, Qian, Huo, et al. 2020). Although minor anthropogenic effects may occur, the increases appear primarily natural.

In contrast, Cl (139.32 mg/L) and NO3 (30.4 mg/L) NBLs remain below their limits (250 and 50 mg/L). Low chloride suggests minimal human influence (Pulido‐Velazquez et al. 2022), whereas the moderately high nitrate relative to natural background may reflect agriculture or organic matter mineralization (Kim et al. 2015; Huan et al. 2020). The Na NBL (212.9 mg/L) slightly exceeds the 200‐mg/L limit, likely due to dissolution of Na‐rich minerals (Molinari et al. 2019).

Other parameters show mostly natural origins: pH (8.2) reflects carbonate buffering (Amiri, Sohrabi, et al. 2023; Preziosi, Parrone, Del Bon, and Ghergo 2014), HCO3 (326.81 mg/L) slightly exceeds the standard due to carbonate weathering (Coetsiers et al. 2009), and K (3.52 mg/L) remains below its limit, consistent with feldspar weathering and adsorption onto clays (Mondal et al. 2020).

In addition to the main dataset comprising all samples collected from the 2011–2012 to 2022–2023 hydrological year, the NBL and TV values were also calculated for each individual year (presented in Tables S7 and S8, respectively) and compared with the values obtained in the first stage. The results of the NBL and TV calculations are presented in Figure 3.

FIGURE 3.

FIGURE 3

NBL (top) and TV (bottom) values of physicochemical variables in different statistical years.

The temporal analysis of NBL values for groundwater physicochemical parameters from 2011 to 2023 reveals the combined influence of hydrogeological, climatic, and anthropogenic factors on the regional hydrogeochemical system. As noted by Preziosi, Parrone, and Del Bon (2014) and Mondal et al. (2020), temporal NBL variability reflects dynamic interactions between natural processes and human activities.

NBL results show considerable variability for most parameters, highlighting simultaneous natural and anthropogenic influences. EC ranged from 1274 to 2780 μS/cm, attributed to variations in water mixing and evapotranspiration (Edmunds and Shand 2008). The EC increase between 2011 and 2013 likely indicates drought effects and aquifer overextraction (Karunanidhi et al. 2021). SO4 (114–460 mg/L) variations reflect dissolution intensity of evaporite formations such as gypsum and anhydrite (Biddau et al. 2017), occasionally enhanced by industrial wastewater (Amiri, Sohrabi, et al. 2023). Changes in Cl (56–155 mg/L) suggest mixing of different water sources and surface runoff (Pulido‐Velazquez et al. 2022), whereas wastewater intrusion also plays a role (Busico et al. 2020).

Other parameters, including pH (7.9–8.4) and HCO3 (296–391 mg/L), indicate stability of the carbonate buffering system (Amiri, Sohrabi, et al. 2023; Coetsiers et al. 2009). Variability in Ca (109–138 mg/L) and Mg (31–80 mg/L) reflects fluctuations in carbonate and dolomite dissolution (Molinari et al. 2019; Gao, Qian, Huo, et al. 2020). Limited K variability (0.2–4.7 mg/L) corresponds to adsorption onto clays and slow feldspar weathering (Mondal et al. 2020), with possible agricultural contributions. Na (160–264 mg/L) derives from dissolution of sodium‐bearing minerals (Kim et al. 2015) and anthropogenic sources such as urban and industrial effluents (Sohrabi et al. 2021).

Overall, comparisons of annual and multiyear averages show that natural controls (precipitation, evaporation, and aquifer level changes) and human activities (agriculture, overextraction, and wastewater discharge) jointly shape groundwater chemistry. These findings align with Sellerino et al. (2019) and Parrone et al. (2019), underscoring the need for integrated water management. Exceedance of REF values may result from deep geological contributions such as tectonic fluid upwelling or hydrothermal activity (Sellerino et al. 2019). In years where outliers skew data distributions, NBL estimation may be unreliable; hence, the IGT method using iterative outlier removal is recommended as a more robust approach (Parrone et al. 2019).

The Grubbs test, by systematically removing outliers, helps reduce bias in the dataset. Parameters such as pH showed the smallest proportion of identified outliers, indicating that their variability is largely controlled by natural hydrogeochemical processes. Likewise, SO4 retained approximately 86.9% of the original observations after the iterative procedure, suggesting that only a limited proportion of measurements were identified as outliers. These findings indicate that sulfate concentrations are predominantly controlled by natural geochemical processes, with localized anthropogenic influences. Consequently, the IGT method provides a reliable estimate of the NBL for these parameters.

In contrast, parameters such as Mg (55.44%), EC (3.49%), and Cl (96.58%) exhibit the highest percentages of outliers, reflecting the influence of point‐source anthropogenic activities (e.g., urban wastewater, agricultural runoff, or industrial discharge) or local natural processes such as interlayer salt dissolution (Amiri et al. 2021). Removing these outliers is essential for calculating the true NBL; otherwise, the mean would be biased toward higher values, leading to an overestimation of the NBL.

The choice of an appropriate statistical method for determining the TV or background threshold value (BTV) has a direct impact on the accuracy of contamination detection and the distinction between natural and anthropogenic sources. In this study, in addition to iterative methods including CDF, Iterative 2σ, and IGT, the applicability of three statistical methods, i.e., parametric 95% UTL, nonparametric 95% UTL, and bootstrap 95% UTL, for calculating TV was evaluated (Table S9 and Figure 4).

FIGURE 4.

FIGURE 4

Changes in TV values calculated by different approaches.

Based on the data presented in Table 3, the IGT method consistently provides the lowest values for all variables, indicating its high efficiency in removing outliers and identifying the pure natural background concentrations. For example, the TV calculated for Cl using the IGT method (112 mg/L) is significantly lower than those obtained by other methods, reflecting the strong influence of anthropogenic sources on the concentration of this parameter. This finding is consistent with Preziosi, Parrone, Del Bon, and Ghergo (2014), demonstrated that outlier‐removal‐based methods such as IGT are more suitable for determining NBL of various elements in areas affected by human activities.

TABLE 3.

Statistical summary of the original data and the residual data after outlier removal for NBL calculation based on the IGT method.

Variable Original samples Remaining samples NBL NBL/REF TV
Num. of samples Change in dataset size (%) Min. Max. Mean Std. dev.
Na (mg/L) 1830 1176 −35.7 0.9 159.1 73.9 43.8 146.7 0.73 173.3
Ca (mg/L) 1663 1014 −39.0 19.2 92.0 55.5 18.7 87.8 0.44 143.9
Mg (mg/L) 1551 860 −44.6 5.2 38.9 22.0 8.6 36.6 0.24 73.1
K (mg/L) 1663 1221 −26.6 0.0 3.1 1.5 0.8 3.1 0.26 6.3
SO4 (mg/L) 1551 1398 −9.9 6.2 434.7 187.7 126.2 380.4 1.52 380.4
HCO3 (mg/L) 1551 1076 −30.6 161.6 297.4 229.6 34.7 288.3 0.96 294.1
Cl (mg/L) 1718 705 −59.0 8.2 58.5 32.8 13.2 56.0 0.22 112.0
NO3 (mg/L) 226 142 −37.2 7.7 22.9 15.0 4.1 22.9 0.5 36.5
pH (−) 1752 1587 −9.4 7.2 8.2 7.7 0.3 8.1 0.96 8.3
EC (μS/cm) 1919 973 −49.3 286.0 1112.0 698.0 211.7 1067.3 0.71 1283.7

Significant variations in SO4 values calculated using different methods (from 380.4 mg/L with the IGT method to 817.9 mg/L with the parametric 95% UTL) reflect the combined influence of natural and anthropogenic sources on its concentration. Higher values obtained from parametric and nonparametric methods mainly reflect the influence of natural sources such as dissolution of evaporite formations (gypsum and anhydrite), oxidation of sulfide minerals, and intrusion of saline waters. In contrast, lower values from the IGT, CDF, and Iterative 2σ methods, which are based on outlier removal, indicate the success of these methods in identifying and eliminating contributions from anthropogenic sources.

For EC and Na, the parametric 95% UTL method shows the highest values, which may result from the method's sensitivity to outliers. Conversely, the IGT method provides significantly lower values, highlighting the substantial impact of human activities on these parameters. These findings are consistent with Mondal et al. (2020), who suggested the bootstrap method as a robust approach for determining UTL.

For NO3, the value obtained using the IGT method (36.5 mg/L) is lower than those from other methods, demonstrating the method's ability to identify and remove contributions from anthropogenic pollution. On the other hand, the relative consistency of values across different methods for HCO3 and pH indicates the natural origin of these variables and their relatively uniform distribution within the water system.

For predominantly geogenic variables such as Ca and Mg, differences among methods are smaller, reflecting the control of natural processes over the variability of these elements. This observation aligns with Panda et al. (2022), who found that different methods produce similar results for naturally sourced parameters.

The close agreement between TV values determined by the bootstrap and nonparametric 95% UTL methods for most variables indicates the similar performance of these two approaches in estimation. Both methods are nonparametric and do not rely on distributional assumptions. The nonparametric 95% UTL method directly uses the 95th percentile of the data, whereas the bootstrap method approximates the empirical distribution of the same statistic through repeated resampling. In datasets with sufficient sample size (as in this study) and relatively stable distributions, these two methods naturally converge to similar results. Furthermore, the similarity may also be due to the similar influence of outliers on both methods (Preziosi, Parrone, and Del Bon 2014).

Considering environmental concerns and the need to identify contamination TVs, the IGT method, by providing lower TV values, offers a more conservative approach, which is crucial for environmental risk management. Additionally, the IGT method more effectively removes values associated with anthropogenic activities. The Bootstrap method is recommended as a complementary approach, particularly for understanding the natural variability of the system, as it is useful for determining confidence intervals and assessing uncertainty (Panda et al. 2022).

Based on the TV values for physicochemical variables, the concentration distributions of these variables for the final year of the statistical period (hydrological Year 2022–2023) are presented in Figure 5.

FIGURE 5.

FIGURE 5

Spatial variations in the concentration of variables and their corresponding TVs.

The estimated NBL values obtained in this study are generally consistent with those reported for several semiarid aquifers in Iran. For example, previous studies conducted in the Urmia and Fereidan aquifers reported elevated natural background concentrations of EC, SO4, and Na due to intensive water–rock interaction, evaporite dissolution, and prolonged groundwater residence time (Amiri et al. 2021; Amiri et al. 2024). Similar patterns have also been observed in other semiarid groundwater systems where natural salinization represents the dominant control on groundwater chemistry. These comparisons further support the reliability of the proposed statistical framework and demonstrate that the estimated NBLs reasonably reflect the hydrogeochemical characteristics of the Qazvin aquifer.

4.3. Contribution of Anthropogenic Activities to Groundwater Chemistry Changes

PAC results for 112 groundwater samples collected in the hydrological Year 2022–2023 are presented in Table S10. PAC analysis identified Cl, EC, Na, and Mg as the principal indicators of anthropogenic influence within the groundwater system. Chloride exhibited the highest frequency of positive PAC values, reflecting widespread impacts from wastewater discharge, industrial activities, and agricultural return flow. Elevated EC values further indicate increased dissolved solids associated with these anthropogenic inputs. Sodium and magnesium also showed considerable anthropogenic enrichment, although their distributions suggest that natural geochemical processes continue to contribute to their concentrations. Collectively, these results demonstrate that groundwater chemistry is controlled by both natural hydrogeochemical evolution and human activities, with anthropogenic effects becoming increasingly pronounced in the central and southern parts of the aquifer. These findings demonstrate the widespread and diverse influence of anthropogenic sources on the groundwater system. In addition to the primary dataset, PAC values were determined for samples containing NO3. Among a total of 216 samples collected in 2023, 67 samples exhibited positive PAC values (Figure 6).

FIGURE 6.

FIGURE 6

Distribution of the calculated PAC values for the physicochemical variables.

The spatial analysis of PAC for Cl reveals a clear pattern shaped by geological, hydrogeological, and anthropogenic factors. Very high PAC values are concentrated in the southern and southeastern parts of the plain, consistent with the north–south groundwater flow and hydrochemical evolution. This distribution suggests gradual contaminant transfer from upstream agricultural, industrial, and residential areas toward central and southern regions. In contrast, peripheral zones outside the main aquifer, which are characterized by hard formations and shallow wells, show considerably lower PAC values due to higher rainfall, shorter residence times, and reduced water–sediment interaction. Geologically, gypsum and upper red salt formations along the western margin act as natural Cl sources, whereas carbonate formations in the east contribute less due to limited outcrop. Anthropogenic activities, including industrial clusters in the eastern half and industrial–agricultural effluent discharge, markedly increase PAC for Cl in central and southern areas.

The PAC spatial distribution for EC shows high values mainly in the southern and southwestern parts of the plain, corresponding to the downstream end of groundwater flow and zones with longer residence times. This pattern reflects the cumulative southward transport of salts and contaminants, further intensified by the influence of gypsum and salt formations in the west (Figure 6).

The spatial pattern of PAC for Mg is similar to other quality‐related parameters such as Ca and Na, indicating combined natural and anthropogenic control. High PAC values occur mostly in the southern and southwestern regions. Gypsum and salt units in the west and carbonate–dolomite formations in the east serve as natural Mg sources. However, in several central and southern locations, PAC values exceed the NBL, pointing to significant human influence (Figure 6).

The spatial distribution of PAC for NO3 shows elevated values in the northern and southeastern parts of the plain. Key factors include permeable Quaternary sediments in the northern and central alluvial fans, the general groundwater flow direction, and dense agricultural and industrial activity in central and eastern areas. Persistent groundwater level decline in recent years has further intensified nitrate concentrations (Figure 6).

4.4. Identification of Hydrochemical Facies Using SVM and Gradient Boosting

In this study, the Python code developed by Díaz‐González et al. (2021) was executed in the RStudio environment, and results were obtained for different classification models. After running the various models, the classification results of groundwater samples collected from the groundwater quality monitoring network during 2011–2012 to the hydrological Year 2022–2023 were analyzed. Subsequently, the results for the hydrological year 2022–2023 (Table 4) are presented as an illustrative example.

TABLE 4.

Statistical summary of the classification results for the different models.

Chemical facies GMC WClassCB WClassCB hybrid WClassVL WClassVL hybrid WClassVP WClassVP hybrid WClassVR WClassVR hybrid
Ca‐HCO3 14 (10.2%) 1 (0.7%) 0 (0.0%) 14 (10.2%) 13 (9.5%) 14 (10.2%) 9 (6.6%) 0 (0.0%) 0 (0.0%)
Mg‐HCO3 1 (0.7%) 5 (3.6%) 0 (0.0%) 1 (0.7%) 1 (0.7%) 1 (0.7%) 1 (0.7%) 0 (0.0%) 0 (0.0%)
Na‐Cl 25 (18.2%) 22 (16.1%) 18 (13.1%) 25 (18.2%) 22 (16.1%) 25 (18.2%) 20 (14.6%) 25 (18.2%) 22 (16.1%)
Na‐HCO3 95 (69.3%) 106 (77.4%) 102 (74.5%) 95 (69.3%) 97 (70.8%) 95 (69.3%) 98 (71.5%) 103 (75.2%) 105 (76.6%)
Na‐SO4 2 (1.5%) 3 (2.2%) 3 (2.2%) 2 (1.5%) 2 (1.5%) 2 (1.5%) 2 (1.5%) 9 (6.6%) 8 (5.8%)
Mixed/other 0 (0.0%) 0 (0.0%) 14 (10.2%) 0 (0.0%) 2 (1.5%) 0 (0.0%) 7 (5.1%) 0 (0.0%) 2 (1.5%)
All samples 137 137 137 137 137 137 137 137 137

Note: Mixed/other: encompasses all combined classifications such as Na‐Mg‐HCO3 and Na‐Ca‐Cl.

The results indicate that all models consistently identified the Na‐HCO3 facies as the predominant groundwater hydrochemical facies, accounting for approximately 69%–77% of the analyzed samples. This finding highlights the dominant role of water–rock interaction and cation exchange processes in controlling groundwater chemistry within the study area.

The WClassCB and WClassVP models, along with their hybrid versions, show a clear tendency to assign samples to the Na‐HCO3 class. These models largely ignored samples belonging to Ca‐HCO3 and Mg‐HCO3 hydrochemical facies, assigning them instead to the Na‐HCO3. This represents a limitation of this group of models.

One of the most notable results is the emergence of mixed hydrochemical facies in the outputs of the hybrid models. For example, the WClassCB hybrid model assigned 14 samples (2.10%) and the WClassVP hybrid model assigned seven samples (1.5%) to mixed hydrochemical facies. This indicates that the hybrid models enable a better representation of the chemical complexity of samples, providing a more realistic classification rather than forcing assignment to a single pure hydrochemical facies, which could be misleading.

The WClassVL and WClassVL hybrid models, in terms of statistical distribution, produced results closest to the reference GMC model. The reported percentages for the main hydrochemical facies (Na‐HCO3, Na‐Cl, and Ca‐HCO3) are consistent with those of GMC. In contrast, the WClassVR model and its hybrid version show an unusual tendency to classify samples in the Na‐SO4 class (6.6% and 8.5%, respectively, compared to 1.5% in the GMC method).

To assess the performance and accuracy of the models in identifying hydrochemical facies, a confusion matrix was used (Solangi et al. 2024; Gurram et al. 2025). This approach evaluates each model's ability to classify samples and its agreement with the GMC reference. Confusion matrix results for the two WClassCB models are presented in Table S11, showing correctly classified samples (main diagonal) and misclassifications (off‐diagonal).

Overall, the WClassCB model demonstrated strong classification performance, particularly for the dominant Na‐HCO3 facies, which achieved high precision and recall. In contrast, classification accuracy for the less frequent Ca‐HCO3 facies was considerably lower, indicating a tendency to assign transitional samples to the dominant hydrochemical facies. Similar classification patterns have been reported in previous ML studies of groundwater hydrochemistry and reflect the gradual nature of hydrochemical evolution rather than abrupt class boundaries. For the Na‐Cl class, accuracy is 0.86, recall is 0.76, and F1‐score is ~0.80. In contrast, performance for Ca‐HCO3 is poor, with only one of 14 samples correctly identified. The model shows a strong tendency to classify Ca‐HCO3 and Mg‐HCO3 as Na‐HCO3, likely due to threshold definitions for dominant cations. A bidirectional error also occurs between Na‐Cl and Na‐HCO3, where six Na‐Cl samples were misclassified as Na‐HCO3 and three Na‐HCO3 samples as Na‐Cl.

To avoid repeated explanation of individual confusion matrices, overall comparisons for all models against GMC are provided using accuracy and F1‐score metrics as summarized in Table S12. Results show that most models, particularly WClassCB and WClassVP, tend to classify Ca‐HCO3 as Na‐HCO3. In all model pairs except WClassVL and WClassVL hybrid, hybrid models outperform their standalone versions, demonstrating the efficiency of combining ML algorithms with geochemical rules. These models also better identify mixed types (e.g., Ca‐Na‐HCO3), which is essential for recognizing evolving hydrochemical conditions. Previous studies confirm that hybrid models outperform single algorithms by reducing sensitivity to initial parameters and improving prediction reliability (Gurram et al. 2025; Sihag et al. 2023).

Among all evaluated models, WClassVL and WClassVL hybrid show the closest agreement to the reference, with accuracy above 93%. These models also excel in identifying rare hydrochemical facies such as Mg‐HCO3 and Na‐SO4. Mixing between the Na‐Cl and Na‐HCO3 facies was observed in nearly all classification models. This behavior is expected because these facies commonly represent successive stages of groundwater evolution and are influenced by similar hydrogeochemical processes, including ion exchange, mineral dissolution, and groundwater mixing. Consequently, samples located near the transition between these facies are more likely to be classified differently by individual models.

Cohen's Kappa values (Table S13) indicate “almost perfect” agreement (κ > 0.85) for WClassVL and WClassVL hybrid with the GMC model, further confirming their high accuracy. Among hybrid models, hybridization consistently improves agreement. Fleiss' Kappa, used to measure overall agreement among all models, yields κ = 0.75, indicating substantial agreement despite some disagreements in transitional samples.

Stability and certainty analyses (Dietterich 2000; Hastie et al. 2009; Guo et al. 2017) were conducted to identify samples requiring further review. A certainty index was assigned to each sample based on model voting. For the 2022–2023 dataset, mean and median certainty values are 89.9% and 100%, respectively, with 87 samples (63.5%) classified with full certainty. The detailed certainty statistics are provided in Figure S4. Six samples exhibit less than 60% certainty. Such uncertainty may arise from analytical uncertainties, local geological heterogeneity, or transitional hydrochemical compositions that place some groundwater samples near the boundaries between hydrochemical facies. Consequently, these samples are more difficult to classify consistently across different models. These samples, listed in Table S14, likely lie at boundaries between hydrochemical facies (e.g., mixtures of Na‐HCO3 and Ca‐HCO3). Their spatial distribution can help identify mixing zones or areas influenced by multiple hydrogeochemical processes. The spatial distributions are illustrated in Figure S5.

Samples S81, S42, and S14, located southwest of the aquifer boundary at higher elevations, may reflect distinct recharge sources, rapid infiltration from rainfall, or interactions with local geological units, explaining their inconsistent classifications. Samples S81, S11, and S42 were classified as Ca‐HCO3 by GMC but as Na‐HCO3 or mixed types by several models. These represent transitional waters mixing between younger Ca‐HCO3 waters and older Na‐HCO3 waters enriched through ion exchange (Chae et al. 2006). For Sample S14, all models identified Na‐Cl, but hybrid models indicated minor HCO3 or Ca components, suggesting partial mixing or dissolution of evaporitic formations.

Samples S60 and S61 show the greatest classification disagreement, with predictions spanning Na‐HCO3, Na‐Cl, and Na‐SO4. Hybrid models suggest complex mixed types, indicating simultaneous influence of anthropogenic pollution (e.g., NO3, Cl, and SO4 enrichment), mixing of shallow fresh and deeper saline water, or dissolution of evaporites. These samples may lie within a fresh–saline transition zone where parameter values fall near class thresholds, reducing classification certainty.

Sample S11 appears to reflect multisource pollution in the northern area, influenced by urban wastewater, industrial leakage, chemical fertilizers, and mixing with natural groundwater, producing a chemically inconsistent composition that lowers classification certainty.

Groundwater hydrochemical facies remained generally stable throughout the study period despite changes in the monitoring network (Figure 7). Na‐HCO3 and Na‐Cl consistently represented the dominant facies, indicating that the overall hydrochemical framework of the aquifer remained relatively stable over the decade. Although several individual wells exhibited changes in hydrochemical facies, these variations mainly reflected local hydrogeological conditions, groundwater abstraction, and mixing processes rather than basin‐wide changes.

FIGURE 7.

FIGURE 7

Temporal evolution of the two dominant groundwater hydrochemical facies during the 2011–2023 hydrological years.

Ca‐HCO3 and Mg‐HCO3 types appear intermittently and at low frequency. Since these types are mostly monitored near groundwater recharge areas and indicate fresh groundwater with little influence from human or natural contamination, they suggest that groundwater is affected both by human activities and natural interactions with the solid aquifer matrix.

Some samples (e.g., S5, S17, S38, and S64) have changed type over time, which may indicate changes in the source of recharge water, environmental influences, or overall hydrochemical conditions of the aquifer due to fluctuations in groundwater extraction and pumping of waters with different types.

Based on continuous data collected from 66 observation wells over a 10‐year period (2011–2012 to 2020–2021), the temporal and spatial trends of groundwater hydrochemistry in the study area were analyzed (Figure 8). The initial spatial distribution pattern of chemical types for the 2011–2012 hydrological year (Figure 8, left) shows that it was primarily influenced by the intrinsic geological and hydrogeological factors of the basin. In this year, Na‐HCO3 and Na‐Cl types were the dominant types in the area, with approximate frequencies of 43% and 40%, respectively. The spatial distribution of these types follows a distinct pattern: Chloride types are generally located in the downstream sections (such as S45, S82, and S133), whereas bicarbonate types (such as S21, S20, and S19) are situated in the upstream areas, adjacent to geologically resistant units. This pattern aligns closely with Chebotarev's hydrochemical sequence hypothesis, which describes the progression of water type from bicarbonate to sulfate and ultimately to chloride along the direction of groundwater flow (Chebotarev 1955).

FIGURE 8.

FIGURE 8

Groundwater type in the 2011–2012 (left) and 2020–2021 (right) hydrological years, showing the spatial distribution of dominant hydrochemical facies across the study area.

The expansion of Na‐Cl facies toward the central and upstream parts of the aquifer suggests progressive secondary salinization. Two principal mechanisms may explain this pattern. First, intensive groundwater abstraction lowers the water table and enhances evaporation from the saturated zone, thereby increasing dissolved ion concentrations (Hounslow 1995; Appelo and Postma 2005). Second, external saline water may enter the aquifer through fault‐controlled pathways or reverse hydraulic gradients induced by long‐term groundwater depletion (Amiri and Asgari‐Nejad 2022; Werner et al. 2013). Both mechanisms contribute to groundwater salinization and accelerate the hydrochemical evolution of the aquifer.

By the mid‐decade (2015–2016 to 2018–2019), the data indicate the beginning of a change in water chemistry behavior. During these years, although the dominant types remain unchanged, several samples experience notable shifts in their subtypes. For instance, well S5 exhibits a fully dynamic sequence change from Mg‐HCO3 to Na‐HCO3, then to Na‐SO4 and Na‐Cl, and back to Na‐HCO3, reflecting severe water table fluctuations and mixing with waters of different origins due to overextraction. Similarly, well S17 shifts from a stable Na‐Cl type to Na‐HCO3. This unusual phenomenon, where water reverts from a more evolved type to a more primary type, can be explained by the concept of the invasion of modern water (Cartwright et al. 2007). It appears that sharp groundwater declines due to pumping have increased the hydraulic gradient, allowing modern bicarbonate‐type waters from distant areas to intrude into the aquifer system.

Additionally, a subtype change in a sample such as S64 from Na‐Cl to Na‐HCO3 in the final year, although seemingly positive, may serve as a warning. This change might not indicate quality improvement but rather temporary dilution from a heavy rainfall event or local wastewater infiltration, temporarily altering ion ratios. Overall, the dominance of Na over Ca in most samples, where Ca combined with HCO3 represents fresh water, may indicate weathering of sodium‐bearing silicates or ion exchange of Ca and Mg with Na (Hounslow 1995; Kortatsi 2007).

Almost complete stability of chemical types at certain points, such as S14, S21, S41, and S133, across all years suggests that these wells are either fed by a fully independent and stable water source (e.g., deep baseflow from hard formations) or are minimally affected by human activities. Conversely, severe instability in samples such as S5 and S38 indicates high vulnerability, exposure to multiple contamination sources, and hydrogeological fluctuations. In other words, changes in groundwater flow paths or human impacts, such as agriculture and possibly industrial wastewater, continuously alter ion ratios.

Examining temporal variations in specific samples provides important insights into the hydrochemical dynamics of the area. For example, sample S13 shows an interesting transition from Na‐Cl to Na‐HCO3 and back to Na‐Cl, indicating a competition between ion exchange processes and the influence of different water sources. These fluctuations may be influenced by seasonal water table variations or changes in recharge rates (Freeze and Cherry 1979). Sample S27 also shows significant changes (Na‐SO4 to Na‐HCO3), which may be related to the reduced influence of sulfate sources or increased silicate weathering. On the other hand, long‐term stable samples like S29 and S41 represent systems with long residence times and stable chemical equilibrium, likely in contact with uniform geological formations.

Overall, while geological factors remain the primary controls of the region's hydrochemical framework, over the decade, human pressures, especially excessive groundwater extraction, have become the main driver of water quality changes and degradation. These pressures disrupt the natural equilibrium, intensify concentration processes, promote abnormal mixing of waters from different origins, and ultimately cause the advancement of saline zones toward the center of the aquifer.

5. Conclusion

This study demonstrated that integrating advanced statistical and ML methodologies provides a powerful and objective framework for groundwater quality assessment. The IGT outperformed other approaches by efficiently removing anthropogenic outliers and identifying true natural baselines for major ions. The Iterative 2σ and CDF methods complemented the analysis by providing alternative statistical estimates that reflected the variability of the dataset after iterative outlier treatment. Furthermore, by employing advanced parametric and nonparametric methods, ProUCL 5.2 was employed as the statistical platform to estimate NBLs and TVs using established parametric and nonparametric approaches, thereby providing a consistent basis for comparing different threshold estimation methods. Applying 7hlr log‐ratio transformation and SVM/CatBoost models significantly improved the accuracy of hydrochemical facies classification compared with traditional diagrams, achieving excellent agreement (κ > 0.85) with reference classifications. These models not only enhanced interpretability but also identified mixed hydrochemical facies and transition processes between facies.

Beyond its methodological contributions, the proposed framework provides practical guidance for groundwater monitoring and environmental management. By integrating statistically derived NBLs with ML‐based hydrochemical facies classification, the framework enables more reliable identification of anthropogenic contamination, supports evidence‐based prioritization of monitoring programs, and facilitates early detection of groundwater quality deterioration. The methodology is readily transferable to other complex aquifer systems and can assist environmental agencies in establishing scientifically defensible groundwater quality thresholds, designing monitoring networks, and developing sustainable groundwater protection strategies under increasing climatic and anthropogenic pressures.

Author Contributions

Vahab Amiri: conceptualization, data curation, methodology, software, validation, visualization, writing – original draft. Peiyue Li: discussion, writing – original draft, writing – review and editing. Mehdi Torabi‐Kaveh: writing – review and editing.

Funding

This work was supported by the Iran National Science Foundation (INSF) under grant number 4044547.

Conflicts of Interest

The authors declare no conflicts of interest.

Supporting information

Figure S1: Distribution of geological units in the study area (Complete descriptions of geological units are available in the 1:100,000 sheets of Qazvin, Eshtehard, Takestan, and Khiyarj.).

Figure S2: Normality status of physicochemical components in the 2011–2023 dataset.

Figure S3: NBLs calculated using the CDF (right) and Iterative 2σ (left) methods in 2011–2023.

Figure S4: The certainty index of ML models in identifying groundwater quality classes.

Figure S5: Samples with the least certainty in determining the quality class.

Table S1: Summary statistics of the main dataset from water Year 2010–2011 to 2022–2023.

Table S2: Statistical summary of the nitrate dataset collected in the 2022–2023 water year.

Table S3: Statistical summary of the nitrate dataset collected in June and July 2023.

Table S4: Statistical summary of the nitrate dataset collected in the drinking water network.

Table S5: Statistical summary of the dataset from 2011 to 2023.

Table S6: Normality test of variables before calculating NBL.

Table S7: Changes in the calculated NBLs by CDF and Iterative 2σ methods for different hydrological years.

Table S8: Changes in the calculated TVs by CDF and Iterative 2σ methods for different hydrological years.

Table S9: Comparison of TVs calculated for physicochemical variables by different methods.

Table S10: PAC evaluation results.

Table S11: Confusion matrix for the WClassCB model (columns) versus the reference quality class (rows).

Table S12: Summary of performance metrics of water quality class classification models versus GMC.

Table S13: Cohen's Kappa value for each model compared to the GMC.

Table S14: Model classification results for six samples with the highest uncertainty in determining the quality class.

WER-98-e70521-s001.docx (2.3MB, docx)

Acknowledgments

This study was supported by the Iran National Science Foundation (INSF) under grant number 4044547. The authors gratefully acknowledge the Qazvin Regional Water Company for providing the essential baseline data and their cooperation throughout this research.

Contributor Information

Vahab Amiri, Email: v.amiri@yazd.ac.ir, Email: vahab.amiri@gmail.com.

Peiyue Li, Email: lipy2@163.com, Email: peiyueli@chd.edu.cn.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

References

  1. Abba, S. I. , Pham Q. B., Saini G., et al. 2020. “Implementation of Data Intelligence Models Coupled With Ensemble Machine Learning for Prediction of Water Quality Index.” Environmental Science and Pollution Research International 27: 41524–41539. 10.1007/s11356-020-09689-x. [DOI] [PubMed] [Google Scholar]
  2. Adhikary, P. P. , Dash C. J., Bej R., and Chandrasekharan H.. 2011. “Indicator and Probability Kriging Methods for Delineating Cu, Fe, and Mn Contamination in Groundwater of Najafgarh Block, Delhi, India.” Environmental Monitoring and Assessment 176, no. 1–4: 663–676. 10.1007/s10661-010-1611-4. [DOI] [PubMed] [Google Scholar]
  3. Aju, C. D. , Achu A. L., Mohammed M. P., Raicy M. C., Gopinath G., and Reghunath R.. 2024. “Groundwater Quality Prediction and Risk Assessment in Kerala, India: A Machine‐Learning Approach.” Journal of Environmental Management 370: 122616. 10.1016/j.jenvman.2024.122616. [DOI] [PubMed] [Google Scholar]
  4. Ambrosino, M. , Palarea‐Albaladejo J., Albanese S., Lin X., Ciarcia S., and Cicchella D.. 2025. “Assessing Natural Background Concentrations of Chemical Elements in Urban Soils: A Case Study in Benevento (Italy).” Science of the Total Environment 975: 179298. 10.1016/j.scitotenv.2025.179298. [DOI] [PubMed] [Google Scholar]
  5. Amiri, V. , Ali S., Sohrabi N., and Amiri F.. 2023. “Hydrogeochemical Evaluation With Emphasis on Nitrate and Fluoride in Urban and Rural Drinking Water Resources in Western Isfahan Province, Central Iran.” Environmental Science and Pollution Research 30: 108720–108740. 10.1007/s11356-023-30001-0. [DOI] [PubMed] [Google Scholar]
  6. Amiri, V. , and Asgari‐Nejad M.. 2022. “Hydrogeological Assessment and Estimation of Groundwater Inflow Into the Water Transmission Tunnel to Urmia Lake, Northwestern Iran.” Bulletin of Engineering Geology and the Environment 81: 111. 10.1007/s10064-022-02612-3. [DOI] [Google Scholar]
  7. Amiri, V. , Nakhaei M., Lak R., and Li P.. 2021. “An Integrated Statistical‐Graphical Approach for the Appraisal of the Natural Background Levels of Some Major Ions and Potentially Toxic Elements in the Groundwater of Urmia Aquifer, Iran.” Environmental Earth Sciences 80, no. 12: 432. 10.1007/s12665-021-09733-0. [DOI] [Google Scholar]
  8. Amiri, V. , Sohrabi N., Lak R., and Tajbakhsh G.. 2024. “Estimation of Natural Background Levels of Heavy Metals and Major Variables in Groundwater to Ensure the Sustainable Supply of Safe Drinking Water in Fereidan, Iran.” Environment, Development and Sustainability 26: 19807–19832. 10.1007/s10668-023-03438-z. [DOI] [Google Scholar]
  9. Amiri, V. , Sohrabi N., Li P., and Amiri F.. 2023. “Groundwater Quality for Drinking and Non‐Carcinogenic Risk of Nitrate in Urban and Rural Areas of Fereidan, Iran.” Exposure and Health 15: 807–823. 10.1007/s12403-022-00525-w. [DOI] [Google Scholar]
  10. Apollaro, C. , Di Curzio D., Fuoco I., et al. 2022. “A Multivariate Non‐Parametric Approach for Estimating Probability of Exceeding the Local Natural Background Level of Arsenic in the Aquifers of Calabria Region (Southern Italy).” Science of the Total Environment 806: 150345. 10.1016/j.scitotenv.2021.150345. [DOI] [PubMed] [Google Scholar]
  11. Appelo, C. A. J. , and Postma D.. 2005. Geochemistry, Groundwater and Pollution. 2nd ed. CRC Press. 10.1201/9781439833544. [DOI] [Google Scholar]
  12. Ascott, M. J. , Gooddy D. C., Wang L., et al. 2017. “Global Patterns of Nitrate Storage in the Vadose Zone.” Nature Communications 8, no. 1: 1416. 10.1038/s41467-017-01321-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  13. Barbieri, M. , Barberio M. D., Banzato F., et al. 2023. “Climate Change and Its Effect on Groundwater Quality.” Environmental Geochemistry and Health 45, no. 4: 1133–1144. 10.1007/s10653-021-01140-5. [DOI] [PubMed] [Google Scholar]
  14. Basharat, U. , Zhang W., Han C., et al. 2025. “Optimizing Machine Learning Methods for Groundwater Quality Prediction: Case Study in District Bagh, Azad Kashmir, Pakistan.” Ecotoxicology and Environmental Safety 302: 118610. 10.1016/j.ecoenv.2025.118610. [DOI] [PubMed] [Google Scholar]
  15. Biddau, R. , Cidu R., Lorrai M., and Mulas M. G.. 2017. “Assessing Background Values of Chloride, Sulfate and Fluoride in Groundwater: A Geochemical‐Statistical Approach at a Regional Scale.” Journal of Geochemical Exploration 181: 243–255. 10.1016/j.gexplo.2017.08.002. [DOI] [Google Scholar]
  16. Bondu, R. , Hunter P., Mayer B., et al. 2022. “Estimating Natural Background Concentrations for Dissolved Constituents in Groundwater: A Methodological Review and Case Studies for Geogenic Fluoride.” Journal of Geochemical Exploration 233: 106906. 10.1016/j.gexplo.2021.106906. [DOI] [Google Scholar]
  17. Bulut, O. F. , Duru B., Çakmak O., Günhan O., Dilek F. B., and Yetis U.. 2020. “Determination of Groundwater Threshold Values: A Methodological Approach.” Journal of Cleaner Production 253: 120001. 10.1016/j.jclepro.2020.120001. [DOI] [Google Scholar]
  18. Busico, G. , Bordbar M., Rufino F., Sarracino A., and Tedesco D.. 2024. “Assessment of NO3−, As, and F− Background Levels in Groundwater Bodies: A Methodological Review and Case Study Utilizing Sequential Gaussian Simulation (SGS).” Groundwater for Sustainable Development 26: 101211. 10.1016/j.gsd.2024.101211. [DOI] [Google Scholar]
  19. Busico, G. , Cuoco E., Sirna M., Mastrocicco M., and Tedesco D.. 2019. “Protection From Natural and Anthropogenic Sources A New Rating Methodology to Delineate Nitrate Vulnerable Zone.” Environmental Earth Sciences 78, no. 4: 113. 10.1007/s12665-019-8118-2. [DOI] [Google Scholar]
  20. Busico, G. , Kazakis N., Cuoco E., et al. 2020. “A Novel Hybrid Method of Specific Vulnerability to Anthropogenic Pollution Using Multivariate Statistical and Regression Analyses.” Water Research 171: 115386. 10.1016/j.watres.2019.115386. [DOI] [PubMed] [Google Scholar]
  21. Capri, E. , and Civita M.. 2009. “Assessment of Groundwater Nitrate Pollution in the Lombardy Region (Italy).” Acque Sotterranee Italian Journal of Groundwater 8, no. 1: 7–18. [Google Scholar]
  22. Cartwright, I. , Weaver T. R., and Simmons C. T.. 2007. “Hydrological and Hydrochemical Processes in the Murray Basin, Australia.” Journal of Hydrology 335, no. 1–2: 123–136. [Google Scholar]
  23. Chae, G. , Yun S., Kim K., and Mayer B.. 2006. “Hydrogeochemistry of Sodium‐Bicarbonate Type Bedrock Groundwater in the Pocheon Spa Area, South Korea: Water–Rock Interaction and Hydrologic Mixing.” Journal of Hydrology 321, no. 1–4: 326–343. 10.1016/j.jhydrol.2005.08.006. [DOI] [Google Scholar]
  24. Chebotarev, I. I. 1955. “Metamorphism of Natural Waters in the Crust of Weathering.” Geochimica et Cosmochimica Acta 8, no. 1–2: 22–48. [Google Scholar]
  25. Coetsiers, M. , Blaser P., Martens K., and Walraevens K.. 2009. “Natural Background Levels and Threshold Values for Groundwater in Fluvial Pleistocene and Tertiary Marine Aquifers in Flanders, Belgium.” Environmental Geology 57, no. 5: 1155–1168. 10.1007/s00254-008-1412-z. [DOI] [Google Scholar]
  26. Cohen, J. 1960. “A Coefficient of Agreement for Nominal Scales.” Educational and Psychological Measurement 20, no. 1: 37–46. 10.1177/001316446002000104. [DOI] [Google Scholar]
  27. Cruz, J. V. , and Andrade C.. 2015. “Natural Background Groundwater Composition in the Azores Archipelago (Portugal): A Hydrogeochemical Study and Threshold Value Determination.” Science of the Total Environment 520: 127–135. 10.1016/j.scitotenv.2015.03.057. [DOI] [PubMed] [Google Scholar]
  28. Dalla Libera, N. , Fabbri P., Mason L., Piccinini L., and Pola M.. 2017. “Geostatistics as a Tool to Improve the Natural Background Level Definition: An Application in Groundwater.” Science of the Total Environment 598: 330–340. 10.1016/j.scitotenv.2017.04.018. [DOI] [PubMed] [Google Scholar]
  29. Díaz‐González, L. , Uscanga‐Junco O. A., and Rosales‐Rivera M.. 2021. “Development and Comparison of Machine Learning Models for Water Multidimensional Classification.” Journal of Hydrology 598: 126234. 10.1016/j.jhydrol.2021.126234. [DOI] [Google Scholar]
  30. Dietterich, T. G. 2000. “Ensemble Methods in Machine Learning.” In Multiple Classifier Systems, edited by Kittler J. and Roli F., 1–15. Springer. 10.1007/3-540-45014-9_1. [DOI] [Google Scholar]
  31. Drever, J. I. 1997. The Geochemistry of Natural Waters: Surface and Groundwater Environments. 3rd ed. Prentice Hall. [Google Scholar]
  32. Ducci, D. , Sellerino M., and Ribeiro L.. 2016. “Combining Natural Background Levels (NBLs) Assessment With Indicator Kriging Analysis to Improve Groundwater Quality Data Interpretation and Management.” Science of the Total Environment 569 570: 569–584. 10.1016/j.scitotenv.2016.06.184. [DOI] [PubMed] [Google Scholar]
  33. Durov, S. A. 1948. “Natural Waters and Graphic Representation of Their Compositions.” Doklady Akademii Nauk SSSR 59: 87–90. [Google Scholar]
  34. Edmunds, W. M. , and Shand P.. 2008. Natural Groundwater Quality. Blackwell. [Google Scholar]
  35. Edmunds, W. M. , Shand P., Hart P., and Ward R. S.. 2003. “The Natural (Baseline) Quality of Groundwater: A UK Pilot Study.” Science of the Total Environment 9697, no. 2: 25–35. 10.1016/S0048-9697(02)00620-4. [DOI] [PubMed] [Google Scholar]
  36. European Commission . 2006. “Directive 2006/118/EC on the Protection of Groundwater Against Pollution and Deterioration.” European Commission Official Journal of the European Union L 372: 19–31. [Google Scholar]
  37. Fetter, C. W. 2001. Applied Hydrogeology. 4th ed. Prentice‐Hall. [Google Scholar]
  38. Fleiss, J. L. 1971. “Measuring Nominal Scale Agreement Among Many Raters.” Psychological Bulletin 76, no. 5: 378–382. 10.1037/h0031619. [DOI] [Google Scholar]
  39. Freeze, R. A. , and Cherry J. A.. 1979. Groundwater. Prentice‐Hall. [Google Scholar]
  40. Gao, Y. , Qian H., Huo C., Chen J., and Wang H.. 2020. “Assessing Natural Background Levels in Shallow Groundwater in a Large Semiarid Drainage Basin.” Journal of Hydrology 584: 124638. 10.1016/j.jhydrol.2020.124638. [DOI] [Google Scholar]
  41. Gao, Y. , Qian H., Wang H., Chen J., Ren W., and Yang F.. 2020. “Assessment of Background Levels and Pollution Sources for Arsenic and Fluoride in the Phreatic and Confined Groundwater of Xi'an City, Shaanxi, China.” Environmental Science and Pollution Research 27: 34702–34714. 10.1007/s11356-019-06791-7. [DOI] [PubMed] [Google Scholar]
  42. Geological Survey and Mineral Exploration of Iran . 2002. 1:100,000 Geological Map of Qazvin. Geological Survey and Mineral Exploration of Iran (GSI) Sheet No. 6062. (in Persian). [Google Scholar]
  43. Gong, G. , Mattevada S., and O'Bryant S. E.. 2014. “Comparison of the Accuracy of Kriging and IDW Interpolations in Estimating Groundwater Arsenic Concentrations in Texas.” Environmental Research 130: 59–69. 10.1016/j.envres.2013.12.005. [DOI] [PubMed] [Google Scholar]
  44. Guadagnini, L. , Menafoglio A., Sanchez‐Vila X., and Guadagnini A.. 2020. “Probabilistic Assessment of Spatial Heterogeneity of Natural Background Concentrations in Large‐Scale Groundwater Bodies Through Functional Geostatistics.” Science of the Total Environment 740: 140139. 10.1016/j.scitotenv.2020.140139. [DOI] [PubMed] [Google Scholar]
  45. Guo, C. , Pleiss G., Sun Y., and Weinberger K. Q.. 2017. “On Calibration of Modern Neural Networks.” In Proceedings of the 34th International Conference on Machine Learning, 1321–1330. PMLR. [Google Scholar]
  46. Gurram, A. R. , Pandith M., Yadav A., et al. 2025. “Machine Learning Approaches for Predicting Water Quality Towards Climate‐Resilient Groundwater Management in Southern India.” Hydrology Research 56, no. 8: 754–773. 10.2166/nh.2025.042. [DOI] [Google Scholar]
  47. Handa, B. K. 1965. “Modified Hill‐Piper Diagram for Presentation of Water Analysis Data.” Current Science 34, no. 11: 314. [Google Scholar]
  48. Haselbeck, V. , Kordilla J., Krause F., and Sauter M.. 2019. “Self‐Organizing Maps for the Identification of Groundwater Salinity Sources Based on Hydrochemical Data.” Journal of Hydrology 576: 610–619. 10.1016/j.jhydrol.2019.06.053. [DOI] [Google Scholar]
  49. Hastie, T. , Tibshirani R., and Friedman J.. 2009. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2nd ed. Springer. [Google Scholar]
  50. He, B. , He J., Zeng Y., Sun J., Peng C., and Bi E.. 2022. “Coupling of Multi‐Hydrochemical and Statistical Methods for Identifying Apparent Background Levels of Major Components and Anthropogenic Anomalous Activities in Shallow Groundwater of the Liujiang Basin, China.” Science of the Total Environment 838: 155905. 10.1016/j.scitotenv.2022.155905. [DOI] [PubMed] [Google Scholar]
  51. Helsel, D. R. , Hirsch R. M., Ryberg K. R., Archfield S. A., and Gilroy E. J.. 2020. Statistical Methods in Water Resources. U.S. Geological Survey Techniques and Methods, Book 4, Chapter A3. 10.3133/tm4a3. [DOI] [Google Scholar]
  52. Herms, I. , Jódar J., Soler A., et al. 2021. “Evaluation of Natural Background Levels of High Mountain Karst Aquifers in Complex Hydrogeological Settings. A Gaussian Mixture Model Approach in the Port del Comte (SE, Pyrenees) Case Study.” Science of the Total Environment 756: 143864. 10.1016/j.scitotenv.2020.143864. [DOI] [PubMed] [Google Scholar]
  53. Hounslow, A. W. 1995. Water Quality Data: Analysis and Interpretation. CRC Press. 10.1201/9781482273423. [DOI] [Google Scholar]
  54. Huan, H. , Hu L., Yang Y., et al. 2020. “Groundwater Nitrate Pollution Risk Assessment of the Groundwater Source Field Based on the Integrated Numerical Simulations in the Unsaturated Zone and Saturated Aquifer.” Environment International 137: 105532. 10.1016/j.envint.2020.105532. [DOI] [PubMed] [Google Scholar]
  55. Huang, G. , Song J., Han D., Liu R., Liu C., and Hou Q.. 2023. “Assessing Natural Background Levels of Geogenic Contaminants in Groundwater of an Urbanized Delta Through Removal of Groundwaters Impacted by Anthropogenic Inputs: New Insights Into Driving Factors.” Science of the Total Environment 857: 159527. 10.1016/j.scitotenv.2022.159527. [DOI] [PubMed] [Google Scholar]
  56. Karunanidhi, D. , Aravinthasamy P., Subramani T., and Kumar M.. 2021. “Human Health Risks Associated With Multipath Exposure of Groundwater Nitrate and Environmentally Friendly Actions for Quality Improvement and Sustainable Management: A Case Study From Texvalley (Tiruppur Region) of India.” Chemosphere 265: 129083. 10.1016/j.chemosphere.2020.129083. [DOI] [PubMed] [Google Scholar]
  57. Khosravi, K. , Barzegar R., Golkarian A., et al. 2021. “Predictive Modeling of Selected Trace Elements in Groundwater Using Hybrid Algorithms of Iterative Classifier Optimizer.” Journal of Contaminant Hydrology 242: 103849. 10.1016/j.jconhyd.2021.103849. [DOI] [PubMed] [Google Scholar]
  58. Kim, K.‐H. , Yun S.‐T., Kim H.‐K., and Kim J.‐W.. 2015. “Determination of Natural Backgrounds and Thresholds of Nitrate in South Korean Groundwater Using Model‐Based Statistical Approaches.” Journal of Geochemical Exploration 148: 196–205. 10.1016/j.gexplo.2014.10.001. [DOI] [Google Scholar]
  59. Kortatsi, B. K. 2007. “Hydrochemical Characterization of Groundwater in the Accra Plains of Ghana.” Environmental Geology 52, no. 6: 1051–1062. 10.1007/s00254-006-0546-0. [DOI] [Google Scholar]
  60. Kuhn, M. , and Johnson K.. 2013. Applied Predictive Modeling. Springer. 10.1007/978-1-4614-6849-3. [DOI] [Google Scholar]
  61. Liang, Z. , Zou R., Chen X., Ren T., Su H., and Liu Y.. 2020. “Simulate the Forecast Capacity of a Complicated Water Quality Model Using the Long Short‐Term Memory Approach.” Journal of Hydrology 581: 124432. 10.1016/j.jhydrol.2019.124432. [DOI] [Google Scholar]
  62. Lloyd, J. W. 1965. “The Hydrochemistry of the Aquifers of Northeastern Jordan.” Journal of Hydrology 3: 319–330. 10.1016/0022-1694(65)90089-2. [DOI] [Google Scholar]
  63. Machiwal, D. , Cloutier V., Güler C., and Kazakis N.. 2018. “A Review of GIS‐Integrated Statistical Techniques for Groundwater Quality Evaluation and Protection.” Environmental Earth Sciences 77, no. 19: 681. 10.1007/s12665-018-7872-x. [DOI] [Google Scholar]
  64. Machiwal, D. , and Jha M. K.. 2010. “Tools and Techniques for Water Quality Interpretation.” In Advances in Water Quality Control. Scientific Research Publishing. [Google Scholar]
  65. Mastrocicco, M. , Colombani N., Salemi E., and Castaldelli G.. 2012. “Nitrate Contamination in a Coastal Aquifer Driven by the Interaction Between the Groundwater and the Brine Water.” Environmental Earth Sciences 66, no. 7: 1953–1963. 10.1007/s12665-011-1417-x. [DOI] [Google Scholar]
  66. Matiatos, I. 2016. “Nitrate Source Identification in Groundwater of Multiple Land‐Use Areas by Combining Isotopes and Multivariate Statistical Analysis: A Case Study of Asopos Basin (Central Greece).” Science of the Total Environment 541: 802–814. 10.1016/j.scitotenv.2015.09.134. [DOI] [PubMed] [Google Scholar]
  67. Matschullat, J. , Ottenstein R., and Reimann C.. 2000. “Geochemical Background Can We Calculate It?” Environmental Geology 39, no. 9: 990–1000. 10.1007/s002549900084. [DOI] [Google Scholar]
  68. McHugh, M. L. 2012. “Interrater Reliability: The Kappa Statistic.” Biochemia Medica 22, no. 3: 276–282. [PMC free article] [PubMed] [Google Scholar]
  69. Melesse, A. M. , Khosravi K., Tiefenbacher J. P., et al. 2020. “River Water Salinity Prediction Using Hybrid Machine Learning Models.” Water 12, no. 10: 2951. 10.3390/w12102951. [DOI] [Google Scholar]
  70. Molinari, A. , Guadagnini L., Marcaccio M., and Guadagnini A.. 2012. “Natural Background Levels and Threshold Values of Chemical Species in Three Large‐Scale Groundwater Bodies in Northern Italy.” Science of the Total Environment 425: 9–19. 10.1016/j.scitotenv.2012.03.015. [DOI] [PubMed] [Google Scholar]
  71. Molinari, A. , Guadagnini L., Marcaccio M., and Guadagnini A.. 2019. “Geostatistical Multimodel Approach for the Assessment of the Spatial Distribution of Natural Background Concentrations in Large‐Scale Groundwater Bodies.” Water Research 149: 522–532. 10.1016/j.watres.2018.09.049. [DOI] [PubMed] [Google Scholar]
  72. Mondal, A. , Prabhakar R., and Singh D. K.. 2020. “Evaluation of Parametric and Nonparametric Methods for Estimating the Background Threshold of Groundwater Contaminants.” Environmental Pollution 265: 114890. 10.1016/j.envpol.2020.114890. [DOI] [PubMed] [Google Scholar]
  73. Muller, D. , Blum A., Hart A., et al. 2006. Final Proposal for a Methodology to Set Up Groundwater Threshold Values in Europe. Report to the EU Project “BRIDGE” 2006, Deliverable D18. [Google Scholar]
  74. Nachappa, T. G. , Piralilou S. T., Gholamnia K., Ghorbanzadeh O., Rahmati O., and Blaschke T.. 2020. “Flood Susceptibility Mapping With Machine Learning, Multi‐Criteria Decision Analysis and Ensemble Using Dempster Shafer Theory.” Journal of Hydrology 590: 125275. 10.1016/j.jhydrol.2020.125275. [DOI] [Google Scholar]
  75. Nakic, Z. , Posavec K., and Bacani A.. 2007. “A Visual Basic Spreadsheet Macro for Geochemical Background Analysis.” Ground Water 45, no. 5: 642–647. 10.1111/j.1745-6584.2007.00325.x. [DOI] [PubMed] [Google Scholar]
  76. Nordstrom, D. K. 2011. “Hydrogeochemical Processes Governing the Origin, Transport and Fate of Major and Trace Elements From Mine Wastes and Mineralized Rock to Surface Waters.” Applied Geochemistry 26, no. 11: 1777–1791. 10.1016/j.apgeochem.2011.06.002. [DOI] [Google Scholar]
  77. Panda, B. , Chidambaram S., and Ganesh N.. 2022. “A Comparative Study of Different Statistical Methods for the Determination of Background Level in Groundwater.” Journal of Hydrology 605: 127300. 10.1016/j.jhydrol.2021.127300. [DOI] [Google Scholar]
  78. Parrone, D. , Frollini E., Masciale R., et al. 2022. “A Double Pre‐Selection Method for Natural Background Levels in Coastal Groundwater Bodies.” Environmental Pollution 313: 120076. 10.1016/j.envpol.2022.120076. [DOI] [PubMed] [Google Scholar]
  79. Parrone, D. , Ghergo S., and Preziosi E.. 2019. “A Multi‐Method Approach for the Assessment of Natural Background Levels in Groundwater.” Science of the Total Environment 659: 884–894. 10.1016/j.scitotenv.2018.12.350. [DOI] [PubMed] [Google Scholar]
  80. Pedregosa, F. , Varoquaux G., Gramfort A., et al. 2011. “Scikit‐Learn: Machine Learning in Python.” Journal of Machine Learning Research 12: 2825–2830. [Google Scholar]
  81. Piper, A. M. 1944. “A Graphic Procedure in the Geochemical Interpretation of Water‐Analyses.” Eos, Transactions, American Geophysical Union 25, no. 6: 914–928. 10.1029/TR025i006p00914. [DOI] [Google Scholar]
  82. Preziosi, E. , Parrone D., and Del Bon A.. 2014. “A Natural Background Levels Approach for the Definition of Threshold Values (TV) in Groundwater.” Journal of Geochemical Exploration 143: 43–53. 10.1016/j.gexplo.2014.02.004. [DOI] [Google Scholar]
  83. Preziosi, E. , Parrone D., Del Bon A., and Ghergo S.. 2014. “Natural Background Level Assessment in Groundwaters: Probability Plot Versus Pre‐Selection Method.” Journal of Geochemical Exploration 143: 43–53. 10.1016/j.gexplo.2014.03.015. [DOI] [Google Scholar]
  84. Prokhorenkova, L. , Gusev G., Vorobev A., Dorogush A. V., and Gulin A.. 2018. “CatBoost: Unbiased Boosting With Categorical Features.” Advances in Neural Information Processing Systems 31: 6637–6647. [Google Scholar]
  85. Pulido‐Velazquez, D. , Baena‐Ruiz L., Fernandes J., et al. 2022. “Assessment of Chloride Natural Background Levels by Applying Statistical Approaches. Analyses of European Coastal Aquifers in Different Environments.” Marine Pollution Bulletin 174: 113303. 10.1016/j.marpolbul.2021.113303. [DOI] [PubMed] [Google Scholar]
  86. Qazvin Regional Water Company (QRWC) . 2024. Report on “Determining the Geometry of the Qazvin Plain Aquifer and Presenting a Conceptual Model for It” (in Persian). Qazvin Regional Water Company (QRWC). [Google Scholar]
  87. Rahman, A. , Mondal N. C., and Fauzia F.. 2021. “Arsenic Enrichment and Its Natural Background in Groundwater in the Proximity of Active Floodplains of Ganga River, Northern India.” Chemosphere 265: 129096. 10.1016/j.chemosphere.2020.129096. [DOI] [PubMed] [Google Scholar]
  88. Razali, N. M. , and Wah Y. B.. 2011. “Power Comparisons of Shapiro‐Wilk, Kolmogorov‐Smirnov, Lilliefors and Anderson‐Darling Tests.” Journal of Statistical Modeling and Analytics 2, no. 1: 21–33. [Google Scholar]
  89. Reimann, C. , Filzmoser P., Garrett R. G., and Dutter R.. 2008. Statistical Data Analysis Explained: Applied Environmental Statistics With R. John Wiley & Sons. 10.1002/9780470987605. [DOI] [Google Scholar]
  90. Rivett, M. O. , Buss S. R., Morgan P., Smith J. W. N., and Bemment C. D.. 2008. “Nitrate Attenuation in Groundwater: A Review of Biogeochemical Controlling Processes.” Water Research 42, no. 16: 4215–4232. 10.1016/j.watres.2008.07.020. [DOI] [PubMed] [Google Scholar]
  91. Rodrigues, A. S. L. , Malafaia G., Costa A. T., and Júnior H. A. N.. 2013. “Background Values for Chemical Elements in Sediments of the Gualaxo Do Norte River Basin, Mg, Brazil.” Revista de Ciências Ambientais 7, no. 2: 15–32. 10.18316/1142. [DOI] [Google Scholar]
  92. Rufino, F. , Busico G., Cuoco E., Darrah T. H., and Tedesco D.. 2019. “Evaluating the Suitability of Urban Groundwater Resources for Drinking Water and Irrigation Purposes: An Integrated Approach to the Agro‐Aversano Area of Southern Italy.” Environmental Monitoring and Assessment 191, no. 12: 768. 10.1007/s10661-019-7979-x. [DOI] [PubMed] [Google Scholar]
  93. Salomão, G. N. , Dall'Agnol R., Sahoo P. K., et al. 2018. “Geochemical Distribution and Threshold Values Determination of Heavy Metals in Stream Water in the Sub‐Basins of Vermelho and Sororó Rivers, Itacaiúnas River Watershed, Eastern Amazon, Brazil.” Geochimica Brasiliensis 32, no. 2: 180–198. 10.21715/GB2358-2812.2018322180. [DOI] [Google Scholar]
  94. Salomão, G. N. , Figueiredo M. A., Dall'Agnol R., et al. 2019. “Geochemical Mapping and Background Concentrations of Iron and Potentially Toxic Elements in Active Stream Sediments From Carajás, Brazil—Implication for Risk Assessment.” Journal of South American Earth Sciences 92: 151–166. 10.1016/j.jsames.2019.03.014. [DOI] [Google Scholar]
  95. Sellerino, M. , Forte G., and Ducci D.. 2019. “Identification of the Natural Background Levels in the Phlaegrean Fields Groundwater Body (Southern Italy).” Journal of Geochemical Exploration 200: 181–192. 10.1016/j.gexplo.2019.02.007. [DOI] [Google Scholar]
  96. Shelton, J. L. , Engle M. A., Buccianti A., and Blondes M. S.. 2018. “The Isometric Log‐Ratio (ilr) Ion Plot: A Proposed Alternative to the Piper Diagram.” Journal of Geochemical Exploration 190: 130–141. 10.1016/j.gexplo.2018.03.003. [DOI] [Google Scholar]
  97. Sihag, P. , Tiwari N. K., and Ranjan S.. 2023. “A Review on Hybrid Modeling Techniques for Prediction of Water Quality Parameters: Advances and Future Directions.” Environmental Challenges 12: 100741. 10.1016/j.envc.2023.100741. [DOI] [Google Scholar]
  98. Sohrabi, N. , Kalantari N., Amiri V., et al. 2021. “A Probabilistic‐Deterministic Analysis of Human Health Risk Related to the Exposure to Potentially Toxic Elements in Groundwater of Urmia Coastal Aquifer (NW of Iran) With a Special Focus on Arsenic Speciation and Temporal Variation.” Stochastic Environmental Research and Risk Assessment 35: 1509–1528. 10.1007/s00477-020-01934-6. [DOI] [Google Scholar]
  99. Solangi, G. S. , Ali Z., Bilal M., et al. 2024. “Machine Learning, Water Quality Index, and GIS‐Based Analysis of Groundwater Quality.” Water Practice and Technology 19, no. 2: 384–400. 10.2166/wpt.2024.014. [DOI] [Google Scholar]
  100. Stiff, H. A., Jr. 1951. “The Interpretation of Chemical Water Analysis by Means of Patterns.” Journal of Petroleum Technology 3, no. 10: 15–17. 10.2118/951376-G. [DOI] [Google Scholar]
  101. Stuyfzand, P. J. 1989. “A New Hydrochemical Classification of Water Types.” In Regional Characterization of Water Quality, vol. 182, 89–98. IAHS Press. [Google Scholar]
  102. Toos Ab Consulting Engineers (TCE) . 2010. Studies on Water Balance and Determination of the Well Deepening Depth in the Qazvin Plain, Volume 3: Hydrogeology and Water Balance Report No. 1/13960‐430582. Qazvin Regional Water Company; (in Persian). [Google Scholar]
  103. Urresti‐Estala, B. , Carrasco‐Cantos F., Vadillo‐Perez I., and Jimenez‐Gavilan P.. 2013. “Determination of Background Levels on Water Quality of Groundwater Bodies: A Methodological Proposal Applied to a Mediterranean River Basin.” Journal of Environmental Management 117: 121–130. 10.1016/j.jenvman.2012.11.042. [DOI] [PubMed] [Google Scholar]
  104. USEPA . 2022. ProUCL: Statistical Software for Environmental Applications for Data Sets With and Without Nondetect Observations. USEPA. Version 5.2. https://www.epa.gov/land‐research/proucl‐software. [Google Scholar]
  105. Verma, S. P. 2015. “Monte Carlo Comparison of Conventional Ternary Diagrams With New Log‐Ratio Bivariate Diagrams and an Example of Tectonic Discrimination.” Geochemical Journal 49, no. 4: 393–412. 10.2343/geochemj.2.0364. [DOI] [Google Scholar]
  106. Verma, S. P. , and Armstrong‐Altrin J. S.. 2013. “New Multi‐Dimensional Diagrams for Tectonic Discrimination of Siliciclastic Sediments and Their Application to Precambrian Basins.” Chemical Geology 355: 117–133. 10.1016/j.chemgeo.2013.07.014. [DOI] [Google Scholar]
  107. Verma, S. P. , Díaz‐González L., Rivera‐Gómez M. A., and Rosales‐Rivera M.. 2020. “New Multidimensional Classification Scheme of Altered Igneous Rocks From Performance Comparison of Isometric and Modified Log‐Ratio Transformations of Major Elements.” Earth Science Informatics 13: 1031–1064. 10.1007/s12145-020-00455-8. [DOI] [Google Scholar]
  108. Verma, S. P. , Díaz‐González L., and Uscanga‐Junco O. A.. 2021. “A Statistically Coherent Robust Multidimensional Classification Scheme for Water.” Science of the Total Environment 750: 141704. 10.1016/j.scitotenv.2020.141704. [DOI] [PubMed] [Google Scholar]
  109. Verma, S. P. , Rivera‐Gómez M. A., Díaz‐González L., and Quiroz‐Ruiz A.. 2016. “Log‐Ratio Transformed Major‐Element Based Multidimensional Classification for Altered High‐Mg Igneous Rocks.” Geochemistry, Geophysics, Geosystems 17, no. 12: 4955–4972. 10.1002/2016GC006524. [DOI] [Google Scholar]
  110. Wakida, F. T. , and Lerner D. N.. 2005. “Non‐Agricultural Sources of Groundwater Nitrate: A Review and Case Study.” Water Research 39, no. 1: 3–16. 10.1016/j.watres.2004.07.026. [DOI] [PubMed] [Google Scholar]
  111. Wang, H. , Lu K., Shen C., Song X., Hu B., and Liu G.. 2021. “Human Health Risk Assessment of Groundwater Nitrate at a Two Geomorphic Units Transition Zone in Northern China.” Journal of Environmental Sciences 110: 38–47. 10.1016/j.jes.2021.03.013. [DOI] [PubMed] [Google Scholar]
  112. Wang, X. , Zhang F., and Ding J.. 2017. “Evaluation of Water Quality Based on a Machine Learning Algorithm and Water Quality Index for the Ebinur Lake Watershed, China.” Scientific Reports 7, no. 1: 12858. 10.1038/s41598-017-12853-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
  113. Wendland, F. , Berhold G., Blum A., et al. 2008. “Derivation of Natural Background Levels and Threshold Values for Groundwater Bodies in the Upper Rhine Valley (France, Switzerland and Germany).” Desalination 226, no. 1–3: 160–168. 10.1016/j.desal.2007.01.240. [DOI] [Google Scholar]
  114. Wendland, F. , Hannappel S., Kunkel R., Schenk R., Voigt H. J., and Wolter R.. 2005. “A Procedure to Define Natural Groundwater Conditions of Groundwater Bodies in Germany.” Water Science and Technology 51, no. 3–4: 249–257. 10.2166/wst.2005.0598. [DOI] [PubMed] [Google Scholar]
  115. Werner, A. D. , Bakker M., Post V. E., et al. 2013. “Seawater Intrusion Processes, Investigation and Management: Recent Advances and Future Challenges.” Advances in Water Resources 51: 3–26. 10.1016/j.advwatres.2012.03.004. [DOI] [Google Scholar]
  116. World Health Organization (WHO) . 2017. Guidelines for Drinking‐Water Quality: Fourth Edition Incorporating the First Addendum. World Health Organization (WHO) License: CC BY‐NC‐SA 3.0 IGO. [PubMed] [Google Scholar]
  117. Wu, L. , Peng Y., Fan J., and Wang Y.. 2019. “Machine Learning Models for the Estimation of Monthly Mean Daily Reference Evapotranspiration Based on Cross‐Station and Synthetic Data.” Hydrology Research 50, no. 6: 1730–1750. 10.2166/nh.2019.060. [DOI] [Google Scholar]
  118. Xie, Z. , Liu W., Chen S., et al. 2025. “Machine Learning Approaches to Identify Hydrochemical Processes and Predict Drinking Water Quality for Groundwater Environment in a Metropolis.” Journal of Hydrology: Regional Studies 58: 102227. 10.1016/j.ejrh.2025.102227. [DOI] [Google Scholar]
  119. Yu, X. , Wang Y., Wu L., Chen G., Wang L., and Qin H.. 2020. “Comparison of Support Vector Regression and Extreme Gradient Boosting for Decomposition‐Based Data‐Driven 10‐Day Streamflow Forecasting.” Journal of Hydrology 582: 124293. 10.1016/j.jhydrol.2019.124293. [DOI] [Google Scholar]
  120. Zanotti, C. , Caschette M., Bonomi T., et al. 2022. “Linking Local Natural Background Levels in Groundwater to Their Generating Hydrogeochemical Processes in Quaternary Alluvial Aquifers.” Science of the Total Environment 805: 150259. 10.1016/j.scitotenv.2021.150259. [DOI] [PubMed] [Google Scholar]
  121. Zhang, Z. , Wang H., Shi Z., and Sun N.. 2024. “Temporal and Spatial Evolution of Groundwater Natural Background Levels in a Rapid Urbanization Area, Northeast of Beijing, China.” Exposure and Health 16: 341–355. 10.1007/s12403-023-00559-8. [DOI] [Google Scholar]
  122. Zhou, Y. , Wu J., Gao X., Guo W., and Chen W.. 2023. “Hydrochemical Background Levels and Threshold Values of Phreatic Groundwater in the Greater Xi'an Region, China: Spatiotemporal Distribution, Influencing Factors and Implication to Water Quality Management.” Exposure and Health 15: 757–771. 10.1007/s12403-022-00521-0. [DOI] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Figure S1: Distribution of geological units in the study area (Complete descriptions of geological units are available in the 1:100,000 sheets of Qazvin, Eshtehard, Takestan, and Khiyarj.).

Figure S2: Normality status of physicochemical components in the 2011–2023 dataset.

Figure S3: NBLs calculated using the CDF (right) and Iterative 2σ (left) methods in 2011–2023.

Figure S4: The certainty index of ML models in identifying groundwater quality classes.

Figure S5: Samples with the least certainty in determining the quality class.

Table S1: Summary statistics of the main dataset from water Year 2010–2011 to 2022–2023.

Table S2: Statistical summary of the nitrate dataset collected in the 2022–2023 water year.

Table S3: Statistical summary of the nitrate dataset collected in June and July 2023.

Table S4: Statistical summary of the nitrate dataset collected in the drinking water network.

Table S5: Statistical summary of the dataset from 2011 to 2023.

Table S6: Normality test of variables before calculating NBL.

Table S7: Changes in the calculated NBLs by CDF and Iterative 2σ methods for different hydrological years.

Table S8: Changes in the calculated TVs by CDF and Iterative 2σ methods for different hydrological years.

Table S9: Comparison of TVs calculated for physicochemical variables by different methods.

Table S10: PAC evaluation results.

Table S11: Confusion matrix for the WClassCB model (columns) versus the reference quality class (rows).

Table S12: Summary of performance metrics of water quality class classification models versus GMC.

Table S13: Cohen's Kappa value for each model compared to the GMC.

Table S14: Model classification results for six samples with the highest uncertainty in determining the quality class.

WER-98-e70521-s001.docx (2.3MB, docx)

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.


Articles from Water Environment Research are provided here courtesy of Wiley

RESOURCES