Soil arsenic contamination risk assessment method, device and equipment based on machine learning

Through the machine learning-based soil arsenic pollution risk assessment method, principal component analysis and risk assessment models are used to solve the problem of time-consuming and harmful soil arsenic pollution adsorption experiments, achieve rapid and accurate soil arsenic pollution risk assessment, and improve improve the efficiency of scientific research and environmental protection.

CN118506922BActive Publication Date: 2024-10-01HUNAN ACAD OF FORESTRY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410967973.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-01
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

In the existing technology, soil arsenic pollution adsorption experiments are time-consuming, harmful, and cannot accurately judge the complex and changeable soil environmental characteristics, resulting in limited accuracy of arsenic pollution risk prediction.

Method used

A soil arsenic pollution risk assessment method based on machine learning is used to obtain the characteristic indicators of soil samples, classify them using principal component analysis, and input them into the arsenic pollution risk assessment main model and sub-model for prediction, and calculate the final risk assessment results.

Benefits of technology

It achieves rapid and safe assessment of soil arsenic pollution risks, improves the accuracy and efficiency of scientific research and environmental protection, and can more accurately predict the arsenic adsorption capacity of different soils.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506922B_ABST
    Figure CN118506922B_ABST
Patent Text Reader

Abstract

The present application relates to a soil arsenic contamination risk assessment method, device and equipment based on machine learning, which extracts multiple soil characteristic indicators related to the soil sample, analyzes the multiple soil characteristic indicators using principal component analysis, classifies the soil sample, obtains the soil sample category, inputs the multiple soil characteristic indicators into the arsenic contamination risk assessment main model, and the arsenic contamination risk assessment sub-model corresponding to the soil sample category for prediction, obtains the corresponding main prediction data and sub-prediction data, calculates the final prediction result based on the main prediction data and sub-prediction data, and conducts risk assessment on the soil sample based on the prediction result. The method can quickly obtain the ability of soil to adsorb arsenic, solves the problems of traditional adsorption experimental methods in large-scale prediction accuracy, operation difficulty, time requirement and safety, and improves the accuracy and efficiency of scientific research and environmental protection work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a soil arsenic contamination risk assessment method, device and equipment based on machine learning. Background Art

[0002] Arsenic is a Class I carcinogen identified by the International Agency for Research on Cancer (IARC). It enters humans through surface runoff and the food chain in the natural environment, causing serious environmental hazards and threats to human health. Arsenic exists in soil mainly in the form of trivalent (As(III)) and pentavalent (As(V)). Generally speaking, pentavalent arsenic (As(V)) is more common than trivalent arsenic (As(III)), and pentavalent arsenic is more easily adsorbed by soil, and is cumulative and non-degradable. Therefore, in-depth research on the adsorption and desorption of pentavalent arsenic in soil and accurate prediction of the adsorption-desorption level of pentavalent arsenic under different soil characteristics are necessary prerequisites for effectively solving the spread of arsenic pollution. The adsorption behavior of arsenic in soil is affected by many factors, such as soil properties, pH value, organic matter content, and free iron oxide. Under certain temperature conditions, the adsorption behavior of soil on arsenic will reach a dynamic equilibrium, at which time the relationship between the adsorption amount on the surface of soil particles and its equilibrium concentration in solution can be described by the adsorption isotherm. At present, the Freundlich and Langmuir equations are commonly used models to describe adsorption phenomena in soils. In particular, the adsorption of arsenic by soils can usually be described by the Langmuir equation.

[0003] In the prior art, the adsorption rate of arsenic can only be obtained by conducting an adsorption experiment on the collected soil samples. However, the operation of the adsorption experimental method is relatively complicated and is sensitive to external environmental factors, especially the influence of temperature. Therefore, a constant temperature environment must be maintained during the experiment. At the same time, the entire experiment takes a very long time from start to finish, during which steps such as soil sample processing, adsorption, centrifugation, and final post-adsorption concentration determination are involved. More importantly, during the experiment, the high toxicity of arsenate must also be taken into account. Any small mistake or improper operation in the experiment may lead to potential harm to the experimental operator or the environment. In addition, the waste liquid and contaminated soil generated after the experiment need to be specially treated to avoid further damage to the environment. In short, the arsenic adsorption-analysis prediction based on experimental technology is time-consuming and harmful, and it is impossible to accurately judge the complex and changeable soil environmental characteristics. When applied to large-scale, heterogeneous soil arsenic pollution risk prediction, the accuracy is very limited. Summary of the invention

