Small object target identification method for complex scene

By constructing a lightweight target detection network and improving the sample matching algorithm, the problems of insufficient feature extraction and high computational cost in wheat pest identification in the field were solved, achieving efficient and accurate pest detection and meeting the needs of real-time field monitoring.

CN121937758APending Publication Date: 2026-04-28HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing target recognition networks struggle to simultaneously meet the demands of high accuracy, low computational cost, and rapid inference for wheat pest detection in complex field scenarios. In particular, they suffer from insufficient feature extraction, poor adaptability of sample matching strategies, and an imbalance between lightweight models and real-time performance when identifying individual small pests.

Method used

A lightweight object detection network is constructed, employing an improved sample matching algorithm and feature cascade module, including multiple feature cascade modules and a single detection head. Anchor points are selected using Manhattan distance, the sample matching strategy is optimized, detailed feature extraction is enhanced, and computational costs are reduced.

Benefits of technology

It achieves high accuracy in identifying small pests in complex field environments with 93.0% precision, 88.6% recall, and 91.1% mAP50. The model inference speed is 4.27 milliseconds, meeting the requirements for real-time detection, and the model size is only 3.22MB.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937758A_ABST
    Figure CN121937758A_ABST
Patent Text Reader

Abstract

The invention discloses a small object target recognition method for a complex scene, and belongs to the technical field of computer vision and pest image recognition, and the method comprises the steps: building a field wheat pest image data set; a target recognition network based on the YOLO architecture is constructed, the network comprises an input end, a trunk feature extraction network, a connecting neck and a detecting head, and a feature cascade module enhances the detail feature extraction capability by fusing shallow feature information; an improved sample matching algorithm is adopted, and a plurality of anchor points with the shortest Manhattan distance from the center point of a target frame are selected as supplementary candidate anchor points, so that the small target recognition precision is improved; and the detection head part adopts a single detection head structure for small target identification. According to the method, high identification precision and recall rate are realized under the condition of light weight, the model size is small, the reasoning speed is high, the field wheat pest identification precision and speed requirements can be met, and a guarantee is provided for field intelligent management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and pest image recognition technology, specifically to a method for recognizing small objects in complex scenes. Background Technology

[0002] Wheat is susceptible to pests during its growth, which can severely impact its yield and quality. Therefore, accurate and efficient identification of wheat pests and timely implementation of control measures can minimize pesticide use, reduce soil damage, ensure healthy wheat growth, and better meet the world's food needs.

[0003] With the development of computer vision and image processing technologies, image-based pest identification and detection technologies have emerged. This technology can not only improve pest monitoring and control, reducing food losses, but also promote the intelligent and precise development of agricultural production. However, existing target recognition networks struggle to simultaneously meet the detection needs of wheat pests in complex field scenarios in terms of computational complexity, inference speed, and recognition accuracy.

[0004] Currently, scholars both domestically and internationally have conducted extensive research on wheat diseases and pests. However, their technical focus is mostly on the macroscopic identification of infected areas, such as locating affected areas through features like leaf lesions and plant wilting. Existing technologies still have significant shortcomings in the precise identification and statistical analysis of individual pests, making it difficult to meet the actual needs of field pest monitoring. Taking wheat aphids as an example, their individual size is typically only 1-3 millimeters, resulting in a very low pixel count in field images. They are often densely distributed in concealed locations such as the underside of leaves and crevices in stems. Furthermore, they blend closely with complex backgrounds such as wheat leaf textures, soil particles, and weed debris, causing existing target recognition models to easily suffer feature confusion and making it difficult to effectively distinguish pests from background interference, greatly increasing the difficulty of identification.

[0005] Specifically, existing deep learning-based target recognition networks have three main problems when dealing with the task of detecting small wheat pests in the field: First, insufficient feature extraction capability. Traditional network architectures are prone to losing key shallow features such as the edges and textures of small pests during the layer-by-layer downsampling process, resulting in insufficient feature extraction of small targets. Second, poor adaptability of sample matching strategies. Existing algorithms are mostly based on anchor point matching rules designed for general targets. When there are no preset anchor points in the target box of a small pest, targets that should be labeled as positive samples are easily misclassified as negative samples, resulting in a high false negative rate. Third, an imbalance between lightweight models and real-time performance. Most high-precision models rely on multi-detector architectures to achieve multi-scale target coverage. Although this can improve the recognition effect of large targets, it leads to high computational costs and slow inference speed, making it difficult to meet the needs of real-time detection in the field.

