Pest identification method and system

Through the improved YOLOv8s_HS model, using the Hard swish activation function and SimAM attention mechanism, an automated pest identification system is established, which solves the problems of high manual identification cost and low accuracy, achieves high-precision pest identification and counting, and significantly reduces labor costs.

CN118015432BActive Publication Date: 2024-09-17SHENZHEN RESEARCH INSTITUTE OF NORTHWEST A & F UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410418900.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2024-09-17
Estimated Expiration
2044-04-09

AI Technical Summary

Technical Problem

In the existing technology, agricultural pest monitoring relies on manual identification, which is costly and low in accuracy and efficiency. It is necessary to solve the problems of manual identification and counting.

Method used

The YOLOv8s_HS model improved based on the YOLOv8s model is used, and the Hard swish activation function and SimAM attention mechanism are used to establish a recognition model, perform automatic identification and counting, and achieve accurate identification of pests through the image recognition system.

Benefits of technology

Automatic identification and counting are realized, with identification accuracy as high as 95.95%, which greatly reduces labor costs and improves the accuracy and efficiency of pest identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118015432B
    Figure CN118015432B
Patent Text Reader

Abstract

The present invention relates to the technical field of image recognition, and in particular to a pest recognition method and system, comprising: S1: establishing a recognition model, wherein the recognition model adopts a YOLOv8s_HS model improved based on a YOLOv8s model, and during the improvement, a Hard swish activation function is used to replace a SiLU activation function in the YOLOv8s model, and a SimAM attention mechanism is added to the detection head of the YOLOv8s model; S2: obtaining an image of a pest to be recognized; S3: inputting the image of the pest to be recognized into the recognition model to obtain a corresponding recognition result; S4: counting the number of pests in the recognition result. The present invention adopts an improved recognition model based on a deep learning model YOLOv8s_HS, which not only realizes automatic recognition and counting, but also has a detection accuracy of 95.95% as learned from experiments, ensuring accurate and rapid recognition of pests.
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 recognition, and in particular to a pest recognition method and system. Background Art

[0002] Agricultural pests are an important factor that endangers the healthy development of agriculture. For example, in the process of apple planting, golden moth and peach borer can cause serious damage to apple trees and fruits, affecting the economic interests of growers. At present, the monitoring of agricultural pests mainly relies on manual work, and monitoring personnel need to install monitoring devices in the field. These monitoring devices use sticky insects to collect pests. Then the monitoring personnel regularly collect the sticky insect boards in the field and bring them back to the laboratory, and finally perform manual identification and technology. Although this monitoring method is simple, it has high labor costs, and it also has high requirements for the experience of monitoring personnel when identifying pests. In addition, the accuracy and efficiency of identification are not satisfactory. Summary of the invention

[0003] The present invention provides a pest identification method and system, which are used to solve the problems existing in manual identification and counting in the prior art and reduce labor costs.

[0004] The specific technical solutions are as follows:

[0005] A pest identification method, comprising:

[0006] S1: Establish a recognition model, wherein the recognition model adopts a YOLOv8s_HS model improved based on a YOLOv8s model, and during the improvement, a Hard swish activation function is used to replace the SiLU activation function in the YOLOv8s model, and a SimAM attention mechanism is added to the detection head of the YOLOv8s model;

[0007] S2: Obtain the image of the pest to be identified;

[0008] S3: inputting the pest image to be identified into the identification model to obtain a corresponding identification result;

[0009] S4: Counting the number of pests in the identification results.

[0010] Preferably, the step S1 further comprises, after establishing the recognition model, using a training set, a test set and a validation set to respectively train, test and validate the recognition model.

[0011] Preferably, the training set, test set and validation set are generated by preprocessing samples using data enhancement technology.

[0012] Preferably, the step S3 further comprises, after obtaining the recognition result, applying a mark of a corresponding style to the position of each pest on the image of the pest to be recognized.

[0013] Preferably, the step S4 further comprises counting the number of marks corresponding to each type of pest while identifying the number of pests.

[0014] Preferably, the step S4 further comprises marking the names and corresponding quantities of the pests on the images of the pests to be identified.

[0015] A pest identification system, comprising:

[0016] A model building module, used to build a recognition model;

[0017] An image acquisition module is used to acquire images of pests to be identified;

[0018] A pest identification module, used for inputting the pest image to be identified into the identification model to obtain a corresponding identification result;

