Plant disease recognition method and apparatus

By adopting an adaptive slice fusion and semantic-instance dual-branch cascaded segmentation architecture, the problems of low efficiency and insufficient accuracy in leaf disease identification are solved, achieving efficient and accurate single-leaf disease analysis, reducing data annotation costs, and improving model stability and the degree of automation in disease identification.

CN121746938BActive Publication Date: 2026-05-19XINGYUN TECH (SHANGHAI) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XINGYUN TECH (SHANGHAI) CO LTD
Filing Date
2026-02-28
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies for leaf disease identification suffer from low efficiency, high subjectivity, and difficulty in large-scale quantitative analysis. In particular, most deep learning models lack the ability to accurately separate individual leaf instances, making it impossible to achieve precise diagnosis of "one disease per leaf." Furthermore, disease identification and severity assessment lack an end-to-end automated analysis process.

Method used

An adaptive slicing fusion strategy is adopted to slice high-resolution plant images. A pre-trained semantic segmentation model is used to segment healthy and diseased regions. After mapping back to the original image coordinate system, the segments are integrated into a foreground mask, connected component analysis is performed, single leaf instances are split, and disease analysis is performed in conjunction with a disease classification model.

Benefits of technology

It enables accurate and independent disease analysis of single leaves, automatically identifies one disease per leaf, improves the efficiency and accuracy of disease identification, reduces data annotation costs, and enhances model training efficiency and generalization stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746938B_ABST
    Figure CN121746938B_ABST
Patent Text Reader

Abstract

The application provides a plant disease identification method and device, which can slice an obtained original plant image into multiple sub-images, perform segmentation processing on healthy areas and disease areas of each sub-image, obtain corresponding segmentation results of healthy area sub-masks and disease area sub-masks, map the segmentation results back to a coordinate system corresponding to the original plant image, and obtain accurate global healthy area masks and disease area masks. However, the healthy area masks and the disease area masks do not distinguish single leaves, so it is necessary to integrate the two into a foreground mask, perform single leaf segmentation according to the foreground mask to obtain single leaf instances, and then perform segmentation on the obtained disease area masks according to the single leaf instances, so that single leaf disease masks can be obtained, disease analysis can be performed according to the single leaf disease masks, disease analysis results of each single leaf can be determined, and one-leaf-one-disease identification analysis is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method and device for identifying plant diseases. Background Technology

[0002] Crop leaf diseases are key factors affecting crop yield and quality, and their types and severity are important bases for plant protection decisions and precision control.

[0003] Currently, leaf disease identification and assessment mainly rely on manual visual surveys or expert experience, which suffers from problems such as low efficiency, strong subjectivity, and difficulty in large-scale quantitative analysis. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a method and device for identifying plant diseases, so as to solve or partially solve the above-mentioned technical problems.

[0005] To achieve the above objectives, this application provides a method for identifying plant diseases, comprising:

[0006] Obtain the original plant image;

[0007] The original plant image is sliced ​​to obtain multiple sub-images, and each sub-image is further segmented to obtain a segmentation result for each sub-image. The segmentation result includes a healthy region sub-mask and a diseased region sub-mask.

[0008] The segmentation results corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image. After the healthy region sub-mask and diseased region sub-mask corresponding to each sub-image are mapped, the healthy region mask and the diseased region mask are obtained.

[0009] The healthy region mask and the diseased region mask are integrated to obtain a foreground mask, and leaf connectivity analysis is performed based on the foreground mask to obtain at least one candidate leaf connectivity.

[0010] Based on at least one candidate blade connected component, at least one single blade instance is determined;

[0011] The disease area mask is mapped to the range corresponding to each single leaf instance to determine the single leaf disease mask corresponding to each single leaf instance.

[0012] Based on the single-leaf disease mask corresponding to each single-leaf instance, disease analysis is performed to obtain the disease analysis results.

[0013] Based on the same inventive concept, this disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.

[0014] As can be seen from the above, the plant disease identification method and device provided in this application can slice the acquired original plant image into multiple sub-images, and then perform segmentation processing on the healthy region and diseased region for each sub-image to determine the segmentation results of the healthy region sub-mask and the diseased region sub-mask corresponding to that sub-image. However, the healthy region sub-mask and the diseased region sub-mask obtained in this way are not accurate enough. It is necessary to map the segmentation result back to the coordinate system corresponding to the original plant image to obtain accurate global healthy region mask and diseased region mask. However, the healthy region mask and the diseased region mask obtained in this way are not accurate enough. Since the model does not distinguish individual leaves, it is necessary to integrate the two into a foreground mask. Then, based on this foreground mask, single-leaf segmentation is performed to obtain at least one single-leaf instance. Next, based on the single-leaf instance, the disease area mask obtained above is segmented. This process can obtain an accurate single-leaf disease mask corresponding to each single-leaf instance, which facilitates disease analysis based on the single-leaf disease mask. This allows for accurate and independent disease analysis of each single leaf, enabling the identification and analysis of one disease per leaf. The entire process is completed automatically, bringing great convenience to users. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating the plant disease identification method according to an embodiment of this application;

[0017] Figure 2 This is a schematic diagram illustrating the execution logic of the plant disease identification method according to an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of the original plant image in an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of the corresponding slice grid during the slice processing in an embodiment of this application;

[0020] Figure 5 This is a schematic diagram of a slice mesh mask based on a slice mesh according to an embodiment of this application;

[0021] Figure 6 This is a schematic diagram of the health region mask in an embodiment of this application;

[0022] Figure 7 This is a schematic diagram of the disease analysis results in an embodiment of this application;

[0023] Figure 8 This is a schematic diagram of the structure of the plant disease identification device according to an embodiment of this application;

[0024] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0026] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0027] Definitions:

[0028] RGB: Red (R), Green (G), Blue (B) are the three primary colors.

[0029] In related technologies, deep learning techniques are used to train models capable of identifying leaf diseases, but significant shortcomings still exist:

[0030] Most deep learning models analyze the entire image or the entire crop, focusing on overall disease classification, but lack precise separation of individual leaf instances, making it impossible to achieve detailed diagnosis of "one disease per leaf".