[0006] Therefore, developing a small object target recognition method that combines lightweight architecture, high recognition accuracy, and fast reasoning capability has become a key technological breakthrough direction for solving the problem of accurate monitoring of wheat pests in the field. Summary of the Invention

[0007] The purpose of this invention is to provide a method for small object target recognition in complex scenarios. By constructing a lightweight target detection network and optimizing the sample matching strategy, it solves the problems of high false negative rate, insufficient detail extraction and high computational cost for small targets, while taking into account both recognition accuracy and inference speed, thus achieving efficient and accurate detection.

[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0009] A method for small object recognition in complex scenes includes the following steps:

[0010] Step S1: Obtain and construct an image dataset containing small objects;

[0011] Step S2: Construct a target recognition network based on the YOLO architecture. This target recognition network includes an input end, a backbone feature extraction network, a connection to the neck, and a head detection network. An improved sample matching algorithm is used to assign positive and negative samples.

[0012] The backbone feature extraction network includes multiple feature cascade modules, which are used to fuse shallow feature information during forward propagation to enhance the ability to extract detailed features.

[0013] The improved sample matching algorithm for small targets first counts the anchor points within the target box as preliminary candidate anchor points; if there are no anchor points within the target box, then selects the anchor points with the shortest Manhattan distance from the center point of the target box as supplementary candidate anchor points to participate in the alignment score calculation.

[0014] The detection head is a single detection head designed for small target identification;

[0015] Step S3: Train the target recognition network using the image dataset;

[0016] Step S4: Use the trained target recognition network to detect the input image and identify small object targets within it.

[0017] Furthermore, in step S1, the acquired images are pest images during the tillering, stem elongation, and heading stages of wheat in the field; in step S4, the identified targets are pests in the wheat images in the field.

[0018] Furthermore, in step S2, the backbone feature extraction network employs two convolutional modules and three feature concatenation modules. The implementation process of the feature concatenation modules is as follows:

[0019] The input of the feature concatenation module is first concatenated with the intermediate layer feature output of the previous feature concatenation module in the channel dimension;

[0020] The concatenated features are extracted using a depthwise separable convolutional module to obtain a feature layer with half the feature scale. This feature layer serves as the intermediate feature output of the current feature concatenation module to the next feature concatenation module, and is also used for feature extraction through the first path and the second path respectively.

[0021] The first path sequentially uses a convolutional module and a convolutional attention module to extract detailed features; the second path uses a C3K2 module to extract deep features in complex scenes; the two feature layers obtained from the first and second paths are added together to obtain the final output of the current feature cascade module.

[0022] Furthermore, the convolutional module is composed of a regular convolutional layer, a batch normalized layer, and a SiLU activation function in sequence; the depthwise separable convolutional module is composed of a depthwise separable convolutional layer, a batch normalized layer, and a SiLU activation function in sequence.

[0023] Furthermore, the feature fusion process for the connecting neck includes:

[0024] (1) Upsample the feature map output by the backbone feature extraction network and concatenate it with the feature map output by the two feature concatenation modules along the channel dimension.

[0025] (2) The C3K2 module is used to extract features from the spliced ​​feature map and upsample it. Then, it is spliced ​​with the feature map output by the feature concatenation module once in the channel dimension.

[0026] (3) Finally, the C3K2 module is used to extract and fuse the features after splicing in step (2) to obtain the output of the neck connection.

[0027] Furthermore, in the improved sample matching algorithm: if there are no anchor points in the target box, select the four anchor points with the shortest distance to the Manhattan distance of the target box center point as supplementary candidate anchor points; merge the preliminary candidate anchor points and the supplementary candidate anchor points, and calculate the alignment score of each candidate anchor point; select up to 10 anchor points with the highest alignment scores for the category prediction of the target box and the prediction box regression; at the same time, adjust the distance calculation range corresponding to the 16-dimensional discrete probability distribution of the prediction box from [0,15] to [-1,14].