[0004] Based on this, it is necessary to provide a soil arsenic contamination risk assessment method, device and equipment based on machine learning that can quickly and effectively assess the risk of arsenic contamination in the soil in response to the above technical problems.

[0005] A soil arsenic contamination risk assessment method based on machine learning, the method comprising:

[0006] Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample;

[0007] After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain soil sample categories;

[0008] Inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data;

[0009] The final prediction result is calculated based on the main prediction data and the sub-prediction data, and the risk assessment of the soil sample is performed based on the prediction result.

[0010] In one embodiment, the soil characteristic indicators include: soil pH, organic matter content, cation exchange capacity, clay content, free iron oxide content, and total arsenic and total phosphorus content.

[0011] In one embodiment, when using the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to predict soil samples based on multiple soil characteristic indicators, parameters related to the preset experimental environment are also input into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to obtain the prediction results under the corresponding preset experimental environment.

[0012] In one embodiment, the soil sample categories include: a core category, a strong adsorption category, and a weak adsorption category.

[0013] In one embodiment, the calculating the final prediction result according to the main prediction data and the sub-prediction data includes:

[0014] The corresponding sub-prediction data weight is extracted according to the soil sample category, and the prediction result is obtained by calculation based on the main prediction data, the sub-prediction data and the sub-prediction data weight.

[0015] In one embodiment, training the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model includes:

[0016] Acquire an initial training data set, wherein the initial training data set includes a plurality of sample sequences, each of the sample sequences corresponds to soil characteristic indicators corresponding to different soil samples under different experimental environments, and each of the sample sequences includes a plurality of soil characteristic indicators and experimental environment parameters;

[0017] Preprocessing all sample sequences in the initial training data set to obtain a standardized training data set;

[0018] The standardized training data set is processed by using Pearson correlation analysis and PCA principal component analysis, and the sample sequences in the standardized training data set are divided into a core training subset, a strong adsorption training subset and a weak adsorption training subset according to the correlation between soil physical and chemical properties and adsorption capacity;

[0019] Using the standardized training data set to train the arsenic pollution risk assessment main model to obtain a trained arsenic pollution risk assessment main model;

[0020] The core training subset, strong adsorption training subset and weak adsorption training subset are used to train the corresponding arsenic pollution risk assessment sub-models respectively, so as to obtain the core arsenic pollution risk assessment sub-model, the strong adsorption arsenic pollution risk assessment sub-model and the weak adsorption arsenic pollution risk assessment sub-model for predicting the core category, the strong adsorption category and the weak adsorption category respectively.

[0021] In one embodiment, the preprocessing of all sample sequences in the initial training data set includes:

[0022] Each of the sample sequences in the initial training data set is cleaned, interpolated, converted and standardized in turn.

[0023] In one embodiment, the standardized training data set is processed by Pearson correlation analysis and PCA principal component analysis, and the sample sequences in the standardized training data set are divided into a core training subset, a strong adsorption training subset, and a weak adsorption training subset according to the correlation between soil physical and chemical properties and adsorption capacity, including:

[0024] The standardized training data set is processed by Pearson correlation analysis and PCA principal component analysis, so as to divide the sequence data in the standardized training data set into different groups according to the correlation between soil physical and chemical properties and adsorption capacity;

[0025] Different groups were divided into core training subsets, strong adsorption training subsets and weak adsorption training subsets according to the correlation between the PCA principal component weights and the Pearson correlation coefficient of the adsorption amount.

[0026] The present application also provides a soil arsenic contamination risk assessment device based on machine learning, the device comprising:

[0027] A soil sample acquisition module, used to acquire soil samples to be risk assessed and extract multiple soil characteristic indicators related to the soil samples;

[0028] A soil sample classification module, used to classify the soil samples after analyzing the plurality of soil characteristic indicators using a principal component analysis method to obtain the soil sample category;

[0029] A preliminary prediction module is used to input multiple soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtain corresponding main prediction data and sub-prediction data;

[0030] The risk assessment module is used to calculate the final prediction result according to the main prediction data and the sub-prediction data, and perform risk assessment on the soil sample according to the prediction result.

