Digital soil mapping method and device based on soil space neighborhood information

Through the combination of soil spatial neighborhood information and the random forest model, the problem of insufficient soil attribute data prediction accuracy in the existing technology is solved, and higher soil attribute data prediction accuracy and the stability of digital soil mapping are achieved.

CN118537441AActive Publication Date: 2024-08-23ZHEJIANG UNIV

Patent Information

Application Number
CN202410661656.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-08-23
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

Existing digital soil mapping methods have not yet achieved optimal results in terms of soil attribute data prediction accuracy, making it difficult to achieve higher accuracy and stability.

Method used

By introducing soil spatial neighborhood information, Euclidean distance is used to calculate similar soil sample sets, and inverse distance weighting is performed. The soil attribute data prediction model is trained with the random forest model, and the influence of adjacent soil samples on the soil sample to be tested is considered.

Benefits of technology

It significantly improves the prediction accuracy of soil attribute data, achieves more accurate digital soil mapping, and improves the stability and application effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537441A
    Figure CN118537441A
Patent Text Reader

Abstract

The invention discloses a digital soil mapping method and device based on soil space neighborhood information, and the method comprises the steps: obtaining a space neighborhood soil sample set which is close to the front k space distance of a to-be-detected soil sample by comparing Euclidean distances between the to-be-detected soil sample and other soil samples; performing inverse distance weighting on the soil attribute data of each spatial neighborhood soil sample, and averaging to obtain spatial neighborhood soil attribute data; and training a random forest model based on the environment variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data to obtain a soil attribute data prediction model, and inputting the environment variable set of the to-be-detected region into the soil attribute data prediction model to obtain predicted soil attribute data. And realizing digital soil mapping of the to-be-tested area based on the predicted soil attribute data. According to the method, the soil attribute data can be accurately predicted, so that a more accurate digital soil map can be drawn.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of soil mapping, and in particular relates to a digital soil mapping method and device based on soil spatial neighborhood information. Background Art

[0002] As the cornerstone of all terrestrial ecosystems, soil is facing major threats from human disturbances including climate change, land use change, pollution and erosion. Therefore, timely updating of fine-resolution soil information is crucial for decision-making on protecting limited soil resources and its green and sustainable development.

[0003] Digital soil mapping has become an important tool to provide high-quality cross-scale spatial-temporal soil information and its quantified uncertainty. Improving the predictive accuracy of digital soil maps is essential to advance the practical application of digital soil mapping in decision making. Therefore, a large amount of research is devoted to this research topic, reflecting its importance in the field.

[0004] Deeply mining the environmental variables related to target soil properties is one of the feasible solutions to improve the accuracy of digital soil mapping products. In the past decade, a series of advances have been made in characterizing new environmental variables, including agricultural management, geomorphic variables, and three-dimensional spatiotemporal covariates.

[0005] The invention patent application with publication number CN103955953A discloses a terrain collaborative variable selection method for digital soil mapping. It adopts a multi-terrain factor and multi-algorithm selection method, and uses a functional testing strategy to preprocess and select different terrain factor variables. By combining the correlation mechanism with soil properties, it realizes the rapid and accurate selection of complex terrain factor variables. It also adopts the "evaluation analysis as the main, correlation analysis as the auxiliary" technology to realize "different terrain factor variables, universal selection mechanism; different dependencies, dynamic factor screening; evaluation control strategy, algorithm performance considerations" quantitative digital soil mapping terrain factor variable selection system, which has broad prospects for industrial application.

[0006] The invention patent application with publication number CN116206011A discloses a digital soil mapping method and system based on multi-source data, the method includes obtaining the soil utilization type and satellite remote sensing image raster data of the area to be measured, dividing the area to be measured into blocks to obtain multiple soil areas, each soil utilization type includes at least one soil area, identifying all soil areas to obtain the terrain characteristics of each soil area and the soil area distribution characteristics of the same soil utilization type according to the identification results; judging whether the soil areas of the same soil utilization type are distributed adjacently; if not, obtaining the sample points of each soil unit, and obtaining the sample data of each sample point according to the sample points to perform soil mapping. This application divides the area to be measured into multiple soil areas, and then determines the sample points of each soil area and the sample data corresponding to the sample points respectively, so that the obtained sample data is more representative, thereby improving the prediction accuracy of the prediction model.

