Agricultural disease and insect pest accurate identification method based on diagonal loss
By designing a new bounding box similarity comparison metric and loss function, combined with a lightweight feature extraction module, the YOLOv7 network structure is improved, and the problem of low accuracy of agricultural pest recognition methods is solved, and more efficient pest detection is achieved.
Patent Information
- Application Number
- CN202411168178.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The existing agricultural pest and disease recognition methods have low accuracy, the traditional method relies on experts to experience in low efficiency and high cost, and the deep learning-based methods have high calculation costs and low accuracy. The existing bounding box regression loss function has the same effect under different prediction results. The value of the model reduces the convergence speed and accuracy, and is not completely suitable for the accurate identification of agricultural pests and diseases.
A precise identification method for agricultural pests and diseases based on diagonal loss was designed. By constructing agricultural pest data sets, a new loss was proposed by introducing a comparison measure of the difference between the predicted bounding box and the real bounding box diagonal difference ratio design bounding box similarity. Function LDDRIoU, combined with Focal-Loss idea, propose Focal-DDRIoU loss function; adjust the YOLOv7 network structure, remove the ELAN module, add the C3 module and MobileViTv3 module to form the APD-YOLOv7 network structure, which is used to improve the model's feature extraction ability and Detection accuracy.
It improves the accuracy and efficiency of agricultural pest detection, improves the performance of the model, solves the problem of low accuracy of existing methods, and achieves higher quality anchor box regression and more stable detection results.
Smart Images

