Grass yield estimation method, device and storage medium facing multi-scale segmentation
Through multi-scale segmentation of remote sensing data and random forest algorithm, Sentinel and Gaofen satellite data are used to build a grassland grass yield estimation model, which solves the problems of insufficient application of Sentinel-2 data and low efficiency of high-resolution data processing, and achieves efficient and high-resolution data processing. Accurate pasture grass yield estimates.
Patent Information
- Application Number
- CN201910822474.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-02
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-09-02
AI Technical Summary
In the current technology for grassland remote sensing production estimation, Sentinel-2 satellite data is rarely used, and the high-resolution satellite data processing efficiency and accuracy are insufficient, making it difficult to accurately estimate grassland grass production.
The grass production estimation method uses multi-scale segmentation remote sensing data and random forest algorithm. By acquiring and preprocessing Sentinel, GF-1, GF-3, and GF-6 satellite data, image segmentation and classification are performed, and a random forest model is constructed to predict The amount of grass produced in the pasture.
It achieves efficient and accurate estimation of grassland grass yield, can tolerate outliers and noise, is suitable for hyperspectral remote sensing data, avoids over-fitting problems, and has strong generalization ability.
Smart Images

Figure CN112446522B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of satellite measurement technology, and in particular to a grass yield estimation method, device and storage medium for multi-scale segmented remote sensing data and random forest. Background Art
[0002] Grassland resources are an important part of the global terrestrial ecosystem and play a vital role in the ecological environment. Monitoring grassland resources helps to understand the actual situation of grassland, rationally develop and utilize grassland resources, and achieve the goal of maintaining the balance of grassland ecosystem. Grassland remote sensing yield estimation is to obtain earth surface information through satellite sensors or ground spectrometers. Under the guidance of ground feature spectrum theory, the acquired earth surface information is processed through complex comprehensive processing to identify grassland and its growth, realize grassland area and growth monitoring, and forecast yield and total yield. The use of remote sensing technology for grassland yield estimation originated abroad. Domestic research started late, but developed rapidly. According to research, people initially conducted grassland remote sensing yield estimation based on AVHRR-NDVI data, and explored the relationship between vegetation index NDVI and grass yield by establishing a regression model. With the development of technology, ground spectral experimental data or hyperspectral data, ground monitoring sample data combined with Landsat, MODIS and other data products are used to estimate grassland yield and explore grassland growth conditions by establishing different inversion models.
[0003] Sentinel-2 is a multispectral imaging satellite launched by the European Space Agency in June 2015. It carries a multispectral imager (MSI) with a maximum resolution of 10m and remote sensing data covering 13 spectral bands. It is used for land monitoring and can provide images of vegetation, soil and water cover, inland waterways and coastal areas. It can also be used for emergency rescue services. Currently, two satellites, Sentinel-2A and Sentinel-2B, have been sent. The revisit period of one satellite is 10 days, and the two complement each other with a revisit period of 5 days. However, since Sentinel-2 is a newly launched satellite, there are currently few studies on the use of Sentinel-2 data for remote sensing yield estimation in grassland areas.
[0004] The Gaofen-1 (GF-1) satellite is the first satellite of China's major high-resolution earth observation satellite system project. It was successfully launched into orbit by the Long March 2D carrier rocket at the Jiuquan Satellite Launch Center on April 26, 2013. It carries four wide field view (WFV) sensors with a spatial resolution of 16m and two pan and multispectral sensors (PMS). The spatial resolution of the panchromatic image is 2m, and the spatial resolution of the multispectral image is 8m. The GF-1 satellite provides a new data source for grassland resource monitoring.
[0005] Synthetic aperture radar (SAR) has a certain degree of penetration into the surface coverage area and has the ability to work all day and all weather. It can penetrate the shallow surface cover layer and effectively detect the geological features below the cover layer. The penetration depth is related to the wavelength, surface dielectric constant, and surface roughness. The Gaofen-3 (GF-3) satellite is my country's first C-band fully polarized synthetic aperture radar imaging satellite. It was successfully launched from the Taiyuan Satellite Launch Center on August 10, 2016, and can monitor ocean and land information all day and all weather.
[0006] Gaofen-6 (GF-6) is a low-orbit optical remote sensing satellite launched by my country on June 2, 2018. It features high resolution, wide coverage, high quality and efficient imaging, and can effectively support agricultural resource monitoring, forestry resource surveys, disaster prevention, mitigation and relief, etc. GF-6 can be networked with GF-1, which will shorten the time resolution of remote sensing data acquisition from 4 days to 2 days. Summary of the invention
[0007] In view of the above-mentioned shortcomings that currently exist, the present invention provides a grass yield estimation method based on multi-scale segmented remote sensing data and a random forest algorithm, which can estimate grass yield with relatively accurate results.
[0008] To achieve the above object, the embodiments of the present invention adopt the following technical solutions:
[0009] A grass yield estimation method based on multi-scale segmented remote sensing data and a random forest algorithm, the grass yield estimation method comprising the following steps:
[0010] Acquire remote sensing data and preprocess them;
[0011] Perform multi-scale segmentation on the preprocessed data to obtain the segmentation result;
[0012] Obtain measured data of sample points in grass-producing areas and create grassland classification samples and grass yield estimation samples based on the measured data;
[0013] A random forest classifier is constructed based on the segmentation results and grassland category classification samples to obtain grassland type classification results;
[0014] A random forest estimation model was established based on grassland type classification results, segmentation results and grass yield estimation samples;
[0015] The segmentation results were used as input vectors to the random forest estimation model to predict grass yield.
[0016] According to one aspect of the present invention, the acquiring remote sensing data and preprocessing includes:
[0017] Sentinel data acquisition and preprocessing;
[0018] GF data acquisition and preprocessing.
[0019] According to one aspect of the present invention, the Sentinel data acquisition and preprocessing includes: performing radiometric calibration and atmospheric correction on the Sentinel raw data; and resampling the image bands to a 10m resolution with the best quality by using a bicubic convolution method.
[0020] According to one aspect of the present invention, the GF data acquisition and preprocessing includes: acquisition and preprocessing of GF-1 data, GF-3 data and GF-6 data, wherein:
[0021] GF-1 data acquisition and preprocessing include: for GF1-1 PMS image data, it is necessary to perform radiometric calibration, atmospheric correction and orthorectification of multispectral images, and then perform radiometric calibration and orthorectification on panchromatic images. After that, the corrected multispectral images are fused with panchromatic images to obtain remote sensing fusion images with multispectral information and high spatial resolution.
[0022] GF-3 data acquisition and preprocessing include: radiometric calibration, complex data conversion, multi-view processing, filtering and preprocessing operations for GF-3 images;
[0023] GF-6 data acquisition and preprocessing include: radiation calibration, atmospheric correction and geometric correction of GF-6 data.
[0024] According to one aspect of the present invention, before performing multi-scale segmentation on the pre-processed data to obtain a segmentation result, it is necessary to perform image mosaicking and image cropping steps on the pre-processed data.
[0025] According to one aspect of the present invention, the following steps are included:
[0026] The total fresh weight of grass yield / edible fresh weight of grass yield at the measured point to be calculated is stored in the sample as the Y value, and the band value extracted from the segmentation result and the EVI and NDVI values are used as the X value;
[0027] The random forest regression model is built using the machine learning library. The constructed random forest regression model is represented by {h(X,Θk), k=1,…}, where X is the input vector and {Θk} is an independent and identically distributed random vector.
[0028] According to one aspect of the present invention, both the random forest classifier and the random forest estimation model need to be modeled using a random forest regression model, which specifically includes the following steps:
[0029] Normalize the input sample data set;
[0030] Divide the sample data set into training set and test set;
[0031] For the training set D = {(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x n ,y n )}, use the Bootstrap method to resample and randomly generate T training sets S 1 , S 2 , …, S T ;
[0032] Generate a corresponding decision tree C for each training set 1 , C 2 , …, C T ; Before selecting an attribute on each non-leaf node, randomly select m (m<<M) attributes from all M attributes as the split attribute set of the current node, and select the best split attribute from them as the node to split;
[0033] The generated multiple decision trees form a random forest. For the test set sample X, each decision tree is used to test and the prediction result C is obtained. 1 (x), C 2 (x),…,C T (x);
[0034] When estimating a model as a random forest, the predicted value of the test set sample X is the average of the results of these trees;
[0035] When used as a random forest classifier, the final predicted category is the category with the most votes among the leaf nodes to which the sample point has been sent.
[0036] According to one aspect of the present invention, when the random forest estimation model is used, the predicted value of the test set sample X is the average of the results of these trees, including:
[0037] For any partition feature A, the corresponding data set D is divided on both sides of any partition point S 1 , D 2 , find the way to make D 1 , D 2 The sum of the mean square errors of each set is the smallest, and D 1 , D 2 The feature and eigenvalue partition point corresponding to the minimum sum of the mean square error is expressed as:
[0038]
[0039] Among them, c 1 D1 The sample output mean of the dataset, c 2 D 2 The sample output mean of the dataset.
[0040] According to one aspect of the present invention, when used as a random forest classifier, the final category predicted is the category with the most votes among the leaf nodes to which the sample point reaches, including:
[0041] Each classification tree in RF is a binary tree, and its generation follows the top-down recursive splitting principle, that is, the training set is divided from the root node in sequence; in the binary tree, the root node contains all the training data, and is split into left and right nodes according to the principle of minimum node impurity. They each contain a subset of the training data, and the nodes continue to split according to the same rule until the branch stop rule is met and the growth stops; if the classification data on node n all come from the same category, the impurity of this node is 0, and the impurity measurement method is the Gini criterion:
[0042]
[0043] For a given training set D, suppose the training set consists of K classes, C 1 , C 2 , …C k , then the Gini coefficient is:
[0044]
[0045] If the training samples are divided into two parts, D1 and D2, depending on whether feature A takes a certain value a, then the Gini index under the condition of feature A is:
[0046]
[0047] This is equivalent to calculating the Gini index of the two small sets divided according to feature A respectively, and then taking the expectation based on the empirical probability to obtain the Gini index of D under feature A.
[0048] According to one aspect of the present invention, the random forest regression modeling includes determining the importance of variables, specifically including:
[0049] Add random noise to the variables of each decision tree, and then test the increase or decrease of the out-of-bag error. If the error increases, the change is more important, otherwise it is not important.
[0050] The calculation method is:
[0051]
[0052] in, Indicates the importance of variable i; E errOOB1represents the out-of-bag (OOB) error, E errOOB2 It means randomly adding noise interference to the variable i of all samples of the out-of-bag data OOB, and recalculating the out-of-bag error.
[0053] According to one aspect of the present invention, a model evaluation is performed, wherein the model evaluation selects the coefficient of determination (R 2 ) and mean square error (MSE), specifically including:
[0054]
[0055]
[0056] Among them, y i is the actual observed value, For the model estimate, is the sample mean, and n is the number of samples.
[0057] According to one aspect of the present invention, performing multi-scale segmentation on the pre-processed data to obtain a segmentation result includes:
[0058] The remote sensing image is divided into several non-overlapping and hole-free subset areas. Each area has the same or similar features and represents a type of ground object. The homogeneity-heterogeneity method is selected to make the homogeneity of the object class as large as possible and the homogeneity between objects as small as possible. The homogeneity is represented by the area and standard deviation inside the image object. The specific formula is:
[0059]
[0060] Among them, a i and v i denote the area and standard deviation of the ith region, n is the number of segmented regions at this scale, and wVar represents the homogeneity index;
[0061] Heterogeneity is represented by the spatial correlation index Moran's I (MI) between image objects. The specific formula is:
[0062]
[0063] Among them, n is the number of segmented regions at this scale, w ij is the spatial adjacency weight, y i is the spectral mean of region i, is the spectral mean of the entire image, MI is the heterogeneity index; if regions i and j are adjacent, then w i,j =1, otherwise w i,j =0.
[0064] A grass yield estimation device for multi-scale segmentation remote sensing data and random forest algorithm, the grass yield estimation device comprising:
[0065] Memory for storing computer programs;
[0066] A processor is used to implement any of the steps of the above-mentioned method for estimating grass yield using multi-scale segmented remote sensing data and random forest algorithm when executing the computer program.
[0067] A readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the steps of any of the above-mentioned methods for estimating grass yield using multi-scale segmented remote sensing data and a random forest algorithm are implemented.
[0068] Advantages of the implementation of the present invention: The grass yield estimation method for multi-scale segmented remote sensing data and random forest algorithm described in the present invention includes the following steps: obtaining remote sensing data and preprocessing; performing multi-scale segmentation on the preprocessed data to obtain segmentation results; obtaining measured data of sample points in the grass-producing area and creating grassland category classification samples and grass yield estimation samples according to the measured data; constructing a random forest classifier according to the segmentation results and grassland category classification samples and obtaining grassland type classification results; establishing a random forest estimation model according to grassland type classification results, segmentation results and grass yield estimation samples; using the segmentation results as the input vector of the random forest estimation model to predict grass yield; there is no need to test the assumptions such as normality and independence of variables, and there is no need to consider the collinearity problem of multiple variables, and the operation is efficient and the results are accurate. It has a high accuracy rate, good tolerance for outliers and noise, and better training and learning effects on high-dimensional data such as hyperspectral remote sensing. At the same time, a major problem in machine learning is overfitting. For random forests, as long as there are enough trees in the forest, the classifier will not overfit the model and has strong generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0070] Figure 1 It is a schematic flow chart of a method for estimating grass yield using multi-scale segmented remote sensing data and a random forest algorithm according to the present invention;
[0071] Figure 2 The total grass yield distribution map of the Haiyan research area described in the present invention;
[0072] Figure 3 The edible grass yield distribution map of the Haiyan research area described in the present invention;
[0073] Figure 4 The total grass yield distribution map of the Qilian study area described in the present invention;
[0074] Figure 5 The edible grass yield distribution map of the Qilian study area described in the present invention;
[0075] Figure 6 This is a schematic diagram of the grass yield estimation device described in the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] Embodiment 1
[0078] like Figure 1 , Figure 2 , Figure 3 , Figure 4 and Figure 5 As shown, a grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm, the grass yield estimation method comprises the following steps:
[0079] Step S1: Acquire remote sensing data and perform preprocessing;
[0080] The remote sensing data acquisition and preprocessing comprises:
[0081] 1) Sentinel data acquisition and preprocessing;
[0082] 2) GF data acquisition and preprocessing;
[0083] Among them, Sentinel data acquisition and preprocessing include the following specific implementations:
[0084] According to the actual project needs, as well as the field sampling area and sampling time, select the required Sentinel-2A or Sentinel-2B data. The data is required to be basically cloud-free and have high image quality. The Sentinel-2 data directly obtained through the European Space Agency (ESA) data sharing website (https: / / scihub.copernicus.eu / dhus / ) is Level-1C multispectral data, which is a geometrically precisely corrected orthophoto with a projection coordinate system of UTM / WGS-84. ESA also defines Sentinel-2L2A data. L2A data mainly includes atmospheric bottom reflectance data that has been radiometrically calibrated and atmospherically corrected. This L2A data needs to be processed by the user. The Sentinel-2 data band reference is as follows:
[0085] Table 1 Some parameter information of Sentinel-2 satellite data
[0086]
[0087] In practical applications, the Sentinel raw data needs to be radiometrically calibrated and atmospherically corrected. As can be seen from Table 1, the spatial resolution of the Sentinel-2 band is not uniform. Here, the image bands are resampled to the best quality 10m resolution using bicubic convolution, and the data are combined, stitched, and cropped according to the needs of the study area.
[0088] In practical applications, the principle of ground object radiation calibration is as follows:
[0089] L = gain × DN + bias
[0090]
[0091] Where L is the radiance of the object at the top of the atmosphere, DN is the pixel value, gain is the calibration gain, gain and bias can be obtained from the header file, ρ is the reflectivity of the object, d s is the distance between the Sun and the Earth in astronomical units, E 0 is the solar irradiance, and θ is the solar zenith angle.
[0092] The principle of Flaash atmospheric correction is as follows:
[0093]
[0094] The first two terms on the right side of the equation are the direct and scattered components of the radiation brightness, which are the result of the interaction between the surface and the atmosphere in the transmission of solar radiation; L a is the atmospheric radiation component of the radiant brightness, which is the result of the action of atmospheric molecules and aerosols; ρ is the pixel surface reflectivity; ρe is the average surface reflectivity around the pixel; S is the albedo of the large balloon surface; A and B are two independent coefficients depending on atmospheric and geometric conditions.
[0095] GF data acquisition and preprocessing may specifically include the following implementations:
[0096] The GF-1, GF-3 and GF-6 data are all provided by the China Resources Satellite Application Center.
[0097] GF-1 data combines the advantages of high spatial resolution and high temporal resolution. Here, GF-1PMS data is selected as the data source, and its parameter settings are shown in Table 2. The combination of two PMS cameras enables the sensor to have a large width while having high spatial resolution. In addition, the sensor has good side-swing imaging capabilities, and can perform high-frequency temporal observations of specific areas in emergency situations. For GF1-1 PMS image data, it is necessary to perform multispectral image radiometric calibration, atmospheric correction, and orthorectification, and then perform radiometric calibration and orthorectification on the panchromatic image. After that, the corrected multispectral image is fused with the panchromatic image to obtain a remote sensing fusion image with multispectral information and high spatial resolution. According to specific needs, the images are mosaicked and spliced.
[0098] Table 2 GF-1PMS parameter settings
[0099]
[0100] Here, the super-resolution Bayesian algorithm (Pansharp) is used to fuse the GF-1 data. Based on the least squares method, the algorithm optimally matches the grayscale value relationship between the original multispectral image and panchromatic image involved in the fusion and the fused multispectral image and panchromatic image, and uses statistical methods to solve the problems of standardization and automation of the fusion process, so that the fused image has high spatial resolution and good spectral fidelity. This algorithm is not limited by the number of bands, and has high fidelity of spectral and detail features. It is currently recognized as one of the better algorithms in high-resolution remote sensing image fusion.
[0101] The GF-3 satellite has 12 imaging modes: beamforming, strip, scanning, full polarization, wave imaging, global observation, high and low incidence angles, with a maximum resolution of 1m. The imaging modes selected here are shown in Table 3, and a series of pre-processing operations such as radiometric calibration, complex data conversion, multi-view processing, filtering, and conversion to DB image (output TIFF) are performed on the GF-3 image.
[0102] Table 3 GF-3 satellite imaging modes that can be used to estimate grass production
[0103]
[0104] The radiation calibration of GF-3 data is generally to convert the backscatter energy intensity into the backscatter coefficient. The calibration formula is:
[0105]
[0106] Among them, σ 0 is the backscattering coefficient, P t is the radar transmitter transmission power, G t is the radar signal receiving channel gain, G θ is the two-way antenna pattern, λ is the wavelength of the transmitted wave, δ a is the azimuth resolution, δ t is the range resolution, M is the image processor power enhancement, R is the slant range, β is the angle (incident), and I′ is the thermal noise power.
[0107] One of the most important features of SAR images is intensity or amplitude. Using the intensity / amplitude feature, ground object target information can be extracted. Therefore, it is necessary to convert SAR complex data into SAR intensity / amplitude data. SAR data is complex data consisting of real and imaginary parts, also known as in-phase and quadrature channels. The intensity formula is:
[0108]
[0109] Where: A = Amplitude, I = In-phase, Q = Quadrature channels. The conversion formula between intensity and amplitude is: Intensity = Amplitude 2 , where: Intensity is intensity and Amplitude is amplitude.
[0110] Multi-view processing can improve the visual effect of the image and optimize the estimation accuracy of backscattering of each pixel, specifically the average of the coherence sum of neighboring pixels, as shown in the following formula:
[0111]
[0112] The GF-3 is filtered using the Non-Local Means filter. The Non-Local Means filter is a polarimetric SAR image filtering method that has high suppression of speckle noise and high fidelity of detail information. The principle is to find blocks similar to the area to be restored in the entire image, and then cluster all the similar blocks found through a certain similarity criterion (such as K-means clustering) and then jointly filter them to reduce image noise. The calculation of image similarity can be obtained by comparing the pixel values within a window. The formula of the Non-local Means algorithm is:
[0113]
[0114] in, is the denoised image, v(y) is the noisy image, w(x,y) is the weight, Ω x is the neighborhood of pixel x. The determination of w(x,y) is the key to the algorithm. w(x,y) represents the similarity between pixel x and pixel y in the original image v(y). The value of w(x,y) is determined by the square of the Euclidean distance between the two windows v(x) and v(y), as follows:
[0115]
[0116] in:
[0117]
[0118] Z(x) represents the normalization coefficient, and h is the smoothing parameter. The similarity between image blocks is determined by the Euclidean distance. From the calculation formula of w(x,y), it can be seen that the larger the Euclidean distance, the more dependent the algorithm's denoising ability is on the choice of the smoothing parameter.
[0119] GF-6 is equipped with a 2-meter panchromatic / 8-meter multispectral high-resolution camera and a 16-meter multispectral medium-resolution wide-width camera. The 2-meter panchromatic / 8-meter multispectral camera has an observation width of 90 kilometers, and the 16-meter multispectral camera has an observation width of 800 kilometers. GF-6 also realizes the localization of 8-band CMOS detectors, and for the first time in China, a "red edge" band that can effectively reflect the unique spectral characteristics of crops has been added. GF-6 data is also calibrated by radiation, atmospheric correction, and geometric correction.
[0120] Step S2: performing multi-scale segmentation on the preprocessed data to obtain a segmentation result;
[0121] The performing multi-scale segmentation on the pre-processed data to obtain the segmentation result comprises:
[0122] The segmentation of remote sensing images is to divide them into several non-overlapping and hole-free subset areas. Each area has the same or similar features and represents a type of ground object. Here, the homogeneous heterogeneous method is selected to make the homogeneity of the object class as large as possible and the homogeneity between objects as small as possible. Homogeneity is represented by the area and standard deviation inside the image object. The specific formula is:
[0123]
[0124] Among them, a i and v i Represent the area and standard deviation of the ith region, respectively, and n is the number of segmented regions at this scale. The introduction of area weights is conducive to preferentially merging regions with smaller areas to prevent instability caused by regions with smaller areas. The smaller the homogeneity index wVar, the higher the internal homogeneity of the image object.
[0125] Heterogeneity is represented by the spatial correlation index Moran's I (MI) between image objects. The specific formula is:
[0126]
[0127] Among them, n is the number of segmented regions at this scale, w ij is the spatial adjacency weight, y i is the spectral mean of region i, is the spectral mean of the entire image. If regions i and j are adjacent, then w i,j =1, otherwise w i,j = 0. The smaller the heterogeneity index MI is, the lower the spatial correlation of the image object is and the higher the heterogeneity is.
[0128] The segmentation results include: Sentinel-2 characteristic band, GF-1PMS characteristic band, GF-3 characteristic band, and GF-6 characteristic band.
[0129] Step S3: obtaining measured data of sample points in the grass-producing area and creating grassland classification samples and grass yield estimation samples according to the measured data;
[0130] The measured data used mainly include herbaceous sample plot number, longitude and latitude, vegetation coverage, main plant species, total grass yield fresh weight and air-dried weight, edible grass yield fresh weight and air-dried weight, survey time and other information. According to the growth law of forage grass, the survey time is preferably concentrated in July and August, which is the period when forage grass grows most vigorously. In addition, considering the accuracy of grass yield estimation, the measured data distribution should be as uniform as possible, and a sufficient number of sample plots should be selected for the grassland types in the study area for measurement.
[0131] Grassland classification samples and grass yield estimation samples are created based on measured data. Specifically:
[0132] Vegetation index is a measure of the surface vegetation status obtained by combining the spectral reflectance of different bands on remote sensing images in a linear or nonlinear way. Based on previous studies, NDVI and EVI, two vegetation indices that can better reflect the surface vegetation coverage, are selected as characteristic values. According to the coordinates of the sample points, the corresponding band values of the sample points, the enhanced vegetation index EVI, and the normalized vegetation index NDVI are extracted as sample data, and the storage format is .csv.
[0133]
[0134]
[0135] Among them, ρ nir is the near infrared band value, ρ red is the red light band value, ρ blue is the blue light band value.
[0136] In this embodiment, it is necessary to judge whether the vegetation index NDVI is greater than 0.15. If it is greater than 0.15, it means there is vegetation, and the data can be used in subsequent steps; if it is less than 0.15, it means there is no vegetation, and the data is not used.
[0137] Step S4: construct a random forest classifier according to the segmentation results and grassland category classification samples and obtain grassland type classification results;
[0138] According to the grassland classification samples, combined with the remote sensing data after preprocessing and multi-scale segmentation, the grassland type classification is carried out by establishing a random forest model. Here, the Python machine learning library scikit-learn (sklearn) is used to build a random forest model. Sklearn supports four major machine learning algorithms including classification, regression, dimensionality reduction and clustering, and also includes three modules: feature extraction, data processing and model evaluation. The establishment of the random forest model includes the following steps:
[0139] Data Normalization
[0140] Since the selected evaluation values have different dimensions and dimensional units, this situation will affect the final result. In order to eliminate this effect, the input sample data set needs to be normalized to make the sample feature distribution close to the standard normal distribution to achieve better results. Here, MinMacScaler is used to scale the features to a given minimum and maximum value, usually (0,1).
[0141]
[0142] Among them, x i is the measured sample value at this point, xmin(axis=0) is the minimum sample, x max(axis=0) is the maximum sample, max and min are the maximum and minimum values of the given zoom range.
[0143] Sample training set and test set selection
[0144] Before modeling, the sample data set needs to be divided into a training set and a test set. When dividing the training set and the test set, a trade-off needs to be made. The smaller the test set data, the less accurate the estimation of the generalization error of the model. Generally, in practical applications, based on the size of the entire data set, the ratio of the training set data to the test set data is 6:4, 7:3 or 8:2. For large data, 9:1 or even 99:1 can be used.
[0145] RF model establishment
[0146] RF is a modified evolution based on Bagging. The Bagging algorithm uses random sampling with replacement to extract m sub-samples from the original data set, and then uses these m sub-samples to train m learners, reducing the variance of the model. The data is then placed on these m classifiers, and finally the data is determined based on the voting results of these m classifiers to determine which category the data belongs to. RF has made two changes on this basis: first, when training each learner, instead of selecting the best feature from all features to split the node, k features are randomly selected, and the best feature is selected from these k features to split the node; second, the CART decision tree is used.
[0147] The RF regression model is represented by {h(X,Θk), k=1,…}, where X is the input vector and {Θk} is an independent and identically distributed random vector.
[0148] The specific algorithm steps are as follows:
[0149] For the training data set D = {(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x n ,y n )},
[0150] (1) Use the Bootstrap method to resample and randomly generate T training sets S 1 , S 2 , …, S T ;
[0151] (2) Generate a corresponding decision tree C for each training set 1 , C 2 , …, C T; Before selecting an attribute for each non-leaf node, randomly select m (m<<M) attributes from all M attributes as the split attribute set of the current node, and select the best split attribute from them as the node for splitting. Here m controls the degree of randomness. If m=M, the construction of the base decision tree is the same as the traditional decision tree; if m=1, an attribute is randomly selected for splitting. Generally, m=log 2 M;
[0152] (3) The generated multiple decision trees form a random forest. For the test set sample X, each decision tree is used to test and obtain the prediction result C 1 (x), C 2 (x),…,C T (x);
[0153] (4) The final predicted category is the category with the most votes among the leaf nodes to which the sample point has been sent.
[0154] CART classification tree creation
[0155] Each classification tree in RF is a binary tree, and its generation follows the top-down recursive splitting principle, that is, the training set is divided from the root node in sequence; in the binary tree, the root node contains all the training data, and is split into left and right nodes according to the principle of minimum node impurity. They each contain a subset of the training data, and the nodes continue to split according to the same rule until the branch stop rule is met and the growth stops; if the classification data on node n all come from the same category, the impurity of this node is 0, and the impurity measurement method is the Gini criterion:
[0156]
[0157] For a given training set D, suppose the training set consists of K classes, C 1 , C 2 , …C k , then the Gini coefficient is:
[0158]
[0159] If the training samples are divided into two parts, D1 and D2, depending on whether feature A takes a certain value a, then the Gini index under the condition of feature A is:
[0160]
[0161] This is equivalent to calculating the Gini index of the two small sets divided according to feature A respectively, and then taking the expectation based on the empirical probability to obtain the Gini index of D under feature A.
[0162] The RF model determines the importance of variables by adding random noise to the variables of each decision tree, and then testing the increase or decrease of the out-of-bag error. If the error increases, the change is more important, otherwise it is not important. The calculation method is:
[0163]
[0164] in, Indicates the importance of variable i; E errOOB1 represents the out-of-bag (OOB) error, E errOOB2 It means randomly adding noise interference to the variable i of all samples of the out-of-bag data OOB, and recalculating the out-of-bag error.
[0165] Model Evaluation
[0166] Model evaluation selection determination coefficient (R 2 ) and mean square error (MSE). 2 It characterizes the extent to which the regression equation explains the variation of the dependent variable, or how well the model fits the observed values.
[0167]
[0168]
[0169] Among them, y i is the actual observed value, For the model estimate, is the sample mean, and n is the number of samples.
[0170] Step S5: establishing a random forest estimation model based on grassland type classification results, segmentation results and grass yield estimation samples;
[0171] The specific implementation process of step S5 can be as follows:
[0172] Estimate samples based on grass yield. The total grass yield fresh weight / edible grass yield fresh weight of the measured point to be calculated is stored in the sample as the Y value, and the extracted band value and EVI and NDVI values are used as X values. Here, the Python machine learning library scikit-learn (sklearn) is used to build a random forest regression model. Sklearn supports four major machine learning algorithms including classification, regression, dimensionality reduction and clustering, and also includes three modules: feature extraction, data processing and model evaluation.
[0173] The random forest model is constructed as follows:
[0174] Data Normalization
[0175] Since the selected evaluation values have different dimensions and dimensional units, this situation will affect the final result. In order to eliminate this effect, the input sample data set needs to be normalized to make the sample feature distribution close to the standard normal distribution to achieve better results. Here, MinMacScaler is used to scale the features to a given minimum and maximum value, usually (0,1).
[0176]
[0177] Among them, x i is the measured sample value at this point, x min(axis=0) is the minimum sample, x max(axis=0) is the maximum sample, max and min are the maximum and minimum values of the given zoom range.
[0178] Sample training set and test set selection
[0179] Before modeling, the sample data set needs to be divided into a training set and a test set. When dividing the training set and the test set, a trade-off needs to be made. The smaller the test set data, the less accurate the estimation of the generalization error of the model. Generally, in practical applications, based on the size of the entire data set, the ratio of the training set data to the test set data is 6:4, 7:3 or 8:2. For large data, 9:1 or even 99:1 can be used.
[0180] RF model establishment
[0181] RF is a modified evolution based on Bagging. The Bagging algorithm uses random sampling with replacement to extract m sub-samples from the original data set, and then uses these m sub-samples to train m learners, reducing the variance of the model. The data is then placed on these m classifiers, and finally the data is determined based on the voting results of these m classifiers to determine which category the data belongs to. RF has made two changes on this basis: first, when training each learner, instead of selecting the best feature from all features to split the node, k features are randomly selected, and the best feature is selected from these k features to split the node; second, the CART decision tree is used.
[0182] The RF regression model is represented by {h(X,Θk), k=1,…}, where X is the input vector and {Θk} is an independent and identically distributed random vector.
[0183] The specific algorithm steps are as follows:
[0184] For the training data set D = {(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x n,y n )},
[0185] (1) Use the Bootstrap method to resample and randomly generate T training sets S 1 , S 2 , …, S T ;
[0186] (2) Generate a corresponding decision tree C for each training set 1 , C 2 , …, C T ; Before selecting an attribute for each non-leaf node, randomly select m (m<<M) attributes from all M attributes as the split attribute set of the current node, and select the best split attribute from them as the node for splitting. Here m controls the degree of randomness. If m=M, the construction of the base decision tree is the same as the traditional decision tree; if m=1, an attribute is randomly selected for splitting. Generally, m=log 2 M;
[0187] (3) The generated multiple decision trees form a random forest. For the test set sample X, each decision tree is used to test and obtain the prediction result C 1 (x), C 2 (x),…,C T (x);
[0188] (4) For regression problems, the predicted value of the test set sample X is the average of the results of these trees.
[0189] CART regression tree creation
[0190] When using CART to build a regression tree, the principle used is minimum variance. That is, for any partition feature A, the corresponding data set D on both sides of any partition point S is divided into 1 , D 2 , find the way to make D 1 , D 2 The sum of their respective sets is the smallest, and D 1 , D 2 The feature and eigenvalue division point corresponding to the minimum sum of the mean square error. The expression is:
[0191]
[0192] Among them, c 1 D 1 The sample output mean of the dataset, c 2 D 2 The sample output mean of the dataset. The prediction of the CART tree is based on the mean of the leaf nodes, so the prediction of RF is the average of the prediction values of all trees.
[0193] Model Evaluation
[0194] Model evaluation selection determination coefficient (R 2 ) and mean square error (MSE). 2 It characterizes the extent to which the regression equation explains the variation of the dependent variable, or how well the model fits the observed values.
[0195]
[0196]
[0197] Among them, y i is the actual observed value, For the model estimate, is the sample mean, and n is the number of samples.
[0198] Step S6: Use the segmentation results as input vectors of the random forest estimation model to predict grass yield.
[0199] The specific implementation steps of step S6 using the segmentation results as the input vector of the random forest estimation model to predict grass yield are as follows:
[0200] The remote sensing data used is the remote sensing data that has been preprocessed including segmentation. The gdal library is used to read the preprocessed remote sensing data, and the image band values are stored in an array in the sample format as an input vector. Multi-scale image segmentation, vegetation coverage judgment, grassland type classification, and grass yield estimation of classified grassland are performed, and the predicted total grass yield results are output as TIFF images.
[0201] Embodiment 2
[0202] like Figure 6 As shown, a grass yield estimation device for multi-scale segmented remote sensing data and random forest algorithm, the grass yield estimation device comprises:
[0203] A memory 100, used for storing computer programs;
[0204] The processor 200 is used to implement the steps of the grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm as described in the above embodiment when executing the computer program.
[0205] Embodiment 3
[0206] A readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the steps of the method for estimating grass yield using multi-scale segmented remote sensing data and a random forest algorithm as described in the above embodiment are implemented.
[0207] In practical applications, the following implementation data are included:
[0208] There are two research areas, namely Haiyan Research Area and Qilian Research Area;
[0209] Among them, the Haiyan study area is located at 100.708769~101.136171°E, 36.897002~37.188647°N, and the main grassland types are alpine meadows and temperate grasslands; the Qilian study area is located at 100.495069~100.860690°E, 37.588238~37.801124°N, and the main grassland types are alpine meadows and temperate grasslands.
[0210] The RF model was established, and the total grass yield and edible grass yield were modeled separately. The grass yield was estimated according to the steps and flow chart methods of Example 1 and Example 2, and the results were saved as TIFF images. Figure 2 As shown in the figure, it is a special atlas of total grass production in the Haiyan study area; Figure 3 As shown in the figure, this is a thematic atlas of edible grass production in the Haiyan study area. Figure 4 As shown in the figure, it is a special atlas of total grass production in the Qilian study area; Figure 5 Shown is a thematic atlas of edible grass production in the Qilian study area.
[0211] There is no need to test the assumptions such as normality and independence of variables, nor is there any need to consider the collinearity of multiple variables. The calculation is efficient and the results are accurate. It has a high accuracy rate, good tolerance to outliers and noise, and better training and learning effects on high-dimensional data such as hyperspectral remote sensing. At the same time, a major problem in machine learning is overfitting. For random forests, as long as there are enough trees in the forest, the classifier will not overfit the model and has strong generalization ability.
[0212] Advantages of the implementation of the present invention: The grass yield estimation method for multi-scale segmented remote sensing data and random forest algorithm described in the present invention includes the following steps: obtaining remote sensing data and preprocessing; performing multi-scale segmentation on the preprocessed data to obtain segmentation results; obtaining measured data of sample points in the grass-producing area and creating grassland category classification samples and grass yield estimation samples according to the measured data; constructing a random forest classifier according to the segmentation results and grassland category classification samples and obtaining grassland type classification results; establishing a random forest estimation model according to grassland type classification results, segmentation results and grass yield estimation samples; using the segmentation results as the input vector of the random forest estimation model to predict grass yield; there is no need to test the assumptions such as normality and independence of variables, and there is no need to consider the collinearity problem of multiple variables, and the operation is efficient and the results are accurate. It has a high accuracy rate, good tolerance for outliers and noise, and better training and learning effects on high-dimensional data such as hyperspectral remote sensing. At the same time, a major problem in machine learning is overfitting. For random forests, as long as there are enough trees in the forest, the classifier will not overfit the model and has strong generalization ability.
[0213] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for estimating grass yield based on multi-scale segmented remote sensing data and random forest algorithm, characterized in that: The grass yield estimation method comprises the following steps: Acquire remote sensing data and perform preprocessing, including Sentinel data acquisition and preprocessing, GF data acquisition and preprocessing, wherein the GF data acquisition and preprocessing includes: acquisition and preprocessing of GF-1 data, GF-3 data and GF-6 data, wherein: GF-1 data acquisition and preprocessing include: for GF1-1 PMS image data, it is necessary to perform radiometric calibration, atmospheric correction and orthorectification of multispectral images, and then perform radiometric calibration and orthorectification on panchromatic images. After that, the corrected multispectral images are fused with panchromatic images, and the super-resolution Bayesian algorithm is used to fuse GF-1 data to obtain remote sensing fusion images with multispectral information and high spatial resolution. GF-3 data acquisition and preprocessing include: radiometric calibration, complex data conversion, multi-view processing, filtering and preprocessing operations for GF-3 images; The formula for GF-3 data radiation calibration is: ; in, is the backscattering coefficient, is the radar transmitter transmission power, is the radar signal receiving channel gain, is the two-way antenna pattern, is the emission wavelength, is the azimuth resolution, is the range resolution, M is the image processor power enhancement, R is the slant range, is the incident angle, is the thermal noise power; Complex data conversion converts SAR complex data into SAR intensity / amplitude data. The intensity formula is: Among them: A=Amplitude, I=In-phase, Q=Quadrature channels, the conversion formula between intensity and amplitude is: , where: Intensity is intensity, Amplitude is amplitude; Multi-view processing is specifically the average of the coherence sum of pixels in the field, and the formula is as follows: Use Non-Local Means filtering to filter GF-3. The formula of Non-local Means algorithm is: in, is the denoised image, is a noisy image, is the weight, is the neighborhood of pixel x, where The determination of is the key to this algorithm. In the original image In the equation, the similarity between pixel x and pixel y is The value of the two windows and The square of the Euclidean distance between is determined as follows: in: represents the normalization coefficient, h is the smoothing parameter, and h is the smoothing parameter. The similarity between image blocks is determined by the Euclidean distance; GF-6 data acquisition and preprocessing include: radiometric calibration, atmospheric correction and geometric correction of GF-6 data; After image mosaicking and image cropping are performed on the preprocessed data, multi-scale segmentation is performed on the preprocessed data to obtain the segmentation result; Obtain measured data of sample points in grass-producing areas and create grassland classification samples and grass yield estimation samples based on the measured data; A random forest classifier is constructed based on the segmentation results and the grassland classification samples to obtain the grassland type classification results. Both the random forest classifier and the random forest estimation model need to be modeled by a random forest regression model, which specifically includes the following steps: normalizing the input sample data set; dividing the sample data set into a training set and a test set; for the training set , resample using the Bootstrap method to randomly generate T training sets , , …, ; Generate a corresponding decision tree for each training set , , …, ; Before selecting an attribute on each non-leaf node, randomly select m attributes from all M attributes as the split attribute set of the current node, and select the best split attribute from them as the node to split. ; The generated multiple decision trees form a random forest. For the test set sample X, each decision tree is used to test and obtain the prediction result , , …, ; When used as a random forest estimation model, the predicted value of the test set sample X is the average of the results of these trees; when used as a random forest classifier, the final predicted category is the category with the most votes among the leaf nodes to which the sample point has been sent; A random forest estimation model was established based on grassland type classification results, segmentation results and grass yield estimation samples; The segmentation results were used as input vectors to the random forest estimation model to predict grass yield.
2. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: The Sentinel data acquisition and preprocessing include: performing radiometric calibration and atmospheric correction on the Sentinel raw data; and resampling the image bands to a 10m resolution with the best quality by using a bicubic convolution method.
3. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: The following steps are involved: The total fresh weight of grass yield / edible fresh weight of grass yield at the measured point to be calculated is stored in the sample as the Y value, and the band value extracted from the segmentation result and the EVI and NDVI values are used as the X value; Use the machine learning library to build a random forest regression model. The constructed random forest regression model is used Represents, where X is the input vector, are independent and identically distributed random vectors.
4. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: When estimating a random forest model, the predicted value of the test set sample X is the average of the results of these trees including: For any partition feature A, the corresponding data set divided on both sides of any partition point S , , ask for an envoy , The sum of the mean square errors of each set is the smallest, and , The feature and eigenvalue partition point corresponding to the minimum sum of the mean square error is expressed as: in, for The sample output mean of the dataset, for The sample output mean of the dataset.
5. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: When used as a random forest classifier, the final predicted category is the category with the most votes among the leaf nodes to which the sample point is sent, including: Each classification tree in RF is a binary tree, and its generation follows the top-down recursive splitting principle, that is, the training set is divided from the root node in sequence; in the binary tree, the root node contains all the training data, and is split into left and right nodes according to the principle of minimum node impurity. They each contain a subset of the training data, and the nodes continue to split according to the same rule until the branch stop rule is met and the growth stops; if the classification data on node n all come from the same category, the impurity of this node is 0, and the impurity measurement method is the Gini criterion: For a given training set D, assuming that the training set consists of K categories, , ,… , then the Gini coefficient is: If the training samples are divided into two parts, D1 and D2, depending on whether feature A takes a certain value a, then the Gini index under the condition of feature A is: This is equivalent to calculating the Gini index of the two small sets divided according to feature A respectively, and then taking the expectation based on the empirical probability to obtain the Gini index of D under feature A.
6. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: The random forest regression modeling includes determining the importance of variables, specifically including: Add random noise to the variables of each decision tree, and then test the increase or decrease of the out-of-bag error. If the error increases, the change is more important, otherwise it is not important. The calculation method is: in, Indicates the importance of variable i; represents the out-of-bag (OOB) error, It means randomly adding noise interference to the variable i of all samples of the out-of-bag data OOB, and recalculating the out-of-bag error.
7. The method for estimating grass yield based on multi-scale segmented remote sensing data and random forest algorithm according to claim 1, characterized in that: It includes performing a model evaluation, wherein the model evaluation selects the coefficient of determination And mean square error (MSE), specifically including: in, is the actual observed value, For the model estimate, is the sample mean, is the number of samples.
8. The grass yield estimation method based on multi-scale segmented remote sensing data and random forest algorithm according to any one of claims 1 to 7, characterized in that: The performing multi-scale segmentation on the pre-processed data to obtain the segmentation result comprises: The remote sensing image is divided into several non-overlapping and hole-free subset areas. Each area has the same or similar features and represents a type of ground object. The homogeneity-heterogeneity method is selected to make the homogeneity of the object class as large as possible and the homogeneity between objects as small as possible. The homogeneity is represented by the area and standard deviation inside the image object. The specific formula is: in, and denote the area and standard deviation of the ith region, n is the number of segmented regions at this scale, and wVar represents the homogeneity index; Heterogeneity is represented by the spatial correlation index Moran's I (MI) between image objects. The specific formula is: Among them, n is the number of segmented regions at this scale, is the spatial adjacency weight, is the spectral mean of region i, is the spectral mean of the entire image, MI is the heterogeneity index; if regions i and j are adjacent, ,otherwise .
9. A grass yield estimation device based on multi-scale segmented remote sensing data and random forest algorithm, characterized in that: The grass yield estimation device comprises: Memory for storing computer programs; A processor is used to implement the steps of the method for estimating grass yield using multi-scale segmented remote sensing data and a random forest algorithm as described in any one of claims 1 to 8 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed, implements the steps of the method for estimating grass yield using multi-scale segmented remote sensing data and a random forest algorithm as described in any one of claims 1 to 8.