[0031] Furthermore, in practical applications, deep learning models may capture images with high resolution and multiple leaves, while single leaves and lesions are small in pixel scale, making it difficult for existing methods to guarantee the accuracy of semantic segmentation and instance analysis. Directly using instance segmentation models often requires a large amount of precise annotation, and in this scenario, leaf instances are prone to sticking together, being missed, or having unstable boundaries. At the same time, disease identification and disease severity assessment are usually performed separately, and indicators such as lesion area ratio rely heavily on manual or semi-automatic statistics, lacking an end-to-end automated analysis process.

[0032] The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0033] The plant disease identification method proposed in the embodiments of this application.

[0034] like Figure 1 As shown, the execution process of this method includes:

[0035] Step 101, acquire the original plant image (e.g.) Figure 3 (As shown).

[0036] In practice, a high-resolution RGB camera is used to acquire original plant images, including leaves (e.g., a top-down single-view RGB image). This ensures that the original plant image clearly captures the complete leaf structure.

[0037] Then, the original plant image is normalized to obtain a normalized plant image. The specific normalization formula is as follows:

[0038]

[0039] in, Represents the pixel coordinates of the original plant image. The color channels represent the original plant image. and These represent the minimum and maximum pixel values ​​in the original plant image, respectively. This is a normalized image of the plant.

[0040] Then, the normalized plant images are resized and resampled to a preset size. The preprocessed blade image is obtained. The preprocessed blade image Replace the original plant image to meet the requirements of subsequent processing steps.

[0041] Step 102: The original plant image is sliced ​​to obtain multiple sub-images, and the multiple sub-images are segmented separately to obtain the segmentation result corresponding to each sub-image. The segmentation result includes: healthy region sub-mask and diseased region sub-mask.

[0042] In practice, the original plant image (e.g., a preprocessed leaf image) will be used. According to the sliced ​​grid (e.g.) Figure 4 As shown), forming the corresponding sliced ​​mesh mask (such as...). Figure 5 As shown, the image is sliced ​​into multiple sub-images using a sliced ​​mesh mask. These sub-images overlap to ensure that each sub-image has a large number of pixels, which facilitates accurate identification during subsequent segmentation and avoids inaccurate edge recognition of the sub-images during segmentation.

[0043] Furthermore, the segmentation process in this application utilizes a pre-trained semantic segmentation model (such as...) capable of accurately identifying and segmenting healthy and diseased areas of leaves. Figure 2 As shown in the figure, semantic segmentation is performed on each sub-image to ensure that the sub-masks of the healthy region and the sub-masks of the diseased region corresponding to each sub-image are more accurate.

[0044] The semantic segmentation model is as follows: a neural network model is trained using training samples formed by labeling leaf images of real diseased areas and real healthy areas. After determining that the predetermined training termination condition is met, a semantic segmentation model capable of identifying and segmenting background areas, healthy areas and diseased areas is obtained.

[0045] Step 103: Map the segmentation results corresponding to each sub-image back to the coordinate system corresponding to the original plant image. After the healthy region sub-mask and diseased region sub-mask corresponding to each sub-image are mapped, the healthy region mask is obtained (e.g., ...). Figure 6 (as shown) and the disease area mask.

[0046] In practice, a coordinate system is pre-constructed for the original plant image, and each sub-image is assigned a positional correspondence with this coordinate system. After obtaining the healthy region sub-mask and diseased region sub-mask for each sub-image, they are mapped back to this coordinate system. This enables the process of stitching together the healthy region sub-masks of each sub-image according to the coordinate system, as well as the process of stitching together the diseased region sub-masks of each sub-image according to the coordinate system, to obtain the globally corresponding healthy region mask and diseased region mask for the plant.

[0047] Step 104: Integrate the healthy region mask and the diseased region mask to obtain a foreground mask, and perform leaf connectivity analysis based on the foreground mask to obtain at least one candidate leaf connectivity.

[0048] In practice, in order to perform accurate single-leaf segmentation, the accurate healthy region mask and diseased region mask obtained above need to be superimposed and integrated to obtain the foreground mask corresponding to all leaves. Then, connected component analysis is performed on the foreground mask to determine the corresponding connected components. The obtained connected components are used as candidate connected components for leaves, and the number of candidate connected components for leaves is at least one.

[0049] Step 105: Based on at least one candidate blade connected component, determine at least one single blade instance (e.g., ...). Figure 2 (As shown).

[0050] In practice, if at least one candidate connected component of a blade is a single blade, then at least one candidate connected component of a blade is directly used as at least one single blade instance. If there are multiple candidate connected components of blades that are connected together in at least one single blade instance, then the candidate connected components of blades that are connected together will be split into single blades, thus obtaining single blade instances that are not connected together.

[0051] Step 106: Map the disease area mask to the range corresponding to each single leaf instance, and determine the single leaf disease mask corresponding to each single leaf instance.

