Disease and pest image recognition method and system

By combining superpixel segmentation and multi-color channel gradient histogram features, the problem of accurately distinguishing between diseased and healthy areas in pest and disease images with high texture complexity is solved, and accurate identification of pest and disease patches is achieved.

CN121962012APending Publication Date: 2026-05-01CHONGQING UNIV OF ARTS & SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF ARTS & SCI
Filing Date
2025-12-22
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Under highly textured and complex crop surfaces, existing technologies struggle to accurately distinguish between diseased and healthy areas, often resulting in oversegmentation or undersegmentation.

Method used

Multiple superpixel units are generated through superpixel segmentation. The color gamut difference vector and mutual information entropy are calculated. Combined with the gradient histogram features of multiple color channels, cross-identification of disease and pest patches is performed.

Benefits of technology

On the highly textured and complex surfaces of crops, this technology can accurately distinguish between diseased and healthy areas, reduce computational redundancy, and improve the accuracy and efficiency of pest and disease identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962012A_ABST
    Figure CN121962012A_ABST
Patent Text Reader

Abstract

The invention provides a disease and pest image recognition method and system. The disease and pest image of the surface of a target crop is acquired; segmenting the pest image into a plurality of super-pixel units based on the texture complexity of the target crop; determining color gamut differences of the superpixel units and neighborhood superpixel units under different color channels, generating color gamut difference vectors representing local anomalies of the superpixel units, and identifying candidate scab regions of the target crops; determining gradient histogram features of the candidate scab area under the red channel and the blue channel, and further determining mutual information entropy of a gradient histogram between the red channel and the blue channel; based on the color gamut difference vector and the mutual information entropy corresponding to the candidate scab area, cross identification of the target crop scab is carried out, and a disease and pest plaque on the surface of the target crop is obtained. According to the technical scheme provided by the invention, the scab area and the healthy area can be accurately distinguished under the crop surface with high texture complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Pest and Disease Image Recognition Methods and Systems Technical Field

[0001] This application relates to the field of image recognition technology, and more specifically, to a method and system for identifying images of pests and diseases. Background Technology

[0002] Image recognition, as a core technology of computer vision, is mainly built upon the breakthrough development of deep learning and convolutional neural networks. By constructing multi-layered neural network models, computers can automatically learn hierarchical feature representations from low to high levels from massive labeled image data, thereby achieving accurate identification of objects, scenes, and content. With the continuous optimization of model structures and the promotion of large-scale datasets, image recognition has significantly improved in terms of accuracy and robustness, and has been widely applied in many key fields such as agriculture, medical imaging, autonomous driving, and intelligent interaction, becoming an important pillar for the implementation of artificial intelligence technology.

[0003] In existing image recognition methods, the input image is first preprocessed to eliminate environmental interference and unify the data format. The core process relies on convolutional neural networks, which automatically extract features layer by layer through alternating operations of convolutional and pooling layers. Subsequently, fully connected layers integrate the extracted features to achieve the classification, location, or scene understanding of the target in the image, and output the recognition result of the target image. However, in the recognition of pest and disease images, the surface of crops often has high texture variability and complex background noise. These factors make the diseased area and the healthy area highly similar in color and texture. When traditional methods use fixed segmentation thresholds or single color channel analysis, it is easy to over-segment or under-segment the diseased area and the healthy area, and it is impossible to effectively capture the local abnormal features of the diseased area. Therefore, how to accurately distinguish between diseased areas and healthy areas on the highly textured and complex surface of crops has become a difficult problem for the industry. Summary of the Invention

[0004] This application provides a method and system for identifying pest and disease images, which can accurately distinguish between diseased areas and healthy areas on the highly textured and complex surfaces of crops.

[0005] In a first aspect, this application provides a method for identifying pest and disease images, comprising the following steps: acquiring an image of pests and diseases containing suspected lesions on the surface of a target crop; performing superpixel segmentation on the pest and disease image based on the texture complexity of the target crop to generate multiple superpixel units; for each superpixel unit, determining the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, thereby generating a color gamut difference vector characterizing the local anomaly of the superpixel unit, and identifying candidate lesion regions of the target crop based on the color gamut difference vectors corresponding to each superpixel unit; performing multi-color channel pixel gradient analysis on the candidate lesion regions, and extracting the gradient histogram features of the candidate lesion regions in the red and blue channels during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels; and performing cross-identification of target crop lesions based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions to obtain pest and disease patches on the surface of the target crop.

[0006] In some embodiments, performing superpixel segmentation on the pest and disease image based on the texture complexity of the target crop to generate multiple superpixel units specifically includes: determining the texture complexity of the target crop region in the pest and disease image; adjusting the number of cluster centers and spatial distance weights of the superpixel segmentation based on the texture complexity; and performing superpixel segmentation on the pest and disease image according to the adjusted number of cluster centers and spatial distance weights to obtain multiple superpixel units.

[0007] In some embodiments, for each superpixel unit, determining the gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, and then generating a gamut difference vector characterizing the local anomaly of the superpixel unit, specifically includes: determining the set of neighboring superpixel units for each superpixel unit; converting the superpixel unit and its corresponding set of neighboring superpixel units to different color channels, and extracting the gamut features of the superpixel unit in each color channel; calculating the gamut difference between the gamut features of the superpixel unit and the gamut features of the neighboring superpixel units in the set of neighboring superpixel units in each color channel; and combining the gamut differences in each color channel in a preset order to generate a gamut difference vector characterizing the local anomaly of the superpixel unit.

