Wheat canopy moisture deficiency machine vision intelligent diagnosis method

Through the combination of machine vision technology and deep forest model, the real-time and efficiency problems of moisture loss monitoring in wheat canopy are solved, and high-precision moisture loss diagnosis is achieved, meeting the needs of efficient and precise management of modern agriculture.

CN120107656AActive Publication Date: 2025-06-06CHINA INST OF WATER RESOURCES & HYDROPOWER RES
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510102318.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-06-06
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

The prior art is difficult to realize real-time and dynamic monitoring of wheat canopy moisture deficiency, and traditional methods have problems such as collection limitations and low diagnostic efficiency.

Method used

Using machine vision technology, wheat canopy images are segmented through the Otsu threshold segmentation algorithm optimized by HSV-bilateral filtering. The canopy phenotypic features are extracted in combination with color space conversion, statistical feature analysis and grayscale symbiosis matrix methods, and the improved deep forest model is used for training to achieve intelligent diagnosis of water loss in wheat canopy.

Benefits of technology

The image analysis and diagnosis efficiency of wheat canopy moisture loss is improved, the recognition accuracy and generalization ability of the model are enhanced, and the drought status of wheat can be monitored and diagnosed more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107656A_ABST
    Figure CN120107656A_ABST
Patent Text Reader

Abstract

The invention discloses a machine vision intelligent diagnosis method for wheat canopy moisture deficiency, which comprises the following steps of: S1, acquiring a plurality of wheat canopy images under the stress of appropriate moisture, moderate drought and severe drought, and segmenting the wheat canopy images by adopting an HSV-bilateral filtering optimized Otsu threshold segmentation algorithm; s2, extracting canopy phenotypic features of the segmented wheat canopy image by combining color space conversion, statistical feature analysis and a gray-level co-occurrence matrix method, and taking the canopy phenotypic features as a data set for model training; s3, training the improved deep forest model by adopting the data set to obtain a machine vision intelligent diagnosis model of wheat canopy moisture deficiency; and S4, obtaining a to-be-classified wheat canopy image, obtaining canopy phenotypic features by adopting the steps S1 to S2, and then inputting the canopy phenotypic features into the machine vision intelligent diagnosis model for classification to obtain a water loss type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an intelligent recognition technology for agricultural drought conditions, and in particular to a machine vision intelligent diagnosis method for wheat canopy water deficiency. Background Art

[0002] With global climate change and the continuous expansion of agricultural production, the rational use of agricultural water resources faces huge challenges. Water shortage has become one of the key factors restricting the sustainable development of agriculture. As an important food crop, the water supply during the growth of wheat is crucial. However, traditional wheat moisture monitoring methods have many shortcomings and cannot meet the needs of efficient and precise management of modern agriculture.

[0003] Under the current trend of scientific and technological development, machine vision technology is increasingly widely used in the agricultural field due to its non-destructive, efficient and accurate characteristics. Crop drought machine vision diagnosis technology is in a rapid development stage. There are currently many main methods, but they all have certain limitations. For example, although satellite remote sensing and drone spectral information collection can provide large-scale and high-precision crop information, they are limited by the long satellite transit cycle, complex data processing process and high cost of use, and it is difficult to meet the needs of real-time and rapid diagnosis.

[0004] Therefore, developing an efficient and accurate machine vision intelligent diagnosis method is of great significance for monitoring wheat canopy water loss. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for intelligent machine vision diagnosis of wheat canopy water loss, which solves the problem that remote sensing images are limited in acquisition and it is difficult to dynamically monitor and diagnose wheat drought in real time.

[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0007] A method for machine vision intelligent diagnosis of wheat canopy moisture deficiency is provided, which comprises the following steps:

[0008] S1. Collect multiple wheat canopy images under suitable water content, moderate drought and severe drought stress, and segment the wheat canopy images using the Otsu threshold segmentation algorithm optimized by HSV-bilateral filtering;

[0009] S2, using a combination of color space conversion, statistical feature analysis and gray-level co-occurrence matrix method to extract the canopy phenotypic characteristics of the segmented wheat canopy image, and use it as a data set for model training;

[0010] S3. Use the dataset to train the improved deep forest model and obtain a machine vision intelligent diagnosis model for wheat canopy water loss;

[0011] S4, obtaining a wheat canopy image to be classified, and using steps S1 to S2 to obtain canopy phenotypic characteristics, and then inputting the machine vision intelligent diagnosis model for classification to obtain the water deficiency type;

[0012] The improved deep forest model includes a multi-granularity scanning part, a multi-scale attention module and a cascade forest part which are connected in sequence.