[0028] Furthermore, in the improved sample matching algorithm, the continuous values ​​of the predicted box distance are calculated using the following formula:

[0029]

[0030] In the formula, l, t, r, b are the distances from the anchor point center to the left, top, right, and bottom boundaries of the prediction box, respectively, and p l,i ,p t,i ,p r,i ,p b,i It is a Softmax normalized probability distribution.

[0031] Further, in step S2, the total loss function of the target recognition network includes CIoU loss, DFL loss, and classification loss, and the total loss function is:

[0032] L total =λ CIoU L CIoU +λ DFL L DFL +λ cls L cls

[0033] In the formula, L CIoU For the CIoU loss between the predicted bounding box and the target bounding box, L DFL For the distribution focus loss, L cls For classification loss, λ CIoU , λ DFL , λ cls These are the weighting coefficients for the corresponding losses.

[0034] Furthermore, the single detection head is a decoupled detection head, composed of convolutional modules, which output the probability distribution of pest categories and the coordinate information of prediction boxes respectively.

[0035] Furthermore, the input image size of the target recognition network is an RGB image of 800×800×3 pixels.

[0036] The beneficial effects of the above scheme are as follows:

[0037] 1. This invention effectively enhances the model's ability to capture detailed image features by constructing a feature concatenation module that integrates convolutional attention mechanisms and deep feature extraction, thereby acquiring pest feature information in images with lower computational cost. This design allows shallow feature information to be continuously fused during the network's forward propagation, significantly improving the resolution of morphological and textural features of small-sized pests. It overcomes the problem of easily losing detailed information of small targets in complex field backgrounds, laying the foundation for achieving high-precision recognition.

[0038] 2. By improving traditional sample matching strategies, this invention innovatively adopts an anchor point selection method based on Manhattan distance to assign suitable candidate anchor points to small targets. This mechanism effectively solves the problem of small targets being incorrectly labeled as negative samples during training due to a lack of matching anchor points, ensuring that the model can fully learn the features of various small-scale targets, significantly reducing false negatives and improving the recall capability of the recognition system.

[0039] 3. To address the stringent computational efficiency requirements of real-time field detection scenarios, this invention employs a single-detection-head architecture optimized specifically for small targets. This design significantly reduces the number of network parameters and computational complexity while maintaining the model's sensitivity to small targets, resulting in a more lightweight overall model. Ultimately, while ensuring high recognition accuracy, it achieves extremely fast inference speeds, providing reliable technical support for real-time and efficient pest detection in resource-constrained mobile devices and edge computing environments.

[0040] 4. Based on the synergistic effect of the above-mentioned innovative design, the proposed target recognition network achieves an accuracy of 93.0%, a recall rate of 88.6%, and an mAP50 of 91.1%. The model inference time for a single image is 4.27 milliseconds, and the model file size is only 3.22MB. This meets the accuracy and speed requirements for pest identification in complex field environments, providing support for real-time pest monitoring, trend prediction, and early warning, and facilitating intelligent field management. Attached Figure Description

[0041] Figure 1 These are example illustrations of ten wheat pests in the field according to embodiments of the present invention;

[0042] Figure 2 This is a structural diagram of the cascaded module of the present invention;

[0043] Figure 3 This is an overall structural diagram of the target recognition network of the present invention;

[0044] Figure 4 This is a diagram of a traditional sample matching algorithm;

[0045] Figure 5 This is a diagram of the improved sample matching algorithm of this invention;

[0046] Figure 6 This is a flowchart of the wheat pest target detection network in an embodiment of the present invention. Detailed Implementation

[0047] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0048] It should be noted that, unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0049] Taking wheat pests in the field as an example, this embodiment provides a method for small object target recognition in complex scenarios, including the following steps:

[0050] Step S1: Obtain and construct an image dataset containing small objects;