[0008] In some embodiments, identifying candidate lesion regions of the target crop based on the color gamut difference vector corresponding to each superpixel unit specifically includes: calculating the local anomaly value of each superpixel unit based on the color gamut difference vector of each superpixel unit; determining an anomaly determination threshold based on the local anomaly values ​​of all superpixel units; selecting superpixel units from all superpixel units whose local anomaly values ​​exceed the anomaly determination threshold, and using the selected superpixel units as candidate lesion regions of the target crop.

[0009] In some embodiments, performing multi-color channel pixel gradient analysis on the candidate lesion region and extracting the gradient histogram features of the candidate lesion region in the red and blue channels during the pixel gradient analysis specifically includes: separating the candidate lesion region into multiple color channels to obtain single-channel images of each color channel; calculating the pixel gradient of each single-channel image to obtain the gradient map of each color channel; selecting the red channel gradient map and the blue channel gradient map from the gradient maps of each color channel; performing histogram statistics on the red channel gradient map and the blue channel gradient map respectively, and then extracting the gradient histogram features in the red and blue channels.

[0010] In some embodiments, the cross-identification of target crop lesions based on the color gamut difference vector and mutual information entropy corresponding to the candidate lesion regions to obtain disease and pest patches on the surface of the target crop specifically includes: standardizing the color gamut difference vector and mutual information entropy of the candidate lesion regions to obtain standardized color gamut difference features and standardized mutual information entropy; constructing a lesion cross-identification index based on the standardized color gamut difference features and standardized mutual information entropy; screening candidate lesion regions according to the lesion cross-identification index and retaining candidate lesion regions that meet the lesion characteristics; and performing morphological optimization on the screened candidate lesion regions to obtain disease and pest patches on the surface of the target crop.

[0011] In some embodiments, images of pests and diseases containing suspected lesions on the surface of a target crop are acquired using an industrial camera.

[0012] Secondly, this application provides a pest and disease image recognition system, which includes: an acquisition module for acquiring images of pests and diseases containing suspected lesions on the surface of a target crop; a processing module for performing superpixel segmentation on the pest and disease image based on the texture complexity of the target crop to generate multiple superpixel units; the processing module is further configured to, for each superpixel unit, determine the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, thereby generating a color gamut difference vector characterizing the local anomaly of the superpixel unit, and identifying candidate lesion regions of the target crop based on the color gamut difference vectors corresponding to each superpixel unit; the processing module is further configured to perform multi-color channel pixel gradient analysis on the candidate lesion regions, and extract the gradient histogram features of the candidate lesion regions in the red and blue channels during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels; and an execution module for performing cross-identification of target crop lesions based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions to obtain pest and disease patches on the surface of the target crop.

[0013] Thirdly, this application provides a computer device, the computer device including a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the above-described method for identifying pest and disease images.

