Soil nutrient content prediction method and system
Through the soil nutrient prediction model combined with a random forest algorithm and a depth distribution function, the problems of data quality and sample size limitation in deep soil nutrient prediction are solved, and the rapid and accurate evaluation of deep soil nutrients are achieved.
Patent Information
- Application Number
- CN202510535719.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
AI Technical Summary
The existing technology has low data quality and sample size limitations in deep soil nutrient prediction, which leads to low applicability and accuracy of the model, making it difficult to quickly and accurately obtain deep soil nutrient information.
The soil nutrient content prediction model was trained by the combined random forest algorithm and the depth distribution function. By obtaining the soil sample data to be tested, the initial model was constructed and cross-verified, the optimal depth distribution function and random forest algorithm were screened for training, and the soil nutrient content prediction model was finally established.
It improves the effectiveness and accuracy of deep soil nutrient prediction, and can easily and quickly evaluate the changing characteristics of target nutrients in soil samples, filling the gaps in the prior art.
Smart Images

Figure CN120409251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil nutrient cycling, and in particular, to a method and system for predicting soil nutrient content. Background Art
[0002] The nutrient content of deep soil is crucial for the growth of forests, ecological balance, and biodiversity conservation. Most conventional soil nutrient analysis methods rely on on-site sampling and laboratory analysis, which are cumbersome and costly, and it is difficult to quickly and accurately obtain the nutrient information of deep soil. At the same time, due to the nutrient dynamics of deep soil being affected by various factors, such as soil type, vegetation cover, climate conditions, etc., it makes the real-time monitoring and prediction of its nutrient status complicated.
[0003] With the development of remote sensing technology, artificial intelligence, and data analysis technology, technicians usually construct a soil nutrient prediction model based on machine learning according to geographic information systems and environmental data to predict soil nutrient content and optimize forest management and ecological monitoring. However, in the aspect of deep soil nutrient prediction, due to the limitations of data quality and sample size, the applicability and accuracy of most models are relatively low.
[0004] Based on this, there is an urgent need for a solution for determining the nutrient content of deep soil in forest ecosystems that can overcome the above technical problems. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method and system for predicting soil nutrient content, which can overcome the problems of low data quality and sample size limitations in the existing technology for deep soil nutrient prediction, improve the effectiveness and accuracy of deep soil nutrient prediction, and fill the gap in the existing technology.
[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of the present invention are as follows:
[0007] In a first aspect, the present application provides a method for predicting soil nutrient content, and the method includes:
[0008] Obtain data of the soil sample to be measured;
[0009] Input the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training the combined random forest algorithm and the depth distribution function;
[0010] Based on the prediction parameters of the target nutrient, obtain the prediction result of the target nutrient in the data of the soil sample to be measured to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
[0011] Optionally, before the step of inputting the soil sample data to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured, the following steps are further included:
[0012] Construct an initial soil nutrient content prediction model based on the depth distribution function;
[0013] Train the initial soil nutrient content prediction model according to the random forest algorithm to obtain the final soil nutrient content prediction model.
[0014] Optionally, the step of constructing an initial soil nutrient content prediction model based on the depth distribution function includes:
[0015] Obtain training parameters, and preprocess the training parameters to obtain a data set;
[0016] Construct multiple initial depth distribution functions;
[0017] Adopt the cross-validation method to screen the initial depth distribution function corresponding to the lowest target value from multiple initial depth distribution functions based on the data set as the initial soil nutrient content prediction model.
[0018] Optionally, the target value includes the mean root mean square error value, and the step of obtaining the initial soil nutrient content prediction model includes:
[0019] Divide the data set into multiple mutually exclusive subsets;
[0020] For any initial depth distribution function, based on the mutually exclusive subsets, perform multiple cross-validations to obtain the cross-validation results corresponding to the current initial depth distribution function;
[0021] Obtain the mean root mean square error corresponding to the current initial depth distribution function based on the cross-validation results;
[0022] Take the initial depth distribution function corresponding to the minimum mean root mean square error value as the final depth distribution function to obtain the initial soil nutrient content prediction model.
[0023] Optionally, the step of training the initial soil nutrient content prediction model according to the random forest algorithm to obtain the final soil nutrient content prediction model includes:
[0024] Determine the non-linear equation related to the target nutrient in the data set based on the random forest algorithm;
[0025] Adjust the initial soil nutrient content prediction model based on the non-linear equation to obtain the final soil nutrient content prediction model.
[0026] Optionally, taking the soil available nitrogen content as the target nutrient, the expression of the soil nutrient content prediction model is:
[0027] C x = C e + (C o - C e ) × exp(-kx);
[0028] Among them, C e = 0.16 × C0 +0.81; k = 1.27 × k0+0.01;
[0029] Where C x is the soil available nitrogen content at depth x in the soil profile; C0 is the available nitrogen content in the surface soil; C e is the content of soil available nitrogen that tends to stabilize with increasing soil profile depth; exp(.) is an exponential function; k0 is the rate of change of soil available nitrogen content at a preset soil thickness; and k is the rate of change of soil available nitrogen in the soil profile.
[0030] Optionally, the steps of obtaining training parameters and preprocessing the training parameters to obtain a data set include:
[0031] Screening the training parameters, filtering out soil attribute data that does not meet the preset attribute parameter values in the training parameters, and obtaining initial training parameters;
[0032] Determine the missing data indicators in the initial training parameters based on the generalized boosted regression model and the initial training parameters to obtain a data set;
[0033] Among them, the missing data indicators include bulk density and gravel content data.
[0034] Optionally, the step of determining missing data indicators in the initial training parameters based on the generalized boosted regression model and the initial training parameters includes:
[0035] Construct a generalized boosted regression model and determine the nonlinear relationship between various data indicators under the initial training parameters based on the generalized boosted regression model;
[0036] The nonlinear relationship is used to determine the data values corresponding to the initial training parameters to determine the data indicators missing in the initial training parameters.
[0037] Optionally, the calculation formula for determining the missing data indicators in the initial training parameters is expressed as:
[0038] ;
[0039] in, Target amount The predicted value; F0 is the mean of the target quantity; The m-th data metric prediction function corresponding to the current target quantity in the training parameters ; The weight coefficient of the m-th data metric related to the current target quantity in the training parameters ; M is the total number of data metrics related to the current target quantity in the training parameters .
[0040] In a second aspect, the present invention also provides a soil nutrient content prediction system, including:
[0041] A data acquisition module for acquiring data of the soil sample to be measured;
[0042] A prediction model construction module for inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training in combination with the random forest algorithm and the depth distribution function;
[0043] A prediction evaluation module for obtaining the prediction result of the target nutrient in the data of the soil sample to be measured based on the prediction parameters of the target nutrient, so as to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
[0044] The soil nutrient content prediction method and system provided by the present invention have the following beneficial effects:
[0045] In the soil nutrient content prediction method of the present invention, by acquiring the data of the soil sample to be measured, and then inputting the data of the soil sample to be measured into the soil nutrient content prediction model, the prediction parameters of the target nutrient in the soil sample to be measured are obtained; wherein, the soil nutrient content prediction model is a model obtained by training in combination with the random forest algorithm and the depth distribution function. Finally, based on the prediction parameters of the target nutrient, the prediction result of the target nutrient in the data of the soil sample to be measured is obtained, so as to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured. Based on this, the present invention can overcome the problems of low data quality and sample size limitation in the prediction of deep soil nutrients in the prior art, improve the effectiveness and accuracy of the prediction of deep soil nutrients, and fill the gap in the prior art.
[0046] To make the above objects, features and advantages of the present invention more obvious and understandable, the following specific embodiments are given, and detailed descriptions are made in conjunction with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0048] Figure 1 Fig. 1 shows one of the step flowcharts of the soil nutrient content prediction method provided by the embodiment of the present invention;
[0049] Figure 2 Fig. 2 shows another step flowchart of the soil nutrient content prediction method provided by the embodiment of the present invention;
[0050] Figure 3 Fig. 3 shows the sub-step flowchart of step 200 in the embodiment of the present invention;
[0051] Figure 4 Fig. 4 shows the sub-step flowchart of step 201 in the embodiment of the present invention;
[0052] Figure 5 Fig. 5 shows the sub-step flowchart of step 203 in the embodiment of the present invention;
[0053] Figure 6 Fig. 6 shows the relationship diagram of each initial depth distribution function simulating the vertical distribution of available nitrogen in the soil profile in this embodiment;
[0054] Figure 7 Fig. 7 shows the sub-step flowchart of step 300 in the embodiment of the present invention;
[0055] Figure 8 Fig. 8 shows the analysis result of the training parameters in this embodiment;
[0056] Figure 9 Fig. 9 shows the comparison diagram between the predicted result and the measured result of the soil available nitrogen content in this embodiment;
[0057] Figure 10 Fig. 10 shows the structural schematic diagram of the soil nutrient content prediction system in this embodiment;
[0058] Figure 11 Fig. 11 shows the block diagram of the server in the embodiment of the present invention.
[0059] Icons: 10 - Soil nutrient content prediction system; 11 - Data acquisition module; 12 - Prediction model construction module; 13 - Prediction evaluation module; 20 - Server. Detailed implementation manners
[0060] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Usually, the components of the embodiments of the present invention described and shown in the accompanying drawings here can be arranged and designed in various different configurations.
[0061] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0062] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0063] As described in the background art, many researchers have begun to explore soil nutrient prediction models based on machine learning, geographic information system (GIS) and environmental data. These methods can collect and analyze a large amount of environmental data, establish models to predict soil nutrient content, and optimize forest management and ecological monitoring. However, there are still some deficiencies in the prior art. For example, the applicability and accuracy of the models are limited by data quality and sample size, especially in the prediction of deep soil nutrients, and there is a lack of effective and comprehensive prediction methods.
[0064] Based on this, the present application provides a method and system for predicting soil nutrient content to overcome the above technical problems.
[0065] The above technical solutions will be introduced in detail below.
[0066] Please refer to Figure 1 , Figure 1 which shows a flowchart of the steps of a method for predicting soil nutrient content, and the method includes step 100, step 400 and step 500.
[0067] Step 100: Obtain the data of the soil sample to be measured.
[0068] Step 400: Input the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured.
[0069] Among them, the soil nutrient content prediction model is a model obtained by training the combined random forest algorithm and the depth distribution function.
[0070] Step 500: Based on the prediction parameters of the target nutrient, obtain the prediction result of the target nutrient in the data of the soil sample to be measured, so as to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
[0071] In this embodiment, a soil nutrient content prediction model is obtained based on the random forest algorithm and the depth distribution function. This model can obtain the prediction parameters of the target nutrient from the data of the soil sample to be measured, and then obtain the prediction result of the target nutrient in the data of the soil sample to be measured based on the prediction parameters of the target nutrient. Based on the above prediction result of the target nutrient, the change characteristics of the target nutrient in the current data of the soil sample to be measured are evaluated. Based on this, the present invention can solve the defects of few training / verification data and single method in the existing empirical model, and can simply, quickly and accurately predict the nutrient content of the deep soil in the forest ecosystem.
[0072] Please, on the basis of Figure 1 , refer to Figure 2 , Figure 2 which shows another step flowchart of the soil nutrient content prediction method in this embodiment. Before step 400 of inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured, the method further includes step 200 and step 300.
[0073] Step 200: Construct an initial soil nutrient content prediction model based on the depth distribution function;
[0074] Step 300: Train the initial soil nutrient content prediction model according to the random forest algorithm to obtain the final soil nutrient content prediction model.
[0075] Please, on the basis of Figure 2 , refer to Figure 3 , Figure 3 which shows the sub-step flowchart of step 200 in this embodiment. This step 200 includes steps 201 to 203.
[0076] Step 201: Obtain training parameters and preprocess the training parameters to obtain a data set.
[0077] Step 202: Construct multiple initial depth distribution functions.
[0078] Step 203: Using the cross-validation method, screen the initial depth distribution function corresponding to the lowest target value from multiple initial depth distribution functions based on the data set, and use it as the initial soil nutrient content prediction model.
[0079] In this embodiment, the training parameters may include a large number of soil attribute data such as soil nutrient data and soil physics and chemistry. The data sources may include the soil profile information database developed by the World Soil Information Service (WoSIS), WorldClim version 2 grid data, in-situ measured data of forest ecosystems, and data obtained from published literature, including at least the measured soil profile nutrient content data of 237 forest ecosystem sites in different regions of the world.
[0080] To further improve the accuracy of the prediction model, the above training data can be processed to improve the richness of the data. In a possible implementation, please Figure 3 Based on this, referring to Figure 4 , Figure 4 Figure 2011 shows the sub-step flowchart of step 201 in this embodiment, and this step 201 includes steps 2011 to 2012.
[0081] Step 2011: Screen the training parameters, filter out the soil attribute data that does not meet the preset attribute parameter values in the training parameters, and obtain the initial training parameters.
[0082] Step 2012: Based on the generalized boosted regression model and the initial training parameters, determine the missing data indicators in the initial training parameters to obtain a data set.
[0083] Among them, the missing data indicators include bulk density and gravel content data.
[0084] In this embodiment, data quality inspection can be further performed on the above training data, excluding soil profiles with obvious error information (such as negative soil depth, the depth value of the lower boundary of the soil layer is less than the upper boundary depth value, and negative soil nutrient content, etc.), and deleting the data with missing soil nutrient content data. Finally, 237 soil profiles are obtained.
[0085] Furthermore, in order to take advantage of all the observed data, soil property data including soil texture, chemical property data, and some hydraulic parameters are used to construct a Generalized Boosted Regression Modelling (GBM) to fill in the missing bulk density and gravel content data. In this embodiment, the Generalized Boosted Regression Model, as a machine learning model based on multivariate nonparametric estimation, can adaptively estimate the nonlinear relationship between a large number of confounding variables and the target variable, and has high and flexible computational efficiency, and can effectively predict the missing soil bulk density and gravel content data.
[0086] In this embodiment, the calculation formula for the missing data index in the initial training parameters is expressed as:
[0087] ;
[0088] Wherein, is the soil property data, and the soil property data is expressed as: X = [X1, X2,…, X P , where X1, X2,…, X P can be properties such as clay content, pH value, saturated hydraulic conductivity, etc.; is the predicted value of the target quantity. For example, the predicted value of soil nutrient content; F0 is the mean value of the target quantity. For example, the mean value of soil nutrient content; is the prediction function corresponding to the m-th data index related to the current target quantity in the training parameters, or is characterized as the prediction function of the m-th decision tree in the model; is the weight coefficient of the m-th data index related to the current target quantity in the training parameters, or is characterized as the weight coefficient of the m-th decision tree in the model; M is the total number of data indexes related to the current target quantity in the training parameters.
[0089] It should be noted that the target quantity in the above calculation formula is characterized as a variable value that can be determined according to the nonlinear relationship between the confounding attribute parameters. For example, the above-mentioned bulk density and / or gravel content data. This embodiment includes but is not limited to the above two target quantities. As long as the target variable can be determined or deduced based on any one or more soil property data, it can be included in this embodiment.
[0090] In this embodiment, the initial depth distribution function in step 202 may include: [[ID=3O]]
[0091] The negative exponential function (NEF function) is expressed as: C x = C e + (C o - C e ) × exp(-kx).
[0092] The exponential decay function (EDF function) is expressed as: C x = C o × exp(-kx).
[0093] The power function (PF function) is expressed as: C x = a × x -k .
[0094] The logarithmic function (LF function) is expressed as: C x = a × ln(x) + b.
[0095] The Type III exponential function (or TEF function) is expressed as: C x = a × exp(k × x -1 ).
[0096] The inverse function (or FIPF function) of a univariate polynomial is expressed as: C x = x / (a + kx).
[0097] The modified exponential function (or REF function) is represented by C x = C o × exp(-(1 / kx + a + b)x).
[0098] Where C x is the soil available nitrogen content at depth x in the soil profile (g kg -1 );C o is the available nitrogen content of the surface soil (g kg -1 ); The surface depth of the negative exponential and exponential decay functions is set to 0 cm, and the other functions are set to the midpoint of the surface soil sampling depth. C e is the content of available nitrogen in soil that tends to be stable with increasing depth (g kg -1 ), k is the change rate of soil available nitrogen in the soil profile (cm -1 ), a and b are constants of the depth distribution function.
[0099] Based on this, this embodiment can screen out the optimal depth function from the above seven depth functions as the initial soil nutrient content prediction model.
[0100] In a possible implementation manner, the above seven depth distribution functions can be trained, verified, and tested respectively to screen out the optimal depth distribution function, so as to simulate the variation characteristics that the available nitrogen content in the soil rapidly decreases and then tends to be stable as the soil depth increases through the optimal depth distribution function.
[0101] When the average root mean square error value is used as the target value, on the basis of Figure 3 , refer to Figure 5 , Figure 5 FIG. shows the step-by-step flowchart of step 203 in this embodiment. Step 203 of obtaining the initial soil nutrient content prediction model in this embodiment includes steps 2031 to 2034.
[0102] Step 2031: Divide the data set into multiple mutually exclusive subsets.
[0103] Step 2032: For any initial depth distribution function, perform multiple cross-validations on the basis of the mutually exclusive subsets to obtain the cross-validation results corresponding to the current initial depth distribution function.
[0104] Step 2033: Obtain the average root mean square error corresponding to the current initial depth distribution function based on the cross-validation results.
[0105] Step 2034: Use the initial depth distribution function corresponding to the minimum average root mean square error value as the final depth distribution function to obtain the initial soil nutrient content prediction model.
[0106] In this embodiment, the data set D can be represented as D = {(x1, y1), (x2, y2), …, (x N , y N )}; where x i is the input feature (such as soil depth, environmental variable), and y i is the deep soil nutrient content. Before performing cross-validation, the data set D can be evenly divided into 10 mutually exclusive subsets {D1, D2, …, D 10}.
[0107] In this embodiment, when any initial depth distribution function performs K-fold cross-validation, the training set in the a-th fold validation is represented as: D (a) train = D \ D a , which roughly contains 10% of the data; the validation set is expressed as: D (a) val = D a , which roughly contains 90% of the data; where a = 1, 2, …, 10.
[0108] Specifically, it can be understood that the steps for cross - validating any initial depth distribution function are as follows: successively take the data set of each fold as the validation set, and the remaining part as the training set, calculate the root - mean - square error (RMSE) of each fold's test, and take the average of the RMSEs taken K times here as the final result. Among them, the average root - mean - square error Avg(RMSE m ) corresponding to the m - th initial depth distribution function can be expressed by the formula: Avg(RMSE m ) = 1 / 10 ; in the formula is the average RMSE of the m - th initial depth distribution function in the a - th fold.
[0109] Among them, the processing process for any fold is specifically as follows: in the a - th fold, use the training set D (a) train to fit the model m to obtain the parameter , where the parameter can be expressed as:
[0110]
[0111] In the formula, £ is the loss function, such as the mean - square error calculation function, f a (xi; ∅) is the prediction function corresponding to the a - th initial depth distribution function; arg min(.) is the minimum - value function.
[0112] In this embodiment, the initial soil nutrient content prediction model M * is the initial depth distribution function corresponding to the minimum average root - mean - square error value, and this acquisition method can be expressed as: M * = arg min a∈{NEF、EDF、PF、LF、TEF、FIPF、REF} Avg(RMSE a ); in the formula, M * is the optimal model selected by cross - validation.
[0113] Refer to Figure 6 , Figure 6 which shows the relationship diagram of the initial depth distribution function simulating the vertical distribution of available nitrogen in the soil profile. It can be seen that among the above 7 initial depth distribution functions, the negative - exponential function significantly outperforms other functions in simulating the vertical distribution of available nitrogen in the soil profile.
[0114] After obtaining the initial soil nutrient content prediction model M * , the initial soil nutrient content prediction model M *Optimize it. For example, a machine learning model based on the random forest algorithm is used to determine the key parameters in the initial soil nutrient content prediction model. In this embodiment, the machine learning model based on the random forest algorithm takes into account the variations between and within groups and can effectively capture the non-linear relationship between the changes in soil nutrient content and the predictors.
[0115] Please, on the basis of Figure 2 refer to Figure 7 , Figure 7 which shows the sub-step flow chart of step 300 in this embodiment. This step 300 includes steps 301 to 302.
[0116] Step 301: Determine the non-linear equation related to the target nutrient in the data set based on the random forest algorithm;
[0117] Step 302: Adjust the initial soil nutrient content prediction model based on the non-linear equation to obtain the final soil nutrient content prediction model.
[0118] In this embodiment, the non-linear segmentation in the random forest algorithm with spatial features as the target, that is, at the single-tree level, generates a complex decision boundary through threshold segmentation (such as x1 ≤ b and x2 > c). In the non-linear superposition of multiple-tree integration, that is, at the forest level, different trees need to be trained on different feature subsets or data subsets, and the weighted average of their outputs further enhances the non-linear expression ability.
[0119] The inventor knows from the existing research results that the trend of the soil available nitrogen content decreasing with depth is very obvious in the soil layer of 0 - 40 cm, and gradually slows down and tends to be stable in the soil layer below 40 cm. It can be seen that the soil properties are the main factors affecting the parameters of the depth distribution function.
[0120] Based on this, to ensure the accuracy of the prediction model, since the soil properties are the main factors affecting the parameters of the depth distribution function, in a possible implementation embodiment, the present invention analyzes the relationship between the surface soil properties and the change rate (k0) of the available nitrogen content in the 0 - 40 cm soil layer and the optimal depth distribution function parameters (C e and k), and establishes a method for predicting the deep C e and k.
[0121] Specifically, the calculation method of the change rate k o of the available nitrogen content in the 0 - 40 cm soil layer is: k o = -(ln(C1) - ln(C o )) / (x1 - x o ). In the formula, x o is the sampling depth (cm) of the surface soil; x1 is the sampling depth (cm) of the next layer of soil in the 0 - 40 cm profile, C ois the available nitrogen content in the surface soil (g kg -1 ); C1 is the available nitrogen content in the soil layer x1 (g kg -1 ).
[0122] In addition, reference can be made to Figure 8 , Figure 8 showing the analysis results of the training parameters in this embodiment. It can be seen that the available nitrogen in the topsoil (C0), the clay and silt contents are all significantly positively correlated with C e , and the sand content is significantly negatively correlated with C e . And because there is multicollinearity among the clay, silt, sand contents and C0 in the topsoil, and the correlation coefficient between C0 and C e is the highest (r = 0.78), in this embodiment, C0 can be selected as the variable for predicting C e . Based on this, the prediction equation can be expressed as: Ce = 0.16 × C0 + 0.81.
[0123] With the same idea as the above embodiment, both k0 and the sand content are significantly positively correlated with k, and the clay and silt contents are significantly negatively correlated with k. At the same time, continue to refer to Figure 8 , it can be seen that k0 is significantly positively correlated with the sand content and negatively correlated with the clay and silt contents. Because there is multicollinearity among the clay, silt, sand contents and k0, and the correlation coefficient between k0 and k is the highest (r = 0.90), based on this, the present invention can select the change rate k0 of the available nitrogen content in the 0 - 40 cm soil layer to predict the negative exponential function parameter k, and the prediction equation is expressed as: k = 1.27 × k0 + 0.01.
[0124] In summary, in this embodiment, when the available nitrogen content in the soil is the target nutrient, the expression of the soil nutrient content prediction model is:
[0125] C x = C e + (C o - C e ) × exp(-kx);
[0126] Among them, C e = 0.16 × C0 + 0.81; k = 1.27 × k0 + 0.01;
[0127] In the formula, C x is the available nitrogen content in the soil at the depth x of the soil profile; C0 is the available nitrogen content in the surface soil; C eis the content when the available nitrogen in the soil tends to be stable as the soil profile depth increases; exp(.) is the exponential function; k0 is the change rate of the available nitrogen content in the soil layer under the preset soil thickness; k is the change rate of the available nitrogen in the soil profile.
[0128] Based on this, in this embodiment, the data of the soil sample to be measured can be input into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured, and then based on the prediction parameters, the prediction result of the target nutrient in the current soil sample to be measured can be determined to evaluate the change characteristics of the target nutrient in the current soil sample to be measured. Among them, in this embodiment, R 2 and RMSE can be used as evaluation indicators for evaluation, and the result corresponding to the minimum RMSE and the highest R 2 fitting degree is selected as the prediction parameter.
[0129] In a possible implementation manner, taking the available nitrogen content in the soil layer of 0-100 cm as the target nutrient to be predicted in this embodiment, reference can be made to Figure 9 , Figure 9 which shows the comparison chart between the prediction result and the measured result of the available nitrogen content in the soil in this embodiment. Among them, the slope of the linear relationship reaches 0.93, and R 2 is 0.90, and the RMSE is 0.86 g kg −1 . It can be seen that the prediction result of the available nitrogen content in the soil in this embodiment has a very significant positive correlation with the measurement result. The soil nutrient content prediction method provided in this embodiment can meet the prediction requirements of deep soil nutrients and has high prediction accuracy.
[0130] In summary, the present invention proposes a soil nutrient content prediction method, which relates to the technical field of soil nutrient cycling. The soil nutrient content prediction method in the present invention includes: obtaining the data of the soil sample to be measured, inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training the combined random forest algorithm and the depth distribution function. Based on the prediction parameters of the target nutrient, the prediction result of the target nutrient in the soil sample to be measured is obtained to evaluate the change characteristics of the target nutrient in the current soil sample to be measured. Based on this, the present invention can overcome the problems of low data quality and sample size limitation in the prediction of deep soil nutrients in the prior art, improve the effectiveness and accuracy of deep soil nutrient prediction, and fill the gap in the prior art.
[0131] To execute the corresponding steps in the above embodiments and each possible implementation manner, please refer to Figure 10 , Figure 10The structural schematic diagram of the soil nutrient content prediction system in this embodiment is shown. It should be noted that the basic principle and technical effects of the soil nutrient content prediction system 10 provided in this embodiment are the same as those in the above embodiment. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding content in the above embodiment. The soil nutrient content prediction system 10 in the present invention includes:
[0132] A data acquisition module 11 for acquiring data of a soil sample to be measured;
[0133] A prediction model construction module 12 for inputting the data of the soil sample to be measured into a soil nutrient content prediction model to obtain prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training in combination with a random forest algorithm and a depth distribution function;
[0134] A prediction evaluation module 13 for obtaining a prediction result of the target nutrient in the data of the soil sample to be measured based on the prediction parameters of the target nutrient, so as to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
[0135] With the same idea as the previous embodiment, please refer to Figure 11 , Figure 11 The block diagram of the server in this embodiment is shown. The server 20 includes a memory, a processor and a communication module. Each element of the memory, the processor and the communication module is electrically connected directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines.
[0136] Among them, the memory is used to store programs or data. The memory can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0137] The processor is used to read / write the data or programs stored in the memory, and execute the steps of obtaining the data of the soil sample to be measured; inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training the combined random forest algorithm and the depth distribution function; and obtaining the prediction result of the target nutrient in the data of the soil sample to be measured based on the prediction parameters of the target nutrient to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
[0138] The communication module is used to establish a communication connection between the server and other communication terminals through the network, and is used to send and receive data through the network.
[0139] It should be understood that Figure 11 the structure shown is only a schematic diagram of the server structure, and the server may also include more or fewer components than those shown in Figure 11 or have a different configuration from that shown in Figure 11 The components shown in can be implemented by hardware, software or a combination thereof. Figure 11 Each component shown in can be implemented by hardware, software or a combination thereof.
[0140] Optionally, each module shown in the above Figure 10 can be stored in the memory shown in the form of software or firmware and solidified in the operating system (Operating System, OS) of the soil nutrient content prediction method, and can be executed by the Figure 11 processor shown in. At the same time, the data, program codes, etc. required to execute the above modules can be stored in the memory. Figure 11 The processor shown in. At the same time, the data, program codes, etc. required to execute the above modules can be stored in the memory.
[0141] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0142] In addition, in each embodiment of the present invention, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0143] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0144] The above is only the preferred embodiment of the present invention and is not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting soil nutrient content, characterized in that, The method includes: Obtaining data of the soil sample to be measured; Inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training the combined random forest algorithm and the depth distribution function; Based on the prediction parameters of the target nutrient, obtaining the prediction result of the target nutrient in the data of the soil sample to be measured to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
2. The soil nutrient content prediction method according to claim 1, wherein, Before the step of inputting the data of the soil sample to be measured into the soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured, it further includes: Constructing an initial soil nutrient content prediction model based on the depth distribution function; Training the initial soil nutrient content prediction model according to the random forest algorithm to obtain the final soil nutrient content prediction model.
3. The soil nutrient content prediction method according to claim 2, characterized in that, The step of constructing an initial soil nutrient content prediction model based on the depth distribution function includes: Obtaining training parameters and preprocessing the training parameters to obtain a data set; Constructing a plurality of initial depth distribution functions; Using the cross-validation method to screen the initial depth distribution function corresponding to the lowest target value from the plurality of initial depth distribution functions based on the data set as the initial soil nutrient content prediction model.
4. The soil nutrient content prediction method according to claim 3, wherein The target value includes the mean root mean square error value. The step of obtaining the initial soil nutrient content prediction model includes: Dividing the data set into a plurality of mutually exclusive subsets; For any initial depth distribution function, performing multiple cross-validations based on the mutually exclusive subsets to obtain the cross-validation results corresponding to the current initial depth distribution function; Obtaining the mean root mean square error corresponding to the current initial depth distribution function based on the cross-validation results; Taking the initial depth distribution function corresponding to the minimum mean root mean square error value as the final depth distribution function to obtain the initial soil nutrient content prediction model.
5. The soil nutrient content prediction method according to claim 4, characterized in that, The step of training the initial soil nutrient content prediction model according to the random forest algorithm to obtain the final soil nutrient content prediction model includes: Determining the non-linear equation related to the target nutrient in the data set based on the random forest algorithm; Adjusting the initial soil nutrient content prediction model based on the non-linear equation to obtain the final soil nutrient content prediction model.
6. The method for predicting soil nutrient content according to any one of claims 1 to 5, characterized in that Taking the soil available nitrogen content as the target nutrient, the expression of the soil nutrient content prediction model is: C x = C e +(C o - C e ) × exp(-kx); Among them, C e = 0.16 × C0 + 0.81; k = 1.27 × k0 + 0.01; where C x is the available nitrogen content of the soil at the depth x of the soil profile; C0 is the available nitrogen content of the surface soil; C e is the content when the available nitrogen in the soil tends to be stable with the increase of the soil profile depth; exp(.) is the exponential function; k0 is the change rate of the available nitrogen content in the soil layer under the preset soil thickness; k is the change rate of the available nitrogen in the soil profile.
7. The soil nutrient content prediction method according to claim 3, characterized in that, The step of obtaining training parameters and preprocessing the training parameters to obtain a data set includes: Screening the training parameters to filter out the soil attribute data that does not conform to the preset attribute parameter values in the training parameters to obtain the initial training parameters; Determining the missing data indicators in the initial training parameters based on the generalized boosted regression model and the initial training parameters to obtain the data set; Wherein, the missing data indicators include bulk density and gravel content data.
8. The soil nutrient content prediction method according to claim 7, characterized in that, The step of determining the missing data indicators in the initial training parameters based on the generalized boosted regression model and the initial training parameters includes: Construct a generalized boosted regression model, and determine the non-linear relationship between each data index under the initial training parameters based on the generalized boosted regression model; Utilize the non-linear relationship to determine the missing data index in the initial training parameters based on the data values corresponding to the initial training parameters.
9. The soil nutrient content prediction method according to claim 7 or 8, characterized in that The calculation formula for determining the missing data index in the initial training parameters is expressed as: ; wherein, is the predicted value of the target quantity; F0 is the mean value of the target quantity; is the prediction function corresponding to the m-th data index related to the current target quantity among the training parameters; is the weight coefficient of the m-th data index related to the current target quantity among the training parameters; M is the total number of data indexes related to the current target quantity among the training parameters.
10. A soil nutrient content prediction system, characterized in that, including: A data acquisition module for acquiring data of the soil sample to be measured; A prediction model construction module for inputting the data of the soil sample to be measured into a soil nutrient content prediction model to obtain the prediction parameters of the target nutrient in the soil sample to be measured; wherein, the soil nutrient content prediction model is a model obtained by training in combination with a random forest algorithm and a depth distribution function; A prediction evaluation module for obtaining the prediction result of the target nutrient in the data of the soil sample to be measured based on the prediction parameters of the target nutrient to evaluate the change characteristics of the target nutrient in the current data of the soil sample to be measured.
Citation Information
Cited By
Deep soil nitrogen content monitoring method, server and storage medium
CN121877762A
Soil humidity estimation method and device, electronic equipment and storage medium
CN122130781A
Soil moisture estimation methods, devices, electronic equipment and storage media
CN122130781B