Method and system for detecting plant diseases and insect pests based on modal joint learning
Through the modal joint learning method, the structure, texture and color features are combined to detect plant diseases and insect pests, which solves the problems of illumination, background difference and small sample size in the existing technology, improves the detection accuracy and speed, and prevents over-fitting.
Patent Information
- Application Number
- CN202410792387.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-03
AI Technical Summary
Existing methods for detecting plant diseases and insect pests based on machine vision and deep learning are greatly affected by lighting conditions and background interference in natural environments. The difference between the lesion area and the background is small and the contrast is low, which can easily lead to false detections and false alarms. The small sample size can lead to excessive detection. Fitting makes it difficult to effectively detect plant diseases and insect pests.
A method based on modal joint learning is used to extract structural features through random cropping, convert to grayscale images to extract texture features, and use hue, saturation, brightness and plant type to determine color features, and combine structure, texture and color features for detection. Reduce the impact of illumination, background differences and small sample size on detection results.
It significantly improves the speed and accuracy of plant pest and disease detection, avoids the impact of factors such as illumination, background differences, and small sample size on detection results, prevents over-fitting, and improves detection accuracy.
Smart Images

Figure CN118587599A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of plant disease and pest detection, and in particular, to a plant disease and pest detection method and system based on modality joint learning. Background Art
[0002] Plant pests and diseases are important factors that determine plant yield and quality. The detection of plant pests and diseases can usually be performed through digital image processing. In recent years, deep learning has made breakthroughs in the field of digital image processing technology, far superior to traditional methods. How to use deep learning technology to study plant pest and disease detection has become one of the most concerned research topics for researchers.
[0003] At present, plant pest and disease detection equipment based on machine vision has been initially applied in agriculture and has replaced traditional naked eye recognition technology to a certain extent. Since the image characteristics and imaging scenes of plant pests and diseases are different from those of ordinary images, the current plant pest and disease detection methods based on machine vision and deep learning have many defects. For example: (1) In the actual natural environment, affected by factors such as lighting conditions and background interference, it is difficult for deep learning-based plant pest and disease detection to completely eliminate the impact of scene changes on the recognition results; (2) The difference between the plant diseased area and the background is small and the contrast is low, so deep learning-based plant pest and disease detection has a high rate of false detection and false alarm; (3) Since it is difficult to collect plant pest and disease sample images and the sample size is small, it is easy to cause the deep learning-based plant pest and disease detection system to be overfitted and difficult to play its full role. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a plant disease and pest detection method and system based on modal joint learning, which can combine the structural features, texture features and color features of the image to detect plant diseases and pests, effectively suppressing the influence of factors such as lighting conditions, small difference between the lesion area and the background, low contrast, and small sample size on the detection results, thereby greatly improving the speed and accuracy of plant disease and pest detection.
[0005] In the first aspect, an embodiment of the present application proposes a plant disease and pest detection method based on modal joint learning, the method comprising the following steps: obtaining a plant image to be detected; randomly cropping the plant image to be detected to obtain a number of cropped images, and determining the structural features of the plant image to be detected based on the cropped images; converting the plant image to be detected into a grayscale image, determining the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determining the texture features of the plant image to be detected based on the texture value of each pixel; determining the color features of the plant image to be detected based on the hue, saturation, brightness and plant type of the plant image to be detected; determining the detection result of the plant image to be detected based on the structural features, the texture features and the color features; wherein the detection result includes whether the plant is affected by diseases and pests and the type of diseases and pests.
[0006] In the above manner, based on the plant image to be detected, the structural features, texture features and color features of the plant image to be detected are extracted respectively, and the structural features, texture features and color features of the plant image to be detected are combined for plant disease and insect pest detection, which can effectively avoid the influence of factors such as lighting conditions, small difference between the lesion area and the background, low contrast, and small sample size on the plant disease and insect pest detection results. When extracting structural features, the amount of data is increased by randomly cropping the plant image to be detected, so that more accurate structural features can be determined, which can prevent overfitting when detecting plant diseases and insect pests. When extracting texture features, the plant image to be detected is first converted into a grayscale image to remove information that is not related to the texture but may affect the extraction of texture features, and then texture features are extracted for each pixel point, and finally the texture features of the entire plant image to be detected are obtained. The entire extraction process is not affected by the intensity of light, and can effectively avoid the influence of factors such as lighting conditions on the plant disease and insect pest detection results. When extracting color features, full use is made of three types of information: hue, saturation and brightness. The extraction process is dynamically adjusted based on the plant type, which can effectively avoid the impact of small differences and low contrast between the diseased area and the background on the results of plant disease and insect pest detection.
[0007] In addition, the plant image to be detected is randomly cropped to obtain a number of cropped images, and the structural features of the plant image to be detected are determined based on the cropped images, including: adjusting the resolution of the plant image to be detected to 256px×256px to obtain an adjusted image; randomly cropping the adjusted image to obtain a number of cropped images with a resolution of 224px×224px; inputting all the cropped images into a pre-trained residual network with the last layer removed, and using the output of the residual network as the structural features of the plant image to be detected.
[0008] In addition, the method of converting the image of the plant to be detected into a grayscale image, determining the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determining the texture features of the image of the plant to be detected based on the texture value of each pixel, includes: converting the image of the plant to be detected into a grayscale image, determining the pixel value of each pixel in the grayscale image; traversing each pixel in the grayscale image, taking the current pixel as the center point, selecting a circular neighborhood, and using N pixel points in the circular neighborhood except the current pixel as sampling points, where N is an integer greater than 1; traversing the N sampling points, and selecting the current pixel as the center point. The pixel value of the previous sampling point is compared with the pixel value of the center point. If the pixel value of the current sampling point is greater than or equal to the pixel value of the center point, the binary code corresponding to the current sampling point is recorded as 1, otherwise, the binary code corresponding to the current sampling point is recorded as 0; the binary codes corresponding to the N sampling points are arranged in sequence to obtain a binary number with a length of N, which is converted into a decimal number to obtain the texture value of the current pixel; the texture value of each pixel is input into a pre-trained convolutional neural network with the last layer removed, and the output of the convolutional neural network is used as the texture feature of the plant image to be detected.
[0009] In addition, the N pixel points in the circular neighborhood except the current pixel point are taken as sampling points, specifically: a total of 8 adjacent pixel points adjacent to the left, upper left, upper, upper right, right, lower right, lower and lower left of the center point are taken as sampling points.
[0010] In addition, the color feature of the plant image to be detected is determined based on the hue value, saturation value, brightness value and plant type of the plant image to be detected, including: forming a color array based on the hue value, saturation value and brightness value of the pixel points in the plant image to be detected; respectively obtaining the number of pixel points in the color array of the plant image to be detected that fall into the white range, light gray range and dark brown range, and respectively calculating the ratios RX%, RY% and RZ% of the pixel points falling into the white range, light gray range and dark brown range to the total number of pixel points; wherein the white range, the light gray range and the dark brown range are determined based on the plant type of the plant image to be detected; calculating the absolute value of the difference between RX%, RY% and RZ% to obtain |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%|; and combining RX%, RY%, RZ%, |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%| as the color feature of the plant image to be detected.
[0011] In addition, the detection result of the plant image to be detected is determined based on the structural features, the texture features and the color features, including: inputting the structural features, the texture features and the color features into a pre-trained multi-layer perceptron network, and obtaining the detection result of the plant image to be detected output by the multi-layer perceptron network.
[0012] In addition, the plant types include wheat, rice, watermelon, corn and strawberry; for wheat, the test result is normal wheat, wheat root rot, wheat powdery mildew, wheat fusarium rust, wheat rust or wheat snow rot and leaf blight; for rice, the test result is normal rice, rice leaf blight, rice leaf roller, rice sheath blight, rice bacterial streak, rice brown spot or rice smut; for watermelon, the test result is normal watermelon, watermelon gray mold, watermelon anthracnose, watermelon powdery mildew, watermelon vine blight or watermelon downy mildew; for corn, the test result is normal corn, southern corn rust, southern corn leaf blight, corn leaf spot, corn gray spot or corn rust; for strawberry, the test result is normal strawberry, strawberry leaf spot, strawberry leaf blight, strawberry powdery mildew or strawberry fertilizer deficiency.
[0013] In the second aspect, an embodiment of the present application proposes a plant disease and pest detection system based on modal joint learning, the system comprising: an image access module, a structural feature extraction module, a texture feature extraction module, a color feature extraction module and a disease and pest classification module; the image access module is used to obtain a plant image to be detected; the structural feature extraction module is used to randomly crop the plant image to be detected to obtain a plurality of cropped images, and determine the structural features of the plant image to be detected based on the plurality of cropped images; the texture feature extraction module is used to convert the plant image to be detected into a grayscale image based on The pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood determine the texture value of each pixel, and the texture feature of the plant image to be detected is determined based on the texture value of each pixel; the color feature extraction module is used to determine the color feature of the plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected; the pest and disease classification module is used to determine the detection result of the plant image to be detected based on the structural feature, the texture feature and the color feature, and the detection result includes whether the plant image is affected by pests and diseases and the type of pests and diseases.
[0014] In a third aspect, an embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a plant disease and pest detection method based on modal joint learning as described in the first aspect above.
[0015] In a fourth aspect, an embodiment of the present application proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a plant disease and pest detection method based on modal joint learning as described in the first aspect above.
[0016] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of a method for detecting plant diseases and insect pests based on modality joint learning provided in one embodiment of the present application;
[0018] Figure 2 A flowchart of randomly cropping a plant image to be detected to obtain a plurality of cropped images, and determining structural features of the plant image to be detected based on the cropped images, is provided in one embodiment of the present application;
[0019] Figure 3 A flowchart is provided in one embodiment of the present application, which converts a plant image to be detected into a grayscale image, determines the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determines the texture feature of the plant image to be detected based on the texture value of each pixel;
[0020] Figure 4 A flowchart for determining the color features of a plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected is provided in one embodiment of the present application;
[0021] Figure 5 is a structural schematic diagram of a plant disease and insect pest detection system based on modality joint learning provided in another embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of the structure of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0023] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0024] An embodiment of the present application proposes a plant disease and insect pest detection method based on modal joint learning, which is applied to an electronic device, wherein the electronic device can be a terminal or a server. This embodiment and the following embodiments are all described by taking the server as an example. The implementation details of the plant disease and insect pest detection method based on modal joint learning proposed in this embodiment are described in detail below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this solution.
[0025] The specific implementation process of the plant disease and insect pest detection method based on modality joint learning proposed in this embodiment can be as follows: Figure 1 As shown, including:
[0026] Step 101, obtaining an image of a plant to be detected.
[0027] Step 102 , randomly cropping the image of the plant to be detected to obtain a plurality of cropped images, and determining the structural features of the image of the plant to be detected based on the cropped images.
[0028] In a specific implementation, after the server obtains the image of the plant to be detected, it can randomly crop the obtained image of the plant to be detected to obtain several cropped images, and then determine the structural features of the image of the plant to be detected based on each cropped image.
[0029] In one example, the server randomly crops the image of the plant to be detected to obtain a number of cropped images, and determines the structural features of the image of the plant to be detected based on the cropped images. Figure 2 The steps shown are implemented, specifically including:
[0030] Step 1021, adjusting the resolution of the image of the plant to be detected to 256px×256px to obtain an adjusted image.
[0031] In the specific implementation, since the sources of the plant images to be detected are different and their shooting devices are different, the resolution of the acquired plant images to be detected is not fixed. After the server obtains the plant images to be detected, it can first adjust the resolution of the plant images to be detected to 256px×256px to obtain the adjusted image. This adjustment can standardize the resolution of the plant images to be detected for structural feature extraction, thereby improving the standardization and scientificity of the extracted structural features.
[0032] It is worth noting that 256px×256px is an exemplary standard resolution, and the server can also set the standard resolution to other values according to actual needs.
[0033] Step 1022, randomly crop the adjusted image to obtain a plurality of cropped images with a resolution of 224px×224px.
[0034] In a specific implementation, after obtaining the adjusted image with a resolution of 256px×256px, the server may randomly crop the adjusted image according to the cropping standard to obtain a number of cropped images with a resolution of 224px×224px.
[0035] It is worth noting that 224px×224px is an exemplary cropping standard, and the server can also set the cropping standard to other values according to actual needs.
[0036] Step 1023, input all the cropped images into a pre-trained residual network with the last layer removed, and use the output of the residual network as the structural feature of the plant image to be detected.
[0037] In a specific implementation, after the server obtains several cropped images with a resolution of 224px×224px, all the cropped images can be input into a pre-trained residual network with the last layer removed to obtain the output of the residual network. The server uses the output of the residual network as the structural feature of the plant image to be detected.
[0038] It is worth noting that the output of the residual network without removing the last layer is a classification result, which cannot be used as a structural feature. Therefore, the server uses the residual network without the last layer to extract structural features, so that the extracted feature is a one-dimensional vector.
[0039] Step 103, converting the plant image to be detected into a grayscale image, determining the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determining the texture feature of the plant image to be detected based on the texture value of each pixel.
[0040] In a specific implementation, after the server obtains the plant image to be detected, it can convert the obtained plant image to be detected into a grayscale image, determine the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and finally extract the texture features of the plant image to be detected based on the texture value of each pixel.
[0041] In one example, the server converts the image of the plant to be detected into a grayscale image, determines the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determines the texture feature of the image of the plant to be detected based on the texture value of each pixel. Figure 3 The steps shown are implemented, specifically including:
[0042] Step 1031, converting the plant image to be detected into a grayscale image, and determining the pixel value of each pixel in the grayscale image.
[0043] Step 1032, traverse each pixel in the grayscale image, select a circular neighborhood with the current pixel as the center point, and use N pixels in the circular neighborhood except the current pixel as sampling points.
[0044] In a specific implementation, after the server obtains the image of the plant to be detected, it can convert the obtained image of the plant to be detected into a grayscale image, determine the pixel value of each pixel in the grayscale image, and then traverse each pixel in the grayscale image (starting from the upper left corner of the grayscale image), with the current pixel as the center point, select a circular neighborhood, and use the N pixel points in the circular neighborhood except the current pixel point as sampling points.
[0045] In one example, the server uses N pixel points in the circular neighborhood except the current pixel point as sampling points, specifically: a total of 8 adjacent pixel points adjacent to the left, upper left, upper, upper right, right, lower right, lower and lower left of the center point as sampling points, that is, N=8.
[0046] Step 1033, traverse N sampling points, compare the pixel value of the current sampling point with the pixel value of the center point, if the pixel value of the current sampling point is greater than or equal to the pixel value of the center point, record the binary code corresponding to the current sampling point as 1, otherwise, record the binary code corresponding to the current sampling point as 0.
[0047] In a specific implementation, after the server takes N pixel points other than the current pixel point in the circular neighborhood as sampling points, it can traverse these N sampling points and compare the pixel value of the current sampling point with the pixel value of the center point. If the pixel value of the current sampling point is greater than or equal to the pixel value of the center point, the binary code corresponding to the current sampling point is recorded as 1; if the pixel value of the current sampling point is less than the pixel value of the center point, the binary code corresponding to the current sampling point is recorded as 0.
[0048] Step 1034, arrange the binary codes corresponding to the N sampling points in order to obtain a binary number with a length of N, convert it into a decimal number to obtain the texture value of the current pixel.
[0049] In a specific implementation, after determining the binary codes corresponding to the N sampling points, the server can arrange the binary codes corresponding to the N sampling points in order to obtain a binary number of length N, and then convert the binary number into a decimal number to obtain the texture value of the current pixel.
[0050] Step 1035, input the texture value of each pixel into a pre-trained convolutional neural network with the last layer removed, and use the output of the convolutional neural network as the texture feature of the plant image to be detected.
[0051] In the specific implementation, the server cyclically calculates the texture value of each pixel in the grayscale image, inputs the texture value of each pixel into a pre-trained convolutional neural network with the last layer removed, obtains the output of the convolutional neural network, and uses the output of the convolutional neural network as the texture feature of the plant image to be detected.
[0052] It is worth noting that the output of the convolutional neural network without removing the last layer is a classification result, which cannot be used as a texture feature. Therefore, the server uses the convolutional neural network without the last layer to extract texture features, so that the extracted feature is a one-dimensional vector.
[0053] Step 104 , determining the color features of the image of the plant to be detected based on the hue value, saturation value, brightness value and plant type of the image of the plant to be detected.
[0054] In a specific implementation, after the server obtains the plant image to be detected, it can determine the plant type in the plant image to be detected, and determine the hue value, saturation value, and brightness value of each pixel in the plant image to be detected, and extract the color characteristics of the plant image to be detected based on the plant type and the hue value, saturation value, and brightness value of each pixel.
[0055] In one example, the server determines the color features of the plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected, which can be done by Figure 4 The steps shown in the figure are implemented, including:
[0056] Step 1041, forming a color array based on the hue value, saturation value, and brightness value of the pixel points in the image of the plant to be detected.
[0057] In a specific implementation, the server determines the hue value H, saturation value S, and brightness value V of each pixel in the image of the plant to be detected to form a color array [H, S, V].
[0058] Step 1042, respectively obtain the number of pixels in the color array of the plant image to be detected that fall within the white range, light gray range and dark brown range, and respectively calculate the ratios RX%, RY% and RZ% of the pixel points that fall within the white range, light gray range and dark brown range to the total number of pixel points.
[0059] In a specific implementation, after obtaining the color array of each pixel in the image of the plant to be detected, the server can obtain the number of pixels in the image of the plant to be detected whose color array falls into the white range, light gray range and dark brown range, and calculate the ratios RX%, RY% and RZ of the pixels in the white range, light gray range and dark brown range to the total number of pixels, respectively. The white range, light gray range and dark brown range are determined based on the plant type of the image of the plant to be detected.
[0060] HSV is a color space, in which the hue value H ranges from 0 to 179, the smaller the value, the more red the color is, and the larger the value, the more blue the color is; the saturation value S ranges from 0 to 255, the smaller the value, the lighter the color, and the larger the value, the more saturated the color, that is, the higher the color purity. When the saturation value is 0, it indicates that the pixel is grayscale; the brightness value V ranges from 0 to 255, the smaller the value, the darker the color, and the larger the value, the brighter the color.
[0061] In one example, the white range for watermelon powdery mildew is: [34,0,87] to [75,26,256].
[0062] In one example, the light grey range for rice smut is: [21,120,130] to [27,192,238].
[0063] In one example, the dark brown range for corn rust is: [7,117,87] to [17,256,215].
[0064] Step 1043, calculate the absolute values of the differences between RX%, RY% and RZ% to obtain |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%|.
[0065] In a specific implementation, after obtaining the ratio RX% of pixels falling within the white range to the total number of pixels, the ratio RY% of pixels falling within the light gray range to the total number of pixels, and the ratio RZ% of pixels falling within the dark brown range to the total number of pixels, the server can calculate the absolute values of the differences between RX%, RY%, and RZ%, and obtain |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%|, respectively.
[0066] Step 1044, combining RX%, RY%, RZ%, |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%| as color features of the plant image to be detected.
[0067] In a specific implementation, after calculating |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%|, the server can combine RX%, RY%, RZ%, |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%| (into a one-dimensional vector) as the color feature of the plant image to be detected.
[0068] Step 105 , based on the structural features, texture features and color features of the plant image to be detected, determining the detection result of the plant image to be detected, wherein the detection result includes whether the plant image is affected by pests and diseases and the types of the pests and diseases.
[0069] In the specific implementation, after the server extracts the structural features, texture features and color features of the plant image to be detected, the structural features, texture features and color features of the plant image to be detected are input into a pre-trained multi-layer perceptron network to obtain the detection result of the plant image to be detected output by the multi-layer perceptron network.
[0070] In one example, the plant types that generally need to be detected include, but are not limited to, wheat, rice, watermelon, corn, strawberry, etc. For wheat, the results of plant disease and insect pest detection are normal wheat, wheat root rot, wheat powdery mildew, wheat ergot, wheat rust or wheat snow rot and leaf blight; for rice, the results of plant disease and insect pest detection are normal rice, rice leaf blight, rice leaf roller, rice sheath blight, rice bacterial streak, rice brown spot or rice smut; for watermelon, the results of plant disease and insect pest detection are normal watermelon, watermelon gray mold, watermelon anthracnose, watermelon powdery mildew, watermelon vine blight or watermelon downy mildew; for corn, the results of plant disease and insect pest detection are normal corn, southern corn rust, southern corn leaf blight, corn leaf spot, corn gray spot or corn rust; for strawberry, the results of plant disease and insect pest detection are normal strawberry, strawberry leaf spot, strawberry leaf blight, strawberry powdery mildew or strawberry fertilizer deficiency.
[0071] In this embodiment, based on the plant image to be detected, the structural features, texture features and color features of the plant image to be detected are extracted respectively, and the structural features, texture features and color features of the plant image to be detected are combined to detect plant diseases and insect pests, which can effectively avoid the influence of factors such as lighting conditions, small difference between the lesion area and the background, low contrast, and small sample size on the detection results of plant diseases and insect pests. When extracting structural features, the amount of data is increased by randomly cropping the plant image to be detected, so that more accurate structural features can be determined, and overfitting can be prevented when detecting plant diseases and insect pests. When extracting texture features, the plant image to be detected is first converted into a grayscale image, and information that is irrelevant to the texture but may affect the extraction of texture features is removed. Then, texture features are extracted for each pixel point, and finally the texture features of the entire plant image to be detected are obtained. The entire extraction process is not affected by the intensity of light, and the influence of factors such as lighting conditions on the detection results of plant diseases and insect pests can be effectively avoided. When extracting color features, full use is made of three types of information: hue, saturation and brightness. The extraction process is dynamically adjusted based on the plant type, which can effectively avoid the impact of small differences and low contrast between the diseased area and the background on the results of plant disease and insect pest detection.
[0072] Another embodiment of the present application proposes a plant disease and pest detection system based on modal joint learning. The following is a specific description of the details of the plant disease and pest detection system based on modal joint learning proposed in this embodiment. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this example. Figure 5It is a schematic diagram of a plant disease and pest detection system based on modal joint learning proposed in this embodiment, including: an image access module 201, a structural feature extraction module 202, a texture feature extraction module 203, a color feature extraction module 204 and a disease and pest classification module 205.
[0073] The image access module 201 is used to obtain the image of the plant to be detected.
[0074] The structural feature extraction module 202 is used to randomly crop the image of the plant to be detected to obtain a plurality of cropped images, and determine the structural features of the image of the plant to be detected based on the plurality of cropped images.
[0075] The texture feature extraction module 203 is used to convert the plant image to be detected into a grayscale image, determine the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determine the texture feature of the plant image to be detected based on the texture value of each pixel.
[0076] The color feature extraction module 204 is used to determine the color feature of the plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected.
[0077] The pest classification module 205 is used to determine the detection result of the plant image to be detected based on the structural features, texture features and color features of the plant image to be detected, and the detection result includes whether the plant image is affected by pests and diseases and the types of pests and diseases.
[0078] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
[0079] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.
[0080] Another embodiment of the present application relates to an electronic device, such as Figure 6As shown, it includes: at least one processor 301; and a memory 302 that is communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions that can be executed by the at least one processor 301, and the instructions are executed by the at least one processor 301 so that the at least one processor 301 can execute a plant disease and pest detection method based on modal joint learning described in the above-mentioned method embodiments.
[0081] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect other circuits such as peripheral devices, voltage regulators and power management circuits together, which are all well known in the art, so this article will not describe them further. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0082] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0083] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement a plant disease and pest detection method based on modality joint learning as described in the above method embodiments.
[0084] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM (Read-Only Memory), RAM (Random Access Memory), disk or optical disk and other media that can store program codes.
[0085] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. A plant disease and insect pest detection method based on modal joint learning, characterized in that: include: Acquire an image of a plant to be detected; Randomly cropping the image of the plant to be detected to obtain a plurality of cropped images, and determining the structural features of the image of the plant to be detected based on the cropped images; Converting the plant image to be detected into a grayscale image, determining the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determining the texture feature of the plant image to be detected based on the texture value of each pixel; Determine the color characteristics of the image of the plant to be detected based on the hue, saturation, brightness and plant type of the image of the plant to be detected; Based on the structural features, the texture features and the color features, a detection result of the plant image to be detected is determined; wherein the detection result includes whether the plant image is affected by pests and diseases and the types of pests and diseases.
2. A method for detecting plant diseases and insect pests based on modality joint learning as claimed in claim 1, characterized in that: The step of randomly cropping the image of the plant to be detected to obtain a plurality of cropped images, and determining the structural features of the image of the plant to be detected based on the cropped images, comprises: Adjusting the resolution of the plant image to be detected to 256px×256px to obtain an adjusted image; Randomly crop the adjusted image to obtain several cropped images with a resolution of 224px×224px; All cropped images are input into a pre-trained residual network with the last layer removed, and the output of the residual network is used as the structural feature of the plant image to be detected.
3. A method for detecting plant diseases and insect pests based on modality joint learning as claimed in claim 1, characterized in that: The step of converting the image of the plant to be detected into a grayscale image, determining the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determining the texture feature of the image of the plant to be detected based on the texture value of each pixel, includes: Converting the plant image to be detected into a grayscale image, and determining the pixel value of each pixel in the grayscale image; Traverse each pixel in the grayscale image, take the current pixel as the center point, select a circular neighborhood, and use N pixels in the circular neighborhood except the current pixel as sampling points; where N is an integer greater than 1 Traverse N sampling points, compare the pixel value of the current sampling point with the pixel value of the center point, if the pixel value of the current sampling point is greater than or equal to the pixel value of the center point, record the binary code corresponding to the current sampling point as 1, otherwise, record the binary code corresponding to the current sampling point as 0; Arrange the binary codes corresponding to the N sampling points in order to obtain a binary number with a length of N, convert the binary number into a decimal number, and obtain the texture value of the current pixel; The texture value of each pixel is input into a pre-trained convolutional neural network with the last layer removed, and the output of the convolutional neural network is used as the texture feature of the plant image to be detected.
4. A method for detecting plant diseases and insect pests based on modality joint learning as claimed in claim 3, characterized in that: The N pixel points other than the current pixel point in the circular neighborhood are taken as sampling points, specifically: a total of 8 adjacent pixel points adjacent to the left, upper left, upper, upper right, right, lower right, lower and lower left of the center point are taken as sampling points.
5. A method for detecting plant diseases and insect pests based on modality joint learning as claimed in claim 1, characterized in that: The step of determining the color feature of the plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected includes: Forming a color array based on the hue value, saturation value, and brightness value of the pixel points in the image of the plant to be detected; Respectively obtaining the number of pixels in the color array of the plant image to be detected that fall into the white range, the light gray range, and the dark brown range, and respectively calculating the ratios RX%, RY%, and RZ% of the pixel points that fall into the white range, the light gray range, and the dark brown range to the total number of pixel points; wherein the white range, the light gray range, and the dark brown range are determined based on the plant type of the plant image to be detected; Calculate the absolute value of the difference between RX%, RY% and RZ% to obtain |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%|; RX%, RY%, RZ%, |RX%-RY%|, |RX%-RZ%|, and |RY%-RZ%| are combined as color features of the plant image to be detected.
6. A method for detecting plant diseases and insect pests based on modality joint learning according to any one of claims 1 to 5, characterized in that: The step of determining the detection result of the to-be-detected plant image based on the structural feature, the texture feature and the color feature includes: The structural features, the texture features and the color features are input into a pre-trained multi-layer perceptron network, and a detection result of the plant image to be detected output by the multi-layer perceptron network is obtained.
7. A method for detecting plant diseases and insect pests based on modality joint learning according to any one of claims 1 to 5, characterized in that: The plant types included wheat, rice, watermelon, corn and strawberry; For wheat, the test results are normal wheat, wheat infected with wheat root rot, wheat powdery mildew, wheat scab, wheat rust, or wheat snow rot and leaf blight; For rice, the test result is normal rice, rice infected with rice leaf blight, rice leaf roller, rice sheath blight, rice bacterial leaf streak, rice brown spot or rice smut; For watermelon, the test result is normal watermelon, watermelon gray mold, watermelon anthracnose, watermelon powdery mildew, watermelon vine blight or watermelon downy mildew; For corn, the test result is normal corn, corn infected with southern corn rust, corn infected with southern corn leaf blight, corn leaf spot, corn gray spot or corn rust; For strawberries, the detection results are normal strawberries, strawberries suffering from strawberry leaf spot, strawberry leaf blight, strawberry powdery mildew, or strawberries lacking fertilizer.
8. A plant disease and insect pest detection system based on modal joint learning, characterized in that: The system comprises: an image access module, a structural feature extraction module, a texture feature extraction module, a color feature extraction module and a pest classification module; The image access module is used to obtain the image of the plant to be detected; The structural feature extraction module is used to randomly crop the plant image to be detected to obtain a plurality of cropped images, and determine the structural features of the plant image to be detected based on the plurality of cropped images; The texture feature extraction module is used to convert the plant image to be detected into a grayscale image, determine the texture value of each pixel based on the pixel value of each pixel in the grayscale image and the pixel values of each pixel in its neighborhood, and determine the texture feature of the plant image to be detected based on the texture value of each pixel; The color feature extraction module is used to determine the color feature of the plant image to be detected based on the hue value, saturation value, brightness value and plant type of the plant image to be detected; The pest classification module is used to determine the detection result of the plant image to be detected based on the structural features, the texture features and the color features, and the detection result includes whether the plant image is affected by pests and diseases and the types of pests and diseases.
9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; Wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a plant disease and pest detection method based on modal joint learning 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 a processor, a plant disease and insect pest detection method based on modality joint learning as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Texture feature extracting method for target distinguishing and tracking
CN102955945A
Method for identifying pest
CN103440488A
Method and system for identifying crop diseases and pests based on Android mobile phone platform
CN103514459A
Automatic identification method of foliar disease image of greenhouse vegetable
CN103559511A
System and method for performing interactive diagnosis on crop leaf segment disease images
CN104063686A
