An agricultural pest image detection method based on C3M-Yolov5s

By improving the Yolov5 model to C3M-Yolov5s and combining MobileNetV3 and the Bottleneck architecture, the problem of insufficient accuracy in existing pest detection is solved, achieving higher detection accuracy and faster inference speed, making it suitable for agricultural pest detection.

CN115578642BActive Publication Date: 2026-01-06CHANGCHUN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211461266.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2026-01-06
Estimated Expiration
2042-11-18

AI Technical Summary

Technical Problem

Existing deep learning algorithms for agricultural pest detection suffer from insufficient detection accuracy and require improvement in real-time performance. In particular, two-stage detection models perform poorly when detecting small targets, while one-stage detection models have low accuracy.

Method used

An agricultural pest image detection method based on C3M-Yolov5s is adopted. By replacing the standard convolutional module of Yolov5 with the MConv module of MobileNetV3 and combining it with the MBottleneck module of the Bottleneck structure, a C3M module is constructed to enhance the deep learning capability of the network and improve the image feature processing capability of the Neck part.

Benefits of technology

It improves the accuracy of pest detection and the inference speed of the model, enhances the confidence of multi-target and single-target detection, and reduces the number of model parameters and training time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578642B_ABST
    Figure CN115578642B_ABST
Patent Text Reader

Abstract

The application provides an agricultural pest image detection method based on C3M-Yolov5s, which comprises the following steps: first, in order to reduce the parameter quantity and calculation cost of the original model while extracting image features by convolution, that is, to accelerate the convergence speed of the network, the original model Yolov5 standard convolution Conv module is replaced with the convolution module proposed in MobileNetV3; second, a bottleneck convolution module of MBottleneck is built based on the structure of Bottleneck, which is more flexible when extracting image features under the condition of ensuring a low parameter quantity, and the features extracted after scaling the convolution kernel size are more specific; third, C3M is built by using MConv and MBottleneck to learn from the staggered structure, wherein the staggered structure can effectively avoid the disadvantages of gradient disappearance and reasonably deepen the number of network layers, which can further improve the feature acquisition capability of the model; fourth, the experiment is set based on the public agricultural pest data set IP102, and the C3M module is used to replace the C3 of the original model Neck to improve the receiving capacity of the model Neck for the image features submitted by the main stem, and the results show that the convergence speed of the improved model remains consistent with the mAP index of the original model under the same configuration of training parameters, and the AP50 index and the model convergence speed are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural image detection. Specifically, it designs an agricultural pest image detection method based on C3M-Yolov5s, which can effectively detect pests in crops, identify the types of pests detected, and provide timely and accurate data information for experts to formulate targeted prevention and control plans. Background Technology

[0002] my country is a country with a huge population, and food security is of paramount importance. Therefore, agriculture, as the primary industry, must be given high priority. In the agricultural production process, crop pests and diseases affect crop productivity as pests extract energy from the plants they inhabit. If not diagnosed in time, this can lead to significant economic losses for farmers. Pesticides used to control pests and restore crop health place a considerable economic burden on farmers. Furthermore, excessive pesticide use can also lead to environmental degradation and affect water quality and soil cycles around agricultural areas. In addition, plant diseases induced by pests can affect the growth of specific species.

[0003] Effective pest and disease control is crucial for preventing severe crop yield losses caused by pests and diseases, and is vital for agricultural production, daily life, and national economic development. Smart agriculture is a broad field encompassing sensor development, parameter monitoring, data collection, network convergence and maintenance, sensor node clustering, cluster head selection, data compression and aggregation, security and integrity, designing and developing expert systems, and AI-based decision-making. Over the past two decades, the development of artificial intelligence and deep learning has significantly increased the number of projects in the agricultural sector. Deep learning technology has provided superior performance in most related work and produces better results than traditional methods in the field. Some key factors that are overlooked can have a significant impact on the decisions made by any AI (Artificial Intelligence) or deep learning algorithm. This invention observes that information about pests is collected using field sensors before applying deep learning algorithms to obtain the next steps.

