Farmland water content inversion method, system and equipment based on hyperspectral image and medium

By combining unsupervised ground cover classification and mRMR feature selection with machine learning models, the problems of high-dimensional data processing and interference from non-target ground covers in the soil moisture content inversion of hyperspectral images were solved, achieving efficient and accurate soil moisture content prediction and spatial inversion.

CN121577561APending Publication Date: 2026-02-27SHANDONG PROVINCIAL CLIMATE CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511779004.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing methods for analyzing soil moisture content using hyperspectral images suffer from problems such as heavy high-dimensional data processing burden, susceptibility to interference from non-target ground features, and unsatisfactory feature selection, which affect the accuracy of the inversion results and the generalization ability of the model.

Method used

Unsupervised land cover classification combined with mRMR method is used for feature selection. Soil moisture content inversion model is constructed using machine learning model. Farmland areas are identified by unsupervised clustering algorithm. The mRMR method is used to select the most relevant and low redundancy features from multiple vegetation indices. Soil moisture content is predicted by combining principal component analysis and machine learning regression algorithm.

Benefits of technology

It achieves efficient and accurate soil moisture content inversion, significantly improves the spatial accuracy and regional specificity of the inversion results, reduces the computational burden, and enhances the model's generalization ability and interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121577561A_ABST
    Figure CN121577561A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of farmland water content prediction, in particular to a farmland water content inversion method, system and device based on a hyperspectral image and a medium, and the method comprises the steps: setting a plurality of farmland sampling points in a target area, obtaining the hyperspectral image of the target area, and synchronously measuring the measured value of the soil water content of each farmland sampling point; spectral information of each pixel point in the hyperspectral image is extracted, dimensionality reduction is carried out after preprocessing, and then all farmland pixel points are identified by using an unsupervised clustering algorithm; calculating various vegetation indexes of each farmland sampling point, and performing feature screening by using an mRMR method to obtain evaluation features; constructing and training a soil water content inversion model based on a machine learning regression algorithm; and calculating evaluation characteristics of each farmland pixel point, inputting the evaluation characteristics into the soil water content inversion model, and generating a soil water content prediction value of each farmland pixel point. According to the invention, accurate and efficient inversion of the soil water content can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of farmland moisture content prediction technology, specifically to a method, system, equipment, and medium for farmland moisture content inversion based on hyperspectral images. Background Technology

[0002] Soil moisture content is a key parameter in agricultural production, water resource management, and environmental monitoring, and it is of great significance for crop growth, irrigation decisions, and disaster early warning. Traditional methods for obtaining soil moisture content mainly rely on field sampling and point measurement methods, such as the oven-drying method and the time-domain reflectometry method. These methods have high accuracy but low efficiency and high cost, making it difficult to meet the needs of large-scale, dynamic monitoring.

[0003] With the development of remote sensing technology, especially the application of hyperspectral remote sensing technology, new technical approaches have been provided for the spatial inversion of soil moisture content. Hyperspectral imagery can provide continuous and detailed spectral information. By analyzing the spectral response of soil in specific bands (such as near-infrared to short-wave infrared), a quantitative relationship between soil moisture content and water content can be established. Existing research has attempted to use hyperspectral data combined with vegetation indices or statistical models to estimate soil moisture content. Some methods have also introduced machine learning algorithms for regression analysis to improve inversion accuracy and automation.

[0004] However, existing methods for analyzing soil moisture content using hyperspectral images still have shortcomings: on the one hand, hyperspectral data has high dimensionality and large information redundancy, which leads to heavy computational burden and low model efficiency when directly used for modeling, and is easily affected by spectral interference from non-target features (such as roads and buildings), affecting the accuracy of the inversion results; on the other hand, existing methods rely heavily on manual experience or simple correlation analysis for feature selection, failing to systematically screen features that are highly correlated with moisture content, thus limiting the generalization ability and interpretability of the model. Summary of the Invention

[0005] To address the technical problems of existing methods for analyzing soil moisture content using hyperspectral images, such as high dimensionality, susceptibility to interference from non-target features, and unsatisfactory feature selection when processing hyperspectral data, this application provides a method, system, device, and medium for farmland moisture content inversion based on hyperspectral images. By focusing on farmland areas through unsupervised feature classification, using mRMR for efficient feature selection, and constructing mapping relationships based on machine learning models, accurate and efficient soil moisture content inversion is achieved.

[0006] In a first aspect, this application provides a method for inverting farmland moisture content based on hyperspectral imagery, comprising the following steps: S1. Set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point; S2. Extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information; S3. Dimensionality reduction is performed on the denoised spectral information, and then an unsupervised clustering algorithm is used to classify the land cover information of all pixels and identify all farmland pixels. S4. Calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and measured soil moisture content of each farmland sampling point, use the mRMR (minimum redundancy maximum correlation) method to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. S5. Construct a soil moisture content inversion model based on machine learning regression algorithm. The input of the soil moisture content inversion model is the evaluation features of farmland pixels, and the output is the predicted soil moisture content of the farmland pixels. The soil moisture content inversion model was trained using the assessment features of farmland sampling points, and the mapping relationship between assessment features and soil moisture content was constructed. S6. After calculating the evaluation features of each farmland pixel, input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

