A method for identifying abnormal phenotypes of cucumber leaves

Through improved multi-scale superpixel segmentation method and brightness distribution feature analysis, the accuracy and speed of abnormal phenotype recognition of cucumber leaves are solved, efficient automatic recognition of cucumber leaves is achieved, and the accuracy of disease detection is improved and intelligent agriculture is improved. applicability.

CN118865345BActive Publication Date: 2024-12-13QINGDAO AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411336908.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-13
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately identify the abnormal phenotype of cucumber leaves, which affects the speed and accuracy of disease detection. Especially in intelligent agricultural planting, there are problems of insufficient recognition intensity and real-time performance.

Method used

By obtaining the color image of cucumber leaves, performing pixel-by-pixel labeling and data preprocessing, the abnormal phenotype features are extracted using the improved multi-scale superpixel segmentation method, calculating the brightness distribution feature vector, and performing similarity measurements to determine whether the image is normal, realizing automatic Identify abnormal phenotypes of the leaves.

Benefits of technology

It realizes efficient, accurate and automatic identification of abnormal phenotypes of cucumber leaves, improves the accuracy and speed of disease detection, and can accurately identify downy mildew, powdery mildew and other diseases in different planting environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865345B_ABST
    Figure CN118865345B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of intelligent crop identification, and in particular to a method for identifying abnormal phenotypes of cucumber leaves, which is as follows: color images of cucumber leaves under two planting environments are obtained, and manual pixel-by-pixel annotation is performed, and then the images are divided into a training set and a test set in proportion; data preprocessing is performed on the images in the training set and the test set respectively; superpixel regions are obtained by an improved multi-scale superpixel segmentation method; the brightness distribution feature vectors of each superpixel region of the images in the training set and the test set on three channels are calculated to obtain channel feature vectors; superpixel region types are divided, and feature vector values ​​of two types of regions are calculated; and the test set is evaluated. The present invention can automatically identify abnormal phenotypes of leaves efficiently and accurately by analyzing the probability of changes in cucumber phenotypes from a more fine-grained angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of intelligent crop identification, and in particular to a method for identifying abnormal phenotypes of cucumber leaves. Background Art

[0002] Cucumber is a widely planted vegetable crop, and its yield and quality directly affect farmers' economic income and consumers' food supply. With the rapid development of agricultural technology, planting technology mainly based on solar greenhouses and vegetable greenhouses has been widely used and implemented. However, due to the low temperature and high temperature of the planting environment, insufficient light, and weak ability of vegetable plants to resist pests and diseases, cucumber leaves are extremely susceptible to various diseases such as downy mildew, powdery mildew, mosaic virus, etc., and their health status is directly related to the growth and development of the flower melon plant and the final yield. Moreover, due to the influence of pests and diseases, cucumber leaves often show various abnormal phenotypes, such as changes in leaf shape, color, gloss, etc. At present, the detection of pests and diseases is mainly based on manual visual inspection, which is very limited for the recognition speed, recognition strength, real-time and other characteristics required by the intelligent agricultural planting industry. The recognition of abnormal phenotypes of cucumber leaves is an important basis for judging the types of cucumber diseases and their degree of damage, but due to the wide range of leaf phenotypes, the accurate recognition of abnormal phenotypes of cucumber leaves is still a challenging task.

[0003] Therefore, the present invention proposes a method for identifying abnormal phenotypes of cucumber leaves to solve the above problems. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention proposes a method for identifying abnormal phenotypes of cucumber leaves. The present invention analyzes the probability of changes in cucumber phenotypes from a more fine-grained perspective, and can automatically identify abnormal phenotypes of leaves efficiently and accurately.

[0005] The technical solution to the technical problem of the present invention is a method for identifying abnormal phenotypes of cucumber leaves, and the steps are as follows:

[0006] S1. Obtain color images of cucumber leaves under two planting environments respectively, and manually annotate the acquired images pixel by pixel, and then divide the annotated images into a training set and a test set according to proportion;

[0007] S2, performing data preprocessing on the images in the training set and the test set respectively, firstly cropping the images, then extracting the leaf regions from the cropped images, and then obtaining leaf images;

[0008] S3, extracting abnormal phenotypic leaf features from leaf images in the training set and the test set by using an improved multi-scale superpixel segmentation method to obtain superpixel regions;