[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample;

[0033] After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain the soil sample categories;

[0034] Inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data;

[0035] The final prediction result is calculated based on the main prediction data and the sub-prediction data, and the risk assessment of the soil sample is performed based on the prediction result.

[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0037] Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample;

[0038] After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain the soil sample categories;

[0039] Inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data;

[0040] The final prediction result is calculated based on the main prediction data and the sub-prediction data, and the risk assessment of the soil sample is performed based on the prediction result.

[0041] The above-mentioned soil arsenic contamination risk assessment method, device and equipment based on machine learning extracts multiple soil characteristic indicators related to the soil sample, analyzes the multiple soil characteristic indicators using principal component analysis, classifies the soil sample, obtains the soil sample category, inputs the multiple soil characteristic indicators into the arsenic contamination risk assessment main model, and the arsenic contamination risk assessment sub-model corresponding to the soil sample category for prediction, obtains the corresponding main prediction data and sub-prediction data, calculates the final prediction result based on the main prediction data and sub-prediction data, and conducts risk assessment on the soil sample based on the prediction result. The method can quickly obtain the ability of soil to adsorb arsenic, solves the problems of traditional adsorption experimental methods in terms of operational difficulty, time requirements and safety, and improves the accuracy and efficiency of scientific research and environmental protection work. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Schematic diagram of a process of soil arsenic contamination risk assessment method based on machine learning in one embodiment;

[0043] Figure 2 A schematic diagram of a flow chart of a method for training a model in an embodiment;

[0044] Figure 3 A schematic diagram of a PCA principal component analysis result in one embodiment;

[0045] Figure 4 is a schematic diagram of Pearson correlation coefficient analysis in one embodiment;

[0046] Figure 5 A schematic diagram of average data per group of K-Means clustering in one embodiment;

[0047] Figure 6 A schematic diagram of the regression scattering points of the predicted value and the true value for data prediction based on models established by different machine learning algorithms in one embodiment, wherein: Figure 6 (a) is the extreme random tree machine learning algorithm, Figure 6 (b) is the gradient boosting machine learning algorithm, Figure 6 (c) is the random forest machine learning algorithm, Figure 6 (d) is the extreme gradient boosting machine learning algorithm;

[0048] Figure 7 is a structural block diagram of a soil arsenic pollution risk assessment device based on machine learning in one embodiment;

[0049] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] The risk assessment of arsenic contamination in soil is usually reflected by the soil's adsorption rate. However, in the existing technology, a series of experiments are required on the soil to be assessed to finally obtain the results, and this process is relatively long and unsafe. To address this issue, Figure 1 As shown, a soil arsenic contamination risk assessment method based on machine learning is provided, and the specific steps include:

[0052] Step S100: obtaining a soil sample to be risk assessed and extracting a plurality of soil characteristic indicators related to the soil sample.

[0053] Step S110, after analyzing a plurality of soil characteristic indicators using principal component analysis, the soil samples are classified to obtain soil sample categories.

[0054] Step S120 , inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data.

[0055] Step S130, calculating the final prediction result based on the main prediction data and the sub-prediction data, and performing risk assessment on the soil sample based on the prediction result.

[0056] In this embodiment, considering the problems of traditional soil arsenic adsorption methods in terms of operational difficulty, time requirements and safety, a trained model is used to predict the arsenic adsorption capacity, thereby achieving a rapid, efficient and safe soil arsenic contamination risk assessment. In this method, the corresponding sub-models are trained specifically according to different types of soil, and the data predicted by the sub-models are used to correct the data predicted by the main model, so that a more accurate prediction result can be obtained.

[0057] In this embodiment, through prior knowledge, in step S100, the extracted multiple soil characteristic indicators related to the soil sample include: soil pH, organic matter content, cation exchange capacity, clay content, free iron oxide content, and total arsenic and total phosphorus content. Although these six indicators are conventional general indicators of arsenic adsorption rate of soil in this field, there are actually multiple conventional general indicators. The selection of these six indicators is the first time proposed in this method. At the same time, when training the learning model, the model is also trained by using these six soil characteristic indicators corresponding to different soils.

[0058] In this embodiment, the method for extracting characteristic indicators based on soil samples may be through experimental analysis, and the specific experimental analysis method is not limited to one.

[0059] In step S110, the principal component analysis method is used to analyze the extracted soil characteristic indicators to obtain the groups to which they belong, and then they are classified into different soil categories according to the strength of the soil's arsenic adsorption performance.