[0007] It should be further explained that in step S1, the rule for setting farmland sampling points is as follows: the target area is divided into a corresponding number of equal-area grids according to the preset number of farmland sampling points, and one farmland sampling point is randomly selected from each grid. If a grid does not contain farmland, then an additional farmland sampling point is randomly selected from the nearest grid containing farmland.

[0008] It should be further noted that in step S1, the measured soil moisture content is determined using the oven-drying method, specifically including: Uncirculated soil samples were collected from sampling points in farmland, and the fresh weight of the soil samples was weighed. The original soil sample was dried to constant weight at a drying temperature of 105℃, and the dry weight of the soil sample was weighed. Calculate the measured soil moisture content at the sampling point in this farmland: .

[0009] It should be further noted that in step S2, the preprocessing includes radiometric calibration, atmospheric correction, and noise reduction.

[0010] It should be further noted that in step S3, principal component analysis is used for dimensionality reduction.

[0011] It should be further noted that in step S3, the Minibatch K-Means clustering algorithm is used to classify the spectral information of all pixels for land cover classification, specifically including: Randomly initialize k cluster centers, randomly select a small batch of samples from the dataset consisting of the spectral information of all pixels, calculate the distance of the samples to each cluster center and assign them to the nearest cluster, update the cluster center positions according to the assignment results of the small batch of samples, and repeat the iteration until the cluster centers converge.

[0012] It should be further noted that in step S4, the vegetation indices include normalized difference vegetation index, converted difference vegetation index, vegetation near-infrared reflectance, water stress index, modified green-red vegetation index, infrared percentage vegetation index, dual-band enhanced vegetation index, difference vegetation index, chlorophyll index-green light, charcoal soil index, burn area index, and anthocyanin reflectance index.

[0013] It should be further explained that the specific steps for feature selection using the mRMR (minimum redundancy maximum relevance) method in step S4 include: S401. Based on the vegetation index data and measured soil moisture content of all farmland sampling points, calculate the mutual information between each vegetation index and the measured soil moisture content as a correlation measure; S402. Based on the vegetation index data of all farmland sampling points, calculate the mutual information between every two vegetation indices as a measure of redundancy; S403. Construct the optimal feature subset, initially an empty set; S404. Among the vegetation indices not selected for the optimal feature subset, select the vegetation index that maximizes the objective function value and add it to the optimal feature subset. The objective function is:

[0014] in, This represents the th vegetation index that was not selected into the optimal feature subset. Individual vegetation indices; Represents the th element in the current optimal feature subset. Individual vegetation indices; This represents the measured value of soil moisture content; This represents the current optimal feature subset; This represents the set of vegetation indices that have not yet been selected into the optimal feature subset; Indicating vegetation index Compared with measured soil moisture content Mutual information between them; Indicating vegetation index With vegetation index Mutual information between them; Represents the current optimal feature subset The number of vegetation indices; Indicating vegetation index With the current optimal feature subset The average mutual information among all vegetation indices determines the current optimal feature subset. When it is an empty set, =0; S405. Determine whether the number of vegetation indices in the optimal feature subset is equal to n. If not, return to step S404; if yes, output the vegetation indices in the current optimal feature subset as evaluation features.

[0015] It should be further noted that in step S5, a soil moisture content inversion model is constructed based on one of the following machine learning regression algorithms: The algorithms include Linear Regression, K-Nearest Neighbors Regressor, Support Vector Regression (SVR), Ridge Regression, Multilayer Perceptron Regressor (MLP), Decision Tree, Extra Tree, Extreme Gradient Boosting (XGBoost), Random Forest, AdaBoost, Gradient Boost, and Bagging.

[0016] It should be further noted that in step S5, a soil moisture content inversion model is constructed based on the ridge regression algorithm.

[0017] It should be further noted that the training steps for the soil moisture content inversion model in step S5 include: S501. Take the denoised spectral information of the pixel corresponding to a farmland sampling point as a sample, and summarize all samples into a sample dataset; S502. Divide the sample dataset into a training set and a test set; S503. Input the training set into the soil moisture content inversion model for training. During the training process, use the cross-optimization method to optimize the hyperparameters of the model to prevent overfitting. S504. Use the test set to evaluate the model performance. Once the evaluation is successful, the trained soil moisture content inversion model is obtained.

[0018] It should be further noted that step S7 is also included: generating a spatial distribution map of the soil moisture content of the target area based on the predicted soil moisture content of each farmland pixel.