[0009] S4, calculating the brightness distribution feature vector of each superpixel region in the images of the training set and the test set on three channels to obtain a channel feature vector;

[0010] S5, dividing the superpixel regions of all images in the training set into normal and abnormal categories, and then calculating the feature vector values ​​of the two categories of regions according to the brightness distribution feature vectors of the two categories of superpixel regions;

[0011] S6. Perform similarity measurement on the channel feature vectors of the superpixel region in each image in the test set and the feature vector values ​​of the two types of regions in the training set to obtain the number of abnormal pixels. Finally, determine whether the image in the test set is normal based on the number of abnormal pixels.

[0012] S1 is as follows:

[0013] The color images of cucumber leaves in two planting environments, solar greenhouse and vegetable greenhouse, were taken by smart cameras. The collected images are divided into normal and abnormal categories. The cucumber leaf types in the abnormal category are downy mildew, powdery mildew, brown spot and anthracnose. Half of the normal images and half of the abnormal images are collected under the two planting environments. Then, the collected 2 images are manually compared. Annotate the image type pixel by pixel for each image;

[0014] The labeled images are then divided into two types: solar greenhouse and vegetable greenhouse. The images are divided into training sets according to the ratio of 7:3. and test set ; The training set is represented as , Represented as training set Middle images, training set Included images, Represents the training set Any image in; the test set is represented by , Represents the test set Middle images, test set Include images, Represents the test set any image in .

[0015] S2 is as follows:

[0016] S2.1. Training set Each image in Perform data cropping to obtain the image ,image is a 3D matrix , 256×256 represents the image The length of , 3 represents the dimension of the image, which are red, green and blue channels respectively;

[0017] Similarly for the test set Each image in The image is trimmed to obtain the image ;

[0018] S2.2, extract the leaf area in the image;

[0019] S2.2.1. Color image Convert the image to grayscale , the calculation process is as follows:

[0020] ,

[0021] in, Represents grayscale transformation operation;

[0022] S2.2.2. Image by Gaussian filtering Smoothing is performed to eliminate the image The noise in the image is reduced and the sharpness of the image is increased. The specific operations are as follows:

[0023] For images Filter the pixels one by one to get the grayscale image , the calculation process is as follows:

[0024] ,

[0025] in, Representing images Any pixel in Representing images Medium pixel After filtering, the corresponding grayscale image The representation of the pixels in represents the standard deviation of the Gaussian function;

[0026] S2.2.3. Canny edge detector from grayscale image via multi-level threshold Extract the leaf image from the image file. The specific operations are as follows:

[0027] (1) Calculate the grayscale image using the Sobel operator Middle Pixels The corresponding horizontal gradient component is And the vertical gradient component is , and then calculate the first The gradient magnitude corresponding to each pixel , the calculation process is as follows:

[0028] ,

[0029] Then use the same method to calculate the current pixel points The gradient magnitude of two adjacent pixels along the gradient direction and , Indicates Pixels The gradient amplitude of Indicates Pixels The gradient amplitude of

[0030] (2) The gradient amplitude of the current pixel Compare the gradient magnitude of two adjacent pixels to suppress non-edge points. If the gradient magnitude of the previous pixel is If it is the largest, it is retained, otherwise the gradient amplitude of the current pixel is Set to 0, the calculation process is as follows:

[0031] ,

[0032] Then the gradient amplitude Compare with the two set thresholds to select strong edge points and weak edge points. Indicates the high threshold, Indicates the low threshold, the comparison rules are as follows:

[0033] like , then the pixel is a strong edge point;

[0034] like , then the pixel is a non-edge point;

[0035] like , then check the pixel Whether it is connected to a strong edge point, if so, it is a weak edge point, otherwise it is marked as a non-edge point;

[0036] Finally, the type of the current pixel is determined according to the comparison rules;

[0037] (3) For grayscale images Repeat the operations (1) and (2) in step S2.2.3 for all pixels in the image to obtain the types of all pixels. Then connect the weak edge points to the strong edge points to form a continuous edge contour, and then obtain the leaf image. ;

[0038] Similarly, extract the test set Each image in The leaf area in the image is obtained. .

[0039] S3 is as follows:

