Regional groundwater fluorine risk prediction method based on machine learning model

By constructing a stacked ensemble model based on machine learning models and using SHAP analysis, the adaptability and interpretability issues of groundwater fluoride risk prediction in existing technologies are solved, achieving high-precision and robust risk prediction and providing an intuitive risk grading map and key factor identification.

CN121786378APending Publication Date: 2026-04-03UNIV OF JINAN
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing methods for predicting fluoride risk in regional groundwater suffer from poor adaptability of single models, insufficient stability of prediction results, and lack of interpretability, making it difficult to provide accurate risk classification maps and identification of key influencing factors in complex environments on a large scale.

Method used

A machine learning model-based approach was adopted, using entropy weighting to screen various machine learning algorithms, performing hyperparameter optimization, constructing a stacked ensemble model, and using the SHAP method for feature contribution analysis to generate groundwater fluoride exceedance probability distribution maps and risk classification maps.

Benefits of technology

It improves the accuracy and robustness of groundwater fluoride risk prediction, can accurately predict the spatial distribution of high-fluoride water at the regional scale, and provides an intuitive risk classification map to serve drinking water safety assessment and health prevention and control decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786378A_ABST
    Figure CN121786378A_ABST
Patent Text Reader

Abstract

The invention provides a regional groundwater fluorine risk prediction method based on a machine learning model, and relates to the technical field of hydrogeology and environmental geoscience information. The method comprises the following steps: collecting and preprocessing predictive variable data, and constructing a sample data set; defining a model task according to the predictive variable data and the groundwater fluorine concentration exceeding condition; based on the sample data set, three machine learning algorithms are evaluated and screened through an entropy weight method to serve as base learners; performing hyper-parameter optimization on the base learner, generating out-of-fold prediction features by using cross validation, and constructing a meta learner input feature matrix; taking logistic regression as a meta-learner, constructing a stack integration model, predicting a global environment data set of a research area, and outputting an underground water fluorine exceeding probability distribution map and an underground water fluorine risk grading map; the SHAP method is adopted to analyze the feature contributions of the base learner and the meta learner, identify key driving factors and reveal the action mechanism. According to the invention, the groundwater fluorine risk prediction precision and robustness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hydrogeology and environmental geoscience information technology, and in particular to a method for predicting regional groundwater fluoride risk based on a machine learning model. Background Technology

[0002] Currently, research on regional groundwater fluoride risk prediction has gradually shifted from traditional statistical methods (such as multivariate statistics) to data-driven machine learning methods. Models such as random forests, support vector machines, and extreme gradient boosting have shown advantages in handling nonlinear relationships and complex environmental factors.

[0003] However, existing methods still have significant bottlenecks: single models have large variations in adaptability to different regions and data distributions, resulting in insufficient stability and transferability of prediction results; most studies have failed to fully utilize the complementary advantages of multiple models, leading to limited prediction accuracy under large-scale and complex environmental conditions; furthermore, in practical applications, groundwater fluoride risk prediction requires not only obtaining the spatial distribution of fluoride concentration but also providing an intuitive risk classification map to serve drinking water safety assessment, monitoring network optimization, and health prevention and control decisions. Traditional methods, however, mostly remain at the concentration or probability distribution level, lacking the ability to classify risk levels and identify key influencing factors.

[0004] Therefore, there is an urgent need for a new prediction method that can output interpretable and manageable prediction results while ensuring prediction accuracy and robustness, thereby providing a scientific, reliable and operable decision-making basis for the risk management of groundwater fluoride. Summary of the Invention

[0005] The purpose of this invention is to provide a regional groundwater fluoride risk prediction method based on a machine learning model, which can solve the problems of limited prediction accuracy, insufficient stability and lack of interpretability of existing single models. By comprehensively capturing data features, optimizing model performance and conducting interpretability analysis, the accuracy and robustness of groundwater fluoride risk prediction are improved.

