Prediction method for effective-state cadmium and methane emission of soil under dry-wet alternation condition and related equipment
By constructing a soil environmental index prediction model and using machine learning technology to simultaneously predict the available cadmium content and methane emissions in soil under alternating wet and dry conditions, the problem of time-consuming and labor-intensive traditional monitoring methods is solved. This achieves efficient and accurate soil monitoring and prediction, reduces costs, and improves the practicality of the application.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG INST OF ECO ENVIRONMENT & SOIL SCI
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, traditional methods are time-consuming and labor-intensive in monitoring available cadmium and methane emissions from paddy field soils, making them difficult to apply on a large scale and unable to meet the needs of efficient monitoring and prediction.
A soil environmental index prediction model was constructed using machine learning. By inputting soil physicochemical property data, the model can simultaneously predict the available cadmium content and methane emissions in soil under alternating wet and dry conditions. The available cadmium prediction model and the methane emission prediction model were trained using a training dataset. Combined with five-fold cross-validation and feature importance analysis, the prediction accuracy and efficiency were improved.
It improves the prediction efficiency and accuracy of available cadmium and methane emissions from soil, reduces human and material costs, provides scientific guidance for targeted regulation of soil physicochemical properties, and enhances the practicality of large-scale applications.
Smart Images

Figure CN122045818A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of agricultural information technology, and in particular to a method and related equipment for predicting soil available cadmium and methane emissions under alternating wet and dry conditions. Background Technology
[0002] Currently, cadmium poses a serious threat to rice safety due to its high toxicity, high mobility, and tendency to accumulate in rice grains. Meanwhile, paddy fields, as important constructed wetland systems, contribute 6%–11% of global anthropogenic methane emissions annually. Therefore, it is necessary to monitor available cadmium and methane emissions from paddy field soils.
[0003] In related technologies, traditional methods such as the static box method are commonly used for monitoring and measurement. However, in practical applications, it has been found that traditional monitoring methods are time-consuming, labor-intensive, and difficult to apply on a large scale.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0005] This application provides a method and related equipment for predicting available cadmium and methane emissions in soil under alternating wet and dry conditions. It can simultaneously predict the available cadmium content and methane emissions in soil under alternating wet and dry conditions, effectively improving prediction efficiency and accuracy, reducing manpower and material costs, providing scientific guidance data for targeted regulation of soil physicochemical properties, and improving the practicality of large-scale applications.
[0006] On the one hand, embodiments of this application provide a method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, the method comprising the following steps:
[0007] Obtain soil physicochemical property data for the target area under alternating wet and dry conditions; The soil physicochemical property data are input into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
[0008] Optionally, the soil environmental index prediction model is trained through the following steps: A training dataset was constructed by reading multiple soil physicochemical property data samples from the soil database, as well as the available cadmium content and methane emission data for each soil physicochemical property data sample. Based on the available cadmium prediction scenario and the methane emission prediction scenario, all candidate machine learning models are trained using the training dataset, and the prediction accuracy of each candidate machine learning model is evaluated by five-fold cross-validation. The candidate machine learning model with the highest prediction accuracy in the scenario of predicting cadmium in the effective state was determined to be the cadmium in the effective state prediction model. The candidate machine learning model with the highest prediction accuracy in the methane emission prediction scenario was determined as the methane emission prediction model. By combining the available cadmium prediction model and the methane emission prediction model, the soil environmental indicator prediction model is constructed.
[0009] Optionally, the step of reading multiple soil physicochemical property data samples from a soil database, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, to construct a training dataset includes: Soil samples were obtained by measuring the soil's physicochemical properties, the available cadmium content, and methane emissions under alternating wet and dry conditions. A soil database was constructed by acquiring multiple sets of the aforementioned soil samples; Multiple soil physicochemical property data samples, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, were read from the soil database to form the basic dataset. The training dataset is constructed by using the Pearson correlation coefficient to filter variables in the base dataset.
[0010] Optionally, the soil physicochemical properties include pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, total iron, free iron, and total cadmium.
[0011] Optionally, after reading multiple soil physicochemical property data samples from the soil database, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, as the base dataset, the method further includes: The soil physicochemical property data samples in the aforementioned basic dataset are normalized. Based on the standard box plot of soil heavy metal environmental quality, outliers in the basic dataset are detected and removed.
[0012] Optionally, after constructing the soil environmental indicator prediction model by combining the available cadmium prediction model and the methane emission prediction model, the method further includes: The SHAP analysis was performed on the available cadmium prediction model and the methane emission prediction model based on the feature importance analysis of the SHAP value to quantify the contribution of the input features in the soil physicochemical property data to the prediction results of soil environmental indicators. The feature importance analysis based on SHAP values includes feature importance graph analysis, feature density scatter plot analysis, and partial dependency graph analysis.
[0013] On the other hand, embodiments of this application provide a device for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, the device comprising: The data acquisition module is used to acquire soil physicochemical property data of the target area to be predicted under alternating wet and dry conditions; The model prediction module is used to input the soil physicochemical property data into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
[0014] On the other hand, embodiments of this application provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0016] On the other hand, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0017] This application embodiment inputs soil physicochemical property data into a soil environmental index prediction model to simultaneously predict the available cadmium content and methane emissions in the soil under alternating wet and dry conditions. This can effectively improve prediction efficiency and accuracy, reduce manpower and material costs, provide scientific guidance data for targeted regulation of soil physicochemical properties, and improve the practicality of large-scale applications. Attached Figure Description
[0018] Figure 1This is a schematic diagram illustrating the implementation environment of a method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, as provided in an embodiment of this application. Figure 2 This is a flowchart illustrating a method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, as provided in an embodiment of this application. Figure 3 This is a fitting diagram illustrating the performance evaluation of a soil environmental index prediction model provided in an embodiment of this application; Figure 4 This is a schematic diagram illustrating a Pearson correlation coefficient variable selection method provided in an embodiment of this application; Figure 5 This is a schematic diagram of a feature importance map provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a predictor of available cadmium and methane emissions from soil under alternating wet and dry conditions, provided in an embodiment of this application. Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0020] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0021] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0023] Currently, cadmium poses a serious threat to rice safety due to its high toxicity, high mobility, and tendency to accumulate in rice grains. Meanwhile, paddy fields, as important constructed wetland systems, contribute 6%–11% of global anthropogenic methane emissions annually. Therefore, it is necessary to monitor available cadmium and methane emissions from paddy field soils.
[0024] In related technologies, traditional methods such as the static box method are commonly used for monitoring and measurement. However, in practical applications, it has been found that traditional monitoring methods are time-consuming, labor-intensive, and difficult to apply on a large scale.
[0025] In view of this, this application provides a method and related equipment for predicting available cadmium and methane emissions in soil under alternating wet and dry conditions. By inputting soil physicochemical property data into a soil environmental index prediction model, the method can simultaneously predict the available cadmium content and methane emissions in soil under alternating wet and dry conditions. This can effectively improve prediction efficiency and accuracy, reduce manpower and material costs, provide scientific guidance data for targeted regulation of soil physicochemical properties, and improve the practicality of large-scale applications.
[0026] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0027] The specific implementation methods of the embodiments of this application will be described in detail below with reference to the accompanying drawings. First, a method for predicting available cadmium and methane emissions from soil under alternating wet and dry conditions, provided in the embodiments of this application, will be described with reference to the accompanying drawings.
[0028] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, as provided in this application embodiment. In this implementation environment, the main hardware and software components involved include a terminal processor 110 and a server 120.
[0029] Specifically, the terminal processor 110 may be equipped with a control program for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, and the server 120 serves as the backend server for this control program. The terminal processor 110 and the backend server 120 are connected in communication. The method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions provided in this embodiment can be executed on the terminal processor 110 side.
[0030] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0031] In addition, server 120 can also be a node server in a blockchain network.
[0032] The terminal processor 110 and the server 120 can establish a communication connection via a wireless network. This wireless network uses standard communication technologies and / or protocols. The network can be the Internet or any other network, including but not limited to a Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, or any combination of wireless networks, private networks, or virtual private networks. Furthermore, these hardware and software components can use the same or different communication connection methods; this application does not impose specific limitations in this regard.
[0033] Of course, this is understandable. Figure 1 The implementation environments described in this application are merely some optional application scenarios for the method of predicting soil available cadmium and methane emissions under alternating wet and dry conditions provided in this embodiment. Actual applications are not fixed. Figure 1 The software and hardware environment shown is not specifically limited in this application.
[0034] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for predicting available cadmium and methane emissions from soil under alternating wet and dry conditions, as provided in this application embodiment, including but not limited to steps 100 to 200.
[0035] Step 100: Obtain soil physicochemical property data of the target area to be predicted under alternating wet and dry conditions.
[0036] In this embodiment of the application, the target area to be predicted can be a geographical area where it is necessary to predict the available cadmium content and methane emissions in the soil. The alternating wet and dry conditions refer to the soil being under alternating flooding and drainage conditions (abbreviated as alternating wet and dry conditions).
[0037] Furthermore, by installing various sensors in the soil, data on the physicochemical properties of the soil can be acquired periodically and used as input data for subsequent soil environmental indicator prediction models.
[0038] In practical applications, soil physicochemical property data may include pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, total iron, free iron, and total cadmium.
[0039] Step 200: Input the soil physicochemical property data into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
[0040] In this embodiment of the application, soil physicochemical property data is input into a pre-trained soil environmental index prediction model. The soil environmental index prediction model performs feature analysis on the input soil physicochemical property data, calculates and outputs the final soil environmental index prediction results.
[0041] The soil environmental index prediction model mainly includes an available cadmium prediction model and a methane emission prediction model. The soil environmental index prediction results include the available cadmium content prediction results and the methane emission prediction results. That is, after the soil physicochemical property data is input into the soil environmental index prediction model, the available cadmium content in the soil is calculated by using the available cadmium prediction model based on the input soil physicochemical property data, and the methane emission in the soil is calculated by using the methane emission prediction model based on the input soil physicochemical property data. Finally, the soil environmental index prediction results are obtained and output.
[0042] In practical applications, the available cadmium prediction model and the methane emission prediction model can be pre-trained using the same training dataset. The training dataset contains at least one soil physicochemical property data sample, and the soil environmental index results corresponding to each soil physicochemical property data sample are used as sample labels. This allows for the simultaneous prediction of available cadmium content and methane emissions in soil under alternating wet and dry conditions. It is simple, fast, and inexpensive, and researchers without a computational chemistry background can also use it easily, thus improving its applicability.
[0043] Therefore, by inputting soil physicochemical property data into the soil environmental index prediction model, it is possible to simultaneously predict the available cadmium content and methane emissions in the soil under alternating wet and dry conditions. This can effectively improve prediction efficiency and accuracy, reduce human and material costs, provide scientific guidance data for targeted regulation of soil physicochemical properties, and enhance the practicality of large-scale applications.
[0044] Specifically, as an optional implementation, the soil environmental index prediction model is trained through the following steps: A training dataset was constructed by reading multiple soil physicochemical property data samples from the soil database, as well as the available cadmium content and methane emission data for each soil physicochemical property data sample. Based on the available cadmium prediction scenario and the methane emission prediction scenario, all candidate machine learning models are trained using the training dataset, and the prediction accuracy of each candidate machine learning model is evaluated by five-fold cross-validation. The candidate machine learning model with the highest prediction accuracy in the scenario of predicting cadmium in the effective state was determined to be the cadmium in the effective state prediction model. The candidate machine learning model with the highest prediction accuracy in the methane emission prediction scenario was determined as the methane emission prediction model. By combining the available cadmium prediction model and the methane emission prediction model, the soil environmental indicator prediction model is constructed.
[0045] In this embodiment of the application, a training dataset is constructed by reading multiple soil physicochemical property data samples and the available cadmium content and methane emission data of each soil physicochemical property data sample from a pre-constructed soil database.
[0046] Furthermore, for the tasks of predicting the available cadmium content in the available cadmium prediction scenario and predicting the methane emissions in the methane emission prediction scenario, respectively, all candidate machine learning models were trained using the training dataset, and the prediction accuracy of each candidate machine learning model was evaluated by five-fold cross-validation.
[0047] The candidate machine learning models can include random forest models, K-nearest neighbor regression models, extreme gradient boosting models, and gradient boosting decision tree models. The five-fold cross-validation specifically involves dividing the training dataset into five parts, selecting four parts to train each candidate machine learning model, and using the last part to evaluate the prediction accuracy of each candidate machine learning model. The above training and evaluation steps are repeated five times, thereby combining the prediction results of each candidate machine learning model each time for a comprehensive score.
[0048] In practical applications, the constructed dataset can also be randomly divided into training dataset and validation dataset according to a preset ratio. For example, 80% of the dataset can be used as the training dataset for model training, and 20% of the dataset can be used as the validation dataset for model validation.
[0049] Furthermore, the validation dataset can be validated by using each trained candidate machine learning model, comparing the predicted values of the machine learning models with the actual values, and the coefficient of determination R can be used. 2 The root mean square error (RMSE) is used as a reference indicator to evaluate model stability and external predictive ability.
[0050] For example, please refer to Table 1 below. Table 1 is a comparison table of evaluation metrics for each candidate machine learning model under different prediction scenarios. The candidate machine learning model with the highest prediction accuracy in the effective cadmium prediction scenario is determined as the effective cadmium prediction model, and the candidate machine learning model with the highest prediction accuracy in the methane emission prediction scenario is determined as the methane emission prediction model.
[0051] Table 1. Comparison of evaluation metrics for each candidate machine learning model under different prediction scenarios.
[0052] For example, as shown in Table 1, the candidate machine learning model with the highest prediction accuracy in the scenario of predicting effective cadmium is the Limiting Gradient Boosting Tree model, with a determination coefficient of 0.83 on both the training and validation datasets, and a root mean square error of 0.02 on both datasets. Furthermore, the candidate machine learning model with the highest prediction accuracy in the scenario of predicting methane emissions is the Random Forest model, with determination coefficients of 0.84 and 0.82 on the training and validation datasets, respectively, and root mean square errors of 0.58 and 0.59 on the training and validation datasets, respectively.
[0053] Furthermore, we can construct training datasets and validation datasets using the candidate machine learning models with the highest prediction accuracy in the identified effective cadmium prediction scenario and methane emission prediction scenario. For details, please refer to... Figure 3, Figure 3 This is a fitting diagram illustrating the performance evaluation of a soil environmental index prediction model provided in an embodiment of this application. Figure 3 The figure shows the comparison between the predicted and actual values of the effective cadmium prediction model and the methane emission prediction model.
[0054] Specifically, such as Figure 3 As shown, in the fitting effect of the effective cadmium prediction model, the data points circled in blue are used as data samples in the training dataset, and the data points triangled in red are used as data samples in the validation dataset, and are marked with... The diagonal axis represents the actual value of available cadmium content, and the vertical axis represents the predicted value of available cadmium content output by the available cadmium prediction model, in mg / kg. The closer the data points are to the diagonal, the closer the predicted value is to the actual value. Furthermore, in the fitting effect of the methane emission prediction model, blue circle data points are used as data points in the training dataset, and red triangle data points are used as data points in the validation dataset, clearly marked... The diagonal axis represents the actual methane emissions on the horizontal axis and the predicted methane emissions from the methane emission prediction model on the vertical axis, with units of mmol / L.
[0055] Therefore, by combining Table 1 and Figure 3 It can quickly determine the prediction performance of the available cadmium prediction model and the methane emission prediction model in the soil environmental indicator prediction model for the available cadmium prediction scenario and the methane emission prediction scenario, respectively.
[0056] In practical applications, the training dataset is constructed by reading multiple soil physicochemical property data samples from a soil database, along with the available cadmium content and methane emission data for each sample. The dataset includes: Soil samples were obtained by measuring the soil's physicochemical properties, the available cadmium content, and methane emissions under alternating wet and dry conditions. A soil database was constructed by acquiring multiple sets of the aforementioned soil samples; Multiple soil physicochemical property data samples, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, were read from the soil database to form the basic dataset. The training dataset is constructed by using the Pearson correlation coefficient to filter variables in the base dataset.
[0057] In the embodiments of this application, soil physicochemical properties can be measured, and data simulating soil under alternating wet and dry conditions can be obtained. Specifically, the soil pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, total iron, free iron, and total cadmium can be measured, as well as the methane emissions at the end of anaerobic conditions and the content of available cadmium at the end of anaerobic and aerobic conditions can be measured, thereby serving as a soil sample.
[0058] Furthermore, a soil database was constructed by measuring multiple groups of soil samples under different soil types and environmental conditions.
[0059] Furthermore, multiple soil physicochemical property data samples, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, were read from the completed soil database to form the basic dataset.
[0060] In practical applications, after obtaining the basic dataset, the obtained soil physicochemical property data samples can be normalized according to the preset transformation principle, so that each soil physicochemical property data variable has the same unit.
[0061] Furthermore, outliers in the basic dataset can be removed based on soil heavy metal environmental quality standards and box plots, thereby completing the data preprocessing of the basic dataset.
[0062] Furthermore, the correlation between input variables can be analyzed using the Pearson correlation coefficient, and input variables with obvious correlations can be filtered out to eliminate the interference of multicollinearity on the model, thereby improving the robustness and prediction accuracy of subsequent model training.
[0063] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram of a Pearson correlation coefficient variable screening method provided in an embodiment of this application. This application obtains various types of input variables, including pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, total iron, free iron and total cadmium, from the soil database as soil physicochemical property data, and reads the corresponding available cadmium content and methane emission data as the basic dataset.
[0064] Furthermore, the correlation between the various input variables is determined using the Pearson correlation coefficient, specifically as follows: Figure 2As shown, when the correlation between variables is greater than the preset threshold, it indicates that the variables are highly correlated and there is information redundancy, which needs to be filtered out. For example, if there is a high correlation between crystalline iron and the variables total iron and free iron, then the variables total iron and free iron can be filtered out. Based on the filtered pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals and total cadmium, a training dataset can be constructed. It can also be divided into a training dataset and a validation dataset according to a preset ratio.
[0065] Of course, it is understood that the soil physicochemical property input variable types in the above embodiments are only some optional application scenarios in the prediction method of soil available cadmium and methane emissions under alternating dry and wet conditions provided in the embodiments of this application. The actual application is not fixed to the above embodiments, and this application does not impose specific restrictions on it.
[0066] Therefore, by selecting suitable input variables based on the Pearson correlation coefficient, the interference of multicollinearity on the model can be effectively eliminated, thereby improving the robustness of subsequent model training and prediction accuracy.
[0067] Specifically, as an optional implementation, after constructing the soil environmental indicator prediction model by combining the available cadmium prediction model and the methane emission prediction model, the method further includes: The SHAP analysis was performed on the available cadmium prediction model and the methane emission prediction model based on the feature importance analysis of the SHAP value to quantify the contribution of the input features in the soil physicochemical property data to the prediction results of soil environmental indicators. The feature importance analysis based on SHAP values includes feature importance graph analysis, feature density scatter plot analysis, and partial dependency graph analysis.
[0068] In the embodiments of this application, after constructing a soil environmental index prediction model by integrating the available cadmium prediction model and the methane emission prediction model, feature importance analysis based on SHAP (SHapley Additive exPlanations) values can be used to quantify different input features in the soil physicochemical property data input into the soil environmental index prediction model, and determine the contribution of different input features to the soil environmental index prediction results.
[0069] Among them, the feature importance analysis based on SHAP values includes feature importance graph analysis, feature density scatter plot analysis, and partial dependency graph analysis.
[0070] For example, please refer to Figure 5 , Figure 5 This is a schematic diagram of a feature importance map provided in an embodiment of this application. Figure 5The diagram illustrates the importance of pH, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, and total cadmium in the available cadmium prediction model and the methane emission prediction model, respectively. The vertical axis represents different types of input feature variables, and the horizontal axis represents the average value of the calculated SHAP values. Each input feature variable corresponds to a horizontal bar, and the bar length indicates the average contribution of that feature to the model prediction results. The longer the bar, the more important the feature. The contribution of each input feature to the soil environmental index prediction results is quantified as a percentage by embedding a pie chart, visually displaying the contribution of each input feature variable.
[0071] In practical applications, scatter plot analysis and partial dependency plot analysis can also be used to perform SHAP analysis on the available cadmium prediction model and the methane emission prediction model. Through feature analysis, the effects of each input feature in the physicochemical properties on the available cadmium content and methane emissions under alternating wet and dry conditions can be analyzed. For example, ... Figure 5 As shown, total cadmium, pH value, and crystalline iron are the most important factors affecting the available cadmium content in soil under alternating wet and dry conditions, while total organic carbon, total cadmium, and pH value are the most important factors affecting soil methane emissions under alternating wet and dry conditions. Therefore, by analyzing key physicochemical factors, we can guide targeted regulation of soil physicochemical properties to reduce the available cadmium content during rice cultivation and simultaneously reduce greenhouse gas emissions.
[0072] Please see Figure 6 , Figure 6 This is a schematic diagram of a device for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, provided in an embodiment of this application. This application also provides a device for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, which can realize the above-mentioned method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions. The device includes: The data acquisition module 610 is used to acquire soil physicochemical property data of the target area to be predicted under alternating wet and dry conditions; The model prediction module 620 is used to input the soil physicochemical property data into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
[0073] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0074] Please see Figure 7 , Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes: The processor 701 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 702 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 702 and is called and executed by the processor 701 using the methods described in the embodiments of this application. The input / output interface 703 is used to implement information input and output; The communication interface 704 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 705 transmits information between various components of the device (e.g., processor 701, memory 702, input / output interface 703, and communication interface 704); The processor 701, memory 702, input / output interface 703, and communication interface 704 are connected to each other within the device via bus 705.
[0075] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0076] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0077] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0078] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0079] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0080] This application provides a method and related equipment for predicting available cadmium and methane emissions in soil under alternating wet and dry conditions. By inputting soil physicochemical property data into a soil environmental index prediction model, it can simultaneously predict the available cadmium content and methane emissions in soil under alternating wet and dry conditions. This can effectively improve prediction efficiency and accuracy, reduce manpower and material costs, provide scientific guidance data for targeted regulation of soil physicochemical properties, and improve the practicality of large-scale applications.
[0081] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0082] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0084] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0085] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0086] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0087] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0088] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0089] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0090] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0091] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, characterized in that, The method includes the following steps: Obtain soil physicochemical property data for the target area under alternating wet and dry conditions; The soil physicochemical property data are input into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
2. The method according to claim 1, characterized in that, The soil environmental index prediction model was trained through the following steps: A training dataset was constructed by reading multiple soil physicochemical property data samples from the soil database, as well as the available cadmium content and methane emission data for each soil physicochemical property data sample. Based on the available cadmium prediction scenario and the methane emission prediction scenario, all candidate machine learning models are trained using the training dataset, and the prediction accuracy of each candidate machine learning model is evaluated by five-fold cross-validation. The candidate machine learning model with the highest prediction accuracy in the scenario of predicting cadmium in the effective state was determined to be the cadmium in the effective state prediction model. The candidate machine learning model with the highest prediction accuracy in the methane emission prediction scenario was determined as the methane emission prediction model. By combining the available cadmium prediction model and the methane emission prediction model, the soil environmental indicator prediction model is constructed.
3. The method according to claim 2, characterized in that, The training dataset is constructed by reading multiple soil physicochemical property data samples from the soil database, along with the available cadmium content and methane emission data for each sample. The dataset includes: Soil samples were obtained by measuring the soil's physicochemical properties, the available cadmium content, and methane emissions under alternating wet and dry conditions. A soil database was constructed by acquiring multiple sets of the aforementioned soil samples; Multiple soil physicochemical property data samples, along with the available cadmium content and methane emission data for each soil physicochemical property data sample, were read from the soil database to form the basic dataset. The training dataset is constructed by using the Pearson correlation coefficient to filter variables in the base dataset.
4. The method according to claim 3, characterized in that, The soil physicochemical properties include pH value, cation exchange capacity, total organic carbon, amorphous iron, crystalline iron, clay-bound iron minerals, total iron, free iron, and total cadmium.
5. The method according to claim 3, characterized in that, After reading multiple soil physicochemical property data samples from the soil database, along with the available cadmium content and methane emission data for each sample, as the base dataset, the following is also included: The soil physicochemical property data samples in the aforementioned basic dataset are normalized. Based on the standard box plot of soil heavy metal environmental quality, outliers in the basic dataset are detected and removed.
6. The method according to claim 2, characterized in that, After constructing the soil environmental indicator prediction model by combining the available cadmium prediction model and the methane emission prediction model, the method further includes: The SHAP analysis was performed on the available cadmium prediction model and the methane emission prediction model based on the feature importance analysis of the SHAP value to quantify the contribution of the input features in the soil physicochemical property data to the prediction results of soil environmental indicators. The feature importance analysis based on SHAP values includes feature importance graph analysis, feature density scatter plot analysis, and partial dependency graph analysis.
7. A device for predicting soil available cadmium and methane emissions under alternating wet and dry conditions, characterized in that, The device includes: The data acquisition module is used to acquire soil physicochemical property data of the target area to be predicted under alternating wet and dry conditions; The model prediction module is used to input the soil physicochemical property data into the soil environmental index prediction model to obtain the soil environmental index prediction results output by the soil environmental index prediction model. The soil environmental indicator prediction model is constructed based on the available cadmium prediction model and the methane emission prediction model. The available cadmium prediction model and the methane emission prediction model are trained using a training dataset, which includes at least one soil physicochemical property data sample and the soil environmental indicator results corresponding to each soil physicochemical property data sample as sample labels. The soil environmental indicator prediction results include the available cadmium content prediction results and the methane emission prediction results.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.