Method for detecting and identifying tomicus
By deploying the detection and classification model based on YOLOv5 and ResNet50 on the tip-cutting detection recognizer, the problem of tip-cutting detection in the wild environment is solved, fast, efficient and accurate detection is achieved, and the stability and operating performance of embedded devices are improved.
Patent Information
- Application Number
- CN202411812183.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The prior art is difficult to detect and identify snatches quickly, efficiently and accurately in wild environments, and the model based on deep learning algorithms has insufficient ability to identify small targets in complex environments, and is difficult to deploy on embedded devices, with high power consumption during operation, affecting long-term stability.
The detection and classification model based on YOLOv5 and ResNet50 is adopted to improve the detection accuracy and operation efficiency of the model through multi-scale feature fusion, model compression, detection layer optimization and classification model lightweight technologies, and deploy it on embedded devices.
It realizes rapid, efficient and accurate detection of snatched beetles in a wild environment, reducing the computing and storage overhead of the equipment, and improving the long-term stability and operating performance of embedded equipment.
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of insect pest detection, and in particular to a method for detecting and identifying a tip cutting beetle. Background Art
[0002] Traditional detection and identification methods for the tip-cutting beetle mainly include molecular identification and morphological recognition. Although the identification methods are accurate and reliable, they are time-consuming and require professional personnel and specialized equipment, which is difficult to implement in the field. Therefore, it is urgent to develop a fast, efficient and highly accurate identification method and instrument to solve the current identification problem of the tip-cutting beetle in the field.
[0003] Algorithms based on traditional image processing have poor detection effects on small targets and are often unable to effectively distinguish the subtle differences between similar insects and the background, resulting in frequent false detections and missed detections. In recent years, target detection and image classification technologies based on deep learning algorithms have made significant progress, especially the application of convolutional neural networks (CNN) and regional convolutional neural networks (R-CNN) series, which have improved the accuracy of automated pest monitoring. For example, the YOLO series of algorithms perform well in target detection and can achieve efficient real-time detection, but its ability to distinguish small targets (such as tip beetles) from similar backgrounds is still insufficient. To address this issue, the optimized version of YOLOv5 has solved the balance between accuracy and efficiency to a certain extent, but the recognition of small targets in complex environments is still challenging.
[0004] The document "Farmland Pest Detection Based on YOLO-V5l and ResNet50" (Liu Chunyuan, Chen Hongjian, Zeng Xiaohui, Xiang Tao, Kou Xipeng) discloses the use of deep learning technology to analyze the data obtained by using the light-induced insect trap device, solving the time-consuming and labor-intensive shortcomings of manually counting insect information, and proposes data coarse classification to improve the accuracy of the detection model; for the case of data imbalance, the data enhancement method is used to expand the data and balance the data. In terms of the first-layer detection model: the YOLO-V5l model is used to bring the coarsely classified data into the detection model, reducing the number of classifications and the impact of large inter-class similarity on the model, and improving the accuracy of the model. In terms of the second-layer recognition model: the results of the coarse classification of the YOLO-V5l detection model are brought into the second-layer recognition model for fine classification, and a weighted prediction enhancement algorithm is proposed to improve the model accuracy. Although the model has high recognition accuracy, it cannot solve the problem of reducing the device computing and storage overhead while ensuring high-precision classification. As a result, the model is difficult to deploy on embedded devices, consumes high power during operation, and has poor performance, which affects the long-term stability of embedded devices. Summary of the invention
[0005] In order to solve the problems existing in the existing deep learning algorithms, the present invention proposes a method for detecting and identifying tip beetles.
[0006] The invention discloses a method for detecting and identifying a tip-cutting beetle. The method is implemented based on a tip-cutting beetle detection and identification instrument. The identification instrument comprises a housing, a screen, a processing unit and a power supply. The screen, the processing unit and the power supply module are electrically connected in sequence. The identification method comprises a detection model and a classification model. The steps for obtaining the detection model are as follows: 1) Model selection: Select YOLOv5s.pt as the pre-trained model; 2) Freezing strategy: During the initial training, freeze the bottom layer used to capture common features, and keep the upper layer trainable; unfreeze the bottom layer after the model converges; 3) Multi-scale feature fusion: FPN is embedded in the YOLOv5 model, GFPN is introduced to enhance the multi-scale feature expression, and BiFPN is combined to introduce bidirectional feature flow; 4) Model compression: Introduce L1 regularization to sparse the weights during training; then evaluate the importance of convolution kernels and features based on the absolute value of the weights and the response of the feature map, and prune the convolution kernels or feature channels that have little impact on the final output; 5) Detection layer optimization: Use a more robust classification loss function Focal Loss to deal with the imbalance problem of positive and negative samples, optimize the bounding box regression loss, and use DIoU to improve regression accuracy; 6) Training strategy: The Cosine Annealing strategy is used to gradually reduce the learning rate from the initial value to near zero; the Warm-up strategy is used in the early stage of training to gradually increase the learning rate; The steps to obtain the classification model are: 1) Model selection: ResNet50 is used as the basic network model for improving the classification algorithm; 2) Model lightweighting: DS is introduced into the residual module of the tip beetle classification model to replace the standard convolution of ResNet50; the deep convolution sublayer of DS is used to apply independent convolution kernels to each channel, and the number of output feature maps is the same as the number of input channels; the point-by-point convolution of DS is used to process the feature maps output by the deep convolution with a 1×1 convolution kernel, so that the feature maps of different channels are combined into a new feature map; 3) Strategy to improve classification accuracy: Introduce ECA in the residual module of each layer in the ResNet50 network to focus the network on key features, thereby improving the ability to distinguish the main features and suppressing minor features; replace the fully connected layer in the ResNet50 network with the MobileNetV3 classifier; replace the ReLU activation function in the ResNet50 network with the PReLU activation function; 4) Training strategy: The optimizer uses the adaptive moment estimation algorithm, the loss function is the cross entropy loss function, the training iterations are 100 rounds, the batch-size is set to 32, and the learning rate training parameter is 0.0001.
[0007] The obtained detection model and classification model are deployed into the tip-cutting beetle detection and identification instrument.
[0008] Specifically, when the YOLOv5s.pt model is trained, the underlying features include the general structure of the edges, corners, lines, colors, and textures of the tip beetle, and the high-level features are the curved contour edge information of the tip beetle and the texture information on the inclined surface of the elytra and the body.
[0009] Specifically, the shell of the tip-cutting beetle detection and identification instrument adopts a PCB board made of FR-4 material, and the processing unit and the power module are wrapped in the shell.
[0010] Specifically, the processing unit of the tip-cutting beetle detection and identification instrument uses the RV1126 core board. The processing unit is a low-power AI intelligent computing chip, which improves the reasoning speed of the deep learning algorithm through hardware, reduces the dependence on AI chips, and thus reduces overall power consumption; the optimized identification instrument can support long-term continuous work, while running the algorithm efficiently, extending the service life of the identification instrument Specifically, the power module of the tip-cutting beetle detection and identification instrument is composed of a power management chip and a battery, wherein: the power management chip adopts the SCT2230 chip, and the battery adopts a 12V battery. The power management chip can convert the input 12V battery voltage into 3.3V and 5V, providing a stable power supply for each component, improving the endurance of the device, and ensuring the stability of the power supply, thereby ensuring the stable operation of the device.
[0011] The beneficial effects of the present invention are as follows: YOLOv5 is widely used in object detection tasks, and its efficient single-stage detection framework can provide real-time processing capabilities while ensuring high detection accuracy, and adopts multi-scale feature fusion and model pruning technology to effectively improve the detection accuracy of small targets; adopts ResNet50 deep residual structure, can extract rich features in images, effectively classify different types of insect bodies, and optimize ResNet50 through DS deep separable convolution and ECA attention mechanism, and modify the number of output channels at the same time, significantly reduce the amount of calculation and memory requirements, while ensuring high classification accuracy, improve the operation efficiency of the model. After the combination of the improved YOLOv5 and ResNet50, not only the advantages of the yolo series algorithm in the target detection task are fully utilized, but also the strong performance of ResNet in image classification is reflected, and the combination of the two not only greatly improves the efficiency of recognition and classification, but also maintains a high accuracy rate. DETAILED DESCRIPTION
[0012] Example 1: The method for detecting and identifying the tip beetle is implemented based on the tip beetle detection and identification instrument. The tip beetle detection and identification instrument includes a shell, a screen, a processing unit and a power supply, and the screen, the processing unit and the power module are electrically connected in sequence. Among them, the shell adopts a PCB board made of FR-4 material, and the processing unit and the power module are wrapped in the shell; the processing unit adopts an RV1126 core board; the power module is composed of a power management chip and a battery, wherein: the power management chip adopts an SCT2230 chip, and the battery adopts a 12V battery.
[0013] The tip-cutting beetle detection and identification instrument uses a high-definition microscope to collect image information of different types of tip-cutting beetles for the first time. In order to improve the quality of the data set and solve the problem of class imbalance in the data set, we preprocessed the data set. The preprocessing mainly includes data enhancement and balancing the amount of data in each category, so as to improve the generalization performance of the model and ensure the scientific nature of model training, verification and testing. In terms of data enhancement, the data is first enhanced by mixing random cropping, horizontal mirroring, rotation and denoising. For the problem of class imbalance, pictures are selected according to a certain proportion of the original data of different categories to enhance the data. For Tomicus yunnanensis, Tomicus minor and Tomicus brevipilosus, 30% of the pictures of each category are randomly selected for data enhancement; for Tomicus armandii, which has relatively less original data, 50% of the pictures are selected for data enhancement. After data enhancement and data balancing, the total amount of the data set increased from the original 4934 to 6371, while ensuring that the number of images in each category is around 1590. Finally, the data set was divided into training set, validation set and test set in a ratio of 8: 1: 1 to ensure the balance of images of each category in training, validation and testing, providing sufficient learning and evaluation samples for the model, thereby improving the reliability and accuracy of the model. The software part of the tip beetle detection and identification instrument includes two parts: detection model and classification model. The steps to obtain the detection model are as follows: 1) Model selection: Select YOLOv5s.pt as the pre-trained model; because of the need for fast inference on resource-limited embedded devices, the detection accuracy and inference efficiency should be considered comprehensively when selecting the model. The YOLOv5 series network is very suitable for embedded device deployment scenarios due to its lightweight design, fast inference capability and high-precision performance. The pre-trained weights are optimized based on large-scale data sets (such as COCO) and have strong versatility.
[0014] 2) Freezing strategy: During the initial training, the bottom layer used to capture common features is frozen. The bottom layer features include the common structures of the edges, corners, lines, colors, and textures of the tip beetle, while the high layer is kept trainable. The high layer features include the curved contour edge information and the texture information on the elytra slope and body. After the model converges, the bottom layer used to capture common features is unfrozen to improve the adaptability to texture and edge information.
[0015] 3) Multi-scale feature fusion: FPN is embedded in the YOLOv5 model, and high-level semantic features and low-level spatial detail features are fused through top-down feature flows. GFPN is introduced to enhance multi-scale feature expression, and a dynamic fusion mechanism and multi-path feature flow are introduced. At the same time, BiFPN is combined to introduce a bidirectional feature flow, allowing features to be transmitted from top to bottom or bottom to top to enhance the ability to detect small targets.
[0016] 4) During the training process, L1 regularization is introduced to sparse the weights, forcing unimportant weights to approach zero. The importance of the convolution kernels and features is then evaluated based on the absolute value of the weights and the response of the feature map. The convolution kernels or feature channels that have little impact on the final output are pruned. When pruning, special attention is paid to the mid- and low-level feature extraction parts, and the convolution kernels that are key to the expression of texture and detail features are retained.
[0017] 5) Detection layer optimization: Use a more robust classification loss function Focal Loss to process positive and negative samples, use the default initial value γ=2.0 for the adjustment factor γ, and the balance factor α t The determination is an empirical setting. According to the ratio of positive and negative samples, γ=2.0 is fixed first, and α is adjusted t = 0.25 to 0.75), observe the balance of positive and negative sample loss contributions; optimize the bounding box regression loss and use DIoU to improve regression accuracy.
[0018] 6) Training strategy: Adopt the Cosine Annealing strategy, and gradually reduce the learning rate from the initial value to near zero; in the early stage of training, adopt the Warm-up strategy to gradually increase the learning rate.
[0019] The steps to obtain the classification model are: 1) Model selection: ResNet50 is used as the basic network model for improving the classification algorithm, which can not only give play to the advantages of the residual network, but also ensure the capture of detailed features.
[0020] 2) Model lightweighting: DS is introduced into the residual module of the classification model of the tip beetle to replace the standard convolution of ResNet50; for the input color tip beetle image, the deep convolution sublayer of DS is used to apply independent convolution kernels to each channel, and the number of output feature maps is the same as the number of input channels; the point-by-point convolution of DS is used to process the output feature map of the deep convolution using a 1×1 convolution kernel, so that the feature maps of different channels are combined into a new feature map, thereby realizing effective information fusion; ResNet50 is used as the improved basic model, and the number of output channels of each layer part is changed from the original 256, 512, 1024, 2048 to 64, 128, 256, 512, reducing the number of training parameters of the model; 3) Strategy to improve classification accuracy: Introduce ECA in the residual module of each layer in the ResNet50 network, so that the network focuses on key features, thereby improving the ability to distinguish the main features and suppressing secondary features; Global Average Pooling (GAP) in the ECA module is a key operation, which is used to extract the global response value of each channel. These response values are statistical representations of channel features in the entire space, reflecting the importance of the channel. If the GAP value of a channel is high, it means that the channel has a strong response in the entire feature map and contains more significant information that helps classification or recognition, as a primary feature; if the GAP value is low, it means that the contribution of the channel is limited and may contain redundant information or noise, as a secondary feature. 4) Replace the fully connected layer in the ResNet50 network with the MobileNetV3 classifier; replace the ReLU activation function in the ResNet50 network with the PReLU activation function; 5) Training strategy: The optimizer uses the adaptive moment estimation algorithm, the loss function is the cross entropy loss function, the training iterations are 100 rounds, the batch-size is set to 32, and the learning rate training parameter is 0.0001.
Claims
1. A method for detecting and identifying a tip-cutting beetle, the method being implemented based on a tip-cutting beetle detection and identification instrument, the identification instrument comprising a housing, a screen, a processing unit and a power supply, the screen, the processing unit and the power supply module being electrically connected in sequence, the identification method comprising a detection model and a classification model, wherein the steps for obtaining the detection model are: 1) Model selection: Select YOLOv5s.pt as the pre-trained model; 2) Freezing strategy: In the initial training, freeze the bottom layer used to capture common features, and keep the high layer trainable; after the model converges, unfreeze the bottom and middle layers used to capture common features to improve adaptability to texture and edge information; 3) Multi-scale feature fusion: FPN is embedded in the YOLOv5 model, GFPN is introduced to enhance the multi-scale feature expression, and BiFPN is combined to introduce bidirectional feature flow; 4) Model compression: Introduce L1 regularization to sparse the weights during training; then evaluate the importance of convolution kernels and features, and prune convolution kernels or feature channels that have little impact on the final output; 5) Detection layer optimization: Use a more robust classification loss function, Focal Loss, to handle the imbalance problem of positive and negative samples, optimize the bounding box regression loss, and use DIoU to improve regression accuracy; 6) Training strategy: The Cosine Annealing strategy is used to gradually reduce the learning rate from the initial value to near zero; the Warm-up strategy is used in the early stage of training to gradually increase the learning rate; The steps to obtain the classification model are: 1) Model selection: ResNet50 is used as the basic network model for improving the classification algorithm; 2) Model lightweighting: DS is introduced into the residual module of the tip beetle classification model to replace the standard convolution of ResNet50; 3) Strategy to improve classification accuracy: Introduce ECA in the residual module of each layer in the ResNet50 network to make the network focus on key features, thereby improving the ability to distinguish the main features and suppressing minor features; replace the fully connected layer in the ResNet50 network with the MobileNetV3 classifier; replace the ReLU activation function in the ResNet50 network with the PReLU activation function.
2. The method for detecting and identifying tip beetles according to claim 1, characterized in that The shell of the tip-cutting beetle detection and identification instrument is made of a PCB board made of FR-4 material, and the processing unit and power module are wrapped in the shell.
3. The method for detecting and identifying tip beetles according to claim 1, characterized in that The processing unit uses the RV1126 core board.
4. The method for detecting and identifying tip beetles according to claim 1, characterized in that The power module of the tip-cutting beetle detection and identification instrument is composed of a power management chip and a battery, wherein: the power management chip adopts the SCT2230 chip, and the battery adopts a 12V battery.
Citation Information
Patent Citations
Hierarchical structure-based two-stage forestry pest identification and detection system and method
CN113449806A
Image recognition method and device, equipment, storage medium and program product
CN114511741A
Real-time multifunctional pest and disease damage intelligent identification and early warning system
CN115187868A
Plasmodium detection method, system and device based on MindSpore deep learning framework
CN117523558A
Wheat leaf disease identification method and system based on improved YOLOX
CN118072092A