[0013] The beneficial effects of the present invention are as follows: this scheme optimizes the Otsu threshold segmentation algorithm by combining the HSV-bilateral filtering algorithm to perform image segmentation, effectively separating the wheat canopy area from the background area, and ensuring the accuracy of subsequent analysis; adopts color space conversion, statistical feature analysis and gray-level co-occurrence matrix methods to extract wheat phenotypic characteristics, so that the extracted wheat canopy characteristics are more comprehensive and accurate, and the recognition performance of the model is improved; adopts the improved deep forest model for recognition, further improving the recognition accuracy and generalization ability of the model, and greatly improving the accuracy and efficiency of image analysis and water loss diagnosis.

[0014] Furthermore, the method of using the data set to train the improved deep forest model includes:

[0015] S31, dividing the data set into a training set and a test set, inputting the training set into the multi-granularity scanning part to perform multi-scale scanning to extract multi-granularity features, and splicing them in the horizontal direction to obtain a high-dimensional feature matrix;

[0016] S32, input the high-dimensional feature matrix into the multi-scale attention module, perform horizontal pooling and vertical pooling on the high-dimensional feature matrix through the pooling layer, and then use the splicing layer to splice the two pooled features;

[0017] S33, input the concatenated features into the convolution layer for a two-dimensional convolution operation, and then convert the features after the two-dimensional convolution operation into attention weights through a group normalization layer and a Sigmoid activation function in sequence;

[0018] S34, using a multi-branch convolution module of a multi-scale attention module to perform dimensionality reduction processing on the high-dimensional feature matrix to obtain a feature matrix after dimensionality reduction;

[0019] S35, fusing the feature matrix after dimension reduction with the attention weight to obtain a fused feature matrix corresponding to each canopy phenotypic feature;

[0020] S36, taking all fused feature matrices as the input of the cascade forest of the deep forest, and training through the random forest of the first layer of the cascade forest and the completely random forest;

[0021] S37, using the test set to test the generated deep forest, and determine whether the test accuracy is less than the accuracy of the previous layer, if so, proceed to step S39; otherwise, proceed to step S38;

[0022] S38, adding one layer to the cascade forest, and concatenating the output of the previous layer with the fusion feature matrix as the input of the added layer, continuing training, and then returning to step S37;

[0023] S39. Complete model training and obtain a machine vision intelligent diagnosis model for wheat canopy water deficiency.

[0024] The beneficial effects of the above technical solution are: when facing high-dimensional feature space, traditional deep forests may suffer from low training efficiency and overfitting due to interference from redundant and irrelevant features. In order to solve these problems, this solution introduces an innovative high-performance multi-scale attention module into the traditional deep forest model, aiming to enhance the model's ability to focus on local important information. The high-performance multi-scale attention module can adaptively adjust the feature weights of different regions or granularities, make full use of the sliding window size and step size of the multi-granularity scanning part, and automatically learn the importance of the input features, thereby highlighting important features in the multi-level feature extraction process, suppressing the interference of irrelevant information, and improving the performance of the overall model.

[0025] The core idea of ​​deep forest is to automatically complete feature learning and classification tasks by cascading and connecting multiple ensemble learners such as random forests; this method not only simplifies the model structure and reduces the dependence on large-scale training data, but also improves classification efficiency. The improved deep forest, by introducing a high-performance multi-scale attention module, enhances the ability of deep forest to focus on image classification features, thereby improving classification performance.

[0026] Furthermore, when performing multi-scale scanning, the method for obtaining the sliding window size and step length includes:

[0027] S311, randomly generate a number of sliding window sizes and step lengths, take each sliding window size and step length as a chromosome, and use a number of chromosomes to form an initial population;

[0028] S312, evaluating the classification accuracy of individuals in the population on the validation set, and using it as the fitness value of the individuals;

[0029] S313, selecting parent individuals by roulette wheel selection method, and randomly selecting two parent individuals from all parent individuals for crossover operation;

[0030] S314, randomly select an individual from the population to perform mutation operation, and then determine whether the iteration termination condition is met, if so, proceed to step S315, otherwise return to step S312;

[0031] S315. Output the individual with the largest fitness value in the population as the sliding window size and step size.

[0032] The beneficial effects of the above technical solution are as follows: the introduction of the genetic algorithm in this solution enables the optimization of hyperparameters such as the size and step size of the sliding window, which can further shorten the training time of the optimal model, further improve the recognition accuracy and generalization ability of the model, and greatly improve the efficiency of image analysis and water loss diagnosis.

[0033] Furthermore, the expressions of horizontal pooling and vertical pooling are:

[0034]

[0035] Among them, B h (c) and B v (c) are the average values ​​of the cth channel in the horizontal and vertical directions respectively; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels; w is the index in the horizontal direction; X h,w,c is the element of the high-dimensional feature matrix at the position of height h, width w, and channel c; σ1 is the Gaussian function in the horizontal direction width; e is the natural logarithm; σ2 is the Gaussian function in the vertical direction Width.

[0036] Furthermore, the method for the group normalization layer to process the features after the two-dimensional convolution operation includes:

[0037] Compute the mean and variance of a high-dimensional feature matrix:

[0038]

[0039] Among them, X is a high-dimensional feature matrix; μ is the feature mean; σ t 2 is the characteristic variance; |·| is the absolute value;

[0040] According to the mean and variance, the features after the input two-dimensional convolution operation are normalized:

[0041]

[0042] in, is the normalized feature; y is the feature after the two-dimensional convolution operation; X concat is the concatenated feature; K is the weight of the two-dimensional convolution kernel; K h and K w They are the height and width of the two-dimensional convolution kernel respectively; i and j are variables; d is the channel number index; C is the total number of channels.

[0043] Furthermore, the method for the multi-branch convolution module to reduce the dimensionality of the high-dimensional feature matrix includes:

[0044] Use 1×1 convolution kernel K respectively 1×1 , 3×3 convolution kernel K 3×3 and a 5×5 convolution kernel K 5×5 Perform convolution operation on high-dimensional feature matrix:

[0045]

[0046]

[0047] Among them, K 1×1 is a 1×1 convolution kernel; K 3×3 is a 3×3 convolution kernel; K 5×5 is a 5×5 convolution kernel; X is a high-dimensional feature matrix; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels, are row index and column index respectively; d is the channel number index; C is the total number of channels;

[0048] Concatenate the feature matrices of different convolution kernels along the channel direction:

[0049] Y concat =Concat(Y 1×1 (h,w,c),Y 3×3 (h,w,c),Y 5×5 (h,w,c))

[0050] Among them, Y concat is the concatenated feature; Concat(·) is the concatenation function;

[0051] Use 1×1 convolution kernel to reduce the dimension of the concatenated features:

[0052]

[0053] Among them, Y residual is the feature matrix after dimensionality reduction; The number of channels for branch output; K is the channel number variable of the branch output; reduce To reduce the weight of the convolution kernel.

[0054] Furthermore, the Sigmoid activation function converts the normalized features into the expression of attention weight:

[0055]

[0056] in, is the normalized feature; is the attention weight; e is the natural logarithm.

[0057] Furthermore, the method for segmenting the wheat canopy image includes:

[0058] S11. Convert the wheat canopy image from RGB space to HSV space:

[0059]

[0060] V=max(R,G,B)

[0061] in, and V are the H, S, V components of the wheat canopy image respectively; R, G, B are the R, G, B components of the wheat canopy image respectively; max and min are the maximum and minimum values ​​respectively;

[0062] S12, using bilateral filtering algorithm to filter the image converted to HSV space:

[0063]

[0064] Among them, I p is the value of pixel p after filtering; S is the set of pixels in the filtering window; W p is the normalization coefficient; σ d is the standard deviation in the spatial domain; is the Gaussian function in the spatial domain; σ r is the range standard deviation; is the range Gaussian function; ‖pq‖ is the Euclidean distance between pixels p and q; I(p) and I(q) are the ranges of pixels p and q, respectively; exp(·) is the exponential function; ‖·‖ is the Euclidean distance;

[0065] S13, converting the filtered image into a grayscale image, and counting the number of pixels at each grayscale level, dividing the number of pixels at each grayscale level by the total number of pixels to obtain a normalized grayscale histogram;

[0066] S14. Use the Otsu algorithm to perform threshold segmentation on the grayscale histogram to obtain the segmented wheat canopy image.

[0067] Furthermore, step S2 further comprises:

[0068] S21, converting the segmented wheat canopy image from the RGB space to the HSV space using color space conversion, traversing the R, G, B and V channel values ​​of all pixels in the wheat canopy image respectively; calculating the mean and variance of the four channels respectively according to the pixel values ​​of the R, G, B and V channels;

[0069] S22, converting the segmented wheat canopy image into a grayscale image, and selecting a set pixel spacing and a set direction to scan the grayscale image, counting the frequency of the preset pixel grayscale value at the point (i, j) in the set direction, and generating a grayscale co-occurrence matrix;

