Pest and disease identification method and device, computer readable storage medium and terminal equipment
By introducing an integrated attention mechanism module into the pest and disease recognition model and using pre-trained artificial intelligence models to identify crop diseases and pests, the problem of low recognition accuracy in the existing technology is solved, and higher recognition accuracy and universality are achieved. ization ability.
Patent Information
- Application Number
- CN202410619971.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-10
AI Technical Summary
The pest and disease identification methods in the prior art are easily interfered by external factors and target size, resulting in low identification accuracy.
A pre-trained artificial intelligence model is used, combined with an integrated attention mechanism module, to identify plant diseases and insect pests in crop images. Feature extraction and identification are performed through the block weight layer, feature extraction layer and pest and disease identification layer to reduce interference from external factors and target size.
The accuracy and generalization ability of pest identification are improved, and pests and diseases of different sizes and types can be more accurately identified.
Smart Images

Figure CN118628792A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of target identification technology, and in particular, relates to a pest identification method, device, computer-readable storage medium and terminal device. Background Art
[0002] With the development of artificial intelligence technology, more and more artificial intelligence detection technologies are being applied in the agricultural field to improve production efficiency and crop yields. In agricultural production, the identification and prevention of crop pests and diseases is a crucial link. However, the pest and disease identification methods in the existing technology are easily affected by external factors and target size, resulting in low accuracy of pest and disease identification. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a pest and disease identification method, apparatus, computer-readable storage medium and terminal device to solve the problem that the pest and disease identification method in the prior art is easily affected by external factors and target size, resulting in low accuracy of pest and disease identification.
[0004] A first aspect of an embodiment of the present application provides a method for identifying pests and diseases, which may include:
[0005] Acquire a target crop image to be identified;
[0006] The target crop image is subjected to pest and disease identification using a preset pest and disease identification model to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module.
[0007] A second aspect of the embodiments of the present application provides a pest identification device, which may include:
[0008] A crop image acquisition module, used to acquire a target crop image to be identified;
[0009] A pest and disease identification module is used to use a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module.
[0010] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned pest and disease identification methods are implemented.
[0011] The fourth aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned pest and disease identification methods when executing the computer program.
[0012] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device executes the steps of any one of the above-mentioned pest and disease identification methods.
[0013] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain a target crop image to be identified; use a preset pest and disease identification model to identify pests and diseases on the target crop image, and obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module. The embodiments of the present application can effectively reduce the interference of external factors and target size by setting an integrated attention mechanism module in the pest and disease identification model, thereby being able to more accurately identify pests and diseases. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0015] Figure 1 This is a schematic diagram of the overall framework of an initial artificial intelligence model in an embodiment of the present application;
[0016] Figure 2 This is a flow chart of an embodiment of a method for identifying pests and diseases in an embodiment of the present application;
[0017] Figure 3 This is a structural diagram of an embodiment of a pest identification device in an embodiment of the present application;
[0018] Figure 4 This is a schematic block diagram of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0021] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0022] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0023] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0024] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0025] With the development of artificial intelligence technology, more and more artificial intelligence detection technologies are being applied in the agricultural field to improve production efficiency and crop yields. In agricultural production, the identification and prevention of crop pests and diseases is a crucial link. However, the pest and disease identification methods in the existing technology are easily affected by external factors and target size, resulting in low accuracy of pest and disease identification.
[0026] In view of this, the embodiments of the present application provide a pest and disease identification method, apparatus, computer-readable storage medium and terminal device to solve the problem that the pest and disease identification method in the prior art is easily affected by external factors and target size, resulting in low accuracy of pest and disease identification.
[0027] It should be noted that the execution subject of the method of the present application is a terminal device, specifically, it can be a common computing device such as a desktop computer, a notebook, a PDA, a smart phone, a tablet, etc., or it can be other computing devices.
[0028] In an embodiment of the present application, a pre-trained pest and disease recognition model can be used to identify pests and diseases in the collected crop images to obtain the corresponding pest and disease recognition results in the crop images; since different crops may have different types of pests and diseases, in order to improve the accuracy of pest and disease recognition, the pest and disease recognition model corresponding to the target crop can be used here to identify pests and diseases. For example, if the crop to be identified for pests and diseases is citrus, that is, the target crop is citrus, then the pest and disease recognition model corresponding to citrus can be used to identify pests and diseases in images containing citrus, and the pest and disease recognition model is a pre-trained artificial intelligence model for identifying pests and diseases corresponding to citrus.
[0029] Before using the pest identification model, the initial artificial intelligence model may be trained to obtain the pest identification model in the embodiment of the present application. For ease of understanding, the training process of the pest identification model will be first introduced below.
[0030] In the embodiment of the present application, the initial artificial intelligence model can be any common artificial intelligence model for target recognition in the prior art, including but not limited to the YOLO series, convolutional neural network (CNN), recurrent neural network (RNN), Fast R-CNN, Faster R-CNN. Here, the initial artificial intelligence model in the embodiment of the present application can preferably be YOLO8 (specifically YOLOv8m.pt).
[0031] In an embodiment of the present application, before performing model training, a preset number of training images to be identified may be obtained to construct a training sample set.
[0032] Specifically, in order to ensure the diversity of image sources, the training images to be identified can be obtained from different channels as much as possible to obtain images containing different types of target crops and pests and diseases. For example, if the target crop is citrus, the image acquisition device can be used to collect images of different types of citrus. In addition, the images of different types of citrus can be obtained from the Internet by means of network search and crawlers; and images containing different citrus pests and diseases can be obtained as much as possible to finally obtain various training images to be identified.
[0033] In order to improve the image quality of the training sample set, the embodiment of the present application may further perform image preprocessing on each training image to be identified to obtain each training image to be identified after image preprocessing.
[0034] In a specific implementation, each training image to be identified can be cleaned to remove blurred images to ensure the quality of the training image to be identified, and the image cleaning method can include but is not limited to image preprocessing methods of any one or more scenarios such as Laplacian operator processing, Gaussian filtering, median filtering, edge detection, etc., which are not specifically limited in this application. For example, the Laplacian operator can be used to clean each training image to be identified to remove noise and unnecessary details in the training image to be identified, and to highlight the edges and details in the training image to be identified, so that the training image to be identified is clearer and easier to identify.
[0035] In another specific implementation method, image enhancement methods such as mask enhancement and contrast enhancement can be used to perform data enhancement on the acquired training images to be identified to simulate images under different lighting and environments, which can increase the number of training images to be identified, thereby improving the performance and generalization ability of the model. The specific data enhancement ratio can be set according to actual needs, and this application does not limit this.
[0036] Afterwards, according to the preset pest and disease marking strategy, each training image to be identified after image preprocessing can be marked with pest and disease results to obtain the marked pest and disease results corresponding to each training image to be identified; wherein the marked pest and disease results can include pest and disease type labels and marked pest and disease areas.
[0037] Here, any one of the training images to be identified (referred to as a target training image to be identified) will be taken as an example to illustrate the pest and disease marking strategy in the embodiment of the present application.
[0038] If there are no pests and diseases in the target training image to be identified, the pest and disease type label of the target training image to be identified can be set to no pests and diseases, and the marked pest and disease area of the target training image to be identified can be set to empty.
[0039] If there are pests and diseases in the target training image to be identified, the pest and disease type label can be set according to the specific pest and disease type of the pest and disease, and an appropriate pest and disease marking strategy can be adopted according to the size of the pest and disease area to obtain a marked pest and disease area; if the pest and disease area is larger than the preset area threshold, it can be considered that the size of the pest and disease is large. At this time, the model has a greater probability of accurately identifying the pest and disease, so each pest and disease area can be marked one by one; if the pest and disease area is less than or equal to the area threshold, it can be considered that the size of the pest and disease is small. If each pest and disease area is marked one by one, the model may find it difficult to accurately identify the pest and disease, so the pest and disease area can be uniformly marked. For example, each pest and disease area can be marked as a whole to obtain a larger marked pest and disease area; at this time, the pest and disease type label corresponding to the target training image to be identified is the specific pest and disease type existing in the target training image to be identified, and the marked pest and disease area corresponding to the target training image to be identified is the marked pest and disease area.
[0040] Based on this, different pest and disease marking strategies can be adopted according to the size of the pest and disease area to adapt to the size differences of different pests and diseases in the image, thereby optimizing the model's recognition ability for pests and diseases of different sizes.
[0041] The above-mentioned regional thresholds can be specified and set according to actual needs, and this application does not limit this.
[0042] Afterwards, the initial artificial intelligence model can be trained with the training image to be identified of each training sample in the training sample set as input and the labeled pest and disease result corresponding to each training sample in the training sample set as output to obtain a pest and disease recognition model.
[0043] In the embodiment of the present application, the overall framework of the initial artificial intelligence model can be as follows: Figure 1 As shown, it can specifically include an input layer, a block weight layer, a feature extraction layer, a pest and disease identification layer and an output layer; wherein the input layer can be used to receive an input image; the block weight layer can be used to weight each area of the input image to reasonably assign weights to each area of the image, so that the model can learn the characteristics of the pest and disease area more attentively, thereby improving the accuracy of pest and disease identification; the feature extraction layer can be used to extract features from the image weighted by the block weight layer; the pest and disease identification layer can be used to identify pests and diseases based on the features extracted by the feature extraction layer; and the output layer can be used to output the pest and disease identification results.
[0044] Specifically, the block weight layer may include a preset integrated attention mechanism module, which is used to perform attention mechanism processing on the input training image to be identified, so as to reasonably allocate the attention of the model, increase the attention to important areas (such as pest and disease areas), and reduce the attention to non-important areas (such as areas outside pest and disease areas); the integrated attention mechanism module may specifically include an integrated channel attention (Convolutional Block Attention Module, CBAM) module, a global attention (Global Attention Mechanism, GAM) module and a residual block channel attention (ResBlock-CBAM) module.
[0045] Among them, the integrated channel attention module can perform channel attention mechanism processing on the training image to be identified, and can obtain target attention information; here, the integrated channel attention module integrates the channel attention mechanism (CAM) module and the spatial attention mechanism (SAM) module. The channel attention can dynamically adjust the contribution of each channel to the feature representation by learning the weight of each channel in the training image to be identified, thereby enhancing the expression of important features; the spatial attention module can dynamically adjust the feature responses of different positions by learning the weight of each spatial position in the training image to be identified, so that the model pays more attention to the important areas in the image; accordingly, the integrated channel attention module can help the model automatically learn and pay attention to important channel or spatial information in the image.
[0046] The global attention module can process the target attention information through the global attention mechanism to obtain global attention information. Based on this, the model can better understand the global structure and correlation of image data, thereby improving the accuracy and generalization ability of pest and disease identification.
[0047] The residual block channel attention module can perform channel attention mechanism processing and residual connection on the global attention information to obtain the target attention information; accordingly, the residual block channel attention module can effectively improve the efficiency of information transmission by residually connecting the processing of the aforementioned attention module.
[0048] Afterwards, the feature extraction module in the feature extraction layer can be used to extract features of the training image to be identified after weighting by the block weight layer to obtain the target features, and the pest and disease identification module in the pest and disease identification layer can be used to identify pests and diseases on the target features to obtain the target pest and disease identification results; afterward, the output layer can be used to output the specific target pest and disease type and target pest and disease area.
[0049] In a specific implementation, each training image to be identified can be divided according to a preset segmentation ratio to obtain a training sample set, a verification sample set, and a test sample set, and ensure that there are representative sample images in the three sample sets so that the model can perform well in various situations; wherein the training sample set can be used for model training, the verification sample set can be used to evaluate the performance of the model and make necessary adjustments to the model, and the test sample set can be used to verify the final performance of the model. Here, the segmentation ratio can be set according to actual needs, and this application does not limit this. For example, the training sample set, the verification sample set, and the test sample set can be divided according to the segmentation ratio of 70%, 15%, and 15%.
[0050] In another specific implementation method, the initial learning rate of the artificial intelligence model and the long-term patience training strategy (patience strategy) can also be set to cope with the limited scale of training sample data; wherein the learning rate refers to the rate at which the model adjusts its parameters during the learning process, and the patience training strategy means that when the model performance no longer improves, you should wait for a certain training cycle before stopping training. Here, the learning rate and the long-term patience training strategy can be set according to actual needs. Preferably, the long-term patience training strategy can be set to 500 training cycles (epochs).
[0051] In another specific implementation, a terminal device with good performance can be used for model training and pest identification to ensure efficient computing capabilities. In addition, the performance indicators of the model can be continuously monitored during the model training process, and the performance indicators may include but are not limited to loss function and accuracy.
[0052] When the artificial intelligence model meets the training stop condition, the training can be stopped and the pest and disease identification model in the embodiment of the present application can be obtained. The training stop condition can be that the loss value of the artificial intelligence model is less than or equal to the preset loss value threshold, or the accuracy of the artificial intelligence model is greater than or equal to the preset accuracy threshold, or the performance of the artificial intelligence model is no longer improved (the loss value or accuracy no longer changes) and after a long period of patient training strategy, it can be determined that the artificial intelligence model is complete. At this time, the parameters of the artificial intelligence model can be frozen and the artificial intelligence model can be deployed to actual application scenarios, for example, in the agricultural monitoring system of the terminal device, to obtain the pest and disease identification model in the embodiment of the present application, and then the pest and disease identification model can be applied to actual pest and disease identification applications.
[0053] See also Figure 2 , an embodiment of a pest identification method in the embodiment of the present application may include:
[0054] Step S201: Acquire a target crop image to be identified.
[0055] In an embodiment of the present application, the target crop image may be an image captured in real time. Specifically, a camera capture device preset on a terminal device may be used to capture images of the target crop for which pests and diseases are to be identified, thereby obtaining the target crop image to be identified. Alternatively, the target crop image may be an image captured in advance and stored in a preset storage module. When pest and disease identification is required, the target crop image may be obtained from the preset storage module.
[0056] Step S202: Use a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result.
[0057] In an embodiment of the present application, the pest and disease identification model may include at least an integrated attention mechanism module in a preset block weight layer, a feature extraction module in a preset feature extraction layer, and a pest and disease identification module in the pest and disease identification layer.
[0058] When using a preset pest and disease recognition model to identify pests and diseases in a target crop image, the integrated attention mechanism module can be used to perform attention mechanism processing on the target crop image to better focus on important information in the target crop image and obtain target attention information. Based on the target attention information, feature extraction can be performed more specifically.
[0059] The integrated attention mechanism module in the embodiment of the present application may at least include an integrated channel attention module, a global attention module and a residual block channel attention module. Here, the integrated channel attention module can be used to perform channel attention mechanism processing on the target crop image to obtain channel attention information; then, the global attention module can be used to perform global attention mechanism processing on the channel attention information to obtain global attention information; then, the residual block channel attention module can be used to perform channel attention mechanism processing and residual connection on the global attention information to obtain target attention information.
[0060] Afterwards, the feature extraction module in the feature extraction layer can be used to extract features of the target attention information to obtain target features. Afterwards, the pest identification module in the pest identification layer can be used to identify pests and diseases on the target features to obtain target pest and disease identification results; wherein the target pest and disease identification results may at least include a target pest and disease type label and a target pest and disease area, the target pest and disease type label is used to indicate whether there are pests and diseases in the target crop image and the type of pests and diseases that exist, and the target pest and disease area is the area where pests and diseases exist in the target crop image.
[0061] In a specific implementation of an embodiment of the present application, after the target crop image is subjected to pest and disease identification using a pest and disease identification model and the target pest and disease identification result is obtained, the result processing can also be performed based on the target pest and disease identification result. For example, if the target pest and disease type label indicates the presence of a certain type of pest and disease, the specific target pest and disease result can be sent to a mobile terminal held by a manager, so that the manager can be notified in time to handle the pest and disease, thereby ensuring the health of the target crop. For another example, corresponding prevention and control measures can be matched based on the target pest and disease type label and the size of the target pest and disease area, and the target pest and disease identification result and the corresponding prevention measures can be sent to the mobile terminal held by the manager.
[0062] In summary, the embodiment of the present application obtains a target crop image to be identified; uses a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module. The embodiment of the present application can effectively reduce the interference of external factors and target size by setting an integrated attention mechanism module in the pest and disease identification model, thereby being able to more accurately identify pests and diseases.
[0063] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0064] Corresponding to the pest identification method described in the above embodiment, Figure 3 A structural diagram of an embodiment of a pest identification device provided in an embodiment of the present application is shown.
[0065] In an embodiment of the present application, a pest identification device may include:
[0066] The crop image acquisition module 301 is used to acquire the target crop image to be identified;
[0067] The pest and disease identification module 302 is used to use a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module.
[0068] In a specific implementation of the embodiment of the present application, the pest identification module may include:
[0069] an attention mechanism processing submodule, configured to perform attention mechanism processing on the target crop image using the integrated attention mechanism module to obtain target attention information;
[0070] A feature extraction submodule, used to extract features of the target attention information using the feature extraction module to obtain target features;
[0071] The pest identification submodule is used to identify pests and diseases on the target features using the pest identification module to obtain the target pest and disease identification result.
[0072] In a specific implementation of the embodiment of the present application, the attention mechanism processing submodule may include:
[0073] a channel attention mechanism processing unit, configured to perform channel attention mechanism processing on the target crop image using the integrated channel attention module to obtain channel attention information;
[0074] A global attention mechanism processing unit, used to perform global attention mechanism processing on the channel attention information using the global attention module to obtain global attention information;
[0075] The channel attention mechanism processing and residual connection unit is used to use the residual block channel attention module to perform channel attention mechanism processing and residual connection on the global attention information to obtain the target attention information.
[0076] In a specific implementation of the embodiment of the present application, the pest identification device may further include:
[0077] A sample set construction module is used to construct a training sample set; wherein the training sample set includes a preset number of training samples, each training sample includes a training image to be identified and a corresponding marked pest result;
[0078] The model training module is used to train the initial artificial intelligence model with the training image to be identified of each training sample in the training sample set as input and the marked pest and disease result corresponding to each training sample in the training sample set as output to obtain the pest and disease identification model.
[0079] In a specific implementation of the embodiment of the present application, the sample set construction module may include:
[0080] A training image acquisition submodule is used to acquire a preset number of training images to be identified;
[0081] An image preprocessing submodule is used to perform image preprocessing on each training image to be identified, so as to obtain each training image to be identified after image preprocessing;
[0082] The pest and disease marking submodule is used to mark the pest and disease results of each training image to be identified after image preprocessing according to a preset pest and disease marking strategy, and obtain the marked pest and disease results corresponding to each training image to be identified.
[0083] In a specific implementation of the embodiment of the present application, the pest and disease marking submodule may include:
[0084] A marking unit is used to mark the pest areas one by one if there are pests and diseases in the target training image to be identified and the pest and disease area is larger than a preset area threshold; wherein the target training image to be identified is any one of the training images to be identified;
[0085] The unified marking unit is used to uniformly mark the pest area if there is pest in the target training image to be identified and the pest area is less than or equal to the area threshold.
[0086] In a specific implementation of the embodiment of the present application, the pest identification device may further include:
[0087] The result processing module is used to process the result according to the target pest and disease identification result.
[0088] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0090] Figure 4 A schematic block diagram of a terminal device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0091] like Figure 4 As shown, the terminal device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, the steps in the above-mentioned various pest identification method embodiments are implemented, for example Figure 2 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 The functions of modules 301 to 302 are shown.
[0092] Exemplarily, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4.
[0093] Those skilled in the art will understand that Figure 4 It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 4 may also include input and output devices, network access devices, buses, etc.
[0094] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0095] The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store the computer program and other programs and data required by the terminal device 4. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0096] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0097] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0099] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0102] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0103] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for identifying pests and diseases, characterized in that: include: Acquire a target crop image to be identified; The target crop image is subjected to pest and disease identification using a preset pest and disease identification model to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module.
2. The pest identification method according to claim 1, characterized in that: The pest identification model also includes a preset feature extraction module and a pest identification module; The method of using a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result includes: Using the integrated attention mechanism module to perform attention mechanism processing on the target crop image to obtain target attention information; Using the feature extraction module to extract features from the target attention information to obtain target features; The pest identification module is used to identify pests and diseases on the target features to obtain the target pest and disease identification result.
3. The pest identification method according to claim 2, characterized in that: The integrated attention mechanism module includes an integrated channel attention module, a global attention module and a residual block channel attention module; The using the integrated attention mechanism module to perform attention mechanism processing on the target crop image to obtain target attention information includes: Using the integrated channel attention module to perform channel attention mechanism processing on the target crop image to obtain channel attention information; Using the global attention module to process the channel attention information through a global attention mechanism to obtain global attention information; The residual block channel attention module is used to perform channel attention mechanism processing and residual connection on the global attention information to obtain the target attention information.
4. The pest identification method according to claim 1, characterized in that: The training process of the pest and disease identification model includes: Constructing a training sample set; wherein the training sample set includes a preset number of training samples, each training sample includes a training image to be identified and a corresponding marked pest result; Taking the training image to be identified of each training sample in the training sample set as input and the labeled pest result corresponding to each training sample in the training sample set as output, the initial artificial intelligence model is trained to obtain the pest identification model.
5. The pest identification method according to claim 4, characterized in that: The step of constructing a training sample set includes: Obtaining a preset number of training images to be recognized; Performing image preprocessing on each training image to be identified to obtain each training image to be identified after image preprocessing; According to the preset pest and disease marking strategy, each training image to be identified after image preprocessing is marked with pest and disease results to obtain the marked pest and disease results corresponding to each training image to be identified.
6. The pest identification method according to claim 5, characterized in that: The method of marking the pests and diseases results for each training image to be identified after image preprocessing according to the preset pest and disease marking strategy, and obtaining the marked pest and disease results corresponding to each training image to be identified, includes: If there are pests and diseases in the target training image to be identified, and the pest and disease area is larger than a preset area threshold, the pest and disease areas are marked one by one; wherein the target training image to be identified is any one of the training images to be identified; If pests and diseases exist in the target training image to be identified, and the pest and disease area is less than or equal to the area threshold, the pest and disease area is uniformly marked.
7. The method for identifying pests and diseases according to any one of claims 1 to 6, characterized in that: After the target crop image is subjected to pest and disease identification using the preset pest and disease identification model to obtain a target pest and disease identification result, the method further includes: The result processing is performed according to the target pest and disease identification result.
8. A pest identification device, characterized in that: include: A crop image acquisition module, used to acquire a target crop image to be identified; A pest and disease identification module is used to use a preset pest and disease identification model to identify pests and diseases on the target crop image to obtain a target pest and disease identification result; wherein the pest and disease identification model is a pre-trained artificial intelligence model for pest and disease identification, and the pest and disease identification model includes a preset integrated attention mechanism module.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the pest identification method according to any one of claims 1 to 7 are implemented.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the pest identification method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Monocular unsupervised depth estimation method based on CBAM
CN112950697A
Image feature extraction model training method and device, server and storage medium
CN114119997A
Improved corn leaf disease and insect pest automatic detection method based on YOLO model
CN116310836A
Pepper disease and insect pest identification method and system for field scene
CN116883838A
Image recognition model training method, image recognition method and device
CN117496300A