[0040] S3.1. Using a top-down region growing strategy, the leaf image Pixels with homogeneous characteristics are segmented into the same area by setting the scale parameter To control the size of the generated superpixel, and the scale parameter As the termination condition of region growth, it ensures the heterogeneity of segmented formations under the constraint of minimum segmentation size;

[0041] Among them, the leaf image is classified according to the homogeneity feature The pixels in area, represented by , Represents a leaf image The first pixel with homogeneous characteristics area, use express Any area in

[0042] S3.2. Calculation area Brightness heterogeneity in red, green and blue channels , the calculation process is as follows:

[0043]

[0044] in, Indicates the number of channels, , indicating the three channels of red, green and blue. Indicates the area Neidi The standard deviation of the brightness values ​​of the channels, Indicates the The weight of each channel, Indicates area Neidi The mean of the brightness values ​​of the channels, where the variance and coefficient of variation are improved to jointly evaluate the region The brightness heterogeneity within Set to ;

[0045] S3.3. Calculation area The shape heterogeneity of the new rule is measured by the smoothness and compactness of the region. The smoothness is used to estimate the irregularity of the shape, and the compactness is used to measure whether the region is compact and has no redundant scattered parts. The specific steps are as follows:

[0046] The smoothness is measured by combining the ratio of the boundary perimeter to the number of pixels in the area and the standard deviation method. , the calculation process is as follows:

[0047]

[0048] in, The smaller the value, the higher the smoothness. represents the standard deviation, Indicates area The actual boundary length, Indicates area The length of the inner square border;

[0049] Compactness Index The calculation process is as follows:

[0050] ,

[0051] in, For Region The number of pixels inside, For Region The actual border length;

[0052] According to smoothness and compactness index Shape Heterogeneity , the calculation process is as follows:

[0053] ,

[0054] in, Represents the weight assigned to compactness, and its value range is a real number between [0,1];

[0055] Then obtain the entire area Heterogeneity , the calculation process is as follows:

[0056]

[0057] in, The weight representing the brightness heterogeneity is set is 0.4;

[0058] S3.4. Area Heterogeneity and area Heterogeneity of adjacent regions with predefined parameters For comparison, if the area Heterogeneity and area The heterogeneity of adjacent regions is less than the parameter , then the region with the smallest heterogeneity is selected for merging. If the heterogeneity of all regions is greater than the parameter , then the merging is terminated, and then different scales and sizes are generated Superpixel area ,in Indicates Superpixel area;

[0059] Similarly, the improved multi-scale superpixel segmentation method is used to segment the Each leaf image The abnormal phenotypic leaf features are extracted and the corresponding superpixel regions are obtained.

[0060] S4 is as follows:

[0061] Calculate the Superpixel area In the Brightness distribution feature vector on each channel , brightness distribution feature vector Include mean , absolute mean , maximum value , minimum ,variance ,slope and skewness Features, super pixel area In the The brightness value on each channel is expressed as , and then obtain the Superpixel area on each channel The average brightness value of , absolute mean , maximum value , minimum ,variance ,slope and skewness , the brightness distribution feature vector is expressed as ,in Indicates Brightness values, total Brightness value;

[0062] Then the feature vectors on the three channels are stacked to form the first The final channel feature vector of the superpixel region , ;

[0063] Then get The channel feature vector of the superpixel region is expressed as ;

[0064] Similarly, the brightness distribution feature vector of each superpixel area in each image on three channels is calculated, as well as the test set The channel feature vector of each superpixel region in each image.

[0065] S5 is as follows:

[0066] According to the manual pixel-by-pixel annotation of the images in the training set, the most common annotation type in each superpixel area is known, and it is set as the label of the superpixel area, and then the labels of all superpixel areas in the image are obtained, and the label types are normal class and abnormal class;

[0067] For the superpixel area of ​​the normal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the normal class area. ;

[0068] For the superpixel area of ​​the abnormal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the abnormal class area. .

[0069] S6 is as follows:

[0070] The feature vector value of the normal class area in the training set , the feature vector value of the abnormal area The similarity is measured with the channel feature vector of each superpixel region of each image in the test set. The channel feature vector of each superpixel region of the image in the test set is expressed as , Indicates the image in the test set Superpixel area The channel feature vector of Represents the number of superpixel areas, and the calculation process is as follows:

[0071] ,

[0072] in, , express or , Represents similarity calculation, The label representing the superpixel region;

[0073] Then statistics The number of abnormal labels in the superpixel region is denoted as ,like , then the leaf phenotype is considered to be abnormal, and the abnormal leaf position is accurately located by checking the labels of the superpixel area.

[0074] The effects provided in the content of the invention are only the effects of the embodiments, rather than all the effects of the invention. The above technical solution has the following advantages or beneficial effects:

[0075] The present invention designs a cucumber leaf phenotype anomaly detection algorithm, realizes multi-scale superpixel segmentation with minimal heterogeneity by improving the segmentation scale constraint of the region growing algorithm, introduces multi-scale superpixels in the abnormal phenotype detection process, mines the feature transformation of the patch shape and brightness value when the cucumber leaf phenotype is abnormal at different scales and granularities, constructs the average variation range of the feature distribution under different patches, analyzes the probability of cucumber phenotype change from a more fine-grained perspective, and realizes automatic identification of abnormal phenotypes efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0077] Figure 1 It is a schematic diagram of the method flow of the present invention.

[0078] Figure 2 Schematic diagram of the data preprocessing process in the present invention.

[0079] Figure 3 It is a schematic diagram of the experimental effect of the present invention. DETAILED DESCRIPTION

[0080] In order to clearly illustrate the technical features of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below.

[0081] Example 1

[0082] Combination Figure 1 and Figure 2 As shown, the technical solution of a method for identifying abnormal phenotypes of cucumber leaves is as follows:

[0083] S1. Obtain color images of cucumber leaves under two planting environments respectively, and manually annotate the acquired images pixel by pixel, and then divide the annotated images into a training set and a test set according to proportion;

[0084] S2, performing data preprocessing on the images in the training set and the test set respectively, firstly cropping the images, then extracting the leaf regions from the cropped images, and then obtaining leaf images;

[0085] S3, extracting abnormal phenotypic leaf features from leaf images in the training set and the test set by using an improved multi-scale superpixel segmentation method to obtain superpixel regions;

[0086] S4, calculating the brightness distribution feature vector of each superpixel region in the images of the training set and the test set on three channels to obtain a channel feature vector;

[0087] S5, dividing the superpixel regions of all images in the training set into normal and abnormal categories, and then calculating the feature vector values ​​of the two categories of regions according to the brightness distribution feature vectors of the two categories of superpixel regions;

[0088] S6. Perform similarity measurement on the channel feature vectors of the superpixel region in each image in the test set and the feature vector values ​​of the two types of regions in the training set to obtain the number of abnormal pixels. Finally, determine whether the image in the test set is normal based on the number of abnormal pixels.

[0089] S1 is as follows:

[0090] The color images of cucumber leaves in two planting environments, solar greenhouse and vegetable greenhouse, were taken by smart cameras. The collected images are divided into normal and abnormal categories. The cucumber leaf types in the abnormal category are downy mildew, powdery mildew, brown spot and anthracnose. Half of the normal images and half of the abnormal images are collected under the two planting environments. Then, the collected 2 images are manually compared. Annotate the image type pixel by pixel for each image;

[0091] The labeled images are then divided into two types: solar greenhouse and vegetable greenhouse. The images are divided into training sets according to the ratio of 7:3. and test set ; The training set is represented as , Represented as training set Middle images, training set Included images, Represents the training set Any image in; the test set is represented by , Represents the test set Middle images, test set Include images, Represents the test set any image in .

[0092] S2 is as follows:

[0093] S2.1. Training set Each image in Perform data cropping to obtain the image ,image is a 3D matrix , 256×256 represents the image The length of , 3 represents the dimension of the image, which are red, green and blue channels respectively;

[0094] Similarly for the test set Each image in The image is trimmed to obtain the image ;

[0095] S2.2, extract the leaf area in the image;

[0096] S2.2.1. Color image Convert the image to grayscale , the calculation process is as follows:

[0097] ,

[0098] in, Represents grayscale transformation operation;

[0099] S2.2.2. Image by Gaussian filtering Smoothing is performed to eliminate the image The noise in the image is reduced and the sharpness of the image is increased. The specific operations are as follows:

[0100] For images Filter the pixels one by one to get the grayscale image , the calculation process is as follows:

[0101] ,

[0102] in, Representing images Any pixel in Representing images Medium pixel After filtering, the corresponding grayscale image The representation of the pixels in represents the standard deviation of the Gaussian function;

[0103] S2.2.3. Canny edge detector from grayscale image via multi-level threshold Extract the leaf image from the image file. The specific operations are as follows:

[0104] (1) Calculate the grayscale image using the Sobel operator Middle Pixels The corresponding horizontal gradient component is And the vertical gradient component is , and then calculate the first The gradient magnitude corresponding to each pixel , the calculation process is as follows:

[0105] ,

[0106] Then use the same method to calculate the current pixel points The gradient magnitude of two adjacent pixels along the gradient direction and , Indicates Pixels The gradient amplitude of Indicates Pixels The gradient amplitude of

[0107] (2) The gradient amplitude of the current pixel Compare the gradient magnitude of two adjacent pixels to suppress non-edge points. If the gradient magnitude of the previous pixel is If it is the largest, it is retained, otherwise the gradient amplitude of the current pixel is Set to 0, the calculation process is as follows:

[0108] ,

[0109] Then the gradient amplitude Compare with the two set thresholds to select strong edge points and weak edge points. Indicates the high threshold, Indicates the low threshold, the comparison rules are as follows:

[0110] like , then the pixel is a strong edge point;

[0111] like , then the pixel is a non-edge point;

[0112] like , then check the pixel Whether it is connected to a strong edge point, if so, it is a weak edge point, otherwise it is marked as a non-edge point;

[0113] Finally, the type of the current pixel is determined according to the comparison rules;

[0114] (3) For grayscale images Repeat the operations (1) and (2) in step S2.2.3 for all pixels in the image to obtain the types of all pixels. Then connect the weak edge points to the strong edge points to form a continuous edge contour, and then obtain the leaf image. ;

[0115] Similarly, extract the test set Each image in The leaf area in the image is obtained. .

[0116] S3 is as follows:

[0117] S3.1. Using a top-down region growing strategy, the leaf image Pixels with homogeneous characteristics are segmented into the same area by setting the scale parameter To control the size of the generated superpixel, and the scale parameter As the termination condition of region growth, it ensures the heterogeneity of segmented formations under the constraint of minimum segmentation size;

[0118] Among them, the leaf image is classified according to the homogeneity feature The pixels in area, represented by , Represents a leaf image The first pixel with homogeneous characteristics area, use express Any area in

[0119] S3.2. Calculation area Brightness heterogeneity in red, green and blue channels , the calculation process is as follows:

[0120]

[0121] in, Indicates the number of channels, , indicating the three channels of red, green and blue. Indicates the area Neidi The standard deviation of the brightness values ​​of the channels, Indicates the The weight of each channel, Indicates area Neidi The mean of the brightness values ​​of the channels, where the variance and coefficient of variation are improved to jointly evaluate the region The brightness heterogeneity within Set to ;

[0122] S3.3. Calculation area The shape heterogeneity of the new rule is measured by the smoothness and compactness of the region. The smoothness is used to estimate the irregularity of the shape, and the compactness is used to measure whether the region is compact and has no redundant scattered parts. The specific steps are as follows:

[0123] The smoothness is measured by combining the ratio of the boundary perimeter to the number of pixels in the area and the standard deviation method. , the calculation process is as follows:

[0124]

[0125] in, The smaller the value, the higher the smoothness. represents the standard deviation, Indicates area The actual boundary length, Indicates area The length of the inner square border;

[0126] Compactness Index The calculation process is as follows:

[0127] ,

[0128] in, For Region The number of pixels inside, For Region The actual border length;

[0129] According to smoothness and compactness index Shape Heterogeneity , the calculation process is as follows:

[0130] ,

[0131] in, Represents the weight assigned to compactness, and its value range is a real number between [0,1];

[0132] Then obtain the entire area Heterogeneity , the calculation process is as follows:

[0133]

[0134] in, The weight representing the brightness heterogeneity is set is 0.4;