[0070] S23, normalizing the frequencies of the elements in the gray-level symbiosis matrix so that the sum of all the elements in the gray-level symbiosis matrix is ​​1; the gray-level symbiosis matrix uses four-dimensional parameters of energy, uniformity, contrast, and correlation to represent the texture characteristics of wheat;

[0071] S24. Construct a feature vector as the canopy phenotypic feature based on the mean and variance of the four channels R, G, B and V and the energy, uniformity, contrast and correlation of the gray-level co-occurrence matrix:

[0072]

[0073] Among them, r mean is the R mean; r var is the R variance; g mean is the mean value of G; g var is the variance of G; b mean is the B mean; b var is the variance of B; v mean is the mean value of V; v var V is the variance; texture feature part: E is energy; U is uniformity, For contrast, For relevance.

[0074] The beneficial effects of the above technical solution are as follows: when processing wheat canopy images, this solution introduces the HSV color space, converts the image from the RGB space to the HSV space before bilateral filtering the image, and makes full use of the independence of the brightness and chromaticity components in the HSV space for optimization. The HSV color space can more intuitively reflect the color changes of the wheat canopy, especially in the case of water loss. By introducing the HSV color space, the algorithm can process the color information in the image more specifically and improve the accuracy of segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 Flow chart of the machine vision intelligent diagnosis method for wheat canopy water loss.

[0076] Figure 2 Schematic diagram of the multi-granularity scanning stage.

[0077] Figure 3 Figure 2 is the principle block diagram of the multi-scale attention module.

[0078] Figure 4 Figure 2 is a block diagram of the cascade forest stage. DETAILED DESCRIPTION

[0079] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0080] refer to Figure 1 , Figure 1 The flowchart of the machine vision intelligent diagnosis method for wheat canopy moisture deficiency is shown; Figure 1 As shown, the method S includes steps S1 to S4.

[0081] In step S1, multiple wheat canopy images under suitable water content, moderate drought and severe drought stress are collected, and the wheat canopy images are segmented using the Otsu threshold segmentation algorithm optimized by HSV-bilateral filtering;

[0082] In one embodiment of the present invention, a method for segmenting a wheat canopy image includes:

[0083] S11. Convert the wheat canopy image from RGB space to HSV space:

[0084]

[0085] V=max(R,G,B)

[0086] in, and V are the H, S, V components of the wheat canopy image respectively; R, G, B are the R, G, B components of the wheat canopy image respectively; max and min are the maximum and minimum values ​​respectively;

[0087] S12, using bilateral filtering algorithm to filter the image converted to HSV space:

[0088]

[0089] Among them, I p is the value of pixel p after filtering; S is the set of pixels in the filtering window; W p is the normalization coefficient; σ d is the standard deviation in the spatial domain; is the Gaussian function in the spatial domain; σ r is the range standard deviation; is the range Gaussian function; ‖pq‖ is the Euclidean distance between pixels p and q; I(p) and I(q) are the ranges of pixels p and q, respectively; exp(·) is the exponential function; ‖·‖ is the Euclidean distance;

[0090] Using the above formula for filtering can smooth long-distance pixels and remove noise from pixels of different colors, weaken the smoothing effect of pixels in the edge area to retain the image edge, and achieve the best effect of noise reduction and edge preservation.

[0091] S13, converting the filtered image into a grayscale image, and counting the number of pixels at each grayscale level, dividing the number of pixels at each grayscale level by the total number of pixels to obtain a normalized grayscale histogram; normalization formula:

[0092]

[0093] Among them, p i is the probability of gray level i, n i is the number of pixels at gray level i, and N is the total number of all pixels in the image.

[0094] S14. Use the Otsu algorithm to perform threshold segmentation on the grayscale histogram to obtain the segmented wheat canopy image. The detailed implementation process is as follows:

[0095] Assume that the grayscale level of the image ranges from 0 to L-1, record the image with a grayscale value in the range of [0, T-1] as the background, and the image with a grayscale value in the range of [T, L-1] as the foreground, then traverse all possible thresholds T, calculate the inter-class variance under different thresholds, and select the threshold that maximizes the inter-class variance to find the optimal threshold T.

[0096] The formula for between-class variance is:

[0097] σ 2 (T) = w 1 (T) ·w 2 (T)·(μ 1 (T)-μ 2 (T)) 2

[0098] The background weight formula is:

[0099]

[0100] The background weight formula is:

[0101]

[0102] The average gray value formula of the background is:

[0103]

[0104] The average gray value formula of the background is:

[0105]

[0106] Among them, w 1 (T) is the background weight of the wheat canopy image, w 2 (T) is the foreground weight of the wheat canopy image, μ 1 (T) is the average gray value of the background of the wheat canopy image, μ 2 (T) is the average gray value of the foreground of the wheat canopy image.

