Soil sample prediction method and device based on subspace local modeling

By dividing the soil data set into multiple subspaces and building a local model in the closest subspace for prediction, the problem of long-term local sample modeling under large-scale data samples is solved, and efficient soil sample prediction is achieved.

CN119719769APending Publication Date: 2025-03-28INSTITUTE OF AGRO PRODUCTS STORAGE & PROCESSING
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411693484.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the data samples are particularly large, existing local sample modeling methods need to traverse a large number of samples and sort them in the process of selecting local samples, resulting in a long time-consuming prediction process and increasing the time cost of new sample prediction.

Method used

The correlation characteristics of the soil data set are divided into multiple subspaces by clustering method. According to the spatial distance between the relevant characteristic spatial distance between the soil sample to be measured and the subspace, the closest subspace is determined, and a local model is constructed from the subspace for prediction.

Benefits of technology

This method significantly reduces the calculation amount and time cost during the prediction process, improves the efficiency of soil sample prediction, while maintaining the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719769A_ABST
    Figure CN119719769A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a soil sample prediction method and device based on subspace local modeling, and the method comprises the steps: dividing the correlation characteristics of a soil data set into a plurality of subspaces through employing a clustering method, and determining a closest subspace according to the spatial distance between the plurality of subspaces and the correlation characteristics of a to-be-detected soil sample; according to the related characteristic data of the soil sample to be detected and the closest subspace, sorting the related characteristics in the closest subspace, and determining a correction set from the soil data set of the closest subspace according to a sorting result; constructing a corresponding local model according to the correction set based on a partial least square method; performing prediction weight assignment on the measured soil sample according to the local model, and determining a corresponding prediction result; the prediction efficiency of the soil sample prediction method can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of soil data analysis, and in particular to a soil sample prediction method and device based on subspace local modeling. Background Art

[0002] The modeling strategy based on local samples is an effective method to improve the prediction accuracy of the model, and is particularly suitable for the correction of nonlinear systems. This strategy reduces the problem of frequent model updates due to changes in sample composition by making full use of the rich information in the existing database. Traditional factor analysis methods often require rebuilding the model when the sample composition changes, which is not only time-consuming but also inefficient. The modeling strategy based on local samples avoids these drawbacks by selecting the most similar samples from the database to build the model. In recent years, this strategy has been widely used in fields such as soil spectral quantitative analysis to solve nonlinear problems in soil composition prediction.

[0003] For example, the patent application with the publication number CN116401871A proposes a method for quickly constructing an optimal local modeling set. The method first uses the Mahalanobis distance to measure the difference between the spectrum of the soil sample to be tested and the spectrum of other samples in the database, and generates a similarity ranking result. Then, a distance matrix is ​​constructed based on these similarity data, and feature points are extracted from them. The optimal local modeling set is selected through the first feature point of the "row number-storage capacity" relationship curve, that is, the most suitable database sample group is selected to build the model, thereby improving the accuracy of the prediction effect.

[0004] However, when the data samples are particularly large, the process of selecting local samples becomes very time-consuming because each calculation requires traversing a large number of samples and sorting them, thereby increasing the time cost of predicting new samples. Summary of the invention

[0005] In response to the problems in the prior art, the present application provides a soil sample prediction method and device based on subspace local modeling, which can greatly improve the prediction efficiency of the soil sample prediction method.

[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions:

[0007] According to a first aspect of an embodiment of the present application, the present application provides a soil sample prediction method based on subspace local modeling, comprising:

[0008] Using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0009] Determine a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0010] According to the correlation characteristic data of the soil sample to be tested and the closest subspace, the correlation characteristics in the closest subspace are sorted, and a calibration set is determined from the soil data set of the closest subspace according to the sorting result;

[0011] Based on the partial least squares method, according to the local model corresponding to the calibration set component;

[0012] Based on formula (1), the prediction weight is assigned to the soil sample according to the local model, and the corresponding prediction result is determined based on formula (2):

