Leaf disease identification method and device, electronic equipment and storage medium

Through the combination method of using the inverted residual structural feature extraction module and the characteristics of the characteristic fusion module to converge the coupling detection head in Apple blade disease recognition, it solves the problem of inaccurate artificial recognition and inconvenience of the model in mobile terminals. Accurate leaf disease recognition and lightweight model application.

CN119380184APending Publication Date: 2025-01-28WUHAN BJC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411403318.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the prior art, it is impossible to accurately identify apple leaf diseases manually, and the existing machine learning models are inconvenient to use in mobile terminals.

Method used

Adopt the feature diagram of the image withdrawal module with the characteristics of the inverted residual structure, and the characteristic chart is combined by combining the characteristic fusion module of the channel attention and spatial attention mechanism through the combination of the channel attention mechanism and the spatial attention mechanism. The detection head predicts the feature fusion diagram to determine the location and category of leaf disease.

Benefits of technology

The rapid and accurate identification of apple leaves on the mobile terminal is achieved, the accuracy of artificial identification is avoided, and the neural network model is lightly improved to facilitate fruit farmers' operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380184A_ABST
    Figure CN119380184A_ABST
Patent Text Reader

Abstract

The invention provides a leaf disease recognition method and device, electronic equipment and a storage medium, and belongs to the technical field of image recognition, and the method comprises the steps: employing a feature extraction module with an inverse residual structure to extract a feature map of a to-be-recognized leaf image; fusing the feature maps through a feature fusion module combining a channel attention mechanism and a space attention mechanism to obtain a feature fusion map; and adopting a decoupling detection head to predict the feature fusion image, and determining a leaf disease position and a leaf disease category in the to-be-identified leaf image. According to the method, the diseases in the plant leaves are identified in a machine learning mode, the problem of accurate disease identification caused by manual identification is avoided, and the inverse residual feature extraction module is adopted, so that a neural network model can be lightened, the model can be conveniently configured to a mobile terminal for use, and operation of fruit farmers is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a leaf disease recognition method, device, electronic equipment and storage medium. Background Art

[0002] As an important fruit crop in my country, apple production has always ranked first in the world. However, during its growth, apples are often invaded by various diseases such as brown spot, alternaria leaf spot, gray spot, bacterial wilt, and scab. These diseases not only seriously endanger the yield and quality of apple fruits, but also lead to the increasingly prominent problem of apple production reduction. How to accurately and quickly identify apple diseases is of far-reaching and important significance for improving apple yield and quality and promoting the development of the apple industry.

[0003] At present, the prevention and control of apple tree leaf diseases and pests generally relies on traditional manual identification methods. However, farmers generally lack agricultural knowledge, and the number of agricultural experts and scientific researchers is relatively small. Therefore, there is a lack of professional guidance in the apple planting process, and fruit farmers can only rely on naked eye observation and past experience to identify apple diseases. However, there are many types of apple diseases, including more than ten types of leaf diseases. The characteristics of these diseases have a high degree of similarity, making manual identification very difficult; for existing machine detection algorithms, the backbone network uses a relatively complex network structure, which greatly increases the amount of calculation and slows down the detection speed. Therefore, such a large and complex model is difficult to be applied to mobile terminals, which is inconvenient for users to use.

[0004] It can be seen that the existing technology has technical problems that manual labor cannot accurately identify leaf diseases, and machine learning models are inconvenient to use on mobile terminals. Summary of the invention

[0005] In view of this, it is necessary to provide a leaf disease identification method, device, electronic device and storage medium to solve the technical problems in the prior art that manual labor cannot accurately identify leaf diseases and machine learning models are inconvenient to use in mobile terminals.

[0006] In order to solve the above technical problems, on the one hand, the present invention provides a leaf disease identification method, comprising: A feature extraction module with an inverse residual structure is used to extract a feature map of the leaf image to be identified; The feature maps are fused by a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; The decoupled detection head is used to predict the feature fusion image to determine the leaf disease position and leaf disease category in the leaf image to be identified.