[0007] However, the digital soil mapping methods provided by the above patents have room for further improvement in the prediction accuracy of soil attribute data. Summary of the invention

[0008] The present invention provides a digital soil mapping method based on soil spatial neighborhood information, which can accurately predict soil attribute data and thus can draw more accurate digital soil mapping.

[0009] A specific embodiment of the present invention provides a digital soil mapping method based on soil spatial neighborhood information, comprising:

[0010] By comparing the Euclidean distance between the soil sample to be tested and other soil samples, a set of spatial neighborhood soil samples with the closest spatial distance to the soil sample to be tested is obtained, and the soil attribute data of each spatial neighborhood soil sample is inversely distance weighted and averaged to obtain the spatial neighborhood soil attribute data;

[0011] A soil attribute data prediction model is obtained by training a random forest model based on an environmental variable set of each training sample in a training sample set and corresponding spatial neighborhood soil attribute data, wherein the training sample set comes from a soil sample set to be tested constructed by the soil sample to be tested;

[0012] When applied, the environmental variable set of the area to be tested is input into the soil property data prediction model to obtain predicted soil property data, and digital soil mapping of the area to be tested is achieved based on the predicted soil property data.

[0013] Preferably, the spatial neighborhood soil sample set with the closest k spatial distances to the soil sample to be tested is obtained by comparing the Euclidean distances between the soil sample to be tested and other soil samples, including:

[0014] Calculate the Euclidean distance between the soil sample in the tested area and other soil samples based on the latitude and longitude of the soil sample and other soil samples;

[0015] The k other soil samples with the closest Euclidean distance are taken as the spatial neighborhood soil sample set.

[0016] Preferably, the soil sample set to be tested also includes a verification sample set and target soil property data corresponding to each verification sample;

[0017] The environmental variable set of the validation sample is input into the soil property data prediction model to obtain the predicted soil property data, and the prediction accuracy is obtained by using the determination coefficient, root mean square error and consistency correlation coefficient based on the predicted soil property data and the target soil property data;

[0018] When the prediction accuracy is lower than the set accuracy threshold, the corresponding soil attribute data prediction model is used as the final soil attribute data prediction model.

[0019] Preferably, the method for obtaining a soil sample to be tested comprises the following steps:

[0020] Collect 0-20cm soil surface samples from the area to be tested, and use the random stratification method to determine the spatial location of the soil sampling points;

[0021] The soil sample to be tested is collected at the spatial position: a plurality of sub-samples are collected at each soil sampling point by using the diagonal method, and the plurality of sub-samples are mixed into a soil sample to be tested, and the latitude and longitude information of the soil sampling point is recorded at the same time.

[0022] Preferably, the soil property data includes one or more of soil organic carbon density data, soil heavy metal content data, soil texture data, and soil gravel content data.

[0023] Preferably, the environmental variables include one or more of climate environmental variables, topographic environmental variables, spatial location environmental variables, and biological environmental variables.

[0024] Preferably, the soil property data prediction model is obtained by training a random forest model based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil property data, including:

[0025] Based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data, ten-fold cross validation was used to determine the optimal number of trees and branch variables of the random forest. The corresponding relationship between the environmental variables and the predicted soil attribute data was fitted based on the determined optimal number of trees and branch variables, thus obtaining the soil attribute data prediction model.

[0026] On the other hand, a specific embodiment of the present invention further provides a digital soil mapping device based on soil spatial neighborhood information, comprising:

[0027] A data processing module; used to obtain a spatial neighborhood soil sample set with the top k spatial distances to the soil sample to be tested by comparing the Euclidean distance between the soil sample to be tested and other soil samples, and to average the soil property data of each spatial neighborhood soil sample after inverse distance weighting to obtain spatial neighborhood soil property data; and to train a random forest model based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil property data to obtain a soil property data prediction model, wherein the training sample set comes from the soil sample set to be tested constructed by the soil sample to be tested;

[0028] Input module: Input the environmental variable set of the area to be tested into the soil property data prediction model to obtain predicted soil property data, and realize digital soil mapping of the area to be tested based on the predicted soil property data.

[0029] On the other hand, a specific embodiment of the present invention further provides a digital soil mapping device based on soil spatial neighborhood information, characterized in that it includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the digital soil mapping method based on soil spatial neighborhood information.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] Different from the prior art that directly fits the correspondence between environmental variables and soil property data, the present invention uses the spatial neighborhood soil property data and environmental variables of the soil adjacent to the soil to be tested to train the random forest model at the same time, thereby taking into account the influence of adjacent soil samples on the soil samples to be tested when training the random forest model, and then accurately obtaining the corresponding soil property data, thereby achieving accurate drawing of digital soil mapping. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A flow chart of a digital soil mapping method based on soil spatial neighborhood information provided by a specific embodiment of the present invention;

[0033] Figure 2 A prediction accuracy map of the organic carbon density of the soil to be tested by the digital soil mapping method based on soil spatial neighborhood information provided in Example 1 of the present invention;

[0034] Figure 3 A prediction accuracy map of heavy metal lead in the soil to be tested by the digital soil mapping method based on soil spatial neighborhood information provided in Example 2 of the present invention;

[0035] Figure 4This is a prediction accuracy map of heavy metal zinc in the soil to be tested by the digital soil mapping method based on soil spatial neighborhood information provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0036] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0037] There is no research in the prior art that attempts to incorporate soil spatial neighborhood information into digital soil mapping. In addition to the field of environmental variables, soil attribute data at a specific sampling point is inevitably associated with soil samples at neighboring sampling points. In order to further improve the accuracy and stability of digital soil mapping, a specific embodiment of the present invention attempts to introduce soil spatial neighborhood information enhancement technology into digital soil mapping. This technology can enhance the accuracy of the soil attribute data prediction model by capturing neighboring soil sample information and integrating it with existing environmental variables into digital soil mapping.

[0038] The specific embodiment of the present invention proposes a digital soil mapping method based on soil spatial neighborhood information, such as Figure 1 As shown, the following steps are included:

[0039] (1) Obtain a soil sample set to be tested, and divide the soil sample set to be tested into a training set and a validation set:

[0040] A specific embodiment of the present invention provides a method for obtaining a soil sample to be tested, comprising the following steps: collecting 0-20 cm soil surface samples in the area to be tested, and determining the spatial position of the soil sampling point by using a random stratification method by comprehensively considering land cover and terrain factors; collecting the soil sample to be tested at the spatial position, collecting 5 sub-samples at each sampling point by using a diagonal method, and mixing the 5 sub-samples into a soil sample to be tested, wherein the soil sample to be tested includes soil attribute data, an environmental variable set, and longitude and latitude; and simultaneously recording the longitude and latitude information of the sampling point as a geographical location identifier of the soil sample.

[0041] The soil property data method of the soil sample to be tested provided in a specific embodiment of the present invention includes the following steps: air-drying, grinding, and sieving each collected soil sample to be tested, and then determining the soil property data through a standard laboratory physical and chemical analysis method, wherein the soil property data includes one or more of soil organic carbon density data, soil heavy metal content data, soil texture data, and soil gravel content data.

[0042] The environmental variable method of the soil sample to be tested provided in a specific embodiment of the present invention includes extracting satellite remote sensing images and products through the longitude and latitude of the soil sample to obtain an environmental variable set, and the environmental variables include one or more of climate environmental variables, terrain environmental variables, spatial location environmental variables, and biological environmental variables.