[0006] To achieve the above objectives, this invention provides a method for predicting regional groundwater fluoride risk based on a machine learning model, comprising the following steps: Step S1: Collect and preprocess the predictor variable data to construct the sample dataset; Step S2: Define the model task based on the predicted variable data and the groundwater fluoride concentration exceeding the standard; Step S3: Based on the sample dataset, evaluate and select three machine learning algorithms as base learners using the entropy weight method; Step S4: Optimize the hyperparameters of the base learner, generate out-of-fold prediction features using cross-validation, and construct the meta-learner input feature matrix; Step S5: Using logistic regression as the meta-learner, construct a stacked ensemble model to predict the environmental dataset of the entire study area and output a groundwater fluoride exceedance probability distribution map and a groundwater fluoride risk classification map. Step S6: Use the SHAP method to analyze the feature contributions of the base learner and the meta-learner, identify key driving factors and reveal their mechanisms of action.

[0007] Preferably, in step S1, the predicted variable data includes six categories of environmental factors: water chemical parameters, climate parameters, hydrogeological parameters, sedimentary environment parameters, human activity parameters, and soil physicochemical properties.

[0008] Preferably, the water chemical parameters include , , , , , , , , , , , (pH) (Total dissolved solids) as well as Climate parameters include potential evapotranspiration and precipitation; hydrogeological parameters include groundwater depth, hydraulic gradient, groundwater level, digital elevation, slope, topography, and groundwater type (unconfined or confined); sedimentary environment parameters include clay layer thickness, sand layer thickness, clay-to-sand ratio, surface soil clay content, subsoil clay content, surface soil silt content, subsoil silt content, surface soil sand content, and subsoil sand content; soil physicochemical properties include surface soil pH, subsoil pH, surface soil organic carbon content, and subsoil organic carbon content; human activity-related parameters include land use type, vegetation index, and distance to the river.

[0009] Preferably, in step S1, the preprocessing of the predictor variable data involves using GIS for spatial mapping, rasterizing all environmental factors and sample information in the predictor variable data, and resampling them. A unified spatial resolution is achieved, and the same coordinate reference and projection system are used for registration and stitching.

[0010] Preferably, step S2 specifically involves: setting a threshold for exceeding the standard for groundwater fluoride concentration and defining a binary classification prediction model task.

[0011] Preferably, in step S3, the machine learning algorithms participating in the evaluation and screening include AdaBoost, XGBoost, GBDT, TreeBag, RF, KNN, MLP, LR, LDA, and SVM.

[0012] Preferably, in step S3, the performance indicators for performance evaluation include: Accuracy, Precision, Recall, F1-score, and Cohen's Kappa; the entropy weight method objectively assigns weights to each performance index, determines the weights based on the dispersion of each performance index, and calculates the comprehensive evaluation score.

[0013] Preferably, in step S4, the specific content of hyperparameter optimization is as follows: Hyperparameter sensitivity analysis was performed on the three base learners to determine the hyperparameters to be tuned and their tuning range for each machine learning algorithm, and a hyperparameter space was constructed. A parallel grid search strategy was used to systematically traverse and experiment with all hyperparameter combinations in the hyperparameter space. Cross-validation was used to traverse all grid points in the hyperparameter space, and the comprehensive performance index ROC-AUC of each hyperparameter combination was compared to determine the optimal hyperparameter combination.

[0014] Preferably, the cross-validation is at least one of five-fold hierarchical cross-validation and ten-fold hierarchical cross-validation.

[0015] Preferably, step S6 specifically includes: For the three base learners, the SHAP method is used to construct a permutation interpreter on the test set, calculate the SHAP value of each environmental factor and take the average SHAP value, and draw the SHAP beehive diagram of each base learner respectively. The probability of fluoride exceeding the standard in groundwater samples was determined using three base learners. The prediction results are input into the meta-learner to construct the SHAP interpretation model of the meta-learner, quantitatively analyze the relative contribution of each base learner, and characterize its importance by calculating the average absolute SHAP value. Based on the SHAP weights obtained from the relative contributions of the meta-learner to the outputs of the three base learners, the SHAP values ​​of the three base learners on the test set for each environmental factor are weighted and fused to construct a weighted ensemble SHAP model. The SHAP interpretation results of the stacked ensemble model are obtained, and a weighted SHAP swarm graph and a global importance graph are drawn accordingly. Finally, the main driving environmental factors in the prediction of groundwater fluoride exceedance are identified, revealing the scientific basis of the decision-making of the stacked ensemble model and the mechanism of action of key environmental variables.