[0019] It should be further noted that the generated spatial distribution map of soil moisture content is as follows: Create a blank raster layer with the same geographic extent, projection, and spatial resolution as the hyperspectral imagery. Each cell of this blank raster layer is used to store a predicted soil moisture content value. The predicted soil moisture content of each farmland pixel is assigned to the corresponding pixel in the blank raster layer according to its spatial coordinates, thus obtaining the assigned raster layer. Define a color map for the assigned raster layer. The color map is used to map consecutive soil moisture values ​​to a preset color gradient sequence. The color mapping table is used to render the assigned raster layer to generate a spatial distribution map of soil moisture content.

[0020] Secondly, this application provides a farmland moisture content inversion system based on hyperspectral imagery, used to implement the aforementioned farmland moisture content inversion method, including: The data acquisition module is used to set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point. The preprocessing module is used to extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information. The land cover classification module is used to reduce the dimensionality of the denoised spectral information, and then use an unsupervised clustering algorithm to classify the land cover information of all pixels and identify all farmland pixels. The evaluation feature selection module is used to calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and the measured soil moisture content of each farmland sampling point, the mRMR method is used to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. The soil moisture content inversion model module is used to construct a soil moisture content inversion model based on machine learning regression algorithm, and to train the soil moisture content inversion model using the evaluation features of farmland sampling points, and to construct the mapping relationship between evaluation features and soil moisture content. The soil moisture content prediction module is used to calculate the evaluation features of each farmland pixel and input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

[0021] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for retrieving farmland moisture content.

[0022] Fourthly, this application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for retrieving farmland moisture content.

[0023] As can be seen from the above technical solutions, this application has the following advantages: 1. This application uses an unsupervised clustering algorithm to classify land features in hyperspectral images, which can automatically and accurately identify farmland pixels and effectively eliminate spectral interference from non-farmland features such as roads and buildings, thereby significantly improving the spatial accuracy and regional specificity of subsequent soil moisture content inversion results.

[0024] 2. This application uses the mRMR (minimum redundancy maximum correlation) method for feature selection, which can automatically select the top n evaluation features with the highest correlation to soil moisture content and the lowest redundancy from multiple vegetation indices. This effectively reduces data dimensionality, avoids information redundancy, improves the quality and interpretability of model input features, and thus improves the efficiency and generalization ability of the inversion model.

[0025] 3. This application constructs a soil moisture content inversion model based on machine learning regression algorithm, which can adaptively learn the complex nonlinear mapping relationship between the selected evaluation features and soil moisture content, overcoming the limitations of traditional linear models, thereby realizing rapid and accurate prediction and spatial inversion of soil moisture content in farmland areas. Attached Figure Description

[0026] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of a method for inverting farmland moisture content based on hyperspectral images in one embodiment of this application.

[0028] Figure 2 This is a schematic diagram of the land feature classification results in one embodiment of this application.

[0029] Figure 3 This is a spatial distribution map of the water content in the target area in one embodiment of this application.

[0030] Figure 4 This is a schematic block diagram of a farmland moisture content inversion system based on hyperspectral images in one embodiment of this application.

[0031] Figure 5 This is a schematic diagram of the hardware structure of an electronic device in one embodiment of this application. Detailed Implementation

[0032] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] The method for inverting farmland moisture content according to this application will be described in detail below. Specific details, such as particular system structures and techniques, are presented for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details.

[0034] In the farmland moisture content inversion method involved in this application, the term "comprising" indicates the presence of the described feature, whole, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or sets thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0035] To facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.

[0036] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0037] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0038] The farmland moisture content inversion method provided in this application embodiment is executed by computer equipment, and correspondingly, the farmland moisture content inversion system based on hyperspectral images runs in the computer equipment.

[0039] Figure 1 This is a flowchart of a method for retrieving farmland moisture content based on hyperspectral imagery, according to an embodiment of this application. Figure 1 The implementing entity can be a farmland moisture content inversion system. Depending on different needs, the order of the steps in this flowchart can be changed, and some can be omitted.

[0040] like Figure 1 As shown, the method for retrieving farmland moisture content based on hyperspectral imagery includes: Step S1: Set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point.

[0041] By setting up multiple farmland sampling points in the target area and simultaneously acquiring hyperspectral images and measuring actual soil moisture content, a data foundation with accurate geographic correspondence and real moisture content labels was provided for model construction, ensuring the sample quality and spatial representativeness required for inversion model training.

[0042] In some specific embodiments, the rule for setting farmland sampling points is as follows: the target area is divided into a corresponding number of equal-area grids according to the preset number of farmland sampling points, and a farmland sampling point is randomly selected from each grid; If a grid does not contain farmland, then an additional farmland sampling point is randomly selected from the nearest grid containing farmland.

[0043] By dividing the target area into equal-area grids according to a preset number and randomly sampling, and by using a nearest neighbor substitution strategy in the grids without farmland, the uniformity and representativeness of the sampling points in spatial distribution are ensured, which effectively improves the ability of the measured data to represent the overall condition of the area and reduces sampling bias.

[0044] In some specific embodiments, the soil moisture content is measured using the oven-drying method, specifically including: Uncirculated soil samples were collected from sampling points in farmland, and the fresh weight of the soil samples was weighed. The original soil sample was dried to constant weight at a drying temperature of 105℃, and the dry weight of the soil sample was weighed. Calculate the measured soil moisture content at the sampling point in this farmland: .