[0043] (2) By comparing the Euclidean distance between the soil sample to be tested and other soil samples, a spatial neighborhood soil sample set is obtained. The soil attribute data of each spatial neighborhood soil sample is weighted by inverse distance and then averaged to obtain the spatial neighborhood soil attribute data. The specific description is as follows:

[0044] The specific embodiment of the present invention calculates the Euclidean distance of the longitude and latitude of the soil sample to be tested and other soil samples. It can be understood that other soil samples are also collected in the area to be tested. By comparing the Euclidean distance of longitude and latitude, other soil samples that are closest to the soil sample to be tested in spatial distance are obtained. The other soil samples that are closest to the soil sample to be tested are used as a set of spatial neighborhood soil samples, thereby obtaining soil samples adjacent to the soil sample to be tested. Inverse distance weighting is used to assign weights to the soil attribute data of each spatial neighborhood soil sample. The closer to the soil sample to be tested, the higher the weight, thereby realizing the idea that the spatial neighborhood soil sample that is closer to the soil sample to be tested has a greater impact on the soil sample to be tested. The weighted soil attribute data are averaged to obtain the spatial neighborhood soil attribute data.

[0045] (3) Based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data, a random forest model is trained to obtain a soil attribute data prediction model, which is specifically described as follows:

[0046] The specific embodiment of the present invention uses ten-fold cross validation to determine the optimal number of trees and branch variables of the random forest based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data, and fits the correspondence between the environmental variables and the predicted soil attribute data based on the determined optimal number of trees and branch variables, thereby obtaining a soil attribute data prediction model.

[0047] The specific embodiment of the present invention uses spatial neighborhood soil attribute data as parameters together with environmental variables for training random forests, thereby taking into account the influence of soil samples adjacent to the soil sample to be tested on the soil sample to be tested, thereby enhancing the mapping relationship between environmental variables and soil attribute data, so that the obtained soil attribute data prediction model can more accurately predict soil attribute data.

[0048] (4) The soil attribute data prediction model is verified based on the verification sample set. If the verification result is less than the accuracy threshold, the final soil attribute data prediction model is obtained.

[0049] In a specific embodiment, this embodiment inputs the environmental variable set of the verification sample into the soil attribute data prediction model to obtain predicted soil attribute data, and uses the determination coefficient, root mean square error and consistency correlation coefficient based on the predicted soil attribute data and the target soil attribute data to obtain the prediction accuracy; when the prediction accuracy is lower than the set accuracy threshold, the corresponding soil attribute data prediction model is used as the final soil attribute data prediction model.

[0050] The accuracy of the model provided by the present invention uses the determination coefficient, root mean square error and consistency correlation coefficient to evaluate the prediction accuracy of the prediction model. The determination coefficient R 2 for:

[0051]

[0052] The root mean square error RMSE is:

[0053]

[0054] The consistency correlation coefficient LCCC is:

[0055]

[0056] Among them, n is the number of validation samples, y i is the target soil property data of the i-th verification sample, is the predicted soil property data generated by the prediction model for the i-th sample, represents the covariance between and, var(y i )and Respectively represent y i and Variance of i and represent the means of and respectively.

[0057] (5) A digital soil map is prepared based on the final soil property data prediction model, the environmental variable set of the area to be tested is input into the final soil property data prediction model to obtain predicted soil property data, and digital soil mapping of the area to be tested is realized based on the predicted soil property data.

[0058] On the other hand, a specific embodiment of the present invention further provides a digital soil mapping device based on soil spatial neighborhood information, comprising:

[0059] The data processing module is used to obtain a set of spatial neighborhood soil samples with the closest spatial distance to the soil sample to be tested by comparing the Euclidean distance between the soil sample to be tested and other soil samples, and to obtain spatial neighborhood soil property data by averaging the soil property data of each spatial neighborhood soil sample after inverse distance weighting; and to train a random forest model based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil property data to obtain a soil property data prediction model, wherein the training sample set comes from the soil sample set to be tested constructed by the soil sample to be tested.