[0107] The calculated threshold T is used to binarize the grayscale histogram, with the foreground area being white and the background area being black. The binary image is then used as a mask to process the original RGB image (wheat canopy image). When the pixel value in the mask is 0, the pixel at the corresponding position in the original RGB image is set to black; when the pixel value in the mask is 255, the pixel value at the corresponding position in the original RGB image remains unchanged, thereby retaining the color and texture information of the foreground.

[0108] This scheme uses the mask obtained by threshold segmentation to process the color image processed by the HSV-bilateral filtering algorithm, thereby extracting the target area that retains color and texture information and effectively completing the segmentation of foreground and background.

[0109] In step S2, the canopy phenotypic features of the segmented wheat canopy image are extracted by combining color space conversion, statistical feature analysis and gray level co-occurrence matrix method, and used as a data set for model training;

[0110] During implementation, the detailed implementation steps of the preferred step S2 of this scheme are:

[0111] S21, using color space conversion to convert the segmented wheat canopy image from RGB space to HSV space, respectively traversing the R, G, B and V channel values ​​of all pixels in the wheat canopy image; according to the respective pixel values ​​of the R, G, B and V channels, respectively calculate the four-channel mean μ td With variance σ td :

[0112]

[0113] Among them, I i is the value of the i-th pixel, N is the total number of pixels in the wheat canopy image; the mean represents the average distribution of image color, and the variance reflects the degree of discreteness of image color distribution.

[0114] This scheme preferably selects channels (R, G, B, V) with a coefficient of variation greater than 10% to calculate their means and variances, which provides quantitative characteristics for the color distribution of the wheat canopy image and reflects the overall characteristics of the image color and the degree of color change.

[0115] S22, converting the segmented wheat canopy image into a grayscale image, and selecting a set pixel spacing and a set direction (0°, 45°, 90°, 135°) to scan the grayscale image, counting the frequency of the preset pixel grayscale value at the point (i, j) in the set direction, and generating a grayscale co-occurrence matrix;

[0116] S23, normalizing the frequencies of the elements in the gray-level symbiosis matrix so that the sum of all the elements in the gray-level symbiosis matrix is ​​1; the gray-level symbiosis matrix uses four-dimensional parameters of energy, uniformity, contrast, and correlation to represent the texture characteristics of wheat;

[0117] The expressions of energy, uniformity, contrast and correlation are:

[0118]

[0119] Contrast=∑ i,j=0 (ij) 2 p(i, j),

[0120] Where Energy, Homogeneity, Contrast and Correlation are energy, homogeneity, contrast and correlation respectively; p(i, j) is the pixel value of point (i, j); u gm and σ gm 2 are the gray value mean and standard deviation respectively.

[0121] S24. Construct a feature vector as the canopy phenotypic feature based on the mean and variance of the four channels R, G, B and V and the energy, uniformity, contrast and correlation of the gray-level co-occurrence matrix:

[0122]

[0123] Among them, r mean is the R mean; r var is the R variance; g mean is the mean value of G; g var is the variance of G; b mean is the B mean; b var is the variance of B; v mean is the mean value of V; v var V is the variance; texture feature part: E is energy; U is uniformity, For contrast, For relevance.

[0124] In step S3, the improved deep forest model is trained using the data set to obtain a machine vision intelligent diagnosis model for wheat canopy moisture loss; the improved deep forest model includes a multi-granularity scanning part, a multi-scale attention module and a cascade forest part connected in sequence, wherein the schematic diagram of the multi-granularity scanning part can be referred to Figure 2 , the schematic diagram of the multi-scale attention module can be referred to Figure 3 , the schematic diagram of the cascade forest part can be referred to Figure 4 .

[0125] In one embodiment of the present invention, a method for training an improved deep forest model using a data set includes:

[0126] S31, dividing the data set into a training set and a test set, inputting the training set into the multi-granularity scanning part to perform multi-scale scanning to extract multi-granularity features, and splicing them in the horizontal direction to obtain a high-dimensional feature matrix;

[0127] S32, input the high-dimensional feature matrix into the multi-scale attention module, perform horizontal pooling and vertical pooling on the high-dimensional feature matrix through the pooling layer, and then use the splicing layer to splice the two pooled features;

[0128] During implementation, the preferred expressions of horizontal pooling and vertical pooling in this scheme are:

[0129]