[0051] Step S2: Construct a target recognition network based on the YOLO architecture. This target recognition network includes an input end, a backbone feature extraction network, a connection to the neck, and a head detection network. An improved sample matching algorithm is used to assign positive and negative samples.

[0052] The backbone feature extraction network includes multiple feature cascade modules, which are used to fuse shallow feature information during forward propagation to enhance the ability to extract detailed features.

[0053] The improved sample matching algorithm for small targets first counts the anchor points within the target box as preliminary candidate anchor points; if there are no anchor points within the target box, then selects the anchor points with the shortest Manhattan distance from the center point of the target box as supplementary candidate anchor points to participate in the alignment score calculation.

[0054] The detection head is a single detection head designed for small target identification;

[0055] Step S3: Train the target recognition network using the image dataset;

[0056] Step S4: Use the trained target recognition network to detect the input image and identify small object targets within it.

[0057] The specific implementation process of each step is explained in detail below.

[0058] Step S1: Dataset Preparation and Augmentation

[0059] First, under natural light conditions in the field, images of pests are acquired using image acquisition devices such as smartphones during key growth stages of wheat, such as tillering, stem elongation, and heading. During acquisition, it is essential to ensure that the target pest area is clearly visible, with a complex background including healthy leaves, withered leaves, weeds, and soil.

[0060] The collected raw images were screened, and annotation tools were used to label the target regions and categories of pests in the images. To improve model robustness and combat overfitting, the labeled dataset underwent balanced augmentation processing. Specific augmentation methods included image rotation, flipping, mosaic enhancement, scaling, and stitching fusion. Finally, the augmented data was proportionally divided into training, validation, and test sets for subsequent model training and evaluation.

[0061] The small objects described in this invention are small pests that occur during the wheat growth process in the field. Figure 1 The illustrations show ten examples of wheat pests in the field, including (a) aphids, (b) wheat spiders, (c) spotted stink bugs, (d) wheat leaf miners, (e) wheat leaf beetles, (f) silkworm moths, (g) midges, (h) click beetles, (i) stalked stink bugs, and (j) wheat midges. All of these pests are identified in this embodiment.

[0062] Step S2: Construction of the target recognition network

[0063] The target recognition network based on the YOLO architecture constructed in this invention mainly includes an input end, a backbone feature extraction network, a neck connection, and a head detection network.

[0064] YOLO is a target recognition and localization algorithm based on deep neural networks, achieving end-to-end detection. The small object target recognition method proposed in this invention does not limit the target recognition network to a specific YOLO version, but rather builds upon the YOLO architecture. To reduce the number of model parameters and computational load, the backbone feature extraction network employs multiple cascaded feature modules; to improve model inference speed, a single detection head is used for target recognition; and to enhance the target recognition capability for small objects, an improved sample matching algorithm is used for positive and negative sample allocation.

[0065] The target recognition network receives a pre-processed 800×800×3 pixel RGB image at its input.

[0066] The backbone feature extraction network is responsible for extracting multi-level feature information from the input image. It consists of two convolutional modules and three sequentially connected feature cascade modules (FCMs).

[0067] like Figure 2 As shown, a feature cascade module is constructed using a depthwise separable convolutional module, a convolutional module, a convolutional attention module, and a C3K2 module to perform deep-level and detail-level feature fusion and extraction on the input image. The workflow of the feature cascade module is as follows:

[0068] (1) Feature concatenation: The input of the feature concatenation module is first concatenated with the intermediate layer feature output of the previous feature concatenation module in the channel dimension, thereby introducing shallow feature information into the current processing flow.

[0069] (2) Preliminary downsampling: The concatenated features are processed by a depthwise separable convolutional module to achieve preliminary feature extraction. The depthwise separable convolutional module consists of a depthwise separable convolutional layer, a batch normalization layer and a SiLU activation function, resulting in a feature layer with half the feature scale.

[0070] (3) Dual-path feature extraction: The above feature layer serves as the intermediate feature output of the current feature cascade module, which is then passed to the next feature cascade module. Simultaneously, it enters two paths for feature extraction: the first path passes through a convolutional module and a convolutional attention module, focusing on extracting local detail features of the target. The second path uses a C3K2 module to extract and fuse deep features in complex scenes.