[0007] As a possible implementation manner of the present invention, in this implementation manner, the feature extraction module with an inverse residual structure is used to extract a feature map of the leaf image to be identified, including: The first convolution module is used to perform channel expansion on the leaf image to be identified, and a channel expansion feature map is obtained; Using a depthwise separable convolution module to extract features from each of the channel extension feature maps to obtain a plurality of intermediate feature maps; The second convolution module is used to fuse the multiple intermediate feature maps to obtain a feature map of the leaf image to be identified.

[0008] As a possible implementation manner of the present invention, in this implementation manner, the feature map is fused by a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map, including: dividing the feature map into a first feature map and a second feature map; Using a channel attention mechanism module to perform channel attention learning on the first feature map, assigning a first weight to the first feature map to obtain a first weighted feature map, and using a spatial attention mechanism to assign a second weight to the second feature map to obtain a second weighted feature map; A channel shuffling operation is performed based on the first weight feature map and the second weight feature map to obtain a feature fusion map.

[0009] As a possible implementation manner of the present invention, in this implementation manner, the step of assigning a first weight to the first feature map using a channel attention mechanism module to obtain a first weighted feature map includes: Performing a global average pooling operation on each channel of the first feature map to obtain global information of the feature map; Using an activation function to compress the global information to obtain a first weight for each channel; Applying the first weight to the first feature map to obtain a first weighted feature map.

[0010] As a possible implementation manner of the present invention, in this implementation manner, the adopting of a spatial attention mechanism to assign a second weight to the second feature map to obtain a second weighted feature map includes: Grouping the second feature maps, and normalizing each group of feature maps; The normalized feature maps are transformed through the fully connected layer to obtain feature transformation maps; Using an activation function to compress the feature transformation map to obtain a second weight of each feature change map; The second weight is applied to the second feature map to obtain a second weighted feature map.

[0011] As a possible implementation mode of the present invention, in this implementation mode, the use of a decoupled detection head to predict the feature fusion map to determine the leaf disease position and leaf disease category in the leaf image to be identified includes: Using a classification detection head to determine the category of the leaf disease in the leaf image to be identified; A regression detection head is used to determine the location of leaf diseases in the leaf image to be identified.

[0012] As a possible implementation manner of the present invention, in this implementation manner, the step of using a regression detection head to determine the leaf disease position in the leaf image to be identified includes: The regression loss function value of the feature fusion graph is calculated by using a regression loss function combined with a gradient gain allocation mechanism; The leaf disease position in the leaf image to be identified is determined based on the regression loss function value.

[0013] On the other hand, the present invention also provides a leaf disease identification device, comprising: A feature map extraction module, used for extracting a feature map of a leaf image to be identified by using a feature extraction module with an inverse residual structure; A feature fusion module, used for fusing the feature maps through a feature fusion module combining a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; The disease recognition module is used to predict the feature fusion image using a decoupled detection head to determine the leaf disease position and leaf disease category in the leaf image to be identified.

[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the leaf disease identification method described in any of the above implementations.

[0015] On the other hand, the present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the leaf disease identification method described in any of the above-mentioned implementations.

[0016] The beneficial effects of the present invention are as follows: the leaf disease identification method provided by the present invention extracts the feature map of the leaf image to be identified by using a feature extraction module with an inverted residual structure, and fuses the feature map by a feature fusion module combining a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map, and then uses a decoupling detection head to predict the feature fusion map to determine the leaf disease position and leaf disease category in the leaf image to be identified. Diseases in plant leaves are identified by machine learning to avoid the problem of accurate disease identification caused by manual identification, and the inverted residual feature extraction module can be used to lighten the neural network model, making it easy to configure the model to a mobile terminal for use, which is convenient for fruit farmers to operate. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A schematic diagram of a flow chart of a leaf disease identification method provided by an embodiment of the present invention; Figure 2 A flowchart of a possible implementation method of S101 provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of the inverted residual structure provided by an embodiment of the present invention; Figure 4 A flowchart of a possible implementation method of S102 provided in an embodiment of the present invention; Figure 5 A structural schematic diagram of a feature fusion module provided in an embodiment of the present invention; Figure 6 A flowchart of a possible implementation method of S402 provided in an embodiment of the present invention; Figure 7 A flowchart of another possible implementation method of S402 provided in an embodiment of the present invention; Figure 8 A flowchart of a possible implementation method of S103 provided in an embodiment of the present invention; Fig. 9 A flowchart of a possible implementation method of S802 provided in an embodiment of the present invention; Fig.10 A schematic diagram of the structure of a leaf disease identification device provided by an embodiment of the present invention; Fig.11A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0020] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0021] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0022] The present invention provides a leaf disease identification method, device, electronic device and storage medium, which are respectively described below.