[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for identifying pest and disease images.

[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: In the pest and disease image recognition method and system provided in this application, firstly, an image of pests and diseases containing suspected lesions on the surface of a target crop is acquired; secondly, the pest and disease image is segmented into multiple superpixel units based on the texture complexity of the target crop; further, for each superpixel unit, the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels is determined, thereby generating a color gamut difference vector characterizing the local anomaly of the superpixel unit, and candidate lesion regions of the target crop are identified based on the color gamut difference vectors corresponding to each superpixel unit; then, pixel gradient analysis of the candidate lesion regions in multiple color channels is performed, and during the pixel gradient analysis process, the gradient histogram features of the candidate lesion regions in the red and blue channels are extracted, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels; finally, cross-identification of target crop lesions is performed based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions to obtain pest and disease patches on the surface of the target crop.

[0016] Therefore, this application can accurately distinguish between lesion areas and healthy areas on crop surfaces with high texture complexity. First, acquiring images of pests and diseases containing suspected lesions provides a targeted data source for subsequent full-process analysis. Second, superpixel segmentation based on the texture complexity of the target crop generates multiple superpixel units, which better fit the natural boundaries of the crop tissue, avoiding feature fragmentation caused by traditional uniform segmentation, and providing a precise regional division basis for subsequent local anomaly analysis. Furthermore, by calculating the color gamut difference between superpixel units and neighboring units in multiple color channels and generating a color gamut difference vector, the color anomaly features of local areas can be effectively obtained, and candidate lesion areas can be screened based on the color gamut difference vector, thereby effectively eliminating a large number of normal tissue areas and significantly reducing the computational redundancy of subsequent fine processing. Then, multi-color channel pixel gradient analysis is performed on the candidate lesion areas and targeted... This paper extracts gradient histogram features from the red and blue channels and calculates the mutual information entropy of these two channels. This approach leverages the sensitivity of the red and blue channels to color decay and structural damage in lesions to capture differentiated gradient information. Furthermore, it quantifies the feature associations between channels through mutual information entropy, thereby improving the distinguishability of lesions from similar backgrounds. This avoids over-segmentation and under-segmentation of lesion areas often caused by high texture variability and complex background noise on the target crop surface. Finally, cross-identification based on color gamut difference vectors and mutual information entropy is used to obtain disease and pest patches. This achieves complementary verification of color anomaly features and channel gradient association features, effectively eliminating noise interference and misjudged areas in the candidate regions, ensuring that the final output disease and pest patches accurately match the contour and range of the actual infected area. In summary, the technical solution provided in this application can accurately distinguish between lesion areas and healthy areas on crop surfaces with high texture complexity. Attached Figure Description

[0017] Figure 1 is a schematic diagram of an application scenario architecture of the pest and disease image recognition method according to some embodiments of this application; Figure 2 is an exemplary flowchart of the pest and disease image recognition method according to some embodiments of this application; Figure 3 is an exemplary flowchart of determining multiple superpixel units according to some embodiments of this application; Figure 4 is a schematic diagram of the structure of the pest and disease image recognition system according to some embodiments of this application; Figure 5 is a schematic diagram of the structure of the computer device implementing the pest and disease image recognition method according to some embodiments of this application. Detailed Implementation

[0018] To better understand the technical solution of this application, the technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] Referring to Figure 1, which is a schematic diagram of an application scenario architecture for a pest and disease image recognition method according to some embodiments of this application, the application scenario architecture includes a data acquisition terminal, a communication network, and a server. The data acquisition terminal and the server are directly or indirectly connected through the communication network. The data acquisition terminal acquires images of pests and diseases containing suspected lesions on the surface of a target crop and uploads them to the server. The server performs superpixel segmentation on the pest and disease image based on the texture complexity of the target crop, generating multiple superpixel units. For each superpixel unit, the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels is determined, and further... The process involves generating a color gamut difference vector characterizing the local anomalies of superpixel units, identifying candidate lesion regions of the target crop based on the color gamut difference vectors corresponding to each superpixel unit, performing multi-color channel pixel gradient analysis on the candidate lesion regions, and extracting the gradient histogram features of the candidate lesion regions in the red and blue channels during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels, and performing cross-identification of target crop lesions based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions to obtain the disease and pest patches on the surface of the target crop.

[0020] Referring to Figure 2, which is an exemplary flowchart of a pest and disease image recognition method according to some embodiments of this application, the pest and disease image recognition method mainly includes the following steps: in step 101, an image of pests and diseases containing suspected lesions on the surface of the target crop is obtained.

[0021] In specific implementation, images of pests and diseases containing suspected lesions on the surface of the target crop can be acquired using an industrial camera. In addition, in other embodiments, other acquisition devices can also be used to acquire images of pests and diseases containing suspected lesions on the surface of the target crop. The pest and disease images refer to images used to present the surface state of the target crop. Specifically, they are digital images of abnormal surface states of the target crop acquired by an industrial camera. The pest and disease images record the visual characteristics of pests on the target crop. By acquiring pest and disease images, the aim is to achieve accurate monitoring and identification of the health status of the target crop.

[0022] In step 102, the pest and disease image is segmented into multiple superpixel units based on the texture complexity of the target crop.

[0023] In some embodiments, referring to FIG3, which is an exemplary flowchart of determining multiple superpixel units according to some embodiments of this application, the generation of multiple superpixel units by superpixel segmentation of the pest and disease image based on the texture complexity of the target crop in this embodiment can be achieved by the following steps: in step 1021, the texture complexity of the target crop region in the pest and disease image is determined; in step 1022, the number of cluster centers and spatial distance weights of superpixel segmentation are adjusted based on the texture complexity; in step 1023, superpixel segmentation is performed on the pest and disease image according to the adjusted number of cluster centers and spatial distance weights to obtain multiple superpixel units.

[0024] In specific implementation, firstly, the target crop region is segmented from the pest and disease image and converted into a grayscale image. Then, using the well-known gray-level co-occurrence matrix method, the contrast, energy, and entropy texture features of the grayscale image are calculated in four directions: 0°, 45°, 90°, and 135°. The three texture features are then fused using a weighted fusion method, and the fusion result is used as the texture complexity of the target crop region. The weights of contrast, energy, and entropy in the weighted fusion can be set according to actual needs or expert knowledge, and are not limited here. The texture complexity is an indicator that characterizes the complexity of the surface texture of the target crop.Then, adjust the number of clustering centers and the spatial distance weight of superpixel segmentation based on the texture complexity, that is: obtain the standard value range [Cmin, Cmax] of the texture complexity of the target crop from a large number of target crop image samples, where Cmax is the maximum texture complexity and Cmin is the minimum texture complexity. At the same time, determine the reference value K0 of the number of clustering centers (that is, the number of clustering centers corresponding to the median value Cmid of the interval of texture complexity, calculated by dividing the image resolution by the average area of the target superpixel unit) and the reference value W0 of the spatial distance weight (which can be determined according to experimental statistics or set according to actual needs). Subsequently, establish a positive linear mapping relationship between the texture complexity and the number of clustering centers, and set the adjustment coefficient k1 of the number of clustering centers (k1>0, which can be set according to actual needs to ensure that when the texture complexity changes within [Cmin, Cmax], the number of clustering centers is within the reasonable range [Kmin, Kmax], where Kmin is the minimum number of clustering centers when the texture complexity is Cmin, and Kmax is the maximum number of clustering centers when the texture complexity is Cmax). Calculate the actual number of clustering centers K through the positive linear mapping relationship K = K0 + k1×(C - Cmid), where C is the texture complexity of the target crop in the current pest and disease image. If the calculated K exceeds [Kmin, Kmax], take the corresponding boundary value (that is, take Kmin when it is lower than Kmin and take Kmax when it is higher than Kmax). At the same time, establish a negative linear mapping relationship between the texture complexity and the spatial distance weight, and set the adjustment coefficient k2 of the spatial distance weight (0 < k2 < 1, which can be set according to actual needs to ensure that the weight changes within [Wmin, W0], where Wmin is the minimum weight value when the texture complexity is Cmax). Calculate the actual spatial distance weight W through the negative linear mapping relationship W = W0 - k2×(C - Cmid). If the calculated W exceeds [Wmin, W0], take the corresponding boundary value (that is, take Wmin when it is lower than Wmin and take W0 when it is higher than W0). The principle of adjusting the number of clustering centers and the spatial distance weight of superpixel segmentation based on the texture complexity is that the higher the texture complexity, the richer the surface details of the crop, and the spatial distance weight needs to be reduced to weaken the influence of spatial position on clustering and increase the number of clustering centers. The lower the texture complexity, the flatter the surface of the crop, and the spatial distance weight needs to be increased to ensure the spatial continuity of superpixel units, avoid over-segmentation, and reduce the number of clustering centers. The number of clustering centers is the total number of clustering points in superpixel segmentation, and the spatial distance weight is a parameter that emphasizes the difference in pixel spatial positions during the superpixel clustering process;Finally, the target crop area in the pest and disease image is first evenly divided into grids according to the adjusted number of cluster centers. The grid intersections are used as cluster centers. A simple linear iterative clustering algorithm is used to convert the image to the CIELAB color channel. The color distance and Euclidean distance between each pixel and each cluster center are calculated. The Euclidean distance is weighted by the adjusted spatial distance weights and then fused with the color distance to obtain the comprehensive distance. Each pixel is assigned to the cluster center with the closest comprehensive distance. The cluster centers are iteratively updated to the mean position of their corresponding cluster regions until the cluster centers converge, thus obtaining multiple superpixel units with similar features and spatial adjacency.

[0025] It should be noted that, in this application, a superpixel unit refers to a pixel block in a pest and disease image that is similar in color and texture and spatially adjacent. Determining a superpixel unit can aggregate pixels with similar features (color, texture, etc.) and spatially adjacent in a pest and disease image into irregular pixel blocks with actual semantics. This not only significantly reduces the amount of data in subsequent image processing and lowers the computational complexity, but also preserves the local structure and boundary information of the target crop surface, avoiding interference from individual pixel noise on feature extraction. At the same time, the superpixel unit can also provide a carrier for accurately capturing the feature differences between lesions and normal crop areas, making the subsequent lesion identification process more targeted and effectively improving the accuracy of candidate lesion area screening and the efficiency of overall pest and disease identification.

[0026] In step 103, for each superpixel unit, the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels is determined, and then a color gamut difference vector characterizing the local anomaly of the superpixel unit is generated. Based on the color gamut difference vector corresponding to each superpixel unit, the candidate lesion area of ​​the target crop is identified.

[0027] In some embodiments, for each superpixel unit, determining the gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, and then generating a gamut difference vector characterizing the local anomaly of the superpixel unit, is achieved through the following steps: determining the set of neighboring superpixel units for each superpixel unit; converting the superpixel unit and its corresponding set of neighboring superpixel units to different color channels, and extracting the gamut features of the superpixel unit in each color channel; calculating the gamut difference between the gamut features of the superpixel unit and the gamut features of the neighboring superpixel units in the set of neighboring superpixel units in each color channel; and combining the gamut differences in each color channel in a preset order to generate a gamut difference vector characterizing the local anomaly of the superpixel unit.

[0028] In specific implementation, firstly, based on the geometric center of each superpixel unit, it is determined whether other superpixel units overlap with or are spatially adjacent to the current superpixel unit. If so, they are selected as neighboring superpixel units, thus obtaining the set of neighboring superpixel units for each superpixel unit. The set of neighboring superpixel units refers to the set of superpixel units that are spatially adjacent to the current superpixel unit. Secondly, using existing image color channel conversion methods, the current superpixel unit and the corresponding neighboring superpixel units in the set are converted to the L, A, and B color channels in the CIELAB color space, respectively. Then, through statistical calculation, the mean and standard deviation of all pixels of each superpixel unit in each color channel are extracted, and the extracted mean and standard deviation are combined to represent the superpixel in the corresponding color channel. The color gamut features of a superpixel unit are defined as a set of indicators reflecting the overall color distribution and dispersion of the superpixel unit. Then, under each color channel, the Euclidean distance is used to calculate the distance between the color gamut features of the current superpixel unit and the color gamut features of each neighboring superpixel unit in the neighboring superpixel unit set. The average distances of all neighboring superpixel units are then taken to obtain the color gamut difference of the current superpixel unit under that color channel. This color gamut difference quantifies the similarity of color features between the current superpixel unit and its neighboring superpixel units under different color channels. Finally, according to a preset color channel priority order (e.g., L color channel → A color channel → B color channel), the color gamut differences obtained under each color channel are arranged sequentially to construct a one-dimensional numerical sequence, generating a color gamut difference vector representing the local anomalies of the superpixel unit.

[0029] It should be noted that, in this application, the color gamut difference vector refers to the feature vector of the degree of color aberration of the current superpixel unit relative to the surrounding superpixel units. Determining the color gamut difference vector can integrate the color gamut feature differences of the superpixel unit with the neighboring units in multiple color spaces to form a unified quantitative feature. This can effectively avoid the limitations of a single color space in capturing color differences and comprehensively reflect the degree of color aberration of the current superpixel unit relative to the surrounding area. This provides an accurate quantitative basis for subsequent local anomaly calculation and candidate lesion area screening, thereby effectively improving the distinction between lesions and normal crop areas and laying the foundation for the accuracy of overall pest and disease identification.

[0030] In some embodiments, identifying candidate lesion regions of the target crop based on the color gamut difference vector corresponding to each superpixel unit is achieved by the following steps: calculating the local anomaly value of each superpixel unit based on the color gamut difference vector of each superpixel unit; determining an anomaly determination threshold based on the local anomaly values ​​of all superpixel units; selecting superpixel units whose local anomaly values ​​exceed the anomaly determination threshold from all superpixel units, and using the selected superpixel units as candidate lesion regions of the target crop.

[0031] In specific implementation, firstly, the vector magnitude calculation method is used to solve the Euclidean magnitude of the color gamut difference vector of each superpixel unit, and the obtained magnitude value is used as the local anomaly value of the corresponding superpixel unit, thus obtaining the local anomaly value of each superpixel unit. The local anomaly value refers to the index characterizing the degree of color anomaly of the superpixel unit relative to the neighborhood region in multiple color spaces. Secondly, the local anomaly values ​​of all superpixel units are statistically analyzed. By calculating the inter-class variance of the local anomaly values ​​at different gray levels, the local anomaly value corresponding to the largest inter-class variance is selected as the anomaly judgment threshold. The anomaly judgment threshold refers to the critical value for distinguishing whether a superpixel unit belongs to an abnormal region. Finally, the local anomaly value of each superpixel unit is compared with the anomaly judgment threshold one by one, and superpixel units with local anomaly values ​​greater than the anomaly judgment threshold are selected as candidate lesion areas of the target crop.

[0032] It should be noted that, in this application, candidate lesion areas refer to pixel areas that are determined to be potentially infected by pests and diseases. Identifying candidate lesion areas can accurately screen out the set of units with local abnormal features from all superpixel units, effectively eliminating normal crop areas without abnormalities, and providing analysis objects for subsequent targeted analysis such as extracting gradient histogram features and calculating channel mutual information entropy. This avoids interference from normal areas with effective features and improves the targeting and efficiency of subsequent lesion cross-identification.

[0033] In step 104, pixel gradient analysis of the candidate lesion region is performed on the multi-color channel, and the gradient histogram features of the candidate lesion region in the red channel and blue channel are extracted during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histogram features between the red channel and the blue channel.

[0034] In some embodiments, performing multi-color channel pixel gradient analysis on the candidate lesion region and extracting the gradient histogram features of the candidate lesion region in the red and blue channels during the pixel gradient analysis process is achieved through the following steps: separating the candidate lesion region into multiple color channels to obtain single-channel images of each color channel; calculating the pixel gradient of each single-channel image to obtain the gradient map of each color channel; selecting the red channel gradient map and the blue channel gradient map from the gradient maps of each color channel; performing histogram statistics on the red channel gradient map and the blue channel gradient map respectively, and then extracting the gradient histogram features in the red and blue channels.

[0035] In specific implementation, firstly, the RGB color image corresponding to the candidate lesion region is decomposed into red, green, and blue channel images containing only single color component information using existing color channel separation methods, thus obtaining single-channel images for each color channel. A single-channel image refers to an original color image containing only a single color component information. Secondly, the Sobel gradient operator in image processing is used to calculate the pixel gradient of each single-channel image. Specifically, a 3×3 Sobel horizontal and vertical convolution kernel is used to convolve the single-channel image, obtaining the gradient response value of each pixel in the horizontal and vertical directions. Then, the L2 norm is used to perform a square root operation on the horizontal and vertical gradient response values ​​to obtain the gradient value of each pixel. Finally, gradient maps for each color channel are generated based on the gradient values ​​of all pixels. The gradient map refers to an image that represents the degree of drastic change in pixel grayscale in the corresponding single-channel image. Then, the gradient map of the red channel and the gradient map of the blue channel are directly selected from the gradient maps of the red channel, green channel, and blue channel. The gradient map of the red channel represents the degree of drastic change in the red component of the pixel in the candidate lesion area, and the gradient map of the blue channel represents the degree of drastic change in the blue component of the pixel in the candidate lesion area. Finally, histogram statistics are performed on the gradient maps of the red channel and the gradient maps of the blue channel respectively. First, the range of gradient values ​​is determined and divided into multiple equal grayscale levels (the specific division can be based on actual needs and is not limited here). Then, the number of pixels contained in each grayscale level is counted. A histogram is constructed with the grayscale level as the horizontal axis and the corresponding number of pixels as the vertical axis. The histogram is used as the gradient histogram feature, thereby obtaining the gradient histogram features of the red channel and the blue channel.

[0036] It should be noted that the gradient histogram feature in this application is a feature that characterizes the distribution pattern of gradient values ​​in the gradient map, and can reflect the edge and detail features of the image. This scheme combines the chlorophyll degradation, abnormal pigment distribution and structural characteristics caused by crop lesion infection, and specifically selects the red channel and blue channel (the red channel is more sensitive to the gradient change of lesion color decay, and the blue channel is more accurate for the edge gradient difference of lesion structural damage), avoiding the redundant interference caused by the chlorophyll background in the green channel. Instead of directly fusing the dual-channel features, it extracts the gradient histogram features of each channel separately, retaining the independent characteristics of the red channel focusing on color gradient and the blue channel focusing on structural abrupt gradient. Compared with the full-channel gradient feature, the scheme of this embodiment can eliminate redundant interference, making the features more focused on the edge and detail of the lesion, improving the feature distinction between lesions and normal tissue and reducing the noise impact of subsequent calculations. At the same time, the scene-based channel selection that fits the change pattern of crop lesions can effectively distinguish similar backgrounds from real lesions, significantly improving the accuracy of subsequent cross-identification and reducing the false recognition rate.

[0037] In some embodiments, determining the mutual information entropy of the gradient histogram features between the red channel and the blue channel is achieved through the following steps: calculating the joint probability distribution and their respective marginal probability distributions based on the gradient histogram features of the red channel and the blue channel; calculating the entropy of the gradient histogram features of the red channel and the blue channel based on the corresponding marginal probability distributions; calculating the joint entropy of the red channel and the blue channel based on the joint probability distributions; and determining the mutual information entropy of the gradient histograms between the red channel and the blue channel based on the entropy of the gradient histogram features of the red channel, the entropy of the gradient histogram features of the blue channel, and the joint entropy.

[0038] In specific implementation, based on the gradient histogram features of the red and blue channels (i.e., the normalized frequency distribution, where the normalized frequency distribution is obtained by dividing the number of pixels corresponding to each gray level (i.e., the frequency) by the total number of pixels in the corresponding gradient histogram feature, and the sum of the frequencies of all gray levels is 1), a known joint probability statistical method is used. The gray levels of the gradient histogram features of the red channel are used as the horizontal axis, and the gray levels of the gradient histogram features of the blue channel are used as the vertical axis to construct a two-dimensional joint histogram. The joint occurrence frequency of pixels for each combination (i.e., the combination of red channel gray levels and blue channel gray levels) is statistically analyzed. After normalization, the joint probability distribution of the two is obtained. Simultaneously, the normalized frequencies of the gradient histogram features of the red and blue channels are used as the corresponding edge probability distributions. The joint probability distribution is a two-dimensional probability distribution describing the possibility of the two channel gradient gray levels occurring together, while the edge probability distribution is a one-dimensional probability distribution describing the possibility of each channel gradient gray level occurring separately. Secondly, according to the definition of information entropy, the edge probability distribution of the red channel is further analyzed. The calculation involves taking the logarithm of the probability for each gray level, multiplying it by the probability, summing all the results, and taking the negative value to obtain the entropy of the red channel gradient histogram feature. Similarly, the same operation is performed on the marginal probability distribution of the blue channel to obtain the entropy of the blue channel gradient histogram feature. The entropy of the red channel gradient histogram feature is a quantitative indicator characterizing the uncertainty of the red channel gradient value distribution, and the entropy of the blue channel gradient histogram feature is a quantitative indicator characterizing the uncertainty of the blue channel gradient value distribution. Then, using the definition of joint entropy, the entropy is calculated for each gray level in the joint probability distribution... The joint probability of each combination (i.e., the combination of the gray levels of the red channel and the gray levels of the blue channel) is taken as logarithm, multiplied by the joint probability, and then the sum of all the results is taken as negative to obtain the joint entropy of the red channel and the blue channel. The joint entropy is a quantitative indicator that characterizes the uncertainty of the joint distribution of the gradient gray levels of the two channels. Finally, according to the known calculation logic of mutual information entropy, the entropy of the gradient histogram feature of the red channel is added to the entropy of the gradient histogram feature of the blue channel, and then the joint entropy is subtracted. The result is the mutual information entropy of the gradient histogram between the red channel and the blue channel.

[0039] It should be noted that in this application, mutual information entropy is an indicator that characterizes the statistical correlation and information sharing degree between the gradient histogram features of two channels. The core function of determining mutual information entropy is to quantify the statistical correlation and information sharing degree between the gradient histogram features of the red channel and the blue channel. By reflecting the correlation characteristics of the gradient distribution of the two channels (such as the low correlation caused by the asynchrony of color decay and structural damage in lesion areas, and the high correlation caused by the consistency of features in normal areas), a key quantitative indicator that can distinguish lesions from normal tissue is constructed. At the same time, this mutual information entropy integrates the complementary information of the color gradient gradient of the red channel and the structural mutation gradient of the blue channel. This avoids the limitation of single-channel features in representing complex lesions, and enhances the uniqueness of lesion features through the correlation analysis of the two-channel features. This provides a more discriminative basis for the final judgment of lesions based on multi-dimensional features, effectively improving the accuracy and anti-interference ability of pest and disease identification.

[0040] In step 105, cross-identification of target crop lesions is performed based on the color gamut difference vector and mutual information entropy corresponding to the candidate lesion regions to obtain the disease and pest patches on the surface of the target crop.

[0041] In some embodiments, the cross-identification of target crop lesions based on the color gamut difference vector and mutual information entropy corresponding to the candidate lesion regions to obtain disease and pest patches on the surface of the target crop is achieved through the following steps: standardizing the color gamut difference vector and mutual information entropy of the candidate lesion regions to obtain standardized color gamut difference features and standardized mutual information entropy; constructing a lesion cross-identification index based on the standardized color gamut difference features and standardized mutual information entropy; screening candidate lesion regions according to the lesion cross-identification index and retaining candidate lesion regions that meet the lesion characteristics; and performing morphological optimization on the screened candidate lesion regions to obtain disease and pest patches on the surface of the target crop.

[0042] In specific implementation, firstly, the color gamut difference vector and mutual information entropy of the candidate lesion regions are processed using the well-known Z-score standardization method. This involves calculating the mean and standard deviation of each component of the color gamut difference vector and the mean and standard deviation of the mutual information entropy for all candidate lesion regions. Then, for each candidate lesion region, the mean of the corresponding component is subtracted from each component of the color gamut difference vector, and the result is divided by the standard deviation. Similarly, the mean of the mutual information entropy is subtracted from the mean of the mutual information entropy, and the result is divided by the standard deviation. This yields the standardized color gamut difference feature and the standardized mutual information entropy. The standardized color gamut difference feature refers to the color gamut difference vector where all components are of the same order of magnitude after eliminating the influence of dimensions. The standardized mutual information entropy is the quantified value of the mutual information entropy within a uniform distribution range after eliminating the influence of dimensions. Secondly, based on the standardized color gamut difference feature and the standardized mutual information entropy, a lesion cross-identification index is constructed using a linear weighted fusion method. This involves setting preset weights (specifically, based on the contribution of the color gamut difference feature and mutual information entropy to lesion identification). (The parameters are set by the expert or based on their knowledge, without limitation here.) The modulus of the standardized color gamut difference features and the standardized mutual information entropy are weighted and summed to obtain the lesion cross-identification index. The lesion cross-identification index is used to measure the probability of lesions in the candidate lesion area. Then, the lesion cross-identification index of each candidate lesion area is compared with the cross-identification index threshold. The candidate lesion areas with a cross-identification index greater than the cross-identification index threshold are regarded as candidate lesion areas that meet the lesion characteristics. The specific cross-identification index threshold can be set according to actual needs or based on expert knowledge, without limitation here. Finally, the selected candidate lesion areas are optimized using a known morphological processing method. That is, the selected candidate lesion areas are eroded to remove small noise areas, and then the broken lesion areas are connected by an expansion operation, finally obtaining the disease and pest patches on the surface of the target crop.

[0043] It should be noted that, in this application, "pest and disease patches" refers to areas on the surface of the target crop that are infected by pests and diseases.

[0044] In another aspect, in some embodiments, this application provides a pest and disease image recognition system. Referring to FIG4, which is a schematic diagram of the structure of a pest and disease image recognition system according to some embodiments of this application, the pest and disease image recognition system includes: an acquisition module 201, a processing module 202, and an execution module 203, which are described as follows: The acquisition module 201 is mainly used to acquire images of pests and diseases containing suspected lesions on the surface of a target crop; the processing module 202 is mainly used to perform superpixel segmentation on the pest and disease image based on the texture complexity of the target crop, generating multiple superpixel units; the processing module 202 is also used to determine, for each superpixel unit, the relationship between the superpixel unit and its neighboring superpixel units. The color gamut difference of the superpixel unit under different color channels is used to generate a color gamut difference vector representing the local anomaly of the superpixel unit. Based on the color gamut difference vector corresponding to each superpixel unit, the candidate lesion region of the target crop is identified. In addition, the processing module 202 is also used to perform multi-color channel pixel gradient analysis on the candidate lesion region, and extract the gradient histogram features of the candidate lesion region under the red channel and the blue channel during the pixel gradient analysis process, and then determine the mutual information entropy of the gradient histogram between the red channel and the blue channel. The execution module 203 in this application is mainly used to perform cross-identification of the target crop lesion based on the color gamut difference vector and mutual information entropy corresponding to the candidate lesion region, so as to obtain the disease and pest patches on the surface of the target crop.

[0045] In addition, this application also provides a computer device, the computer device including a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the above-described method for identifying disease and pest images.

[0046] In some embodiments, referring to FIG5, which is a schematic diagram of the structure of a computer device for implementing a pest and disease image recognition method according to some embodiments of this application, the pest and disease image recognition method in the above embodiments can be implemented by the computer device shown in FIG5, which includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.

[0047] The processor 301 can be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of the pest and disease image recognition method in this application.

[0048] The communication bus 302 can be used to transmit information between the aforementioned components.

[0049] The memory 303 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CDROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

[0050] The memory 303 stores program code for executing the scheme of this application, and its execution is controlled by the processor 301. The processor 301 executes the program code stored in the memory 303. The program code may include one or more software modules. In the above embodiments, the determination of the pest and disease image recognition method can be implemented by the processor 301 and one or more software modules in the program code in the memory 303.

[0051] Communication interface 304 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0052] In a specific implementation, as one example, a computer device may include multiple processors, each of which may be a single-core (single CPU) processor or a multi-core (multi CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0053] The aforementioned computer device can be a general-purpose computer device or a special-purpose computer device. In specific implementations, the computer device can be a desktop computer, a portable computer, a network server, a handheld digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer device.