[0052] Step 107: Based on the single-leaf disease mask corresponding to each single-leaf instance, perform disease analysis to obtain the disease analysis results (e.g., Figure 7 (As shown).

[0053] In practice, because we can obtain the disease mask for each individual leaf instance, we can perform individual disease analysis on that single leaf. This enables accurate identification of one disease per leaf, ensuring that the disease analysis results for each individual leaf are more accurate.

[0054] The above method slices the acquired original plant image into multiple sub-images. Then, for each sub-image, healthy and diseased regions are segmented, and the corresponding healthy and diseased region sub-masks are determined. However, these sub-masks are not accurate enough. The segmentation results need to be mapped back to the coordinate system of the original plant image to obtain accurate global healthy and diseased region masks. However, these masks do not distinguish individual leaves. Therefore, they need to be integrated into a foreground mask. Then, single-leaf segmentation is performed based on this foreground mask to obtain at least one single-leaf instance. Finally, the diseased region mask obtained above is segmented based on the single-leaf instance. This yields an accurate single-leaf disease mask for each single-leaf instance, facilitating disease analysis and determining accurate disease analysis results for each leaf. This allows for accurate and independent disease analysis of individual leaves, achieving one-leaf-one-disease identification and analysis. The entire process is automated, providing great convenience to users.

[0055] In some embodiments, step 102 includes:

[0056] Step 1021: Extract the foreground portion of the original plant image.

[0057] In practice, the original plant image (e.g., a preprocessed leaf image) is used. The image is downsampled to obtain a low-resolution preview image. Regarding this low-resolution preview image The input is fed into a semantic segmentation model to identify background, healthy, and diseased regions, yielding the recognition results. :

[0058] Where 0 represents the background area, 1 represents the healthy area, and 2 represents the diseased area.

[0059] Convert the recognition result into a binary image : The binary image A binary image serving as the foreground portion.

[0060] Step 1022: Based on the foreground portion, determine the average leaf density corresponding to each candidate slice using a sliding window.

[0061] In practice, the size of the sliding window is preset, and then the sliding window is used to slide across the foreground. Each slide takes the portion that falls into the sliding window as a candidate slice, and the average leaf density corresponding to each candidate slice is calculated. The formula is:

[0062] ;in, For the first A set of pixels for candidate slices The total number of pixels in the sliding window. Characterizing the first The leaf distribution density of each candidate slice; the larger the value, the denser the leaves.

[0063] Step 1023: Determine the size and overlap rate of each slice based on the average leaf density.

[0064] In practice, the size corresponding to the i-th slice The calculation formula is: ,in, , These are the preset minimum and maximum slice sizes, respectively.

[0065] The overlap rate of the i-th slice The calculation formula is: ,in, , These are the preset minimum and maximum overlap rates.

[0066] when When the value approaches 1 (high leaf density), the slice size decreases and the overlap rate increases to ensure complete and high-precision coverage of a single leaf. When the value approaches 0 (leaf sparseness), the slice size increases and the overlap decreases to improve processing efficiency.

[0067] Step 1024: According to the size and overlap rate of each slice, slice the original plant image to obtain multiple sub-images.

[0068] In practice, the slice size is used. As the window size, use (1- Using the sliding ratio as a guide, the slicing window is determined, and multiple sub-images are obtained by sliding and cropping on the original plant image. These sub-images Combine to obtain a set of sub-images. , where N is the number of sub-images. The coordinates of each sub-image within the original plant image are also recorded for mapping in subsequent steps.

[0069] Step 1025: Perform semantic segmentation on each sub-image to determine the sub-mask of the healthy region and the sub-mask of the diseased region corresponding to the sub-image.

[0070] Step 1026: Take the sub-mask of the healthy region and the sub-mask of the diseased region corresponding to each sub-image as the segmentation result corresponding to that sub-image.

[0071] In practice, each sub-image is input into the semantic segmentation model for semantic segmentation processing to determine the background, healthy region, and diseased region corresponding to the sub-image, thus obtaining the output result. : ,in, Indicates the background area. Indicates the healthy area. Indicates the area affected by the disease.

[0072] Then, the output is binarized to obtain the sub-mask of the healthy region. and disease area submask .

[0073] The calculation formula is: ;

[0074] .

[0075] The above method allows for the slicing of the original plant image with a defined size and overlap rate, ensuring that the sliced ​​sub-images better meet the requirements of the corresponding leaf density. This enables accurate semantic recognition of each sub-image, guaranteeing the accuracy of the corresponding healthy region sub-masks and diseased region sub-masks for each sub-image.

[0076] In some embodiments, step 103 includes:

[0077] Step 1031: Map the sub-masks of the healthy regions corresponding to each sub-image back to the coordinate system corresponding to the original plant image to obtain the undetermined healthy region masks with overlapping parts.

[0078] In practice, the healthy region sub-mask of each sub-image is mapped back to the coordinate system corresponding to the original plant image according to the previously recorded coordinates. This allows the healthy region sub-masks of each sub-image to be stitched together. However, since there is overlap between the sub-images, the resulting undetermined healthy region mask will be... There are also overlapping parts.

[0079] Step 1032: Map the sub-masks of the diseased regions corresponding to each sub-image back to the coordinate system corresponding to the original plant image to obtain the undetermined diseased region masks with overlapping parts.

[0080] In practice, the disease region sub-mask of each sub-image is mapped back to the coordinate system corresponding to the original plant image according to the previously recorded coordinates. This allows the disease region sub-masks of each sub-image to be stitched together. However, since there is overlap between the sub-images, the resulting undetermined disease region mask will vary. There are also overlapping parts.

[0081] Step 1033: Determine the fusion probability of healthy regions based on the mask of undetermined healthy regions, and determine the fusion probability of diseased regions based on the mask of undetermined diseased regions.

[0082] In practice, this applies to any pixel of the mask for the undetermined health region. Let C be the set of pixels corresponding to the sub-image covering the pixel, and calculate the fusion probability of the healthy region. The calculation formula is:

[0083] ,in, The number of pixels in the sub-image that covers this pixel.

[0084] For any pixel of the mask of the undetermined disease area Let C be the set of pixels corresponding to the sub-image covering the pixel, and calculate the fusion probability of the diseased area. The calculation formula is:

[0085] ,in, The number of pixels in the sub-image that covers this pixel.

[0086] Step 1034: Determine the first threshold corresponding to the mask of the undetermined healthy region, and determine the second threshold corresponding to the mask of the undetermined diseased region.

[0087] In practical implementation, the first threshold The calculation formula is: ,in, For each pixel corresponding Combination The mean and standard deviation of , where k is an adjustable parameter.

[0088] Second threshold The calculation formula is: ,in, For each pixel corresponding Combination The mean and standard deviation of , where k is an adjustable parameter.

[0089] Step 1035: Binarize each pixel value in the undetermined health region mask based on a first threshold to obtain the health region mask (e.g., ...). Figure 6 (As shown).

[0090] In practice, the health zone mask The formula is:

[0091] .

[0092] Step 1036: Binarize each pixel value in the mask of the undetermined disease area based on the second threshold to obtain the disease area mask.

[0093] In practice, the diseased area mask... The formula is:

[0094] .

[0095] The above scheme maps the healthy region sub-masks and diseased region sub-masks corresponding to each sub-image back to the coordinate system corresponding to the original plant image, resulting in overlapping undetermined healthy region masks and undetermined diseased region masks. By calculating the determined fusion probabilities of healthy and diseased regions, accurate first and second thresholds are determined. Then, the undetermined healthy region masks and undetermined diseased region masks are binarized using the first and second thresholds respectively. This effectively eliminates the overlapping parts and ensures that the obtained healthy and diseased region masks are more accurate.

[0096] In some embodiments, step 104 includes:

[0097] Step 1041: Perform a union operation on the healthy region mask and the diseased region mask to obtain the foreground mask.

[0098] In practice, the foreground mask The formula is .

[0099] Step 1042: Extract the foreground mask using a connected component analysis algorithm to obtain at least one candidate connected component for the leaf.

[0100] In practice, the foreground mask Binarization is performed, and connected component analysis algorithms are used to extract connected components. The extracted connected components are used as candidate connected components for the blade, thus obtaining a set of candidate connected components for at least one blade. In which, each leaf candidate connected component The corresponding foreground area of ​​a leaf in the original plant image may contain a single complete leaf or multiple leaf areas that are stuck together or overlapping.

[0101] The above scheme can be used to split the foreground mask, thereby ensuring the accuracy of at least one candidate connected component for the leaf.

[0102] In some embodiments, step 105 includes:

[0103] Step 1051: Determine the area of ​​each candidate connected region in at least one candidate connected region of a blade, and compare the area of ​​the region with the area range of a single blade to obtain a comparison result, wherein each candidate connected region of a blade corresponds to one comparison result.

[0104] In specific implementation, for the i-th candidate connected component of the blade Calculate its corresponding pixel area The area is taken as the region area, and the formula is: In this way, the area of ​​each candidate connected region of a leaf can be obtained.

[0105] Determine the range of single blade area ,in This represents the minimum leaf area. This represents the maximum leaf area.

[0106] The area of ​​each candidate connected region of the leaf By comparing with the area range of a single blade, accurate comparison results are obtained.

[0107] Step 1052: In response to determining that the comparison result corresponding to the candidate connected component of the blade is within the area of ​​a single blade, the candidate connected component of the blade is taken as a single blade instance.

[0108] In practice, when the comparison result is When the blade candidate connected component is determined to be a single blade instance, it is considered to be a single blade instance.

[0109] And / or, in step 1053, in response to determining that the comparison result corresponding to the candidate connected region of the blade is greater than the area range of a single blade, the candidate connected region of the blade is determined as a multi-blade adhesion instance, and the multi-blade adhesion instance is split to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

[0110] In practice, when the comparison result is When a candidate connected component of a blade is determined to be a multi-blade adhesion instance, it is necessary to split the candidate connected component of the blade to extract multiple single-blade instances.

[0111] The above scheme can accurately determine the candidate connected regions of each leaf based on the leaf area, screen out and accurately separate multiple leaf adhesion instances, thus ensuring that the final results are all single leaf instances, which facilitates the subsequent determination of specific disease areas.

[0112] In some embodiments, the step 1053 of splitting the multi-blade adhesion instance to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance includes:

[0113] Step 10531: Perform distance transformation on the multi-blade adhesion instance to obtain a distance map.

[0114] In practical implementation, distance map The formula is:

[0115] ;in, Examples of multi-blade adhesion The coordinates of any pixel within the area, Represents the boundary of multi-blade adhesion instances. The pixel coordinates on Examples of multi-blade adhesion The set of boundary points.

[0116] Step 10532: Determine multiple local maxima points based on the distance map, and use these local maxima points as initial marker points, wherein the number of initial marker points is a first quantity. .

[0117] Step 10533: Based on the ratio of the area of ​​the region in the multi-blade adhesion instance to the average area of ​​a single blade, determine the second number of single blades in the multi-blade adhesion instance. .

[0118] In specific implementation, the second quantity The formula is: ,in, This is an example of multi-blade adhesion. The area of ​​the region, This represents the average area of ​​a single leaf.

[0119] Step 10534: Based on the first number of initial marker points, a second number is used for correction and adjustment to determine the second number of marker points in the multi-blade adhesion example.

[0120] In practice, the first quantity is determined. With the second quantity Based on the relationship, the initial marker points are adjusted. The adjustment process is as follows:

[0121] when At that time, according to the distance map Sort the initial markers corresponding to local maxima points in descending order of distance values, and retain the first markers with the largest sorted distance values. One initial marker point is selected, and the remaining initial marker points are discarded to obtain the final result. The initial marker points are used as One marker point;

[0122] when At that time, within the multi-blade adhesion instance, from the distance map Among the pixels that were not selected as markers (i.e., in the distance map) (pixels other than the initial marker point), according to the distance map Pixels with corresponding distance values ​​in descending order are selected as supplementary initial markers until the total number of initial markers reaches a certain value. , will be the final The initial marker points are used as 1 marker point.

[0123] Step 10535: Construct a gradient map based on the boundary information of the foreground mask, and normalize the gradient map to obtain a normalized gradient map.

[0124] In practical implementation, gradient diagram The construction formula is: ;in, Represents the spatial gradient operator. For the foreground mask, the pixel in the foreground mask is... The value is 1 if it belongs to the leaf area (including healthy areas and / or diseased areas), otherwise the value is 0.

[0125] Then, to further enhance the blade boundary constraints and suppress noise within the region, the gradient map is normalized: ;in, and These represent the minimum and maximum values ​​in the gradient graph, respectively.

[0126] Step 10536: Determine the maximum distance value in the distance map, and fuse the distance map and the maximum distance value into the normalized gradient map to obtain a fused gradient map.

[0127] In practice, a fused gradient map is constructed by simultaneously utilizing blade boundary information and internal region distance information. The specific formula is as follows: ;in: This is a distance map. The maximum value of the distance map. , which is the weighting coefficient used to balance boundary constraints and region center constraints.

[0128] This fused gradient map is used to suppress premature segmentation within the region during the watershed process, while strengthening the segmentation boundary at the blade edge.

[0129] Step 10537: The fused gradient map is processed for watershed identification based on a second number of marker points to obtain the watershed boundary.

[0130] In some embodiments, step 10537 includes:

[0131] Step 105371: Starting from each of the second number of marked points, expand the region in ascending order of the corresponding fusion gradient values ​​in the fusion gradient map. This simulates the gradual rise of the water level.

[0132] Step 105372: During the region expansion process, for each unmarked pixel in the fused gradient map, the unmarked pixel is assigned to the label set of the nearest labeled point to obtain a second number of label sets.

[0133] In practice, for an unmarked pixel p, if it was first marked by a certain pixel... If the extended area is covered, then the pixel is assigned to that marker point. The corresponding set of tags is given by the formula:

[0134] ;in, This represents the shortest path distance based on the fused gradient graph. For the k-th marked point, calculate the path distances between the unmarked pixel p and all marked points to form a distance set. j represents the number of path distances, determining the set of distances. The shortest distance (i.e., ), determine the marker point corresponding to the shortest distance. The unmarked pixel p is assigned to the marked point corresponding to the shortest distance. Corresponding tag set middle.

[0135] By repeating the above process until there are no unlabeled pixels in the fused gradient map, a second set of labels can be obtained.

[0136] Step 105373: Determine the overlapping regions in the second set of markers, and establish watershed boundaries based on the overlapping regions.

[0137] In practice, for different tag sets in the second tag set M to meet at pixel p, the following formula must be satisfied:

[0138] ;

[0139] in, The preset gradient threshold is used to prevent unnecessary segmentation at low gradient locations within the region. Mi and Mj are distinct sets of labels in the second set of labels M. To fuse gradient maps The gradient value corresponding to pixel p in the image. Let p be the distance between pixel p and the tag set Mi. Let p be the distance between pixel p and the tag set Mj. This indicates that an encounter occurred at pixel p. The value represents whether pixel p is a watershed boundary; 1 indicates that it belongs to the watershed boundary, and 0 indicates that it does not belong to the watershed boundary.

[0140] Step 10538: The multi-blade adhesion instance is split according to the watershed boundary to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

[0141] In practice, after splitting the multi-blade adhesion instance according to the watershed boundary, multiple single-blade instances are obtained. The multiple single-blade instances corresponding to the multi-blade adhesion instance, and / or the candidate connected components of the blades are directly added as single-blade instances to the set L of single-blade instances, resulting in... , of which each Corresponding serial number J represents the number of independent single-blade instances.

[0142] In some embodiments, step 106 includes:

[0143] The disease area mask is intersected with each single leaf instance to obtain the single leaf disease mask corresponding to each single leaf instance.

[0144] In specific implementation, the single-leaf disease mask for serial number j The calculation formula is:

[0145] .

[0146] The above method can divide the disease area mask according to each single leaf instance, and obtain the single leaf disease mask corresponding to each single leaf instance, which facilitates the subsequent analysis of specific diseases on each leaf.

[0147] In some embodiments, step 107 includes:

[0148] Step 1071: Based on each single leaf instance, crop the region corresponding to each single leaf instance from the original plant image to obtain an image of each single leaf instance.

[0149] In specific implementation, the image of the j-th single-blade instance The formula for determining it is: ;in, This indicates a pixel-by-pixel multiplication operation.

[0150] Step 1072: Input the single-leaf instance image and / or the single-leaf disease mask corresponding to the single-leaf instance image into the disease classification model to determine the disease type and obtain the disease category corresponding to the single-leaf instance.

[0151] In practical implementation, the single-blade instance image will be used. Or its corresponding single-leaf disease mask is input into a pre-trained disease classification model (such as...) Figure 2 (As shown), identify the disease type and output the disease category:

[0152] ,in, This indicates the number of predefined disease categories. Indicates the first Disease type of a single leaf instance.

[0153] Step 1073: Determine the single-leaf area of ​​each single-leaf instance, and determine the single-leaf disease area corresponding to the single-leaf disease mask of the single-leaf instance. Use the ratio of the single-leaf disease area to the single-leaf area as the disease area percentage of the single-leaf instance.

[0154] In specific implementation, the single-blade area of ​​the j-th single-blade instance is:

[0155] ,in, This represents the number of pixels within a single leaf instance, used to characterize the area of ​​the corresponding single leaf.

[0156] The single-leaf disease area corresponding to the single-leaf disease mask of the j-th single-leaf instance:

[0157] ,in, This represents the number of pixels within the disease mask of a single leaf instance, used to characterize the disease area of ​​the corresponding single leaf.

[0158] Percentage of diseased area The formula is: The area affected by this disease accounts for This characterizes the degree of spatial spread of the disease on a single leaf instance.

[0159] Step 1074: Determine the degree of disease in the single leaf instance based on the proportion of diseased area in the single leaf instance.

[0160] In practice, it should be based on the proportion of the diseased area. The severity of the disease is quantified into a continuous index or a discrete level through a preset severity mapping function:

[0161] ;in, This is a disease severity mapping function that divides the disease severity into multiple discrete levels. Its definition rules are as follows:

[0162] .

[0163] Step 1075: Combine the disease category and disease severity corresponding to each single leaf instance to obtain the disease data combination.

[0164] In practice, for the j-th single-leaf instance, the resulting disease data combination for: .

[0165] Step 1076: Statistically analyze all single-leaf instances and summarize the disease data combinations corresponding to each single-leaf instance to obtain the summary result.

[0166] Step 1077: Combine the disease data of each individual leaf instance, and the summary results corresponding to all individual leaf instances as the disease analysis results (e.g., Figure 2 (As shown).

[0167] In practice, the number of all single-blade instances is counted. Then, the disease type and severity corresponding to each single leaf instance are combined and output together with the number of single leaf instances as a summary result.

[0168] In practice, the disease type, disease severity, and corresponding disease area percentage obtained from each single leaf instance can be compiled into a table and then output.

[0169] The above method enables accurate identification of diseases in a single leaf.

[0170] The plant disease identification method disclosed herein has the following characteristics:

[0171] 1. High-resolution, multi-leaf disease perception strategy based on adaptive slice fusion.

[0172] To address the issue of easily lost details of individual leaves and lesions in high-resolution, multi-leaf images, an adaptive slicing process is introduced. The original plant image is divided into local sub-images based on leaf distribution density, and semantic segmentation is performed on each sub-image. The slicing results are then mapped back to the original image, and overlapping areas are fused based on pixel-level consistency principles to generate globally consistent masks for healthy and diseased leaf regions. This provides high-precision input for subsequent instance separation and disease analysis.

[0173] 2. Semantic-instance dual-branch cascaded partitioning architecture.

[0174] A semantic-instance dual-branch cascaded segmentation architecture, employing a "holistic first, individual later" approach, organically combines semantic segmentation and instance segmentation. The semantic segmentation branch performs pixel-level classification only on leaf and disease regions, enabling rapid and stable extraction of all leaf foreground data from complex backgrounds and generation of disease masks. This stage requires only semantically labeled data, significantly reducing data annotation costs compared to traditional instance segmentation methods that rely on fine-grained instance annotations, thereby improving model training efficiency and generalization stability.

[0175] Based on this, the obtained leaf foreground is used as the input instance segmentation branch, so that the instance segmentation process only focuses on the instance differentiation between leaves, fundamentally reducing the interference of background noise on instance separation. Through this cascaded design, the problems of missegmentation, missed segmentation, and unstable boundaries that are prone to occur when performing instance segmentation directly on the whole image are effectively solved.

[0176] 3. Instance-aware watershed separation algorithm based on area prior.

[0177] In response to the morphological characteristics of leaves that are prone to sticking together and overlapping, this invention proposes an instance-aware watershed separation algorithm based on area prior. This algorithm introduces the physical prior constraint that the leaf areas are relatively consistent, thereby achieving adaptive instance separation of sticking leaves.

[0178] This method first performs connected component analysis on the leaf foreground obtained from semantic segmentation, and then automatically estimates the area range of a single leaf based on the area statistics of all candidate leaf regions in the same image. By comparing the area of ​​the candidate region with the prior area of ​​a single leaf, it determines whether it is a single leaf instance or a region where multiple leaves are connected, thus avoiding the problem of relying on manual experience to set a fixed threshold in traditional methods.

[0179] For regions identified as having multiple blades stuck together, this invention utilizes distance transform to extract local extrema as initial instance markers. The number of markers is adaptively determined based on the ratio of candidate region area to single blade area, ensuring the marker count matches the actual number of blades. Subsequently, marker-based watershed segmentation is performed on the gradient map incorporating semantic segmentation boundary information, thereby achieving reasonable and stable instance separation while maintaining blade boundary continuity. This method effectively suppresses over-segmentation and under-segmentation, significantly improving instance segmentation accuracy in scenarios with stuck blades.

[0180] 4. Integrated blade-level analysis of disease identification and severity measurement.

[0181] This invention integrates disease type identification and disease severity calculation at the single-leaf instance level. By precisely mapping the disease region mask obtained from semantic segmentation to the range of each independent leaf instance, a one-to-one correspondence between disease regions and specific leaves is achieved.

[0182] Based on this, a lightweight disease classification network is used to identify disease types in single leaf instances or their diseased areas. Simultaneously, based on the ratio of the diseased area to the total leaf area, the proportion of diseased area is automatically calculated, enabling a quantitative assessment of disease severity. Compared to existing disease analysis methods that analyze entire images or entire plants, this invention achieves truly precise diagnosis of "one disease per leaf," significantly improving the precision and application value of disease analysis.

[0183] 5. End-to-end fully automated analysis process.

[0184] This invention integrates modules such as image preprocessing, semantic segmentation, instance separation, disease identification, and disease severity quantification to construct an end-to-end automated analysis workflow, requiring no manual intervention throughout. By filtering background through semantic segmentation, optimizing instance segmentation based on area priors, and completing disease identification and quantitative analysis at the single-leaf scale, this invention achieves independent disease diagnosis for each leaf in complex leaf scenarios on a single RGB image for the first time. It surpasses existing technologies in terms of analysis accuracy, processing efficiency, and system robustness, and has promising prospects for engineering applications.

[0185] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0186] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0187] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a plant disease identification device.

[0188] refer to Figure 8 The device includes:

[0189] The acquisition module 201 is configured to acquire raw plant images;

[0190] The segmentation processing module 202 is configured to slice the original plant image to obtain multiple sub-images, and to segment the multiple sub-images separately to obtain a segmentation result corresponding to each sub-image. The segmentation result includes a healthy region sub-mask and a diseased region sub-mask.

[0191] The mapping module 203 is configured to map the segmentation results corresponding to each sub-image back to the coordinate system corresponding to the original plant image. After the healthy region sub-mask and the diseased region sub-mask corresponding to each sub-image are mapped, the healthy region mask and the diseased region mask are obtained.

[0192] The connected component analysis module 204 is configured to integrate the healthy region mask and the diseased region mask to obtain a foreground mask, and perform blade connected component analysis based on the foreground mask to obtain at least one blade candidate connected component.

[0193] The single-blade determination module 205 is configured to determine at least one single-blade instance based on at least one candidate blade connected component;

[0194] The disease mask determination module 206 is configured to map the disease area mask to the range corresponding to each single leaf instance, and determine the single leaf disease mask corresponding to each single leaf instance.

[0195] The disease analysis module 207 is configured to perform disease analysis based on the single-leaf disease mask corresponding to each single-leaf instance, and obtain the disease analysis results.

[0196] In some embodiments, the segmentation processing module 202 is specifically configured as follows:

[0197] Extract the foreground portion of the original plant image;

[0198] Based on the foreground portion, the average leaf density corresponding to each candidate slice is determined using a sliding window.

[0199] Based on the average leaf density, determine the size and overlap rate of each slice;

[0200] According to the size and overlap rate of each slice, the original plant image is sliced ​​to obtain multiple sub-images;

[0201] Each sub-image is semantically segmented to determine the sub-mask of the healthy region and the sub-mask of the diseased region corresponding to that sub-image.

[0202] The healthy region sub-mask and the diseased region sub-mask corresponding to each sub-image are used as the segmentation result for that sub-image.

[0203] In some embodiments, the mapping module 203 is specifically configured as follows:

[0204] The sub-masks of the healthy regions corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image to obtain the undetermined healthy region masks with overlapping parts.

[0205] The disease area sub-masks corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image to obtain the undetermined disease area mask with overlapping parts.

[0206] The probability of merging healthy regions is determined based on the mask of undetermined healthy regions, and the probability of merging diseased regions is determined based on the mask of undetermined diseased regions.

[0207] Determine a first threshold corresponding to the mask of the undetermined healthy region, and determine a second threshold corresponding to the mask of the undetermined diseased region;

[0208] The health region fusion probability corresponding to each pixel value in the undetermined health region mask is binarized based on the first threshold to obtain the health region mask.

[0209] The disease region fusion probability corresponding to each pixel value in the undetermined disease region mask is binarized based on the second threshold to obtain the disease region mask.

[0210] In some embodiments, the connected component analysis module 204 is specifically configured as follows:

[0211] The healthy region mask and the diseased region mask are combined to obtain the foreground mask;

[0212] The foreground mask is extracted using a connected component analysis algorithm to obtain at least one candidate connected component for the leaf.

[0213] In some embodiments, the single-blade determination module 205 is specifically configured as follows:

[0214] In at least one candidate connected component of a blade, the area of ​​each candidate connected component of the blade is determined, and the area of ​​the region is compared with the area range of a single blade to obtain a comparison result. Each candidate connected component of the blade corresponds to one comparison result.

[0215] In response to the comparison result indicating that the candidate connected component of the blade falls within the area of ​​a single blade, the candidate connected component of the blade is treated as a single blade instance; and / or,

[0216] In response to determining that the comparison result corresponding to the candidate connected region of the blade is greater than the area range of a single blade, the candidate connected region of the blade is determined as a multi-blade adhesion instance, and the multi-blade adhesion instance is split to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

[0217] In some embodiments, the single-blade determination module 205 is further configured to:

[0218] The distance map is obtained by performing a distance transformation on the multi-blade adhesion example.

[0219] Based on the distance map, multiple local maxima points are determined, and these local maxima points are used as initial marker points, wherein the number of initial marker points is a first number;

[0220] The second number of single blades in the multi-blade adhesion instance is determined based on the ratio of the area of ​​the region in the multi-blade adhesion instance to the average area of ​​a single blade.

[0221] Based on the first number of initial marker points, a second number is used for correction and adjustment to determine the second number of marker points in the multi-blade adhesion example;

[0222] A gradient map is constructed based on the boundary information of the foreground mask, and the gradient map is normalized to obtain a normalized gradient map.

[0223] Determine the maximum distance value in the distance map, and then fuse the distance map and the maximum distance value into the normalized gradient map to obtain a fused gradient map.

[0224] The fused gradient map is then subjected to watershed identification processing based on a second number of marker points to obtain the watershed boundary.

[0225] The multi-blade adhesion instance is split according to the watershed boundary to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

[0226] In some embodiments, the single-blade determination module 205 is further configured to:

[0227] Starting from each of the second number of marker points, the region is expanded in order of increasing fusion gradient value corresponding to the fusion gradient map;

[0228] During the region expansion process, for each unlabeled pixel in the fused gradient map, the unlabeled pixel is assigned to the label set of the nearest labeled point, thus obtaining a second number of label sets;

[0229] Determine the overlapping regions in the second set of markers, and establish watershed boundaries based on the overlapping regions.

[0230] In some embodiments, the disease mask determination module 206 is specifically configured as follows:

[0231] The disease area mask is intersected with each single leaf instance to obtain the single leaf disease mask corresponding to each single leaf instance.

[0232] In some embodiments, the disease analysis module 207 is specifically configured as follows:

[0233] Based on each single leaf instance, the region corresponding to each single leaf instance is cropped from the original plant image to obtain an image of each single leaf instance;

[0234] The single-leaf instance image and / or the single-leaf disease mask corresponding to the single-leaf instance image are input into the disease classification model to determine the disease type and obtain the disease category corresponding to the single-leaf instance.

[0235] Determine the single-leaf area of ​​each single-leaf instance, and determine the single-leaf disease area corresponding to the single-leaf disease mask of that single-leaf instance. Use the ratio of the single-leaf disease area to the single-leaf area as the proportion of the disease area of ​​that single-leaf instance.

[0236] The degree of disease in a single leaf instance is determined based on the percentage of diseased area in that instance.

[0237] The disease category corresponding to each single leaf instance and the disease severity corresponding to each single leaf instance are combined to obtain the disease data combination;

[0238] All single-leaf instances are statistically analyzed, and the disease data corresponding to each single-leaf instance are combined to obtain the summary result;

[0239] The disease analysis results are obtained by combining the disease data of each individual leaf instance and summarizing the results of all individual leaf instances.

[0240] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0241] The apparatus of the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0242] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any of the above embodiments.