[0060] Input module: Input the environmental variable set of the area to be tested into the soil property data prediction model to obtain predicted soil property data, and realize digital soil mapping of the area to be tested based on the predicted soil property data.

[0061] On the other hand, a specific embodiment of the present invention also provides a digital soil mapping device based on soil spatial neighborhood information, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the digital soil mapping method based on soil spatial neighborhood information as described in the right.

[0062] Example 1

[0063] In this example, France is selected as the research area, and 916 surface soil sample data (0-20 cm) of the LUCAS Soil 2018 dataset are used. Other soil properties and environmental variables obtained through remote sensing technology are used to construct soil spatial neighborhood information through the inverse distance weighted method, which ultimately improves the prediction accuracy of the target soil properties. The specific description is as follows:

[0064] Step (1): Collect 0-20 cm soil surface samples from the area to be tested, determine the spatial position of the soil sampling point by random stratification based on comprehensive land cover and terrain, determine the sampling point based on the spatial position, collect 5 sub-samples by the diagonal method, and the 5 sub-samples form a mixed soil sample, i.e., the soil sample to be tested, and record the longitude and latitude of the sampling point of the soil sample to be tested as the longitude and latitude of the soil sample to be tested.

[0065] The soil property data of the soil sample to be tested provided in this embodiment is soil organic carbon density data. The soil organic carbon density data calculation includes soil bulk density and soil organic carbon content (soil organic carbon density = soil bulk density × soil organic carbon content × soil layer thickness / 100 × (1-gravel content)).

[0066] The soil bulk density provided in this embodiment is obtained by adopting a core sampling method, in which a ring with a known volume is knocked vertically or horizontally into undisturbed soil to obtain a sample, which is then brought back to the laboratory for soil quality measurement, wherein the soil bulk density can be calculated by the following formula: soil bulk density = soil sample mass / ring volume.

[0067] The organic carbon content of a soil sample provided in this embodiment includes: air-drying, grinding and sieving the soil sample, and then determining the organic carbon content of the soil by a combustion method.

[0068] The soil gravel content provided in this embodiment includes: collecting a soil sample and preparing a wet screening tool; using a wet screening method to separate gravel from the soil sample; weighing the gravel and calculating its content percentage in the sample:

[0069] Step (2): The environmental variables provided in this embodiment include climate environmental variables, topographic factors, clay particles and USDA soil texture classification

[0070] The WorldClim Version 2 climate environment variable provided in this embodiment uses data from 60,000 climate stations around the world (http: / / www.worldclim.com / version2), combined with elevation, distance from the coast, maximum / minimum surface temperature and cloud cover data, to obtain the global 1 km resolution annual average precipitation, annual average temperature, wind speed, vapor pressure and solar radiation through spline interpolation.

[0071] The terrain factors provided in this embodiment obtain elevation data from ASTER GDEM V2 (GeoSpatial Data Cloud, https: / / www.gscloud.cn / ) with a spatial resolution of 30 meters, and use SAGA (Automated Geoscience Analysis System) to calculate terrain factors, including fill and available water capacity.

[0072] The clay and USDA soil texture classifications provided in this example were extracted from the LUCAS Soil 2009 database of the European Soil Data Center. Soil organic carbon in European surface soils (0-20 cm) in 2009 was extracted from a 1 km resolution product (https: / / esdac.jrc.ec.europa.eu / projects / lucas). Soil types were extracted from the French 1:5000000 scale national soil type map.

[0073] The French land use map provided in this example is extracted from the 2018 CORINE land cover ( https: / / land.copernicus.eu / ).

[0074] All environmental variables provided in this example were resampled to 30 m spatial resolution using bilinear interpolation (majority voting was used for soil type and land use) and reprojected to the Lambert-93 system.

[0075] Step (3): The extraction of environmental variables of the soil sampling points provided in this embodiment is implemented in the R language through the extract function of the raster software package, so that the sampling point latitude information and environmental variable data of each soil sample to be tested are represented by a data matrix.