[0071] (4) Feature fusion: The feature layers output from the two paths are added together to obtain the final output of the current feature cascade module. This design ensures that shallow detail information is preserved and utilized throughout the forward propagation of the entire network.

[0072] Figure 3 This is a structural diagram of the target recognition network in this embodiment. The backbone network consists of convolutional modules and FCM, the neck connection is achieved by channel splicing and C3K2 modules, and finally the decoupled detection head is composed of convolutional modules to realize the prediction of category and bounding box coordinates.

[0073] The neckline is responsible for fusing feature maps of different scales output by the backbone feature extraction network. Specifically, the neckline upsamples the final feature map output by the backbone feature extraction network to amplify the feature information, and then concatenates it with the feature map output by two feature cascade modules along the channel dimension. The concatenated result is processed by the C3K2 module and upsampled again to extract and amplify feature details, and then concatenated with the feature map output by one feature cascade module along the channel dimension. Finally, a C3K2 module is used for final feature extraction and fusion to obtain the output of the neckline.

[0074] To reduce the computational load and number of parameters in the model, this invention uses only a single detection head for small target recognition. It employs a convolutional module to form a decoupled detection head, which outputs the probability distribution of pest categories and the coordinate information of the prediction boxes.

[0075] Each of the above convolutional modules consists of a regular convolutional layer, a batch normalization layer, and a SiLU activation function, which are used to extract features and perform nonlinear transformations.

[0076] like Figure 3As shown, the input image first passes through two convolutional modules with a stride of 2 to reduce the dimensionality of the features and increase the dimensionality of the channels. Then, the output is added to two feature layers obtained from the convolutional module and convolutional attention module, and the C3K2 module, respectively, to obtain the input part of the FCM. After three cascaded FCM operations, deep and detailed features are extracted and fused. Specific structural parameters are shown in Table 1. In Table 1, SepConv represents a depthwise separable convolutional module, Conv represents a regular convolutional module, CBAM represents a convolutional attention module, FCM1, FCM2, and FCM3 represent three levels of cascaded feature modules from front to back, and the C3K2 module is a commonly used feature extraction module in this field.

[0077] Table 1 FCM structural parameters

[0078]

[0079] Sample matching is a key strategy in object detection tasks for determining the correspondence between predicted and ground truth bounding boxes. By appropriately allocating positive and negative samples, model training efficiency and detection performance can be improved. Existing positive and negative sample matching algorithms include... Figure 4 As shown, the orange, green, and blue square anchor boxes correspond to small, medium, and large targets in the image, respectively, with the center point of each box serving as the anchor point. These are used to detect targets of the corresponding sizes. The black target box represents the true location of the target in the image; that is, the target box indicates the true location of the target object, while the prediction box indicates the location predicted by the model.

[0080] Based on the target box position, anchor points within the target box range are counted as candidate points, and alignment scores are obtained using formula (1).

[0081] t = s α ×u β (1)

[0082] In the formula, u is the CIoU value between the predicted bounding box output by the candidate anchor and the current target bounding box, s represents the predicted class score output by the candidate anchor, and α and β are the hyperparameters set.

[0083] For each target box, the 10 anchor points with the highest alignment scores are selected for target box category prediction and prediction box regression. The model outputs a 16-dimensional probability distribution in four directions (left, top, right, and bottom) from the anchor points. After passing through the Softmax function, the distribution is weighted and summed to obtain continuous values ​​of the prediction box distance, as shown in formula (2).

[0084]

[0085] In the formula, l, t, r, b are the distances from the anchor point center to the left, top, right, and bottom of the prediction box, respectively; p l,i ,p t,i ,pr,i ,p b,i It is a Softmax normalized probability distribution that satisfies (* represents l, t, r, b).