[0016] Therefore, the present invention employs the above-mentioned regional groundwater fluoride risk prediction method based on a machine learning model, and the beneficial technical effects are as follows: (1) This invention makes full use of the complementary advantages of multiple learners, and achieves adaptive selection of models through entropy weight method screening and hyperparameter optimization; at the same time, combined with SHAP interpretability analysis, it realizes the transition from model prediction to scientific understanding, reveals the comprehensive contribution law of different environmental factors to the distribution of fluoride in groundwater, and improves the accuracy and robustness of groundwater fluoride risk prediction.

[0017] (2) Compared with existing single models or statistical interpolation methods, this invention can more accurately predict the spatial distribution of high-fluoride groundwater at the regional scale, and intuitively serve the protection of drinking water sources, optimization of monitoring points and assessment of population health risks through risk classification results. It has important application value for groundwater quality safety and prevention and control of environmental geological disasters. Attached Figure Description

[0018] Figure 1 This is a flowchart of a regional groundwater fluoride risk prediction method based on a machine learning model according to the present invention; Figure 2 A flowchart illustrating the construction of the stacked integration model and the analysis using the SHAP method; Figure 3 A schematic diagram illustrating the results of interpreting model feature contributions using the SHAP method (first 25 features). Detailed Implementation

[0019] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0020] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0021] Example 1 like Figure 1 As shown, a method for predicting regional groundwater fluoride risk based on a machine learning model includes the following steps: Step S1: By integrating regional groundwater monitoring data, hydrogeological databases, meteorological statistics and land use information, collect predictive variable data that are potentially related to excessive fluoride in groundwater, and preprocess the data to construct a sample dataset.

[0022] The predictor variables include six categories of environmental factors: hydrochemical parameters, climate parameters, hydrogeological parameters, sedimentary environment parameters, human activity parameters, and soil physicochemical properties. Among these, hydrochemical parameters include... , , , , , , , , , , , (pH) (Total dissolved solids) as well as Climate parameters include potential evapotranspiration and precipitation; hydrogeological parameters include groundwater depth, hydraulic gradient, groundwater level, digital elevation, slope, topography, and groundwater type (unconfined or confined); sedimentary environment parameters include clay layer thickness, sand layer thickness, clay-to-sand ratio, surface soil clay content, subsoil clay content, surface soil silt content, subsoil silt content, surface soil sand content, and subsoil sand content; soil physicochemical properties include surface soil pH, subsoil pH, surface soil organic carbon content, and subsoil organic carbon content; human activity-related parameters include land use type, vegetation index, and distance to the river.

[0023] Preprocessing the predictor variable data involves spatial mapping using a Geographic Information System (GIS), rasterizing all environmental factors and sample information in the predictor variable data, and then resampling them. To achieve a unified spatial resolution, registration and stitching are performed using the same coordinate reference and projection system, with each... A grid serves as a spatial unit.

[0024] Step S2: Define the model task based on the predicted variable data and the groundwater fluoride concentration exceeding the standard.

[0025] In this embodiment, based on the water quality standard of the Chinese geological industry standard (DZ / T 0290–2015), the threshold for fluoride exceeding the standard in groundwater is set as follows: , to reduce the fluoride concentration in groundwater The sample is defined as an excessive sample, the fluoride concentration in groundwater. The samples were defined as non-exceeding samples. Simultaneously, 40 predictive variables representing information such as water chemical parameters, climate parameters, hydrogeological parameters, sedimentary environment parameters, human activity parameters, and soil physicochemical properties were selected as model input features to construct a binary classification prediction model task with the output being whether groundwater exceeds the fluoride standard.

[0026] Step S3: Based on the sample dataset, evaluate the performance of several machine learning algorithms using the entropy weight method, and select three machine learning algorithms as base learners.

[0027] Multiple machine learning algorithms were selected as candidate base learners, including Adaptive Boosting (AdaBoost), Extreme Gradient Boosting (XGBoost), Gradient Boosting Decision Tree (GBDT), Bag Decision Tree (TreeBag), Random Forest (RF), Extreme Random Tree (ET), K Nearest Neighbors (KNN), Multilayer Perceptron (MLP), Logistic Regression (LR), Linear Discriminant Analysis (LDA), and Support Vector Machine (SVM).