[0045] By adopting the standard procedure of collecting undisturbed soil samples, weighing fresh soil, drying at 105℃ to constant weight, weighing dry soil, and calculating soil moisture content, the accuracy and reliability of the obtained measured soil moisture content values ​​are ensured, providing high-precision label data for model training.

[0046] Step S2: Extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information.

[0047] By extracting the spectral information of each pixel in the hyperspectral image and preprocessing it to obtain denoised spectral information, the influence of various factors on the spectral data is effectively eliminated, providing high-quality and reliable spectral input data for subsequent land cover classification and feature calculation.

[0048] In some specific embodiments, preprocessing includes radiometric calibration, atmospheric correction, and noise reduction.

[0049] By defining preprocessing specifically as including radiometric calibration, atmospheric correction, and denoising, various errors introduced from the acquisition of raw signals from sensors to the generation of surface reflectance are systematically eliminated, ensuring the accuracy and consistency of the physical meaning of the spectral information upon which subsequent analysis is based.

[0050] Step S3: Dimensionality reduction is performed on the denoised spectral information, and then an unsupervised clustering algorithm is used to classify the spectral information of all pixels into land features and identify all farmland pixels.

[0051] By performing dimensionality reduction on the denoised spectral information and using an unsupervised clustering algorithm to classify all pixels as land cover, it is possible to automatically and accurately identify all farmland pixels in complex scenes, effectively focus on the target analysis area and eliminate spectral interference from non-farmland features, significantly reducing the dimensionality complexity and computational burden of hyperspectral data.

[0052] In some specific embodiments, principal component analysis is used for dimensionality reduction.

[0053] By using principal component analysis to reduce the dimensionality of denoised spectral information, the original high-dimensional spectral data can be transformed into a small number of uncorrelated principal components. This significantly reduces the data dimensionality while preserving the effective spectral information to the maximum extent, thereby improving the computational efficiency of subsequent cluster analysis.

[0054] In some specific embodiments, the Minibatch K-Means clustering algorithm is used to classify land cover information based on the spectral information of all pixels, specifically including: Randomly initialize k cluster centers, randomly select a small batch of samples from the dataset consisting of the spectral information of all pixels, calculate the distance of the samples to each cluster center and assign them to the nearest cluster, update the cluster center positions according to the assignment results of the small batch of samples, and repeat the iteration until the cluster centers converge.

[0055] By using the Minibatch K-Means clustering algorithm, k cluster centers are randomly initialized and then the center positions are iteratively updated using mini-batch samples until convergence. This can significantly improve the processing speed of large-scale hyperspectral image data while ensuring the accuracy of land cover classification, and is suitable for large-scale farmland identification tasks.

[0056] Step S4: Calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and measured soil moisture content of each farmland sampling point, use the mRMR (minimum redundancy maximum correlation) method to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features.

[0057] Multiple vegetation indices are calculated based on the denoised spectral information of the corresponding pixels of farmland sampling points. The mRMR method is used to select the top n vegetation indices with the greatest influence as evaluation features based on the vegetation indices and measured values. This method can automatically select the optimal feature subset that is most relevant to soil moisture content and has the lowest redundancy from a large number of potential features, providing efficient and information-rich input for model construction.

[0058] In some specific embodiments, vegetation indices include normalized difference vegetation index, converted difference vegetation index, vegetation near-infrared reflectance, water stress index, modified green-red vegetation index, infrared percentage vegetation index, dual-band enhanced vegetation index, difference vegetation index, chlorophyll index-green light, charcoal soil index, burn area index, and anthocyanin reflectance index.

[0059] By defining vegetation indices specifically as twelve classic indices including normalized difference vegetation index, conversion difference vegetation index, and water stress index, a candidate feature pool covering the response characteristics of different vegetation physiological and biochemical parameters was constructed, providing a rich and diverse foundation for subsequent screening of features most related to soil moisture content.

[0060] In some specific embodiments, the specific steps for feature selection using the mRMR (minimum redundancy maximum relevance) method include: S401. Based on the vegetation index data and measured soil moisture content of all farmland sampling points, calculate the mutual information between each vegetation index and the measured soil moisture content as a correlation measure; S402. Based on the vegetation index data of all farmland sampling points, calculate the mutual information between every two vegetation indices as a measure of redundancy; S403. Construct the optimal feature subset, initially an empty set; S404. Among the vegetation indices not selected for the optimal feature subset, select the vegetation index that maximizes the objective function value and add it to the optimal feature subset. The objective function is:

[0061] in, This represents the th vegetation index that was not selected into the optimal feature subset. Individual vegetation indices; Represents the th element in the current optimal feature subset. Individual vegetation indices; This represents the measured value of soil moisture content; This represents the current optimal feature subset; This represents the set of vegetation indices that have not yet been selected into the optimal feature subset; Indicating vegetation index Compared with measured soil moisture content Mutual information between them; Indicating vegetation index With vegetation index Mutual information between them; Represents the current optimal feature subset The number of vegetation indices; Indicating vegetation index With the current optimal feature subset The average mutual information among all vegetation indices determines the current optimal feature subset. When it is an empty set, =0; S405. Determine whether the number of vegetation indices in the optimal feature subset is equal to n. If not, return to step S404; if yes, output the vegetation indices in the current optimal feature subset as evaluation features.

[0062] By specifying the steps for mRMR feature selection in detail, including calculating the mutual information between vegetation indices and water content as correlation, the mutual information between vegetation indices as redundancy, and iteratively optimizing the objective function to construct the optimal feature subset, the final selected top n vegetation indices are ensured to have both high correlation and low redundancy, thus optimizing the quality of the model input features.

[0063] Step S5: Construct a soil moisture content inversion model based on machine learning regression algorithm. The input of the soil moisture content inversion model is the evaluation features of farmland pixels, and the output is the predicted soil moisture content of the farmland pixels. The soil moisture content inversion model was trained using the assessment features of farmland sampling points, and the mapping relationship between assessment features and soil moisture content was constructed.

[0064] An inversion model is constructed based on machine learning regression algorithms, taking evaluation features as input and predicted soil moisture content as output. The model is trained using sample point data to build a mapping relationship, which can adaptively learn the complex nonlinear relationship between evaluation features and soil moisture content, forming an intelligent inversion tool with strong generalization ability and high prediction accuracy.

[0065] In some specific embodiments, a soil moisture content inversion model is constructed based on one of the following machine learning regression algorithms: The algorithms include Linear Regression, K-Nearest Neighbors Regressor, Support Vector Regression (SVR), Ridge Regression, Multilayer Perceptron Regressor (MLP), Decision Tree, Extra Tree, Extreme Gradient Boosting (XGBoost), Random Forest, AdaBoost, Gradient Boost, and Bagging.

[0066] By listing various machine learning regression algorithms such as linear regression, K-nearest neighbor regression, support vector regression, and ridge regression as the basis for optional model construction, this method provides the possibility of flexibly selecting the most suitable algorithm based on specific data characteristics and accuracy requirements, thereby enhancing the adaptability and robustness of the inversion method.

[0067] In some specific embodiments, a soil moisture content inversion model is constructed based on the ridge regression algorithm.

[0068] By specifying a soil moisture content inversion model based on the ridge regression algorithm, the multicollinearity problem that may exist between high-dimensional features can be effectively handled, and overfitting can be prevented by L2 regularization, thereby obtaining a stable prediction model with strong generalization ability.

[0069] In some specific embodiments, the training steps of the soil moisture content inversion model include: S501. Take the denoised spectral information of the pixel corresponding to a farmland sampling point as a sample, and summarize all samples into a sample dataset; S502. Divide the sample dataset into a training set and a test set; S503. Input the training set into the soil moisture content inversion model for training. During the training process, use the cross-optimization method to optimize the hyperparameters of the model to prevent overfitting. S504. Use the test set to evaluate the model performance. Once the evaluation is successful, the trained soil moisture content inversion model is obtained.

[0070] By specifying the model training steps, including constructing a sample dataset, dividing the training and test sets, optimizing hyperparameters using cross-optimization methods to prevent overfitting, and evaluating performance using the test set, the final soil moisture content inversion model is ensured to have proven reliability and generalization ability.

[0071] Step S6: After calculating the evaluation features of each farmland pixel, input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

[0072] By calculating the evaluation features of each farmland pixel and inputting them into the pre-trained soil moisture content inversion model, the predicted soil moisture content value corresponding to each farmland pixel in the study area can be generated quickly and in batches. This realizes the upgrade from point measurement to area spatial distribution and provides a feasible solution for large-scale farmland moisture content monitoring.

[0073] In some specific embodiments, step S7 is also included: generating a spatial distribution map of the water content of the target area based on the predicted soil moisture content of each farmland pixel.

[0074] By adding a step to generate a spatial distribution map of soil moisture content in the target area based on the predicted soil moisture content of each farmland pixel, the point-like prediction results are transformed into an intuitive spatial distribution visualization product, which greatly facilitates users to have a macroscopic understanding and spatial analysis of the regional soil moisture status.

[0075] In some specific embodiments, generating a spatial distribution map of soil moisture content specifically involves: Create a blank raster layer with the same geographic extent, projection, and spatial resolution as the hyperspectral imagery. Each cell of this blank raster layer is used to store a predicted soil moisture content value. The predicted soil moisture content of each farmland pixel is assigned to the corresponding pixel in the blank raster layer according to its spatial coordinates, thus obtaining the assigned raster layer. Define a color map for the assigned raster layer. The color map is used to map consecutive soil moisture values ​​to a preset color gradient sequence. The color mapping table is used to render the assigned raster layer to generate a spatial distribution map of soil moisture content.