[0086] When no anchor point is located within the target bounding box, anchor points that should have been matched as positive samples are incorrectly identified as negative samples, resulting in poor learning performance for small targets during model training. To address this issue, this invention retains only anchor boxes used for detecting small targets and removes anchor boxes used for detecting medium and large targets, such as... Figure 5 As shown in Formula 3. Secondly, anchor points within the target box are counted as initial candidate anchor points. For cases where there are no anchor points within the target box, the four anchor points with the shortest Manhattan distance from the target box's center point are selected as supplementary candidate anchor points for the small target. The candidate anchor points obtained from the two calculations are merged as the overall candidate anchor points for alignment score calculation. Finally, the distance calculation range corresponding to the 16-dimensional discrete probability distribution of the predicted box is changed from [0,15] to [-1,14], as shown in Formula 3.

[0087]

[0088] The total loss function of this invention includes CIoU loss, DFL loss, and classification loss, and the total loss function L total As shown in formula (4):

[0089] L total =λ CIoU L CIoU +λ DFL L DFL +λ cls L cls (4)

[0090] In the formula, L CIoU For the CIoU loss between the predicted bounding box and the target bounding box, L DFL For the distribution focus loss, L cls For classification loss, λ CIoU =7.5, λ DFL =1.5, λ cls =0.5 represent the weight coefficients of the corresponding loss categories, which are derived from large-scale ablation experiments on the COCO dataset.

[0091] L CIoU The calculation formula is shown in (5):

[0092]