[0060] For reference Figure 3 , soil samples can be divided into multiple groups with a certain characteristic through principal component analysis. Figure 3 It can be seen that each dot represents a characteristic indicator of a soil sample, and some soil samples have high common characteristics and therefore belong to multiple groups at the same time.

[0061] In this embodiment, soil samples are initially classified by component analysis, and then classified into corresponding categories according to pre-set rules. Soil sample categories include: core category, strong adsorption category, and weak adsorption category. After the soil samples are classified, the corresponding arsenic pollution risk assessment sub-model is selected according to the category.

[0062] Next, in step S120, the soil characteristic indicators are input into the arsenic pollution risk assessment sub-model and the selected corresponding arsenic pollution risk assessment sub-model in the form of a sequence, and prediction is performed simultaneously. It can be understood that the arsenic pollution risk assessment sub-model includes a core arsenic pollution risk assessment sub-model, a strong adsorption arsenic pollution risk assessment sub-model, and a weak adsorption arsenic pollution risk assessment sub-model corresponding to the above three soil categories.

[0063] Because in the actual adsorption rate experiment, the experimental environment corresponding to different experimental parameters will also affect the final adsorption rate detection results. Therefore, when using the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to predict soil samples based on multiple soil characteristic indicators, the parameters related to the preset experimental environment are also input into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to obtain the prediction results under the corresponding preset experimental environment.

[0064] In this embodiment, the parameters related to the preset experimental environment include, but are not limited to, soil-liquid ratio, solution pH value, background ion concentration, experimental temperature, and experimental time.

[0065] In step S130, the main prediction data is corrected according to the sub-prediction data to obtain the final prediction data. In this embodiment, the final prediction result is calculated based on the main prediction data and the sub-prediction data, including: extracting the corresponding sub-prediction data weight according to the soil sample category, and calculating the prediction result based on the main prediction data, the sub-prediction data and the sub-prediction data weight.

[0066] Specifically, the sub-prediction data weights are obtained by analyzing the training samples when training the model, which will be described later.

[0067] After obtaining the final prediction results, based on the prediction results and the agricultural land soil pollution risk control standards combined with the risk assessment coding method, we can further obtain no risk, mild risk, moderate risk, high risk and extremely high risk to achieve arsenic pollution risk assessment of the soil samples to be tested.

[0068] In this embodiment, if Figure 2 As shown, a method for training the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model is also provided, including:

[0069] Step S200, obtaining an initial training data set, the initial training data set includes multiple sample sequences, each sample sequence corresponds to soil characteristic indicators corresponding to different soil samples in different experimental environments, and each sample sequence includes multiple soil characteristic indicators and experimental environment parameters.

[0070] Step S210, preprocessing all sample sequences in the initial training data set to obtain a standardized training data set.

[0071] Step S220, using Pearson correlation analysis and PCA principal component analysis to process the standardized training data set, and dividing the sample sequences in the standardized training data set into a core training subset, a strong adsorption training subset, and a weak adsorption training subset according to the correlation between soil physical and chemical properties and adsorption capacity.

[0072] Step S230, training the arsenic pollution risk assessment main model using the standardized training data set to obtain a trained arsenic pollution risk assessment main model.

[0073] Step S240, using the core training subset, the strong adsorption training subset and the weak adsorption training subset to train the corresponding arsenic pollution risk assessment sub-models respectively, to obtain the core arsenic pollution risk assessment sub-model, the strong adsorption arsenic pollution risk assessment sub-model and the weak adsorption arsenic pollution risk assessment sub-model for prediction of the core category, the strong adsorption category and the weak adsorption category respectively.

[0074] In step S200, the initial training data set is constructed by detecting the physical and chemical properties of different soils and adsorption experimental data from a large amount of literature.

[0075] In step S210, preprocessing all sample sequences in the initial training data set includes: sequentially performing cleaning, interpolation, conversion and standardization on each sample sequence in the initial training data set.

[0076] Specifically, the soil characteristic indicators of interest in this method are soil pH, organic matter content, cation exchange capacity, clay content, free iron oxide content, and total arsenic and total phosphorus content. Since different literatures do not conduct exactly the same tests on arsenic adsorption indicators, some indicators are missing in the retrieved data. In this case, the data with two or more missing indicators in the sample sequence corresponding to the same soil sample are first removed, that is, the sample sequence in the initial training data set is first cleaned.