[0243] Figure 9 This embodiment illustrates a more specific hardware structure of an electronic device. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0244] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0245] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0246] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0247] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0248] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0249] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0250] The electronic devices described above are used to implement the corresponding methods in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0251] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to perform the methods described in any of the above embodiments.

[0252] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0253] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0254] Based on the same concept, corresponding to any of the above embodiments, this application also provides a computer program product, including computer program instructions, which, when run on a computer, cause the computer to perform the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0255] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0256] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.

[0257] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0258] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0259] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0260] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0261] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0262] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the claims of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method for identifying plant diseases, characterized in that, include: Obtain the original plant image; The original plant image is sliced ​​to obtain multiple sub-images, and each sub-image is further segmented to obtain a segmentation result for each sub-image. The segmentation result includes a healthy region sub-mask and a diseased region sub-mask. The segmentation results corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image. After the healthy region sub-mask and diseased region sub-mask corresponding to each sub-image are mapped, the healthy region mask and diseased region mask are obtained. The healthy region mask and the diseased region mask are integrated to obtain a foreground mask, and leaf connectivity analysis is performed based on the foreground mask to obtain at least one candidate leaf connectivity. Based on at least one candidate blade connected component, at least one single blade instance is determined; The disease area mask is mapped to the range corresponding to each single leaf instance to determine the single leaf disease mask corresponding to each single leaf instance. Based on the single-leaf disease mask corresponding to each single-leaf instance, disease analysis is performed to obtain the disease analysis results; The step of determining at least one single-blade instance based on at least one candidate blade connected component includes: In at least one candidate connected component of a blade, the area of ​​each candidate connected component of the blade is determined, and the area of ​​the region is compared with the area range of a single blade to obtain a comparison result. Each candidate connected component of the blade corresponds to one comparison result. In response to the comparison result indicating that the candidate connected component of the blade falls within the area of ​​a single blade, the candidate connected component of the blade is treated as a single blade instance; and / or, In response to determining that the comparison result corresponding to the candidate connected region of the blade is greater than the area range of a single blade, the candidate connected region of the blade is determined as a multi-blade adhesion instance, and the multi-blade adhesion instance is split to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

