A small target detection method and system based on an improved YOLOv8 structure
Patent Information
- Application Number
- CN202510413963.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-04-03
AI Technical Summary
然而,这种方法通过固定阈值对重叠的检测框进行严格抑制,在小目标密集场景下容易误删真实目标,从而显著降低小目标的召回率和整体检测精度
[0032] The beneficial effects of this invention are as follows: By improving YOLOv8 and introducing a scale sequence feature fusion module and a three-feature encoder module, the method significantly enhances the network's ability to fuse multi-scale features, thereby improving the accuracy of capturing and recognizing small target features. Furthermore, by adding a P2 detection layer, the network possesses a higher resolution feature representation, specifically designed for small-scale target detection. Soft nonmaximum suppression (Soft-NMS) avoids the potential for missed detections of small targets caused by the hard suppression of traditional NMS, thus improving the recall and accuracy of detection in dense scenes.
Smart Images

Figure CN120356060B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image target recognition technology, specifically relating to a small target detection method and system based on an improved YOLOv8 structure. Background Technology
[0002] With the development of computer vision technology, object detection has been widely applied in various fields, including smart agriculture, security monitoring, autonomous driving, wildlife protection, medical image analysis, and industrial quality inspection. In many practical applications, the targets to be detected are often small in scale, such as pest detection in agricultural plant protection, lesion identification in medical imaging, small target tracking in surveillance videos, and long-distance obstacle detection in autonomous driving. However, existing technologies still face many challenges in small target detection.
[0003] Object detection methods can generally be divided into two-stage detection and single-stage detection methods. Two-stage object detection methods, such as R-CNN and its variants, typically generate a large number of candidate regions first, and then classify each candidate region one by one. Although these methods have high detection accuracy, they suffer from high computational cost and poor real-time performance, making them difficult to meet the needs of scenarios with high real-time requirements, such as security monitoring and autonomous driving applications.
[0004] Single-stage object detection methods, such as YOLO (You Only Look Once), achieve higher real-time detection by directly predicting bounding boxes and class probabilities across the entire image. However, these methods often perform poorly in detecting small objects, mainly due to the following reasons:
[0005] First, the fixed grid partitioning strategy used by the YOLO method can easily lead to the loss of feature information in small target areas, making it difficult to capture the fine-grained features of small targets. This results in the problem of missing small targets in dense or complex background environments.
[0006] Secondly, single-stage detection methods typically rely on predefined anchor frames for target localization. These anchor frames have fixed sizes and are difficult to adapt to small targets of different scales and densities. In particular, in fields such as smart agriculture, medical imaging, and industrial quality inspection, it is common for small targets to be diverse in scale and densely distributed. Existing detection models cannot effectively adapt to such scenarios.
[0007] Furthermore, existing object detection methods generally employ traditional non-maximum suppression (NMS) as a post-processing step to remove redundant candidate boxes. However, this method, by strictly suppressing overlapping detection boxes with a fixed threshold, is prone to mistakenly deleting real targets in scenes with densely packed small targets, thus significantly reducing the recall rate and overall detection accuracy for small targets.
[0008] In summary, current target detection methods still have significant shortcomings in terms of accuracy, scale adaptability, and real-time performance in small target detection. These shortcomings limit their effective application in fields such as smart agriculture, medical diagnosis, security monitoring, autonomous driving, and industrial inspection. There is an urgent need to propose a small target detection technology that combines real-time performance and high accuracy to address these technical deficiencies. Summary of the Invention
[0009] The purpose of this invention is to address the shortcomings of the aforementioned background technology and provide a small target detection method and system based on an improved YOLOv8 structure, which significantly enhances the ability to identify small targets in dense and complex scenes.
[0010] The technical solution adopted in this invention is: a small target detection method based on an improved YOLOv8 structure, comprising the following steps:
[0011] The image to be detected is preprocessed to obtain a standardized image;
[0012] The standardized image is input into the YOLOv8 backbone network to extract multi-scale feature maps;
[0013] The feature map is input into the neck network of YOLOv8 for fusion processing; the neck network introduces the ASF mechanism and integrates a scale sequence feature fusion module and a three-feature encoder module to perform multi-scale integration of features at different resolutions and output a fused feature map.
[0014] Based on the fused feature map, detection layers P2, P3, P4, and P5 are generated to detect targets of different sizes.
[0015] The P2–P5 detection layers respectively generate candidate bounding boxes and their category confidence scores;
[0016] The candidate bounding boxes are processed by soft nonmaximum suppression: based on the cross-union ratio between candidate bounding boxes, the confidence of the candidate bounding boxes is reduced, and the final detection result is output.
[0017] In the above technical solution, the mid-level features output by the backbone network are fused and then scale sequence integration is performed. The fused features are then added to the deep feature map output by the backbone network after being processed by the scale sequence feature fusion module to obtain the feature map corresponding to the resolution of the P3 detection layer.
[0018] In the above technical solution, the deep features output by the backbone network are processed by the scale sequence feature fusion module and the three-feature encoder module to obtain the feature map corresponding to the resolution of the P4 detection layer.
[0019] In the above technical solution, the shallow features output by the backbone network, the feature maps corresponding to the resolutions of the P3 and P4 detection layers are scaled and integrated, and then added and fused with the feature map corresponding to the resolution of the P3 detection layer, which has been successively upsampled, concatenated with the shallow features output by the backbone network, and processed by the residual module, to obtain the feature map corresponding to the resolution of the P2 detection layer.
[0020] In the above technical solution, the deep features output by the backbone network are processed by the scale sequence feature fusion module and the three-feature encoder module to obtain the feature map corresponding to the resolution of the P5 detection layer.
[0021] In the above technical solution, the soft nonmaximum suppression processing includes: calculating the cross-union ratio of the overlapping regions between multiple candidate target boxes, and linearly or Gaussianly decaying the corresponding confidence based on the degree of overlap, thereby retaining some neighboring small target candidate boxes and improving the detection recall rate in dense small target scenes.
[0022] In the above technical solution, the method is applicable to aerial images collected by drones equipped with camera devices, or to applications such as remote sensing monitoring, traffic management, and dense detection of small targets in agricultural plant protection.
[0023] This invention also provides a small target detection system based on an improved YOLOv8 architecture, comprising:
[0024] The image input module is used to receive the image to be detected;
[0025] The backbone network module is used to extract multi-scale features of the image;
[0026] The neck network module introduces the ASF mechanism and integrates a scale sequence feature fusion module and a three-feature encoder module to perform deep fusion of shallow, middle and deep features extracted by the backbone network and generate high-quality multi-scale fusion feature maps.
[0027] The feature generation module constructs P2, P3, P4 and P5 detection layers based on multi-scale fused feature maps to ensure that targets at different scales can be fully detected;
[0028] The detection head module is used to generate candidate target boxes and their category confidence scores corresponding to the P2–P5 detection layers;
[0029] The soft nonmaximum suppression module is used to attenuate the confidence of candidate target boxes based on the cross-union ratio between them and output the final detection result.
[0030] In the above technical solution, the process of generating the feature map corresponding to the resolution of the P2 detection layer includes: performing a scale sequence integration operation on the shallow features output by the backbone network, the feature maps corresponding to the resolutions of the P3 and P4 detection layers, and then adding and fusing them with the feature map corresponding to the resolution of the P3 detection layer, which has been sequentially upsampled, concatenated with the shallow features output by the backbone network, and processed by the residual module, to obtain the feature map corresponding to the resolution of the P2 detection layer.
[0031] In the above technical solution, the soft nonmaximum suppression module calculates the intersection-union ratio between candidate target boxes and adjusts the confidence of candidate boxes using a linear or Gaussian decay function based on the degree of overlap, thereby improving the detection recall rate in scenarios with dense small targets.
[0032] The beneficial effects of this invention are as follows: By improving YOLOv8 and introducing a scale sequence feature fusion module and a three-feature encoder module, the method significantly enhances the network's ability to fuse multi-scale features, thereby improving the accuracy of capturing and recognizing small target features. Furthermore, by adding a P2 detection layer, the network possesses a higher resolution feature representation, specifically designed for small-scale target detection. Soft nonmaximum suppression (Soft-NMS) avoids the potential for missed detections of small targets caused by the hard suppression of traditional NMS, thus improving the recall and accuracy of detection in dense scenes.
[0033] Furthermore, by performing a scale sequence integration operation on the mid-level features output by the backbone network and then adding and fusing them with the deep feature map, the present invention can more effectively fuse mid-level and deep semantic information, enhance the representation ability of mid-scale target features, further optimize the accuracy of small target detection, and reduce the false negative rate.
[0034] Furthermore, this invention processes the deep features output by the backbone network through a scale sequence feature fusion module and a three-feature encoder module to obtain a more representative P4 detection layer. This enhances the network's ability to capture deep semantic information in complex backgrounds and scenes with dense small targets, thereby improving the robustness and accuracy of target detection.
[0035] Furthermore, this invention fuses shallow features with feature maps corresponding to the resolutions of the P3 and P4 detection layers after scale integration, and then further fuses them with the feature map corresponding to the resolution of the P3 detection layer after upsampling, stitching, and residual module processing, to obtain a higher resolution feature map corresponding to the resolution of the P2 detection layer. This significantly enhances the network's ability to express fine-grained spatial features, enabling the network to more effectively extract and utilize fine spatial information when detecting extremely small targets, thereby improving the accuracy and recall of small target detection.
[0036] Furthermore, this invention limits the deep features of the backbone network to be processed by the scale sequence feature fusion module and the three-feature encoder module to obtain the feature map corresponding to the resolution of the P5 detection layer. This ensures that the network can make full use of the feature representation at a higher level of abstraction, better achieve the improvement of small target detection performance in large-scale scenes, and thus improve the overall detection performance of the model in multi-scale target mixed scenes.
[0037] Furthermore, the Soft Non-Maximum Suppression (Soft-NMS) of the present invention attenuates the confidence of candidate target boxes in a linear or Gaussian manner. Compared with the traditional Non-Maximum Suppression (NMS) method, it avoids over-suppression of highly overlapping target boxes, allowing some real small target boxes to be retained. This effectively solves the problem of missed detection caused by the accidental deletion of real targets in dense small target scenes, and significantly improves the detection recall rate in dense small target scenes.
[0038] Furthermore, by explicitly applying the method to scenarios involving dense detection of small targets, such as UAV aerial imagery, remote sensing monitoring, traffic management, and agricultural plant protection, this invention effectively broadens the practical application scope of the detection method. This allows the technology to be more widely applied in several important fields requiring real-time, high-precision small target detection, demonstrating good practical value and application prospects. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0040] Figure 2 This is a schematic diagram of the improved YOLOv8 network structure of the present invention;
[0041] Figure 3 This is a schematic diagram illustrating the experimental results using existing technologies;
[0042] Figure 4 This is a schematic diagram illustrating the experimental results of using the present invention. Detailed Implementation
[0043] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments to facilitate a clear understanding of the present invention, but these descriptions do not constitute a limitation on the present invention.
[0044] Example 1
[0045] like Figure 1 As shown, the present invention provides a small target detection method based on an improved YOLOv8 structure, comprising the following steps:
[0046] A. Preprocess the image to be detected to obtain a standardized image;
[0047] B. Input the standardized image into the YOLOv8 backbone network to extract multi-scale feature maps, including shallow, medium and deep features;
[0048] C. The multi-scale feature map is input into the neck network for feature fusion. The neck network introduces the ASF mechanism and integrates a Scale Sequence Feature Fusion (SSF) module and a Triple Feature Encoding (TFE) module. The SSF module is used to normalize, upsample, and concatenate and fuse features from different scales. The TFE module is used to encode the fused features to form a multi-scale fused feature map.
[0049] D. Based on the multi-scale fused feature map, generate a multi-resolution detection layer including P2, P3, P4, and P5, where:
[0050] The feature map corresponding to the resolution of the P3 detection layer is obtained by adding the mid-layer features output by the backbone network to the deep feature map processed by the SSF module after the scale sequence integration operation.
[0051] The feature map corresponding to the resolution of the P4 detection layer is obtained by processing the deep features output by the backbone network through the SSF module and the TFE module.
[0052] The feature map corresponding to the resolution of the P2 detection layer is obtained by first performing a scale sequence integration operation on the shallow features output by the backbone network, the feature maps corresponding to the resolutions of the P3 and P4 detection layers, and then adding and fusing them with the feature map corresponding to the resolution of the P3 detection layer after upsampling, concatenation with the shallow features output by the backbone network, and processing by the residual module.
[0053] The feature map corresponding to the resolution of the P5 detection layer is obtained by processing the deep features output by the backbone network through the SSF module and the TFE module.
[0054] E. Input the feature maps of the corresponding resolutions of the detection layers P2 to P5 into the corresponding detection heads to generate candidate target boxes and their category confidence scores;
[0055] F. Perform soft nonmaximum suppression (Soft-NMS) on the candidate target boxes. Adjust the confidence level using a linear or Gaussian decay function based on the intersection-over-union (IoU) ratio between candidate boxes to suppress redundant boxes and improve the detection recall in dense small target scenes. Output the final detection result. The specific process includes:
[0056] Calculate the intersection-union ratio (IoU) between candidate bounding boxes;
[0057] When the IoU between candidate bounding boxes is less than a predetermined threshold, their confidence level remains unchanged;
[0058] When the IoU between candidate bounding boxes is greater than or equal to a predetermined threshold, the confidence of the candidate bounding boxes is attenuated according to a linear or Gaussian decay function, and the final detection result is output.
[0059] like Figure 2 As shown, the backbone of YOLOv8 consists of multiple Conv layers, several C2f modules, and one SPPF module from top to bottom. The output of the upper-layer module serves as the input of the lower-layer module, as detailed below:
[0060] The first Conv layer performs preliminary convolutional feature extraction on an input image of size 640×640×3, including basic spatial receptive field expansion and channel transformation. It outputs a low-level feature map, typically preserving preliminary visual information such as edges and corners, preparing for subsequent layers.
[0061] The second Conv layer further stacks convolutional operations to enhance local feature representation or appropriately adjust channels / resolution, extracting more fine-grained texture information. The output is a richer local feature map than the first layer, but it is still at a relatively high resolution and has not been significantly downsampled.
[0062] The third-layer C2f module combines residual thinking with partial feature reuse (Cross Stage). It divides the input features into several branches, performs convolution processing on each branch separately, and then concatenates or sums the branch results, thereby improving feature representation and reducing redundant computation. The output is a shallow feature map with high resolution and more detail retention, which is crucial for detecting small targets.
[0063] The fourth Conv layer performs another convolution operation to extract higher-level patterns based on the shallow features, or to further scale the resolution. The output is a feature map that has been enhanced from the shallow features, which serves as input for the subsequent C2f module.
[0064] The fifth layer, C2f, builds upon the existing convolutional output. By fusing multi-branch parallel convolutions with residuals, C2f extracts more semantic features. The output is the first mid-layer feature map, with a slightly lower resolution compared to the shallower layers, containing more abstract semantic information.
[0065] The sixth Conv layer continues to perform convolutional transformations on the mid-layer features, which may include downsampling or channel adjustment, preparing for subsequent mid-layer or deeper C2f layers. The output is a more compact but semantically focused feature map.
[0066] The seventh layer C2f again uses multi-branch convolution and fusion strategies to further refine the details and semantic information in the mid-layer features; it outputs a second mid-layer feature map, which is more semantically in-depth, but still retains some spatial details.
[0067] The eighth layer, Conv, after continuous downsampling or convolution processing, brings the features to a deeper level, usually significantly reducing the resolution while retaining more condensed semantic information; it serves as input for the final deep layer C2f.
[0068] The ninth layer, C2f, performs multi-branch convolution and residual fusion on the existing features, further refining the high-order features; the output uses mid-level features, which can be further fused with shallow / deep layers in the Neck for multi-scale fusion.
[0069] The tenth layer, SPPF (Spatial Pyramid Pooling Fast), expands the network's receptive field and captures global context by performing multi-scale pooling operations (e.g., max pooling with k=5,9,13) on the feature maps and concatenating the results. It outputs deep feature maps with the lowest resolution but the strongest semantics, which can be fused with other feature layers in subsequent Neck structures. This is particularly helpful for detecting large targets or targets in complex backgrounds.
[0070] The neck network portion of YOLOv8 aims to improve its ability to detect small targets in complex backgrounds, such as distant and cluttered backgrounds, by integrating the ASF module into YOLOv8. The ASF module includes a Scale Sequential Feature Fusion (SSFF) module and a Triple Feature Encoder (TFE) module.
[0071] The Scale Sequence Feature Fusion (SSFF) module consists of:
[0072] Input: Deep features from the final downsampled backbone network (such as SPPF output), or the output of the previous SSFF module. If multiple SSFF modules are cascaded, the input of the next SSFF is the output of the previous SSFF, realizing segmented, multi-level, deep fusion.
[0073] Conv: Within SSFF, the input features are first subjected to two convolution (Conv) operations for channel adjustment, feature extraction, or activation processing. This convolution reduces the computational burden of directly scaling and stitching large-channel, multi-scale features, and provides initial screening of target information;
[0074] The ZoomCat operation scales the convolutional feature map to different degrees (Zoom), such as upsampling / downsampling or dilated convolution, and then concatenates them along the channel / scale dimensions (Concat) to form 3D or multi-branch features. This step achieves "adaptive multi-scale reconstruction" of deep features in a single path, balancing high semantics and local details.
[0075] C2f or Lightweight Residual Fusion: The multi-scale features concatenated by ZoomCat are usually fused through a C2f (or similar residual / convolutional) module to produce the final SSFF output features. If there is a next SSFF, this output needs to be passed to the next SSFF; otherwise, it can be passed to TFE or subsequent branches.
[0076] Since the input to SSFF can sequentially come from deep features of the backbone network or the output of the previous SSFF, iterative processing can be used to enhance the multi-scale representation capability of deep features. By first performing convolution processing on the features, noise can be better filtered, channels reduced, and the dimensionality burden during ZoomCat stitching can be decreased, while highlighting key features related to small targets. The features output by SSFF can be used by downstream TFE modules or detection heads, providing rich global context and multi-scale information for the recognition of large targets, complex backgrounds, and small targets. SSFF normalizes, upsamples, and stitches features at multiple scales, and fuses them through 3D convolution operations. This operation fuses global semantic information across scales, enabling YOLOv8 to better recognize targets of different sizes, orientations, and aspect ratios, which is particularly important in aerial scenes where targets change greatly due to variations in altitude and viewpoint.
[0077] The Triple Feature Encoder (TFE) module consists of:
[0078] Input: The output from an SSFF module or the output from the previous TFE. TFE modules can be stacked in multiple stages or connected in series with SSFFs to form a multi-fusion pipeline; if this TFE is the first TFE, the input comes directly from an SSFF. The input features may already contain some multi-scale or deep information, but still need to be further refined and fused in the TFE.
[0079] Conv (preprocessed convolution): Before multi-branch convolution and concatenation (Concat), a convolution (Conv) operation is performed first: it performs preliminary adaptation on the input feature channels, resolution or feature distribution, reducing channel dimension conflicts in subsequent parallel branch processing; it extracts higher-level or more aggregated feature information, making it easier to focus on key targets when encoding in parallel with three branches; and it provides a relatively unified input basis, so that subsequent branches can perform convolution on a "similar" feature space.
[0080] Three-branch parallel convolution and concatenation (Concat): TFE splits or replicates the input features into multiple branches, each with different kernel sizes, dilation rates, or lightweight attention operations to obtain feature descriptions under large, medium, and small receptive fields, taking into account both fine-grained and global context; the branch outputs are concatenated (Concat) along the channel dimension and then fused in a C2f (or residual structure) to generate the final output.
[0081] C2f / Residual Fusion: The concatenated features can be further processed by a lightweight C2f (or other residual structure) convolutional fusion. The residual / parallel channel strategy mitigates gradient vanishing and enhances the network's expressive power, resulting in the final TFE output. The fused features after TFE multi-branch encoding can be passed to the next TFE (if any) or sent to other branches / detection heads in the Neck. This progressively enhances the network's ability to recognize targets of various sizes, preserving more details and incorporating deeper semantics.
[0082] This embodiment introduces a TFE module at the standard stitching operation between the YOLOv8 neck network layers. The TFE module selectively integrates feature maps of small, medium, and large scales, improving upon the limited aggregation of YOLOv8 through simple summation and stitching. By explicitly encoding features at each scale, the TFE module enhances the preservation of fine-grained spatial details, which is crucial for recognizing small targets against cluttered backgrounds.
[0083] Compared with single-path convolution, triple parallel coding allows multi-branch convolution to characterize multiple receptive fields of input features within the same level, which is beneficial for simultaneously taking into account the semantics of large targets and the details of small targets.
[0084] By allowing the TFE to be input from the previous TFE or SSFF, the network can alternately perform "deep multi-scale construction" (SSFF) and "multi-branch coding fusion" (TFE) to refine or amplify the ability to identify targets step by step.
[0085] If multiple TFEs are configured in the network design, then subsequent TFEs will further refine the feature expression based on the results of the previous TFE, so that the detection head can obtain higher quality input features, which is particularly suitable for fine localization and recognition in dense scenes of small targets.
[0086] SSFF is inserted only after the final downsampled features of the backbone network (or the previous SSFF), achieving multi-scale adaptive reconstruction of a single deep feature through "Conv+ZoomCat+Residual Fusion". TFE input comes from SSFF or the previous TFE and can be stacked multiple times. Through triple parallel encoding and concatenation, the expressive power of features for targets of different sizes is enhanced. The two are usually used together in the Neck: SSFF is responsible for multi-scale scaling and concatenation of deep features, and TFE is responsible for three-way parallel encoding and fusion, forming a progressive feature enhancement, which ultimately outputs high-precision target localization and classification results for the detector head.
[0087] The generation path of the P3 feature layer mainly includes two branches:
[0088] Deep branches: The final deep features (SPPF output) of the backbone network are processed by two cascaded SSFF modules;
[0089] Intermediate branch: The intermediate features generated by the three C2f modules output from the backbone network are processed by the ScalSeq module.
[0090] Finally, the deep and mid-level branches perform an Add operation to achieve feature fusion, outputting a feature map at the resolution corresponding to the P3 detection layer.
[0091] Specifically, the deep branch is: SPPF→SSFF→SSFF:
[0092] The Spatial Pyramid Pooling (SPPF) module at the very end of the backbone outputs a deep feature map containing the global receptive field and the strongest semantic information, but with low resolution. It provides deep semantic support for subsequent modules, helping to detect targets in complex or large-scale background scenes.
[0093] The first SSFF module in the Neck section first performs convolution on deep features to adjust the number of channels and extract key semantics, reducing redundancy in subsequent scaling and concatenation. The convolved features are then scaled (zoomed) or interpolated at different ratios, and concatenated in the newly added scale / channel dimensions to form a feature tensor with more multi-scale semantics. The ZoomCat output is then fused using C2f (or residual convolution) to obtain the output features of the first SSFF.
[0094] The second SSFF module takes as input the output features of the first SSFF. The process is similar: first, convolution (Conv), then ZoomCat concatenation; further fusion via C2f / residual; the final output is a feature map resulting from multiple deep, multi-scale fusions, representing the deep branch. This result offers richer global context and partial detail recovery capabilities.
[0095] Specifically, the intermediate branch is: C2f output of the backbone network intermediate layer → ScalSeq
[0096] After the shallow C2f layer, the backbone network will downsample and perform several C2f operations (there are three intermediate C2f layers in total) to output three intermediate feature maps. Each of them is roughly similar in resolution and semantic abstraction, but they have their own differences for different local regions and textures.
[0097] The ScalSeq module simultaneously receives three C2f mid-level outputs; it slightly scales or aligns the mid-level features (if there are minor differences in resolution), and then stacks or concatenates them in the scale or channel dimension; it fuses the three mid-level features through convolution or lightweight attention operations, so that the output features have both more details and mid-level semantics. The output is the fused mid-level feature map of ScalSeq, which is the result of the mid-level branch.
[0098] The Add operation is performed as follows: deep branch + middle branch → P3
[0099] The deep branch output is a feature map obtained by cascading SPPF+SSFF+SSFF. It has strong semantics and low resolution, but after multiple ZoomCat and residual operations, it has certain multi-scale information.
[0100] The output of the intermediate branch is a feature map obtained by integrating the outputs of the three intermediate C2f layers through ScalSeq. It has a higher resolution than the deep features and has considerable semantic and texture representation.
[0101] After aligning the two feature maps in the same spatial dimension, perform element-wise addition: retain and overlay the global semantic information of the deep branches; at the same time, supplement the details and medium-scale information of the middle branches.
[0102] The output feature map of the P3 detection layer at the corresponding resolution integrates information from deep and mid-level branches, possessing both context awareness and preserving a certain spatial resolution, making it well-suited for detecting small-scale targets.
[0103] The generation path for the P4 feature layer is: SPPF→SSFF→SSFF→TFE.
[0104] SPPF inputs deep feature maps from the ends of the backbone network. These maps have low resolution but contain strong semantic and global contextual information. Multi-scale pooling is used to integrate the context, improving the understanding of a large range of backgrounds. This provides deep basal features for subsequent modules to construct higher-level detection feature maps.
[0105] The first SSFF module first performs convolution (Conv) operations on the deep features output by SPPF, adjusting the number of channels or performing preliminary refinement to reduce noise and focus on target-related features. The convolved features are then scaled (Zoom) or dilated convolutionally processed in the scale dimension. Features at different resolutions are then concatenated (Concat) in the channel / new dimension to form a multi-scale fused representation. After concatenation, the multi-scale features are convolved and residual integrated (C2f) to output the deep fused features of the first SSFF.
[0106] The output features of the first SSFF module are then fed into the second SSFF, forming a cascade. The second SSFF is identical to the first: it first performs Conv, then ZoomCat, and after multi-scale stitching, it is fused using C2f or a residual structure. By stacking multiple SSFFs, the ability of deep features to perceive small targets is further enhanced, and the loss of detail caused by low resolution is compensated.
[0107] The deep multi-scale fusion features obtained by stacking multiple SSFFs serve as the input for the subsequent TFE module.
[0108] The deep multi-scale fusion features from the second SSFF module already possess considerable global semantics and some detailed information, but still require multi-branch parallel encoding within the TFE. Before the parallel branches, a convolution is performed on the input features to unify feature channels or filter key textures, reducing redundancy between branches. The convolutional features are then split or copied to three parallel branches, each potentially with different kernel sizes or dilation rates.
[0109] Large receptive field branch: more suitable for semantic capture of larger or more dispersed targets;
[0110] Mid-receptive field branch: standard 3×3 convolution, taking into account both local details and context;
[0111] Small receptive field branch: This could be a 1×1 convolution or a lighter convolution, highlighting the edges and textures of small objects.
[0112] The outputs of the parallel branches are concatenated along the channel dimension to obtain a feature map that integrates information from large, medium, and small receptive fields.
[0113] The concatenated multi-branch features are then integrated using C2f or a lightweight residual structure through convolution to output the final triple feature encoding result.
[0114] The output P4 detection layer's feature map at the corresponding resolution combines the advantages of deep multi-scale fusion (from SSFF) and triple parallel encoding (TFE). The generation path of the P4 detection layer goes through multiple deep feature enhancements (dual SSFF) and triple encoding (TFE), which not only enhances contextual understanding but also takes into account details in multi-branch parallel convolution, making it suitable for detecting medium to large targets or subtle targets in complex backgrounds.
[0115] The generation path for the P5 feature layer is: SPPF→SSFF→SSFF→TFE→TFE.
[0116] The SPPF module at the end of the backbone network outputs deep feature maps, which have the lowest resolution but the strongest global receptive field and abstract semantics. By compressing contextual information into deep features through multi-scale pooling, it helps to identify large targets or make global judgments in complex backgrounds, providing a highly condensed basic representation for subsequent SSFF and TFE.
[0117] The first SSFF module performs convolution on the deep features output by SPPF to filter key target information, reduce noise, and adjust channels or resolution. Then, a Zoom-Cat operation is performed: the convolutionally processed feature map is scaled by different factors (zoom) and concatenated along the scale or channel dimensions (concat) to form a multi-scale fused representation. This allows for multi-scale adaptive processing within the same deep feature layer. The concatenated features are then refined using C2f or residual convolution to output the multi-scale deep features of the first SSFF.
[0118] The deep fusion features output by the first SSFF contain some multi-scale information but can still be further enhanced. The second SSFF module is similar to the first SSFF: first convolution (Conv), then Zoom-Cat, and finally C2f residual fusion. After stacking multiple SSFFs, the deep features gain stronger semantics and a certain ability to restore details in multiple scale dimensions.
[0119] The input to the first TFE module is the fused feature map output from the second SSFF module. Before the parallel branch, the input features are convolved to unify the channel dimensions and aggregate important features. The convolved features are then copied / divided into three parallel paths, which perform convolutional encoding on small, medium, and large receptive fields respectively.
[0120] Large receptive field branch: More suitable for large targets or global background;
[0121] Mid-receptive field branch: conventional 3×3 convolution balances local and global aspects;
[0122] Small receptive field branches: 1×1 or lightweight convolutions preserve detailed information.
[0123] The parallel branch outputs are concatenated along the channel dimension, fusing features from multiple receptive fields. The concatenated three-way features are then convolved and integrated with residuals to output the first TFE result feature.
[0124] The input to the second TFE module comes from the output features of the first TFE. The process is similar to the previous TFE: first convolution, then three-branch parallel convolution and concatenation, and finally C2f or residual fusion. By stacking multiple levels of TFE, the expressive power for multi-size targets can be further enriched each time.
[0125] The final feature map, after two TFE depth encodings, is used as the feature map for the corresponding resolution of the P5 detection layer.
[0126] The P5 detection layer, based on the deepest feature set (SPPF), undergoes multiple SSFF multi-scale enhancements and two TFE triple parallel encodings, achieving global semantic and multi-scale information fusion. In the detection head, it exhibits high stability for large targets or scenes with complex backgrounds; it also provides some support for small targets, as details may still be preserved due to multiple residuals and small receptive field branches. As the deepest detection layer in the network, P5, along with P2, P3, and P4, covers the detection needs of targets of different sizes. In small target detection tasks such as UAV imagery, it can balance global context and detailed characterization, thus achieving better results.
[0127] The generation path of the P2 detection layer is based on two main fusion branches:
[0128] First branch: [P3 detection layer, P4 detection layer, shallow feature map] → ScalSeq
[0129] Second branch: P3 detection layer → Upsample → Concat → C2f
[0130] Then, the outputs of these two branches are added to generate the P2 detection layer.
[0131] The input features of the first branch include:
[0132] The feature map corresponding to the resolution of the P3 detection layer: the features generated after deep fusion of the middle layer, which has both semantic and resolution properties;
[0133] The feature map corresponding to the P4 detection layer is generated after deeper processing, resulting in stronger semantics, but lower resolution.
[0134] Backbone's first C2f output (shallow feature map): the earliest C2f in the network, with the highest resolution and retaining the most details.
[0135] The three input features of the ScalSeq module each have different numbers of channels or spatial dimensions. ScalSeq typically performs minimal scaling / channel adaptation first to ensure dimensionality matching during subsequent concatenation / fusion. The three features at different levels are concatenated (Concat) along the newly added "scale" or channel dimension to form a "multi-scale sequence" feature. Subsequent processing using convolution or attention can refine these features uniformly, converging shallow details, mid-level features, and deeper semantics onto a single feature map. The output is a multi-scale feature map that integrates shallow features (Backbone's first C2f output), P3, and P4 information, representing the first branch result.
[0136] The second branch uses the feature map at the resolution corresponding to the P3 detection layer as input. Upsampling is performed on the feature map at the P3 detection layer resolution (e.g., by 2x interpolation or deconvolution) to make it spatially closer to the shallower features, preserving / restoring more spatial details for easier subsequent fusion. The upsampled feature map at the P3 detection layer resolution may then be concatenated with certain local features (e.g., with shallow features or intermediate branch outputs) to form richer channel combinations; the specific concatenation source depends on the network design, such as... Figure 2 The "concat" annotation likely indicates channel merging with a shallow or intermediate layer feature. After concatenation, the C2f layer further fuses the features from each channel to extract key information. This layer preserves key textures of small objects without significantly increasing computational cost and enhances the ability to integrate multi-scale features. The final output of the second branch is a feature map processed by Upsample+Concat+C2f, retaining the original medium semantics of the feature map at the corresponding resolution of the P3 detection layer, and further supplemented with detailed information due to upsampling and concatenation operations.
[0137] The feature maps corresponding to the resolution of the P2 detection layer are obtained by performing Add operations on the first and second branches. After aligning the spatial resolution and the number of channels, the two feature maps are added element-wise. Combining the multi-scale information from ScalSeq cross-layer integration with the P3 features after Upsample+Concat+C2f deep processing, it possesses both high-resolution shallow / mid-layer details and contains more deep semantics fused from P4.
[0138] The resulting P2 detection layer has the highest resolution, which is particularly important in cluttered scenes or small target detection. Because the Add operation effectively accumulates information from multiple paths, P2 possesses the fine-grained features and cross-layer semantic information fusion required for the localization and recognition of small targets. This multi-path fusion + final addition design demonstrates SOD-YOLO's deep enhancement approach to small target detection in the P2 layer, maximizing the integration of information from various levels and operation paths.
[0139] This embodiment introduces a new detection layer at the P2 level of the YOLOv8 architecture, which utilizes higher resolution feature maps to capture details that are crucial for accurately identifying small targets.
[0140] First, the feature maps of the backbone network are upsampled to preserve high-resolution details. These upsampled features are then concatenated with earlier backbone features, enriching the representation by combining spatial details and deeper abstract features. The concatenated features are then processed through a C2f layer (enhanced residual block) to refine and enhance the combined feature map. This step is crucial for maintaining the integrity of spatial details while integrating information from different feature scales. Through C2f layer processing, the model can effectively preserve fine-grained spatial information, which is essential for accurately detecting small objects in cluttered and complex backgrounds. After feature processing, the ScalSeq module integrates features across multiple scales, ensuring that details of small objects are preserved and emphasized. Finally, the processed P2 features are combined with existing detection heads (P3, P4, P5), enabling the model to detect objects at various scales and improving the detection accuracy of small objects.
[0141] The aforementioned enhancements significantly improve the model's performance in detecting small targets, making it more robust and effective in UAV-based applications. By introducing the P2 detection head, the improved YOLOv8 architecture in this embodiment better addresses the unique challenges of small target detection in aerial imagery, capturing finer details and improving overall detection accuracy in complex backgrounds.
[0142] In this embodiment, the feature maps of the multi-scale detection layers (P2–P5) at corresponding resolutions are input into a conventional detection head to form their corresponding detection layers. Boundary box regression and classification prediction are performed for each scale to obtain candidate target boxes and confidence scores. This step can be implemented using conventional YOLO detection heads or head structures such as FCOS / RetinaNet.
[0143] To address the issue of potentially discarding detection boxes containing objects, this embodiment employs the soft nonmaximum suppression (soft-NMS) algorithm. Unlike traditional NMS, soft-NMS adjusts the score of the current detection box by applying a weighting function that reduces the scores of adjacent boxes based on their overlap with the highest-scoring box. The greater the overlap, the faster the score decays. This method prevents boxes containing objects from being removed and avoids situations where two similar boxes simultaneously detect the same object. The soft-NMS algorithm used in this embodiment considers the overlap between detection boxes, reducing the possibility of false negatives compared to traditional NMS, thereby improving the accuracy and reliability of small object detection.
[0144] The implementation process of the Soft Nonmaximum Suppression (Soft-NMS) algorithm specifically includes:
[0145] 1. Candidate box initialization
[0146] After completing network inference, multiple candidate target boxes {B1, B2, ..., B} are obtained.n} and their corresponding scores {S1,S2,…,S} n The score typically represents the detection confidence or classification confidence.
[0147] Store these candidate boxes in a list or priority queue and initially sort them by score from highest to lowest.
[0148] 2. Select the highest-scoring detection box.
[0149] Select the highest-scoring detection box from the candidate box list and denote it as A. Treat it as the current "reference detection box". Output detection box A to the final detection result list as a valid detection.
[0150] 3. Calculate IoU and decay the scores of adjacent candidate boxes.
[0151] For the remaining candidate boxes B i (i≠A) Calculate the intersection-union ratio (IoU(A,B)) of each of them with A. i ));
[0152] The scores of adjacent candidate boxes are updated according to the following linear decay formula:
[0153]
[0154] S i A represents the score of the i-th bounding box; B represents the bounding box with the highest confidence in the region of interest; i Represents the i-th bounding box; IoU represents the degree of overlap between the i-th bounding box and A; N t This represents the overlap threshold after calibration, which can typically be selected from 0.5 to 0.6 (or reduced to 0.3 to 0.4 for small target scenarios in UAV imagery). It controls the level of IoU that requires score decay. When the IoU is less than this threshold, the original score is maintained; when it is greater than or equal to this threshold, the confidence of the bounding box is linearly decayed.
[0155] 4. Update the candidate box list
[0156] After decay is complete, the candidate boxes whose scores have been updated are kept in the list, but their confidence has been reduced.
[0157] If a candidate box's score falls below a certain minimum detection threshold after decay (which can be set according to the application scenario, such as 0.01 or 0.1), it can be removed from the list to reduce the computational load of subsequent iterations.
[0158] 5. Repeated iterations
[0159] After removing the output detection box A, the remaining candidate boxes are sorted again from high to low, and the new highest-scoring detection box is selected as the current reference box. Steps 3 and 4 are repeated. The iteration continues until the candidate box list is empty or all scores are lower than the minimum detection threshold.
[0160] 6. Final Output
[0161] All candidate boxes that are output to the final detection result list through the above process are the target boxes after Soft-NMS filtering. The difference between this process and the traditional NMS "removal of overlapping boxes" is that Soft-NMS does not directly discard candidate boxes that have a large overlap with the highest-scoring box, but retains their potential contribution through a linear decay method, thereby reducing false negatives.
[0162] In specific scenarios (such as when targets are extremely dense), linear decay can be replaced with Gaussian decay:
[0163] S i ←S i ×exp(-αIoU(A, B) i ) 2 )
[0164] Where α is an adjustable hyperparameter. N can be adjusted separately for different scenarios. t To achieve better detection results, a minimum detection threshold or attenuation function can be used.
[0165] To comprehensively evaluate the performance of this invention (SOD-YOLO) in small target detection on drones, this embodiment selects the widely recognized VisDrone2019-DET dataset. This dataset aims to evaluate target detection and visual perception capabilities on drone platforms and consists of 288 video clips (totaling 261,908 frames) and an additional 10,209 still images taken at multiple locations. The shooting devices were various types of drones equipped with cameras, covering diverse environments including urban and rural areas, and encompassing multiple target scenes such as pedestrians, vehicles (cars, trucks, etc.), and bicycles. The targets are densely distributed in the images and vary greatly in size, posing a significant challenge.
[0166] The VisDrone 2019-DET is divided as follows:
[0167] Training set: 6,471 images;
[0168] Validation set: 548 images;
[0169] Test set: 1,610 images.
[0170] The dataset defines 10 object categories: pedestrians, crowds, bicycles, cars, vans, trucks, tricycles, covered tricycles, buses, and motorcycles. Approximately 75% of the objects are smaller than 0.001 times the image size, further highlighting the difficulty of small object detection. The distribution of object annotations also shows a significant clustering phenomenon in the image center; therefore, employing a center-cropping strategy in data augmentation can effectively improve the model's detection capability.
[0171] In this experiment, the training environment was deployed on a workstation with one RTX 4090 GPU, and CSPDarknet53 was selected as the backbone network. Stochastic Gradient Descent (SGD) optimizer was used during training, with a batch size of 8. Furthermore, this embodiment first performed three warm-up cycles, gradually increasing the learning rate from 0 to 0.005. The main training hyperparameters are as follows:
[0172] Weight Decay: 0.0005
[0173] Momentum: 0.937
[0174] Total number of epochs: 200
[0175] Image size: 640×640
[0176] Batch size: 8
[0177] During the training and validation phases, this embodiment uses widely adopted object detection metrics for evaluation, specifically including Intersection over Union (IoU), Precision, Recall, and Mean Average Precision (mAP):
[0178] Intersection over Union (IoU): Measures the degree of overlap between the predicted and actual labeled regions by the ratio of their intersection to their union. The value ranges from [0,1], with a higher value indicating more accurate localization.
[0179] Precision represents the proportion of samples predicted as positive that are actually positive.
[0180] Recall represents the proportion of actual positive samples that are correctly detected.
[0181] The mean precision (mAP) is calculated by taking the area under the precision-recall (PR) curve at different IoU thresholds and averaging the AP values for each category to obtain mAP.
[0182] mAP50: Average accuracy when IoU = 0.5;
[0183] mAP50:95: The average value of the IoU threshold increasing from 0.5 to 0.95, which is more stringent and reflects the model's performance at higher IoU levels.
[0184] This embodiment uses YOLOv8-m as a baseline, compares it with several advanced object detectors, and conducts experiments on the VisDrone2019-DET dataset, which mainly consists of small objects.
[0185] Table 1. Detection results of different models on the VisDrone2019-DET validation set (val).
[0186]
[0187]
[0188] As shown in Table 1, compared with YOLOv8-m, the SOD-YOLO proposed in this embodiment shows a significant advantage in small target detection, specifically in the following aspects:
[0189] mAP50:95: SOD-YOLO reached 0.351, which is 0.093 higher than YOLOv8-m's 0.258;
[0190] mAP50: SOD-YOLO reached 0.526, an improvement of 0.090 compared to YOLOv8-m's 0.436.
[0191] These results demonstrate that SOD-YOLO maintains higher detection precision and recall under stricter IoU thresholds, significantly enhancing its ability to locate small targets. Even compared to other models such as YOLOv9-gelan-c and YOLOv10-l, SOD-YOLO exhibits strong competitiveness. It surpasses YOLOv9-gelan-c in both mAP50:95 (0.351 vs. 0.305) and mAP50 (0.526 vs. 0.489). Furthermore, SOD-YOLO has approximately 22.6M parameters and 94.9 GFLOPs, making it more lightweight and efficient than YOLOv7-m (36.9M parameters, 103.5 GFLOPs) and Edge-YOLO.
[0192] Visual comparison, for example Figure 3 and Figure 4 As shown, SOD-YOLO can detect more small targets and has higher bounding box accuracy than the baseline YOLOv8-m, demonstrating robustness in more complex contexts.
[0193] This embodiment further conducted ablation experiments (see Table 2) to examine the contribution of each component in SOD-YOLO to the performance improvement, with YOLOv8 as the baseline:
[0194] Table 2 Ablation Experiment Results
[0195]
[0196]
[0197] The evaluation metrics for baseline YOLOv8 are as follows:
[0198] FLOPs: 78.7G; mAP50: 95: 0.258; mAP50: 0.436.
[0199] The evaluation metrics for introducing ASF (Neck Attention Fusion Strategy) are as follows:
[0200] FLOPs: 82.7G; mAP50:95: 0.265 (+0.007); mAP50: 0.440 (+0.004).
[0201] Despite the increase in FLOPs, improvements were made in the detection of small targets.
[0202] The evaluation metrics for adding the P2 layer (high-resolution detector head) are as follows:
[0203] FLOPs: 94.9G; mAP50: 95: 0.294 (+0.036); mAP50: 0.476 (+0.040).
[0204] Utilizing high-resolution feature maps for specialized detection of small targets significantly improves detection performance.
[0205] The evaluation metrics for integrating Soft-NMS are as follows: FLOPs: 94.9G (no further increase); mAP50: 95: 0.352 (+0.094); mAP50: 0.526 (+0.090).
[0206] By gently attenuating the confidence of overlapping bounding boxes, the positive sample retention rate was improved while false positives were reduced, resulting in a significant performance improvement.
[0207] In summary, the combination of the ASF mechanism, the P2 detection layer, and the Soft-NMS algorithm yielded the most significant performance gains. In particular, the Soft-NMS algorithm achieved a substantial improvement from mAP50:95 = 0.294 to 0.352 with almost no increase in computational overhead.
[0208] The SOD-YOLO model proposed in this embodiment demonstrates excellent accuracy and recall improvements when detecting small targets in UAV imagery. Its key improvements include:
[0209] 1. ASF mechanism: Introducing an attention-scale sequence fusion strategy to focus on key regions in the neck network;
[0210] 2. P2 Detection Layer: Utilizes high-resolution feature maps to specifically process small targets, significantly improving the ability to capture extremely small targets;
[0211] 3. Soft-NMS algorithm: By applying a gentle confidence decay to overlapping candidate boxes, more positive samples are retained, further improving the recall rate.
[0212] Experimental results on the VisDrone2019-DET dataset show that SOD-YOLO improves upon YOLOv8-m by 36% on mAP50:95 (from 0.258 to 0.352) and by 20% on mAP50 (from 0.436 to 0.526), while maintaining reasonable parameter count and FLOPs. This demonstrates the effectiveness and efficiency of this method in the detection of small targets in dense UAV scenarios.
[0213] Example 2
[0214] This invention also provides a small target detection system based on an improved YOLOv8 architecture, comprising:
[0215] The image input module is used to receive the image to be detected;
[0216] The backbone network module is used to extract multi-scale features of the image;
[0217] The neck network module introduces the ASF mechanism and integrates a scale sequence feature fusion module and a three-feature encoder module to fuse shallow, middle and deep features from the backbone network to generate a multi-scale fused feature map.
[0218] The feature generation module is used to generate multi-resolution detection feature maps including P2, P3, P4 and P5 based on the fused feature map;
[0219] The detection head module is used to input the P2–P5 detection layers into the corresponding detection heads to generate candidate target boxes and their category confidence scores.
[0220] The soft nonmaximum suppression module is used to attenuate the confidence of candidate target boxes and output the final detection result.
[0221] Example 3
[0222] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the small target detection method based on the improved YOLOv8 structure described above.
[0223] Example 4
[0224] The present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the small target detection method based on the improved YOLOv8 structure described above.
[0225] The SOD-YOLO detection method and system provided by this invention have significant advantages in identifying small targets, and are particularly suitable for UAV platforms performing the following typical tasks:
[0226] Urban traffic monitoring: In urban centers or highway intersections, drones can monitor vehicle and pedestrian flow through real-time aerial images. When vehicles or pedestrians are small and densely distributed, conventional detection methods are prone to missed or false detections. The ASF mechanism and P2 detection layer integrated in this invention can effectively address the need for small target detection in complex backgrounds and high-density environments, improving the efficiency of traffic monitoring systems in recognizing and responding to congestion and accident scenarios.
[0227] Public safety and emergency rescue: Drones can be used to search for people or trapped targets at large events and disaster sites (such as earthquakes and floods). When the target has extremely low resolution in long-distance aerial images and the scene is highly cluttered, Soft-NMS can retain more valid candidates when identifying highly overlapping bounding boxes, reducing the false deletion of potential targets, thereby improving the search efficiency and reliability of key areas.
[0228] Agricultural and forestry monitoring: When conducting drone patrols over farmland, orchards, and forest areas, it is often necessary to monitor targets such as small pests, animals, or disease spots. This invention, through its P2 detection layer, can capture rich details when detecting extremely small and irregularly shaped targets, greatly promoting the early detection and precise location of pests and diseases, and assisting in modern precision agricultural management.
[0229] Power line inspection and infrastructure monitoring: Drones are commonly used for inspection and photography of structures such as high-altitude power transmission lines, wind turbine blades, and bridges. The objects being inspected may include minute cracks, loose parts, or metal corrosion spots. This invention can preserve details in high-resolution feature maps, offering advantages for detecting small defects at long distances, and reduces background clutter interference by focusing on key areas through ASF (Automatic Sensor).
[0230] Environmental and wildlife conservation: Drones often capture images of complex scenes and dense vegetation in nature reserves or wild environments, where wild animals are small and easily concealed. SOD-YOLO can improve the detection rate of small animals through multi-layer feature fusion, and combined with Soft-NMS, it avoids missed detections when adjacent targets overlap, which is of great significance for endangered species monitoring and ecological patrols.
[0231] Logistics and Warehouse Management: In indoor and outdoor warehouses or during transportation, the use of drones for detecting goods, small packages, or tags requires capturing extremely small and inconspicuous objects. This invention's ability to detect small, low-contrast targets effectively reduces missed detections, improving logistics turnover efficiency and accuracy.
[0232] With the continuous improvement of UAV imaging resolution and flight control precision, small target detection will be more deeply applied in fields such as security and defense, unmanned inspection, and smart cities. The multi-scale feature fusion method and Soft-NMS technology of this invention can also be combined with other vision algorithms, such as behavior recognition and target tracking, to realize diverse intelligent vision applications for UAVs.
[0233] In summary, this invention is not only suitable for rapid detection of small ground targets on UAV platforms, but can also be widely applied in various scenarios such as satellite remote sensing, traffic monitoring, industrial inspection, and public safety. The combination of the ASF mechanism, P2 detection layer, and Soft-NMS improves detection accuracy while maintaining algorithm efficiency, enabling it to meet the detection needs of various harsh environments, including those with high resolution requirements, complex background noise, a large number of small targets, or high overlap between targets. It possesses significant practical value and widespread application potential.
[0234] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0235] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0236] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0237] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0238] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
[0239] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A small target detection method based on an improved YOLOv8 structure, characterized in that, Includes the following steps: The image to be detected is preprocessed to obtain a standardized image; The standardized image is input into the YOLOv8 backbone network to extract multi-scale feature maps; The feature map is input into the neck network of YOLOv8 for fusion processing; the neck network introduces the ASF mechanism and integrates a scale sequence feature fusion module and a three-feature encoder module to perform multi-scale integration of features at different resolutions and output a fused feature map. Based on the fused feature map, P2, P3, P4 and P5 multi-resolution detection layers are generated to enhance the detection capability of targets at different scales; The P2-P5 detection layers respectively generate candidate bounding boxes and their category confidence scores; The candidate bounding boxes are processed by soft nonmaximum suppression: based on the cross-union ratio between candidate bounding boxes, the confidence of the candidate bounding boxes is reduced, and the final detection result is output. After performing scale sequence integration on the shallow features output by the backbone network, the feature maps at the corresponding resolutions of the P3 and P4 detection layers, and the feature maps at the corresponding resolutions of the P3 detection layer (which have been successively upsampled, concatenated with the shallow features output by the backbone network, and processed by the residual module), a fusion operation is performed to obtain the feature map at the corresponding resolution of the P2 detection layer.
2. The method of claim 1, wherein, After the mid-level features output by the backbone network are fused, a scale sequence integration operation is performed. Then, the feature map output by the backbone network after being processed by the scale sequence feature fusion module is added and fused to obtain the feature map corresponding to the resolution of the P3 detection layer.
3. The method of claim 1, wherein, The deep features output by the backbone network are processed by the scale sequence feature fusion module and the three-feature encoder module to obtain the feature map corresponding to the resolution of the P4 detection layer.
4. The method of claim 1, wherein, The deep features output by the backbone network are processed by the scale sequence feature fusion module and the three-feature encoder module to obtain the feature map corresponding to the resolution of the P5 detection layer.
5. The method according to claim 1, characterized in that, The soft nonmaximum suppression process includes: calculating the cross-union ratio of the overlapping regions between multiple candidate target boxes, and linearly or Gaussianly decaying the corresponding confidence scores according to the degree of overlap, thereby retaining some neighboring small target candidate boxes and improving the detection recall rate in dense small target scenes.
6. The method according to any one of claims 1-5, characterized in that, The method is applicable to aerial images captured by drones equipped with camera devices, or to applications such as remote sensing monitoring, traffic management, and dense detection of small targets in agricultural plant protection.
7. A small target detection system based on an improved YOLOv8 architecture, characterized in that, include: The image input module is used to receive the image to be detected; The backbone network module is used to extract multi-scale features of the image; The neck network module introduces the ASF mechanism and integrates a scale sequence feature fusion module and a three-feature encoder module to deeply fuse shallow, middle and deep features from the backbone network to generate a multi-scale fused feature map. The feature generation module is used to generate detection layers P2, P3, P4 and P5 based on the multi-scale fused feature map to ensure that targets at different scales can be fully detected. The detection head module is used to generate candidate target boxes and their category confidence scores corresponding to the P2-P5 detection layers; The soft nonmaximum suppression module is used to attenuate the confidence of candidate target boxes based on the cross-union ratio between them and output the final detection result. The generation process of the feature map corresponding to the resolution of the P2 detection layer includes: performing a scale sequence integration operation on the shallow features output by the backbone network, the feature maps corresponding to the resolutions of the P3 and P4 detection layers, and then adding and fusing them with the feature map corresponding to the resolution of the P3 detection layer, which has been successively upsampled, concatenated with the shallow features output by the backbone network, and processed by the residual module, to obtain the feature map corresponding to the resolution of the P2 detection layer.
8. The system according to claim 7, characterized in that, The soft nonmaximum suppression module calculates the cross-union ratio between candidate target boxes and adjusts the confidence of candidate boxes using a linear or Gaussian decay function based on the degree of overlap, thereby improving the detection recall rate in scenarios with dense small targets.
Citation Information
Patent Citations
Traffic tracking detection system for view angle of unmanned aerial vehicle
CN118918148A
Multi-scale pest type detection method and device and electronic equipment
CN119274026A