[0023] Figure 1 A schematic flow chart of an embodiment of the leaf disease identification method provided by the present invention is as follows: Figure 1 As shown, leaf disease identification methods include: S101, extracting a feature map of the leaf image to be identified using a feature extraction module with an inverse residual structure; S102, fusing the feature map through a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; S103, using a decoupled detection head to predict the feature fusion image, and determining the leaf disease position and leaf disease category in the leaf image to be identified.

[0024] The leaf disease identification method provided in the embodiment of the present invention can be used to identify diseases of apple tree leaves, and a machine recognition algorithm is used to automatically identify the types of leaf diseases that may exist in the apple tree leaf image and the locations where the leaf diseases appear. In the embodiment of the present invention, an improved algorithm based on the YOLOv8s algorithm is provided, which performs lightweight optimization on the backbone network of the YOLOv8s algorithm, simplifies the network structure, greatly reduces the number of model parameters and the amount of calculation, adds a channel space attention mechanism module, and replaces the loss function, so that leaf diseases can be identified more accurately.

[0025] In an embodiment of the present invention, the leaf image to be identified refers to a leaf image of an apple tree collected in advance, wherein the leaf image to be identified should include at least one possible leaf disease feature, such as brown spot disease, alternaria leaf spot disease, gray spot disease, bacterial wilt disease, scab disease, etc. In an embodiment of the present invention, a feature extraction module with an inverted residual structure is used to extract a feature map of the leaf image to be identified, wherein, for a leaf image to be identified, multiple feature maps will be obtained after feature extraction, and then a feature fusion module combining a channel attention mechanism and a spatial attention mechanism is used to fuse the multiple feature maps to obtain a feature fusion map. The spatial attention mechanism generally generates an attention map of the same size as the input feature map through a convolution layer. The pixel value of the attention map indicates the importance of the corresponding position, and the spatial attention will pay more attention to the local area of ​​the image. Then, a decoupled detection head is used to predict the feature fusion map to determine the leaf disease position and leaf disease category in the leaf image to be identified. The decoupled detection head refers to decoupling the recognition task of the leaf image to be identified into a regression task and a classification task, thereby identifying the types of leaf diseases and the positions of leaf diseases that may exist in the leaf image to be identified.

[0026] The leaf disease identification method provided by the present invention extracts the feature map of the leaf image to be identified by using a feature extraction module with an inverted residual structure, and fuses the feature map by a feature fusion module combining a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map, and then uses a decoupling detection head to predict the feature fusion map to determine the leaf disease position and leaf disease category in the leaf image to be identified. The disease in the plant leaf is identified by machine learning to avoid the problem of accurate disease identification caused by manual identification, and the inverted residual feature extraction module can be used to lighten the neural network model, which is convenient for configuring the model to a mobile terminal for use, and is convenient for fruit farmers to operate.

[0027] As a possible implementation mode of the present invention, in this implementation mode, Figure 2 As shown, a feature extraction module with an inverse residual structure is used to extract a feature map of the leaf image to be identified, including: S201, using a first convolution module to perform channel expansion on the leaf image to be identified, to obtain a channel expansion feature map; S202, using a depthwise separable convolution module to extract features from the dilated feature maps of each channel to obtain multiple intermediate feature maps; S203, using a second convolution module to fuse multiple intermediate feature maps to obtain a feature map of the leaf image to be identified.