[0093] In the formula, IoU is the intersection-union ratio of the predicted bounding box and the target bounding box, c represents the length of the diagonal of the minimum rectangle enclosing the predicted bounding box and the target bounding box, and ρ 2(b,b gt () represents the center point b of the predicted bounding box and the center point b of the target bounding box. gt The square of the Euclidean distance, It is the balance coefficient. This is the difference in aspect ratio, where w and h are the width and height of the predicted bounding box. gt ,h gt The width and height of the target bounding box.

[0094] Unlike the earlier YOLO direct regression prediction of four coordinates (x, y, w, h), this method models the prediction box regression as a distribution prediction and uses DFL (Distribution Focal Loss) to optimize the distribution focus of continuous coordinates.

[0095] L DFL The calculation formula is shown in (6):

[0096]

[0097] In the formula, y l y r The labels for the left / right (or top / bottom) edges of the target bounding box are mapped from the real coordinates to the two nearest integer grid points; The model predicts the probabilities of these two grid points; the DFL is calculated independently for each boundary (l,t,r,b).

[0098] The classification loss uses the binary cross-entropy loss function, and the calculation formula is shown in (7):

[0099]

[0100] In the formula, z i y represents the raw output of the model before activation. i ∈{0,1} represents the true label (0 or 1). N is the number of samples.

[0101] This study trained and tested the model on a 64-bit Ubuntu 20.04 operating system using PyTorch 2.5.0 + cu121 and Python 3.10.15. The system was equipped with an NVIDIA GeForce RTX 2080 Ti GPU, an Intel(R) Core(TM) i9-7960X CPU, and 96GB of RAM. To ensure experimental reproducibility and methodological rigor, an initial learning rate of 0.01 and cosine annealing scheduling were used, with momentum set to 0.9 and weight decay set to 0.0005. A stochastic gradient descent optimizer combined with coupled weight decay was employed. The model was trained for 100 epochs. The input image size was fixed at 800×800×3 resolution, and the training batch size was set to 8.

[0102] This study uses precision, recall, F1-score, mAP, inference time, and model size as evaluation metrics. Based on the difference between the true and predicted values, all samples are divided into four categories: the number of correctly identified positive samples (True Positive, TP), the number of incorrectly identified positive samples (False Positive, FP), the number of correctly identified negative samples (True Negative, TN), and the number of incorrectly identified negative samples (False Negative, FN).

[0103]

[0104] The image acquisition device used in this study was an Android smartphone. The images of wheat pests were acquired in a wheat field, capturing images under natural light conditions during the tillering, stem elongation, and heading stages. The specific image acquisition protocol is shown in Table 2.

[0105] Table 2 Data Acquisition Protocol

[0106]

[0107] After screening the collected raw data, 2433 high-quality images containing 7735 pest annotations were selected. To improve the distribution balance of the model dataset and the robustness of the final model, balancing enhancements were performed on the original images and label data using methods such as rotation, flipping, mosaic enhancement, scaling, and random stitching and fusion. The raw data was divided into a 9:1 ratio, with 90% used for model training and validation, and 10% used for model comparison testing. After balancing enhancement, the model training and validation data were also divided into training and validation sets in a 9:1 ratio. Test images were randomly cropped and padded to ensure their size was consistent with the training images. The final number of pests included in the different datasets were: training set (48944), validation set (5690), and test set (716). The overall flowchart of this experiment is shown below. Figure 6 As shown, the overall system can be divided into four parts: image processing, image balancing and enhancement, dataset partitioning and model training, and model validation. Comparative experiments were conducted with mainstream YOLO object detection models, testing the model's training performance on the same dataset.

[0108] To demonstrate the superiority of the model proposed in this invention, this study conducted comparative experiments on YOLOv8n, YOLOv9t, YOLOv10n, YOLOv11n, YOLOv12n, and YOLOv13n networks. The test results for different models are shown in Table 3, where mAP@0.5 represents the result obtained at IoU = 0.5. As shown in Table 3, the accuracy (93.0%), recall (88.6%), and mAP@0.5 (91.1%) of the model proposed in this invention are all higher than those of mainstream lightweight models such as YOLOv8n and YOLOv9t. Furthermore, the model weight size is only 3.22MB, and the inference time is 4.27ms, balancing lightweight design with high performance, and meeting the real-time detection requirements of field mobile equipment.

[0109] Table 3 Test results for different models

[0110]

[0111] To demonstrate the effectiveness of the proposed network structure and improved sample matching algorithm, representative YOLOv8n, YOLOv12n, and YOLOv13n network models were selected. Ablation experiments were conducted to test the effectiveness of the improved positive and negative sample matching algorithm, the number of detector heads, and the network structure. The results are shown in Table 4.

[0112] Table 4 shows that ablation experiments with different numbers of detector heads demonstrate that a single detector head is sufficient for small target detection, reducing the number of model parameters and inference speed while maintaining detection accuracy. The ablation experiments show that the single-detector-head architecture reduces model weights by approximately 37%–40% and improves inference speed by approximately 15%–27%. Using the improved sample matching algorithm, the model's Precision, Recall, F1-score, and mAP@0.5 all show varying degrees of improvement, proving the correctness of the theoretical analysis and the effectiveness of the practical application of the improved algorithm.

[0113] Table 4 Ablation Experiment

[0114]

[0115] This study collects images of wheat pests in the field and performs balanced enhancement processing on the raw data to improve the robustness and feature extraction ability of the model in complex environments. A target detection network is constructed, and a backbone feature extraction network based on feature cascade modules is designed to enable the model to integrate shallow feature information during forward propagation, enhancing its ability to extract detailed features. An improved sample matching algorithm is used to overcome the defect of traditional algorithms in assigning small targets, ensuring that all targets in the labels are correctly assigned and reducing the false negative rate in small target detection. Comparative experiments with different network models show that, under lightweight conditions, the proposed model still maintains a maximum detection accuracy of 93.0%, a recall rate of 88.6%, and an average detection precision of 91.1%. Ablation experiments further demonstrate that the proposed network model and improved sample matching algorithm show significant improvements in average precision, detection speed, and computational cost compared to traditional networks.

[0116] Finally, it should be noted that any parts of this invention not described in detail are prior art. Those skilled in the art will understand that the above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.

Claims

1. A method for recognizing small objects in complex scenes, characterized in that, Includes the following steps: Step S1: Obtain and construct an image dataset containing small objects; Step S2: Construct a target recognition network based on the YOLO architecture. This target recognition network includes an input end, a backbone feature extraction network, a connection to the neck, and a head detection network. An improved sample matching algorithm is used to assign positive and negative samples. The backbone feature extraction network includes multiple feature cascade modules, which are used to fuse shallow feature information during forward propagation to enhance the ability to extract detailed features. The improved sample matching algorithm for small targets first counts the anchor points within the target box as preliminary candidate anchor points; if there are no anchor points within the target box, then selects the anchor points with the shortest Manhattan distance from the center point of the target box as supplementary candidate anchor points to participate in the alignment score calculation. The detection head is a single detection head designed for small target identification; Step S3: Train the target recognition network using the image dataset; Step S4: Use the trained target recognition network to detect the input image and identify small object targets within it.

2. The method for small object target recognition in complex scenes according to claim 1, characterized in that, In step S1, the acquired images are pest images of wheat in the field during tillering, stem elongation, and heading stages; in step S4, the identified targets are pests in the wheat images in the field.

3. The method for small object recognition in complex scenes according to claim 1, characterized in that, In step S2, the backbone feature extraction network employs two convolutional modules and three feature concatenation modules. The implementation process of the feature concatenation modules is as follows: The input of the feature concatenation module is first concatenated with the intermediate layer feature output of the previous feature concatenation module in the channel dimension; The concatenated features are extracted using a depthwise separable convolutional module to obtain a feature layer with half the feature scale. This feature layer serves two purposes: firstly, it outputs intermediate features from the current feature cascade module to the next feature cascade module; secondly, it performs feature extraction through the first path and the second path, respectively. The first path sequentially uses a convolutional module and a convolutional attention module to extract detailed features; the second path uses a C3K2 module to extract deep features in complex scenes; the two feature layers obtained from the first and second paths are added together to obtain the final output of the current feature cascade module.

4. The method for small object target recognition in complex scenes according to claim 3, characterized in that, The convolutional module consists of a regular convolutional layer, a batch normalized layer, and a SiLU activation function in sequence; the depthwise separable convolutional module consists of a depthwise separable convolutional layer, a batch normalized layer, and a SiLU activation function in sequence.

5. The method for small object target recognition in complex scenes according to claim 3, characterized in that, The feature fusion process for the connecting neck includes: (1) Upsample the feature map output by the backbone feature extraction network and concatenate it with the feature map output by the two feature concatenation modules along the channel dimension. (2) The C3K2 module is used to extract features from the spliced ​​feature map and upsample it. Then, it is spliced ​​with the feature map output by the feature concatenation module once in the channel dimension. (3) Finally, the C3K2 module is used to extract and fuse the features after splicing in step (2) to obtain the output of the neck connection.

6. The method for small object target recognition in complex scenes according to claim 1, characterized in that, In the improved sample matching algorithm: if there are no anchor points in the target box, select the four anchor points with the shortest distance to the Manhattan distance of the target box center point as supplementary candidate anchor points; merge the preliminary candidate anchor points and the supplementary candidate anchor points, and calculate the alignment score of each candidate anchor point; select up to 10 anchor points with the highest alignment scores for target box category prediction and prediction box regression; at the same time, adjust the distance calculation range corresponding to the 16-dimensional discrete probability distribution of the prediction box from [0,15] to [-1,14].

7. The method for small object target recognition in complex scenes according to claim 6, characterized in that, In the improved sample matching algorithm, the continuous values ​​of the predicted box distance are calculated using the following formula: In the formula, l, t, r, b are the distances from the anchor point center to the left, top, right, and bottom boundaries of the prediction box, respectively, and p l,i ,p t,i ,p r,i ,p b,i It is a Softmax normalized probability distribution.

8. The method for small object target recognition in complex scenes according to claim 1, characterized in that, In step S2, the total loss function of the target recognition network includes CIoU loss, DFL loss, and classification loss. The total loss function is: L total =λ CIoU L CIoU +λ DFL L DFL +λ cls L cls In the formula, L CIoU For the CIoU loss between the predicted bounding box and the target bounding box, L DFL For the distribution focus loss, L cls For classification loss, λ CIoU , λ DFL , λ cls These are the weighting coefficients for the corresponding losses.

9. A method for small object target recognition in complex scenes according to claim 2, characterized in that, The single detection head is a decoupled detection head, composed of convolutional modules, which output the probability distribution of pest categories and the coordinate information of prediction boxes.

10. A method for small object recognition in complex scenes according to claim 1, characterized in that, The input image of the target recognition network is an RGB image with a size of 800×800×3 pixels.