[0019] The quantity counting module is used to count the quantity of pests in the identification result.

[0020] Compared with the prior art, the present invention has the following beneficial effects: the use of an improved recognition model based on the deep learning model YOLOv8s_HS can not only realize automatic recognition and counting, but also the accuracy of recognition and counting is as high as 95.95%, which ensures the accurate identification technology of pests and reduces labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a pest identification method provided by an embodiment of the present invention.

[0022] Figure 2 A schematic diagram of the composition of the recognition model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 ordinary technicians in this field without making creative work belong to the protection scope of the present invention.

[0024] See also Figure 1 The present invention provides a pest identification method, comprising:

[0025] S1: Establish a recognition model. The recognition model adopts the YOLOv8s_HS model improved based on the YOLOv8s model. The Hard swish activation function is used to replace the SiLU activation function in the YOLOv8s model during the improvement, and the SimAM attention mechanism is added to the detection head of the YOLOv8s model.

[0026] S2: Obtain the image of the pest to be identified;

[0027] S3: inputting the pest image to be identified into the identification model to obtain a corresponding identification result;

[0028] S4: Count the number of pests in the identification results.

[0029] When improving the YOLOv8s model, the Hard swish activation function is used to replace the SiLU activation function in all CBS modules in the original YOLOv8s model. In addition, a SimAM attention mechanism is introduced into the small target detection head in the detection head layer to improve the network's feature extraction and fusion capabilities for pests, and the YOLOv8s_HS model is obtained. After the YOLOv8s_HS model is established, the recognition model is trained, tested and verified using the pre-established sample set.

[0030] For example, when identifying the golden moth and peach borer that harm apples, the samples in the sample set are images containing labeled golden moth and peach borer, and the samples are preprocessed using data enhancement technology to obtain larger samples, and then to obtain a larger number of samples. The sample set is then divided into a training set, a test set, and a validation set according to a certain ratio, and these three data sets are used for training, testing, and validation, respectively.

[0031] Exemplarily, to obtain images of pests to be identified, monitoring personnel can go to the field to manually take images of sticky insect boards, and bring the captured portraits back to the laboratory for pest identification. They can also use automatic shooting devices to take images of sticky insect boards and then upload them to a cloud server, which will store the images of pests to be identified.

[0032] Exemplarily, after the cloud server stores the pest image to be identified, the pest image to be identified is analyzed and processed using a recognition model also running on the cloud server to determine whether each object in the pest image to be identified is a certain type of pest.

[0033] When the pest image to be identified is input into the YOLOv8s_HS model, it first passes through the backbone network layer, which consists of three modules, namely the CBS module replaced with the Hard_swish activation function, the C2F1 module, and the SPPF module. The pest image to be identified passes through these three modules in turn, and is continuously disassembled into feature maps by the CBS module and the C2F1 module and then spliced. Finally, the SPPF module is used to fuse the feature maps of different receptive fields, while improving the running speed.

[0034] The main task of the backbone network layer is to extract feature information from the image, and the feature map output by the backbone network layer then enters the neck network layer. The entire neck network layer consists of CBS modules and C2F2 modules, and is arranged as an FPN+PAN structure. FPN continuously downsamples the feature map output by the backbone network layer to achieve a top-down propagation path, and connects with the middle of the backbone network's bottom-up propagation path to pass the semantic information of the deep feature map to the bottom layer. The PAN structure follows the FPN structure, and again achieves bottom-up, and is also connected to the middle of FPN for feature fusion, passing the location information of the bottom feature map to the top layer.

[0035] The neck network layer passes the position information and semantic information in the feature map to the next layer, realizing the network's fusion of feature information, so that the image finally enters the detection head layer with the SimAM attention mechanism added.

[0036] Among them, the neck network layer outputs feature maps of different scales. According to different scales, the detection head can be divided into small target detection head, medium target detection head and large target detection head. The output feature maps of different scales are divided into grids according to the proportion, and three different sizes of prior frames are generated with each grid as the center. Finally, the network retains the prior frame with the highest confidence in each grid as the prediction frame. If the grid does not contain the characteristic information of the target pest, the prior frame will not be retained. At this point, the pest recognition of a picture is completed.

