Small target pest detection method and device for unbalanced data in image
By introducing a new spatial attention mechanism and Focaler-NWDPIoU loss function into the YOLOv9 model, the problem of data imbalance and interference factors in small target pest detection is solved, the detection accuracy and performance are improved, and it is suitable for pest detection in smart agriculture. .
Patent Information
- Application Number
- CN202410745987.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-06
AI Technical Summary
In the detection of small target pests, there are data imbalance problems and interference factors such as lighting and occlusion, which lead to unstable detection results. Traditional methods are time-consuming and labor-intensive and are easily affected by subjective factors.
Using the new spatial attention mechanism and Focaler-NWDPIoU loss function, combined with the YOLOv9 model, the BTD-YOLOv9 model is constructed by weighting the loss and deleting unnecessary convolutional layers, enhancing the fusion of global and local features, and improving the model's accuracy for small targets. Detection capabilities.
It effectively solves the problem of data imbalance, improves the accuracy and model performance of small target pest detection, significantly improves the mAP50 value and performance, reduces the number of model parameters, and is suitable for the detection of small target pests in smart agriculture.
Smart Images

Figure CN118608769A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of small target pest detection, and in particular to a method and device for small target pest detection targeting unbalanced data in an image. Background Art
[0002] The technical background in the field of small target pest detection has received extensive attention and research in recent years. With the rapid development of agricultural production, pest problems have become increasingly prominent, posing a serious threat to the growth and yield of crops. Therefore, it is particularly important to develop efficient and accurate small target pest detection technology. Traditional pest detection methods mostly rely on manual inspections and empirical judgments, but this method is time-consuming and labor-intensive, and is easily affected by subjective factors, resulting in time-consuming and labor-intensive detection and unstable detection results. In order to overcome these problems, researchers began to explore pest detection methods based on computer vision and machine learning.
[0003] Computer vision technology can automatically identify pest targets by extracting feature information from images. Machine learning algorithms can learn and analyze large amounts of pest image data to establish accurate pest detection models. The combination of these technologies makes small target pest detection more intelligent and automated. However, small target pest detection still faces some challenges. Since pest targets are often small and may be affected by interference factors such as lighting and occlusion in images, the extracted feature information is not accurate and stable enough. In addition, different types of pests may differ in morphology and color, which also increases the complexity of detection. Summary of the invention
[0004] The present invention provides a method and device for detecting small target pests in unbalanced data in images. The present invention utilizes a small amount of hardware resources of monitoring equipment in smart agriculture to detect small target pests. At the same time, even if the target pests appear less frequently, detection can be performed, thereby ensuring high detection accuracy. The present invention solves the data imbalance problem faced by a single-stage detection model when processing small targets. The model combines global and local features, enabling the network to make full use of these two types of information, thereby enhancing the effectiveness of fused features, as described below:
[0005] A method for detecting small target pests in unbalanced data in an image, the method comprising:
[0006] Construct a new spatial attention mechanism;
[0007] Apply Focaler-NWDPIoU LOSS to BTD-YOLOv9 and perform weighted processing on the loss;
[0008] Delete the original C2F and CONV layers in YOLOv9 to build a small target detection mode;
[0009] The new spatial attention mechanism, Focaler-NWDPIoU and small target detection mode are combined with YOLOv9 to form a small target imbalanced data pest detection model, and small target pest detection is achieved based on the detection model.
[0010] Among them, the new spatial attention mechanism WMOConcat is:
[0011] The converted feature maps are fused and the attention map is generated through the ReLU activation function; the attention map is fused with the weighted feature map to enhance the original features;
[0012] A 1x1 convolution kernel is used to reduce the dimension of global features and local features; a 3x3 convolution kernel is used to process the fused features; an attention mechanism is introduced to map the feature map to a single channel through a 1x1 convolution, and the attention map is output through a Sigmoid activation function.
[0013] Among them, the application of Focaler-NWDPIoU LOSS in BTD-YOLOv9 and the weighted processing of the loss are specifically: applying the Focaler IoU loss to the IoU-based bounding box regression loss function:
[0014] Loss Focaler-PIoU =Loss PIoU +IoU-IoU Focaler
[0015] Among them, IoU Focaler is the Focaler-PIoU loss;
[0016] Loss Focaler-PIoU and Loss NWD Combine by coefficient:
[0017] Loss Focaler-NWDPIoU =radio×Loss Focaler-PIoU +(1-radio)Loss NWD
[0018] Among them, Loss Focaler-NWDPIoU is the Focaler-NWDPIoU loss; radio is the proportional relationship between the two.
[0019] In a second aspect, a device for detecting small target pests in unbalanced data in an image comprises: a processor and a memory, wherein the memory stores program instructions, and the processor calls the program instructions stored in the memory to enable the device to execute any one of the methods described in the first aspect.
[0020] In a third aspect, a computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes any one of the methods described in the first aspect.
[0021] The beneficial effects of the technical solution provided by the present invention are:
[0022] 1. Optimize small target detection: By combining global and local features, BTD-YOLOv9 can effectively detect small target pests in images, improving the accuracy of small target pest detection; this is crucial for accurate identification and timely treatment of pests in smart agriculture;
[0023] 2. Dealing with data imbalance: BTD-YOLOv9 adopts the innovative Focaler-NWDPIoU loss function. This combined loss function reduces the contribution of the majority class to the loss by adjusting the proportional coefficient, while enhancing the learning of the minority class, effectively solving the data imbalance problem and improving the model's detection performance for minority class pests;
[0024] 3. Improve model performance: Experimental results show that BTD-YOLOv9 reduces the model parameters by 64%, while increasing the mAP50 value to 61.9% and improving the performance by 5.6% compared to YOLO v9; this indicates that the performance of the target detection model can be significantly improved by optimizing the loss function and introducing new feature fusion technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a method for small object pest detection in an image with unbalanced data;
[0026] Figure 2 This is the network structure diagram of BTD-YOLOv9;
[0027] Figure 3 Added location map for WMOConcat;
[0028] Figure 4 This is the structure diagram of the WMOConcat model;
[0029] Figure 5 This is the environment map for collecting datasets. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are described in further detail below.
[0031] In order to solve the problems in the background technology, researchers are constantly exploring new technologies and methods. For example, by improving the image preprocessing algorithm, the image quality is improved and the influence of interference factors is reduced; by optimizing the feature extraction and classification algorithm, the accuracy and stability of detection are improved; by introducing deep learning technology, a more complex pest detection model is constructed to improve the generalization ability and robustness of the model.
[0032] Based on the defects in the prior art, the embodiment of the present invention proposes a method for detecting small target pests in unbalanced data in images, and performs model evaluation on a public dataset and a self-made dataset, unbalanced tiny pests dataset. The main idea of the model is to optimize the loss function, add an innovative attention mechanism, reduce the network parameters, computational complexity and model size, while maintaining high-precision detection of small target pests, so as to better meet the needs of actual scenarios.
[0033] Example 1
[0034] like Figure 1 As shown, a method for detecting small target pests in unbalanced data in an image is provided by an embodiment of the present invention, and the method comprises the following steps:
[0035] Step 101: Collect pest photos, label them using labelme and build a dataset;
[0036] Step 102: Design a new spatial attention mechanism WMOConcat to enhance the features of small targets, so that the model can focus on the pests of small targets and improve the accuracy of model detection;
[0037] Step 103: Apply Focaler-NWDPIoU LOSS to BTD-YOLOv9 and perform weighted processing on the loss;
[0038] Among them, this step improves the loss categories of minority pests by weighting the loss of unbalanced data, and can further focus on minority categories of pests.
[0039] Step 104: Delete the original C2F and CONV layers in YOLOv9 to build a small target detection mode, which can save computing resources and pay more attention to small targets;
[0040] Step 105: Combining WMOConcat, Focaler-NWDPIoU and small target detection mode with YOLOv9, we successfully proposed BTD-YOLOv9, a small target imbalanced data pest detection, which will be evaluated on public datasets as well as self-made datasets to enable it to be better applied in practical scenarios and to meet the needs of accurate detection.
[0041] In summary, the embodiment of the present invention designs a small target unbalanced data pest detection network that occupies a small amount of hardware resources of the intelligent weeding robot in smart agriculture through the above steps 101-105, and pays attention to the unbalanced category pests while paying attention to the small target pests, thereby ensuring high detection accuracy; in BTD-YOLOv9, the embodiment of the present invention creatively improves the original CONCAT module and proposes the Weights for Minor Objectivesconcat (WMOConcat) fusion method; this method is strengthened after feature extraction, and can increase the weight of small target pest features, so that it can get more attention in the detection process; the embodiment of the present invention also introduces the combination of advanced loss functions Focaler-PIOU loss and NWDloss, and optimizes the performance of the model by adjusting the proportional coefficients of the two losses, which not only reduces the influence of the majority class on the loss, but also enhances the model's learning ability for the tail category. Specifically, the Focaler-PIOU loss function can help the model learn each category more balanced, especially those rare target categories, thereby improving the detection rate of rare category targets. The NWD loss can further optimize the performance of the model, making it more accurate and stable when dealing with complex scenes.
[0042] Example 2
[0043] The scheme in Example 1 is further introduced below, as described below:
[0044] Step 201: Collect pest photos, label them using labelme and build a dataset;
[0045] Step 202: Figure 3 The model structure diagram shown in the figure designs a new spatial attention mechanism called WMOConcat;
[0046] Among them, the embodiment of the present invention designs a new spatial attention mechanism, called WMOConcat, which aims to generate an attention map by fusing feature maps of different dimensions, thereby helping the model to focus more on the small target parts during detection and suppress useless information.
[0047] In WMOConcat, the embodiment of the present invention first fuses the converted feature maps and generates an attention map through the ReLU activation function. This attention map is obtained by multiplying the feature maps of different dimensions of the original input and combining the attention map with the original feature output map. Next, the embodiment of the present invention fuses this attention map with the weighted feature map to enhance the original features. In this way, the model can pay more attention to the characteristics of small target pests and improve the accuracy of detection.
[0048] In the feature fusion stage, the embodiment of the present invention uses a 1x1 convolution kernel to reduce the dimension of global features and local features to reduce the amount of calculation while retaining key information. In this way, an intermediate feature representation can be obtained, providing effective feature input for subsequent fusion and processing.
[0049] In order to further capture spatial context information, an embodiment of the present invention uses a 3x3 convolution kernel to process the fused features. The application of dilated convolution enables the model to expand the receptive field, thereby capturing a wider range of spatial context information. This is crucial for understanding details such as the shape and size of the target, and helps to improve detection accuracy. An embodiment of the present invention introduces an attention mechanism to further improve the performance of the model. The feature map is mapped to a single channel through a 1x1 convolution, and an attention map is output through a Sigmoid activation function. This attention map can guide the model to pay more attention to important parts of the image, such as small target pests. By multiplying with the original features, the original features are enhanced, so that the model pays more attention to useful information in subsequent processing.
[0050] Step 203: Applying the proposed Focaler-PIoU loss function to the loss function can pay more attention to the unbalanced data and detect unbalanced pests:
[0051] in, For all pixels p in the set i,j Sum them up, and these sets include all the pixels of the marked box and the true box.
[0052]
[0053] Among them, b is the labeled box, b' is the true box, S b∩b' represents the intersection area between the marked box and the true box, S b∪b' Represents the information of the marked box and the real box. δ(p i,j |b) represents pixel p i,j Whether it is in the marked box b, the pixel point is in the bounding box, and the function value is 1; otherwise, it is 0. i,j |b') represents the pixel p i,jWhether it is in the real box b', the pixel point is in the bounding box, and the function value is 1; otherwise it is 0. B is the set of pixels in the bounding box, i is the horizontal coordinate of the pixel, and j is the vertical coordinate of the pixel.
[0054] The proposed PIoU calculation is as follows:
[0055]
[0056] The final calculated PIoU (pixel intersection over union) loss formula is as follows:
[0057]
[0058] Where lnPIoU(b,b') is the natural logarithm of the PIoU between the labeled box and the true box. M represents the number of bounding box pairs involved in the calculation.
[0059]
[0060] Among them, W2 2 (N a ,N b ) is the quadratic Wasserstein distance metric between two distributions and cannot be directly used as IoU, N a is the normal distribution of the target, N b is the normal distribution of labeled objects, cx a is the distribution N a The horizontal coordinate of the center position, cy a YesN a The vertical coordinate of the center position, w a is the target width, h a is the target height, cx b is the horizontal coordinate of the center position of the marked object, cy b is the ordinate of the center position of the marked object, w b is the width of the marker object, h b is the height of the marked object, T is the representation transposition operation, and the embodiment of the present invention uses an exponential normalized form to normalize the new metric of Wasserstein distance (NWD):
[0061]
[0062] Here, C is a constant used to adjust the sensitivity and numerical stability of the loss function.
[0063] Apply the Focaler IoU loss to the existing IoU-based bounding box regression loss function:
[0064] Loss Focaler-PIoU =Loss PIoU+IoU-IoU Focaler
[0065] Among them, IoU Focaler is the Focaler-PIoU loss.
[0066] This loss function provides a method to balance the accuracy of small target detection and handle category imbalance by mixing Focaler-PIOU loss and NWD loss in a ratio of 0.6 to 0.4. Focaler-PIOU loss enhances the sensitivity to small targets or targets that are difficult to detect through the penalty term, while NWD loss focuses on the overall bounding box prediction quality and evaluates the model performance by calculating the Wasserstein distance between the predicted box and the true box. Focaler-PIoU and Loss NWD Combine by coefficient:
[0067] Loss Focaler-NWDPIoU =radio×Loss Focaler-PIoU +(1-radio)Loss NWD
[0068] Among them, Loss Focaler-NWDPIoU is the Focaler-NWDPIoU loss; radio is the proportional relationship between the two, which is set to 0.6.
[0069] Step 204: The WMOConcat and Focaler-PIoU loss functions are combined with the small target mode of the improved YOLOv9, and a BTD-YOLOv9 model suitable for small target unbalanced data pest detection in cotton fields is proposed and evaluated on a public dataset. Based on the BTD-YOLOv9 model, the detection of small target unbalanced data pests in cotton fields is realized.
[0070] In order to evaluate the object detection model, the embodiment of the present invention uses a variety of indicators, including: precision (P) and recall (R), mean average precision (mAP), gigabit per second (GFlops) and parameters (Params). mAP is the average detection accuracy, which is obtained by calculating the average accuracy at different recall stages. R is obtained by calculating the average accuracy at different recall stages. P and mAP indicators take into account both precision and recall. Params is used to measure the complexity of the model, while GFlops is used to quantify the computational complexity of the model.
[0071] In summary, the embodiment of the present invention uses the BTD-YOLOv9 model to achieve significant improvement in the detection of small target pests in images. It can not only effectively solve the problem of data imbalance, but also improve the performance and accuracy of the model, providing a new solution for farmland pest detection.
[0072] Example 3
[0073] Combine the following Figure 2-Figure 3 The feasibility of the schemes of Examples 1 and 2 is verified as follows:
[0074] Figure 2 This is the network structure diagram of BTD-YOLOv9, which is mainly used for unbalanced data detection of small target pests in cotton fields. A small target unbalanced pest data detection model combining Focaler-NWDPIoU, WMOconcat and small target mode with YOLOv9 is proposed.
[0075] Figure 2 The Focaler-NWDPIoU loss is a loss function optimized for unbalanced data detection, which aims to improve the sensitivity and accuracy of the target detection model for small targets and imbalanced categories by optimizing the IoU calculation process. Let BTD-YOLOv9 pay more attention to small targets that are difficult to detect or easy to ignore, and reduce the negative impact of data imbalance on detection performance through a weighted mechanism. This method is particularly beneficial for the detection of small targets and unbalanced data because it can coherently reflect the distance between even non-overlapping distributions, has scale invariance, smooth response to position deviations, and the ability to measure the similarity between non-overlapping or mutually contained bounding boxes.
[0076] Figure 3 This is the structure diagram of the WMOConcat module. WMOConcat fuses the feature maps converted into each other, generates an attention map through the ReLU activation function, multiplies the output of the feature maps of different dimensions of the original input, and then fuses them with the weighted feature map. This can help the model pay more attention to the small target part during detection and suppress useless information.
[0077] In step 201, a self-made pest dataset is used. The data comes from a farm in Xinjiang, China, located at 86.96' east longitude and 44.23' north latitude. The environment is shown in the figure. The data is captured by placing two insect sticking boards in one square meter. The data is captured once a week, and a total of 284 photos are collected. The shooting height is kept at about 40 cm from the ground, the shooting angle is 90 degrees, and the original size is: 3024*4032. Among them, the number of Thrips with an area less than 32*32 pixels exceeds 9300. The small target problem refers to the large number of Thrips samples with an area less than 32*32 pixels in the dataset. Small target detection is a challenge in computer vision because they occupy fewer pixels in the image, making it difficult to extract enough feature information for accurate identification. Specifically, more than 9,300 Thrips samples belong to the category of small targets, which not only increases the difficulty of detection, but also may affect the model's accurate positioning and identification of such objects. Such data can simulate insect pests in cotton fields and provide valuable training and testing data for smart farms.
[0078] In step 202, the embodiment of the present invention compares Figure 3 Positions 1-4 were replaced with WMOconcat, and the test results are shown in Table 1. The embodiment of the present invention observed that at position 4, the entire model had an advantage in mAP50 for target detection as well as in P and R. In the overall results, mAP50 reached 0.608, while maintaining a high level, and FPS did not decrease. Among them, the detection results of small targets alone, compared with the baseline and then adding WMOconcat, P, R, and mAP50 were all improved, and mAP50 at position 4 increased by 2.7%. Compared with the baseline model, BDT-YOLOv9 has better accuracy in the detection of small targets! Therefore, the embodiment of the present invention selects position 4 as the replacement position for WMOconcat.
[0079] Table 1 WMOconcat position replacement experimental results
[0080]
[0081] In step 203, when exploring the combined use of the two loss functions, the embodiment of the present invention observed the comprehensive impact of different ratios on model performance by adjusting their scale coefficients. When the combined scale coefficient of the loss function was 0.6, the model achieved the best overall performance, with an mAP50 value of 0.611. Compared with other ratios, while maintaining high precision (P = 0.654) and recall (R = 0.648), it also achieved a higher number of frames processed per second. Therefore, considering all key performance indicators, the scale coefficient of 0.6 was confirmed to be the key parameter for achieving optimal model performance under this experimental setting.
[0082] In step 204, the embodiment of the present invention first creates a small target pest detection version, which significantly reduces the number of parameters, while slightly increasing mAP to 0.572, and the model speed is significantly improved. By replacing MWOConcat, the embodiment of the present invention can observe the improvement of the model in multi-scale weighted fusion. This technology significantly improves the model's detection ability for targets of different sizes. The embodiment of the present invention observes a slight increase in the number of parameters, but the model size remains low. This improvement has significantly improved P and mAP. After the embodiment of the present invention adds the Focaler-NWDPIoU loss, its parameters are 1.15M, and GFLOPS is slightly improved. By focusing on difficult samples and reducing the weight of easy samples, the performance of the detection model can be effectively improved. This improvement further increases mAP to 0.619 while keeping FPS unchanged. The experimental results are shown in Table 2. It highlights that the improvement strategy of the embodiment of the present invention improves detection accuracy while maintaining model efficiency, and significantly enhances the detection of unbalanced data of small target pest samples.
[0083] Table 2. Comparison examples of the training results of the self-made dataset and various operation parameters.
[0084]
[0085]
[0086] Example 4
[0087] A small target unbalanced data pest detection device, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to enable the device to execute the following method steps in embodiment 1:
[0088] Construct a new spatial attention mechanism;
[0089] Apply Focaler-NWDPIoU LOSS to BTD-YOLOv9 and perform weighted processing on the loss;
[0090] Delete the original C2F and CONV layers in YOLOv9 to build a small target detection mode;
[0091] The new spatial attention mechanism, Focaler-NWDPIoU and small target detection mode are combined with YOLOv9 to form a small target imbalanced data pest detection model, and small target pest detection is achieved based on the detection model.
[0092] Among them, the new spatial attention mechanism is:
[0093] The converted feature maps are fused and the attention map is generated through the ReLU activation function; the attention map is fused with the weighted feature map to enhance the original features;
[0094] A 1x1 convolution kernel is used to reduce the dimension of global features and local features; a 3x3 convolution kernel is used to process the fused features; an attention mechanism is introduced to map the feature map to a single channel through a 1x1 convolution, and the attention map is output through a Sigmoid activation function.
[0095] Among them, the Focaler-NWDPIoU LOSS is applied to BTD-YOLOv9, and the loss is weighted as follows: the Focaler IoU loss is applied to the IoU-based bounding box regression loss function:
[0096] Loss Focaler-PIoU =Loss PIoU +IoU-IoU Focaler
[0097] Among them, IoU Focaler is the Focaler-PIoU loss;
[0098] Loss Focaler-PIoU and Loss NWD Combine by coefficient:
[0099] Loss Focaler-NWDPIoU =radio×Loss Focaler-PIoU +(1-radio)Loss NWD
[0100] Among them, Loss Focaler-NWDPIoU is the Focaler-NWDPIoU loss; radio is the proportional relationship between the two.
[0101] In summary, the device designed in the embodiment of the present invention is used to execute the algorithm and data processing tasks of the above-mentioned BTD-YOLOv9 model; the processor is responsible for executing the reasoning and calculation process of the model, and the memory is used to store model parameters, intermediate results and final detection results. Such a device structure enables the BTD-YOLOv9 model to efficiently and accurately complete the pest detection task in practical applications.
[0102] The execution subjects of the above-mentioned processor and memory can be devices with computing functions such as computers, single-chip microcomputers, and microcontrollers. In specific implementation, the embodiments of the present invention do not limit the execution subjects and are selected according to the needs of actual applications.
[0103] The data signal is transmitted between the memory and the processor via a bus, which is not described in detail in the embodiment of the present invention.
[0104] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, the storage medium includes a stored program, and when the program is running, the device where the storage medium is located is controlled to execute the method steps in the above embodiment.
[0105] The computer-readable storage medium includes but is not limited to a flash memory, a hard disk, a solid-state drive, and the like.
[0106] It should be pointed out here that the description of the readable storage medium in the above embodiment corresponds to the description of the method in the embodiment, and the embodiment of the present invention will not be described in detail here.
[0107] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present invention are generated.
[0108] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium or transmitted via a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium or a semiconductor medium, etc.
[0109] Unless otherwise specified, the models of the components in the embodiments of the present invention are not limited, and any device that can perform the above functions may be used.
[0110] Those skilled in the art can understand that the accompanying drawing is only a schematic diagram of a preferred embodiment, and the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting small target pests in unbalanced data in images, characterized in that: The method comprises: Construct a new spatial attention mechanism WMOConcat; Apply Focaler-NWDPIoU LOSS to BTD-YOLOv9 and perform weighted processing on the loss; Delete the original C2F and CONV layers in YOLOv9 to build a small target detection mode; The new spatial attention mechanism WMOConcat, Focaler-NWDPIoU and small target detection mode are combined with YOLOv9 to form a small target imbalanced data pest detection model, and small target pest detection is realized based on the detection model.
2. The method for detecting small target pests in unbalanced data in an image according to claim 1, characterized in that: The new spatial attention mechanism WMOConcat is: The converted feature maps are fused and the attention map is generated through the ReLU activation function. The attention map is fused with the weighted feature map to enhance the original features. Use 1x1 convolution kernel to reduce the dimension of global features and local features; use 3x3 convolution kernel to process the fused features; The attention mechanism is introduced to map the feature map to a single channel through 1x1 convolution, and the attention map is output through the Sigmoid activation function.
3. The method for detecting small target pests in unbalanced data in an image according to claim 1, characterized in that: The Focaler-NWDPIoU LOSS is applied to BTD-YOLOv9, and the loss is weighted as follows: the Focaler IoU loss is applied to the IoU-based bounding box regression loss function: Loss Focaler-PIoU =Loss PIoU +IoU-IoU Focaler Among them, IoU Focaler is the Focaler-PIoU loss; Loss Focaler-PIoU and Loss NWD Combine by coefficient: Loss Focaler-NWDPIoU =radio×Loss Focaler-PIoU +(1-radio)Loss NWD Among them, Loss Focaler-NWDPIoU is the Focaler-NWDPIoU loss; radio is the proportional relationship between the two.
4. A device for detecting small target pests in unbalanced data in images, characterized in that: The device comprises: a processor and a memory, wherein program instructions are stored in the memory, and the processor calls the program instructions stored in the memory to enable the device to execute the method according to any one of claims 1 to 3.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Agricultural insect pest image detection method based on SFP-YoloX
CN116883839A
Disease and insect pest target detection method, device and equipment based on improved YOLOv8
CN117115640A
Deep learning-based crop disease and insect pest real-time detection method and device, and computer storage medium
CN117351353A
Pest detection and identification method based on improved YOLOv8 model
CN117975278A
Target object detection model
US20220156534A1