[0013]

[0014] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0015]

[0016] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0017] According to any embodiment of the present application, determining a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested includes:

[0018] The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined:

[0019]

[0020] Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S i is the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

[0021] According to any embodiment of the present application, before using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the method further includes:

[0022] The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial;

[0023] The smoothed and differentiated spectral data were subjected to a standard normal transformation.

[0024] According to any embodiment of the present application, when the clustering is fuzzy k-means clustering, before the correlation characteristics of the soil data set are divided into multiple subspaces using the clustering method, the method further includes:

[0025] Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized:

[0026]

[0027] Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS;

[0028] The optimization range of N is 2 to 10, with an interval of 1;

[0029] The optimization range of m is 1.05 to 1.30, with an interval of 0.05.

[0030] According to a second aspect of an embodiment of the present application, the present application provides a soil sample prediction device based on subspace local modeling, comprising:

[0031] A subspace partitioning module is used to: use a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0032] A proximity judgment module, used to: determine a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0033] A set construction module is used to: sort the correlation characteristics in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determine a calibration set from the soil data set of the closest subspace according to the sorting result;

[0034] A local modeling module is used to: based on the partial least squares method, according to the local model corresponding to the calibration set component;

[0035] The result prediction module is used to: assign prediction weights to the soil samples according to the local model based on formula (1), and determine the corresponding prediction results based on formula (2):

[0036]

[0037] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0038]

[0039] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0040] According to any implementation manner of the present application, the proximity determination module is specifically used for:

[0041] The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined:

[0042]

[0043] Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S i is the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

[0044] According to any embodiment of the present application, a pre-processing module is further included, which is used to:

[0045] The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial;

[0046] The smoothed and differentiated spectral data were subjected to a standard normal transformation.

[0047] According to any embodiment of the present application, a subspace optimization module is further included, which is used to:

[0048] Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized:

[0049]

[0050] Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS;

[0051] The optimization range of N is 2 to 10, with an interval of 1;

[0052] The optimization range of m is 1.05 to 1.30, with an interval of 0.05.

[0053] According to the third aspect of the embodiment of the present application, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the soil sample prediction method based on subspace local modeling are implemented.

[0054] According to a fourth aspect of an embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the soil sample prediction method based on subspace local modeling.

[0055] According to a fifth aspect of an embodiment of the present application, the present application provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the soil sample prediction method based on subspace local modeling.

[0056] It can be seen from the above technical scheme that the present application provides a soil sample prediction method and device based on subspace local modeling, which divides the correlation characteristics of the soil data set into multiple subspaces by using a clustering method, and determines a closest subspace according to the spatial distance between the multiple subspaces and the correlation characteristics of a soil sample to be tested; sorts the correlation characteristics in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determines a correction set from the soil data set of the closest subspace according to the sorting result; based on the partial least squares method, constructs a local model corresponding to the correction set component; assigns prediction weights to the test soil sample according to the local model, and determines the corresponding prediction results, which can greatly improve the prediction efficiency of the soil sample prediction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0058] Figure 1 This is one of the flow charts of the soil sample prediction method based on subspace local modeling in the embodiment of the present application;

[0059] Figure 2 This is a second flow chart of the soil sample prediction method based on subspace local modeling in an embodiment of the present application;

[0060] Figure 3 This is an intentional illustration of the distribution of subspace samples in different data sets in the embodiments of this application;

[0061] Figure 4 Schematic diagram of the quantitative results of LOCAL (left side) and S-LOCAL (right side) in different data sets in the embodiments of the present application;

[0062] Figure 5 Schematic diagram of the quantitative results of LOCAL (left side) and S-LOCAL (right side) in different data sets in the embodiments of the present application;

[0063] Figure 6 A schematic diagram comparing the running time of the S-LOCAL and LOCAL algorithms in the embodiments of the present application;

[0064] Figure 7 It is a structural diagram of a soil sample prediction device based on subspace local modeling in an embodiment of the present application;