[0028] A stratified sampling method was used to divide the sample dataset into training and test sets in an 8:2 ratio. Then, binary classification prediction models were constructed and tested for 11 candidate machine learning algorithms, and multiple performance metrics were recorded. The average performance of each metric was obtained through multiple calculations. These performance metrics include... (Area Under Curve, the area under the ROC curve and the coordinate axis), Accuracy, Precision, Recall, F1-score (F1 value, the harmonic mean of precision and recall), and Cohen's Kappa (a statistic that measures class consistency).

[0029] The entropy weight method objectively assigns weights to each performance index, determining the weights based on their dispersion, and calculates a comprehensive evaluation score to quantify the overall predictive performance of different machine learning algorithms. Ultimately, three machine learning algorithms with optimal comprehensive performance and complementarity are selected as base learners: RF, GBDT, and XGBoost. These three algorithms have the highest comprehensive evaluation scores and exhibit a degree of complementarity. RF demonstrates strong stability and good noise resistance; GBDT exhibits low bias when processing medium-sized data; and XGBoost demonstrates strong learning ability in complex nonlinear structures. Other machine learning algorithms, such as SVM and LDA, while possessing certain advantages on specific sample datasets, are slightly inferior in overall performance, robustness, and interpretability. Therefore, RF, GBDT, and XGBoost are ultimately selected as the base learners in this embodiment.

[0030] Step S4: Optimize the hyperparameters of the three base learners, generate out-of-fold prediction features using cross-validation, and construct the meta-learner input feature matrix. Specifically: Hyperparameter sensitivity analysis was performed on the three base learners to determine the hyperparameters that need to be tuned and their tuning ranges for each machine learning algorithm, and a hyperparameter space was constructed. In this embodiment, the hyperparameters that need to be tuned and their tuning ranges for the three machine learning algorithms RF, GBDT, and XGBoost are shown in Table 1.

[0031] A parallel grid search strategy is employed to systematically traverse and experiment with all hyperparameter combinations within the hyperparameter space, thereby achieving a balance between computational cost and comprehensive coverage. After optimization, the optimal hyperparameters for RF are: , , , , The optimal hyperparameters of GBDT are: , , , , , The optimal hyperparameters for XGBoost are: , , , , , .

[0032] In this embodiment, five-fold cross-validation is used to traverse all grid points in the hyperparameter space and compare the comprehensive performance index ROC-AUC (Receiver Operating Characteristic Curve-Area Under the Curve) of each hyperparameter combination to determine the optimal hyperparameter combination and complete the hyperparameter optimization.

[0033] Table 1. Hyperparameters that need to be adjusted and their tuning ranges in RF, GBDT, and XGBoost. A binary classification prediction model based on three base learners is trained using optimal hyperparameter combination, and out-of-fold prediction features are generated using five-fold hierarchical cross-validation. Specifically: Figure 2 As shown, for the three selected base learners, their corresponding training sets are divided into five-fold subsets. Each time, four folds are used as the training subset and one fold as the validation subset. The binary classification prediction models built for each of the three base learners are used to predict the data in the current validation subset to obtain probability outputs. This process is repeated five times, and the prediction results of the five-fold validation subsets are merged sequentially to obtain independent prediction records for all training sets, which are the out-of-fold prediction features of a single base learner. Then, the out-of-fold prediction features of the three base learners (RF, GBDT, and XGBoost) are concatenated column-wise to construct the meta-learner input feature matrix.

[0034] Step S5: Based on the input feature matrix of the meta-learner, and using logistic regression as the meta-learner, a stacked ensemble model is constructed to predict the environmental dataset of the entire study area, outputting a probability distribution map of groundwater fluoride exceedance and a groundwater fluoride risk classification map. Specifically: Logistic regression was used as the meta-learner to train the out-of-fold prediction features and the true labels. The true labels were the concentrations of fluoride in the 0 / 1 samples of the training set, where fluoride concentrations exceeding the label were 1, and those not exceeding the label were 0. Logistic regression fused the outputs of the three base learners using a linear weighting method. The weights were obtained by maximum likelihood estimation, which directly reflected the contribution of each base learner to the final prediction. Based on this fusion strategy, a stacked ensemble model was constructed.