[0130] Among them, B h (c) and B v (c) are the average values ​​of the cth channel in the horizontal and vertical directions respectively; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels; w is the index in the horizontal direction; X h,w,c is the element of the high-dimensional feature matrix at the position of height h, width w, and channel c; σ1 is the Gaussian function in the horizontal direction width; e is the natural logarithm; σ2 is the Gaussian function in the vertical direction Width.

[0131] S33, input the concatenated features into the convolution layer for a two-dimensional convolution operation, and then convert the features after the two-dimensional convolution operation into attention weights through a group normalization layer and a Sigmoid activation function in sequence;

[0132] Among them, the method for the group normalization layer to process the features after the two-dimensional convolution operation includes:

[0133] Compute the mean and variance of a high-dimensional feature matrix:

[0134]

[0135] Among them, X is a high-dimensional feature matrix; μ is the feature mean; σ t 2 is the characteristic variance; |·| is the absolute value;

[0136] According to the mean and variance, the features after the input two-dimensional convolution operation are normalized:

[0137]

[0138] in, is the normalized feature; y is the feature after the two-dimensional convolution operation; X concat is the concatenated feature; K is the weight of the two-dimensional convolution kernel; K h and K w They are the height and width of the two-dimensional convolution kernel respectively; i and j are variables; d is the channel number index; C is the total number of channels.

[0139] The Sigmoid activation function converts the normalized features into the expression of attention weight:

[0140]

[0141] in, is the normalized feature; is the attention weight; e is the natural logarithm.

[0142] S34, use the multi-branch convolution module of the multi-scale attention module to reduce the dimension of the high-dimensional feature matrix to obtain the feature matrix after dimension reduction:

[0143] Use 1×1 convolution kernel K respectively 1×1 , 3×3 convolution kernel K 3×3 and a 5×5 convolution kernel K 5×5 Perform convolution operation on high-dimensional feature matrix:

[0144]

[0145] Among them, K 1×1 is a 1×1 convolution kernel; K 3×3 is a 3×3 convolution kernel; K 5×5 is a 5×5 convolution kernel; X is a high-dimensional feature matrix; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels, are row index and column index respectively; d is the channel number index; C is the total number of channels;

[0146] Concatenate the feature matrices of different convolution kernels along the channel direction:

[0147] Y concat =Concat(Y 1×1 (h,w,c),Y 3×3 (h,w,c),Y 5×5 (h,w,c))

[0148] Among them, Y concat is the concatenated feature; Concat(·) is the concatenation function;

[0149] Use 1×1 convolution kernel to reduce the dimension of the concatenated features:

[0150]

[0151] Among them, Y residual is the feature matrix after dimensionality reduction; The number of channels for branch output; K is the channel number variable of the branch output; reduce To reduce the weight of the convolution kernel.

[0152] S35, fusing the feature matrix after dimension reduction with the attention weight to obtain a fused feature matrix corresponding to each canopy phenotypic feature;

[0153] S36, taking all fused feature matrices as the input of the cascade forest of the deep forest, and training through the random forest of the first layer of the cascade forest and the completely random forest;

[0154] S37, using the test set to test the generated deep forest, and determine whether the test accuracy is less than the accuracy of the previous layer, if so, proceed to step S39; otherwise, proceed to step S38;

[0155] S38, adding one layer to the cascade forest, and concatenating the output of the previous layer with the fusion feature matrix as the input of the added layer, continuing training, and then returning to step S37;

[0156] S39. Complete model training and obtain a machine vision intelligent diagnosis model for wheat canopy water deficiency.

[0157] In step S4, the wheat canopy image to be classified is obtained, and the canopy phenotypic characteristics are obtained by using steps S1 to S2, and then input into the machine vision intelligent diagnosis model for classification to obtain the water deficiency type (suitable water, moderate drought or severe drought);

[0158] In one embodiment of the present invention, when performing multi-scale scanning, the method for obtaining the sliding window size and step length includes:

[0159] S311, randomly generate a number of sliding window sizes and step lengths, take each sliding window size and step length as a chromosome, and use a number of chromosomes to form an initial population;

[0160] S312, evaluating the classification accuracy of individuals in the population on the validation set, and using it as the fitness value of the individuals;

[0161] S313, selecting parent individuals by roulette wheel selection method, and randomly selecting two parent individuals from all parent individuals for crossover operation;

[0162] S314, randomly select an individual from the population to perform mutation operation, and then determine whether the iteration termination condition is met, if so, proceed to step S315, otherwise return to step S312;

[0163] S315. Output the individual with the largest fitness value in the population as the sliding window size and step size.

[0164] When the number of iterations is greater than or equal to a preset number of iterations (preferably 50 times) or the fitness value no longer increases significantly, it indicates that the iteration termination condition is met.