2. The method according to claim 1, characterized in that, The process of slicing the original plant image to obtain multiple sub-images, and then segmenting each sub-image to obtain a segmentation result for each sub-image, includes: Extract the foreground portion of the original plant image; Based on the foreground portion, the average leaf density corresponding to each candidate slice is determined using a sliding window. Based on the average leaf density, determine the size and overlap rate of each slice; According to the size and overlap rate of each slice, the original plant image is sliced ​​to obtain multiple sub-images; Each sub-image is semantically segmented to determine the sub-mask of the healthy region and the sub-mask of the diseased region corresponding to that sub-image. The healthy region sub-mask and the diseased region sub-mask corresponding to each sub-image are used as the segmentation result for that sub-image.

3. The method according to claim 1, characterized in that, The process of mapping the segmentation results corresponding to each sub-image back to the coordinate system corresponding to the original plant image, and after the mapping of the healthy region sub-mask and the diseased region sub-mask corresponding to each sub-image is completed, results in the healthy region mask and the diseased region mask, including: The sub-masks of the healthy regions corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image to obtain the undetermined healthy region masks with overlapping parts. The disease area sub-masks corresponding to each sub-image are mapped back to the coordinate system corresponding to the original plant image to obtain the undetermined disease area mask with overlapping parts. The probability of merging healthy regions is determined based on the mask of undetermined healthy regions, and the probability of merging diseased regions is determined based on the mask of undetermined diseased regions. Determine a first threshold corresponding to the mask of the undetermined healthy region, and determine a second threshold corresponding to the mask of the undetermined diseased region; The health region fusion probability corresponding to each pixel value in the undetermined health region mask is binarized based on the first threshold to obtain the health region mask. The disease region fusion probability corresponding to each pixel value in the undetermined disease region mask is binarized based on the second threshold to obtain the disease region mask.