[0035] The stacked ensemble model was applied to the environmental dataset of the entire study area for prediction, outputting the probability of groundwater fluoride exceeding the standard for each spatial unit. This generates a probability distribution map of fluoride exceedance in groundwater. The study area's total environmental dataset covers the entire study area, including all environmental factor data corresponding to each spatial unit.

[0036] To facilitate risk assessment and management, risk levels are classified based on probability thresholds: It is a low-risk area. It is a medium-risk area. High-risk areas were identified, and a groundwater fluoride risk classification map was generated. The prediction results are output in GeoTIFF (georeferenced image file format) or Shapefile (vector graphics file) format, which can visually display the spatial pattern of groundwater fluoride risk on the map. The prediction results indicate that high-risk areas are mainly distributed in areas with strong evaporation, low-lying terrain, slow groundwater flow, and... The distribution areas of medium-risk groundwater are characterized by their spatial distribution, often surrounding the outer edges of high-risk patches in a strip or patchy pattern. These areas primarily occur in the piedmont-plain transition zone, paleochannel corridors, the contact zone between alluvial-diluvial plains and lacustrine sedimentary units, and the lateral recharge-evaporation alternation zones along major rivers. These zones constitute the distribution of groundwater from "recharge-type" to "medium-risk" areas. Water shifts towards alkaline soil The key transitional zone in the evolution of "water". Low-risk areas are mostly located in areas with high elevation and abundant groundwater recharge, The model primarily focuses on water-type hydrology, and the prediction results of the stacked integrated model are highly consistent with the regional hydrochemical zoning characteristics.

[0037] Step S6: Use the SHAP method to analyze the feature contributions of the base learner and the meta-learner, identify key driving factors and reveal their mechanisms of action.

[0038] For the three base learners, the SHAP (SHapley Additive Explanations) method is used to construct permutational explainers on the test set. Based on the five-fold model (i.e., the model constructed during the five-fold hierarchical cross-validation process in step S4), the SHAP values ​​of each environmental factor are calculated and averaged to obtain stable feature contribution results. SHAP beehive diagrams are plotted for each base learner to visualize different environmental factors (such as...). , , , , The positive and negative influences and relative intensity of groundwater fluoride exceedance probability (such as groundwater depth and hydraulic gradient) on the probability of groundwater fluoride exceedance.

[0039] Three base learners were used to assess the probability of fluoride exceeding the standard in groundwater. The prediction results are input into the meta-learner to construct the SHAP interpretation model of the meta-learner, quantitatively analyze the relative contributions of each base learner, and characterize their importance by calculating the average absolute SHAP value. Based on the analysis results, the SHAP weights of XGBoost, GBDT, and RF are determined to be approximately 52%, 30%, and 18%, respectively. Based on these weights, the SHAP values ​​of each environmental factor on the test set of the three base learners are weighted and fused to construct a weighted ensemble SHAP model, obtain the SHAP interpretation results of the stacked ensemble model, and draw a weighted SHAP beehive graph and a global importance graph accordingly. Finally, the main driving environmental factors in the prediction of groundwater fluoride exceedance are identified, revealing the scientific basis of the stacked ensemble model's decision-making and the mechanism of action of key environmental variables.

[0040] like Figure 3 As shown, , , Silicic acid, hydraulic gradient, slope, and potential evapotranspiration are the core factors driving the risk of fluoride exceeding standards. Among them, and The high values ​​all showed a positive contribution, reflecting that a high bicarbonate-high sodium, low calcium environment more easily promotes the dissolution of fluoride-containing minerals and the release of fluoride. Specifically, The increase in [amount] is usually closely related to the dissolution process of dolomite or dolomitic limestone, i.e. This process not only increased the concentration of pollutants in the water Content and total alkalinity also lead to The rise in temperature enhances the chemical weathering and surface desorption of fluoride minerals (such as fluorite, mica, and amphibole). Simultaneously, Preferred precipitation, or with Forming low solubility This leads to water Removed Residual; in contrast, The precipitation is weak and easily soluble, therefore high In fact, it represents a high -high -Low —A "fluorine-promoting environment" with strong evaporation. Correspondingly, This manifests as a significant negative contribution, indicating that it is through Co-precipitation or calcite synergistic precipitation reduces the soluble content in water. Content. In addition, the positive contribution of silica further indicates that the weathering and complexation reactions of aluminosilicate minerals play an important role in fluoride release; hydraulic gradient and slope affect the flow and residence time of groundwater, thereby regulating the solute dilution and enrichment process; the increase in potential evapotranspiration indicates a strong evaporation and concentration environment, which promotes solute accumulation and enhances the fluoride enrichment effect.