[0054] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for identifying images of pests and diseases.

[0055] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0056] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for identifying pest and disease images, characterized in that, The method includes the following steps: acquiring images of pests and diseases containing suspected lesions on the surface of a target crop; performing superpixel segmentation on the pest and disease images based on the texture complexity of the target crop to generate multiple superpixel units; for each superpixel unit, determining the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, thereby generating a color gamut difference vector characterizing the local anomaly of the superpixel unit, and identifying candidate lesion regions of the target crop based on the color gamut difference vectors corresponding to each superpixel unit; performing multi-color channel pixel gradient analysis on the candidate lesion regions, and extracting the gradient histogram features of the candidate lesion regions in the red and blue channels during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels; and performing cross-identification of target crop lesions based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions to obtain pest and disease patches on the surface of the target crop.

2. The method as described in claim 1, characterized in that, The process of performing superpixel segmentation on the pest and disease image based on the texture complexity of the target crop to generate multiple superpixel units specifically includes: determining the texture complexity of the target crop region in the pest and disease image; adjusting the number of cluster centers and spatial distance weights of the superpixel segmentation based on the texture complexity; and performing superpixel segmentation on the pest and disease image according to the adjusted number of cluster centers and spatial distance weights to obtain multiple superpixel units.

3. The method as described in claim 1, characterized in that, For each superpixel unit, determining the gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, and then generating a gamut difference vector representing the local anomaly of the superpixel unit, specifically includes: determining the set of neighboring superpixel units for each superpixel unit; converting the superpixel unit and its corresponding set of neighboring superpixel units to different color channels, and extracting the gamut features of the superpixel unit in each color channel; calculating the gamut difference between the gamut features of the superpixel unit and the gamut features of the neighboring superpixel units in the set of neighboring superpixel units in each color channel; and combining the gamut differences in each color channel in a preset order to generate a gamut difference vector representing the local anomaly of the superpixel unit.