[0076] Step (4): First, in R language, use the createDataPartition function of the caret software package to divide the data set into a training set and a validation set. Next, extract the longitude and latitude information of each sample from the data set, and use the dist function to calculate the Euclidean distance matrix between samples. For each sample in the training set, loop the Euclidean distance between it and other training set samples, and select the k neighboring samples with the shortest distance. Then, use the inverse distance weighted method to calculate the weighted average organic carbon density value based on the organic carbon density values ​​of these neighboring samples and their distance weights, and add this value to the training set as a new spatial neighborhood information variable. For each sample in the validation set, also calculate the Euclidean distance between it and the training set sample, and select the k nearest training set samples. Subsequently, use the inverse distance weighted method to calculate the weighted average organic carbon density value, and add this value to the validation set as a new spatial neighborhood information variable. In this study, the k value range is set to 1 to 10. The optimal model parameters can be selected by comparing different k values, such as Figure 2 As shown in Figure 2, as k increases, the prediction accuracy of the model (R 2 ) gradually increases. When k=7, the prediction accuracy of the model is the highest, R 2 It is 0.37.

[0077] Step (5): Construct a random forest (RF) model. The RF model was constructed using the randomForest package. This model improves prediction accuracy by integrating multiple decision trees. When constructing, the number of trees (ntree) was set to the default value of 500 to ensure model stability and generalization ability. At the same time, the number of predictor variables (mtry) for decision tree node division was optimized to 3 to make full use of data feature information.

[0078] Step (6): Input the environmental variable set into the final prediction model to enhance the prediction accuracy of the digital mapping model.

[0079] In this example, the data was divided into a training sample set (687) and a validation sample set (229), which were used to fit the prediction model and objectively evaluate the model accuracy. The model performance of the random forest model without using soil spatial neighborhood information and the random forest model with soil spatial neighborhood information evaluated on the same validation data were used to objectively evaluate the potential of soil spatial neighborhood information in enhancing the accuracy of spatial modeling. The results showed that in the modeling of soil organic carbon density in France, the random forest model with soil spatial neighborhood information outperformed the random forest model without using soil spatial neighborhood information, R 2 The results showed that the LCCC was improved by 0.04 and the RMSE was reduced by 0.9t ha. -1 , proving the effectiveness and superiority of the method of this embodiment.

[0080] Example 2

[0081] In this example, the floodplain of the Meuse River near Stein, the Netherlands, was selected as the research area, 152 surface soil samples (0-20 cm) collected nearby were used as soil samples, other soil attribute data and environmental variables obtained through remote sensing technology were used, and the soil spatial neighborhood information was constructed through the inverse distance weighted method, which ultimately improved the prediction accuracy of the target soil attributes. The following mainly shows the specific data and implementation details:

[0082] Step (1): The dataset for this study includes soil heavy metal (zinc and lead) content data, organic matter, altitude, etc. observed at 152 sampling points, as described below:

[0083] Soil zinc and lead concentration data. The study used the Meuse dataset included in the sp software package. This dataset provides the location and many soil and landscape variables of the observation site, among which the soil zinc and lead concentrations are from mixed samples with an area of ​​about 15m×15m.

[0084] The environmental variables provided in this example mainly include distance to the river, altitude, land use, flood frequency, soil type and lime application frequency.

[0085] In R language, the createDataPartition function of the caret package is used to divide the data set into a training set and a validation set. Then, the longitude and latitude information of each sample is extracted from the data set, and the Euclidean distance matrix between samples is calculated using the dist function.

[0086] The research on soil heavy metal zinc provided in this example:

[0087] For each sample in the training set, this embodiment cyclically calculates the Euclidean distance between it and other samples in the training set, and selects the nearest k neighboring samples. Subsequently, the weighted average of the zinc content of these k neighboring samples is calculated, and this value is added to the training set as a new spatial neighborhood information variable. For the samples in the validation set, the same operation is performed to calculate the weighted average zinc content of the nearest k neighboring sample points in the surrounding training set, and this value is added to the validation set as a new spatial neighborhood information variable. In this study, for the prediction of zinc, this embodiment attempts to use different k values ​​(from 1 to 10) to explore the impact of the k value on the prediction performance of the model, such as Figure 3 As shown in Figure 2, as k increases, the prediction accuracy of the model (R 2 ) gradually increases. When k=9, the prediction accuracy of the model is the highest, R 2 It is 0.64.