[0065] Figure 8It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0068] Considering that when the data sample is particularly large, each calculation requires traversing a large number of samples and sorting them, the process of selecting local samples will become very time-consuming, thereby increasing the time cost of predicting new samples. The present application provides a soil sample prediction method and device based on subspace local modeling, which greatly improves the prediction efficiency of the soil sample prediction method.

[0069] In order to greatly improve the prediction efficiency of the soil sample prediction method, the present application provides an embodiment of a soil sample prediction method based on subspace local modeling, see Figure 1 The soil sample prediction method based on subspace local modeling specifically includes the following contents:

[0070] Step S101: Use a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties.

[0071] First, the samples in the soil database can be divided into multiple subspaces according to their relevant characteristics. The relevant characteristics may include spectral characteristics, physical characteristics, chemical characteristics, etc. To achieve this, the present application uses a variety of clustering algorithms, such as fuzzy k-means clustering, hierarchical clustering, density clustering, etc.

[0072] Through the above division, soil samples in the database are classified into different subspaces according to their similarities, thereby forming multiple independent subspaces with specific characteristics. By grouping samples with similar characteristics together, this application provides a basis for subsequent modeling and prediction, reduces the complexity and redundant information of modeling, and improves model efficiency and accuracy.

[0073] Step S102: determining a closest subspace according to the spatial distances between the plurality of subspaces and the relevant characteristics of a soil sample to be tested.

[0074] In the soil sample prediction process, we first need to determine the subspace that is closest to the sample to be tested. The specific approach is to calculate the distance between the relevant characteristic data of the sample to be tested and the average characteristic data of each subspace, where the distance can be measured by methods such as Euclidean distance. According to the calculation results, the subspace with the smallest distance is selected as the nearest subspace. The core of this step is to find the sample set that is most similar to the sample to be tested, and to ensure the accuracy of the prediction by selecting a subspace with higher similarity. This method avoids the direct use of the entire database, reduces the amount of calculation, and ensures the accuracy of the prediction.

[0075] Step S103: sorting the correlation features in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determining a calibration set from the soil data set of the closest subspace according to the sorting result.

[0076] After finding the nearest subspace, the correlation coefficient between the sample to be tested and the sample in the nearest subspace is calculated, the samples are sorted by similarity and local samples are selected as the calibration set.

[0077] For example, the characteristic data of the sample to be tested and each sample in the subspace can be sorted by similarity, and the top-ranked samples can be selected as the calibration set. This calibration set will be used as training data for subsequent modeling, with the purpose of improving the model's recognition ability and adaptability to the characteristics of the sample to be tested. Through this targeted screening, data noise can be effectively reduced, and more accurate and representative samples can be provided for the model, thereby improving the accuracy of prediction.

[0078] Step S104: Based on the partial least squares method (PLS), a local model corresponding to the calibration set component is constructed.

[0079] After obtaining the calibration set, PLS is used to build a local model. PLS is a multivariate regression method that is suitable for processing data with high correlation between variables. It can compress the data into a small number of latent variables, which retain the main information of the data and are easy to use for prediction.

[0080] Based on the above method, a local model suitable for the sample to be tested can be quickly established, effectively reducing the complexity of the model and ensuring efficient calculation speed.

[0081] Step S105: assigning prediction weights to the soil samples according to the local model, and determining corresponding prediction results.

[0082] Among them, the present application is based on formula (1), assigns prediction weights to the soil samples according to the local model, and determines the corresponding prediction results based on formula (2):

[0083]

[0084] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0085]

[0086] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0087] Finally, the prediction results based on each PLS factor are weighted averaged to obtain the final prediction value. Specifically, the weight of each PLS factor is determined by the inverse of the product of the root mean square (RMS) of its spectral residual and the root mean square of the regression coefficient. Factors with smaller residuals and more stable regression coefficients are given higher weights to ensure more reliable prediction results. The final prediction value It is the weighted sum of the prediction results of each factor, which can integrate the information of different factors and improve the accuracy and robustness of the prediction.

