Method and equipment for predicting heavy metal distribution coefficient of soil mineral and storage medium
By using random forest algorithm to build a soil heavy metal distribution coefficient prediction model, the problem of low efficiency of soil mineral heavy metal distribution coefficients in existing technologies has been solved, and high -efficiency and accurate heavy metal distribution coefficients are achieved.
Patent Information
- Application Number
- CN202411242176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art is inefficient when acquiring the heavy metal distribution coefficient of soil minerals and fails to effectively consider the impact of mineral composition differences on heavy metal adsorption capacity.
The random forest algorithm uses soil sample information to perform machine learning, build a heavy metal distribution coefficient prediction model, pre -process it through database data and adsorption experimental data, and consider soil properties and mineral content.
The rapid and accurate prediction of the heavy metal distribution coefficient is achieved, the prediction accuracy and the universality and explanatoryness of the model are improved, the tedious procedures for traditional experiments are avoided, and the financial resources of manpower and material resources are saved.
Smart Images

Figure CN119380867A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental pollution prediction, and in particular to a method, device and storage medium for predicting heavy metal distribution coefficients of soil minerals. Background Art
[0002] In the study of the environmental behavior of heavy metals in soil, the migration capacity of heavy metals affects their concentration in the soil-water phase and the adsorption-desorption behavior between the two phases. This capacity can be described by the distribution coefficient. The distribution coefficient represents the environmental behavior properties of heavy metals, making it a key parameter in soil standard formulation, environmental risk assessment and public health evaluation. Soil is a complex complex with heterogeneity. The soil pH, organic matter content and mineral content in different spaces have obvious differences, which largely determine the distribution coefficient of heavy metals in soil. Minerals are the main components of soil. Among them, soil clay minerals and oxide minerals have a strong influence on the distribution coefficient of heavy metals. The difference in mineral composition leads to the spatial heterogeneity of soil, which makes the distribution coefficient of heavy metals vary greatly. The existing technology mainly obtains the heavy metal distribution coefficient of a single soil through actual sampling and adsorption experiments; or establishes a multivariate regression model of soil properties and distribution coefficients through a small amount of data to obtain a distribution coefficient database for a certain area. These research processes for determining the distribution coefficient are complicated, arduous and inefficient, and do not consider the impact of differences in mineral composition on the adsorption capacity of heavy metals.
[0003] Therefore, there is an urgent need for a method, device and storage medium for predicting the heavy metal distribution coefficient of soil minerals, which can realize the rapid acquisition of heavy metal distribution coefficient data of different soil properties. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and storage medium for predicting the heavy metal distribution coefficient of soil minerals, aiming to solve the technical problems such as low efficiency in obtaining the heavy metal distribution coefficient of traditional soil minerals.
[0005] To achieve the above object, in a first aspect, the present invention provides a method for predicting the heavy metal distribution coefficient of soil minerals, the steps of which include:
[0006] S1. Collect soil sample information, including soil information, basic physical and chemical properties of soil, soil mineral content, and heavy metal adsorption data, and use the collected soil sample information as a heavy metal distribution coefficient modeling database;
[0007] S2, preprocessing the heavy metal distribution coefficient modeling database to obtain a heavy metal distribution coefficient preprocessing sample data set, and dividing it into a test set and a training set;
[0008] S3, using a random forest algorithm to perform machine learning on the training set to obtain a soil heavy metal distribution coefficient prediction model, and performing model evaluation, mineral feature effectiveness evaluation, and feature importance evaluation on the soil heavy metal distribution coefficient prediction model;
[0009] S4. Inputting the sample data of the unknown soil heavy metal distribution coefficient into the trained soil heavy metal distribution coefficient prediction model for prediction to obtain the unknown soil heavy metal distribution coefficient.
[0010] As a further improvement of the above scheme, in step S1, the heavy metal adsorption data includes all data information of the adsorption amount of the heavy metal, the equilibrium concentration of the heavy metal, the temperature of the heavy metal, the water-soil ratio of the heavy metal and the pH value of the heavy metal solution;
[0011] The heavy metals include arsenic (As), cadmium (Cd), chromium (Cr) and lead (Pb).
[0012] As a further improvement of the above scheme, in step S1, the soil mineral content data includes the mineral content data of all ore types including illite, montmorillonite, kaolinite, chlorite, vermiculite, feldspar, hematite and goethite.
[0013] As a further improvement of the above scheme, in step S2, when preprocessing the heavy metal distribution coefficient modeling database, it is necessary to fill missing values, delete duplicate values, process outliers, standardize data, and reduce dimension.
[0014] As a further improvement of the above scheme, the data normalization method adopts one of the 0-1 normalization method, the log function normalization method, the linear proportion normalization method, the range normalization method, and the Z-score normalization method.
[0015] As a further improvement of the above scheme, the dimension reduction processing method includes one of Spearman correlation, permutation importance, principal component analysis, low variance filter, mutual information method and f regression method.
[0016] As a further improvement of the above scheme, the heavy metal distribution coefficient preprocessing sample data set includes soil coordinates, soil pH value, soil organic matter content, soil cation exchange capacity, soil temperature, soil clay content, soil mineral content, heavy metal equilibrium adsorption capacity, solution equilibrium concentration, solution initial concentration, solution temperature, water-soil ratio and solution pH value.
[0017] As a further improvement of the above scheme, the initial concentration of the solution is the initial addition amount of the heavy metal in the solution in the adsorption experiment;
[0018] For the initial concentration of the solution that is not clearly indicated in the literature, it is calculated using the solution equilibrium concentration, soil-water ratio and the amount of heavy metal adsorbed. The specific calculation formula is shown below:
[0019] C0=Q e *t+C e
[0020] Where C0 is the initial concentration of heavy metals in the solution (mg / L), C e is the solution concentration when adsorption reaches equilibrium (mg / L), t is the water-to-soil ratio of the solution (g / mL), Q e is the amount of adsorption when the adsorption reaches equilibrium (mg / g).
[0021] As a further improvement of the above solution, in step S3, a random division method is used when dividing the heavy metal partition coefficient preprocessing sample data set into a test set and a training set.
[0022] As a further improvement of the above scheme, in step S3, when using the training set to obtain the soil heavy metal distribution coefficient prediction model based on the random forest algorithm, the soil heavy metal distribution coefficient prediction model is also hyperparameter optimized to obtain the soil heavy metal distribution coefficient prediction model with the best prediction performance; preferably, the hyperparameter optimization method includes one of grid search, random search, Bayesian optimization, and genetic algorithm.
[0023] As a further improvement of the above scheme, in step S3, the model evaluation method is the determination coefficient (R 2 ), mean absolute error (MAE), root mean square error (RMSE), and 5-fold cross validation were used to verify the prediction performance of the soil heavy metal distribution coefficient prediction model.
[0024] As a further improvement of the above scheme, in step S3, the mineral characteristic validity evaluation method includes a Pearson correlation evaluation method and a Spearman correlation evaluation method.
[0025] As a further improvement of the above scheme, in step S3, the feature importance evaluation method is evaluated using SHAP and partial dependence diagram.
[0026] In a second aspect, the present invention also provides a device comprising a memory for storing computer program instructions and a processor for executing computer program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to execute a method for predicting heavy metal distribution coefficients of soil minerals provided in the first aspect.
[0027] In a third aspect, the present invention further provides a storage medium having a computer program stored thereon, wherein when the program is run, the device where the storage medium is located is controlled to execute a method for predicting the heavy metal distribution coefficient of soil minerals provided in the first aspect.
[0028] Since the present invention adopts the above technical solution, the beneficial effects of this application are:
[0029] The present invention provides a method for predicting the heavy metal distribution coefficient of soil minerals. The method comprises the following steps: firstly, basic soil properties and heavy metal adsorption properties are obtained through database information and literature adsorption experimental data, and the collected soil sample information is used as a heavy metal distribution coefficient modeling database. The heavy metal distribution coefficient modeling database is preprocessed to obtain a heavy metal distribution coefficient preprocessing sample data set, and based on the heavy metal distribution coefficient preprocessing sample data set, a random forest algorithm is used to perform machine learning on a training set to construct a soil heavy metal distribution coefficient prediction model with the best prediction performance. The present invention can realize fast and accurate prediction of the heavy metal distribution coefficient according to the constructed soil heavy metal distribution coefficient prediction model, and the method is simple and efficient, with high prediction reliability, effectively overcoming the difficulty of large differences in heavy metal distribution coefficients caused by soil spatial heterogeneity, avoiding the complicated experimental procedures of traditional adsorption experiments when obtaining single heavy metal adsorption data, shortening the working cycle, and greatly saving manpower, material and financial resources. The influence of the content of different minerals in the soil on the adsorption capacity of heavy metals is comprehensively considered, the prediction accuracy of the heavy metal distribution coefficient is enhanced, the universality and interpretability of the model are improved, and the correspondence between the soil mineral content and the heavy metal distribution coefficient can be realized; compared with the risk assessment that only considers the heavy metal content, it is more reasonable to evaluate the heavy metal risk of the soil based on the heavy metal distribution coefficient, and soil control measures can be taken according to the distribution coefficient predicted by different soil properties, thereby minimizing the risk of soil heavy metal pollution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0031] Figure 1 It is a schematic flow chart of a method for predicting the heavy metal distribution coefficient of soil minerals disclosed in the present invention;
[0032] Figure 2 Schematic diagram of comparison results of predicted values and true values of the distribution coefficients of As, Cd, Cr, and Pb in Example 1 of the present invention;
[0033] Figure 3 Schematic diagram of mineral effectiveness of the As, Cd, Cr, and Pb models in Example 1 of the present invention;
[0034] Figure 4 Schematic diagram of the correlation analysis results of the As model in Example 1 of the present invention, wherein (a) is a schematic diagram of the Pearson correlation analysis results, and (b) is a schematic diagram of the Spearman correlation analysis results;
[0035] Figure 5 This is a schematic diagram of the SHAP results of the feature importance analysis of the As model in Example 1 of the present invention;
[0036] The purpose, features and advantages of the present invention will be further described in conjunction with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Furthermore, the technical solutions between the various embodiments of the present invention may be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in the field. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0039] Embodiment 1:
[0040] See also Figure 1-5 The present invention provides a method for predicting the heavy metal distribution coefficient of soil minerals, the steps of which include:
[0041] S1. Collect soil sample information from literature databases and professional databases, wherein the soil sample information includes soil information, basic physical and chemical properties of soil, soil mineral content, and heavy metal adsorption data, and use the collected soil sample information as a heavy metal distribution coefficient modeling database;
[0042] Specifically, in this embodiment, soil information and soil basic physical and chemical property data are derived from the Harmonized World Soil Database (HWSD), which mainly includes the European Soil Database, the Chinese Soil Map, the Regional SOTER Database and the DSMW;
[0043] In this embodiment, the soil mineral content data includes the mineral content data of all ore types in illite, montmorillonite, kaolinite, chlorite, vermiculite, feldspar, hematite and goethite; the soil mineral content data is composed of two parts: soil physical and chemical property data from HWSD and clay mineral relative content data from literature, and the minerals include illite, montmorillonite, kaolinite, chlorite, vermiculite, feldspar, hematite and goethite;
[0044] Heavy metal adsorption data were obtained from databases such as the China National Knowledge Infrastructure Database and Web of Science. The terms TS = (soil OR soils OR farmland OR farmlands) AND TS = (adsorption OR sorption OR langmuir OR freundlich OR isotherm) AND TS = (cadimum OR Cd OR chromium OR CrOR lead OR Pb OR Arsenic) were used for retrieval. The adsorption amount and related data of heavy metals in soils in the selected literature were manually collected. Those that did not indicate the geographic coordinates of the sampling soil area were not adopted. Some literature that indicated the sampling area was located through Google Earth to obtain the latitude and longitude of the specific sampling point.
[0045] The heavy metal adsorption data includes all data information of the adsorption amount of heavy metals, the equilibrium concentration of heavy metals, the temperature of heavy metals, the water-soil ratio of heavy metals and the pH value of heavy metal solutions; the heavy metals include arsenic (As), cadmium (Cd), chromium (Cr) and lead (Pb); in this embodiment, the adsorption data and soil properties of arsenic (As), cadmium (Cd), chromium (Cr) and lead (Pb) are extracted by manual collection, including equilibrium concentration, equilibrium adsorption amount, water-soil ratio, solution pH, longitude and latitude, soil pH, solution temperature, soil OC, soil clay, among which As mainly exists in the form of anionic groups in the soil, while Cd, Cr and Pb generally exist in the form of cations;
[0046] Among them, if the main text and attachment information of the literature do not directly list the amount of heavy metal adsorption in the soil, WebPlotDigitizer was used to extract the experimental points in the fitted adsorption curve to obtain the heavy metal adsorption amount and the heavy metal concentration data in the solution at equilibrium; if the soil-water ratio (g / mL) is not directly given in the literature, it is calculated according to the experimental soil amount and experimental solution amount in the materials and methods; if the initial concentration of heavy metals is not clearly indicated in the literature, the solution equilibrium concentration, soil-water ratio and heavy metal adsorption amount are used for calculation, and the calculation formula is as follows:
[0047] C0=Q e*t+C e
[0048] Where C0 is the initial concentration of heavy metals in the solution (mg / L), C e is the solution concentration when adsorption reaches equilibrium (mg / L), t is the water-to-soil ratio of the solution (g / mL), Q e is the adsorption amount when adsorption reaches equilibrium (mg / g);
[0049] The heavy metal distribution coefficient (Kd) indicates the adsorption and fixation capacity of a certain soil for heavy metals. It is calculated using the ratio of equilibrium adsorption amount and equilibrium concentration. The calculation formula is as follows:
[0050]
[0051] Among them, K d is the partition coefficient of soil for heavy metals;
[0052] S2, preprocessing the heavy metal distribution coefficient modeling database to obtain a heavy metal distribution coefficient preprocessing sample data set;
[0053] S3, dividing the heavy metal distribution coefficient preprocessing sample data set into a test set and a training set, establishing a soil heavy metal distribution coefficient prediction model based on a random forest algorithm, and performing model evaluation, mineral feature effectiveness evaluation, and feature importance evaluation on the soil heavy metal distribution coefficient prediction model;
[0054] Specifically, in this embodiment, the data are randomly divided into a test set and a training set in a ratio of 20:80, wherein the training set is used to train the model and the test set is used to evaluate the prediction accuracy of the model;
[0055] S4, inputting the sample data of the unknown soil heavy metal distribution coefficient into the trained soil heavy metal distribution coefficient prediction model for prediction, and obtaining the unknown soil heavy metal distribution coefficient;
[0056] The soil heavy metal distribution coefficient prediction model constructed by the present invention can realize the prediction of the heavy metal distribution coefficient of soil sample points with known soil properties, mineral content and adsorption properties. It is efficient and accurate, avoids the complicated experimental procedures of traditional adsorption experiments in obtaining single heavy metal adsorption data, shortens the working cycle, and greatly saves manpower, material and financial resources; it also comprehensively considers the influence of the content of different minerals in the soil on the heavy metal adsorption capacity, thereby enhancing the prediction accuracy of the heavy metal distribution coefficient, improving the universality and interpretability of the model, and realizing the correspondence between the soil mineral content and the heavy metal distribution coefficient; compared with the risk assessment that only considers the heavy metal content, it is more reasonable to evaluate the heavy metal risk of soil with the heavy metal distribution coefficient, and soil control measures can be taken according to the distribution coefficient predicted by different soil properties, thereby minimizing the pollution risk of soil heavy metals.
[0057] As a preferred embodiment, in step S2, when preprocessing the heavy metal partition coefficient modeling database, it is necessary to perform missing value filling, duplicate value deletion, outlier processing, data standardization, and dimensionality reduction processing on the heavy metal partition coefficient modeling database;
[0058] Specifically, before obtaining the preprocessed sample data set, it is necessary to fill in the missing sample data in the data set, import the collected data into ArcGIS to check the spatial coordinates, and remove duplicate values;
[0059] When extracting adsorption data from literature, some experiments used initial heavy metal concentrations that were thousands to tens of thousands times higher than the surface water environmental standards. This high-value data has little reference value for the actual soil environmental prediction process and is likely to affect the model accuracy of the entire heavy metal distribution coefficient, resulting in a high distribution coefficient at the prediction point. The above extreme heavy metal adsorption data were removed to make the sample database more reasonable and objective.
[0060] After the above processing, the preliminarily obtained heavy metal distribution coefficient preprocessing sample data set includes soil coordinates, soil pH value, soil organic matter content, soil cation exchange capacity, soil temperature, soil clay content, soil mineral content, heavy metal equilibrium adsorption capacity, solution equilibrium concentration, solution initial concentration, solution temperature, water-soil ratio and solution pH value; these data information include soil properties, mineral composition and adsorption properties, and are also data with high correlation with the heavy metal distribution coefficient. Based on this database, the prediction accuracy of the heavy metal distribution coefficient can be improved; the heavy metal distribution coefficient preprocessing sample data set obtains a total of 18 initial characteristic factors and 2854 sample data, of which As is 380, Cd is 1383, Cr is 318, and Pb is 774;
[0061] Specifically, the initial concentration of the solution is the initial addition amount of the heavy metal in the solution in the adsorption experiment;
[0062] For the initial concentration of the solution that is not clearly indicated in the literature, it is calculated using the solution equilibrium concentration, soil-water ratio and the amount of heavy metal adsorbed. The calculation formula is as follows:
[0063] C0=Q e *t+C e ;
[0064] Since there are large differences in experimental conditions, analytical tests, etc. in batch adsorption tests, in order to eliminate the influence of different attributes between different indicators, the data set can be standardized and the prediction target can be logarithmized. The data standardization method adopts one of the 0-1 normalization method, log function standardization method, linear ratio standardization method, range standardization method, and Z-score standardization method;
[0065] The dimensionality reduction processing method includes one of Spearman correlation, permutation importance, principal component analysis, low variance filter, mutual information method and f regression method; through dimensionality reduction processing, only important features are retained, data redundancy can be effectively avoided, and operation speed can be provided; specifically, the characteristic values of different data factors are obtained by machine learning algorithm, and arranged from high to low, the factor data with greater influence is screened out, the correlation between different factors is excluded, the independence and importance of factors are guaranteed, and the scientificity of modeling accuracy and factor selection is improved. Specifically, in the present embodiment, the data set processed by the above-mentioned standardization is processed by Spearman correlation, permutation importance, and principal component analysis to perform dimensionality reduction processing of the database, delete redundant features, retain highly correlated and independent characteristic factors, reduce the modeling factors from 18 to 11, and obtain the final heavy metal distribution coefficient preprocessing sample data set, as shown in Table 1.
[0066] Table 1 Description of preprocessed sample dataset
[0067]
[0068]
[0069] As a preferred embodiment, in step S3, when a training set is used to obtain a soil heavy metal distribution coefficient prediction model based on a random forest algorithm, the soil heavy metal distribution coefficient prediction model is also subjected to hyperparameter optimization to obtain a soil heavy metal distribution coefficient prediction model with the best prediction performance; preferably, the hyperparameter optimization method includes one of grid search, random search, Bayesian optimization, and genetic algorithm; specifically, in this embodiment, a Bayesian optimization algorithm is selected to perform hyperparameter optimization on the model, and the adjustment range of each parameter is: n_estimators is 1 to 1000, max_depth is 1 to 200, and max_leaf_nodes is 50 to 500. After 300 iterations of Bayesian optimization and comparison of the model performance on each optimization validation set, the optimal parameter combination of the heavy metal distribution coefficient prediction model within the adjustment range is finally obtained;
[0070] In step S3, the model evaluation method is the determination coefficient (R 2), mean absolute error (MAE), root mean square error (RMSE), and a 5-fold cross-validation was used to verify the prediction performance of the soil heavy metal distribution coefficient prediction model; specifically, the determination coefficient R 2 It is a statistical indicator for evaluating the linear relationship between the true value and the predicted value. Its value range is [0,1]. 2 The closer it is to 1, the better the model prediction performance is, and vice versa. The mean absolute error (MAE) is the mean of the difference between the sample prediction value and the sample true value. The smaller the MAE, the smaller the prediction error and the better the model performance. The root mean square error (RMSE) is the square root of the ratio of the square of the difference between the sample prediction value and the sample true value to the sample number, which measures the deviation between the sample prediction value and the sample true value. The calculation formula is as follows:
[0071]
[0072] Among them, y i is the true value of sample i, is the predicted value of sample i, is the mean of all samples, N is the sample size; specifically, y i is the true value of the heavy metal partition coefficient, is the predicted value of the heavy metal partition coefficient, is the average value of the true values of all heavy metal partition coefficients, and N is 11.
[0073] The mineral characteristic validity evaluation method includes a Pearson correlation evaluation method and a Spearman correlation evaluation method; specifically, the Pearson correlation and the Spearman correlation are used to calculate the correlation coefficient between the mineral content and the heavy metal distribution coefficient, and the correlation between the mineral content and the heavy metal distribution coefficient is evaluated according to the significance level.
[0074] The feature importance evaluation method uses SHAP and partial dependence diagram for evaluation; specifically, the SHAP method is used to obtain the final contribution of each input feature to model construction; the partial dependence diagram is used to obtain the relevance of a certain input feature to model construction.
[0075] Specifically, the As, Cd, Cr, and Pb pre-processed sample data sets in the heavy metal distribution coefficient pre-processed sample data set finally obtained in step 2 are randomly divided into a test set and a training set in a ratio of 20:80, wherein the training set is used to train the model, and the test set is used to evaluate the prediction accuracy of the model, and a machine learning algorithm is selected to train and test the prediction model;
[0076] In order to reasonably evaluate the effectiveness of random forest (RF) modeling of soil heavy metal adsorption, support vector machine (SVM) and multi-layer perceptron (MLP) were selected as benchmark algorithms. Under the default parameters, the three evaluation indicators of R2, MAE and RMSE of each model were compared, and the results are shown in Table 2.
[0077] After multiple cycles, the R values of As, Cd, Cr, and Pb based on the random forest model (RF model) 2 The MAEs of the four metals were 0.363, 0.493, 0.755 and 0.675, and the corresponding RMSEs were 0.486, 0.734, 1.300 and 0.980, which were all greater than those of the SVM and MLP models. The MAE and RMSE were both smaller than those of the SVM and MLP models, indicating that the heavy metal distribution coefficient prediction model based on RF is feasible and effective, and its model performance is acceptable.
[0078] Table 2 Comparison of the accuracy of prediction models for As, Cd, Cr, and Pb
[0079]
[0080] The hyperparameters of the RF model determined above were optimized, and the Bayesian optimization algorithm was selected to optimize the hyperparameters of the model. The adjustment range of each parameter was: n_estimators was 1 to 1000, max_depth was 1 to 200, and max_leaf_nodes was 50 to 500. After 300 iterations of Bayesian optimization and comparison of the model performance on the validation set for each optimization, the optimal parameter combination of the heavy metal distribution coefficient prediction model within the adjustment range was finally obtained, and the results are shown in Table 3.
[0081] Table 3 Optimal parameter combinations for prediction models of As, Cd, Cr and Pb
[0082]
[0083] After hyperparameter optimization, the R 2 The MAE and RMSE were slightly lower than those with the default parameters (Table 4). The modeling results are shown in Figure 2 As shown, Figure 2 a represents a schematic diagram of the comparison of the actual value of the heavy metal As distribution coefficient and the predicted value of the As distribution coefficient obtained by the prediction method provided by the present invention; wherein Figure 2 b is a schematic diagram showing the comparison of the actual value of the heavy metal Cd distribution coefficient and the predicted value of the Cd distribution coefficient obtained by the prediction method provided by the present invention; wherein Figure 2c represents a schematic diagram of the comparison of the actual value of the heavy metal Cr distribution coefficient and the predicted value of the Cr distribution coefficient obtained by the prediction method provided by the present invention; wherein Figure 2 d is a schematic diagram showing the comparison of the actual value of the heavy metal Pb distribution coefficient and the predicted value of the Pb distribution coefficient obtained by the prediction method provided by the present invention; Figure 2 a- Figure 2 In d, the solid dots represent the sample data set, the solid line represents the fitting line of the sample data set, and the dotted line represents a straight line of y=x; the sample data set is distributed on both sides of the dotted line, and the fitting line almost coincides with the dotted line, indicating that the predicted value is very close to the true value, that is, the soil heavy metal distribution coefficient prediction model provided by the present invention has a good prediction effect.
[0084] Table 4 Performance comparison of As, Cd, Cr, and Pb prediction models before and after optimization
[0085]
[0086] Based on the RF model and optimized parameters obtained above, the effectiveness of minerals was evaluated. 2 In contrast, the R of the prediction model for the distribution coefficient of heavy metals As and Cd after considering minerals as input features 2 Both have been improved to a certain extent, and MAE and RMSE have been reduced to a certain extent. Figure 3 As shown in Table 5, it shows that minerals have a great influence on the heavy metal distribution coefficient and can effectively improve the accuracy of the soil heavy metal distribution coefficient prediction model.
[0087] Table 5 Comparison of model accuracy of minerals for As and Cd
[0088]
[0089] To further illustrate the effectiveness of the mineral characteristics selected in the present invention, the following uses As as an example to calculate the correlation coefficient between mineral content and heavy metal distribution coefficient using Pearson correlation and Spearman correlation, see Figure 4 As shown, specifically, the Pearson correlation results are as follows Figure 4 As shown in a, except for OC and montmorillonite, the significance of soil pH, iron oxides, initial concentration, kaolinite, solution pH, vermiculite, chlorite, feldspar and illite with their distribution coefficients is less than 0.01, showing a strong correlation; the Spearman correlation results are shown in Figure 4As shown in b, except for illite, montmorillonite and feldspar, the other features show obvious correlation with the As distribution coefficient. The above correlation analysis shows that most of the input features have a linear correlation with the As distribution coefficient, especially for mineral content, which shows a significant correlation with the As correlation coefficient, which helps the machine learning algorithm to build a metal Ln (Kd) prediction model through linear or nonlinear relationships;
[0090] The SHAP method is used to obtain the final contribution of each input feature to the model construction. Taking As as an example, the results are as follows Figure 5 As shown in the figure, according to the SHAP results, the As distribution coefficient has a significant negative relationship with soil pH. In soil, the adsorption of As(V) decreases with increasing pH, and the adsorption of As(III) also decreases when pH>7. This is because the increase in pH reduces the positive charge on the soil surface and increases the negative charge on the surface, so that negatively charged arsenate is more difficult to adsorb on the soil surface; the initial concentration has a negative effect on its Ln(Kd). Because the As adsorption process in various types of soils follows the Langmuir or Freundlich adsorption curve, the soil adsorption amount and the adsorption equilibrium concentration show a parabolic relationship with the increase in initial concentration. The slope of the isothermal adsorption curve, i.e., the distribution coefficient, shows a downward trend. Therefore, the initial concentration is negatively correlated with the As distribution coefficient, and the prediction results of this model are consistent with it. In addition, the soil mineral importance of As is ranked as iron oxides>montmorillonite>feldspar>vermiculite>kaolinite>chlorite>illite. Iron oxides have the strongest influence on the Ln(Kd) of As. In soil, As mainly exists in the form of anions, and the surface of aluminosilicate minerals generally carries a negative charge, so aluminosilicate minerals such as chlorite and illite have a weak adsorption capacity for As. However, As and iron oxides exchange ligands to form monodentate or bidentate inner sphere surface complexes, which have strong stability. Therefore, iron oxides show a higher importance in the As model than other silicate minerals, and the model prediction results are consistent with the existing experimental research results.
[0091] Embodiment 2:
[0092] The present invention also provides a device, comprising a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute some or all of the steps in Embodiment 1;
[0093] The processor may include one or more processing units, for example, the processor may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0094] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0095] A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. The memory may store instructions or data that the processor has just used or is cyclically used. If the processor needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor, and thus improves the efficiency of the system.
[0096] Embodiment 3:
[0097] The present invention also provides a storage medium having a computer program stored thereon, wherein when the program is executed, the device where the storage medium is located is controlled to execute part or all of the steps in Example 1.
[0098] The storage medium may include a high-speed RAM memory, and may also include a nonvolatile memory (nonvolatile memory), such as at least one disk memory. It is understandable that the storage medium can be a random access memory (Random Access Memory, RAM), a disk, a hard disk, a solid state disk (solid state disk, SSD) or a nonvolatile memory, etc., which can store program codes and other machine-readable media.
[0099] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods or storage media. Therefore, the embodiments of the present invention may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0100] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.
Claims
1. A method for predicting the heavy metal distribution coefficient of soil minerals, characterized in that: The steps include: S1. Collect soil sample information, including soil information, basic physical and chemical properties of soil, soil mineral content, and heavy metal adsorption data, and use the collected soil sample information as a heavy metal distribution coefficient modeling database; S2, preprocessing the heavy metal distribution coefficient modeling database to obtain a heavy metal distribution coefficient preprocessing sample data set, and dividing it into a test set and a training set; S3, using a random forest algorithm to perform machine learning on the training set to obtain a soil heavy metal distribution coefficient prediction model, and performing model evaluation, mineral feature effectiveness evaluation, and feature importance evaluation on the soil heavy metal distribution coefficient prediction model; S4. Inputting the sample data of the unknown soil heavy metal distribution coefficient into the trained soil heavy metal distribution coefficient prediction model for prediction to obtain the unknown soil heavy metal distribution coefficient.
2. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1, characterized in that: In step S1, the heavy metal adsorption data includes all data information of the adsorption amount of the heavy metal, the equilibrium concentration of the heavy metal, the temperature of the heavy metal, the water-soil ratio of the heavy metal and the pH value of the heavy metal solution; The heavy metals include arsenic (As), cadmium (Cd), chromium (Cr) and lead (Pb).
3. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1 or 2, characterized in that: In step S1, the soil mineral content data includes mineral content data of all ore types including illite, montmorillonite, kaolinite, chlorite, vermiculite, feldspar, hematite and goethite.
4. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1 or 2, characterized in that: In step S2, when preprocessing the heavy metal distribution coefficient modeling database, it is necessary to perform missing value filling, duplicate value deletion, outlier processing, data standardization, and dimensionality reduction processing on the heavy metal distribution coefficient modeling database; The data standardization method adopts one of 0-1 normalization method, log function standardization method, linear ratio standardization method, range standardization method, and Z-score standardization method; The dimensionality reduction processing method includes one of Spearman correlation, permutation importance, principal component analysis, low variance filter, mutual information method and f-regression method.
5. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1 or 2, characterized in that: The heavy metal distribution coefficient preprocessing sample data set includes soil coordinates, soil pH value, soil organic matter content, soil cation exchange capacity, soil temperature, soil clay content, soil mineral content, heavy metal equilibrium adsorption capacity, solution equilibrium concentration, solution initial concentration, solution temperature, water-soil ratio and solution pH value.
6. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 5, characterized in that: The initial concentration of the solution is the initial addition amount of heavy metals in the solution in the adsorption experiment; For the initial concentration of the solution that is not clearly indicated in the literature, it is calculated using the solution equilibrium concentration, soil-water ratio and the amount of heavy metal adsorbed. The specific calculation formula is shown below: C0=Q e *t+C e Where C0 is the initial concentration of heavy metals in the solution (mg / L), C e is the solution concentration when adsorption reaches equilibrium (mg / L), t is the water-to-soil ratio of the solution (g / mL), Q e is the amount of adsorption when the adsorption reaches equilibrium (mg / g).
7. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1 or 2, characterized in that: In step S3, when the soil heavy metal partition coefficient prediction model based on the random forest algorithm is obtained by using the training set, the soil heavy metal partition coefficient prediction model is also hyperparameter optimized to obtain the soil heavy metal partition coefficient prediction model with the best prediction performance.
8. The method for predicting the heavy metal distribution coefficient of soil minerals according to claim 1 or 2, characterized in that: In step S3, the model evaluation method is the determination coefficient (R 2 ), mean absolute error (MAE), root mean square error (RMSE), and 5-fold cross validation were used to verify the prediction performance of the soil heavy metal distribution coefficient prediction model; The mineral characteristic validity evaluation method includes a Pearson correlation evaluation method and a Spearman correlation evaluation method. The feature importance evaluation method is evaluated using SHAP and partial dependence diagram.
9. A device, characterized in that: It comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute a method for predicting the heavy metal distribution coefficient of soil minerals as described in any one of claims 1-8.
10. A storage medium, characterized in that: A computer program is stored thereon, wherein when the program is running, the device where the storage medium is located is controlled to execute a method for predicting the heavy metal distribution coefficient of soil minerals as described in any one of claims 1-8.
Citation Information
Cited By
Method for simulating heavy metal adsorption process of soil and underground water through multi-method dynamic coupling
CN121405265A
A multi-method dynamic coupling soil and groundwater heavy metal adsorption process simulation method
CN121405265B