A smart detection method and system for agricultural crop pests and diseases
By calculating the proximity rate and grayscale gradient similarity of pest centers of pixel points in agricultural crop areas, and combining the degree of infection impact, correcting the problem of missed detection and missed detection in the existing technology is solved, and the segmentation of pest and disease areas is improved Accuracy and analytical value of detection results.
Patent Information
- Application Number
- CN202411244166.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the prior art, in the detection of pests and diseases of agricultural crops, the images of normal crops and infected crops are small, resulting in frequent mis-checking and missed detection of threshold detection methods, and failure to predict the risk of infection, affecting the prevention and control effects.
A smart detection method for pests and diseases in agricultural crops is adopted to calculate the proximity rate of pest centers, similarity weight parameters and infection impact degree by obtaining the pixel points in agricultural crop areas, and combining the grayscale gradient similarity, the probability of pests and diseases and transmission are calculated. The ratio is to use weighted correction of the significant value of the G channel to divide the pest and diseases.
It improves the accuracy of pest and disease area segmentation, avoids misjudgment of uninfected but high-risk pixel points, enhances the analytical value of detection results, and improves the efficiency of pest and disease prevention and control of agricultural crops.
Smart Images

Figure CN118762189B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image segmentation technology, and specifically to an intelligent detection method and system for agricultural crop pests and diseases. Background Art
[0002] Agricultural crop diseases and pests can lead to large-scale crop yield reduction and loss. Traditional pest monitoring and control methods usually require a lot of manpower and time, are inefficient and easily interfered by subjective factors. Existing technologies for detecting surface pests of agricultural crops based on image processing are gradually becoming popular. However, in the actual process of collecting agricultural crop images and detecting pests and diseases, due to the small difference between some normal agricultural crop images and agricultural crop images infected with diseases and pests, the existing threshold detection method cannot set a suitable threshold for the pest and disease area, which is prone to false detection and missed detection of pests and diseases. In addition, the existing threshold detection results do not take into account the propagation characteristics of the infected pest and disease area, so the infection risk cannot be predicted, making the detection results not have a high analytical value, which is not conducive to the subsequent prevention and control of agricultural crop diseases and pests. Summary of the invention
[0003] The present application provides an intelligent detection method and system for agricultural crop pests and diseases to solve the problem that there is little difference between some normal agricultural crops and agricultural crops infected with pests and diseases, resulting in large errors in the segmentation of pest and disease areas, and the identification results cannot predict the infection risk.
[0004] The present invention discloses a method and system for intelligently detecting agricultural crop pests and diseases using the following technical solutions:
[0005] In a first aspect, an embodiment of the present application provides a method for intelligent detection of agricultural crop pests and diseases, the method comprising the following steps:
[0006] Acquire the agricultural crop area in the collected image, and acquire the grayscale values of all pixels in the agricultural crop area;
[0007] Take any pixel in the agricultural crop area as the target pixel, and obtain the pest center approach rate of the target pixel according to the information entropy of the grayscale value within the target pixel area and the maximum information entropy of all neighboring pixels corresponding to the target pixel within the neighborhood of the neighboring pixel. Obtain the similarity weight parameter of each neighboring pixel according to the Euclidean distance between the neighboring pixel and the target pixel. Then, obtain the pest probability of the target pixel according to the pest center approach rate of the target pixel, the similarity weight parameter of each neighboring pixel, and the grayscale gradient cosine similarity between each neighboring pixel and the target pixel.
[0008] All pixels except the target pixel in the agricultural crop area are regarded as suspicious pixels. The pest transmission rate of the suspicious pixel to the target pixel is obtained according to the gray value and pest probability of the target pixel and the suspicious pixel. The infection impact degree of the target pixel is obtained according to the pest transmission rate and Euclidean distance of all suspicious pixels to the target pixel.
[0009] The G channel significance value of the target pixel point is weighted by using the pest probability and the degree of infection impact of the target pixel point to obtain the pest significance value of the target pixel point; and the pest area is segmented based on the pest significance value using a segmentation algorithm.
[0010] Preferably, the step of obtaining the grayscale values of all pixels in the agricultural crop area includes the following specific steps:
[0011] The RGB image of the agricultural crop area is converted into a G channel image, and the pixel value of the pixel in the G channel is called the gray value.
[0012] Preferably, the step of obtaining the pest center approach rate of the target pixel point includes the following specific steps:
[0013] All pixels within a circular range with a radius of R and a target pixel as the center are regarded as neighborhood pixels of the target pixel, where R is a preset value;
[0014]
[0015] Among them, i represents the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, v represents the v-th type of neighboring pixel, Represents the gray value of the vth class of neighborhood pixels, Represents the number of categories of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the probability value of the vth type of neighborhood pixel within the neighborhood of the target pixel, represents the logarithmic function with a natural constant as base, It means that when all the neighboring pixels of the i-th target pixel have the same number of categories in the neighborhood The maximum information entropy when Represents the logarithmic function with a natural constant as base.
[0016] Preferably, the obtaining of the similarity weight parameter of each neighborhood pixel point according to the Euclidean distance between the neighborhood pixel point and the target pixel point comprises the following specific steps:
[0017]
[0018] Among them, r represents the rth neighboring pixel within the neighborhood of the i-th target pixel, Represents the similarity weight parameter of the rth neighboring pixel of the i-th target pixel, Represents the Euclidean distance between the i-th target pixel and the r-th neighboring pixel.
[0019] Preferably, the method of obtaining the pest probability of the target pixel point according to the pest center approaching rate of the target pixel point, the similarity weight parameter of each neighborhood pixel point, and the gray gradient cosine similarity between each neighborhood pixel point and the target pixel point comprises the following specific steps:
[0020]
[0021] in, represents the probability of pests and diseases at the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, H represents the number of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the ratio of the similarity weight parameter of the rth neighboring pixel of the i-th target pixel to the sum of the similarity weight parameters of the H neighboring pixels. Represents the grayscale gradient of the i-th target pixel, Represents the grayscale gradient of the rth neighborhood pixel; Represents the cosine similarity between the grayscale gradient of the i-th target pixel and the grayscale gradient of the r-th neighboring pixel.
[0022] Preferably, the step of obtaining the pest transmission rate of the suspicious pixel to the target pixel according to the grayscale values of the target pixel and the suspicious pixel and the pest probability comprises the following specific steps:
[0023]
[0024] in, Representative target pixels, Representative Suspicious pixels. Representative The gray value of the target pixel, Representative Gray value of suspicious pixels, Representative The probability of pests and diseases at each target pixel, Representative The probability of pests and diseases at suspicious pixels, Represents the minimum gray value in the agricultural crop area, Represents the maximum gray value within the agricultural crop area, Represents the minimum probability of pests and diseases among all suspicious pixels, Represents the maximum probability of pests and diseases among all suspicious pixels, Representative The suspicious pixel is The pest and disease transmission rate of each target pixel.
[0025] Preferably, the step of obtaining the infection influence degree of the target pixel point according to the pest transmission rate and the Euclidean distance of all suspicious pixels to the target pixel point includes the following specific steps:
[0026]
[0027] in, represents the infection impact degree of the i-th target pixel, and P represents the infection impact degree of the i-th target pixel. The number of all suspicious pixels other than the target pixels, Representative The suspicious pixel is The Euclidean distance of the target pixel, Representative The infection weight parameter of the suspicious pixel for the i-th target pixel, represents the sum of the infection weight parameters of P suspicious pixels for the i-th target pixel, Representative The suspicious pixel is The pest transmission rate of target pixels, Represents the hyperbolic tangent function.
[0028] Preferably, the method of weighting the G channel significance value of the target pixel point by using the probability of the pest and disease and the degree of infection impact of the target pixel point to obtain the significance value of the pest and disease of the target pixel point includes the following specific steps:
[0029] Count the grayscale values of all target pixels in the agricultural crop area, and take each unequal grayscale value as a grayscale level, and count the probability of each grayscale level appearing;
[0030] Calculate the absolute value of the difference between the gray value of each target pixel and the gray value corresponding to each gray level, and take the product of the absolute value and the probability of occurrence of each gray level as the G channel significance value of each target pixel;
[0031] The sum of the probability of pests and diseases, the degree of infection and the preset constant of each target pixel is taken as the correction weight, and the product of the correction weight and the G channel significance value of each target pixel is taken as the pest and disease significance value of each target pixel.
[0032] Preferably, the segmentation algorithm is used to segment the pest area based on the pest significance value, and the specific steps include the following:
[0033] A single-channel image to be segmented is constructed by replacing the gray value of each target pixel with the pest and disease saliency value of each target pixel in the agricultural crop area;
[0034] The image to be segmented is used as input, and the segmentation threshold of all the pest and disease significance values is obtained using the Otsu threshold segmentation algorithm, and the connected domain formed by all target pixel points whose pest and disease significance values are greater than the segmentation threshold is used as the pest and disease area in the agricultural crop area.
[0035] In a second aspect, an embodiment of the present application also provides an intelligent detection system for agricultural crop diseases and pests, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned intelligent detection methods for agricultural crop diseases and pests are implemented.
[0036] The beneficial effects of the technical solution of this application are:
[0037] By analyzing the pest center approaching rate of target pixels in the agricultural crop area and the gradient similarity of neighboring pixels, the pest probability of the target pixel is obtained, and then the infection impact degree of the target pixel is obtained according to the pest probability and grayscale value of the target pixel and the suspicious pixel. The G channel significance value of each target pixel is weightedly corrected using the pest probability and infection impact degree of the target pixel, and the state difference of the target pixel quality inspection is increased from both the overall agricultural crop area and the pixel point, avoiding the merging of pixels that are not infected with pests but have a greater risk of infection into the pest area. The corrected pest significance value avoids the problem that the pest area is difficult to distinguish due to the small difference between the disease index of agricultural crops infected with pests and normal agricultural crops, thereby improving the accuracy of pest area segmentation in agricultural crop areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a method for intelligently detecting agricultural crop pests and diseases provided in accordance with an embodiment of the present application;
[0040] Figure 2A flowchart for obtaining a significant value of pests and diseases provided in one embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to further explain the technical means and effects adopted by this application to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of an intelligent detection method and system for agricultural crop pests and diseases proposed in this application, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0043] The specific scheme of the intelligent detection method and system for agricultural crop diseases and insect pests provided by the present application is described in detail below with reference to the accompanying drawings.
[0044] See also Figure 1 , which shows a flowchart of a method for intelligent detection of agricultural crop pests and diseases provided by an embodiment of the present application, the method comprising the following steps:
[0045] Step S001, obtaining the agricultural crop area in the captured image, and obtaining the grayscale values of all pixels in the agricultural crop area in the G channel.
[0046] In the present application, the agricultural crops for disease and insect pest detection are green agricultural crops. Images of the agricultural crops in the detection area are collected, and the collected images are RGB images. Gaussian filtering is used to denoise the collected images, and then the trained semantic segmentation network is used to segment the agricultural crop areas in the collected images. Among them, Gaussian filtering and semantic segmentation of agricultural crop areas are well-known technologies in the field and will not be elaborated in detail.
[0047] Since most agricultural crops are green, the RGB image of agricultural crops is converted into a G channel image. The pixel value of a pixel in the G channel is called a gray value. In the G channel image, the gray value of a normal pixel is larger, while the gray value of a pixel infected with pests and diseases is smaller. The longer the infection time, the smaller the gray value of the pixel. Converting a three-channel image into a single-channel image is a well-known technology, and the specific process will not be repeated here.
[0048] Step S002: according to the grayscale values of all neighboring pixels within the neighborhood of the target pixel, the pest center approach rate of the target pixel is obtained; according to the Euclidean distance between the neighboring pixel and the target pixel, the similarity weight parameter of the neighboring pixel is obtained; and then based on the pest center approach rate and the similarity weight parameter, the pest probability of the target pixel is obtained.
[0049] When agricultural crop pests and diseases spread, they will spread radially outward from any infected agricultural crop as the center, and the infected agricultural crops that are spread also have this feature. Due to the radial propagation characteristics, the infection time and propagation speed of agricultural crop pests and diseases that are close in position are almost synchronized. If there is an agricultural crop area infected with pests and diseases, it will show a change pattern of spreading outward from a certain pest and disease center pixel point in the G channel image, and the grayscale value will change from small to large as the diffusion radius increases. Therefore, in the diffusion area of pests and diseases, pixels with similar positions have almost the same grayscale gradient, which includes the size and direction of the gradient value; while pixels in the healthy area do not have a fixed change pattern, so the grayscale gradient between them and the surrounding pixels is not the same or even has a large difference;
[0050] The possibility of the presence of pests and diseases at the pixel point is determined based on this feature, specifically:
[0051] The Soble operator is used to obtain the grayscale gradient of each pixel in the agricultural crop area. Since the grayscale gradient is a vector value, it includes direction and gradient magnitude;
[0052] Take any pixel as the target pixel, and all the pixels within the circular range with the target pixel as the center and the radius R as the neighborhood pixels of the target pixel, and take the neighborhood pixels with the same gray value as the target pixel as the same type of pixels, and take each unequal gray value corresponding to the neighborhood pixels with different gray values from the target pixel as a gray level, and the neighborhood pixels under each gray level as a type of neighborhood pixels of the target pixel. The circular range is called the neighborhood range. In this embodiment, R=100 is preset;
[0053] It should be noted that, in other embodiments, the implementer may set a suitable radius according to the size of the captured image, and this application does not impose any special restrictions on this.
[0054] The pest center approach rate of the target pixel is calculated based on the grayscale values of all neighboring pixels within the target pixel neighborhood:
[0055]
[0056] Among them, i represents the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, v represents the v-th type of neighboring pixel, Represents the gray value of the vth class of neighborhood pixels, Represents the number of categories of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the probability value of the vth type of neighborhood pixel within the neighborhood of the target pixel, represents the logarithmic function with a natural constant as base, It means that when all the neighboring pixels of the i-th target pixel have the same number of categories in the neighborhood The maximum information entropy when
[0057] The information entropy of the grayscale values of all neighboring pixels in the neighborhood of the i-th target pixel is divided by the maximum information entropy to obtain the pest center approach rate of the i-th target pixel. ; It should be noted that, since the pest and disease area has the characteristic of spreading outward from the center, and the infection time and propagation speed of agricultural crops at adjacent positions are almost the same, and the larger the ratio of information entropy to maximum information entropy, the more equal the number of neighboring pixels representing different types of gray values within the circular neighborhood of the i-th target pixel point, the greater the probability that this pixel structure will present a diffusion phenomenon centered on the i-th target pixel point in the agricultural crop area. Then, only when the i-th target pixel point is the center of the pest and disease area, the pixel structure in its neighborhood range will have the maximum probability of presenting this diffusion characteristic, and the further away from the center of the pest and disease area, the weaker this diffusion characteristic is. Therefore, the ratio of information entropy to maximum information entropy can be used to judge whether the target pixel point is close to the center of the pest and disease area;
[0058] Furthermore, according to the distance between the target pixel and the neighboring pixel, the similarity weight parameter of each neighboring pixel is obtained, which is:
[0059]
[0060] Among them, r represents the rth neighboring pixel within the neighborhood of the i-th target pixel, Represents the similarity weight parameter of the rth neighboring pixel of the i-th target pixel, represents the Euclidean distance between the i-th target pixel and the r-th neighboring pixel, represents a natural constant;
[0061] It should be noted that It represents the use of exponential function to perform inverse proportional mapping of the Euclidean distance between the i-th target pixel and the r-th neighboring pixel. When calculating the pest probability of the i-th target pixel, it is determined based on the grayscale gradient similarity between the i-th target pixel and all neighboring pixels within the neighborhood. Therefore, the closer the neighboring pixel is to the target pixel, the higher the similarity weight should be given. Conversely, the farther the neighboring pixel is from the target pixel, the lower the similarity weight should be.
[0062] According to the pest center approaching rate of the target pixel and the similarity weight parameter of each neighboring pixel, the grayscale gradient cosine similarity of the i-th target pixel and all neighboring pixels is weighted and summed to obtain the pest probability of the i-th target pixel, which is:
[0063]
[0064] in, represents the probability of pests and diseases at the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, H represents the number of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the ratio of the similarity weight parameter of the rth neighboring pixel of the i-th target pixel to the sum of the similarity weight parameters of the H neighboring pixels. Represents the grayscale gradient of the i-th target pixel, Represents the grayscale gradient of the rth neighborhood pixel; Represents the cosine similarity between the grayscale gradient of the i-th target pixel and the grayscale gradient of the r-th neighboring pixel;
[0065] Represents the ratio of the similarity weight parameter of the rth neighboring pixel to the sum of the similarity weight parameters of all neighboring pixels of the i-th target pixel. Perform sum normalization and normalize the result is the similarity weight of the rth neighborhood pixel; and then the similarity weights of all neighborhood pixels can be obtained, The cosine similarity between the grayscale gradient of the i-th target pixel and the grayscale gradient of the r-th neighboring pixel is limited to the range between 0 and 1. It means multiplying the similarity weight of the r-th neighboring pixel by the cosine similarity of the gray gradient between the target pixel and the r-th neighboring pixel, and then accumulating the product of the similarity weights of all neighboring pixels and their respective cosine similarities to obtain the weighted summed cosine similarity of all neighboring pixels, and multiplying the cosine similarity by the pest center approach rate of the i-th target pixel to obtain the pest probability of the i-th target pixel;
[0066] The higher the approach rate of the pest center of the i-th target pixel point, and the higher the cosine similarity with the neighboring pixels with similar positions in the neighborhood, the greater the probability of pests and diseases at the i-th target pixel point.
[0067] Step S003: According to the grayscale values of the target pixel and the suspicious pixel and the probability of pests and diseases, the pest transmission rate of the suspicious pixel to the target pixel is obtained, and the infection impact degree of the target pixel is obtained according to the pest transmission rate of all suspicious pixels to the target pixel and the Euclidean distance.
[0068] For healthy agricultural crops, the closer they are to diseased and insect-infested agricultural crops, the greater the possibility of infection with diseases and insect pests. The smaller the grayscale value of the pixels in the infected area, the longer the infection time. The smaller the grayscale value of the pixels, the greater the impact on other pixels. The detection of the health status of agricultural crops should not only be based on the current infection status of agricultural crops, but also on the prediction of the spread trend of pests and diseases. That is to say, even if the probability of a pixel being infected with a disease or insect pest is low, if it is in a position that is about to be infected, it also has a greater risk of disease and insect pests. This situation should also be taken into account when conducting intelligent detection of the status of agricultural crops.
[0069] Get the pest transmission rate of suspicious pixels to target pixels:
[0070] All pixels in the agricultural crop area in the collected image are regarded as suspicious pixels;
[0071] Further:
[0072]
[0073] in, Representative target pixels, Representative Suspicious pixels. Representative The gray value of the target pixel, Representative Gray value of suspicious pixels, Representative The probability of pests and diseases at each target pixel, Representative The probability of pests and diseases at suspicious pixels, Represents the minimum gray value in the agricultural crop area, Represents the maximum gray value within the agricultural crop area, Represents the minimum probability of pests and diseases among all suspicious pixels, Represents the maximum probability of pests and diseases among all suspicious pixels, Representative The suspicious pixel is The pest transmission rate of each target pixel;
[0074] Representative The gray value of the target pixel is The ratio of the gray values of suspicious pixels, The larger the gray value of the target pixel, the healthier the target pixel. The lower the gray value of a suspicious pixel, the worse the health status of the suspicious pixel. When it is greater than 1, it means The health status of the suspicious pixel is quite different from that of the target pixel. The transmission rate of pests and diseases from suspicious pixels to target pixels is higher; Representative The probability of pests and diseases at the suspicious pixel is The ratio of the probability of pests and diseases of target pixels. When the ratio is greater than 1 and the larger it is, the higher the probability of pests and diseases of target pixels. The transmission rate of pests and diseases from suspicious pixels to target pixels is higher;
[0075] So, in summary, when The closer the product of is to 1, the The lower the pest transmission rate of the suspicious pixel to the target pixel, the logarithmic function is used to adjust the result of the product, that is, when the product is 1, The value is 0, which can be As the The suspicious pixel is The propagation rate of target pixels, and due to There are negative values, represents the minimum propagation rate available for all pixels in the agricultural crop area. The suspicious pixel is The value of the pest and disease transmission rate can be adjusted to be greater than or equal to 0 by subtracting the minimum transmission rate from the transmission rate of the target pixel point.
[0076] Furthermore, according to the pest transmission rate of all suspicious pixels to the target pixel, the degree of infection influence of each pixel by other suspicious pixels is calculated, specifically:
[0077]
[0078] in, represents the infection impact degree of the i-th target pixel, and P represents the infection impact degree of the i-th target pixel. The number of all suspicious pixels other than the target pixels, Representative The suspicious pixel is The Euclidean distance of the target pixel, Representative The infection weight parameter of the suspicious pixel for the i-th target pixel, represents the sum of the infection weight parameters of P suspicious pixels for the i-th target pixel, Representative The suspicious pixel is The pest transmission rate of target pixels, represents the hyperbolic tangent function;
[0079] Representatives The infection weight parameters of suspicious pixels are summed and normalized as the first The infection weight of suspicious pixels, Represents the number of suspicious pixels. The pest and disease transmission rates of target pixels are weighted summed, and then the weighted summation results are normalized in direct proportion using the hyperbolic tangent function to obtain the The degree of infection impact of each target pixel;
[0080] It should be noted that the higher the infection impact of the target pixel, the more likely it is to be infected by nearby pest and disease pixels.
[0081] Step S004: using the pest and disease probability and infection impact degree of the target pixel point, a significance analysis is performed on the pixel points in the agricultural crop area, and based on the analysis result, the pest and disease area in the agricultural crop area is segmented.
[0082] According to the above process, the probability of pests and diseases and the degree of infection impact of each target pixel in the agricultural crop area are obtained respectively. For agricultural crops in a healthy state, in the corresponding area of the collected image, the probability of pests and diseases and the degree of infection impact of the pixel points will be low, and the grayscale value of the pixel points will be relatively large; for agricultural crops in a pest and disease state, in the corresponding area of the collected image, the probability of pests and diseases of the pixel points will be relatively large, and affected by its neighboring pixels, the degree of infection impact of the pixel points will also be relatively large, and the grayscale value of the pixel points will be relatively small. Therefore, in order to more accurately segment the pest and disease area from the collected image. In this embodiment, the pest and disease probability and the degree of infection impact are used to determine the pest and disease significance value of each target pixel point, further increasing the difference in quality inspection of corresponding pixels of agricultural crops in different health states in the agricultural crop area. The process for obtaining the pest and disease significance value is as follows. Figure 2 shown.
[0083] Specifically, the grayscale values of all target pixels in the agricultural crop area are counted, and each unequal grayscale value is regarded as a grayscale level, and the probability of each grayscale level is counted. The pest and disease significance value of each target pixel is determined by combining the probability of occurrence of the grayscale level to which each target pixel belongs, the probability of pests and diseases, and the degree of infection impact, specifically:
[0084]
[0085]
[0086] in, represents the G channel saliency value of the i-th target pixel, m represents the number of gray levels in the agricultural crop area, d represents the d-th gray level, represents the probability of the d-th gray level appearing, Represents the grayscale value corresponding to the dth grayscale level, Represents the gray value of the i-th target pixel;
[0087] represents the pest and disease significance value of the i-th target pixel, , They represent the probability of pests and diseases and the degree of infection impact of the i-th target pixel respectively.
[0088] Represents the significance of the i-th target pixel from the perspective of the entire agricultural crop area. The higher the significance of the i-th target pixel, The larger the value of Represents the evaluation of the significance of the i-th target pixel from the perspective of all gray levels; represents the significance of the status of the i-th target pixel compared with the status of the other target pixels from the perspective of the i-th target pixel and the infection of the i-th target pixel by the other suspicious pixels, while Can prevent When the value of is less than 1, the significance of pests and diseases at the i-th target pixel is reduced.
[0089] It should be noted that the larger the pest and disease significance value of the target pixel point is, the more likely the target pixel point is a pixel point in the agricultural crop area that is in a pest and disease state.
[0090] Further, based on the above process, the pest and disease significance value of each target pixel is determined in turn. The single-channel image to be segmented is constructed by replacing the gray value of each target pixel with the pest and disease significance value in the agricultural crop area as input, and the segmentation threshold of all the pest and disease significance values is obtained by using the Otsu threshold segmentation algorithm, and the connected domain formed by all target pixels with pest and disease significance values greater than the segmentation threshold is used as the pest and disease area in the agricultural crop area. The Otsu threshold segmentation algorithm is a well-known technology, and the specific process is not repeated here.
[0091] On the other hand, based on the same inventive concept as the above method, an embodiment of the present invention also provides an intelligent detection system for agricultural crop diseases and pests, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, it implements the steps of any one of the above-mentioned intelligent detection methods for agricultural crop diseases and pests.
[0092] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0093] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A smart detection method for agricultural crop pests and diseases, It is characterized in that The method comprises the following steps: Acquire the agricultural crop area in the collected image, and acquire the grayscale values of all pixels in the agricultural crop area; Take any pixel point in the agricultural crop area as the target pixel point, take the target pixel point as the center of the circle, and obtain the range of the preset value as the radius as the neighborhood range of the target pixel point. According to the information entropy of the grayscale value in the neighborhood range of the target pixel point, the maximum information entropy of all the neighborhood pixels corresponding to the target pixel point in the neighborhood range of the neighborhood pixel point is used to obtain the pest and disease center approaching rate of the target pixel point. According to the Euclidean distance between the neighborhood pixel point and the target pixel point, the similarity weight parameter of each neighborhood pixel point is obtained. Then, according to the pest and disease center approaching rate of the target pixel point, the similarity weight parameter of each neighborhood pixel point and the grayscale gradient cosine similarity between each neighborhood pixel point and the target pixel point, the pest and disease probability of the target pixel point is obtained. All pixels except the target pixel in the agricultural crop area are regarded as suspicious pixels. The pest transmission rate of the suspicious pixel to the target pixel is obtained according to the gray value and pest probability of the target pixel and the suspicious pixel. The infection impact degree of the target pixel is obtained according to the pest transmission rate and Euclidean distance of all suspicious pixels to the target pixel. Calculate the absolute value of the difference between the gray value of each target pixel and the gray value corresponding to each gray level, accumulate the product of each absolute value of the difference and the probability of each gray level appearing on all gray levels to obtain the G channel significance value of the target pixel, weight the G channel significance value of the target pixel by the probability of the pest and disease at the target pixel and the degree of infection impact, and obtain the pest and disease significance value of the target pixel; segment the pest and disease area based on the pest and disease significance value using a segmentation algorithm; The specific steps of obtaining the pest center approach rate of the target pixel point are as follows: All pixels within a circular range with a radius of R and a target pixel as the center are regarded as neighborhood pixels of the target pixel, where R is a preset value; Among them, i represents the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, v represents the v-th type of neighboring pixel, Represents the gray value of the vth class of neighborhood pixels, Represents the number of categories of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the probability value of the vth type of neighborhood pixel within the neighborhood of the target pixel, represents the logarithmic function with a natural constant as base, It means that when all the neighboring pixels of the i-th target pixel have the same number of categories in the neighborhood The maximum information entropy when Represents the logarithmic function with a natural constant as base.
2. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The specific steps of obtaining the grayscale values of all pixels in the agricultural crop area are as follows: The RGB image of the agricultural crop area is converted into a G channel image, and the pixel value of the pixel in the G channel is called the gray value.
3. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The specific steps of obtaining the similarity weight parameter of each neighborhood pixel point according to the Euclidean distance between the neighborhood pixel point and the target pixel point are as follows: Among them, r represents the rth neighboring pixel within the neighborhood of the i-th target pixel, Represents the similarity weight parameter of the rth neighboring pixel of the i-th target pixel, Represents the Euclidean distance between the i-th target pixel and the r-th neighboring pixel.
4. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The specific steps of obtaining the pest probability of the target pixel point according to the pest center approaching rate of the target pixel point, the similarity weight parameter of each neighborhood pixel point, and the gray gradient cosine similarity between each neighborhood pixel point and the target pixel point include the following: in, represents the probability of pests and diseases at the i-th target pixel, represents the pest center approaching rate of the i-th target pixel, H represents the number of all neighboring pixels within the neighborhood of the i-th target pixel, Represents the ratio of the similarity weight parameter of the rth neighboring pixel of the i-th target pixel to the sum of the similarity weight parameters of the H neighboring pixels. Represents the grayscale gradient of the i-th target pixel, Represents the grayscale gradient of the rth neighborhood pixel; Represents the cosine similarity between the grayscale gradient of the i-th target pixel and the grayscale gradient of the r-th neighboring pixel.
5. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The method of obtaining the pest transmission rate of the suspicious pixel to the target pixel according to the grayscale values of the target pixel and the suspicious pixel and the pest probability includes the following specific steps: in, Representative target pixels, Representative Suspicious pixels. Representative The gray value of the target pixel, Representative Gray value of suspicious pixels, Representative The probability of pests and diseases at each target pixel, Representative The probability of pests and diseases at suspicious pixels, Represents the minimum gray value in the agricultural crop area, Represents the maximum gray value within the agricultural crop area, Represents the minimum probability of pests and diseases among all suspicious pixels, Represents the maximum probability of pests and diseases among all suspicious pixels, Representative The suspicious pixel is The pest and disease transmission rate of each target pixel.
6. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The specific steps of obtaining the infection influence degree of the target pixel point according to the pest transmission rate and Euclidean distance of all suspicious pixels to the target pixel point include the following: in, represents the infection impact degree of the i-th target pixel, and P represents the infection impact degree of the i-th target pixel. The number of all suspicious pixels other than the target pixels, Representative The suspicious pixel is The Euclidean distance of the target pixel, Representative The infection weight parameter of the suspicious pixel for the i-th target pixel, represents the sum of the infection weight parameters of P suspicious pixels for the i-th target pixel, Representative The suspicious pixel is The pest transmission rate of target pixels, Represents the hyperbolic tangent function.
7. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The specific steps of weighting the G channel significance value of the target pixel point by using the pest probability and the infection impact degree of the target pixel point to obtain the pest significance value of the target pixel point are as follows: Count the grayscale values of all target pixels in the agricultural crop area, and take each unequal grayscale value as a grayscale level, and count the probability of each grayscale level appearing; Calculate the absolute value of the difference between the gray value of each target pixel and the gray value corresponding to each gray level, and take the product of the absolute value and the probability of occurrence of each gray level as the G channel significance value of each target pixel; The sum of the probability of pests and diseases, the degree of infection and the preset constant of each target pixel is taken as the correction weight, and the product of the correction weight and the G channel significance value of each target pixel is taken as the pest and disease significance value of each target pixel.
8. According to claim 1, a smart detection method for agricultural crop pests and diseases, It is characterized in that The segmentation algorithm is used to segment the pest area based on the pest significance value, and the specific steps include the following: A single-channel image to be segmented is constructed by replacing the gray value of each target pixel with the pest and disease saliency value of each target pixel in the agricultural crop area; The image to be segmented is used as input, and the segmentation threshold of all the pest and disease significance values is obtained using the Otsu threshold segmentation algorithm, and the connected domain formed by all target pixel points whose pest and disease significance values are greater than the segmentation threshold is used as the pest and disease area in the agricultural crop area.
9. An intelligent detection system for agricultural crop pests and diseases, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. It is characterized in that When the processor executes the computer program, the steps of the intelligent detection method for agricultural crop pests and diseases as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Efficient targeting spraying regulation and control method and system for plant protection unmanned aerial vehicle
CN116171962A
Crystal impurity detection method for boehmite production
CN116385446A
Artificial intelligence-based acrylic emulsion color change identification method
CN116758528A
Rapid detection method for garden plant disease and insect pest area
CN117974989A
Image area detection method and device
WO2016127883A1