[0135] S3.4. Area Heterogeneity and area Heterogeneity of adjacent regions with predefined parameters For comparison, if the area Heterogeneity and area The heterogeneity of adjacent regions is less than the parameter , then the region with the smallest heterogeneity is selected for merging. If the heterogeneity of all regions is greater than the parameter , then the merging is terminated, and then different scales and sizes are generated Superpixel area ,in Indicates Superpixel area;

[0136] Similarly, the improved multi-scale superpixel segmentation method is used to segment the Each leaf image The abnormal phenotypic leaf features are extracted and the corresponding superpixel regions are obtained.

[0137] S4 is as follows:

[0138] Calculate the Superpixel area In the Brightness distribution feature vector on each channel , brightness distribution feature vector Include mean , absolute mean , maximum value , minimum ,variance ,slope and skewness Features, super pixel area In the The brightness value on each channel is expressed as , and then obtain the Superpixel area on each channel The average brightness value of , absolute mean , maximum value , minimum ,variance ,slope and skewness , the brightness distribution feature vector is expressed as ,in Indicates Brightness values, total Brightness value;

[0139] Then the feature vectors on the three channels are stacked to form the first The final channel feature vector of the superpixel region , ;

[0140] Then get The channel feature vector of the superpixel region is expressed as ;

[0141] Similarly, the brightness distribution feature vector of each superpixel area in each image on three channels is calculated, as well as the test set The channel feature vector of each superpixel region in each image.

[0142] S5 is as follows:

[0143] According to the manual pixel-by-pixel annotation of the images in the training set, the most common annotation type in each superpixel area is known, and it is set as the label of the superpixel area, and then the labels of all superpixel areas in the image are obtained, and the label types are normal class and abnormal class;

[0144] For the superpixel area of ​​the normal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the normal class area. ;

[0145] For the superpixel area of ​​the abnormal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the abnormal class area. .

[0146] S6 is as follows:

[0147] The feature vector value of the normal class area in the training set , the feature vector value of the abnormal area The similarity is measured with the channel feature vector of each superpixel region of each image in the test set. The channel feature vector of each superpixel region of the image in the test set is expressed as , Indicates the image in the test set Superpixel area The channel feature vector of Represents the number of superpixel areas, and the calculation process is as follows:

[0148] ,

[0149] in, , express or , Represents similarity calculation, The label representing the superpixel region;

[0150] Then statistics The number of abnormal labels in the superpixel region is denoted as ,like , then the leaf phenotype is considered to be abnormal, and the abnormal leaf position is accurately located by checking the labels of the superpixel area.

[0151] Example 2

[0152] In order to demonstrate the beneficial effects of the method of the present invention, the method of the present invention and the deep learning model were respectively applied on the basis of the self-collected cucumber leaf phenotype dataset. The recognition accuracy of the proposed method is 92.63%, and the deep learning model The accuracy rate is 89.26%, which shows that the present invention has a higher accuracy rate than the existing method.

[0153] Example 3

[0154] In order to demonstrate the beneficial effects of the method of the present invention, the following is provided: Figure 3 The specific use case shown is demonstrated on a self-collected cucumber leaf;

[0155] Firstly, the cucumber leaf image is segmented by an improved superpixel method to obtain a multi-scale superpixel group. Then, the proposed method is used to iterate each superpixel region to find the superpixel region that meets the abnormal class. Figure 3 As shown, there are 26 abnormal areas, which means that there are abnormalities in the leaves of the image.

[0156] Although the above describes the specific implementation mode of the invention in conjunction with the drawings, it is not intended to limit the scope of protection of the invention. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present invention.

Claims

1. A method for identifying abnormal phenotypes of cucumber leaves, characterized in that: The following steps are involved: S1. Obtain color images of cucumber leaves under two planting environments respectively, and manually annotate the acquired images pixel by pixel, and then divide the annotated images into training sets according to the proportion and test set ; S2, respectively for the training set The images in the training set and the test set are preprocessed by first cropping the images and then extracting the leaf regions from the cropped images to obtain leaf images. The leaf image obtained in is represented as , the leaf image obtained in the test set is represented as ; S3, extracting abnormal phenotypic leaf features from leaf images in the training set and the test set by using an improved multi-scale superpixel segmentation method to obtain superpixel regions; S3 is as follows: S3.