[0028] In the embodiment of the present invention, Figure 3 As shown, it is a structural schematic diagram of a feature extraction module with an inverse residual structure provided by an embodiment of the present invention, the feature extraction module includes two 1x1 convolution modules and a 3x3 depth-separable convolution module. For the leaf image to be identified that needs to be feature extracted, a 1x1 first convolution module is first used to perform channel expansion on the leaf image to be identified to obtain multiple channel-expanded feature maps, and then a 3x3 depth-separable convolution module is used to perform feature extraction on each channel-expanded feature map to obtain multiple intermediate feature maps, and then a 1x1 second convolution module is used to fuse the multiple intermediate feature maps to reduce the number of channels and obtain the feature map of the leaf image to be identified.

[0029] The feature extraction module with an inverted residual structure provided by the embodiment of the present invention effectively reduces the overall computing requirements by expanding first and then compressing, and is more suitable for building a lightweight deep learning model and using the model on a mobile terminal.

[0030] As a possible implementation mode of the present invention, in this implementation mode, Figure 4 As shown, the feature map is fused by a feature fusion module that combines the channel attention mechanism and the spatial attention mechanism to obtain a feature fusion map, including: S401, dividing the feature map into a first feature map and a second feature map; S402, using a channel attention mechanism module to perform channel attention learning on the first feature map, assigning a first weight to the first feature map to obtain a first weighted feature map, and using a spatial attention mechanism to assign a second weight to the second feature map to obtain a second weighted feature map; S403, performing a channel shuffling operation based on the first weighted feature map and the second weighted feature map to obtain a feature fusion map.

[0031] In an embodiment of the present invention, when a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism fuses feature maps, it is necessary to first group the feature maps, group the multiple feature maps obtained in the aforementioned embodiment, and obtain multiple first feature maps and multiple second feature maps. For the first feature map and the second feature map, the channel attention mechanism module and the spatial attention mechanism module are respectively used to extract features of the spatial dimension and the channel dimension, and then different features are summarized and fused to obtain a feature fusion map.

[0032] In an embodiment of the present invention, when the channel attention mechanism module extracts the channel dimension features of the first feature map, the channel attention mechanism module assigns a first weight to the first feature map to obtain a first weight feature map, and the first weight is used to indicate the channel dimension features of the feature map; when the spatial attention mechanism module extracts the spatial dimension features of the second feature map, the spatial attention mechanism module assigns a second weight to the second feature map to obtain a second weight feature map, and the second weight is used to indicate the spatial dimension features of the feature map.

[0033] In the embodiment of the present invention, the multiple feature maps obtained in the above embodiment are first Grouping, get ,in, is the Gth feature map, The dimension obtained in the above embodiment is The collection of all feature maps of , in the feature fusion stage, such as Figure 5 As shown, It is split into two branches, one branch explores the interaction between channels and forms a channel-based attention feature map. The other branch focuses on mining spatial relationships and creates a space-based attention feature map, namely the first weight feature map and the second weight feature map.

[0034] In an embodiment of the present invention, due to the existence of grouped convolution, the features between the first weighted feature map and the second weighted feature map cannot be interactively fused. Therefore, a channel shuffling operation can be performed on the first weighted feature map and the second weighted feature map to obtain a feature fusion map, so as to eliminate the side effect of the grouped convolution features being unable to interactively fuse and improve the accuracy of feature extraction.

[0035] As a possible implementation mode of the present invention, in this implementation mode, Figure 6 As shown, a channel attention mechanism module is used to assign a first weight to the first feature map to obtain a first weighted feature map, including: S601, performing a global average pooling operation on each channel of the first feature map to obtain global information of the feature map; S602, compressing the global information using an activation function to obtain a first weight for each channel; S603: Apply the first weight to the first feature map to obtain a first weighted feature map.

