Plant growth monitoring and protection method based on spectral monitoring technology
By performing dimensionality reduction and modified Mahalanobis distance calculation on hyperspectral data, constructing an expanded data set, and training the isolation forest algorithm model, the problem of insufficient generalization ability of the isolation forest algorithm in evaluating hyperspectral data anomalies in soybean plant planting areas was solved, and more accurate growth monitoring was achieved.
Patent Information
- Application Number
- CN202510933898.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-08
AI Technical Summary
When the existing isolation forest algorithm is used to evaluate anomalies in hyperspectral data in soybean plantation areas, the dataset cannot fully cover all anomalies, resulting in poor generalization ability of the algorithm.
By collecting raw hyperspectral data, performing dimensionality reduction processing, calculating the spectral component uniformity and corrected Mahalanobis distance, obtaining the baseline and offset sampling weights, constructing an extended data set, and training a machine learning model to monitor the growth of soybean plants.
The generalization ability of the algorithm is improved, ensuring the accuracy of soybean plant growth monitoring, covering more abnormal situations, and enhancing the accuracy of monitoring.
Smart Images

Figure CN120431471B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral analysis, and in particular to a plant growth monitoring and protection method based on spectral monitoring technology. Background Art
[0002] With the continuous advancement of remote sensing technology, spectral instruments and data processing algorithms, the efficiency and accuracy of acquiring and analyzing hyperspectral data of soybean plant planting areas are constantly improving; soybean plants attacked by diseases may experience leaf withering, leaf yellowing, plant growth stunting and other phenomena, thereby affecting the growth of soybean plants; through machine learning algorithms, such as the isolation forest algorithm, anomaly evaluation of hyperspectral data of soybean plant planting areas can help to timely detect signs of pest and disease invasion in the early stages of soybean plant growth process, avoid nutrient and water loss, and realize intelligent soybean plant growth monitoring; consider using the isolation forest algorithm to evaluate anomalies in hyperspectral data of soybean plant planting areas; when using the traditional isolation forest algorithm to evaluate anomalies in hyperspectral data, the collected data may be affected by factors such as soil. For example, some exposed soil areas without soybean plants lead to more extreme anomaly distribution, and the acquired data set cannot fully cover all anomalies, which leads to poor generalization ability of the algorithm. Summary of the Invention
[0003] The present invention provides a plant growth monitoring and protection method based on spectral monitoring technology to solve the problem that when performing abnormality evaluation on hyperspectral data of soybean plant planting areas, the acquired data set cannot fully cover all abnormal situations, resulting in poor generalization ability of the algorithm.
[0004] The plant growth monitoring and protection method based on spectral monitoring technology of the present invention adopts the following technical solutions:
[0005] One embodiment of the present invention provides a plant growth monitoring and protection method based on spectral monitoring technology, the method comprising the following steps:
[0006] Collect hyperspectral raw data of each sample point in the soybean plant planting area;
[0007] Performing dimensionality reduction on the hyperspectral raw data to obtain hyperspectral reduced dimensionality data, wherein each dimension in the hyperspectral reduced dimensionality data is recorded as a wavelength combination;
[0008] Calculating the spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data based on each wavelength combination and the linear combination coefficient of each wavelength and the maximum response change at each wavelength; determining the spectral response intensity coefficient of any two sample points at each wavelength combination based on the spectral component uniformity and the spectral response value of each wavelength combination; obtaining the modified Mahalanobis distance of any two sample points based on the spectral response intensity coefficient;
[0009] The baseline sampling weight of each sample point is calculated according to the modified Mahalanobis distance between any two sample points, and the baseline point is sampled from all sample points based on the baseline sampling weight; the offset sampling weights of other sample points are obtained according to the modified Mahalanobis distance between the baseline point and other sample points, and the offset points are sampled from other sample points based on the offset sampling weight; virtual points are determined based on the baseline points and offset points. All sample points and virtual points constitute an extended data set, which is used to train machine learning models and monitor soybean plant growth.
[0010] Furthermore, the calculation of the spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data based on each wavelength combination and the linear combination coefficient of each wavelength and the maximum response change at each wavelength includes the following specific calculation method:
[0011] Uniqueness of spectral components of the rth wavelength combination The calculation method is:
[0012]
[0013] Where: Represents the first wavelength in the hyperspectral raw data; Indicates the last wavelength in the hyperspectral raw data; Represents the combination of the rth wavelength and the rth wavelength in the hyperspectral dimension reduction data The linear combination coefficient of wavelengths, It represents the standard deviation function. represents the maximum value function; Indicates the relationship between the i-th sample point and the The Euclidean distance of the sample points, Indicates that the i-th sample point in the hyperspectral raw data is The spectral response value at wavelengths, Indicates the first The sample point in The spectral response value at wavelengths, Indicates the number of samples in the neighborhood of the i-th sample point The maximum response change of the spectral value at a wavelength.
[0014] Furthermore, the wavelength combinations and the linear combination coefficients of the wavelengths include the following specific contents:
[0015] The linear combination coefficients corresponding to each wavelength combination in the hyperspectral dimensionality reduction data are obtained according to the PCA principal component analysis method.
[0016] Furthermore, the spectral response intensity coefficients of any two sample points at each wavelength combination are determined based on the singleness of the spectral components and the spectral response values of each wavelength combination, including the specific method of:
[0017] The spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point at the r-th wavelength combination The calculation method is:
[0018]
[0019] Where: Indicates the singleness of the spectral component of the rth wavelength combination, represents the spectral response value of the i-th sample point at the r-th wavelength combination, represents the spectral response value of the j-th sample point at the r-th wavelength combination, Represents an exponential function with a natural constant as its base.
[0020] Furthermore, the modified Mahalanobis distance between any two sample points is obtained based on the spectral response intensity coefficient, and the specific method includes:
[0021] According to the spectral response intensity coefficient when comparing each two sample points at each wavelength combination, the correction matrix between each two sample points is obtained, and the correction matrix between the i-th sample point and the j-th sample point is obtained. for:
[0022]
[0023] Where: It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the first dimension; It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the z-th dimension;
[0024] According to the hyperspectral dimension reduction data of each two sample points and the correction matrix between each two sample points, the corrected Mahalanobis distance between each two sample points and the corrected Mahalanobis distance between the i-th sample point and the j-th sample point are obtained. The calculation method is:
[0025]
[0026] Where: represents the hyperspectral dimension reduction data of the i-th sample point, represents the hyperspectral dimension reduction data of the j-th sample point, represents the correction matrix between the i-th sample point and the j-th sample point, Indicates the variance contribution rate of the first wavelength combination corresponding to the principal component in the PCA principal component analysis, Indicates the variance contribution rate of the z-th wavelength combination corresponding to the principal component in the PCA principal component analysis, represents the function for finding the transposed matrix, Represents the matrix inversion function.
[0027] Furthermore, the specific method of calculating the baseline sampling weight of each sample point based on the modified Mahalanobis distance between any two sample points includes:
[0028] According to the mean of the modified Mahalanobis distance between each sample point and its neighboring sample points, the density of each sample point is obtained. The density of the i-th sample point is The calculation method is:
[0029]
[0030] Where: represents the number of neighboring sample points of the i-th sample point, represents the tth neighboring sample point of the i-th sample point, represents the modified Mahalanobis distance between the i-th sample point and the t-th neighboring sample point of the i-th sample point;
[0031] According to the density of each sample point, the benchmark sampling weight of each sample point is obtained, and the benchmark sampling weight of the i-th sample point is The calculation method is:
[0032]
[0033] Where: represents the density of the i-th sample point, Represents the Sigmoid function.
[0034] Furthermore, the method of sampling the reference point from all the sample points based on the reference sampling weight includes the following specific methods:
[0035] The number of all sample points is recorded as N, and the benchmark sampling weights of all sample points are obtained. All sample points are arranged from large to small according to the benchmark sampling weights, and the sample points with the largest benchmark sampling weight are selected. Sample points, the obtained The sample points are recorded as reference points, and all the reference points and the reference sampling weights of all the reference points are input into the random sampling function for extraction; in the tth round of sampling, a sample point is randomly selected from all the reference points using the datasample function as the reference point for the tth round of sampling.
[0036] Furthermore, the method of obtaining offset sampling weights of other sample points based on the modified Mahalanobis distance between the reference point and other sample points, and sampling offset points from other sample points based on the offset sampling weights, includes the following specific methods:
[0037] The reference point of the t-th round of sampling is the i-th sample point, then the offset sampling weight of the j-th sample point (j≠i) is The calculation method is:
[0038]
[0039] Where: represents the density of the j-th sample point, represents the modified Mahalanobis distance between the i-th sample point and the j-th sample point, represents the Euclidean distance between the i-th sample point and the j-th sample point, It represents the standard deviation function. Represents the Sigmoid function; Represents the standard deviation of the set of modified Mahalanobis distances between the i-th sample point and all sample points, Represents the standard deviation of the set of Euclidean distances between the i-th sample point and all sample points;
[0040] Get the offset sampling weights of all sample points in the tth round of sampling, arrange all sample points from large to small according to the offset sampling weights of the tth round of sampling, and take the one with the largest offset sampling weight Sample points, this The sample points are recorded as offset points, and all offset points and the offset sampling weights of all offset points are input into the random sampling function for extraction; a sample point is randomly selected from all offset points using the datasample function as the offset point for the tth round of sampling.
[0041] Furthermore, the specific method of determining the virtual point based on the reference point and the offset point includes:
[0042] The reference point of the t-th round sampling is the a-th sample point, the offset point of the t-th round sampling is the b-th sample point, and the spectral response value of the r-th wavelength combination of the t-th virtual point is established. for:
[0043]
[0044] Where: It represents the spectral response value of the a-th sample point at the r-th wavelength combination, Represents the spectral response value of the bth sample point at the rth wavelength combination.
[0045] Furthermore, the method of using the expanded data set to train a machine learning model and monitor soybean plant growth includes the following specific methods:
[0046] The hyperspectral dimensionality reduction data of all sample points and virtual points in the expanded data set are input into the isolation forest algorithm model in vector format. The output of the isolation forest algorithm is the anomaly score of each data point; sample points with anomaly scores greater than the preset anomaly threshold G are screened out; all the screened sample points are recorded as outliers; the location of soybean plants with abnormal growth can be obtained through the corresponding position of the outlier in the hyperspectral dimensionality reduction data, realizing intelligent soybean plant growth monitoring based on spectral characteristics.
[0047] The beneficial effects of the technical solution of the present invention are as follows: the present invention corrects the Mahalanobis distance according to the singleness of the spectral components to obtain the corrected Mahalanobis distance, and takes into account the influence of the singleness of the spectral components and the size of the spectral response value on the Mahalanobis distance, so as to ensure that sample points with large differences can be sampled as much as possible during subsequent sampling; the benchmark point obtained according to the corrected Mahalanobis distance has a large number of sample points with high feature similarity to the benchmark point among the sample points adjacent to the benchmark point, so as to ensure that the benchmark point can describe the normal samples of most soybean plant growth conditions; with the benchmark point as a reference, the sample point that is more abnormal relative to the benchmark point is obtained as an offset point, so that the constructed virtual point can cover the features between normal and abnormal, thereby covering more abnormal conditions, improving the generalization ability of the algorithm, and thus ensuring the accuracy of soybean plant growth monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 paying any creative work.
[0049] Figure 1 This is a flow chart of the steps of the plant growth monitoring and protection method based on spectral monitoring technology of the present invention. DETAILED DESCRIPTION
[0050] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the plant growth monitoring and protection method based on spectral monitoring technology, including its specific implementation, structure, features, and effectiveness. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0051] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0052] The specific scheme of the plant growth monitoring and protection method based on spectral monitoring technology provided by the present invention is described in detail below with reference to the accompanying drawings.
[0053] See also Figure 1 , which shows a flow chart structure diagram of a plant growth monitoring and protection method based on spectral monitoring technology provided by an embodiment of the present invention, the method includes the following steps:
[0054] Step S001: collecting hyperspectral raw data of each sample point in the soybean plant planting area.
[0055] The purpose of this example is to expand the hyperspectral dataset used for the soybean plant growth monitoring machine learning model to improve the generalization ability of the soybean plant growth monitoring algorithm; therefore, it is first necessary to collect hyperspectral data of the soybean plant planting area and denoise the hyperspectral data.
[0056] Specifically, an unmanned aerial vehicle (UAV) remote sensing device equipped with a hyperspectral sensor is used to collect hyperspectral data of the soybean plant planting area in the soybean plant planting area; a spectral smoothing operation is used to denoise the hyperspectral data segments of the soybean plant planting area in the visible light band and the near-infrared band to obtain the denoised hyperspectral data segments of the soybean plant planting area; each point in the soybean plant planting area is recorded as a sample point, and the denoised hyperspectral data segment of each sample point is recorded as the hyperspectral original data of each sample point.
[0057] Step S002: Dimensionality reduction is performed on the hyperspectral original data to obtain hyperspectral dimension-reduced data.
[0058] It should be noted that the hyperspectral raw data contains too many bands and spectral response value data corresponding to redundant bands, and the spectral response values corresponding to some wavelengths are relatively small, resulting in information redundancy in the hyperspectral raw data. Therefore, the PCA principal component analysis method is used to reduce the dimensionality of the hyperspectral raw data, and the principal components obtained are linear combinations of the dimensions before dimensionality reduction. All principal components with variance contribution rates greater than the preset dimensionality reduction threshold are retained to constitute the dimensionality reduction result, and the principal components with smaller variance contribution rates are ignored to achieve the purpose of simplifying information. The obtained dimensionality reduction results are recorded as hyperspectral dimensionality reduction data.
[0059] Specifically, for the hyperspectral raw data, each dimension of the hyperspectral raw data represents each wavelength, and the value of each dimension of the hyperspectral raw data represents the spectral response value at each wavelength. In this embodiment, the value of the absorbance is used as the spectral response value, and in other embodiments, the numerical value of physical quantities such as reflectance or emissivity can be taken as the spectral response value; PCA principal component analysis is performed on the hyperspectral raw data of all sample points, and the first z principal components whose variance contribution rate is greater than the preset dimensionality reduction threshold are retained to constitute the dimensionality reduction result; this embodiment is described using the preset dimensionality reduction threshold of 85% as an example, and other embodiments can be set to other values, which are not specifically limited in this embodiment; as an example, the hyperspectral raw data of the i-th sample point is recorded as , the dimensionality reduction result of the hyperspectral original data of the i-th sample point is recorded as the hyperspectral dimensionality reduction data , the dimension of the hyperspectral dimensionality reduction data is z; similarly, the hyperspectral dimensionality reduction data of each sample point is obtained.
[0060] It should be further explained that each dimension of the hyperspectral dimensionality reduction data obtained by dimensionality reduction according to the PCA principal component analysis method is a linear combination of each wavelength of the hyperspectral original data, and each dimension of the hyperspectral dimensionality reduction data and each wavelength of the hyperspectral original data correspond to a linear combination coefficient. Therefore, in this embodiment, each dimension of the hyperspectral dimensionality reduction data is recorded as each wavelength combination, and each wavelength combination and each wavelength of the hyperspectral original data correspond to a linear combination coefficient; the spectral response value on each wavelength combination of the hyperspectral dimensionality reduction data corresponds to the linear combination of the spectral response value on each wavelength of the hyperspectral original data.
[0061] Step S003: Calculate the spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data based on each wavelength combination and the linear combination coefficient of each wavelength and the maximum change of the spectral response value at each wavelength; determine the spectral response intensity coefficient of any two sample points at each wavelength combination based on the spectral component uniformity and the spectral response value of each wavelength combination.
[0062] It should be noted that different material components exhibit different spectral response values at different wavelengths. Since each wavelength combination of the hyperspectral dimensionality reduction data is a linear combination of each wavelength of the hyperspectral original data, the hyperspectral dimensionality reduction data also has the characteristic that different material components exhibit different spectral response values at different wavelength combinations. The spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data is calculated based on the maximum response change at each wavelength. The greater the spectral component uniformity of the wavelength combination, the more uniform the material component that determines the spectral response value at this wavelength combination is, and the more likely the spectral response value of this wavelength combination is determined only by soil or soybean plants.
[0063] Specifically, according to the PCA principal component analysis, the linear combination coefficients corresponding to each wavelength combination and each wavelength of the hyperspectral original data before dimensionality reduction are obtained, which are recorded as the linear combination coefficients of wavelength combination and wavelength; as an example, the singleness of the spectral component of the rth wavelength combination The calculation method is as follows:
[0064]
[0065] Where: Represents the first wavelength in the hyperspectral raw data; Indicates the last wavelength in the hyperspectral raw data; Represents the combination of the rth wavelength and the rth wavelength in the hyperspectral dimension reduction data The linear combination coefficient of wavelengths, It represents the standard deviation function. represents the maximum value function; Indicates the relationship between the i-th sample point and the The Euclidean distance of the sample points, Indicates that the i-th sample point in the hyperspectral raw data is The spectral response value at wavelengths, Indicates the first The sample point in The spectral response value at wavelengths, Indicates the number of samples in the neighborhood of the i-th sample point The maximum response change of the spectral value at each wavelength;
[0066] It should be noted that, Represents the combination of the rth wavelength and the rth wavelength in the hyperspectral dimension reduction data When calculating the spectral component uniformity of the r-th wavelength combination, the linear combination coefficients of the r-th wavelength combination and each wavelength are used for weighted average, so that the wavelength with higher weight in the composition of the r-th wavelength combination contributes more to the spectral component uniformity; it reflects that the i-th sample point is in the The degree of change of the spectral response value at each wavelength. It should be noted that in this embodiment, the range with a Euclidean distance less than 5 centered on each sample point is the neighborhood of each sample point. In other embodiments, the neighborhood range of other sizes can be defined, and this embodiment does not specifically limit it;
[0067] Indicates that all sample points in The standard deviation of the set consisting of the maximum variation of the spectral response values at each wavelength; if there is only soil or soybean plant parts in the neighborhood of the sample point, the variation of the spectral response values of the sample point at each wavelength will fluctuate violently with the change of the position of the soil and the soybean plant, and thus the standard deviation of the set consisting of the variation of the spectral response values of the sample point at each wavelength is larger; if there are both soil and soybean plant parts in the neighborhood of the sample point, the variation of the spectral response values of the sample point at each wavelength is relatively gentle relative to the sample points with only soil or soybean plant parts in the neighborhood, and thus the standard deviation of the set consisting of the variation of the spectral response values of the sample point at each wavelength is smaller;
[0068] Similarly, the spectral component uniformity of each wavelength combination is obtained.
[0069] It should be noted that when any two sample points are compared at each wavelength combination, if the spectral component homogeneity at the wavelength combination is large and at least one sample point has a large spectral response value at the wavelength combination, then the characteristics exhibited by the two sample points are obvious. The spectral response intensity coefficients of any two sample points at each wavelength combination are determined based on the spectral component homogeneity and the spectral response value of each wavelength combination.
[0070] As an example, the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point at the r-th wavelength combination is The calculation method is as follows:
[0071]
[0072] Where: Indicates the singleness of the spectral component of the rth wavelength combination, represents the spectral response value of the i-th sample point at the r-th wavelength combination, represents the spectral response value of the j-th sample point at the r-th wavelength combination, represents an exponential function with a natural constant as its base;
[0073] It should be noted that, Indicates the singleness of the spectral components of the rth wavelength combination. The greater the singleness of the spectral components of the wavelength combination, the more single the material components that determine the spectral response value at this wavelength combination are. When the value of is large, it means that at least one of the spectral response values of the i-th sample point and the j-th sample point on the wavelength combination is large; The larger the product represented, the more obvious the characteristics of the two sample points are. When calculating the modified Mahalanobis distance, the spectral response intensity coefficients of the two sample points in the calculation are larger.
[0074] Similarly, the spectral response intensity coefficient when every two sample points are compared in each dimension is obtained.
[0075] Step S004: obtaining a modified Mahalanobis distance between any two sample points based on the spectral response intensity.
[0076] It should be noted that the traditional Mahalanobis distance is only calculated through the covariance matrix of the data in different dimensions, which cannot accurately reflect the characteristic differences between the two sample points; therefore, the correction matrix between each two sample points is obtained based on the spectral response intensity coefficient when each two sample points are compared at each wavelength combination; on the basis of the traditional Mahalanobis distance calculation method, the distance measure between each two sample points is corrected by combining the hyperspectral dimensionality reduction data of each two sample points and the correction matrix between each two sample points to obtain the corrected Mahalanobis distance between each two sample points.
[0077] Furthermore, the correction matrix between the i-th sample point and the j-th sample point is obtained :
[0078]
[0079] Where: It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the first dimension; It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the z-th dimension.
[0080] Similarly, obtain the correction matrix between every two sample points.
[0081] Furthermore, according to the hyperspectral dimension reduction data of the i-th sample point and the j-th sample point and the correction matrix between the i-th sample point and the j-th sample point, the corrected Mahalanobis distance between the i-th sample point and the j-th sample point is obtained. , the calculation method is as follows:
[0082]
[0083] Where: represents the hyperspectral dimension reduction data of the i-th sample point, represents the hyperspectral dimension reduction data of the j-th sample point, represents the correction matrix between the i-th sample point and the j-th sample point, Indicates the variance contribution rate of the first wavelength combination corresponding to the principal component in the PCA principal component analysis, Indicates the variance contribution rate of the z-th wavelength combination corresponding to the principal component in the PCA principal component analysis, represents the function for finding the transposed matrix, Represents the matrix inversion function.
[0084] Similarly, obtain the modified Mahalanobis distance between every two sample points.
[0085] It should be noted that this embodiment corrects the Mahalanobis distance between each two sample points based on the spectral response values of each dimension in the hyperspectral dimensionality reduction data of each two sample points and the uniformity of the spectral components of each wavelength combination, so as to take into account the influence of the uniformity of the spectral components and the size of the spectral response value on the Mahalanobis distance in the calculation of the Mahalanobis distance, and ensure that in subsequent sampling, sample points with large differences can be sampled as much as possible.
[0086] Step S005: Calculate the baseline sampling weight of each sample point based on the modified Mahalanobis distance between any two sample points. The sample point with the largest baseline sampling weight is recorded as the baseline point. Obtain the offset sampling weights of other sample points based on the modified Mahalanobis distance between the baseline point and other sample points. The other sample points with the largest offset sampling weights are recorded as offset points. Determine virtual points based on the baseline points and offset points. All sample points and virtual points constitute the expanded data set.
[0087] It should be noted that in order to sample sample points with large differences, two samplings are performed; several sample points with the smallest modified Mahalanobis distance to a certain sample point are recorded as the neighboring sample points of the sample point, and the density of the sample point is obtained according to the average of the modified Mahalanobis distance between the sample point and the nearest sample point of the sample point, and then the benchmark sampling weight of the sample point is obtained; several sample points with the largest benchmark sampling weight are taken as benchmark points. Usually, in the soybean plant planting area, the soybean plants with normal growth account for the majority, so the benchmark points obtained are the sample points with relatively normal growth among all the sample points; each sampling is performed using a random sampling function to randomly select one from all the benchmark points The sample point is used as the reference point for this sampling, and the offset sampling weight is calculated based on the modified Mahalanobis distance between the reference point of this sampling and all sample points. Several sample points with the largest offset sampling weights are taken as offset points. The larger the offset sampling weight of a sample point, the more abnormal the sample point is relative to the reference point of this sampling. A random sampling function is used to randomly extract a sample point from all offset points as the offset point for this sampling. For each sampling, two sample points are selected from the sample point set as the reference point and offset point for this sampling, and linear interpolation is used to construct virtual point hyperspectral dimensionality reduction data to expand the data set so that the data set can fully cover more abnormal situations.
[0088] Specifically, the T sample points with the smallest modified Mahalanobis distance to a certain sample point are recorded as the neighboring sample points of the sample point. In this embodiment, T=10 is used as an example for description. Other embodiments may set it to other values, which are not specifically limited in this embodiment. The density of each sample point is obtained based on the average of the modified Mahalanobis distances between each sample point and its neighboring sample points. As an example, the density of the i-th sample point is The calculation method is as follows:
[0089]
[0090] Where: Indicates the number of neighboring sample points of the i-th sample point. In this embodiment, , represents the tth neighboring sample point of the i-th sample point, represents the modified Mahalanobis distance between the i-th sample point and the t-th neighboring sample point of the i-th sample point;
[0091] It should be noted that the density of the i-th sample point The larger the value is, the more sample points in the neighborhood of the i-th sample point have high similarity with the i-th sample point in terms of spectral composition and spectral response value characteristics.
[0092] Furthermore, the Sigmoid function is used to transform the density of the i-th sample point The value of is normalized to the range of [0,1], and the normalized value is used as the benchmark sampling weight of the i-th sample point , then the benchmark sampling weight ; Record the number of all sample points as N, obtain the benchmark sampling weights of all sample points, arrange all sample points from large to small according to the benchmark sampling weights, and take the one with the largest benchmark sampling weight Sample points, this The sample points are recorded as reference points, and all the reference points and the reference sampling weights of all the reference points are input into the random sampling function for extraction. This embodiment uses the datasample function as an example for description. Other embodiments may choose other random sampling functions, which are not specifically limited in this embodiment.
[0093] As an example, in the t-th round of sampling, use the datasample function to randomly select a sample point from all the reference points as the reference point for the t-th round of sampling; calculate the offset sampling weight of each sample point based on the modified Mahalanobis distance between the reference point for the t-th round of sampling and all the sample points and the Euclidean distance between the reference point for the t-th round of sampling and all the sample points; if the reference point for the t-th round of sampling is the i-th sample point, then the offset sampling weight of the j-th sample point (j≠i) is The calculation method is as follows:
[0094]
[0095] Where: represents the density of the j-th sample point, represents the modified Mahalanobis distance between the i-th sample point and the j-th sample point, represents the Euclidean distance between the i-th sample point and the j-th sample point, It represents the standard deviation function. Represents the Sigmoid normalization function, the normalization range is [0,1]; Represents the standard deviation of the set of modified Mahalanobis distances between the i-th sample point and all sample points, Represents the standard deviation of the set of Euclidean distances between the i-th sample point and all sample points;
[0096] It should be noted that, represents the density of the j-th sample point, The larger the value, the closer the average distance between the jth sample point and its neighboring sample points. Indicates the distance distribution between the jth sample point and the i-th sample point in the Mahalanobis distance metric, Indicates the distance distribution between the j-th sample point and the i-th sample point; and The larger the value, the more abnormal the j-th sample point is relative to the i-th sample point, and the offset sampling weight of the j-th sample point is The bigger;
[0097] Get the offset sampling weights of all sample points in the tth round of sampling, arrange all sample points from large to small according to the offset sampling weights of the tth round of sampling, and take the one with the largest offset sampling weight Sample points, this The sample points are recorded as offset points, and all offset points and the offset sampling weights of all offset points are input into the random sampling function for extraction; the datasample function is used to randomly extract a sample point from all offset points as the offset point of the tth round of sampling.
[0098] Furthermore, after obtaining the reference point of the t-th round of sampling and the offset point of the t-th round of sampling, the average value of the spectral response value of each wavelength combination of the reference point of the t-th round of sampling and the offset point of the t-th round of sampling is used as the spectral response value of each wavelength combination of the virtual point of the t-th round of sampling, and the hyperspectral dimensionality reduction data of the t-th virtual point is constructed; as an example, the reference point of the t-th round of sampling is the a-th sample point, the offset point of the t-th round of sampling is the b-th sample point, and the spectral response value of the r-th wavelength combination of the t-th virtual point established is for: , It represents the spectral response value of the a-th sample point at the r-th wavelength combination, Represents the spectral response value of the b-th sample point at the r-th wavelength combination; obtains the spectral response value of the t-th virtual point at all wavelength combinations;
[0099] Then, according to the above method, the t+1th round of sampling is performed to obtain the reference points and offset points of the t+1th round of sampling and obtain virtual points; sampling is performed until the same number of virtual points as the original sample points is obtained, then a total of N samplings are completed, N pairs of reference points and offset points are obtained, and N virtual points are constructed; the set consisting of the hyperspectral dimensionality reduction data of all virtual points and all sample points is recorded as the expanded data set.
[0100] It should be noted that, in this embodiment, the density of each sample point is obtained based on the modified Mahalanobis distance, and then the benchmark sampling weight is obtained; the benchmark point is obtained based on the benchmark sampling weight, and the offset sampling weight is obtained with reference to the benchmark point, and then the offset point is obtained; the neighboring sample points of the benchmark point obtained based on the density of each sample point have more sample points with high similarity to its characteristics, ensuring that the benchmark point can describe the normal sample of the growth conditions of most soybean plants; the sample points that are more abnormal relative to the benchmark point are obtained with reference to the benchmark point as offset points, so that the constructed virtual points can cover the features between normal and abnormal, thereby covering more abnormal situations and improving the generalization ability and accuracy of the algorithm.
[0101] Step S006: Use the expanded data set to train a machine learning model and monitor the growth of soybean plants.
[0102] Specifically, the hyperspectral dimensionality reduction data of all sample points and virtual points in the expanded data set are input into the machine learning model; this embodiment is described using the isolation forest algorithm as an example, other embodiments may select other machine learning models, and this embodiment does not make specific limitations; the hyperspectral dimensionality reduction data of all sample points and virtual points in the expanded data set are input into the isolation forest algorithm in vector format, and the output of the isolation forest algorithm is the anomaly score of each data point; sample points whose anomaly scores are greater than a preset anomaly threshold G are screened out; this embodiment is described using the preset threshold G=0.7 as an example, other embodiments may be set to other values, and this embodiment does not make specific limitations; since the virtual points are virtual data constructed to improve the accuracy of the results and have nothing to do with the actual growth of soybean plants, only sample points are screened here; all sample points obtained by screening are recorded as abnormal points; the position of the soybean plant with abnormal growth can be obtained through the corresponding position of the abnormal point in the hyperspectral dimensionality reduction data, thereby realizing intelligent soybean plant growth monitoring based on spectral features.
[0103] It should be noted that the The model only shows negative correlation and the output of the constraint model is in In the interval, As the input of this model, it can be replaced by other models with the same purpose in specific implementation. This embodiment is just based on The model is used as an example for description without making any specific limitations.
[0104] At this point, this embodiment is completed.
[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A plant growth monitoring and protection method based on spectral monitoring technology, characterized in that: The method comprises the following steps: Collect hyperspectral raw data of each sample point in the soybean plant planting area; Performing dimensionality reduction on the hyperspectral raw data to obtain hyperspectral reduced dimensionality data, wherein each dimension in the hyperspectral reduced dimensionality data is recorded as a wavelength combination; Calculating the spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data based on each wavelength combination and the linear combination coefficient of each wavelength and the maximum response change at each wavelength; determining the spectral response intensity coefficient of any two sample points at each wavelength combination based on the spectral component uniformity and the spectral response value of each wavelength combination; obtaining the modified Mahalanobis distance of any two sample points based on the spectral response intensity coefficient; The baseline sampling weight of each sample point is calculated based on the modified Mahalanobis distance between any two sample points, and a baseline point is sampled from all sample points based on the baseline sampling weight. The offset sampling weights of other sample points are obtained based on the modified Mahalanobis distance between the baseline point and other sample points, and offset points are sampled from other sample points based on the offset sampling weight. Virtual points are determined based on the baseline points and offset points. All sample points and virtual points constitute an expanded data set, which is used to train a machine learning model and monitor soybean plant growth. The specific method of obtaining the modified Mahalanobis distance between any two sample points based on the spectral response intensity coefficient includes: According to the spectral response intensity coefficient when comparing each two sample points at each wavelength combination, the correction matrix between each two sample points is obtained, and the correction matrix between the i-th sample point and the j-th sample point is obtained. for: Where: It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the first dimension; It represents the spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point in the z-th dimension; According to the hyperspectral dimension reduction data of each two sample points and the correction matrix between each two sample points, the corrected Mahalanobis distance between each two sample points and the corrected Mahalanobis distance between the i-th sample point and the j-th sample point are obtained. The calculation method is: Where: represents the hyperspectral dimension reduction data of the i-th sample point, represents the hyperspectral dimension reduction data of the j-th sample point, represents the correction matrix between the i-th sample point and the j-th sample point, Indicates the variance contribution rate of the first wavelength combination corresponding to the principal component in the PCA principal component analysis, Indicates the variance contribution rate of the z-th wavelength combination corresponding to the principal component in the PCA principal component analysis, represents the function for finding the transposed matrix, Represents the matrix inversion function.
2. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 1, characterized in that: The specific calculation method for calculating the spectral component uniformity of each wavelength combination of the hyperspectral dimensionality reduction data based on each wavelength combination, the linear combination coefficient of each wavelength, and the maximum response change at each wavelength is as follows: Uniqueness of spectral components of the rth wavelength combination The calculation method is: Where: Represents the first wavelength in the hyperspectral raw data; Indicates the last wavelength in the hyperspectral raw data; Represents the combination of the rth wavelength and the rth wavelength in the hyperspectral dimension reduction data The linear combination coefficient of wavelengths, It represents the standard deviation function. represents the maximum value function; Indicates the relationship between the i-th sample point and the The Euclidean distance of the sample points, Indicates that the i-th sample point in the hyperspectral raw data is The spectral response value at wavelengths, Indicates the first The sample point in The spectral response value at wavelengths, Indicates the number of samples in the neighborhood of the i-th sample point The maximum response change of the spectral value at a wavelength.
3. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 2, characterized in that: The wavelength combinations and the linear combination coefficients of the wavelengths include the following specific contents: The linear combination coefficients corresponding to each wavelength combination in the hyperspectral dimensionality reduction data are obtained according to the PCA principal component analysis method.
4. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 1, characterized in that: The specific method of determining the spectral response intensity coefficient of any two sample points at each wavelength combination based on the singleness of the spectral components and the spectral response value of each wavelength combination is as follows: The spectral response intensity coefficient when the i-th sample point is compared with the j-th sample point at the r-th wavelength combination The calculation method is: Where: Indicates the singleness of the spectral component of the rth wavelength combination, represents the spectral response value of the i-th sample point at the r-th wavelength combination, represents the spectral response value of the j-th sample point at the r-th wavelength combination, Represents an exponential function with a natural constant as its base.
5. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 1, characterized in that: The specific method of calculating the baseline sampling weight of each sample point based on the modified Mahalanobis distance between any two sample points includes: According to the mean of the modified Mahalanobis distance between each sample point and its neighboring sample points, the density of each sample point is obtained. The density of the i-th sample point is The calculation method is: Where: represents the number of neighboring sample points of the i-th sample point, represents the tth neighboring sample point of the i-th sample point, represents the modified Mahalanobis distance between the i-th sample point and the t-th neighboring sample point of the i-th sample point; According to the density of each sample point, the benchmark sampling weight of each sample point is obtained, and the benchmark sampling weight of the i-th sample point is The calculation method is: Where: represents the density of the i-th sample point, Represents the Sigmoid function.
6. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 1, characterized in that: The specific method of sampling the reference point from all sample points based on the reference sampling weight is as follows: The number of all sample points is recorded as N, and the benchmark sampling weights of all sample points are obtained. All sample points are arranged from large to small according to the benchmark sampling weights, and the sample points with the largest benchmark sampling weight are selected. Sample points, the obtained The sample points are recorded as reference points, and all the reference points and the reference sampling weights of all the reference points are input into the random sampling function for extraction; in the tth round of sampling, a sample point is randomly selected from all the reference points using the datasample function as the reference point for the tth round of sampling.
7. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 6, characterized in that: The method of obtaining the offset sampling weights of other sample points based on the modified Mahalanobis distance between the reference point and other sample points, and sampling the offset points from other sample points based on the offset sampling weights, includes the following specific methods: The reference point of the t-th round of sampling is the i-th sample point, then the offset sampling weight of the j-th sample point is The calculation method is: Where: represents the density of the j-th sample point, Represents the modified Mahalanobis distance between the i-th sample point and the j-th sample point, j≠i, represents the Euclidean distance between the i-th sample point and the j-th sample point, It represents the standard deviation function. Represents the Sigmoid function; Represents the standard deviation of the set of modified Mahalanobis distances between the i-th sample point and all sample points, Represents the standard deviation of the set of Euclidean distances between the i-th sample point and all sample points; Get the offset sampling weights of all sample points in the tth round of sampling, arrange all sample points from large to small according to the offset sampling weights of the tth round of sampling, and take the one with the largest offset sampling weight Sample points, this The sample points are recorded as offset points, and all offset points and the offset sampling weights of all offset points are input into the random sampling function for extraction; a sample point is randomly selected from all offset points using the datasample function as the offset point for the tth round of sampling.
8. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 6, characterized in that: The specific method of determining the virtual point based on the reference point and the offset point includes: The reference point of the t-th round sampling is the a-th sample point, the offset point of the t-th round sampling is the b-th sample point, and the spectral response value of the r-th wavelength combination of the t-th virtual point is established. for: Where: It represents the spectral response value of the a-th sample point at the r-th wavelength combination, Represents the spectral response value of the bth sample point at the rth wavelength combination.
9. The plant growth monitoring and protection method based on spectral monitoring technology according to claim 1, characterized in that: The method of using the expanded dataset to train a machine learning model and monitor soybean plant growth includes the following specific methods: The hyperspectral dimensionality reduction data of all sample points and virtual points in the expanded data set are input into the isolation forest algorithm model in vector format. The output of the isolation forest algorithm is the anomaly score of each data point. Sample points with anomaly scores greater than the preset anomaly threshold G are screened out. All the sample points obtained by screening are recorded as outliers. The location of soybean plants with abnormal growth can be obtained by the corresponding position of the outlier in the hyperspectral dimensionality reduction data.
Citation Information
Patent Citations
Near infrared spectrum abnormal sample identification method based on high-dimensional subspace
CN119125067A
Printing apparatus and printing method
US20130127946A1