4. The method as described in claim 1, characterized in that, The method of identifying candidate lesion regions of the target crop based on the color gamut difference vector corresponding to each superpixel unit specifically includes: calculating the local anomaly value of each superpixel unit based on the color gamut difference vector of each superpixel unit; determining the anomaly judgment threshold based on the local anomaly values ​​of all superpixel units; selecting superpixel units whose local anomaly values ​​exceed the anomaly judgment threshold from all superpixel units, and using the selected superpixel units as candidate lesion regions of the target crop.

5. The method as described in claim 1, characterized in that, The process of performing multi-color channel pixel gradient analysis on the candidate lesion region and extracting the gradient histogram features of the candidate lesion region in the red and blue channels during the pixel gradient analysis includes: separating the candidate lesion region into multiple color channels to obtain single-channel images of each color channel; calculating the pixel gradient of each single-channel image to obtain the gradient map of each color channel; selecting the red channel gradient map and the blue channel gradient map from the gradient maps of each color channel; and performing histogram statistics on the red channel gradient map and the blue channel gradient map respectively to extract the gradient histogram features of the red channel and the blue channel.

6. The method as described in claim 1, characterized in that, The specific steps for cross-identifying disease patches on the target crop surface based on the color gamut difference vector and mutual information entropy corresponding to the candidate lesion regions are as follows: Standardizing the color gamut difference vector and mutual information entropy of the candidate lesion regions to obtain standardized color gamut difference features and standardized mutual information entropy; constructing a lesion cross-identification index based on the standardized color gamut difference features and standardized mutual information entropy; screening candidate lesion regions according to the lesion cross-identification index and retaining those that meet the lesion characteristics; and performing morphological optimization on the screened candidate lesion regions to obtain disease patches on the target crop surface.