[0036] In the embodiment of the present invention, for the channel attention mechanism module, the average value of each channel in the feature map is first embedded into the global information through a global average pooling operation. This process compresses the spatial information H×W of each channel, thereby realizing the dimensionality reduction from two-dimensional spatial information to global information, as shown in formula (1): (1) in, is the global average pooling feature map after compression of the first feature map, W and H are the width and height of the feature map, is the first feature map i , j Characteristics of dimensional channels.

[0037] Then, the activation function is used to process the global information and generate a concise feature representation. In this process, the activation function compresses each element of the global information to a value between 0 and 1. This operation generates a set of weights, namely the first weights, which describe the importance of each channel relative to other channels. When the first weights are applied to the original feature map, the model will give more attention to channels with higher weights, thereby amplifying their influence in subsequent processing and reducing the influence of channels with lower weights. Specifically, as shown in formula (2): (2) in, is the first weight feature map, is the first weight, is the first bias.

[0038] The embodiment of the present invention strengthens the model's attention to the features of channels with higher weights by integrating the attention mechanism module, thereby improving the model's recognition ability.

[0039] As a possible implementation mode of the present invention, in this implementation mode, Figure 7 As shown, a second weight feature map is obtained by assigning a second weight to the second feature map using a spatial attention mechanism, including: S701, grouping the second feature maps, and normalizing each group of feature maps; S702, transforming the normalized multiple feature maps through a fully connected layer to obtain a feature transformation map; S703, compressing the feature transformation map using an activation function to obtain a second weight of each feature change map; S704: Apply the second weight to the second feature map to obtain a second weighted feature map.

[0040] In the embodiment of the present invention, when the spatial attention mechanism module processes the second feature map, it is also necessary to group the second feature map, normalize each group of feature maps, transform the normalized feature map through a fully connected layer with weights and biases, and determine the correlation between different spatial regions. Then, an activation function is used to determine a weight matrix to represent the importance of each spatial position. Then, the weight matrix is ​​applied to the original feature map to obtain a second weighted feature map, as shown in formula (3): (3) in, is the second weight feature map, is the second weight, is the second bias, and GN is the normalization operation.

[0041] The embodiment of the present invention extracts the spatial dimension features of the feature map through the spatial attention mechanism module to improve the accuracy of model recognition.

[0042] As a possible implementation mode of the present invention, in this implementation mode, Figure 8 As shown in the figure, the decoupled detection head is used to predict the feature fusion map to determine the leaf disease location and leaf disease category in the leaf image to be identified, including: S801, using a classification detection head to determine the category of leaf diseases in the leaf image to be identified; S802, using a regression detection head to determine the location of leaf disease in the leaf image to be identified.

[0043] In an embodiment of the present invention, the head of the model is divided into two independent parts, one for the classification task and the other for the regression task. Traditional target detection models usually use a single detection head to simultaneously process the category prediction and location determination of the target. This coupling method will cause mutual interference between tasks. In the embodiment of the present invention, by decoupling, the classification head focuses on identifying the category of the object, and the regression head is responsible for the spatial positioning of the object, such as position and size, allowing each head to specifically optimize its respective task, thereby achieving improvement in specialized performance.

[0044] As a possible implementation mode of the present invention, in this implementation mode, Fig. 9 As shown, a regression detection head is used to determine the location of leaf diseases in the leaf image to be identified, including: S901, using a regression loss function combined with a gradient gain allocation mechanism to calculate a regression loss function value of the feature fusion graph; S902: Determine the leaf disease position in the leaf image to be identified based on the regression loss function value.

[0045] In the embodiment of the present invention, when detecting apple leaf diseases, due to the imbalance of sample data, the reasonable use of loss function is very critical to improving the recognition ability of the model. The regression loss function combined with the gradient gain allocation mechanism provided in the embodiment of the present invention includes: (4) (5) (6) Among them, IOU represents the intersection-union ratio between the actual box and the predicted box, where A is the detection box and B is the actual box. is the first version of the loss function, is the classification loss, is the regression loss.