[0088] The research on heavy metal lead in soil provided in this embodiment:

[0089] Similar to the zinc research process, this embodiment calculates the Euclidean distance between each sample in the training set and the validation set and other samples, and selects the nearest k neighboring samples. Then, the weighted average of the lead content of these k neighboring samples is calculated, and this value is added to the training set and the validation set as a new spatial neighborhood information variable. Similarly, this embodiment attempts to use different k values ​​(from 1 to 10) to evaluate their impact on the performance of the lead content prediction model, such as Figure 4 As shown in Figure 2, as k increases, the prediction accuracy of the model (R 2 ) gradually increases. When k = 5, the prediction accuracy of the model is the highest, R 2 It is 0.73.

[0090] Through the above steps, this embodiment constructs a training set and a validation set containing spatial information for soil heavy metals zinc and lead, respectively, providing a basis for the subsequent random forest model construction.

[0091] Step (3): Build a random forest (RF) model

[0092] Using the randomForest software package, this embodiment constructs random forest models for zinc and lead for prediction. The model improves the prediction accuracy by integrating multiple decision trees. During the model construction process, this embodiment sets the number of decision trees (ntree) to a default value of 500 to ensure the stability and generalization ability of the model. At the same time, in order to make full use of data feature information, this embodiment optimizes the number of prediction variables (mtry) for decision tree node partitioning and sets it to an appropriate value.

[0093] Step (4): Enhance the performance of the prediction model

[0094] When enhancing the performance of the prediction model, this embodiment also operates for zinc and lead respectively. This embodiment uses the data set containing environmental variables and the calculated k-value weighted average soil heavy metal value (for zinc and lead respectively) as input features to train the respective prediction models. By introducing these spatial neighborhood information, the spatial prediction performance in the digital mapping model can be enhanced. These new features not only take into account the spatial relationship between samples, but also combine the influence of environmental variables, thereby helping to improve the prediction accuracy and reliability of the model.

[0095] In this embodiment, the data is divided into a training sample set (114) and a validation sample set (38), which are used to fit the prediction model and objectively evaluate the model accuracy, respectively. The model performance of the random forest model without using soil spatial neighborhood information and the random forest model with soil spatial neighborhood information evaluated on the same validation data is used to objectively evaluate the potential of soil spatial neighborhood information in enhancing the accuracy of spatial modeling. The results show that in the spatial modeling of heavy metals in the Meuse River floodplain near Stein, the Netherlands, the random forest model with soil spatial neighborhood information is better than the random forest model without using soil spatial neighborhood information, where the R of lead element is 2 The R value of zinc element increased by 0.17, LCCC increased by 0.12, RMSE decreased by 14.8ppm, and 2 The accuracy was improved by 0.06, the LCCC was improved by 0.03, and the RMSE was reduced by 20.18 ppm, which proved the effectiveness and superiority of the method in this embodiment.

[0096] The above-described embodiments are only preferred solutions of the present invention, but they are not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A digital soil mapping method based on soil spatial neighborhood information, It is characterized in that include: By comparing the Euclidean distance between the soil sample to be tested and other soil samples, a set of spatial neighborhood soil samples with the closest spatial distance to the soil sample to be tested is obtained, and the soil attribute data of each spatial neighborhood soil sample is inversely distance weighted and averaged to obtain the spatial neighborhood soil attribute data; A soil attribute data prediction model is obtained by training a random forest model based on an environmental variable set of each training sample in a training sample set and corresponding spatial neighborhood soil attribute data, wherein the training sample set comes from a soil sample set to be tested constructed by the soil sample to be tested; When applied, the environmental variable set of the area to be tested is input into the soil property data prediction model to obtain predicted soil property data, and digital soil mapping of the area to be tested is achieved based on the predicted soil property data.

2. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that By comparing the Euclidean distance between the soil sample to be tested and other soil samples, a set of spatial neighborhood soil samples with the closest spatial distance to the soil sample to be tested is obtained, including: Calculate the Euclidean distance between the soil sample in the tested area and other soil samples based on the latitude and longitude of the soil sample and other soil samples; The k other soil samples with the closest Euclidean distance are taken as the spatial neighborhood soil sample set.

3. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that The soil sample set to be tested also includes a verification sample set and target soil property data corresponding to each verification sample; The environmental variable set of the validation sample is input into the soil property data prediction model to obtain the predicted soil property data, and the prediction accuracy is obtained by using the determination coefficient, root mean square error and consistency correlation coefficient based on the predicted soil property data and the target soil property data; When the prediction accuracy is lower than the set accuracy threshold, the corresponding soil attribute data prediction model is used as the final soil attribute data prediction model.

4. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that The method for obtaining a soil sample to be tested comprises the following steps: Collect 0-20cm soil surface samples from the area to be tested, and use the random stratification method to determine the spatial location of the soil sampling points; The soil sample to be tested is collected at the spatial position: a plurality of sub-samples are collected at each soil sampling point by using the diagonal method, and the plurality of sub-samples are mixed into a soil sample to be tested, and the latitude and longitude information of the soil sampling point is recorded at the same time.

5. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that The soil attribute data includes one or more of soil organic carbon density data, soil heavy metal content data, soil texture data, and soil gravel content data.

6. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that Environmental variables include one or more of climate environmental variables, topographic environmental variables, spatial location environmental variables, and biological environmental variables.

7. The digital soil mapping method based on soil spatial neighborhood information according to claim 1, It is characterized in that The soil attribute data prediction model is obtained by training the random forest model based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data, including: Based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil attribute data, ten-fold cross validation was used to determine the optimal number of trees and branch variables of the random forest. The corresponding relationship between the environmental variables and the predicted soil attribute data was fitted based on the determined optimal number of trees and branch variables, thus obtaining the soil attribute data prediction model.

8. A digital soil mapping device based on soil spatial neighborhood information, It is characterized in that include: A data processing module; used to obtain a spatial neighborhood soil sample set with the top k spatial distances to the soil sample to be tested by comparing the Euclidean distance between the soil sample to be tested and other soil samples, and to average the soil property data of each spatial neighborhood soil sample after inverse distance weighting to obtain spatial neighborhood soil property data; and to train a random forest model based on the environmental variable set of each training sample in the training sample set and the corresponding spatial neighborhood soil property data to obtain a soil property data prediction model, wherein the training sample set comes from the soil sample set to be tested constructed by the soil sample to be tested; Input module: Input the environmental variable set of the area to be tested into the soil property data prediction model to obtain predicted soil property data, and realize digital soil mapping of the area to be tested based on the predicted soil property data.

9. A digital soil mapping device based on soil spatial neighborhood information, It is characterized in that, It comprises a memory and one or more processors, wherein the memory stores executable codes, and when the one or more processors execute the executable codes, they are used to implement the digital soil mapping method based on soil spatial neighborhood information as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for calculating soil attribute value

    CN109541172A

  • Soil heavy metal content prediction method and system based on deep reinforcement learning

    CN112926256A

  • Southern hilly area cultivated land soil available phosphorus drawing method based on high-resolution environment variables

    CN115266612A

  • Soil mineral binding state organic carbon prediction method and device based on random forest and environmental variables

    CN115758270A

  • Soil organic matter spectrum prediction method and device based on nonlinear memory learning

    CN117057464A

Cited By

  • Method, system and equipment for analyzing heavy metal input contribution of farmland soil around mining area

    CN119227571A

  • Large-area soil rapid detection method and system based on Raman spectrum

    CN119555664A

  • Soil organic matter spectrum prediction method based on texture perception residual superposition

    CN121167680A