[0088] It can be seen from the above description that the soil sample prediction method based on subspace local modeling provided in the embodiment of the present application can greatly improve the prediction efficiency of the soil sample prediction method.

[0089] In one embodiment of the soil sample prediction method based on subspace local modeling of the present application, a closest subspace is determined according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested, including:

[0090] The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined:

[0091]

[0092] Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S iis the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and X Si,j are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

[0093] Wherein, the database sample space is divided into multiple subspaces: S1, S2, ..., S N After that, the Euclidean distance formula (3) can be used to calculate the distance from the sample to be tested to each subspace, and the nearest neighbor subspace of the sample can be found. It can be understood that the distance evaluation method that can be used in this application includes but is not limited to the Euclidean distance.

[0094] In summary, if Figure 2 As shown, the present application is divided into multiple subspaces according to certain correlations (such as spectral similarity) in the subspace local modeling framework. For a soil sample to be tested, first find its nearest subspace. Then, a local modeling strategy is adopted in the nearest neighbor subspace to establish a correction model and predict the sample. According to different division methods, subspaces of different database samples can be obtained, and then, in this nearest neighbor subspace, a local model is constructed to predict the unknown sample and finally generate a prediction result.

[0095] In one embodiment of the soil sample prediction method based on subspace local modeling of the present application, before using the clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, it also includes:

[0096] The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial;

[0097] The smoothed and differentiated spectral data were subjected to a standard normal transformation.

[0098] In order to verify the effectiveness of the prediction method provided by this application, this application uses 6 different infrared soil spectral data sets (Table 1) to verify the effectiveness of the proposed new algorithm.

[0099] Table 1

[0100]

[0101] For all spectral datasets, spectral preprocessing was performed using the Savitzky–Golay first-order derivative (window size 1, second-order polynomial) combined with a standard normal transformation to reduce the effects of baseline variations and soil particle size and surface scattering.

[0102] In an optional embodiment, after assigning prediction weights to the soil samples according to the local model based on formula (1) and determining corresponding prediction results based on formula (2), the method further includes:

[0103] According to the prediction time of the soil sample to be tested, the accuracy of the prediction result RPD, the average error of the prediction result RMSEP and the explanatory power R 2 Evaluate the prediction results. In practical applications, especially in large-scale data sets or real-time prediction scenarios, the length of the prediction time is very important. Therefore, by measuring the prediction time of the model, we can intuitively understand the speed performance of the method in practical applications.

[0104] In an optional embodiment, when the clustering is fuzzy k-means clustering, before the correlation characteristics of the soil data set are divided into a plurality of subspaces using the clustering method, the method further includes:

[0105] Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized:

[0106]

[0107] Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS;

[0108] The optimization range of N is 2 to 10, with an interval of 1;

[0109] The optimization range of m is 1.05 to 1.30, with an interval of 0.05.

[0110] For each data set, 75% of the data is divided into a training set (database sample) using the concentration gradient method, and the rest of the data is a validation set. The training set is used to construct the subspace, and the validation set is used to verify the effectiveness of each algorithm.

[0111] The fuzzy clustering algorithm is used to construct the subspace of the database samples. The MRMSECV (Mean of root mean square error of cross validation) value shown in Formula 4 is used to optimize the parameters of the fuzzy clustering algorithm: the number of clusters N and the fuzziness index m.

[0112] In order to further illustrate the effect of this solution, this application also provides the corresponding algorithm verification results, which specifically include the following contents:

[0113] Figure 3The distribution of each sample in the optimal sample subspace is shown, which is obtained by performing PCA compression on each data and taking the first two principal components. (a) SOC-MIR, (b) SOC-NIR, (c) TN-NIR, (d) Clay-NIR, (e) pH(CaCI2)-NIR, (f) CEC-NIR data sets. From the figure, it can be seen that the obtained subspace basically meets the characteristics of the subspace samples mentioned above, namely 1) the number of samples is appropriate so that unknown samples can be better predicted; 2) the samples in the subspace are relatively similar, 3) the differences between different subspaces are large, and there is less redundant information between each subspace.