[0041] At the visualization level, the SHAP bee colony graph and the global importance ranking graph clearly demonstrate the internal structure of the stacked ensemble model and the driving effects of environmental factors. For example... Figure 3 As shown in the figure, red dots represent high-value promoting effects, and blue dots represent low-value inhibiting effects. Combined with geochemical mechanism analysis, The effect reflects the competitive adsorption relationship between bicarbonate and fluoride; The enhancing effect reveals that it is driven by cation exchange; The negative effects indicate that reduced calcium consumption is an important condition for fluoride release. The sedimentation promoted The dissolution of F leads to - The release; Increased concentration of F in mineral lattices - Desorption into the solution; The increase reflects strong evaporation and solute enrichment; The negative effect indicates that the oxidation conditions are unfavorable. Release. The above explanation is highly consistent with hydrochemical theory, further verifying the scientific rationality of the stacked integration model.

[0042] Furthermore, to verify the robustness of the stacked ensemble model, this invention compared the results of repeated experiments under different random partitions. The stacked ensemble model underwent ten independent resampling runs, and the experimental results are shown in Table 2. It can be seen that the stacked ensemble model... With a mean of 0.95 and a variance of only 0.0008, the performance fluctuation is less than 3%, indicating that the stacked integration model has a stable structure and reliable prediction results.

[0043] Table 2. AUC performance of the stacked ensemble model in ten independent resampling operations.

[0044] To verify the advantages of this invention, we systematically compared it with traditional statistical methods and single machine learning algorithms on the same test set. The results show that the stacked ensemble model of this invention exhibits significant advantages in predictive performance, robustness, and applicability.

[0045] First, logistic regression, as a representative of traditional statistical methods, has a model... , , , , , The overall accuracy and precision of the previous method were relatively low, and its discrimination performance on the test set was significantly inferior to the stacked ensemble model of this invention. More importantly, logistic regression requires a large number of iterations to converge (nearly 8,000 iterations in actual tests), is sensitive to feature scaling, collinearity, and class imbalance, and struggles to characterize the interaction between nonlinear and high-dimensional data. Therefore, it is unsuitable as the main algorithm for regional groundwater fluoride risk prediction. In contrast, the stacked ensemble model of this invention is superior in spatial prediction accuracy and anomaly identification capability, and can effectively characterize local high-fluoride anomaly zones.

[0046] Secondly, compared with single machine learning algorithms, the stacked ensemble model of this invention also demonstrates significant superiority. Verification results show that the stacked ensemble model... The accuracy, recall, and consistency of the stacked ensemble model are 0.94, 0.88, 0.86, 0.83, 0.84, and 0.75, respectively, which is better than the performance of the single base learner model, as shown in Table 3. Compared with the three base learner models, the stacked ensemble model significantly improves accuracy, recall, and consistency, indicating that the present invention reduces the uncertainty and bias of the model through multi-model fusion, and has stronger robustness and adaptability. It performs better in complex groundwater system data and achieves the effect of "multi-model complementarity-robust prediction".

[0047] Table 3. Predictive performance of stacked ensemble models and single base learner models

[0048] Therefore, the present invention adopts the above-mentioned regional groundwater fluoride risk prediction method based on machine learning model, which solves the problems of limited prediction accuracy, insufficient stability and lack of interpretability of existing single models and traditional statistical methods. By comprehensively capturing data features, optimizing model performance and conducting interpretability analysis, the accuracy and robustness of groundwater fluoride risk prediction are improved.