[0046] In the second version of the loss function, a monotone focusing coefficient is added to effectively reduce the weight of simple samples on the loss value, as shown in formula (7): (7) in, is the second version of the loss function, r is the gradient gain, Monotonic focusing coefficient.

[0047] In the third version of the loss function, the concept of outlier degree is added. The calculation formula is as follows: (8) (9) (10) in, is a weight term used to balance the effect of aspect ratio. is the activation function.

[0048] The embodiment of the present invention adopts the third version of the loss function, and by dynamically adjusting the loss weights of high-quality and low-quality anchor boxes, the model is encouraged to pay more balanced attention to samples of different quality levels. This method is particularly suitable for the field of disease detection. In the task of disease detection, there is usually the challenge of uneven image quality. For example, some images may have uneven quality due to different shooting angles, lighting conditions or disease development stages. This imbalance may cause the model to over-focus on high-quality samples during training and ignore those low-quality but equally important samples. The loss function of the embodiment of the present invention not only improves the sensitivity of the model when processing low-quality samples, but also helps to improve the overall accuracy of detection.

[0049] In order to better implement the leaf disease identification method in the embodiment of the present invention, based on the leaf disease identification method, correspondingly, Fig.10 As shown, the embodiment of the present invention further provides a blade disease identification device, and the blade disease identification device 1000 includes: A feature map extraction module 1001 is used to extract a feature map of a leaf image to be identified by using a feature extraction module with an inverse residual structure; A feature fusion module 1002 is used to fuse the feature map through a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; The disease identification module 1003 is used to predict the feature fusion image using a decoupled detection head to determine the leaf disease position and leaf disease category in the leaf image to be identified.

[0050] The leaf disease identification device 1000 provided in the above embodiment can implement the technical solution described in the above leaf disease identification method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above leaf disease identification method embodiment, which will not be repeated here.

[0051] The leaf disease identification device provided by the present invention extracts the feature map of the leaf image to be identified by using a feature extraction module with an inverted residual structure, and fuses the feature map by a feature fusion module combining a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map, and then uses a decoupling detection head to predict the feature fusion map to determine the leaf disease position and leaf disease category in the leaf image to be identified. The disease in the plant leaf is identified by machine learning to avoid the problem of accurate disease identification caused by manual identification, and the inverted residual feature extraction module can be used to lighten the neural network model, which is convenient for configuring the model to a mobile terminal for use, and is convenient for fruit farmers to operate.

[0052] like Fig.11 As shown, the present invention also provides an electronic device 1100. The electronic device 1100 includes a processor 1101, a memory 1102 and a display 1103. Fig.11 Only some components of the electronic device 1100 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0053] In some embodiments, the processor 1101 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run the program code or process data stored in the memory 1102, such as the leaf disease identification method of the present invention.

[0054] In some embodiments, the processor 1101 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 1101 may be local or remote. In some embodiments, the processor 1101 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0055] In some embodiments, the memory 1102 may be an internal storage unit of the electronic device 1100, such as a hard disk or memory of the electronic device 1100. In other embodiments, the memory 1102 may also be an external storage device of the electronic device 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 1100.

[0056] Furthermore, the memory 1102 may include both an internal storage unit of the electronic device 1100 and an external storage device. The memory 1102 is used to store application software installed in the electronic device 1100 and various data.

[0057] In some embodiments, the display 1103 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 1103 is used to display information of the electronic device 1100 and to display a visual user interface. The components 1101-1103 of the electronic device 1100 communicate with each other via a system bus.

[0058] In one embodiment, when the processor 1101 executes the leaf disease identification program in the memory 1102, the following steps may be implemented: A feature extraction module with an inverse residual structure is used to extract a feature map of the leaf image to be identified; The feature fusion module that combines the channel attention mechanism and the spatial attention mechanism is used to fuse the feature maps to obtain a feature fusion map. The decoupled detection head is used to predict the feature fusion image and determine the leaf disease location and leaf disease category in the leaf image to be identified.