[0076] By creating blank raster layers according to specific rules, assigning predicted values ​​according to coordinates, defining color mapping tables, and performing color rendering to generate spatial distribution maps, the generated visualization results are ensured to have consistent georeference and spatial resolution with the original hyperspectral image, and the color gradient can clearly reflect the spatial differences in water content.

[0077] In one specific embodiment, the steps of the farmland moisture content inversion method based on hyperspectral imagery include: Step S1: Set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point; The target area is located in Shandong Province, China, with specific geographical coordinates from 37°12'56.04” N to 37°13'15.12” N and from 118°31'51.68” E to 118°32'31.72” E. The main part of the study area is a concentrated farmland. The measured values ​​of soil moisture content were determined using the oven-drying method, specifically including: Uncirculated soil samples were collected from sampling points in farmland, and the fresh weight of the soil samples was weighed. The original soil sample was dried to constant weight at a drying temperature of 105℃, and the dry weight of the soil sample was weighed. Calculate the measured soil moisture content at the sampling point in this farmland: .

[0078] Step S2: Extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information. The preprocessing includes radiometric calibration, atmospheric correction and denoising.

[0079] Step S3: Principal component analysis is used to reduce the dimensionality of the denoised spectral information; The Minibatch K-Means clustering algorithm is used to classify land cover based on the spectral information of all pixels, identifying all farmland pixels, specifically including: Randomly initialize k cluster centers, randomly select a small batch of samples from the dataset consisting of the spectral information of all pixels, calculate the distance of the samples to each cluster center and assign them to the nearest cluster, update the cluster center positions according to the assignment results of the small batch of samples, and repeat the iteration until the cluster centers converge. In this embodiment, the schematic diagram of the land cover classification results is as follows: Figure 2 As shown.

[0080] Step S4: Calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and measured soil moisture content of each farmland sampling point, use the mRMR (minimum redundancy maximum correlation) method to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. Among them, vegetation indices include Normalized Difference Vegetation Index (NDVI), Converted Difference Vegetation Index (TDVI), Near-Infrared Reflectance of Vegetation (NIRv), Water Stress Index (MSI), Modified Green-Red Vegetation Index (MGRVI), Percentage Infrared Vegetation Index (IPVI), Dual-Band Enhanced Vegetation Index (EVI2), Difference Vegetation Index (DVI), Chlorophyll Index-Green Light (CIg), Charcoal Soil Index (CSI), Burning Area Index (BAI), and Anthocyanin Reflectance Index (ARI). The specific steps for feature selection using the mRMR (minimum redundancy maximum relevance) method include: S401. Based on the vegetation index data and measured soil moisture content of all farmland sampling points, calculate the mutual information between each vegetation index and the measured soil moisture content as a correlation measure; S402. Based on the vegetation index data of all farmland sampling points, calculate the mutual information between every two vegetation indices as a measure of redundancy; S403. Construct the optimal feature subset, initially an empty set; S404. Among the vegetation indices not selected for the optimal feature subset, select the vegetation index that maximizes the objective function value and add it to the optimal feature subset. The objective function is:

[0081] in, This represents the th vegetation index that was not selected into the optimal feature subset. Individual vegetation indices; Represents the th element in the current optimal feature subset. Individual vegetation indices; This represents the measured value of soil moisture content; This represents the current optimal feature subset; This represents the set of vegetation indices that have not yet been selected into the optimal feature subset; Indicating vegetation index Compared with measured soil moisture content Mutual information between them; Indicating vegetation index With vegetation index Mutual information between them; Represents the current optimal feature subset The number of vegetation indices; Indicating vegetation index With the current optimal feature subset The average mutual information among all vegetation indices determines the current optimal feature subset. When it is an empty set, =0; S405. Determine whether the number of vegetation indices in the optimal feature subset is equal to n. If not, return to step S404; if yes, output the vegetation indices in the current optimal feature subset as evaluation features. When the preset n is 3, 6, and 12 respectively, the results of feature selection using the mRMR method are shown in Table 1.

[0082] Table 1 mRMR screening results

[0083] Step S5: Construct a soil moisture content inversion model based on machine learning regression algorithm. The input of the soil moisture content inversion model is the evaluation features of farmland pixels, and the output is the predicted soil moisture content of the farmland pixels. The soil moisture content inversion model is trained using assessment features from farmland sampling points, establishing a mapping relationship between assessment features and soil moisture content. The training steps for the soil moisture content inversion model include: S501. Take the denoised spectral information of the pixel corresponding to a farmland sampling point as a sample, and summarize all samples into a sample dataset; S502. Divide the sample dataset into a training set and a test set; S503. Input the training set into the soil moisture content inversion model for training. During the training process, use the cross-optimization method to optimize the hyperparameters of the model to prevent overfitting. S504. Use the test set to evaluate the model performance. Once the evaluation is successful, the trained soil moisture content inversion model is obtained.