[0077] Furthermore, in the cleaned initial training data set, for the missing sample sequences, the mean interpolation method, KNN interpolation method and conversion method were used in combination with the Chinese soil database to interpolate the missing data and obtain the interpolated initial training data set.

[0078] In one embodiment, when the missing characteristic index in the sample sequence is the free iron oxide content, the iron freeness (66%) and activation (25%) are calculated according to the T-Fe and DCB-Fe and DCB-Fe and Fe-OX in the search literature for data filling. The freeness and activation are calculated using the existing data in the data set and according to the formula: freeness = (DCB-Fe / T-Fe), activation = (OX-Fe / DCB-Fe), and the remaining missing parts are filled in again using the filled mean.

[0079] In one embodiment, when the missing characteristic indicator in the sample sequence is cation exchange capacity or clay content, the KNN interpolation method is used in combination with the Chinese soil type database, which is a national soil data set based on the second soil census, for interpolation and filling.

[0080] Finally, the Z-score standardization method is used to standardize the initial training data set after interpolation to obtain a standardized sample data set.

[0081] In step S220, the results of Pearson correlation analysis and PCA principal component analysis are used on the standardized sample data set. According to the correlation between soil physical and chemical properties and adsorption capacity, three sub-data sets, namely, a core subset, a strong adsorption subset and a weak adsorption subset, are established, and their proportions in the data set are calculated.

[0082] First, a Pearson correlation analysis was performed on the input features and output feature adsorption capacity in the standardized sample data set, including soil physical and chemical properties and experimental parameter conditions, to preliminarily predict which factors in the input features have a certain correlation with the adsorption capacity, and mark them as potential influencing factor features. At the same time, check whether there is a relatively obvious linear correlation between each input feature to avoid information redundancy in the process of machine learning model construction, which will affect the stability of the model. After deduplication of all soil type data in the data set, the physical and chemical properties of all soil types were obtained, and PCA principal component analysis was performed on this. The association between the two groups with the highest cumulative difference explanation rate and the pre-set potential factor characteristics was examined, and the soil samples were divided into: core subset, strong adsorption subset and weak adsorption subset, and their proportion in the data set was calculated.

[0083] Specifically, all these multidimensional data are simplified through principal component analysis (PCA) to build an unsupervised learning pre-classification model, and the results are represented on a two-dimensional plane. The soil physical and chemical factor characteristics are marked on the graph in the form of vectors, such as Figure 3 Then the K-means algorithm is used to cluster them. The potential influencing factors are found and marked through Pearson correlation analysis, such as Figure 4 As shown, the vector of potential influencing factors is defined as the adsorption correlation direction. Under K-Means clustering, each group can be preliminarily pre-classified into a core subset, a strong adsorption subset, and a weak adsorption subset. Among them, the three clusters at the intersection of the PC1 and PC2 axes are the core subsets, which mainly reflect the subtle differences in the effects of different physical and chemical factors on the adsorption performance in most samples. The strong adsorption subset is the union of the sample clusters in the positive direction of the PC1 axis and the core subset. After the sample dimensionality reduction, the important features of the principal component have a high positive correlation with the adsorption performance. The weak adsorption subset is the union of the sample clusters in the positive direction of the PC2 axis and the core subset. After the sample dimensionality reduction, the important features of the principal component have a weak correlation with the adsorption performance. The average data of each subset are shown in Figure 5 As shown, at the same time, three sub-datasets, namely the core subset, the strong adsorption subset and the weak adsorption subset, are established, and their proportions in the data set are calculated.