Figure CN119049025A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural pest identification, and in particular to a method for accurately identifying agricultural pests and diseases based on diagonal loss. Background Art
[0002] Globally, agriculture plays a vital role in providing population health, maintaining social stability, and even protecting national security. Therefore, people have been demanding continuous innovation in agricultural technology, improving agricultural industry efficiency, and maximizing food production to feed the growing population. However, due to the large number of invasive organisms and microorganisms distributed in the planting environment, crops are increasingly vulnerable to pests and diseases. The invasion of pests and diseases seriously threatens agricultural production safety and the sustainable supply of food. Therefore, accurate identification of crop pests and diseases and effective early warning of pest and disease outbreaks can help prevent the occurrence of agricultural disasters and ensure the quality and yield of farmland.
[0003] However, most traditional pest and disease identification methods are diagnosed by agricultural experts, which rely on the subjective experience of experts, are inefficient, have large errors, and are costly. With the development of image processing technology, crop pest and disease identification methods based on machine learning have become possible. However, these methods still require manual feature extraction, which is cumbersome to operate, difficult to extract abstract features, and difficult to improve the accuracy to the level of practical application. Since then, with the development of graphics processing units (GPUs), deep learning technology that relies on powerful GPU processing power has developed rapidly and has been widely used in agricultural pest and disease identification. The application of deep learning technology to crop pest and disease identification has higher accuracy than traditional pest and disease identification and machine learning-based identification methods.
[0004] Although many studies have provided references and feasibility for using deep learning neural networks to identify agricultural pests and diseases, it is still challenging for existing deep learning models to solve problems such as high computational cost and low accuracy of agricultural pests and diseases.
[0005] Most state-of-the-art object detectors rely on a bounding box regression (BBR) module to determine the location of objects. Based on this paradigm, a well-designed loss function is crucial to the success of BBR. To date, most BBR-based loss functions fall into two categories: ln-norm-based loss functions and Intersection over Union (IoU)-based loss functions.
[0006] However, the existing BBR loss function sometimes has the same value under different prediction results, which reduces the convergence speed and accuracy of BBR. The existing BBR loss function is also not fully applicable to the accurate identification of agricultural pests and diseases. Summary of the invention
[0007] The purpose of the present invention is to provide a method for accurately identifying agricultural pests and diseases based on diagonal loss, aiming to solve the problem of low accuracy of existing agricultural pest and disease identification methods.
[0008] To achieve the above object, the present invention provides a method for accurately identifying agricultural pests and diseases based on diagonal loss, comprising the following steps:
[0009] Construct a dataset of agricultural pests and diseases;
[0010] Design a bounding box regression loss function based on bounding box similarity comparison metric;
[0011] Improve the network structure to obtain an improved network;
[0012] The improved network is trained using the bounding box regression loss function to obtain an agricultural pest detection model;
[0013] The agricultural pest and disease detection model is used to accurately identify crop pests and diseases.
[0014] Among them, in "Constructing an agricultural pest and disease dataset", the agricultural pest and disease dataset includes field photos, public datasets and Internet data. The field photos include Wogan canker and snow pea cabbage caterpillars; the public dataset includes Acridoidea insects and bean blister beetles; the Internet data includes grape black rot and grape leaf blight.
[0015] Among them, in "Designing a bounding box regression loss function based on bounding box similarity comparison measurement", it includes:
[0016] In the bounding box similarity comparison metric, the difference ratio of the diagonal of the predicted bounding box and the true bounding box is introduced to design the bounding box similarity comparison metric DDRIoU, and a new loss function L is obtained. DDRIoU ;
[0017] Using the traditional bounding box similarity comparison metric IoU to the loss function L DDRIoU Weighted, we get a new loss function L Focal-DDRIoU .
[0018] Among them, "improving the network structure to obtain an improved network" includes:
[0019] The two ELAN modules of the YOLOv7 network structure are removed, and the C3 module is added to supplement the feature extraction capability of the network;
[0020] A MobileViTv3 module is embedded between the remaining two ELAN modules to form a new APD-YOLOv7 network structure.
[0021] Among them, in "Improving the network structure to obtain an improved network", the C3 module is a key component in YOLOv5, which adopts a hierarchical structure to extract features, and connects low-level feature maps to high-level feature maps through a series of convolutional layers and bottleneck structures. The MobileViTv3 module is a lightweight model suitable for mobile vision tasks.
[0022] The invention discloses an accurate identification method of agricultural pests and diseases based on diagonal loss, comprising the following steps: constructing an agricultural pest and disease data set; designing a bounding box regression loss function based on a bounding box similarity comparison metric; improving a network structure to obtain an improved network; training the improved network using the bounding box regression loss function to obtain an agricultural pest and disease detection model; and accurately identifying crop pests and diseases using the agricultural pest and disease detection model. The invention constructs an agricultural pest and disease data set through field photography and web crawlers. The data set includes the more prominent problems in the current agricultural pest and disease data set. Secondly, with reference to the existing bounding box regression loss function, the geometric features of the predicted bounding box and the real bounding box in BBR are reconsidered. Combined with the characteristics of the agricultural pest and disease data set, a bounding box similarity comparison metric is proposed, and then combined with the Focal-Loss idea, the regression process is focused on high-quality anchor boxes. Based on the bounding box similarity comparison metric, a Focal-bounding box similarity comparison metric is designed. And the loss function of YOLOv7 is replaced by the Focal-bounding box similarity comparison metric from the CIoU loss. Finally, the network structure of YOLOV7 was adjusted, and the MobileViTv3 module was embedded in the 17th layer of the backbone. So far, a model for agricultural pest detection is proposed for the identification of crop pests and diseases in precision agriculture. The performance of the model was evaluated on the agricultural pest dataset. Experiments show that the Focal-bounding box similarity comparison metric is significantly better than other commonly used BBR losses. Secondly, the adjusted network structure is also better than the original YOLOv7 network structure. This model has superior performance in agricultural pest detection, thus solving the problem of low accuracy of existing agricultural pest identification methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 It is a commonly used boundary regression loss function.
[0025] Figure 2 This is the current status of the annotation of the agricultural pest and disease dataset, where (a) is citrus canker, (b) is grape black rot, (c) is snow pea cabbage caterpillar, (d) is Acridoidea insect, (e) is bean blister beetle, and (f) is grape leaf blight.
[0026] Figure 3 is the result of bounding box regression loss calculation, where (a) and (b) are two different cases.
[0027] Figure 4 It is the DDRIoU element.
[0028] Figure 5 It is the YOLOv7 network structure.
[0029] Figure 6 It is the structure of the MobileViTv3 module.
[0030] Figure 7 It is the APD-YOLOv7 network structure.
[0031] Figure 8 It is a flow chart of the method for accurately identifying agricultural pests and diseases based on diagonal loss provided by the present invention. DETAILED DESCRIPTION
[0032] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0033] See also Figures 1 to 8 The present invention provides a method for accurately identifying agricultural pests and diseases based on diagonal loss, comprising the following steps:
[0034] S1 builds agricultural pest and disease dataset;
[0035] The agricultural pest and disease dataset includes field photos, public datasets and Internet data. The field photos include Wogan canker and snow pea cabbage caterpillars; the public dataset includes Acridoidea insects and bean blister beetles; the Internet data includes grape black rot and grape leaf blight.
[0036] Specifically, a crop pest and disease dataset named FIP6Set was constructed. FIP6Set comes from three main sources: First, it comes from photos taken on the spot in Nanning, Guangxi Zhuang Autonomous Region, including Wogan canker and snow pea cabbage caterpillars; second, it comes from the public dataset IP102, including Acridoidea insects and bean blister beetles; third, it comes from the Internet, including grape black rot and grape leaf blight. According to the actual situation, these pictures were cleaned and high-quality pictures were included in the dataset. Then, under the guidance of agricultural experts, the pictures were annotated, and a new dataset FIP6Set was constructed.
[0037] At the same time, the more prominent problems in the current agricultural pest and disease datasets are taken into consideration. In terms of image selection, both Figure 2 (d) and (f) are complex lesions that are suitable for broad labeling. Figure 2 (a) This type of disease has simple lesions and is suitable for fine marking; Figure 2 (c) and (d) are insect pests with leaves that are close in color. Figure 2 (e) This pest is different from the leaf color.
[0038] According to the research, the minimum amount of image data for training is 150-500. Combined with the current agricultural pest and disease dataset, the number of images of each class in the dataset is controlled between 435-475, which ensures the consistency of the dataset and ensures that the training effect will not be affected by the number of datasets.
[0039] S2 designs the bounding box regression loss function based on the bounding box similarity comparison metric;
[0040] S21 introduces the difference ratio of the predicted bounding box and the true bounding box diagonal in the bounding box similarity comparison metric to design the bounding box similarity comparison metric DDRIoU, and obtains a new loss function L DDRIoU ;
[0041] Specifically,
[0042]
[0043] Among them, c gt is the length of the hypotenuse of the true bounding box, c pr is the length of the hypotenuse of the predicted bounding box. Therefore, the DDRIoU loss is defined as follows:
[0044]
[0045] The core part is the penalty item as follows:
[0046]
[0047] use Function, limiting the penalty term to:
[0048]
[0049] This helps stabilize the training process and prevents the loss value from being too large and causing the gradient to explode. Expression:
[0050]
[0051] It reflects the relative difference in scale between the predicted bounding box and the true bounding box, which is advantageous for some target detection tasks with large changes in scale (such as detecting objects of different sizes). Compared with the traditional loss function, using the square of the hypotenuse of the bounding box as a metric can improve the stability of the loss function. The square of the hypotenuse of the bounding box is not affected by the aspect ratio of the bounding box. The traditional metric based on aspect ratio (or aspect difference) may cause instability during training, especially in tasks that require frequent detection of larger and smaller objects. At the same time, it uses:
[0052]
[0053] As an expression:
[0054]
[0055] This not only avoids the instability of the training process that may be caused when the size of the true bounding box is too small, but also makes the loss function more affected by the change in the size of the predicted bounding box, thereby prompting the model to better adjust the size of the predicted bounding box to approach the true bounding box.
[0056] In this way, the features of CIoU are retained. At the same time, DDRIoU takes the predicted bounding box and the true bounding box into consideration, avoiding the problem that the predicted bounding box and the true bounding box have the same aspect ratio but different widths and heights and the same loss occurs.
[0057] S22 uses the traditional bounding box similarity comparison metric IoU to the loss function L DDRIoU Weighted, we get a new loss function L Focal-DDRIoU .
[0058] Specifically, in BBR, there is also the problem of unbalanced training examples, that is, due to the sparsity of target objects in images, the number of high-quality examples with small regression errors is far less than that of low-quality examples. Outliers will produce excessively large gradients, which is harmful to the training process. Therefore, it is crucial to let high-quality examples contribute more to training. Therefore, Focal-DDRIoU loss is proposed to improve the performance of DDRIoU loss.
[0059] The DDRIoU loss is weighted by the IoU value to obtain the Focal-DDRIoU loss. The loss function = DDRIoU loss = LDDRIoU = bounding box similarity measure = IoU, as shown in the formula:
[0060] L Focal-DDRIoU =IoU γ L DDRIoU
[0061] Where IOU = |A∩B| / |A∪B|, γ is a parameter that controls the degree of outlier suppression.
[0062] S3 improves the network structure to obtain an improved network;
[0063] The C3 module is a key component in YOLOv5, which uses a hierarchical structure to extract features and connects low-level feature maps to high-level feature maps through a series of convolutional layers and bottleneck structures. The MobileViTv3 module is a lightweight model suitable for mobile vision tasks.
[0064] S31 removes the two ELAN modules of the YOLOv7 network structure and adds a C3 module to supplement the feature extraction capability of the network;
[0065] Specifically, first, in the backbone part, two ELAN modules were removed, and a C3 module was added to supplement the network's feature extraction capabilities, introducing the C3 module and the MobileViTv3 module. The C3 module is a key component in YOLOv5. It uses a hierarchical structure to extract features, connecting low-level feature maps to high-level feature maps through a series of convolutional layers and bottleneck structures. This design enables the C3 module to better capture contextual information and perform better when dealing with complex backgrounds.
[0066] S32 embeds the MobileViTv3 module between the remaining two ELAN modules to form a new APD-YOLOv7 network structure.
[0067] Specifically, in order to further improve the performance of the model, a MobileViTv3 module is embedded between the remaining two ELAN modules. In the head part, the C3 module is used to replace all ELAN-W modules, thus forming a new APD-YOLOv7 network structure. MobileViT (MobileViTv1) is a lightweight model suitable for mobile vision tasks that combines convolutional neural networks (CNN) and vision transformers (ViTs). Figure 6As shown in the figure, the MobileViTv3 module fuses the features of the local representation block and the global representation block in the fusionblock, and uses 1X1 convolution, which can not only simplify the learning task, but also avoid a significant increase in parameters and FLOPs when scaling; in the local representation block, 3x3 depth-separable convolution is used to further reduce parameters; before the overall output of the module, the input features are added to the output of the fusion module, and the residual connection is used to improve the accuracy. The introduction of the MobileViTv3 module is conducive to reducing the number of model parameters and improving the model accuracy.
[0068] S4 uses the bounding box regression loss function to train the improved network to obtain an agricultural pest detection model;
[0069] Specifically, the YOLO v7 model is used for experiments, and the baseline results are obtained by training with the default CIoU loss of YOLOv7. Only the use of IoU loss is changed, that is, the YOLO v7 model is trained with GIoU, DIoU, CIoU, EIoU, DDRIoU and Focal-DDRIoU losses, so only the IoU loss of BBR needs to be replaced with L GIoU , L DIoU , L CIoU , L EIoU , L DDRIoU and L Focal-DDRIoU .
[0070]
[0071] Table 1: Five-fold cross validation method, using the default loss (L CIoU ), and L GIoU , L DIoU , L EIoU , L DDRIoU and L Focal-DDRIoU Performance comparison of training YOLOv7 models.
[0072] As shown in Table 1, in the FIP6Set dataset, the average of five experiments was taken using the five-fold cross-validation method. The performance of DDRIoU loss and Focal-DDRIoU loss was better than GIoU loss, DIoU loss, CIoU loss and EIoU loss. Taking the CIoU loss used by default in YOLOv7 as the benchmark, the mAP75 value of DDRIoU loss increased by 0.76%, and the Focal-DDRIoU loss increased by 1.04%.
[0073] This improvement is mainly attributed to the DDRIoU loss. When the predicted bounding box has the same aspect ratio as the true bounding box, but different widths and heights, other IoU loss functions will all get the same loss value. This limitation causes the model to be unable to effectively distinguish between these two different situations during the optimization process, thus affecting the detection accuracy. The DDRIoU loss solves this problem by introducing the difference ratio between the predicted bounding box and the true bounding box diagonal. This design allows the DDRIoU loss to more accurately reflect the actual difference between the predicted bounding box and the true bounding box, thereby guiding the model to optimize more effectively.
[0074] The superiority of DDRIoU loss is not only reflected in the improvement of model accuracy, but also in the fact that by introducing the concept of diagonal difference ratio, it can more delicately reflect the actual difference between the predicted bounding box and the true bounding box. This design helps the model improve the stability and consistency of the results when predicting, thereby reducing the variance of the prediction results.
[0075] Compared with DDRIoU loss, Focal-DDRIoU loss has a slightly increased variance, but its variance is still at a lower level. This result shows that by introducing the idea of Focal-Loss, the model can more effectively focus on samples that are difficult to classify during training, thereby improving performance without significantly increasing the instability of the results. Such a design helps the model perform more robustly and reliably in complex scenarios.
[0076] APD-YOLOv7 network structure (hereinafter referred to as APD network structure) is compared with YOLOv7 network structure. The experimental steps are as follows:
[0077] ① Only change the use of IoU loss, that is, use GIoU loss, DIoU loss, CIoU loss, EIoU loss and Foacl-DDRIoU loss to train the YOLO v7 model respectively, and test the performance of the original network structure of YOLOv7;
[0078] ②Replace the original network structure of the YOLOv7 model with the APD network structure;
[0079] ③Repeat step ①, change the loss function, and test the performance of the APD network structure.
[0080]
[0081] Table 2 uses L GIoU , L DIoU , L CIoU , L EIoU and L Focal-DDRIoU Performance comparison of trained YOLOv7 network structure and APD network structure
[0082]
[0083]
[0084] Table 3 Comparison of YOLOv7 network structure and APD network structure parameters (batch = 1)
[0085] As shown in Table 2, under the same IoU loss, the APD network structure performs better than the YOLOv7 network structure. After replacing the YOLOv7 network structure with the APD network structure, experiments were conducted using GIoU loss, DIoU loss, CIoU loss, EIoU loss, and Foacl-DDRIoU loss, and mAP75 increased by 0.68%, 0.68%, 0.78%, 0.6%, and 0.56%, respectively. In general, under the same circumstances, using Foacl-DDRIoU loss and APD-YOLOv7 network structure for training, compared with using EIoU loss and YOLOv7 network structure for training, the former increased mAP75 by 2.06%.
[0086] As shown in Table 3, compared with the YOLOv7 network structure, the parameter size of the APD network structure is reduced by 3.9MB, and the GigaFloating-point Operations Per Second (GFLOPs) is reduced by 9.74%, reducing the number of parameters and computational burden of the model.
[0087] The performance of other widely used object detection models is evaluated on the FIP6Set dataset.
[0088]
[0089] Table 4 Performance comparison of APD-YOLOv7 and other target detection models
[0090] As shown in Table 4, in terms of model detection accuracy, the APD-YOLOv7 model outlined in the present invention is significantly better than the YOLOv7 and YOLOv5-L models, and its mAP 75 index is 1.86% and 1.6% higher than the YOLOv5-L and YOLOv7 models, respectively, and the model parameters are reduced by 13.5MB and 3.9MB, respectively. In terms of model detection speed, the APD-YOLOv7 model has a single image inference time of 10.8ms. Although the inference time has increased compared with the YOLOv7 and YOLOv5-L models, it still meets the standard for rapid identification of agricultural pests and diseases.
[0091] This is mainly due to the improvement of the YOLOv7 network structure. The network structure of YOLOv7 was adjusted, relatively redundant modules were removed, the C3 module was appropriately supplemented, and the MobileViTv3 module was embedded. This successfully reduced the number of model parameters and computational complexity, and further improved the accuracy of the model.
[0092] Although the inference time for a single image is relatively increased, in the identification of agricultural pests and diseases, strict real-time performance is usually not required. As long as the identification results can be given within a few seconds, it is sufficient for most application scenarios, so it still meets the needs of rapid identification of agricultural pests and diseases.
[0093] S5 uses the agricultural pest and disease detection model to accurately identify crop pests and diseases.
[0094] Specifically, the agricultural pest and disease detection model is used to accurately identify crop pests and diseases.
[0095] This paper first studies and designs a new loss function, Focal-DDRIoU loss, which improves the efficiency and accuracy of BBR.
[0096] Then, the network structure of YOLOv7 was adjusted and the C3 and MobileViTv3 modules were introduced. The MobileViTv3 module was embedded in the 17th layer of the backbone, which reduced the computational complexity, parameter quantity, and floating-point operation amount of the model, and further improved the recognition accuracy of the model.
[0097] The present invention uses mAP75 as the evaluation indicator and performs performance evaluation on the FIP6Set dataset. Experiments show that the APD-YOLOv7 model is 1.6% and 1.86% higher than mainstream models such as YOLOv7 and YOLOv5-L, respectively. In addition, the Focal-DDRIoU loss proposed in the present invention also outperforms the mainstream GIoU loss, DIoU loss, CIoU loss, and EIoU loss, which are 1.12%, 1.24%, 1.04%, and 1.5%, respectively. Although the single-image inference time of the APD-YOLOv7 model increases, it still meets the needs of rapid identification of agricultural pests and diseases.
[0098] Figure 3 Medium GIOU L represents the loss value: that is, L GIOU is the loss value of GIoU, L DIOU is the loss value of DIoU, and so on. CIOU is the loss value of CIoU. EIOU is the loss value of EIoU. DDRIOU is the loss value of DDRIoU.
[0099] Figure 5 It is the network structure of YOLOv7, where input is input and output is output.
[0100] CBS convolution batch normalization activation layer; ELAN efficient long-distance attention network: MPconv multi-scale convolution operation; SPPCSPC pooling layer; Upsample upsampling layer; Concat splicing layer; ELAN-W efficient long-distance attention network variant: it is very similar to the ELAN module. REPconv re-parameterization layer: Backbone backbone network. Head: detection head, representing the head of the network structure.
[0101] Figure 6 In the figure: C is the number of channels of the image, H is the height of the image, and W is the width of the image; LocalRepresentationblock is the local representation module. conv-1x1 is a 1x1 convolution operation, DWconv-3x3 is a 3x3 depth-separable convolution operation; Global Representation block is the global representation module. LinearTransfomersx N is N Transformer layers with linear properties. Transformer is a neural network model based on the self-attention mechanism. There is currently no official or widely recognized Chinese translation for Transformer. Fusionblock is a fusion module used to fuse the local representation module and the global representation module. conv-1x1 is a 1x1 convolution operation
[0102] Figure 7 MobileViTBv3 is a lightweight module that combines convolutional neural networks (CNN) and vision transformers for mobile vision tasks. It should be translated as the third generation mobile vision transformer model (but there is currently no official or widely recognized Chinese translation) C3 module: a cross-stage partial bottleneck structure module containing 3 convolutional layers. The rest of the same Figure 5 Input is input, output is output. CBS convolution batch normalization activation layer; ELAN efficient long-distance attention network: MPconv multi-scale convolution operation; SPPCSPC pooling layer: Concat splicing layer; Upsample upsampling layer. REPconv re-parameterization layer: Backbone backbone network. Head: detection head, representing the head of the network structure.
[0103] Beneficial effects:
[0104] (1) In order to solve the problem that the existing BBR loss function has the same value under different prediction results, a new BBR loss function, Diagonal Difference Ratio IoU (DDRIoU), is designed. DDRIoU is used as a new metric to compare the similarity between the predicted bounding box and the true bounding box in the BBR process.
[0105] (2) Considering the imbalance between high-quality and low-quality anchor boxes in BBR, a regression version of the focused loss, Focal-DDRIoU loss, is designed based on the DDRIoU loss and combined with the Focal-Loss idea to enhance the contribution of high-quality anchor boxes in model optimization while suppressing irrelevant anchor boxes.
[0106] (3) The network structure of YOLOv7 was adjusted, and the MobileViTv3 module was introduced. The new network structure reduces the number of model parameters and computational complexity, enhances the network's feature extraction and fusion capabilities, and further improves the accuracy of the model.
[0107] What is disclosed above is only a preferred embodiment of the method for accurately identifying agricultural pests and diseases based on diagonal loss of the present invention. Of course, this cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A precise identification method of agricultural pests and diseases based on diagonal loss, characterized in that: The following steps are involved: Construct a dataset of agricultural pests and diseases; Design a bounding box regression loss function based on bounding box similarity comparison metric; Improve the network structure to obtain an improved network; The improved network is trained using the bounding box regression loss function to obtain an agricultural pest detection model; The agricultural pest and disease detection model is used to accurately identify crop pests and diseases.
2. The method for accurately identifying agricultural pests and diseases based on diagonal loss according to claim 1, characterized in that: In "Constructing an Agricultural Pest and Disease Dataset", the agricultural pest and disease dataset includes field photos, public datasets and Internet data. The field photos include Wogan canker and snow pea cabbage caterpillars; the public datasets include Acridoidea insects and bean blister beetles; the Internet data include grape black rot and grape leaf blight.
3. The method for accurately identifying agricultural pests and diseases based on diagonal loss according to claim 1, characterized in that: In "Designing a Bounding Box Regression Loss Function Based on Bounding Box Similarity Comparison Metric", include: In the bounding box similarity comparison metric, the difference ratio of the diagonal of the predicted bounding box and the true bounding box is introduced to design the bounding box similarity comparison metric DDRIoU, and a new loss function L is obtained. DDRIoU ; Using the traditional bounding box similarity comparison metric IoU to the loss function L DDRIoU Weighted, we get a new loss function L Focal-DDRIoU .
4. The method for accurately identifying agricultural pests and diseases based on diagonal loss according to claim 1, characterized in that: In "improving the network structure to obtain an improved network", it includes: The two ELAN modules of the YOLOv7 network structure are removed, and the C3 module is added to supplement the feature extraction capability of the network; A MobileViTv3 module is embedded between the remaining two ELAN modules to form a new APD-YOLOv7 network structure.
5. The method for accurately identifying agricultural pests and diseases based on diagonal loss according to claim 4, characterized in that: In "Improving the network structure to obtain an improved network", the C3 module is a key component in YOLOv5, which uses a hierarchical structure to extract features and connects low-level feature maps to high-level feature maps through a series of convolutional layers and bottleneck structures. The MobileViTv3 module is a lightweight model suitable for mobile vision tasks.
Citation Information
Patent Citations
End-to-end lightweight deep license plate recognition method
CN111401361A
Remote sensing image target detection method and system and terminal equipment
CN111860398A
Infrared image weak and small target detection method based on improved YOLO v3
CN112101434A
Roadside construction behavior detection method based on improved YOLOv5 model
CN115359392A
Agricultural pest identification method based on improved YOLOv5
CN117456257A