[0084] In this embodiment, 12 machine learning regression algorithms are used to construct corresponding soil moisture content inversion models, including: Linear Regression, K-Nearest Neighbor Regressor, Support Vector Regression (SVR), Ridge Regression, Multilayer Perceptron Regressor (MLP), Decision Tree, Extra Tree, XGBoost, Random Forest, AdaBoost, Gradient Boost, and Bagging.

[0085] All soil moisture inversion models were implemented using the Scikit-learn and XGBoost libraries in Python, and were trained using the same standardized data as input samples. The training results of each soil moisture inversion model are shown in Table 2.

[0086] Table 2 Training results of various soil moisture content inversion models

[0087] It can be seen that the Ridge regression model exhibits the best and most stable performance when the number of evaluation features is 3, i.e., when the amount of data is not large. Therefore, this embodiment uses the Ridge regression model with the optimal feature subset (evaluation features are CSI, DVI, and BAI) as the final soil moisture content inversion model with input n=3.

[0088] Step S6: After calculating the evaluation features of each farmland pixel, input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

[0089] Step S7: Based on the predicted soil moisture content of each farmland pixel, generate a spatial distribution map of the moisture content in the target area, specifically including: Create a blank raster layer with the same geographic extent, projection, and spatial resolution as the hyperspectral imagery. Each cell of this blank raster layer is used to store a predicted soil moisture content value. The predicted soil moisture content of each farmland pixel is assigned to the corresponding pixel in the blank raster layer according to its spatial coordinates, thus obtaining the assigned raster layer. Define a color map for the assigned raster layer. The color map is used to map consecutive soil moisture values ​​to a preset color gradient sequence. The color mapping table is used to render the assigned raster layer to generate a spatial distribution map of soil moisture content. In this embodiment, the spatial distribution map of water content in the target area is as follows: Figure 3 As shown.

[0090] The following are embodiments of the farmland moisture content inversion system based on hyperspectral images provided in this application. This farmland moisture content inversion system based on hyperspectral images belongs to the same inventive concept as the farmland moisture content inversion methods in the above embodiments. For details not described in detail in the embodiments of the farmland moisture content inversion system, please refer to the embodiments of the farmland moisture content inversion methods based on hyperspectral images described above.

[0091] like Figure 4 As shown, the farmland moisture content retrieval system based on hyperspectral imagery includes: The data acquisition module is used to set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point. The preprocessing module is used to extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information. The land cover classification module is used to reduce the dimensionality of the denoised spectral information, and then use an unsupervised clustering algorithm to classify the land cover information of all pixels and identify all farmland pixels. The evaluation feature selection module is used to calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and the measured soil moisture content of each farmland sampling point, the mRMR method is used to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. The soil moisture content inversion model module is used to construct a soil moisture content inversion model based on machine learning regression algorithm, and to train the soil moisture content inversion model using the evaluation features of farmland sampling points, and to construct the mapping relationship between evaluation features and soil moisture content. The soil moisture content prediction module is used to calculate the evaluation features of each farmland pixel and input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

[0092] The farmland moisture content inversion system in this embodiment is used to implement a farmland moisture content inversion method based on hyperspectral images.

[0093] This application also provides an electronic device for implementing the various embodiments of this application. Figure 5 To illustrate the hardware structure of an electronic device according to various embodiments of this application, as shown in the following diagram... Figure 5As shown, the electronic device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor.

[0094] Those skilled in the art will understand that the electronic device structure involved in the embodiments of this application does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0095] In embodiments of this application, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0096] In this application embodiment, the processor can be implemented using at least one of an Application-Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a processor, a controller, a microcontroller, a microprocessor, or an electronic unit designed to perform the functions described herein. In some cases, such implementations can be implemented within a controller. For software implementations, implementations such as processes or functions can be implemented with separate software modules that allow the performance of at least one function or operation. The software code can be implemented by a software application (or program) written in any suitable programming language, and the software code can be stored in memory and executed by the controller.

[0097] In addition, the electronic device includes some functional modules not shown, which will not be described in detail here.

[0098] Those skilled in the art will understand that the various aspects of the electronic device provided in this application can be implemented as a system, method, or program product. Therefore, the various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0099] This application also provides a storage medium storing a program product capable of implementing a method for retrieving farmland moisture content based on hyperspectral imagery. In some possible embodiments, various aspects of this application can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this application.

[0100] The storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0101] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for inverting farmland moisture content based on hyperspectral imagery, characterized in that, include: S1. Set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point; S2. Extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information; S3. Dimensionality reduction is performed on the denoised spectral information, and then an unsupervised clustering algorithm is used to classify the land cover information of all pixels and identify all farmland pixels. S4. Calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and measured soil moisture content of each farmland sampling point, use the mRMR method to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. S5. Construct a soil moisture content inversion model based on machine learning regression algorithm. The input of the soil moisture content inversion model is the evaluation features of farmland pixels, and the output is the predicted soil moisture content of the farmland pixels. The soil moisture content inversion model was trained using the assessment features of farmland sampling points, and the mapping relationship between the assessment features and soil moisture content was constructed. S6. After calculating the evaluation features of each farmland pixel, input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