4. The method according to claim 1, characterized in that, The healthy region mask and the diseased region mask are integrated to obtain a foreground mask, and leaf connectivity analysis is performed based on the foreground mask to obtain at least one candidate leaf connectivity component, including: The healthy region mask and the diseased region mask are combined to obtain the foreground mask; The foreground mask is extracted using a connected component analysis algorithm to obtain at least one candidate connected component for the leaf.

5. The method according to claim 1, characterized in that, The step of splitting the multi-blade adhesion instance to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance includes: The distance map is obtained by performing a distance transformation on the multi-blade adhesion example. Based on the distance map, multiple local maxima points are determined, and these local maxima points are used as initial marker points, wherein the number of initial marker points is a first number; The second number of single blades in the multi-blade adhesion instance is determined based on the ratio of the area of ​​the region in the multi-blade adhesion instance to the average area of ​​a single blade. Based on the first number of initial marker points, a second number is used for correction and adjustment to determine the second number of marker points in the multi-blade adhesion example; A gradient map is constructed based on the boundary information of the foreground mask, and the gradient map is normalized to obtain a normalized gradient map. Determine the maximum distance value in the distance map, and then fuse the distance map and the maximum distance value into the normalized gradient map to obtain a fused gradient map. The fused gradient map is then subjected to watershed identification processing based on a second number of marker points to obtain the watershed boundary. The multi-blade adhesion instance is split according to the watershed boundary to obtain multiple single-blade instances corresponding to the multi-blade adhesion instance.