[0037] After obtaining the identification results, the name and corresponding quantity of the pest are also marked on the image of the pest to be identified. That is, different types of pests are marked with different marks. For example, the golden moth can be marked with a green frame, and the peach borer can be marked with a red frame. This method allows monitoring personnel to intuitively understand the number of pests in the image to be identified.

[0038] After the image to be identified is marked, the number of marked pests is counted, which is convenient for monitoring personnel to view and directly count the number of marks to determine the number of corresponding types of pests. After the number of pests is counted, the name of the pest and the corresponding number must be marked on the image to be identified to form an identified image. The identified image can be sent by the cloud server to the electronic device used by the monitoring personnel. The detection personnel can view the identified image to understand the pest situation in the current state, and then provide a basis for formulating accurate and reliable prevention and control measures.

[0039] A pest identification system, characterized by comprising:

[0040] A model building module, used to build a recognition model;

[0041] An image acquisition module is used to acquire images of pests to be identified;

[0042] A pest identification module, used for inputting the pest image to be identified into the identification model to obtain a corresponding identification result;

[0043] The quantity counting module is used to count the quantity of pests in the identification result.

[0044] The experiment shows that in order to prove the superiority of the recognition model adopted by the present invention, the initial model YOLOv8s of the present invention is compared with other SOTA models, including YOLOv5x, YOLOv5s, YOLOv6s, YOLOv7x and YOLOv8x. The results are shown in Table 1 below.

[0045] Table 1 Comparison of recognition results between the initial model and other SOTA models

[0046]

[0047] In order to prove the superiority of the recognition model adopted by the present invention, the recognition model of the present invention is compared with the initial model, and the experimental results are shown in Table 2 below.

[0048] Table 2 Comparison of recognition results between the recognition model and the initial model YOLOv8s

[0049]

[0050] It can be seen from the results in Table 1 that the YOLOv8s model used in the initial model of the present invention is significantly better than other models in terms of average accuracy performance compared with the previous SOTA model, and thus can achieve better recognition accuracy in the pest identification task.

[0051] It can be seen from the results in Table 2 that the improved YOLOv8s_HS recognition model used in the present invention far exceeds the initial YOLOv8s model in terms of detection accuracy and recall rate, and thus shows higher recognition accuracy in the pest identification task, ultimately achieving the purpose of automatic pest monitoring.

[0052] It is to be understood that the preferred embodiments of the present invention disclosed above are only used to illustrate the present invention, and the preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and use the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A pest identification method, characterized in that: include: S1: Establish a recognition model, wherein the recognition model adopts the YOLOv8s_HS model improved based on the YOLOv8s model, and during the improvement, the Hard swish activation function is used to replace the SiLU activation function in the YOLOv8s model, and a SimAM attention mechanism is added to the detection head of the YOLOv8s model, wherein the detection head is divided into a small target detection head, a medium target detection head and a large target detection head according to feature maps of different scales output by the neck network layer, and the SimAM attention mechanism is located in the small target detection head; S2: Obtain the image of the pest to be identified; S3: Input the pest image to be identified into the recognition model to obtain a corresponding recognition result; during the recognition process, the feature maps of different scales output by the neck network layer are divided into grids in proportion, and three prior frames of different sizes are generated with each grid as the center, and the prior frame with the highest confidence of each grid is retained as the prediction frame; S4: Counting the number of pests in the identification results.

2. A pest identification method according to claim 1, characterized in that: The step S1 also includes, after establishing the recognition model, using a training set, a test set and a validation set to respectively train, test and validate the recognition model.

3. A pest identification method according to claim 2, characterized in that: The training set, test set and validation set are generated by preprocessing samples using data enhancement technology.

4. A pest identification method according to claim 1, characterized in that: The step S3 further includes applying a mark of a corresponding style to the position of each pest on the image of the pest to be identified after obtaining the identification result.

5. A pest identification method according to claim 4, characterized in that: The step S4 also includes counting the number of marks corresponding to each type of pest while identifying the number of pests.

6. A pest identification method according to claim 4, characterized in that: The step S4 also includes marking the names and corresponding quantities of the pests on the images of the pests to be identified.

7. A system using the pest identification method according to any one of claims 1 to 6, characterized in that: include: A model building module, used to build a recognition model; An image acquisition module is used to acquire images of pests to be identified; A pest identification module, used for inputting the pest image to be identified into the identification model to obtain a corresponding identification result; The quantity counting module is used to count the quantity of pests in the identification result.