Vegetable leaf disease severity detection method and device
The disease segmentation model automates vegetable leaf disease detection, enhancing accuracy and efficiency by analyzing leaf images to determine disease severity.
Patent Information
- Application Number
- CN202111659409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Current methods for detecting vegetable leaf diseases rely on grower experience, which are labor-intensive, costly, inaccurate, and inefficient.
A method and device using a disease segmentation model to automatically detect disease severity by acquiring leaf images, determining disease and healthy area information, and calculating disease severity based on pixel counts.
Automated detection of vegetable leaf diseases saves labor costs and improves accuracy and efficiency.
Smart Images

Figure CN114399480B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for detecting the severity of vegetable leaf diseases. Background Art
[0002] Vegetables may develop diseases due to various reasons during the planting process, resulting in reduced yield and quality. For example, downy mildew and powdery mildew are common and serious diseases of greenhouse vegetables. Accurately obtaining the severity of the disease is a prerequisite for growers to scientifically prevent and control the disease, which is of great significance for reducing the use of pesticides and improving economic benefits.
[0003] At present, the method for detecting the severity of vegetable leaf diseases mainly relies on the growers' experience. This is not only time-consuming and labor-intensive, but also has high labor costs and is dependent on human experience, with poor accuracy and low efficiency. Summary of the invention
[0004] The present invention provides a method and device for detecting the severity of vegetable leaf diseases, which are used to solve the problem that the method for detecting the severity of vegetable leaf diseases in the prior art mainly relies on the experience of growers, which is not only time-consuming and labor-intensive, but also has high labor costs, relies on human experience, has poor accuracy, and has low efficiency. The method can automatically complete the detection of the severity of vegetable leaf diseases, save labor costs, and improve detection accuracy and efficiency.
[0005] The present invention provides a method for detecting the severity of vegetable leaf diseases, which comprises: acquiring a vegetable leaf image; determining a disease segmentation image based on the vegetable leaf image; determining disease spot area information and healthy area information based on the disease segmentation image; and determining disease severity information based on the disease spot area information and the healthy area information.
[0006] According to a method for detecting the severity of vegetable leaf diseases provided by the present invention, the disease segmentation image is determined based on the vegetable leaf image, comprising: inputting the vegetable leaf image into a disease segmentation model to obtain the disease segmentation image output by the disease segmentation model; wherein the disease segmentation model is trained with a vegetable leaf sample data set, and the vegetable leaf sample data set includes a vegetable leaf sample image, and a disease segmentation sample image corresponding to the vegetable leaf sample image.
[0007] According to a method for detecting the severity of vegetable leaf diseases provided by the present invention, the disease segmentation model includes: an encoder, which is used to extract low-level features and mixed semantic features from the vegetable leaf image, and obtain high-level features based on the mixed semantic features; a decoder, which is used to obtain fused features based on the low-level features and the high-level features, and obtain the disease segmentation image based on the fused features.
[0008] According to a method for detecting the severity of vegetable leaf diseases provided by the present invention, the encoder includes: a deep convolution block, the deep convolution block includes at least one hybrid attention module, the hybrid attention module is used to perform channel and spatial interaction feature weight calculations to obtain the low-level features and the hybrid semantic features; a multi-scale feature extraction block, the multi-scale feature extraction block is used to perform a dilated convolution operation and a pooling operation on the hybrid semantic features to obtain the high-level features.
[0009] According to a method for detecting the severity of vegetable leaf diseases provided by the present invention, the training process of the disease segmentation model includes: counting the number of diseased areas, healthy areas and background areas in the disease segmentation sample image; determining the diseased area weights, healthy area weights and background area weights based on the number of diseased areas, healthy areas and background areas and the median frequency equalization method, and applying the diseased area weights, healthy area weights and background area weights to the disease segmentation model.
[0010] According to a vegetable leaf disease severity detection method provided by the present invention, the vegetable leaf sample data set includes: original leaf samples and enhanced leaf samples, wherein the enhanced leaf samples are obtained by performing simulation expansion processing on the original leaf samples.
[0011] According to a method for detecting the severity of vegetable leaf diseases provided by the present invention, the disease spot area information includes: the number of pixels in the disease spot area, and the healthy area information includes: the number of pixels in the healthy area; determining the disease severity information based on the disease spot area information and the healthy area information includes: determining the total pixel value of the number of pixels in the disease spot area and the number of pixels in the healthy area; dividing the number of pixels in the disease spot area by the total pixel value to obtain the disease severity information.
[0012] The present invention also provides a device for detecting the severity of vegetable leaf diseases, which includes: an acquisition module for acquiring vegetable leaf images; a first determination module for determining a disease segmentation image based on the vegetable leaf images; a second determination module for determining disease spot area information and healthy area information based on the disease segmentation image; and a third determination module for determining disease severity information based on the disease spot area information and the healthy area information.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for detecting the severity of vegetable leaf diseases are implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for detecting the severity of vegetable leaf diseases.
[0015] The vegetable leaf disease severity detection method and device provided by the present invention determine the disease segmentation image based on the vegetable leaf image, and determine the disease spot area information and the healthy area information according to the disease segmentation image, thereby obtaining the disease severity information. In this way, the vegetable leaf disease severity detection can be automatically completed, which can save labor costs and improve detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a schematic flow chart of the method for detecting the severity of vegetable leaf diseases provided by the present invention;
[0018] Figure 2 It is one of the structural schematic diagrams of the disease segmentation model of the vegetable leaf disease severity detection method provided by the present invention;
[0019] Figure 3 This is the second structural schematic diagram of the disease segmentation model of the vegetable leaf disease severity detection method provided by the present invention;
[0020] Figure 4 It is a structural schematic diagram of a device for detecting the severity of vegetable leaf diseases provided by the present invention;
[0021] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Combine the following Figure 1-Figure 5 The present invention describes a method and device for detecting the severity of vegetable leaf diseases.
[0024] like Figure 1 As shown, the present invention provides a method for detecting the severity of vegetable leaf diseases, and the method for detecting the severity of vegetable leaf diseases includes the following steps 110 to 140.
[0025] Step 110: Acquire vegetable leaf images.
[0026] It is understandable that vegetable leaf images can be obtained, for example, vegetable leaf images in real scenes can be captured by a camera. The vegetable leaves here can be leaves of various economic crops such as cucumbers, eggplants, soybeans or tomatoes, and of course can also be leaves of other vegetables. The type of vegetables is not limited here.
[0027] The vegetable leaf image here can be an RGB image of vegetable leaves acquired under a complex background or in a laboratory environment. The complex background refers to the interfering background area existing in the vegetable leaf image acquisition process. The lesions can be caused by downy mildew, powdery mildew or other diseases.
[0028] Step 120: Determine a disease segmentation image based on the vegetable leaf image.
[0029] It can be understood that the diseased area and the healthy area can be segmented from the vegetable leaf image to obtain a disease segmentation image. The diseased area refers to the area on the leaf with diseased spots, and the healthy area refers to the area on the leaf that is normally free of diseased spots. The diseased area and the healthy area are marked in the disease segmentation image, and of course the background area can also be included. The segmentation process can be achieved through image recognition technology or through a neural network model. The specific method for obtaining the disease segmentation image based on the vegetable leaf image is not limited here, and technical personnel in this field can adopt a feasible solution to achieve this process.
[0030] Step 130: Determine the diseased area information and the healthy area information based on the disease segmentation image.
[0031] It can be understood that, based on the disease segmentation image, the disease spot area information and healthy area information can be extracted from the disease segmentation image. The disease spot area information can be the area of the disease spot area on the disease segmentation image, or the number of pixels in the disease spot area on the disease segmentation image. The healthy area information can be the area of the healthy area on the disease segmentation image, or the number of pixels in the healthy area on the disease segmentation image. Of course, the disease spot area information and the healthy area information can also include other parameters, which are not specifically limited here.
[0032] Step 140: Determine disease severity information based on the diseased area information and the healthy area information.
[0033] It is understandable that the disease severity information can be obtained based on the diseased area information and the healthy area information. For example, the ratio of the diseased area area to the total area can be calculated to obtain the disease severity information. Of course, the disease severity information can also be obtained by using the ratio of the number of pixels in the diseased area to the total number of pixels. The specific process of determining the disease severity information is not limited here, and those skilled in the art can determine it according to actual conditions.
[0034] It is worth mentioning that greenhouse crops such as cucumbers, eggplants or tomatoes may develop diseases due to various reasons during the planting process, resulting in reduced yield and quality. Downy mildew and powdery mildew are common and more harmful diseases of greenhouse crops. Accurately obtaining the severity of the disease is a prerequisite for growers to scientifically prevent and control diseases, and is of great significance for reducing the use of pesticides and improving economic benefits. Traditional methods of estimating the severity of diseases mainly rely on the experience of growers, which is not only time-consuming and labor-intensive, but also highly subjective. Therefore, seeking an accurate and efficient method for detecting the severity of vegetable leaf diseases is of great significance for accurate disease diagnosis.
[0035] The vegetable leaf disease severity detection method provided by the present invention determines a disease segmentation image based on the vegetable leaf image, and determines the disease spot area information and the healthy area information according to the disease segmentation image, thereby obtaining the disease severity information. In this way, the vegetable leaf disease severity detection can be automatically completed, which can save labor costs and improve detection accuracy and efficiency.
[0036] like Figure 2 As shown, in some embodiments, the above step 120, determining the disease segmentation image based on the vegetable leaf image, includes: inputting the vegetable leaf image into the disease segmentation model to obtain the disease segmentation image output by the disease segmentation model.
[0037] Among them, the disease segmentation model is trained with a vegetable leaf sample data set, and the vegetable leaf sample data set includes vegetable leaf sample images and disease segmentation sample images corresponding to the vegetable leaf sample images.
[0038] It can be understood that this embodiment uses a neural network model to obtain a disease segmentation image based on the vegetable leaf image. The disease segmentation model can be a residual neural network or a convolutional neural network. The disease segmentation model is a new model obtained by innovatively improving the neural network.
[0039] It is worth mentioning that computer vision is currently the main technical means for quantitative diagnosis of the severity of vegetable leaf diseases. A small number of studies on the severity of diseases are based on expert experience to divide the severity levels and use classification and recognition methods to judge the severity level, but this level division cannot intuitively reflect the severity of the disease. Use image processing technology to estimate the severity of the disease, and use machine learning methods to establish a lesion segmentation model to obtain the severity of the disease based on the ratio of the lesion area to the leaf area. Although these methods have achieved certain results, they require manual background removal and artificial setting of image features in the early stage, and the lesions of different diseases may have similar features, making it difficult to segment the lesions simply using manually designed features. These methods are not robust enough to noise such as uneven lighting and complex backgrounds in field environments, making it difficult to expand their application.
[0040] This embodiment uses an improved neural network model to achieve the disease spot segmentation of vegetable leaves. Compared with the existing technology, it can improve the robustness and improve the accuracy of disease spot segmentation.
[0041] The input vegetable leaf image can be an image of a vegetable leaf infected with vegetable downy mildew or powdery mildew with a complex background collected in a natural environment. The disease segmentation model can process the vegetable leaf image to obtain a disease segmentation image.
[0042] like Figure 2 and Figure 3 As shown, in some embodiments, the disease segmentation model includes: an encoder and a decoder.
[0043] The semantic segmentation network of the encoding-decoding block is used as the prototype network to build a disease segmentation model. The disease segmentation model includes an encoder module for extracting diverse features of disease images and a decoder module for pixel-level classification of diseases.
[0044] The encoder is used to extract low-level features and mixed semantic features from vegetable leaf images, and obtain high-level features based on the mixed semantic features.
[0045] It can be understood that the output feature map of the first convolutional layer of the deep convolutional block in the encoder can adjust the number of channels through a 1×1 convolution operation to obtain low-level features, and then obtain mixed semantic features through the convolution block and the mixed attention module, and the mixed semantic features are adjusted through a multi-scale feature extraction block and a 1×1 convolution operation to obtain high-level features.
[0046] The decoder is used to obtain fused features based on low-level features and high-level features, and obtain a disease segmentation image based on the fused features.
[0047] The low-level features and high-level features can be passed into the decoder to form fused features, and a 3×3 convolution operation and a 4-fold upsampling operation can be performed to restore the spatial information of the lesions and leaves. The pixel-level segmentation map of the diseased image is obtained through the final classification layer, that is, the disease segmentation image is obtained.
[0048] like Figure 2 and Figure 3 As shown, in some embodiments, the encoder includes: a deep convolution block and a multi-scale feature extraction block.
[0049] The deep convolution block includes at least one hybrid attention module, which is used to calculate the weights of channel and spatial interaction features to obtain low-level features and mixed semantic features; the multi-scale feature extraction block is used to perform dilated convolution operations and pooling operations on the mixed semantic features to obtain high-level features.
[0050] It is understandable that deep learning is a learning method with self-learning ability and is considered to be one of the most effective ways of image recognition. The semantic segmentation network can not only automatically extract target features, but also obtain pixel-level classification maps of sample images. The attention mechanism can select more critical information for the current task from a large amount of information and can adaptively highlight contextual features.
[0051] The encoder may include a deep convolution block for disease feature extraction and a multi-scale feature extraction block for multi-scale feature extraction of vegetable diseases;
[0052] The deep convolution block can contain 4 residual blocks optimized by hybrid attention mechanisms: 3conv2_x, 4conv3_x, 6conv4_x and 3conv5_x. Each residual block is composed of repeated 1×1, 3×3 and 1×1 convolution group operations; 3conv2_x can contain 3 convolution group operations. The number of convolution feature maps in each convolution group operation is 64, 64 and 256 respectively. The output feature map of the 3conv_x residual block is input into the first hybrid attention mechanism. The first hybrid attention mechanism extracts the channel and spatial interaction features of the vegetable leaf image, calculates the feature weights and weights them with the product of the output feature map; 4conv3_x contains 4 convolution group operations. The number of convolution feature maps in each convolution group operation is 64, 64 and 256 respectively. The numbers of convolutional feature maps in each convolution group operation are 256, 256 and 1024 respectively. The output feature map of the 6conv4_x residual block is input into the third hybrid attention mechanism, and the channel and spatial interaction feature weights are calculated; 3conv5_x contains 3 convolutional group operations, and the number of convolutional feature maps in each convolution group operation is 512, 512 and 2048 respectively. The output feature map of the 3conv5_x residual block is input into the fourth hybrid attention mechanism, and the channel and spatial interaction feature weights are calculated.
[0053] The feature map of the 3conv5_x residual block after mixed attention weighting is passed into the multi-scale feature extraction block. The multi-scale feature extraction block is a parallel convolution block composed of 5 parts, including 1×1, 3×3, 3×3 and 3×3 dilated convolution operations and pooling. The expansion rates used in the three dilated convolution operations are 6, 12 and 18 respectively. The parallel convolution block can reduce the computational complexity while maintaining the same performance and extract multi-scale leaf disease features.
[0054] The hybrid attention mechanism solves the problem of spatial interdependence by capturing the interaction between the spatial dimension and the channel dimension of the input tensor, extracts fine disease features, and reduces the impact of background noise on data set segmentation. The hybrid attention mechanism consists of three parallel branches, where branch 1 captures the cross-dimensional interaction information between channel C and space H, branch 2 captures the cross-dimensional interaction information between channel C and space W, and branch 3 captures the interaction information between space H and W.
[0055] Branch 1 rotates the input feature 90° counterclockwise along the X-axis. The shape of the rotated tensor is (W×H×C). The shape of the tensor after Z-pool is (2×H×C). It then passes through a standard convolution layer with a convolution kernel size of 7×7, and then passes through a batch normalization layer to provide an intermediate output of dimension (1×H×C). Then sigmoid is used to generate attention weights. Finally, the output is rotated 90° clockwise along the H axis to keep the same shape as the input and applied to the input tensor.
[0056] Z-pool is calculated using Formula 1 to reduce the C-dimensional tensor to 2 dimensions, connecting the average feature and the maximum feature on this dimension, so that the layer can retain the rich representation of the actual tensor while reducing its depth to make further calculations lighter;
[0057] Z-pool(χ)=[MaxPool 0d (χ),AvgPool 0d (χ)] Formula 1;
[0058] Branch 2 rotates the input tensor 90° counterclockwise along the W axis. The shape of the rotated tensor is (H×C×W). The shape of the tensor after Z-Pool is (2×C×W). It passes through a standard convolution layer with a convolution kernel size of 7×7, and then passes through a batch normalization layer to provide an intermediate output of dimension (1×C×W). The attention weight is generated by sigmoid. Finally, the output is rotated 90° clockwise along the W axis to keep the same shape as the input and apply it to the input tensor.
[0059] Branch 3 passes the channels of the input tensor through a Z-pool, a 7×7 standard convolution layer, and a batch normalization layer, and then generates an attention weight of shape (1×H×W) through sigmoid and applies it to the input tensor.
[0060] Finally, the refined tensors (C×H×W) produced by branches 1, 2, and 3 are aggregated together by averaging.
[0061] In some embodiments, the training process of the disease segmentation model includes: counting the number of lesion areas, healthy areas and background areas in the disease segmentation sample image; determining the lesion area weights, healthy area weights and background area weights based on the number of lesion areas, healthy areas and background areas and the median frequency equalization method, and applying the lesion area weights, healthy area weights and background area weights to the disease segmentation model.
[0062] It can be understood that the process of training the disease segmentation model using the vegetable leaf sample data set specifically includes: counting the number of diseased areas, healthy areas and background areas in the disease segmentation sample image, and using the median frequency equalization method to calculate the weights of the three categories. For example, the weights of the three categories can be 3.4532, 0.2286 and 1 respectively. The median frequency equalization method is calculated using formula 2 and formula 3;
[0063]
[0064]
[0065] Among them, freq c represents the frequency of the c-th type of pixels in the training set, sum c Indicates the number of pixels in the cth category, sum pc Represents the total number of pixels in the image containing the cth category, α c Represents the weight of the c-th type of pixels, median_freq c It represents the median frequency of all categories.
[0066] Three class weights are applied to the final classification layer of the decoder to reduce the impact of class imbalance on the disease segmentation model.
[0067] In the disease segmentation model, combined with the transfer learning method, the pre-trained weights on the ImageNet dataset are used to initialize the disease segmentation model, and the vegetable leaf sample dataset is used to train the disease segmentation model. The obtained disease segmentation model can achieve accurate segmentation of diseased spots and healthy leaves in vegetable leaf images.
[0068] In some embodiments, the vegetable leaf sample data set includes: original leaf samples and enhanced leaf samples, wherein the enhanced leaf samples are obtained by simulating and expanding the original leaf samples.
[0069] It can be understood that there are original leaf samples and enhanced leaf samples in the vegetable leaf sample dataset. The original leaf samples are leaf sample data captured in real scenes, and the enhanced leaf samples are obtained by simulation and expansion based on the original leaf samples. That is, the original leaf samples are image processed to obtain enhanced leaf samples similar to the original leaf samples. In this way, the number of sample data in the vegetable leaf sample dataset can be expanded, and the training effect can be improved.
[0070] It is understandable that for the convolutional neural network, the larger the vegetable leaf sample data set that can be used for disease segmentation model training, the better the recognition effect of the disease segmentation model. In order to improve the recognition effect of the disease segmentation model, the vegetable leaf sample data set can be expanded by horizontal flipping, vertical flipping, random scaling, 90° rotation or 270° rotation, etc. to construct a vegetable leaf sample data set. It is understandable that when dividing the vegetable leaf sample data set, the training set, validation set and test set should be divided according to an appropriate ratio to ensure that the amount of data in each type of data set is relatively balanced.
[0071] In some embodiments, the vegetable leaf sample images in the vegetable leaf sample data set can undergo a preprocessing process, and the vegetable leaf sample images can be preprocessed to manually mark the downy mildew and powdery mildew spots, healthy leaves, and background parts in the vegetable leaf sample images, and assign category labels of 1, 2, and 0, respectively, to construct a vegetable leaf sample data set.
[0072] From the original leaf images collected from the natural environment, sample images with a resolution lower than a preset threshold can be removed; that is, the low-quality images are removed first, and the downy mildew and powdery mildew spots and healthy leaves are marked from the remaining images to obtain three types of labels: spots, healthy leaves, and background, and construct the original data set.
[0073] The leaf images in the original data set are batch normalized, and all leaf images are resized to 224×224 pixel image data to obtain vegetable leaf sample images. The size of the vegetable leaf sample images is consistent with the input of the disease segmentation model.
[0074] In some embodiments, the lesion area information includes: the number of pixels in the lesion area, and the healthy area information includes: the number of pixels in the healthy area; based on the lesion area information and the healthy area information, the disease severity information is determined, including: determining the total pixel value of the lesion area pixel number and the healthy area pixel number; dividing the lesion area pixel number by the total pixel value to obtain the disease severity information.
[0075] It can be understood that the number of pixels in the diseased area and the number of pixels in the healthy area of the disease segmentation image can be extracted by the following formula 4:
[0076]
[0077] The vegetable leaf disease severity detection device provided by the present invention is described below. The vegetable leaf disease severity detection device described below and the vegetable leaf disease severity detection method described above can be referenced to each other.
[0078] like Figure 4As shown, the present invention also provides a device for detecting the severity of vegetable leaf diseases, which includes: an acquisition module 410, a first determination module 420, a second determination module 430 and a third determination module 440.
[0079] An acquisition module 410 is used to acquire vegetable leaf images;
[0080] A first determination module 420 is used to determine a disease segmentation image based on the vegetable leaf image;
[0081] The second determination module 430 is used to determine the diseased area information and the healthy area information based on the disease segmentation image;
[0082] The third determination module 440 is used to determine disease severity information based on the diseased area information and the healthy area information.
[0083] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a method for detecting the severity of vegetable leaf diseases, the method comprising: acquiring a vegetable leaf image; determining a disease segmentation image based on the vegetable leaf image; determining disease spot area information and healthy area information based on the disease segmentation image; determining disease severity information based on the disease spot area information and healthy area information.
[0084] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0085] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the vegetable leaf disease severity detection method provided by the above-mentioned methods, and the method includes: obtaining a vegetable leaf image; determining a disease segmentation image based on the vegetable leaf image; determining disease spot area information and healthy area information based on the disease segmentation image; and determining disease severity information based on the disease spot area information and healthy area information.
[0086] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the vegetable leaf disease severity detection method provided by the above-mentioned methods. The method includes: acquiring a vegetable leaf image; determining a disease segmentation image based on the vegetable leaf image; determining disease spot area information and healthy area information based on the disease segmentation image; determining disease severity information based on the disease spot area information and healthy area information.
[0087] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the severity of vegetable leaf diseases, characterized in that: include: Acquire vegetable leaf images; Determining a disease segmentation image based on the vegetable leaf image; Based on the disease segmentation image, determining diseased area information and healthy area information; Determining disease severity information based on the diseased area information and the healthy area information; Determining the disease segmentation image based on the vegetable leaf image includes: Inputting the vegetable leaf image into a disease segmentation model to obtain the disease segmentation image output by the disease segmentation model; the disease segmentation image includes a diseased spot area, a healthy area and a background area; Wherein, the disease segmentation model is trained with a vegetable leaf sample data set, and the vegetable leaf sample data set includes vegetable leaf sample images and disease segmentation sample images corresponding to the vegetable leaf sample images; The disease segmentation model includes: An encoder, the encoder is used to extract low-level features and mixed semantic features from the vegetable leaf image, and obtain high-level features based on the mixed semantic features; A decoder is used to obtain fused features based on the low-level features and the high-level features, and to obtain the disease segmentation image based on the fused features.
2. The method for detecting the severity of vegetable leaf diseases according to claim 1, characterized in that: The encoder comprises: A deep convolution block, wherein the deep convolution block includes at least one hybrid attention module, and the hybrid attention module is used to calculate the channel and spatial interaction feature weights to obtain the low-level features and the hybrid semantic features; A multi-scale feature extraction block, wherein the multi-scale feature extraction block is used to perform a dilated convolution operation and a pooling operation on the mixed semantic features to obtain the high-level features.
3. The method for detecting the severity of vegetable leaf diseases according to claim 1, characterized in that: The training process of the disease segmentation model includes: Counting the number of diseased areas, healthy areas and background areas in the disease segmentation sample image; Based on the number of the diseased area, the healthy area and the background area and the median frequency equalization method, determine the diseased area weight, the healthy area weight and the background area weight; The diseased area weight, healthy area weight and background area weight are applied to the disease segmentation model.
4. The method for detecting the severity of vegetable leaf diseases according to claim 1, characterized in that: The vegetable leaf sample data set includes: original leaf samples and enhanced leaf samples, wherein the enhanced leaf samples are obtained by performing simulation expansion processing on the original leaf samples.
5. The method for detecting the severity of vegetable leaf diseases according to any one of claims 1 to 4, characterized in that: The diseased area information includes: the number of pixels in the diseased area, and the healthy area information includes: the number of pixels in the healthy area; The determining of disease severity information based on the diseased area information and the healthy area information includes: Determine the total pixel value of the number of pixels in the diseased area and the number of pixels in the healthy area; The disease severity information is obtained by dividing the number of pixels in the diseased area by the total pixel value.
6. A device for detecting the severity of vegetable leaf diseases, characterized in that: include: An acquisition module, used for acquiring vegetable leaf images; A first determination module is used to determine a disease segmentation image based on the vegetable leaf image; A second determination module is used to determine the diseased area information and the healthy area information based on the disease segmentation image; A third determination module is used to determine disease severity information based on the diseased area information and the healthy area information; Determining the disease segmentation image based on the vegetable leaf image includes: Inputting the vegetable leaf image into a disease segmentation model to obtain the disease segmentation image output by the disease segmentation model; the disease segmentation image includes a diseased spot area, a healthy area and a background area; Wherein, the disease segmentation model is trained with a vegetable leaf sample data set, and the vegetable leaf sample data set includes vegetable leaf sample images and disease segmentation sample images corresponding to the vegetable leaf sample images; The disease segmentation model includes: An encoder, the encoder is used to extract low-level features and mixed semantic features from the vegetable leaf image, and obtain high-level features based on the mixed semantic features; A decoder is used to obtain fused features based on the low-level features and the high-level features, and to obtain the disease segmentation image based on the fused features.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the vegetable leaf disease severity detection method as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the vegetable leaf disease severity detection method as described in any one of claims 1 to 5 are implemented.