7. The method as described in claim 1, characterized in that, Images of pests and diseases, including suspected lesions, are obtained from the surface of target crops using industrial cameras.

8. A pest and disease image recognition system, characterized in that, The system includes: an acquisition module for acquiring images of pests and diseases containing suspected lesions on the surface of a target crop; a processing module for performing superpixel segmentation on the pest and disease images based on the texture complexity of the target crop, generating multiple superpixel units; the processing module is further configured to, for each superpixel unit, determine the color gamut difference between the superpixel unit and its neighboring superpixel units in different color channels, thereby generating a color gamut difference vector characterizing the local anomaly of the superpixel unit, and identifying candidate lesion regions of the target crop based on the color gamut difference vectors corresponding to each superpixel unit; the processing module is further configured to perform multi-color channel pixel gradient analysis on the candidate lesion regions, and extract the gradient histogram features of the candidate lesion regions in the red and blue channels during the pixel gradient analysis process, thereby determining the mutual information entropy of the gradient histograms between the red and blue channels; and an execution module for performing cross-identification of target crop lesions based on the color gamut difference vectors and mutual information entropies corresponding to the candidate lesion regions, to obtain pest and disease patches on the surface of the target crop.

9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the pest and disease image recognition method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the pest and disease image recognition method as described in any one of claims 1 to 7.