[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for predicting regional groundwater fluoride risk based on a machine learning model, characterized in that, Includes the following steps: Step S1: Collect and preprocess the predictor variable data to construct the sample dataset; Step S2: Define the model task based on the predicted variable data and the groundwater fluoride concentration exceeding the standard; Step S3: Based on the sample dataset, evaluate and select three machine learning algorithms as base learners using the entropy weight method; Step S4: Optimize the hyperparameters of the base learner, generate out-of-fold prediction features using cross-validation, and construct the meta-learner input feature matrix; Step S5: Using logistic regression as the meta-learner, construct a stacked ensemble model to predict the environmental dataset of the entire study area and output a groundwater fluoride exceedance probability distribution map and a groundwater fluoride risk classification map. Step S6: Use the SHAP method to analyze the feature contributions of the base learner and the meta-learner, identify key driving factors and reveal their mechanisms of action.

2. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, In step S1, the predicted variable data include six major categories of environmental factors: water chemical parameters, climate parameters, hydrogeological parameters, sedimentary environment parameters, human activity parameters, and soil physicochemical properties.

3. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 2, characterized in that, Water chemical parameters include , , , , , , , , , , , (pH) (Total dissolved solids) as well as Climate parameters include potential evapotranspiration and precipitation; hydrogeological parameters include groundwater depth, hydraulic gradient, groundwater level, digital elevation, slope, topography, and groundwater type (unconfined or confined); sedimentary environment parameters include clay layer thickness, sand layer thickness, clay-to-sand ratio, surface soil clay content, subsoil clay content, surface soil silt content, subsoil silt content, surface soil sand content, and subsoil sand content; soil physicochemical properties include surface soil pH, subsoil pH, surface soil organic carbon content, and subsoil organic carbon content; human activity-related parameters include land use type, vegetation index, and distance to the river.

4. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, In step S1, the predictor variable data is preprocessed by using GIS for spatial mapping, which rasterizes and resamples all environmental factors and sample information in the predictor variable data. A unified spatial resolution is achieved, and the same coordinate reference and projection system are used for registration and stitching.

5. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, Step S2 specifically involves: setting a threshold for exceeding the standard for groundwater fluoride concentration and defining a binary classification prediction model task.

6. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, In step S3, the machine learning algorithms involved in the evaluation and screening include AdaBoost, XGBoost, GBDT, TreeBag, RF, KNN, MLP, LR, LDA, and SVM.

7. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, In step S3, the performance metrics for performance evaluation include: Accuracy, Precision, Recall, F1-score, and Cohen's Kappa; the entropy weight method objectively assigns weights to each performance index, determines the weights based on the dispersion of each performance index, and calculates the comprehensive evaluation score.

8. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, In step S4, the specific content of hyperparameter optimization is as follows: Hyperparameter sensitivity analysis was performed on the three base learners to determine the hyperparameters to be tuned and their tuning range for each machine learning algorithm, and a hyperparameter space was constructed. A parallel grid search strategy was used to systematically traverse and experiment with all hyperparameter combinations in the hyperparameter space. Cross-validation was used to traverse all grid points in the hyperparameter space, and the comprehensive performance index ROC-AUC of each hyperparameter combination was compared to determine the optimal hyperparameter combination.

9. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 8, characterized in that, Cross-validation is at least one of five-fold hierarchical cross-validation and ten-fold hierarchical cross-validation.

10. The method for predicting regional groundwater fluoride risk based on a machine learning model according to claim 1, characterized in that, Step S6 is as follows: For the three base learners, the SHAP method is used to construct a permutation interpreter on the test set, calculate the SHAP value of each environmental factor and take the average SHAP value, and draw the SHAP beehive diagram of each base learner respectively. The probability of fluoride exceeding the standard in groundwater samples was determined using three base learners. The prediction results are input into the meta-learner to construct the SHAP interpretation model of the meta-learner, quantitatively analyze the relative contribution of each base learner, and characterize its importance by calculating the average absolute SHAP value. Based on the SHAP weights obtained from the relative contributions of the meta-learner to the outputs of the three base learners, the SHAP values ​​of the three base learners on the test set for each environmental factor are weighted and fused to construct a weighted ensemble SHAP model. The SHAP interpretation results of the stacked ensemble model are obtained, and a weighted SHAP swarm graph and a global importance graph are drawn accordingly. Finally, the main driving environmental factors in the prediction of groundwater fluoride exceedance are identified, revealing the scientific basis of the decision-making of the stacked ensemble model and the mechanism of action of key environmental variables.

Citation Information

Patent Citations

  • Learning scheme recommendation method and system based on learning effect prediction

    CN114912027A

  • Machine learning and omics based systems and methods for assessing microbial functional composition

    WO2025042781A1

  • Portable biosensor system with vertical graphene array

    WO2025244866A1