[0114] Figure 4 The quantitative results of the existing LOCAL (local modeling) and the S-LOCAL (subspace local modeling) of this application on the SOC-MIR, SOC-NIR and TN-NIR datasets are shown.

[0115] Figure 5 The quantitative results of LOCAL and S-LOCAL on the Clay-NIR, pH-NIR and CEC-NIR datasets are shown.

[0116] The quantitative results of LOCAL and S-LOCAL were tested for differences. The results showed that there was no significant difference between the quantitative results of S-LOCAL and LOCAL: RPD (paired t test: p = 0.07), RMSEP (paired t test: p = 0.28), R 2 (Paired t-test: p=0.11).

[0117] Figure 6 The running time of S-LOCAL and LOCAL algorithms is shown. From the figure, we can see that the running time of S-LOCAL is much shorter than that of LOCAL algorithm. On SOC-MIR, SOC-NIR, TN-NIR, Clay-NIR, pH-NIR and CEC-NIR datasets, the running time of S-LOCAL is 94%, 69%, 41%, 69%, 69% and 46% shorter than that of LOCAL respectively.

[0118] The above results show that the quantitative accuracy of the subspace local modeling method is not significantly different from the model accuracy of the local modeling method, but the prediction time is significantly reduced by about 60%, which greatly improves the prediction efficiency of unknown samples.

[0119] In order to greatly improve the prediction efficiency of the soil sample prediction method, the present application provides an embodiment of a soil sample prediction device based on subspace local modeling for implementing all or part of the content of the soil sample prediction method based on subspace local modeling, see Figure 7 The soil sample prediction device based on subspace local modeling specifically includes the following contents:

[0120] The subspace partitioning module 1101 is used to: use a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0121] The proximity judgment module 1102 is used to: determine a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0122] The set construction module 1103 is used to: sort the correlation characteristics in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determine a calibration set from the soil data set of the closest subspace according to the sorting result;

[0123] A local modeling module 1104 is used to: generate a local model corresponding to the calibration set component based on a partial least squares method;

[0124] The result prediction module 1105 is used to: assign prediction weights to the soil samples according to the local model based on formula (1), and determine the corresponding prediction results based on formula (2):

[0125]

[0126] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0127]

[0128] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0129] According to any implementation manner of the present application, the proximity determination module is specifically used for:

[0130] The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined:

[0131]

[0132] Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S i is the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

[0133] According to any embodiment of the present application, a pre-processing module is further included, which is used to:

[0134] The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial;

[0135] The smoothed and differentiated spectral data were subjected to a standard normal transformation.

[0136] According to any embodiment of the present application, a verification module is further included, which is used to:

[0137] According to the prediction time of the soil sample to be tested, the accuracy of the prediction result RPD, the average error of the prediction result RMSEP and the explanatory power R 2 The prediction results are evaluated.

[0138] According to any embodiment of the present application, a subspace optimization module is further included, which is used to:

[0139] Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized:

[0140]

[0141] Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS;

[0142] The optimization range of N is 2 to 10, with an interval of 1;

[0143] The optimization range of m is 1.05 to 1.30, with an interval of 0.05.

[0144] It can be seen from the above description that the soil sample prediction device based on subspace local modeling provided in the embodiment of the present application can greatly improve the prediction efficiency of the soil sample prediction method.

[0145] From the hardware level, in order to greatly improve the prediction efficiency of the soil sample prediction method, the present application provides an embodiment of an electronic device for implementing all or part of the content of the soil sample prediction method based on subspace local modeling, and the electronic device specifically includes the following content:

[0146] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the soil sample prediction device based on subspace local modeling and related equipment such as core business system, user terminal and related database; the logic controller can be a desktop computer, tablet computer and mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the soil sample prediction method based on subspace local modeling and the embodiment of the soil sample prediction device based on subspace local modeling in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0147] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0148] In practical applications, part of the soil sample prediction method based on subspace local modeling can be executed on the electronic device side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0149] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0150] Figure 8 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 8 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 8 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0151] In one embodiment, the soil sample prediction method based on subspace local modeling can be integrated into the central processor 9100. The central processor 9100 can be configured to perform the following control:

[0152] Step S101: using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0153] Step S102: determining a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0154] Step S103: sorting the correlation features in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determining a calibration set from the soil data set of the closest subspace according to the sorting result;

[0155] Step S104: Based on the partial least squares method, according to the local model corresponding to the calibration set component;

[0156] Step S105: Based on formula (1), the prediction weight is assigned to the soil sample according to the local model, and the corresponding prediction result is determined based on formula (2):

[0157]

[0158] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0159]

[0160] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0161] It can be seen from the above description that the electronic device provided in the embodiment of the present application greatly improves the prediction efficiency of the soil sample prediction method.

[0162] In another embodiment, the soil sample prediction device based on subspace local modeling can be configured separately from the central processing unit 9100. For example, the soil sample prediction device based on subspace local modeling can be configured as a chip connected to the central processing unit 9100, and the function of the soil sample prediction method based on subspace local modeling can be realized through the control of the central processing unit.

[0163] like Figure 8 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 8 In addition, the electronic device 9600 may also include Figure 8 For components not shown, reference may be made to the prior art.

[0164] like Figure 8 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0165] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0166] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0167] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0168] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0169] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0170] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0171] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the soil sample prediction method based on subspace local modeling in the above-mentioned embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the soil sample prediction method based on subspace local modeling in the above-mentioned embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0172] Step S101: using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0173] Step S102: determining a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0174] Step S103: sorting the correlation features in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determining a calibration set from the soil data set of the closest subspace according to the sorting result;

[0175] Step S104: Based on the partial least squares method, according to the local model corresponding to the calibration set component;

[0176] Step S105: Based on formula (1), the prediction weight is assigned to the soil sample according to the local model, and the corresponding prediction result is determined based on formula (2):

[0177]

[0178] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0179]

[0180] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0181] It can be seen from the above description that the computer-readable storage medium provided in the embodiment of the present application greatly improves the prediction efficiency of the soil sample prediction method.

[0182] The embodiments of the present application also provide a computer program product capable of implementing all the steps of the soil sample prediction method based on subspace local modeling in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the soil sample prediction method based on subspace local modeling are implemented. For example, the computer program / instruction implements the following steps:

[0183] Step S101: using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties;

[0184] Step S102: determining a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested;

[0185] Step S103: sorting the correlation features in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determining a calibration set from the soil data set of the closest subspace according to the sorting result;

[0186] Step S104: Based on the partial least squares method, according to the local model corresponding to the calibration set component;

[0187] Step S105: Based on formula (1), the prediction weight is assigned to the soil sample according to the local model, and the corresponding prediction result is determined based on formula (2):

[0188]

[0189] Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor;

[0190]

[0191] in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

[0192] It can be seen from the above description that the computer program product provided in the embodiments of the present application greatly improves the prediction efficiency of the soil sample prediction method.

[0193] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0194] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0197] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A soil sample prediction method based on subspace local modeling, characterized in that: The method comprises: Using a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties; Determine a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested; According to the correlation characteristic data of the soil sample to be tested and the closest subspace, the correlation characteristics in the closest subspace are sorted, and a calibration set is determined from the soil data set of the closest subspace according to the sorting result; Based on the partial least squares method, according to the local model corresponding to the calibration set component; Based on formula (1), the prediction weight is assigned to the soil sample according to the local model, and the corresponding prediction result is determined based on formula (2): Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor; in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