[0084] Specifically, the Pearson correlation coefficient (PCC) is used to preliminarily measure the correlation between input and output features, such as Figure 4 As shown in the figure, the input features include six soil characteristic indicators and six experimental parameters, soil pH (hereinafter referred to as pH (Soil), organic matter content (hereinafter referred to as OM), cation exchange capacity (hereinafter referred to as CEC), clay content (hereinafter referred to as Clay), free iron oxide content (hereinafter referred to as DCB-Fe), total arsenic and total phosphorus content (hereinafter referred to as T-As+TP) and adsorption experimental data, including: solution pH (hereinafter referred to as pH (S)), background ion concentration (Ionic Strength, hereinafter referred to as IS), soil / liquid ratio (Soil / Liquid Ratio), experimental temperature (Temperature), experimental time (Time), solution initial concentration (hereinafter referred to as C0) as input features, and soil adsorption capacity (hereinafter referred to as Qe) as output features.

[0085] Furthermore, the mathematical expression of PCC is:

[0086] ;

[0087] In the above formula, Rxy is the PCC value between x (input variable) and y (target variable). The PCC value range is -1 to 1. Rxy = 1 means that there is a strong linear correlation between the variables, and the symbol indicates positive or negative correlation. However, Rxy = 0 means that there is no correlation between the variables.

[0088] In this embodiment, the standardized training data set is processed by Pearson correlation analysis and PCA principal component analysis, and the sample sequences in the standardized training data set are divided into core training subsets, strong adsorption training subsets and weak adsorption training subsets according to the correlation between soil physical and chemical properties and adsorption capacity, including: the standardized training data set is processed by Pearson correlation analysis and PCA principal component analysis, and the sequence data in the standardized training data set is divided into different groups according to the correlation between soil physical and chemical properties and adsorption capacity, and different groups are divided into core training subsets, strong adsorption training subsets and weak adsorption training subsets according to the correlation between the principal component weights of PCA and the Pearson correlation coefficient of the adsorption amount.

[0089] As shown in Table 1, the groups in each sub-dataset and the proportion of its component groups in the total are given.

[0090] Table 1

[0091]

[0092] In this embodiment, the weight of the sub-prediction data is its corresponding overall proportion. For example, when predicting the adsorption capacity of a certain soil, it is first input into the unsupervised learning classification model generated by the principal component analysis method to evaluate the adsorption capacity type of the soil. Assuming that the soil type currently being evaluated is a strong adsorption type, the prediction result obtained by the main model is A, and the prediction result obtained by the corresponding sub-model is B, then the final prediction result data is (1-88.71%) A+88.71%B.

[0093] That is to say, in step S130, the final prediction result is calculated according to the prediction results of the main model and the sub-model in combination with the corresponding overall proportions.

[0094] In step S230 and step S240, the learning model to be trained can be Random Forest (RF), Extremely Randomized Trees (ET), Gradient Boosting Decision Tree (GBDT), and eXtremeGradient Boosting (XGB) in the ML model.

[0095] In this embodiment, the grid search cross validation (GridSearchCV) method is used to tune the hyperparameters of the machine learning model. The specific implementation method is as follows:

[0096] (1) Define the parameter range, select various parameter combinations for the model, and set a series of values ​​to be tested for each parameter. Including: the number of estimators (n_estimators), the maximum tree depth (max_depth), and the maximum number of features used (max_features). For the XGB model, there are only n_estimators and max_depth;

[0097] (2) Data segmentation: Divide the entire data set into a training set and a test set in a ratio of 80%:20%;

[0098] (3) 5-Kfold cross validation: Divide the dataset into 5 parts, ensuring that one subset is used as the validation set each time and the rest are used as the training set;

[0099] (4) Perform grid search: For each combination in the parameter range, calculate the average performance of the model using 5-Kfold cross validation;

[0100] (5) Select the best parameters: Load the test set data into the cross-validation result parameters and select the parameter combination with the highest score as the final parameters of the model.

[0101] After training the above four models, their prediction effects were verified and it was found that the performance of the ET model significantly surpassed the other three algorithms (RF, GBDT, and XGB). Based on the training data set and the test data set, a joint scatter plot of the actual and model predicted responses was constructed, and a 95% confidence interval was defined. The confidence interval of ET on the test set was much narrower than that of the other three, indicating that its prediction accuracy and stability were higher. Further evaluation was performed by comparing the coefficient of determination (R 2 ), root mean square error (RMSE) and average iteration time (Iterations Average Time, hereinafter referred to as IAT) indicators, once again confirmed the significant advantages of the ET model in multiple evaluation criteria.

[0102] Therefore, based on the above findings, preferably, using the ET algorithm to predict the adsorption capacity of soil for As(V) can achieve better results.

[0103] In this embodiment, when training each learning model, in addition to inputting the six soil characteristic indicators into the model, the relevant experimental parameters are also included, and the corresponding true value, i.e., the adsorption value true value, is given. In this way, the obtained model will give the corresponding adsorption rate true value according to the soil characteristic indicators and a changeable experimental environment, which makes it possible to flexibly obtain the prediction results under various experimental environments through the model. At the same time, it can be known that according to the actual application requirements, the prediction results under a fixed experimental environment can also be obtained by training.

[0104] like Figure 6 As shown in the figure, the scatter plot presents all the predicted values ​​and true values ​​after data partitioning under 10 random seeds and modeling using four different model algorithms. The gray line represents the fitted line based on the gray points, i.e. the training set data, and the black line represents the fitted line based on the black points, i.e. the test set data. Figure 6 (b) The ET model algorithm, namely the gradient boosting decision tree algorithm, can effectively reduce the variance of the model by introducing randomness, thereby increasing the diversity of the model, resulting in better performance of the model on unknown data. Among its performance indicators on the test set, R2 and RMSE can reach 0.882 and 0.321 respectively, with high accuracy. This method uses machine learning to empower the method of predicting the ability of soil to adsorb arsenic. The precise model established by machine learning can quickly and accurately obtain the ability of soil to adsorb arsenic when predicting different types of soil. This solves the technical bottleneck that traditional adsorption experimental methods are time-consuming and cannot accurately predict the arsenic adsorption levels of different types of soils.

[0105] In the above-mentioned soil arsenic contamination risk assessment method based on machine learning, by combining the physical and chemical properties of the soil and the experimental conditions as features, the trained model can effectively distinguish the adsorption capacity of different types of soils for As(V), thereby enhancing the accuracy and generalization ability of the prediction model. The prediction model can adapt, self-adjust and optimize with the addition of new data, and is more adaptable than traditional mathematical modeling. This method, using machine learning technology, can provide higher prediction accuracy for a large number of different types of soils and different experimental environmental conditions, while also maintaining good interpretability.

[0106] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0107] In one embodiment, Figure 7 As shown, a soil arsenic contamination risk assessment device based on machine learning is provided, comprising: a soil sample acquisition module 300, a soil sample classification module 310, a preliminary prediction module 320 and a risk assessment module 330, wherein:

[0108] A soil sample acquisition module 300 is used to acquire a soil sample to be risk assessed and extract a plurality of soil characteristic indicators related to the soil sample;

[0109] A soil sample classification module 310 is used to classify the soil samples after analyzing the plurality of soil characteristic indicators using a principal component analysis method to obtain the soil sample category;

[0110] The preliminary prediction module 320 is used to input a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtain the corresponding main prediction data and sub-prediction data;

[0111] The risk assessment module 330 is used to calculate the final prediction result according to the main prediction data and the sub-prediction data, and perform risk assessment on the soil sample according to the prediction result.

[0112] For the specific limitations of the soil arsenic contamination risk assessment device based on machine learning, please refer to the limitations of the soil arsenic contamination risk assessment method based on machine learning above, which will not be repeated here. Each module in the above-mentioned soil arsenic contamination risk assessment device based on machine learning can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0113] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a soil arsenic contamination risk assessment method based on machine learning is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0114] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0115] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0116] Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample;

[0117] After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain the soil sample categories;

[0118] Inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data;

[0119] The final prediction result is calculated based on the main prediction data and the sub-prediction data, and the risk assessment of the soil sample is performed based on the prediction result.

[0120] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0121] Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample;

[0122] After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain the soil sample categories;

[0123] Inputting a plurality of soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtaining corresponding main prediction data and sub-prediction data;

[0124] The final prediction result is calculated based on the main prediction data and the sub-prediction data, and the risk assessment of the soil sample is performed based on the prediction result.

[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0126] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0127] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A soil arsenic contamination risk assessment method based on machine learning, characterized in that: The method comprises: Obtaining a soil sample to be risk assessed, and extracting a plurality of soil characteristic indicators related to the soil sample; After analyzing the plurality of soil characteristic indicators by using a principal component analysis method, the soil samples are classified to obtain soil sample categories; The plurality of soil characteristic indicators are respectively input into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and the corresponding main prediction data and sub-prediction data are obtained. The training of the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model includes: obtaining an initial training data set, the initial training data set includes a plurality of sample sequences, each of the sample sequences corresponds to soil characteristic indicators corresponding to different soil samples under different experimental environments, each of the sample sequences includes a plurality of soil characteristic indicators and experimental environment parameters, all the sample sequences in the initial training data set are preprocessed to obtain a standardized training data set, and Pearson correlation analysis and PCA main The standardized training data set is processed by component analysis, and the sample sequences in the standardized training data set are divided into a core training subset, a strong adsorption training subset, and a weak adsorption training subset according to the correlation between soil physicochemical properties and adsorption capacity, and the arsenic pollution risk assessment main model is trained using the standardized training data set to obtain the trained arsenic pollution risk assessment main model, and the core training subset, the strong adsorption training subset, and the weak adsorption training subset are used to train the corresponding arsenic pollution risk assessment sub-models, respectively, to obtain the core arsenic pollution risk assessment sub-model, the strong adsorption arsenic pollution risk assessment sub-model, and the weak adsorption arsenic pollution risk assessment sub-model for prediction of the core category, the strong adsorption category, and the weak adsorption category, respectively; The corresponding sub-prediction data weights are extracted according to the soil sample category, the final prediction results are calculated according to the main prediction data, sub-prediction data and sub-prediction data weights, and the soil samples are risk assessed according to the prediction results.