1. Using a top-down region growing strategy, the leaf image Pixels with homogeneous characteristics are segmented into the same area by setting the scale parameter To control the size of the generated superpixel, and the scale parameter As the termination condition of region growth, it ensures the heterogeneity of segmented formations under the constraint of minimum segmentation size; Among them, the leaf image is classified according to the homogeneity feature The pixels in area, represented by , Represents a leaf image The first pixel with homogeneous characteristics area, use express Any area in S3.

2. Calculation area Brightness heterogeneity in red, green and blue channels , the calculation process is as follows: in, Indicates the number of channels, , indicating the three channels of red, green and blue. Indicates the area Neidi The standard deviation of the brightness values ​​of the channels, Indicates the The weight of each channel, Indicates area Neidi The mean of the brightness values ​​of the channels, where the variance and coefficient of variation are improved to jointly evaluate the region The brightness heterogeneity within Set to ; S3.

3. Calculation area The shape heterogeneity of the new rule is measured by the smoothness and compactness of the region. The smoothness is used to estimate the irregularity of the shape, and the compactness is used to measure whether the region is compact and has no redundant scattered parts. The specific steps are as follows: The smoothness is measured by combining the ratio of the boundary perimeter to the number of pixels in the area and the standard deviation method. , the calculation process is as follows: in, The smaller the value, the higher the smoothness. represents the standard deviation, Indicates area The actual boundary length, Indicates area The length of the inner square border; Compactness Index The calculation process is as follows: , in, For Region The number of pixels inside, For Region The actual border length; According to smoothness and compactness index Shape Heterogeneity , the calculation process is as follows: , in, Represents the weight assigned to compactness, and its value range is a real number between [0,1]; Then obtain the entire area Heterogeneity , the calculation process is as follows: in, The weight representing the brightness heterogeneity is set is 0.4; S3.

4. Area Heterogeneity and area Heterogeneity of adjacent regions with predefined parameters For comparison, if the area Heterogeneity and area The heterogeneity of adjacent regions is less than the parameter , then the region with the smallest heterogeneity is selected for merging. If the heterogeneity of all regions is greater than the parameter , then the merging is terminated, and then different scales and sizes are generated Superpixel area ,in Indicates Superpixel region; Similarly, the improved multi-scale superpixel segmentation method is used to segment the Each leaf image Extract the abnormal phenotypic leaf features and obtain the corresponding superpixel area; S4, calculating the brightness distribution feature vector of each superpixel region in the images of the training set and the test set on three channels to obtain a channel feature vector; S4 is as follows: Calculate the Superpixel area In the Brightness distribution feature vector on each channel , brightness distribution feature vector Include mean , absolute mean , maximum value , minimum ,variance ,slope and skewness Features, super pixel area In the The brightness value on each channel is expressed as , and then obtain the Superpixel area on each channel The average brightness value of , absolute mean , maximum value , minimum ,variance ,slope and skewness , the brightness distribution feature vector is expressed as ,in Indicates Brightness values, total Brightness value; Then the feature vectors on the three channels are stacked to form the first The final channel feature vector of the superpixel region , ; Then get The channel feature vector of the superpixel region is expressed as ; Similarly, the brightness distribution feature vector of each superpixel area in each image on three channels is calculated, as well as the test set Channel feature vector of each superpixel region in each image; S5, dividing the superpixel regions of all images in the training set into normal and abnormal categories, and then calculating the feature vector values ​​of the two categories of regions according to the brightness distribution feature vectors of the two categories of superpixel regions; S6. Perform similarity measurement on the channel feature vectors of the superpixel region in each image in the test set and the feature vector values ​​of the two types of regions in the training set to obtain the number of abnormal pixels. Finally, determine whether the image in the test set is normal based on the number of abnormal pixels.

2. A method for identifying abnormal phenotypes of cucumber leaves according to claim 1, characterized in that: S1 is as follows: The color images of cucumber leaves in two planting environments, solar greenhouse and vegetable greenhouse, were taken by smart cameras. The collected images are divided into normal and abnormal categories. The cucumber leaf types in the abnormal category are downy mildew, powdery mildew, brown spot and anthracnose. Half of the normal images and half of the abnormal images are collected under the two planting environments. Then, the collected 2 images are manually compared. Annotate the image type pixel by pixel for each image; The labeled images are then divided into two types: solar greenhouse and vegetable greenhouse. The images are divided into training sets according to the ratio of 7:

3. and test set ; The training set is represented as , Represented as training set Middle images, training set Included images, Represents the training set Any image in; the test set is represented by , Represents the test set Middle images, test set Include images, Represents the test set any image in .

3. The method for identifying abnormal phenotypes of cucumber leaves according to claim 2, wherein S2 The details are as follows: S2.

1. Training set Each image in Perform data cropping to obtain the image ,image is a 3D matrix , 256×256 represents the image The length of , 3 represents the dimension of the image, which are red, green and blue channels respectively; Similarly for the test set Each image in The image is trimmed to obtain the image ; S2.2, extract the leaf area in the image; S2.2.

1. Color image Convert the image to grayscale , the calculation process is as follows: , in, Represents grayscale transformation operation; S2.2.

2. Image by Gaussian filtering Smoothing is performed to eliminate the image The noise in the image is reduced and the sharpness of the image is increased. The specific operations are as follows: For images Filter the pixels one by one to get the grayscale image , the calculation process is as follows: , in, Representing images Any pixel in Representing images Medium pixel After filtering, the corresponding grayscale image The representation of the pixels in represents the standard deviation of the Gaussian function; S2.2.

3. Canny edge detector from grayscale image via multi-level threshold Extract the leaf image from the image file. The specific operations are as follows: (1) Calculate the grayscale image using the Sobel operator Middle Pixels The corresponding horizontal gradient component is And the vertical gradient component is , and then calculate the first The gradient magnitude corresponding to each pixel , the calculation process is as follows: , Then use the same method to calculate the current pixel points The gradient magnitude of two adjacent pixels along the gradient direction and , Indicates Pixels The gradient amplitude of Indicates Pixels The gradient amplitude of (2) The gradient amplitude of the current pixel Compare the gradient magnitude of two adjacent pixels to suppress non-edge points. If the gradient magnitude of the previous pixel is If it is the largest, it is retained, otherwise the gradient amplitude of the current pixel is Set to 0, the calculation process is as follows: , Then the gradient amplitude Compare with the two set thresholds to select strong edge points and weak edge points. Indicates the high threshold, Indicates the low threshold, the comparison rules are as follows: like , then the pixel is a strong edge point; like , then the pixel is a non-edge point; like , then check the pixel Whether it is connected to a strong edge point, if so, it is a weak edge point, otherwise it is marked as a non-edge point; Finally, the type of the current pixel is determined according to the comparison rules; (3) For grayscale images Repeat the operations (1) and (2) in step S2.2.3 for all pixels in the image to obtain the types of all pixels. Then connect the weak edge points to the strong edge points to form a continuous edge contour, and then obtain the leaf image. ; Similarly, extract the test set Each image in The leaf area in the image is obtained. .

4. A method for identifying abnormal phenotypes of cucumber leaves according to claim 3, characterized in that: S5 is as follows: According to the manual pixel-by-pixel annotation of the images in the training set, the most common annotation type in each superpixel area is known, and it is set as the label of the superpixel area, and then the labels of all superpixel areas in the image are obtained, and the label types are normal class and abnormal class; For the superpixel area of ​​the normal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the normal class area. ; For the superpixel area of ​​the abnormal class, the channel feature vectors of all corresponding superpixel areas are added element by element and averaged to obtain the feature vector value of the abnormal class area. .

5. The method for identifying abnormal phenotype of cucumber leaves according to claim 4, wherein S6 The details are as follows: The feature vector value of the normal class area in the training set , the feature vector value of the abnormal area The similarity is measured with the channel feature vector of each superpixel region of each image in the test set. The channel feature vector of each superpixel region of the image in the test set is expressed as , Indicates the image in the test set Superpixel area The channel feature vector of Represents the number of superpixel areas, and the calculation process is as follows , in, , express or , Represents similarity calculation, The label representing the superpixel region; Then statistics The number of abnormal labels in the superpixel region is denoted as ,like , then the leaf phenotype is considered to be abnormal, and the abnormal leaf position is accurately located by checking the labels of the superpixel area.

Citation Information

Patent Citations

  • Image significance object detection method based on multiscale low-rank decomposition and with sensitive structural information

    CN103700091A

  • Ultrasonic image low-rank analysis based thyroid lesion image identification method

    CN105427296A