[0165] In summary, this scheme can improve the recognition accuracy and generalization ability of the model by training the improved deep forest model for wheat canopy image classification, and greatly improve the efficiency of image analysis and water loss diagnosis.

Claims

1. A machine vision intelligent diagnosis method for wheat canopy water loss, characterized in that: Includes steps: S1. Collect multiple wheat canopy images under suitable water content, moderate drought and severe drought stress, and segment the wheat canopy images using the Otsu threshold segmentation algorithm optimized by HSV-bilateral filtering; S2, using a combination of color space conversion, statistical feature analysis and gray-level co-occurrence matrix method to extract the canopy phenotypic characteristics of the segmented wheat canopy image, and use it as a dataset for model training; S3. Use the dataset to train the improved deep forest model and obtain a machine vision intelligent diagnosis model for wheat canopy water loss; S4, obtaining a wheat canopy image to be classified, and using steps S1 to S2 to obtain canopy phenotypic characteristics, and then inputting the machine vision intelligent diagnosis model for classification to obtain the water deficiency type; The improved deep forest model includes a multi-granularity scanning part, a multi-scale attention module and a cascade forest part which are connected in sequence.

2. The machine vision intelligent diagnosis method for wheat canopy water loss according to claim 1, characterized in that: Methods for training the improved deep forest model using the dataset include: S31, dividing the data set into a training set and a test set, inputting the training set into the multi-granularity scanning part to perform multi-scale scanning to extract multi-granularity features, and splicing them in the horizontal direction to obtain a high-dimensional feature matrix; S32, input the high-dimensional feature matrix into the multi-scale attention module, perform horizontal pooling and vertical pooling on the high-dimensional feature matrix through the pooling layer, and then use the splicing layer to splice the two pooled features; S33, input the concatenated features into the convolution layer for a two-dimensional convolution operation, and then convert the features after the two-dimensional convolution operation into attention weights through a group normalization layer and a Sigmoid activation function in sequence; S34, using a multi-branch convolution module of a multi-scale attention module to perform dimensionality reduction processing on the high-dimensional feature matrix to obtain a feature matrix after dimensionality reduction; S35, fusing the feature matrix after dimension reduction with the attention weight to obtain a fused feature matrix corresponding to each canopy phenotypic feature; S36, taking all fused feature matrices as the input of the cascade forest of the deep forest, and training through the random forest of the first layer of the cascade forest and the completely random forest; S37, using the test set to test the generated deep forest, and determine whether the test accuracy is less than the accuracy of the previous layer, if so, proceed to step S39; otherwise, proceed to step S38; S38, adding one layer to the cascade forest, and concatenating the output of the previous layer with the fusion feature matrix as the input of the added layer, continuing training, and then returning to step S37; S39. Complete model training and obtain a machine vision intelligent diagnosis model for wheat canopy water deficiency.

3. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 2 is characterized in that: When performing multi-scale scanning, the sliding window size and step length acquisition method include: S311, randomly generate a number of sliding window sizes and step lengths, take each sliding window size and step length as a chromosome, and use a number of chromosomes to form an initial population; S312, evaluating the classification accuracy of individuals in the population on the validation set, and using it as the fitness value of the individuals; S313, selecting parent individuals by roulette wheel selection method, and randomly selecting two parent individuals from all parent individuals for crossover operation; S314, randomly select an individual from the population to perform mutation operation, and then determine whether the iteration termination condition is met, if so, proceed to step S315, otherwise return to step S312; S315. Output the individual with the largest fitness value in the population as the sliding window size and step size.

4. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 2, characterized in that: The expressions for horizontal pooling and vertical pooling are: Among them, B h (c) and B v (c) are the average values ​​of the cth channel in the horizontal and vertical directions respectively; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels; w is the index in the horizontal direction; X h,w,c is the element of the high-dimensional feature matrix at the position of height h, width w, and channel c; σ1 is the Gaussian function in the horizontal direction width; e is the natural logarithm; σ2 is the Gaussian function in the vertical direction Width.

5. The machine vision intelligent diagnosis method for wheat canopy water loss according to claim 2, characterized in that: The method for the group normalization layer to process the features after the two-dimensional convolution operation includes: Compute the mean and variance of a high-dimensional feature matrix: Among them, X is a high-dimensional feature matrix; μ is the feature mean; σ t 2 is the characteristic variance; |·| is the absolute value; According to the mean and variance, the features after the input two-dimensional convolution operation are normalized: in, is the normalized feature; y is the feature after the two-dimensional convolution operation; X concat is the concatenated feature; K is the weight of the two-dimensional convolution kernel; K h and K w They are the height and width of the two-dimensional convolution kernel respectively; i and j are variables; d is the channel number index; C is the total number of channels.

6. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 2, characterized in that: The method of reducing the dimension of the high-dimensional feature matrix by the multi-branch convolution module includes: Use 1×1 convolution kernel K respectively 1×1 , 3×3 convolution kernel K 3×3 and a 5×5 convolution kernel K 5×5 Perform convolution operation on high-dimensional feature matrix: Among them, K 1×1 is a 1×1 convolution kernel; K 3×3 is a 3×3 convolution kernel; K 5×5 is a 5×5 convolution kernel; X is a high-dimensional feature matrix; H and W are the height and width of the high-dimensional feature matrix respectively; c is the number of channels, and are row index and column index respectively; d is the channel number index; C is the total number of channels; Concatenate the feature matrices of different convolution kernels along the channel direction: Y concat =Concat(Y 1×1 (h,w,c),Y 3×3 (h,w,c),Y 5×5 (h,w,c)) Among them, Y concat is the concatenated feature; Concat(·) is the concatenation function; Use 1×1 convolution kernel to reduce the dimension of the concatenated features: Among them, Y residual is the feature matrix after dimensionality reduction; The number of channels for branch output; K is the channel number variable of the branch output; reduce To reduce the weight of the convolution kernel.

7. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 2, characterized in that: The Sigmoid activation function converts the normalized features into the expression of attention weight: in, is the normalized feature; is the attention weight; e is the natural logarithm.

8. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 1, characterized in that: The methods for segmenting wheat canopy images include: S11. Convert the wheat canopy image from RGB space to HSV space: V=max(R,G,B) in, and V are the H, S, V components of the wheat canopy image respectively; R, G, B are the R, G, B components of the wheat canopy image respectively; max and min are the maximum and minimum values ​​respectively; S12, using bilateral filtering algorithm to filter the image converted to HSV space: Among them, I p is the value of pixel p after filtering; S is the set of pixels in the filtering window; W p is the normalization coefficient; σ d is the standard deviation in the spatial domain; is the Gaussian function in the spatial domain; σ r is the range standard deviation; is the range Gaussian function; ‖pq‖ is the Euclidean distance between pixels p and q; I(p) and I(q) are the ranges of pixels p and q, respectively; exp(·) is the exponential function; ‖·‖ is the Euclidean distance; S13, converting the filtered image into a grayscale image, and counting the number of pixels at each grayscale level, dividing the number of pixels at each grayscale level by the total number of pixels to obtain a normalized grayscale histogram; S14. Use the Otsu algorithm to perform threshold segmentation on the grayscale histogram to obtain the segmented wheat canopy image.

9. The machine vision intelligent diagnosis method for wheat canopy moisture loss according to claim 1, characterized in that: Step S2 further comprises: S21, converting the segmented wheat canopy image from the RGB space to the HSV space using color space conversion, traversing the R, G, B and V channel values ​​of all pixels in the wheat canopy image respectively; calculating the mean and variance of the four channels respectively according to the pixel values ​​of the R, G, B and V channels; S22, converting the segmented wheat canopy image into a grayscale image, and selecting a set pixel spacing and a set direction to scan the grayscale image, counting the frequency of the preset pixel grayscale value at the point (i, j) in the set direction, and generating a grayscale co-occurrence matrix; S23, normalizing the frequencies of the elements in the gray-level symbiosis matrix so that the sum of all the elements in the gray-level symbiosis matrix is ​​1; the gray-level symbiosis matrix uses four-dimensional parameters of energy, uniformity, contrast, and correlation to represent the texture characteristics of wheat; S24. Construct a feature vector as the canopy phenotypic feature based on the mean and variance of the four channels R, G, B and V and the energy, uniformity, contrast and correlation of the gray-level co-occurrence matrix: Among them, r mean is the R mean; r var is the R variance; g mean is the mean value of G; g var is the variance of G; b mean is the B mean; b var is the variance of B; v mean is the mean value of V; v var V is the variance; texture feature part: E is energy; U is uniformity, For contrast, For relevance.

Citation Information

Patent Citations

  • Wheat plant nitrogen content estimation method based on unmanned aerial vehicle image fusion characteristics

    CN112418073A

  • Intelligent pine wood nematode disease identification method and system based on unmanned aerial vehicle technology

    CN119169492A

  • Strong pulsed light skin beauty local area identification method and system

    CN119339149A

  • Image segmentation method combining super-pixels and multi-scale hierarchical feature recognition

    WO2024021413A1