2. The soil arsenic contamination risk assessment method according to claim 1, characterized in that: The soil characteristic indicators include: soil pH, organic matter content, cation exchange capacity, clay content, free iron oxide content, and total arsenic and total phosphorus content.

3. The soil arsenic pollution risk assessment method according to claim 2, characterized in that: When using the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to predict soil samples based on multiple soil characteristic indicators, parameters related to the preset experimental environment are also input into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model to obtain the prediction results under the corresponding preset experimental environment.

4. The soil arsenic contamination risk assessment method according to claim 3, characterized in that: The soil sample categories include: a core category, a strong adsorption category, and a weak adsorption category.

5. The soil arsenic contamination risk assessment method according to claim 4, characterized in that: The preprocessing of all sample sequences in the initial training data set includes: Each of the sample sequences in the initial training data set is cleaned, interpolated, converted and standardized in turn.

6. The soil arsenic contamination risk assessment method according to claim 5, characterized in that: The standardized training data set is processed by using Pearson correlation analysis and PCA principal component analysis, and the sample sequences in the standardized training data set are divided into a core training subset, a strong adsorption training subset and a weak adsorption training subset according to the correlation between soil physical and chemical properties and adsorption capacity, including: The standardized training data set is processed by Pearson correlation analysis and PCA principal component analysis, so as to divide the sequence data in the standardized training data set into different groups according to the correlation between soil physical and chemical properties and adsorption capacity; Different groups were divided into core training subsets, strong adsorption training subsets and weak adsorption training subsets according to the correlation between the PCA principal component weights and the Pearson correlation coefficient of the adsorption amount.

7. A soil arsenic pollution risk assessment device based on machine learning, characterized in that: The device comprises: A soil sample acquisition module, used to acquire soil samples to be risk assessed and extract multiple soil characteristic indicators related to the soil samples; A soil sample classification module, used to classify the soil samples after analyzing the plurality of soil characteristic indicators using a principal component analysis method to obtain the soil sample category; The preliminary prediction module is used to input multiple soil characteristic indicators into the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model corresponding to the soil sample category for prediction, and obtain the corresponding main prediction data and sub-prediction data. The training of the arsenic pollution risk assessment main model and the arsenic pollution risk assessment sub-model includes: obtaining an initial training data set, the initial training data set includes multiple sample sequences, each of the sample sequences corresponds to soil characteristic indicators corresponding to different soil samples under different experimental environments, each of the sample sequences includes multiple soil characteristic indicators and experimental environment parameters, pre-processing all sample sequences in the initial training data set to obtain a standardized training data set, using Pearson correlation analysis and The standardized training data set is processed by PCA principal component analysis, and the sample sequences in the standardized training data set are divided into a core training subset, a strong adsorption training subset, and a weak adsorption training subset according to the correlation between soil physical and chemical properties and adsorption capacity, and the arsenic pollution risk assessment main model is trained using the standardized training data set to obtain the trained arsenic pollution risk assessment main model, and the core training subset, the strong adsorption training subset, and the weak adsorption training subset are used to train the corresponding arsenic pollution risk assessment sub-models, respectively, to obtain the core arsenic pollution risk assessment sub-model, the strong adsorption arsenic pollution risk assessment sub-model, and the weak adsorption arsenic pollution risk assessment sub-model for prediction of the core category, the strong adsorption category, and the weak adsorption category, respectively; The risk assessment module is used to extract the corresponding sub-prediction data weight according to the soil sample category, calculate the final prediction result according to the main prediction data, sub-prediction data and sub-prediction data weight, and perform risk assessment on the soil sample according to the prediction result.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.