Disease and Pest Identification Method, System, Device, Storage Medium and Program Product
By combining multi-classification model and object detection model, the problem of low accuracy in recognition of single model is solved, and efficient and accurate identification of pests and diseases is achieved.
Patent Information
- Application Number
- CN202411052779.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-08-02
AI Technical Summary
Existing pest and disease recognition algorithms rely on a single model and are difficult to cope with complex situations, resulting in low recognition accuracy.
A pest detection model combining multi-classification model and object detection model is used. After preliminary identification of crops through computer vision models, a multi-classification model or object detection model is further input to obtain the target feature map to determine the pest detection results.
It improves the scope and accuracy of pest identification, can more accurately identify the types and locations of pests and diseases, and provides reliable diagnostic support.
Smart Images

Figure CN119273956B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of crop pest and disease identification, and particularly relates to a pest and disease identification method, system, device, storage medium and program product. Background Art
[0002] Due to the large variety and quantity of pests and diseases, which have a great impact on crops, the prevention and control of pests and diseases become particularly important, and pest and disease identification technology also plays an important role in ensuring the healthy growth of crops.
[0003] Existing pest and disease identification algorithms mainly rely on a single model to identify plant pests and diseases. However, there are many complex situations in actual applications, and a single model is difficult to handle, resulting in the problem of low accuracy of existing pest and disease identification.
[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of the embodiments of this application is to provide a pest and disease identification method, system, device, storage medium and program product, aiming to solve the problem of low accuracy of pest and disease identification in existing methods.
[0006] In a first aspect, the embodiments of this application provide a pest and disease identification method, and the method includes:
[0007] Obtain a pest and disease image;
[0008] Input the pest and disease image into a computer vision model to obtain a content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop;
[0009] In the case where the content recognition result is that the pest and disease image includes the target crop, input the pest and disease image into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and an object detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the object detection model outputs a second feature map, and the second feature map is used to represent the pest and disease recognition result of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map;
[0010] Determine the pest and disease detection result of the pest and disease image according to the target feature map.
[0011] Second aspect, embodiments of the present application provide a pest and disease identification system, the system comprising:
[0012] An acquisition module, configured to acquire pest and disease images;
[0013] An input module, configured to input the pest and disease images into a computer vision model to obtain a content recognition result of the pest and disease images, where the content recognition result is that the pest and disease images include target crops, or the pest and disease images do not include the target crops;
[0014] A detection module, configured to, when the content recognition result is that the pest and disease images include the target crops, input the pest and disease images into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and a target detection model; the multi-classification model outputs a first feature map, and the first feature map is used to characterize the recognition result of the health status of the target part of the target crops; the target detection model outputs a second feature map, and the second feature map is used to characterize the recognition result of the pests and diseases of the target crops; the target feature map is determined based on at least one of the first feature map and the second feature map;
[0015] A result module, configured to determine a pest and disease detection result of the pest and disease images according to the target feature map.
[0016] Third aspect, embodiments of the present application provide a pest and disease identification device, the device comprising: a memory, a processor, and a computer processing program stored on the memory and executable on the processor, the computer processing program being configured to implement the steps of the pest and disease identification method as described in the first aspect.
[0017] Fourth aspect, embodiments of the present application provide a storage medium, on which a computer processing program is stored, and when the computer processing program is executed by a processor, the steps of the pest and disease identification method as described in the first aspect are implemented.
[0018] Fifth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the method as described in the first aspect.
[0019] The present application provides a pest and disease identification method, system, device, storage medium, and program product. By obtaining pest and disease images, and then inputting the pest and disease images into a computer vision model to obtain the content recognition result of the pest and disease images, where the content recognition result is that the pest and disease image includes the target crop, or the pest and disease image does not include the target crop. Then, in the case where the content recognition result is that the pest and disease image includes the target crop, the pest and disease image is input into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and an object detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the object detection model outputs a second feature map, and the second feature map is used to represent the pest and disease recognition result of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map. Finally, according to the target feature map, the pest and disease detection result of the pest and disease image is determined. The present application realizes the multi-routing identification of pests and diseases by inputting the pest and disease images into a computer vision model and further inputting the pest and disease images into a pre-trained multi-classification model and / or object detection model in the case where the recognition result is that the target crop is included. In this way, the applicable range of pest and disease identification can be improved, and thus the accuracy of pest and disease identification can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 FIG. is one of the schematic flowcharts of the pest and disease identification method provided by an embodiment of the present application;
[0021] Figure 2 FIG. is the second schematic flowchart of the pest and disease identification method provided by an embodiment of the present application;
[0022] Figure 3 FIG. is the schematic structural diagram of the pest and disease identification system provided by an embodiment of the present application;
[0023] Figure 4 FIG. is one of the schematic structural diagrams of the electronic device provided by an embodiment of the present application;
[0024] Figure 5 FIG. is the second schematic structural diagram of the electronic device provided by an embodiment of the present application;
[0025] The realization, functional features, and advantages of the objectives of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0027] The terms "first", "second", etc. in the description and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / " generally means that the associated objects before and after are in an "or" relationship.
[0028] Next, in conjunction with the accompanying drawings, the display method provided in the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0029] The embodiments of the present application provide a pest and disease identification method, which is applied to an electronic device, such as Figure 1 As shown, the pest and disease identification method in the embodiments of the present application may include the following steps:
[0030] Step 10: Obtain a pest and disease image;
[0031] Step 20: Input the pest and disease image into a computer vision model to obtain a content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop;
[0032] Step 30: In the case where the content recognition result is that the pest and disease image includes the target crop, input the pest and disease image into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and a target detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the target detection model outputs a second feature map, and the second feature map is used to represent the pest and disease recognition result of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map;
[0033] Step 40: Determine the pest and disease detection result of the pest and disease image according to the target feature map.
[0034] In the embodiment of the present application, by obtaining a pest and disease image, and then inputting the pest and disease image into a computer vision model, a content recognition result of the pest and disease image is obtained, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop. Then, in the case where the content recognition result is that the pest and disease image includes the target crop, the pest and disease image is input into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and a target detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the target detection model outputs a second feature map, and the second feature map is used to represent the recognition result of the pests and diseases of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map. Finally, according to the target feature map, the pest and disease detection result of the pest and disease image is determined. By inputting the pest and disease image into the computer vision model and further inputting the pest and disease image into a pre-trained multi-classification model and / or target detection model when the recognition result is that the target crop is included, the multi-route recognition of pests and diseases is realized. In this way, the applicable range of pest and disease recognition can be improved, and further the accuracy of pest and disease recognition can be improved.
[0035] In some embodiments, in step 10 above, a pest and disease image is obtained.
[0036] In this embodiment, it should be noted that the pest and disease image is an image to be detected for pests and diseases, and does not necessarily mean that there are pests and diseases. The pests and diseases can be any one of the following: abnormal spots, color changes, morphological abnormalities, etc. on the leaves, stems or fruits of crops. The pest and disease image can be an image obtained by a photography or scanning device. Further, the pest and disease image can be a pre-processed image or an un-pre-processed image.
[0037] When obtaining, image acquisition devices such as a high-resolution camera, a smart phone or a drone are used to comprehensively photograph the crops in the farmland or greenhouse. When photographing, attention should be paid to selecting appropriate lighting conditions and angles to ensure that the image is clear and rich in details.
[0038] For example, in a soybean field, a user uses a drone to photograph the entire field from the air to identify the pest and disease situation in a large area. The drone can automatically cruise, regularly collect images, and transmit the images to the user's smart phone or computer in real time.
[0039] In some embodiments, in step 20 above, the pest and disease image is input into a computer vision model to obtain the content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop.
[0040] In this embodiment, it should be noted that a computer vision (CV) model refers to a model that recognizes, detects, and analyzes the content in images and videos through computer algorithms and deep learning technologies. The content recognition result refers to the result output after the computer vision model analyzes the input image, including whether the target crop is included in the image. The embodiments of this application do not limit the type of the target crop, which can be specifically set according to actual needs. For example, the target crop can be wheat, corn, rice, etc.
[0041] The obtained pest and disease image is imported into the computer vision model through a specific software or interface. The computer vision model processes the graph, then performs feature extraction and analysis, and finally outputs the content recognition result. The output content recognition result may or may not include the target crop.
[0042] For example, the user uploads the captured corn leaf image to an agricultural intelligent platform, and the platform directly uses the computer vision model to analyze the image, and then determines whether the corn crop is included in the image.
[0043] In some embodiments, in step 30 above, when the content recognition result is that the pest and disease image includes the target crop, the pest and disease image is input into the trained pest and disease detection model to obtain the target feature map.
[0044] In this embodiment, it should be noted that the pest and disease detection model is a machine learning or deep learning model specifically used to identify crop pests and diseases. The pest and disease detection model includes at least one of a multi-classification model and an object detection model, and is used to identify and locate pests and diseases.
[0045] The multi-classification model is a classification algorithm that classifies the input pest and disease image into multiple categories, such as the rotten state or the healthy state. The object detection model refers to a detection algorithm used to identify whether a specific object (such as a pest and disease) exists in the pest and disease image, and determine the position of the specific object in the image when it exists. The health status recognition result includes the health status of the target part of the target crop, and the result is healthy or rotten. The pest and disease recognition result can be that pests and diseases are detected in the pest and disease image, or that no pests and diseases are detected in the pest and disease image.
[0046] When the computer vision model recognizes that the pest and disease image includes the target crop, inputting the pest and disease image into the trained pest and disease detection model for further analysis may include the following methods:
[0047] 1. When the pest and disease detection model only includes a multi-classification model, input the pest and disease image into the multi-classification model, and identify the pest and disease image through the multi-classification model to output the first feature map. In this case, the first feature map is used as the target feature map.
[0048] 2. When the pest and disease detection model only includes an object detection model, input the pest and disease image into the object detection model, so that the object detection model outputs the second feature map. In this case, the second feature map is used as the target feature map.
[0049] 3. When the pest and disease detection model includes both a multi-classification model and an object detection model, there are two implementation methods.
[0050] First, input the pest and disease image into the multi-classification model, perform a classification once through the multi-classification model to obtain the part recognition result of the pest and disease image. When the part recognition result is that the target crop includes the target part, perform a second classification through the multi-classification model to obtain the first feature map. At this time, the first feature map is used as the target feature map. When the part recognition result is that the target crop does not include the target part, input the pest and disease image into the object detection model to obtain the second feature map. At this time, the second feature map is used as the target feature map. In this implementation method, the condition for inputting the pest and disease image into the object detection model is that the part recognition result of the pest and disease image output by the multi-classification model does not include the target part, and the execution of the multi-classification model depends on the output of the multi-classification model. The target feature map is the first feature map or the second feature map.
[0051] Second, input the pest and disease image into the multi-classification model to obtain the first feature map through the multi-classification model. Input the pest and disease image into the object detection model to obtain the second feature map. In this implementation method, the multi-classification model and the multi-classification model are executed independently without a dependency relationship. The target feature map is determined based on the first feature map and the second feature map.
[0052] The target feature map can contain detailed information about crop pests and diseases, such as pest and disease types, locations, and severities.
[0053] For example, after an online agricultural platform confirms that the uploaded image contains corn, it further analyzes the image, uses the pest and disease detection model to identify the specific pest and disease type (such as corn rust) and location on the leaves, and generates a target feature map containing this information.
[0054] In some embodiments, in step 40 above, according to the target feature map, determine the pest and disease detection result of the pest and disease image.
[0055] In this embodiment, it should be noted that the pest and disease detection result refers to the specific types and locations of pests and diseases existing in the finally determined image. The pest and disease detection result can be used to guide the user to take corresponding prevention and control measures.
[0056] Based on the target feature map output by the pest and disease detection model, analyze the types of pests and diseases in the image and their influence degrees, and generate detailed pest and disease detection results. The pest and disease detection results can include the types of pests and diseases, the size and location of the infected areas, etc.
[0057] In the case where the first feature map is used as the target feature map, the pest and disease detection result determined based on the target feature map includes the recognition result of the health status of the target part of the target crop. Exemplarily, the pest and disease detection result is corn root rot.
[0058] In the case where the second feature map is used as the target feature map, the pest and disease detection result determined based on the target feature map includes the pest and disease recognition result of the target crop. Exemplarily, the pest and disease detection result is the type and location of pests and diseases or no pests and diseases for the time being.
[0059] In the case where the target feature map is determined based on the first feature map and the second feature map, the pest and disease detection result determined based on the target feature map includes the health status of the target part of the target crop and the pest and disease recognition result of the target crop. Exemplarily, the pest and disease detection result is a gray lesion in the center of a soybean leaf.
[0060] For example, the online platform can generate a pest and disease detection report according to the pest and disease detection result and notify the user that there is corn rust on the corn leaves. The report includes the specific infection location and recommended prevention and control measures, such as using specific pesticides or pruning the leaves.
[0061] In some embodiments, in the case where the pest and disease detection model includes a multi-classification model, the step of inputting the pest and disease image into the trained pest and disease detection model to obtain the target feature map includes:
[0062] Input the pest and disease image into the multi-classification model, perform a single classification through the multi-classification model, and obtain the part recognition result of the pest and disease image, where the part recognition result is that the target crop includes the target part, or the target crop does not include the target part;
[0063] In the case where the part recognition result is that the target crop includes the target part, perform a secondary classification through the multi-classification detection model to obtain the first feature map, where the target feature map is the first feature map or determined based on the first feature map.
[0064] In this embodiment, first, the pest and disease image is input into the multi-classification model, and the model performs a primary classification on the input image to identify the parts in the image. According to the part identification result, it is determined whether the target crop includes the target part. If the target part is included, a secondary classification is performed to obtain the first feature map. Through the step-by-step refinement of the two classifications, the pest and disease parts can be identified more accurately, reducing misjudgments and improving the overall identification accuracy. At the same time, through the primary classification filtering, unnecessary calculations can be reduced, the detection efficiency can be improved, and the overall processing speed can be significantly increased. In addition, the specific parts where pests and diseases occur can be accurately identified, providing more reliable data support for the diagnosis and prevention of crop pests and diseases and improving the diagnosis reliability.
[0065] In this embodiment, it should be noted that the primary classification refers to the multi-classification model performing a preliminary classification on the input image to identify the main parts in the image. It is mainly used to determine which parts of the crops are included in the image, such as leaves, stems or fruits. The part identification result refers to the identification result of the parts in the image obtained by the model after the primary classification, indicating which specific parts are included in the image. The target crop refers to the specific crop being detected and classified. The target part refers to a specific part of the target crop, such as a leaf, a stem or a fruit, which is the key area for detection and classification. The secondary classification refers to, after confirming that the image contains the target part, performing a further detailed classification on the image to obtain more characteristic information about the health status of the target part. The secondary classification is mainly used to identify the specific type or degree of pests and diseases. The first feature map refers to the feature map obtained after the secondary classification, which contains detailed characteristic information of the target part in the image, such as the health or corruption of the target part, and is used for further analysis and processing.
[0066] When the pest and disease detection model includes a multi-classification model, the crop image containing pests and diseases is input into the multi-classification model, and the model performs a primary classification on the input image to identify the specific parts in the image. From the results output after the primary classification, it is shown which parts are included in the image. According to the part identification result, it is judged whether the target part is included in the image. If it is included, a detailed classification is continued; if not, no further processing is required.
[0067] After confirming that the target part is included in the image, a secondary classification is performed to obtain the first feature map. The output of the secondary classification contains detailed characteristic information of the target part, such as health or corruption. And the first feature map is determined as the target feature map. Among them, the multi-classification model can be a multi-classification residual network (Residual Network for Multi-class Classification, ResNet) model.
[0068] In this embodiment, the target feature map can be the first feature map or determined based on the first feature map. Specifically, when the execution of the target detection model is independent of the multi-classification model, the target feature map can be determined based on the first feature map and the second feature map; when the execution of the target detection model depends on the multi-classification model, the target feature map is the first feature map.
[0069] For example, an image of a damaged rice leaf is input into a pre-trained multi-classification model. The model identifies that the part shown in the image is the stem of the rice. After the recognition result shows that the image contains the stem part of the rice, the disease type of the identified stem part of the rice is further classified to obtain a feature map of the health status characteristics of the stem, which is used for further diagnosis and analysis of pests and diseases.
[0070] In some implementation manners, after inputting the pest and disease image into the multi-classification model and performing a first classification by the multi-classification model, if the part recognition result obtained by the multi-classification model after the first classification is that the target crop includes the target part, then the multi-classification model can continue to perform a second classification to obtain the first feature map. It can be understood that in this implementation manner, a single input of the pest and disease image can trigger the multi-classification model to perform a first classification and a second classification.
[0071] In other implementation manners, after inputting the pest and disease image into the multi-classification model and performing a first classification by the multi-classification model, if the part recognition result obtained by the multi-classification model after the first classification is that the target crop includes the target part, the pest and disease image can be input into the multi-classification model again, and the multi-classification model performs a second classification to obtain the first feature map. It can be understood that in this implementation manner, the first classification and the second classification of the multi-classification model are triggered by different inputs of the pest and disease image respectively.
[0072] In some embodiments, after the step of inputting the pest and disease image into the multi-classification detection model and performing a first classification by the multi-classification detection model to obtain the part recognition result of the pest and disease image, when the pest and disease detection model further includes a target detection model, the method further includes:
[0073] When the part recognition result is that the target crop does not include the target part, input the pest and disease image into the target detection model to obtain the second feature map, where the target feature map is the second feature map.
[0074] In this embodiment, when the pest and disease image is input into the multi-classification model, the model performs a primary classification to identify the parts in the image. After determining whether the target crop includes the target part according to the part identification result, if the part identification result indicates that the target crop does not include the target part, the pest and disease image is input into the target detection model. The target detection model performs detection to obtain a second feature map, which is determined as the target feature map. This can improve the detection coverage. By further detecting in the case of failed part identification, it is ensured that even when the target part cannot be identified in the primary classification, potential pests and diseases can be detected. In addition, the detection accuracy is improved. By using the target detection model to further analyze the image, the specific location and morphology of the pests and diseases can be accurately identified. The robustness and reliability of the model are enhanced. By combining the advantages of the multi-classification detection model and the target detection model, the adaptability of the system to different images and complex situations is improved. The overall detection efficiency is increased. Through the preliminary screening of the multi-classification detection model, the computational burden of the target detection model is reduced, and the resource utilization is optimized.
[0075] In this embodiment, it should be noted that the second feature map is the feature map obtained through the output after processing by the target detection model and contains the pest and disease identification results of the target crop in the pest and disease image.
[0076] In this embodiment, the execution of the target detection model depends on the multi-classification model. Specifically, in the primary classification process, when the model determines that the part in the input image does not belong to the specific part of the target crop, after confirming that the image does not include the target part, the image is input into the target detection model to detect potential pest and disease targets in the image. The second feature map obtained through the output after processing by the target detection model contains the detailed feature information of the pests and diseases in the image, that is, the pest and disease identification results of the target crop. Among them, the target detection model can be a Faster Region-Based Convolutional Neural Network (Faster R-CNN).
[0077] For example, the input image is an image showing a damaged plant, but the primary classification result determines that the part is not the stem of the target crop (rice), but may be a leaf or the like. Then the above image is input into the trained target detection model to identify the specific pest and disease targets in the image, such as disease spots, insect pests, etc., or to identify that there are no diseases in the image for the time being.
[0078] In some embodiments, in the case where the pest and disease detection model includes a target detection model, the step of inputting the pest and disease image into the trained pest and disease detection model to obtain the target feature map includes:
[0079] Input the pest and disease image into the target detection model to obtain the second feature map;
[0080] Wherein, the target feature map is the second feature map or is determined based on the second feature map.
[0081] In this embodiment, the pest and disease image is input into the target detection model to obtain the second feature map, which is determined as the target feature map. The target detection model can quickly identify pests and diseases in crops, improving the detection efficiency. In addition, by leveraging the powerful feature extraction ability of the deep learning model, pests and diseases can be more accurately identified and classified, reducing human misjudgment.
[0082] When the pest and disease detection model includes a target detection model, input the pest and disease image into the target detection model to detect potential pest and disease targets in the pest and disease image, and obtain the second feature map through the output after being processed by the target detection model.
[0083] In this embodiment, the target feature map can be the second feature map or is determined based on the second feature map. Specifically, when the execution of the target detection model is independent of the multi-classification model, the target feature map can be determined based on the first feature map and the second feature map; when the execution of the target detection model depends on the multi-classification model, the target feature map is the second feature map.
[0084] For example, input a pest and disease image containing rice. After being processed by the target detection model, in the case of a disease, the target detection model outputs that there are gray disease spots in the center of the rice leaf. In the case of no disease, the target detection model outputs that there is no disease yet.
[0085] In the embodiments of the present application, when the target feature map is based on the first feature map and the second feature map, in some embodiments, the target feature map can be obtained by directly splicing the first feature map and the second feature map.
[0086] In some embodiments, the step of inputting the pest and disease image into the trained pest and disease detection model to obtain the target feature map further includes:
[0087] Obtain the first feature vector corresponding to the first feature map;
[0088] Obtain the second feature vector corresponding to the second feature map;
[0089] Splice the first feature vector and the second feature vector to obtain the target feature vector;
[0090] Perform weighted averaging on the elements in the target feature vector to obtain the target feature map.
[0091] In this embodiment, the first feature vector corresponding to the first feature map and the second feature vector corresponding to the second feature map are obtained. The first feature vector and the second feature vector are concatenated according to dimensions to obtain a target feature vector. Then, the elements in the target feature vector are weighted and averaged to obtain a target feature map. By concatenating and weighted-averaging feature vectors from different sources, various feature information can be integrated, improving the richness and accuracy of feature representation.
[0092] In this embodiment, it should be noted that a feature vector is a one-dimensional array extracted from a feature map and used to represent image feature information. Concatenation is to connect two or more vectors together to form a new and longer vector. Weighted average is to perform weighted summation on the elements in the feature vector and then take the average to highlight important features.
[0093] In the case where the pest and disease detection model includes a multi-classification model and an object detection model, the object detection model does not rely on the multi-classification model for detection. The first feature vector is extracted from the first feature map, and the first feature vector represents the detailed feature information of the target part in the image, such as the health or corruption of the target part. The second feature vector is extracted from the second feature map, and the second feature vector represents the feature information of other parts in the image, such as having gray disease spots in the center of the leaf. The first feature vector and the second feature vector are connected according to fixed dimensions to form a target feature vector. Each element in the target feature vector is weighted, and the weighted average is calculated to form the final target feature map.
[0094] In some embodiments, before the step of obtaining the pest and disease image, the method further includes:
[0095] Obtaining a pest and disease image training set, where the pest and disease image training set includes at least one pest and disease image and the reference feature map of the at least one pest and disease image;
[0096] Training a pest and disease detection model using the pest and disease image training set to obtain the trained pest and disease detection model.
[0097] In this embodiment, a pest and disease image training set is obtained, and a pest and disease detection model is trained using the pest and disease image training set to obtain the trained pest and disease detection model. Using a pest and disease image training set containing reference feature maps can better extract and learn pest and disease features, improving the accuracy of the detection model. At the same time, by using a diverse training set, the model can better adapt to the detection of different types and scenarios of pests and diseases, enhancing the generalization ability of the model.
[0098] In this embodiment, it should be noted that the pest and disease image training set is a set containing multiple images with pest and disease characteristics and reference feature maps, which is used to train the pest and disease detection model. The reference feature map is an annotation map representing the disease or pest characteristics in the pest and disease image, which is used to guide the model to learn the correct features. The pest and disease detection model is a deep learning model used to identify and detect pest and disease characteristics in images, and may include at least one of a multi-classification model and an object detection model.
[0099] Collect and organize the image training set containing pest and disease characteristics. Each image is accompanied by a corresponding reference feature map for training the model. Input the pest and disease image training set into the model for training. The pest and disease detection model obtained through training can accurately identify and detect pest and disease characteristics. The image training set is obtained by collecting multiple pest and disease images and preprocessing them. Use a high-resolution camera or drone to collect pest and disease images of the target crop, and perform image preprocessing on the collected images. The image preprocessing includes denoising, enhancement, and cropping, etc., to improve the image quality. Training the model includes training a multi-classification model and training an object detection model. When training the multi-classification model, the EfficientNetworks (EfficientNet) can be used for multi-classification training, and then the deep learning framework is used for model training and optimization. The training data is classified for different parts of the target crop (such as roots, stems, leaves, etc.). When training the object detection model, it can be trained through the You Only Look Once version 8 (YOLOv8) model. Use the deep learning framework for training and optimization of the object detection model. The training data is to label small target pests and diseases in the image, such as disease spots, pests, etc.
[0100] It should be noted that the various embodiments, implementation manners, and implementation methods provided in the embodiments of the present application can be implemented independently or combined in an implementation without conflict with each other, and can be specifically determined according to actual needs. The embodiments of the present application do not limit this.
[0101] For ease of understanding, reference can be made to Figure 2 , Figure 2 which is a schematic diagram of the recognition process in the embodiment of the pest and disease recognition method provided by the present application. In Figure 2 the corresponding pest and disease recognition method, the target crops are wheat and citrus, and the target parts are the roots / stems of wheat, but this does not limit the specific forms of the target crops and target parts in the embodiments of the present application.
[0102] Input a pest and disease image, and use a CV model to identify whether the pest and disease image includes wheat or does not include crops. In the case where the pest and disease image includes wheat, the pest and disease image is further input into a multi-classification model, and a single classification is performed using the multi-classification model. If the recognition result of the multi-classification model shows that the target part in the image is the root or stem of wheat, the identified root or stem of wheat is further classified to obtain detailed features, such as healthy or rotten, and the pest and disease detection result is output as healthy stem or stem rot, healthy root or root rot. If the recognition result of the single classification shows that the target part in the image does not include the root or stem of wheat, the image is input into a target detection model to identify the location and type of the pest and disease, and the pest and disease detection result is output as the disease type and location or no disease has been identified yet.
[0103] Input a pest and disease image, and use a CV model to identify whether the pest and disease image includes citrus or does not include crops. In the case where the pest and disease image includes citrus, the pest and disease image is further input into a target detection model. When there is a disease, the pest and disease detection result is output as the disease type and location, and when there is no disease, the pest and disease detection result is output as no disease has been identified yet.
[0104] Refer to Figure 3 , an embodiment of the present application provides a pest and disease recognition system, the system includes:
[0105] An acquisition module 301, configured to acquire a pest and disease image;
[0106] An input module 302, configured to input the pest and disease image into a computer vision model to obtain a content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop;
[0107] A detection module 303, configured to, in the case where the content recognition result is that the pest and disease image includes the target crop, input the pest and disease image into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and a target detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the target detection model outputs a second feature map, and the second feature map is used to represent the recognition result of the pest and disease of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map;
[0108] A result module 304, configured to determine a pest and disease detection result of the pest and disease image according to the target feature map.
[0109] It should be noted that the embodiments of this system and the above method embodiments are based on the same inventive concept. Therefore, the content of the above method embodiments is equally applicable to the embodiments of this system and will not be elaborated here.
[0110] Optionally, as Figure 4 shown, an embodiment of the present application further provides an electronic device 400, including a processor 401 and a memory 402. A program or instruction that can run on the processor 401 is stored on the memory 402. When the program or instruction is executed by the processor 401, it implements each step of the above embodiment of the pest and disease identification method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0111] It should be noted that the electronic device in the embodiments of the present application includes the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0112] Figure 5 It is a schematic diagram of the hardware structure of the electronic device for implementing the embodiments of the present application.
[0113] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, and a processor 510 and other components.
[0114] Those skilled in the art can understand that the electronic device 500 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 510 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 5 The structure of the electronic device shown in does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0115] Among them, the processor 510 is used for:
[0116] Obtain pest and disease images;
[0117] Input the pest and disease images into a computer vision model to obtain the content recognition result of the pest and disease images, where the content recognition result is that the pest and disease images include target crops, or the pest and disease images do not include the target crops;
[0118] When the content recognition result indicates that the pest and disease image includes the target crop, input the pest and disease image into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes at least one of a multi-classification model and an object detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the object detection model outputs a second feature map, and the second feature map is used to represent the recognition result of the pests and diseases of the target crop; the target feature map is determined based on at least one of the first feature map and the second feature map.
[0119] Determine the pest and disease detection result of the pest and disease image according to the target feature map.
[0120] In some embodiments, the processor 510 is further configured to:
[0121] Input the pest and disease image into the multi-classification model, perform a single classification through the multi-classification model to obtain the part recognition result of the pest and disease image, where the part recognition result is that the target crop includes the target part, or the target crop does not include the target part;
[0122] When the part recognition result is that the target crop includes the target part, perform a secondary classification through the multi-classification model to obtain the first feature map, where the target feature map is the first feature map or is determined based on the first feature map.
[0123] In some embodiments, the processor 510 is further configured to:
[0124] When the part recognition result is that the target crop does not include the target part, input the pest and disease image into the object detection model to obtain the second feature map, where the target feature map is the second feature map.
[0125] In some embodiments, the processor 510 is further configured to:
[0126] Input the pest and disease image into the object detection model to obtain the second feature map;
[0127] Wherein, the target feature map is the second feature map or is determined based on the second feature map.
[0128] In some embodiments, the processor 510 is further configured to:
[0129] Obtain a first feature vector corresponding to the first feature map;
[0130] Obtain a second feature vector corresponding to the second feature map;
[0131] Concatenate the first feature vector and the second feature vector to obtain a target feature vector;
[0132] Perform weighted averaging on the elements in the target feature vector to obtain the target feature map.
[0133] In some embodiments, the processor 510 is further configured to:
[0134] Obtain a pest and disease image training set, where the pest and disease image training set includes at least one pest and disease image and the reference feature map of the at least one pest and disease image;
[0135] Use the pest and disease image training set to train a pest and disease detection model to obtain the trained pest and disease detection model.
[0136] It should be understood that in the embodiments of the present application, the input unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. The other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0137] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 509 may include volatile memory or non-volatile memory, or the memory 509 may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 509 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
[0138] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 510 either.
[0139] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above display method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described in detail here.
[0140] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs.
[0141] In addition, an embodiment of the present application provides a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the display method embodiment as described above, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0142] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article, or system. Without more limitations, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or system including that element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0144] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0145] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A pest and disease identification method, characterized in that, The method includes the following steps: Obtain a pest and disease image; Input the pest and disease image into a computer vision model to obtain a content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes the target crop, or the pest and disease image does not include the target crop; In the case where the content recognition result is that the pest and disease image includes the target crop, input the pest and disease image into a trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes a multi-classification model and an object detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent the recognition result of the health status of the target part of the target crop; the object detection model outputs a second feature map, and the second feature map is used to represent the recognition result of the pests and diseases of the target crop; the target feature map is determined based on the first feature map and the second feature map; Determine a pest and disease detection result of the pest and disease image according to the target feature map; The step of inputting the pest and disease image into a trained pest and disease detection model to obtain a target feature map further includes: Obtain a first feature vector corresponding to the first feature map; Obtain a second feature vector corresponding to the second feature map; Concatenate the first feature vector and the second feature vector to obtain a target feature vector; Perform weighted averaging on the elements in the target feature vector to obtain the target feature map.
2. The pest and disease identification method according to claim 1, wherein In the case where the pest and disease detection model includes a multi-classification model, the step of inputting the pest and disease image into a trained pest and disease detection model to obtain a target feature map includes: Input the pest and disease image into the multi-classification model, and perform a first classification through the multi-classification model to obtain a part recognition result of the pest and disease image, where the part recognition result is that the target crop includes the target part, or the target crop does not include the target part; In the case where the part recognition result is that the target crop includes the target part, perform a second classification through the multi-classification model to obtain the first feature map, where the target feature map is the first feature map or is determined based on the first feature map.
3. The pest and disease identification method according to claim 2, wherein, In the case where the pest and disease detection model further includes an object detection model, after the step of inputting the pest and disease image into the multi-classification model and performing a first classification through the multi-classification model to obtain a part recognition result of the pest and disease image, the method further includes: In the case where the part recognition result is that the target crop does not include the target part, input the pest and disease image into the object detection model to obtain the second feature map, where the target feature map is the second feature map.
4. The pest and disease identification method according to claim 1, wherein In the case where the pest and disease detection model includes an object detection model, the step of inputting the pest and disease image into a trained pest and disease detection model to obtain a target feature map includes: Input the pest and disease image into the object detection model to obtain the second feature map; Wherein, the target feature map is the second feature map or is determined based on the second feature map.
5. The pest and disease identification method according to claim 1, characterized in that, Before the step of acquiring the pest and disease image, the method further includes: acquiring a pest and disease image training set, where the pest and disease image training set includes at least one pest and disease image and reference feature maps of the at least one pest and disease image; training a pest and disease detection model using the pest and disease image training set to obtain the trained pest and disease detection model.
6. A pest and disease identification system, characterized in that, The system includes: an acquisition module, configured to acquire pest and disease images; an input module, configured to input the pest and disease image into a computer vision model to obtain a content recognition result of the pest and disease image, where the content recognition result is that the pest and disease image includes a target crop, or the pest and disease image does not include the target crop; a detection module, configured to, when the content recognition result is that the pest and disease image includes the target crop, input the pest and disease image into the trained pest and disease detection model to obtain a target feature map, where the pest and disease detection model includes a multi-classification model and a target detection model; the multi-classification model outputs a first feature map, and the first feature map is used to represent a recognition result of the health status of the target part of the target crop; the target detection model outputs a second feature map, and the second feature map is used to represent a pest and disease recognition result of the target crop; the target feature map is determined based on the first feature map and the second feature map; a result module, configured to determine a pest and disease detection result of the pest and disease image according to the target feature map; The detection module is further configured to, when the content recognition result is that the pest and disease image includes the target crop, acquire a first feature vector corresponding to the first feature map; acquire a second feature vector corresponding to the second feature map; splice the first feature vector and the second feature vector to obtain a target feature vector; perform weighted averaging on elements in the target feature vector to obtain the target feature map.
7. A pest and disease identification device, characterized in that, The device includes: a memory, a processor, and a computer processing program stored on the memory and executable on the processor, where the computer processing program is configured to implement the steps of the pest and disease recognition method according to any one of claims 1 to 5.
8. A storage medium, characterized in that, A computer processing program is stored on the storage medium, and when the computer processing program is executed by the processor, it implements the steps of the pest and disease recognition method according to any one of claims 1 to 5.
9. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is caused to execute the steps of the pest and disease recognition method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and system for identifying fruit tree pest and disease damage types
CN112465038A
Accurate identification method and system for frequent insect pests of crops
CN117115858A