[0059] It should be understood that: when the processor 1101 executes the leaf disease identification program in the memory 1102, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.

[0060] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 1100 mentioned, and the electronic device 1100 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 1100 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0061] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions of the leaf disease identification method provided in the above-mentioned method embodiments can be implemented.

[0062] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0063] The leaf disease identification method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A leaf disease identification method, characterized in that: include: A feature extraction module with an inverse residual structure is used to extract a feature map of the leaf image to be identified; The feature maps are fused by a feature fusion module that combines a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; The decoupled detection head is used to predict the feature fusion image to determine the leaf disease position and leaf disease category in the leaf image to be identified.

2. The leaf disease identification method according to claim 1, characterized in that: The feature extraction module with an inverse residual structure is used to extract the feature map of the leaf image to be identified, including: The first convolution module is used to perform channel expansion on the leaf image to be identified, and a channel expansion feature map is obtained; A depth-wise separable convolution module is used to extract features from the extended feature maps of each channel to obtain multiple intermediate feature maps; The second convolution module is used to fuse the multiple intermediate feature maps to obtain a feature map of the leaf image to be identified.

3. The leaf disease identification method according to claim 1, characterized in that: The feature fusion module combining the channel attention mechanism and the spatial attention mechanism is used to fuse the feature map to obtain a feature fusion map, including: dividing the feature map into a first feature map and a second feature map; Using a channel attention mechanism module to perform channel attention learning on the first feature map, assigning a first weight to the first feature map to obtain a first weighted feature map, and using a spatial attention mechanism to assign a second weight to the second feature map to obtain a second weighted feature map; A channel shuffling operation is performed based on the first weight feature map and the second weight feature map to obtain a feature fusion map.

4. The leaf disease identification method according to claim 3, characterized in that: The step of assigning a first weight to the first feature map using a channel attention mechanism module to obtain a first weighted feature map includes: Performing a global average pooling operation on each channel of the first feature map to obtain global information of the feature map; Using an activation function to compress the global information to obtain a first weight for each channel; Applying the first weight to the first feature map to obtain a first weighted feature map.

5. The leaf disease identification method according to claim 3, characterized in that: The step of assigning a second weight to the second feature map by using a spatial attention mechanism to obtain a second weighted feature map includes: Grouping the second feature maps, and normalizing each group of feature maps; The normalized feature maps are transformed through the fully connected layer to obtain feature transformation maps; Using an activation function to compress the feature transformation map to obtain a second weight of each feature change map; The second weight is applied to the second feature map to obtain a second weighted feature map.

6. The leaf disease identification method according to claim 1, characterized in that: The method of using a decoupling detection head to predict the feature fusion image and determining the leaf disease position and leaf disease category in the leaf image to be identified includes: Using a classification detection head to determine the category of the leaf disease in the leaf image to be identified; A regression detection head is used to determine the location of leaf diseases in the leaf image to be identified.

7. The leaf disease identification method according to claim 6, characterized in that: The step of using a regression detection head to determine the leaf disease position in the leaf image to be identified includes: The regression loss function value of the feature fusion graph is calculated by using a regression loss function combined with a gradient gain allocation mechanism; The leaf disease position in the leaf image to be identified is determined based on the regression loss function value.

8. A leaf disease identification device, characterized in that: include: A feature map extraction module, used for extracting a feature map of a leaf image to be identified by using a feature extraction module with an inverse residual structure; A feature fusion module, used for fusing the feature maps through a feature fusion module combining a channel attention mechanism and a spatial attention mechanism to obtain a feature fusion map; The disease recognition module is used to predict the feature fusion image using a decoupled detection head to determine the leaf disease position and leaf disease category in the leaf image to be identified.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the leaf disease identification method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the leaf disease identification method described in any one of claims 1 to 7.