2. The soil sample prediction method based on subspace local modeling according to claim 1 is characterized in that: Determining a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested includes: The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined: Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S i is the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

3. The soil sample prediction method based on subspace local modeling according to claim 1 is characterized in that: Before using clustering method to divide the correlation characteristics of soil dataset into multiple subspaces, it also includes: The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial; The smoothed and differentiated spectral data were subjected to a standard normal transformation.

4. The soil sample prediction method based on subspace local modeling according to claim 1 is characterized in that: In the case where the clustering is fuzzy k-means clustering, before the correlation characteristics of the soil data set are divided into a plurality of subspaces using the clustering method, the method further includes: Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized: Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS; The optimization range of N is 2 to 10, with an interval of 1; The optimization range of m is 1.05 to 1.30, with an interval of 0.

05.

5. A soil sample prediction device based on subspace local modeling, characterized in that: The device comprises: A subspace partitioning module is used to: use a clustering method to divide the correlation characteristics of the soil data set into multiple subspaces, the clustering method includes fuzzy k-means clustering, hierarchical clustering, density clustering, principal component clustering and Gaussian mixture model clustering, and the correlation characteristics of the soil data set include spectral characteristics, physical properties and chemical properties; A proximity judgment module, used to: determine a closest subspace according to the spatial distances between the multiple subspaces and the relevant characteristics of a soil sample to be tested; A set construction module is used to: sort the correlation characteristics in the closest subspace according to the correlation characteristic data of the soil sample to be tested and the closest subspace, and determine a calibration set from the soil data set of the closest subspace according to the sorting result; A local modeling module is used to: based on the partial least squares method, according to the local model corresponding to the calibration set component; The result prediction module is used to: assign prediction weights to the soil samples according to the local model based on formula (1), and determine the corresponding prediction results based on formula (2): Where j (1≤j≤LV) is the number of PLS ​​factors, W j is the weight of the jth PLS factor; RMS (residual j ) is the root mean square of the spectral residual under the jth PLS factor; RMS(beta j ) is the root mean square of the model regression coefficient under the jth PLS factor; in, is the prediction result, w j is the weight of the jth PLS factor, is the predicted value under the jth PLS factor.

6. The soil sample prediction device based on subspace local modeling according to claim 5, characterized in that: The proximity judgment module is specifically used for: The Euclidean distance formula (3) is used to determine the distances from the relevant characteristics of the soil sample to be tested to each of the multiple subspaces, and a closest subspace is determined: Where D is the distance from the relevant characteristic data of the soil sample to be tested to the subspace, X un is the correlation characteristic data of the sample to be tested, S i is the i-th subspace, is the average correlation feature data of the i-th subspace, k is the number of variables of the correlation feature, X un,j and are the relevant characteristics X of the soil samples to be tested un and subspace S i The value of the j-th feature dimension.

7. The soil sample prediction device based on subspace local modeling according to claim 5, characterized in that: Also includes preprocessing modules for: The soil data set is smoothed and differentiated using Savitzky-Golay first-order derivatives with a window size of 1 and a second-order polynomial; The smoothed and differentiated spectral data were subjected to a standard normal transformation.

8. The soil sample prediction device based on subspace local modeling according to claim 5, characterized in that: Also includes a subspace optimization module for: Based on formula (4), the number of clusters N and the fuzziness index m of the fuzzy k-means clustering are optimized: Among them, MRMSECV is the mean of the cross-validation root mean square error, is the interactive validation standard deviation of the ith cluster space, obtained using 5-fold cross validation of PLS; The optimization range of N is 2 to 10, with an interval of 1; The optimization range of m is 1.05 to 1.30, with an interval of 0.

05.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the soil sample prediction method based on subspace local modeling according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the soil sample prediction method based on subspace local modeling according to any one of claims 1 to 4 are implemented.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the soil sample prediction method based on subspace local modeling according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Rapid construction method for optimal local modeling set

    CN116401871A