[0004] In research experiments on pest detection, traditional methods use sparse encoded histograms to quantify the raw features of pest images, such as insect color and shape, and then further utilize multiple core algorithms to calculate and fuse these features. This involves detecting regions of interest in the image, integrating multiple schemes to enrich and extract image information, and finally classifying the pests using a Support Vector Machine (SVM). Later, some researchers proposed defining the logarithmic spectrum of the image as a new part of the image information and converting the remaining spectrum into the spatial domain to obtain edge detection. Dictionary encoding is also used to obtain the basic features of the image, and then a multi-level classifier is obtained to classify insects with different wing sizes. Deep learning-based object detection algorithms use convolutional neural networks instead of the traditional manual selection method. Deep learning methods can be divided into two parts. One includes two-stage object detection models with CNN feature sequences representing regions, which have high accuracy in object localization and detection rate. However, their real-time performance still needs significant improvement. The other category includes one-stage detection models represented by the YOLO and SSD series detectors, which are fast but have lower accuracy compared to two-stage models. It also falls slightly short in detecting small targets. Using a two-stage detection model, target detection is treated as a classification problem. The detection result is obtained by first generating candidate regions containing objects, and then classifying and calibrating these candidate regions. Conversely, a one-stage detection model treats target detection as a regression problem and provides the final detection result; compared to traditional algorithms, deep learning algorithms have better generalization ability and higher robustness. Therefore, this invention employs a reasonable deep learning-based pest detection and control technology to effectively control the degree of pest damage and create excellent cultivation conditions for the development of the agricultural industry chain. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing traditional detection methods in agricultural pest detection, improve the accuracy of pest detection, and maintain a high inference rate of the model. This invention proposes an agricultural pest image detection method based on C3M-Yolov5s, which has better detection performance and stronger adaptability. To achieve the above objectives, the technical solution adopted by this invention is as follows:

[0006] The C3M-Yolov5s-based method for detecting agricultural pest images is implemented through the following steps:

[0007] Step 1: Replace the original Yolov5 standard convolutional Conv module (conv2d+BN+SiLU) architecture with the MobileNetV3 convolutional module, hereinafter referred to as the MConv convolutional module. The module has fewer parameters, which effectively reduces the computational cost during model training and thus reduces the training time of the model.

[0008] Step 2: In order to obtain feature information of image data more flexibly, a bottleneck convolution module MBottleneck is built based on the structure of Bottleneck. By changing the size of the convolution kernel, different convolution features are obtained, which helps the network learn distinctive image features, thereby helping the model to better complete the detection target.

[0009] Step 3: C3M is constructed by using the MConv convolutional module and the MBottleneck bottleneck convolutional module, drawing inspiration from staggered structures. The use of staggered structures broadens the network depth, further enhancing the model's ability to learn deep features and preventing the gradient vanishing problem during model training.

[0010] Step 4: In the IP102 dataset, replace the C3 module in the original model with the C3M module and then train it. The purpose is to enhance the model's ability to process image features learned by the Backbone network in the Neck part, and obtain better training results for the improved detection model.

[0011] The purpose of introducing the MConv module in Step 1 is to effectively reduce the number of parameters in the original module while extracting features from insect pest images, thereby reducing computational costs. The construction process of this module is as follows: In MobileNetV3, if the number of input layers (input) equals the number of hidden layers (hidden), the first feature processing method is performed, where the upper input x passes through three layers: DW convolutional layer, SE attention mechanism, and PW convolutional layer. Otherwise, the second feature processing method is performed, where the upper input x passes through the PW convolutional layer first, and then enters the subsequent DW, SE, and PW layers. In addition, if the input layer (input) and the output layer (output) are equal and the stride of the convolution is 1, then the upper input x is first processed by the second method described above to obtain the result y, and finally the staggered structure of x + y is output.