6. The method according to claim 5, characterized in that, The step of performing watershed identification processing on the fused gradient map based on a second number of marker points to obtain the watershed boundary includes: Starting from each of the second number of marker points, the region is expanded in order of increasing fusion gradient value corresponding to the fusion gradient map; During the region expansion process, for each unlabeled pixel in the fused gradient map, the unlabeled pixel is assigned to the label set of the nearest labeled point, thus obtaining a second number of label sets; Determine the overlapping regions in the second set of markers, and establish watershed boundaries based on the overlapping regions.

7. The method according to claim 1, characterized in that, The step of mapping the diseased area mask to the range corresponding to each single leaf instance, and determining the single leaf disease mask corresponding to each single leaf instance, includes: The disease area mask is intersected with each single leaf instance to obtain the single leaf disease mask corresponding to each single leaf instance.

8. The method according to claim 1, characterized in that, The disease analysis is performed based on the single-leaf disease mask corresponding to each single-leaf instance, and the disease analysis results are obtained, including: Based on each single leaf instance, the region corresponding to each single leaf instance is cropped from the original plant image to obtain an image of each single leaf instance; The single-leaf instance image and / or the single-leaf disease mask corresponding to the single-leaf instance image are input into the disease classification model to determine the disease type and obtain the disease category corresponding to the single-leaf instance. Determine the single-leaf area of ​​each single-leaf instance, and determine the single-leaf disease area corresponding to the single-leaf disease mask of that single-leaf instance. Use the ratio of the single-leaf disease area to the single-leaf area as the proportion of the disease area of ​​that single-leaf instance. The degree of disease in a single leaf instance is determined based on the percentage of diseased area in that instance. The disease category corresponding to each single leaf instance and the disease severity corresponding to each single leaf instance are combined to obtain the disease data combination; All single-leaf instances are statistically analyzed, and the disease data corresponding to each single-leaf instance are combined to obtain the summary result; The disease analysis results are obtained by combining the disease data of each individual leaf instance and summarizing the results of all individual leaf instances.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.