2. The method for retrieving farmland moisture content as described in claim 1, characterized in that, In step S2, preprocessing includes radiometric calibration, atmospheric correction, and noise reduction.

3. The method for retrieving farmland moisture content as described in claim 1, characterized in that, In step S3, the Minibatch K-Means clustering algorithm is used to classify the spectral information of all pixels for land cover classification, specifically including: Randomly initialize k cluster centers, randomly select a small batch of samples from the dataset consisting of the spectral information of all pixels, calculate the distance of the samples to each cluster center and assign them to the nearest cluster, update the cluster center positions according to the assignment results of the small batch of samples, and repeat the iteration until the cluster centers converge.

4. The method for retrieving farmland moisture content as described in claim 1, characterized in that, In step S4, the vegetation indices include normalized difference vegetation index, converted difference vegetation index, vegetation near-infrared reflectance, water stress index, modified green-red vegetation index, infrared percentage vegetation index, dual-band enhanced vegetation index, difference vegetation index, chlorophyll index-green light, charcoal soil index, burn area index, and anthocyanin reflectance index.

5. The method for inverting farmland moisture content as described in claim 1, characterized in that, In step S4, the specific steps for feature selection using the mRMR method include: S401. Based on the vegetation index data and measured soil moisture content of all farmland sampling points, calculate the mutual information between each vegetation index and the measured soil moisture content as a correlation measure; S402. Based on the vegetation index data of all farmland sampling points, calculate the mutual information between every two vegetation indices as a measure of redundancy; S403. Construct the optimal feature subset, initially an empty set; S404. Among the vegetation indices not selected for the optimal feature subset, select the vegetation index that maximizes the objective function value and add it to the optimal feature subset. The objective function is: in, This represents the th vegetation index that was not selected into the optimal feature subset. Individual vegetation indices; Represents the th element in the current optimal feature subset. Individual vegetation indices; This represents the measured value of soil moisture content; This represents the current optimal feature subset; This represents the set of vegetation indices that have not yet been selected into the optimal feature subset; Indicating vegetation index Compared with measured soil moisture content Mutual information between them; Indicating vegetation index With vegetation index Mutual information between them; Represents the current optimal feature subset The number of vegetation indices; Indicating vegetation index With the current optimal feature subset The average mutual information among all vegetation indices determines the current optimal feature subset. When it is an empty set, =0; S405. Determine whether the number of vegetation indices in the optimal feature subset is equal to n. If not, return to step S404; if yes, output the vegetation indices in the current optimal feature subset as evaluation features.

6. The method for inverting farmland moisture content as described in claim 1, characterized in that, In step S5, the training steps for the soil moisture content inversion model include: S501. Take the denoised spectral information of the pixel corresponding to a farmland sampling point as a sample, and summarize all samples into a sample dataset; S502. Divide the sample dataset into a training set and a test set; S503. Input the training set into the soil moisture content inversion model for training. During the training process, use the cross-optimization method to optimize the hyperparameters of the model to prevent overfitting. S504. Use the test set to evaluate the model performance. Once the evaluation is successful, the trained soil moisture content inversion model is obtained.

7. The method for inverting farmland moisture content as described in claim 1, characterized in that, It also includes step S7: generating a spatial distribution map of the soil moisture content of the target area based on the predicted soil moisture content of each farmland pixel.

8. A farmland moisture content inversion system based on hyperspectral imagery, characterized in that, The method for implementing farmland moisture content inversion as described in any one of claims 1-7 includes: The data acquisition module is used to set up multiple farmland sampling points in the target area, acquire hyperspectral images of the target area, and simultaneously measure the measured values ​​of soil moisture content at each farmland sampling point. The preprocessing module is used to extract the spectral information of each pixel in the hyperspectral image and preprocess the spectral information to obtain denoised spectral information. The land cover classification module is used to reduce the dimensionality of the denoised spectral information, and then use an unsupervised clustering algorithm to classify the land cover information of all pixels and identify all farmland pixels. The evaluation feature selection module is used to calculate multiple vegetation indices for each farmland sampling point based on the denoised spectral information of the corresponding pixels of the farmland sampling points. Then, based on the multiple vegetation indices and the measured soil moisture content of each farmland sampling point, the mRMR method is used to screen features and obtain the top n vegetation indices that have the greatest impact on soil moisture content as evaluation features. The soil moisture content inversion model module is used to construct a soil moisture content inversion model based on machine learning regression algorithm, and to train the soil moisture content inversion model using the evaluation features of farmland sampling points, and to construct the mapping relationship between evaluation features and soil moisture content. The soil moisture content prediction module is used to calculate the evaluation features of each farmland pixel and input them into the soil moisture content inversion model to generate the predicted soil moisture content value for each farmland pixel.

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 a computer program, it implements the steps of the farmland moisture content inversion method as described in any one of claims 1-7.

10. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the farmland moisture content inversion method as described in any one of claims 1-7.