[0012] In step two, within the MBottleneck module, the upper-layer input x passes through two MConv convolutional structures, with kernel sizes set to 1×1 and 3×3 respectively. This allows the model to learn varying image features. If the shortcut variable in MBottleneck is true, meaning that staggered outputs are used to extend the depth of the network model, then the input x is added to the result y after the two MConv convolutions.

[0013] In step three, the specific architecture of C3M is as follows: the input x enters the MConv convolution once, and then enters the MBottleneck layer and the MConv layer respectively to obtain the results x1 and x2. Then, x1 + x2 is used as input to enter the MConv to obtain the final output y.

[0014] In step four, the improved C3M is added to the architecture of the original Yolov5 model. The experiment replaces the first C3 module in Neck in order to broaden the model's receptive field of view, allowing it to extract more comprehensive features, thereby improving the recognition accuracy of the subsequent detection probe for the original image of pests.

[0015] The main advantages of the proposed method are: (1) The C3M module obtains more comprehensive feature data after processing the backbone of the original network model; (2) The improved model has a higher mAP50 index, and the number of module parameters is lower, and the convergence speed is slightly improved, which is more conducive to the subsequent deployment operation of the model. Attached Figure Description

[0016] Figure 1 This is a flowchart of the agricultural pest image detection method based on C3M-Yolov5s of the present invention;

[0017] Figure 2 This is the MBottleneck and C3M structure diagram of the agricultural pest image detection method based on C3M-Yolov5s of this invention;

[0018] Figure 3 This is a network model diagram of the agricultural pest image detection method based on C3M-Yolov5s of this invention;

[0019] Figure 4 This is an example comparing the image detection results obtained from the IP102 dataset with the original model using the improved C3M-Yolov5s agricultural pest image detection method of this invention.

[0020] Figure 5 This is an example comparing the image detection mAP50 index of the agricultural pest image detection method based on C3M-Yolov5s obtained in this invention with the original model on the IP102 dataset. Detailed Implementation

[0021] The present invention will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can better understand the present invention. It should be noted that, without departing from the core idea of ​​the present invention, those skilled in the art can make some improvements to the present invention, and these improvements all fall within the protection scope of the present invention.

[0022] like Figure 1 As shown, the general process of the agricultural pest image detection method based on C3M-Yolov5s of this invention includes the following steps:

[0023] The MConv module, which replaces the standard convolution of the original model as described in Step 1, is constructed as follows: First, in MobileNetV3, if the number of input layers (input) equals the number of hidden layers (hidden), the first feature processing method is performed, where the upper-layer input x passes through a Depthwise convolutional layer, an SE attention mechanism, and a Pointwise convolutional layer. Otherwise, the second feature processing method is performed, where the upper-layer input x passes through a Pointwise convolutional layer before entering the subsequent Depthwise, SE layer, and Pointwise layers. Furthermore, if the input layer (input) and the output layer (output) are equal and the stride of the convolution is 1, then the upper-layer input x is processed through the second method described above to obtain the result y, and finally, a staggered output structure of x + y is output.

[0024] In the MBottleneck module mentioned in step two, the upper-layer input x passes through two MConv convolutional structures, with the kernel size set to 1×1 and 3×3 respectively. The parameter settings call the SE attention mechanism and the h_sigmoid and h_swish activation functions. If the shortcut variable in MBottleneck is true, the result y after passing through the two MConv convolutions is added to the input x to build a staggered output structure.

[0025] The specific architecture of the C3M module built in step three is as follows: the input x enters the MConv convolution once, and then enters the MBottleneck layer and the MConv layer respectively to obtain the results x1 and x2. Then, x1 + x2 is used as input to enter the MConv to obtain the final output y.

[0026] In step four, the improved C3M is added to the architecture of the original Yolov5 model. The experiment compares the model with the original model on the IP102 dataset after replacing the C3 module in Neck, under the same parameter settings (number of training epochs, SGD optimization, etc.).

[0027] Figure 2 The diagram shows the building components of the new module C3M proposed in this invention. MConv uses the lightweight convolutional module proposed in MobileNetV3. MBottleneck is constructed using two staggered blocks according to a staggered architecture. C3M is constructed by splicing together three MConvs and one MBottleneck.

[0028] like Figure 3As shown, the network architecture of the agricultural pest image detection method based on C3M-Yolov5s in this invention is based on the backbone of the original Yolov5 structure, with improvements made to the Neck region by replacing the original C3 module with the C3M module proposed in this invention. This enhances the image features submitted after processing the model backbone, further improving the network's detection performance.

[0029] Figure 4 and Figure 5 The figure shows an example of the comparison results between the original model and the model of this invention. As can be seen from the figure, the model of this invention improves the detection confidence for both multi-target and single-target insect pest images, with a more significant improvement for multi-target images, and the mAP index also shows a slight increase.

Claims

1. A C3M-Yolov5s-based agricultural pest image detection method, which is realized by the following steps: Step one, for the architecture of the original model Yolov5 standard convolution Conv module conv2d+BN+SiLU, replace it with the convolution module of MobileNetV3, which is called MConv. The construction process of this module is as follows: first, in MobileNetV3, if the number of input layers input is equal to the number of hidden layers hidden, the first feature processing method is used, and the upper input x is processed through the Depthwise convolution layer, SE attention mechanism and Pointwise convolution layer; otherwise, the second feature processing method is used, which first passes through the Pointwise convolution layer and then enters the subsequent Depthwise, SElayer and Pointwise layer; in addition, if the input layer input is equal to the output layer output and the convolution step stride is 1, the upper input x is first processed by the above-mentioned second processing method to obtain the result y, and finally the staggered structure of x+y is output; this module has less parameters, effectively reducing the calculation cost during model training, and can reduce the training time of the model; Step two, in order to more flexibly obtain the feature information of the image data, a MBottleneck bottleneck convolution module is built based on the structure of Bottleneck, different convolution features are obtained by changing the size of the convolution kernel, which helps the network to learn the distinctive image features, so as to help the model to better complete the detection target; Step three, C3M is built by using MConv convolution module and MBottleneck bottleneck convolution module, and the specific operation includes: The specific architecture of C3M is that the input x enters MConv convolution, and then enters MBottleneck layer and MConv layer to obtain the results x1 and x2, and then x1+x2 is input into MConv to obtain the final output y; the use of staggered structure widens the depth of the network, further improves the learning ability of the model for deep features, and can also prevent the problem of gradient vanishing during training the model; Step four, in the IP102 data set, the C3M module is used to replace the C3 in the Neck of the original model for training, and the specific operation description is as follows: the improved C3M is added to the architecture of the original Yolov5 model, after replacing the first C3 module in the Neck, the model is trained on the IP102 data set under the same parameter settings as the original model, i.e. the number of training rounds epoch and the use of SGD optimizer for training, the purpose is to strengthen the processing ability of the model Neck part for the image features learned by the Backbone network, and to obtain better training results of the improved detection model.

2. The C3M-Yolov5s-based agricultural pest image detection method according to claim 1, characterized in that, In step two, the bottleneck convolution module of MBottleneck is built based on the bottleneck structure, and different convolution features are obtained by changing the size of the convolution kernel. The specific operation is described as follows: in the MBottleneck module, the upper layer input x passes through two MConv convolution structures in turn, and the kernel size of the convolution kernel is set to 1×1 and 3×3 respectively. The parameters are set to call the SE attention mechanism and h_sigmoid and h_swish activation functions. If the shortcut variable in the MBottleneck is true, the results y after passing through the two layers of MConv convolution are added to the input x, and a staggered output structure is built.

Citation Information

Patent Citations

  • A helmet detection method with lightweight backbone based on yolov3 network

    AU2020100705A4

  • Rapid pest detection method based on improved YOLO V4

    CN114220035A