Lightweight YOLO detection model construction method for low-resolution small target
By combining the Dy_Sample-Adown collaborative sampling module, OD Block, and SA-Det detection head, the problem of false detection and missed detection of low-resolution small targets in complex backgrounds is solved, and the lightweight YOLO detection model is able to achieve efficient real-time detection on resource-constrained devices.
Patent Information
- Application Number
- CN202511226287.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-23
AI Technical Summary
Existing small target detection methods are prone to false positives and false negatives in low resolution and complex backgrounds, and have a heavy computational burden, making them difficult to deploy on resource-constrained devices.
The Dy_Sample-Adown collaborative sampling module is used to replace the resampling method. OD Block and SA-Det detection heads are introduced. Through full-dimensional dynamic convolution and lightweight self-attention mechanism, the model's adaptive representation ability of small targets in complex backgrounds is enhanced.
It significantly reduces computational and parameter requirements while improving detection accuracy and robustness for low-resolution small targets, making it suitable for real-time detection in complex environments.
Smart Images

Figure CN121190935A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of small target detection technology, specifically to a method for constructing a lightweight YOLO detection model for low-resolution small targets. Background Technology
[0002] In recent years, the rapid development and widespread application of drone technology have brought convenience but also triggered a series of safety hazards. Illegal and disorderly flights not only endanger public safety and infringe on personal privacy but also raise serious concerns and control pressures in key areas such as airports, power facilities, and government sites. Therefore, research on real-time detection and identification technologies for small drones has become a crucial direction for improving low-altitude airspace security. This invention focuses on the detection of low-resolution small-target drones in complex environments, aiming to improve the system's accuracy and deployment efficiency.
[0003] To address the threat posed by drones, researchers have proposed various detection methods, including radio spectrum (RF) detection, radar detection, acoustic detection, and target detection based on visual perception. RF detection relies on communication signals between the drone and the ground station, making it suitable for nighttime and obstructed scenarios, but it has limited ability to identify silent targets and is susceptible to electromagnetic interference. Radar possesses strong penetration and long-range imaging capabilities, with stable performance in all weather conditions, but its sensitivity to small drones with low RCS is insufficient and its cost is high. Acoustic detection is based on propeller noise recognition, is low-cost and easy to install, and is suitable for short-range, low-altitude detection, but it is highly susceptible to noise interference and has a limited detection range. Visual perception utilizes image sensors combined with computer vision and deep learning algorithms, possessing high spatial resolution and fine-grained feature extraction capabilities. It is robust in complex backgrounds and dynamic environments, and is low-cost, small in size, and easy to deploy, making it suitable for scenarios such as airport security and urban surveillance.
[0004] Based on the above advantages, visual perception has been widely used in UAV detection, with the YOLO series of single-stage detection methods being the most representative, becoming the mainstream choice due to its good balance between detection speed and accuracy. To improve the accuracy and robustness of UAV target detection, many studies have made targeted improvements and optimizations to the model structure based on the YOLO series detection framework. C. Wang et al. (2022) proposed a lightweight UAV swarm detection method based on YOLOX. This method introduces the SE self-attention mechanism into the CSPDarkNet network model to strengthen key information, enhance the feature extraction capability of the backbone network, and suppress irrelevant features, thereby improving detection performance. However, the application of this method ignores the dynamic modeling requirements of the spatial dimension, resulting in insufficient perception of the spatial position of small targets in complex scenes. Chun et al. (2023) proposed GF-MDH YOLO, which uses a high-resolution detection head and effectively solves the problem of deep feature loss, but leads to a significant increase in computational cost. Cheng et al. (2024) used the LGFF module to achieve more accurate target localization in complex backgrounds by fusing local and global information, while the introduction of the attention mechanism provided the model with stronger feature representation capabilities. Tian et al. (2024) designed the EorthoNet model, which uses orthogonal channel attention to enhance feature independence and maintains high stability under background interference. To achieve edge deployment and real-time response, model lightweighting has also become a research focus. M. Huang et al. (2024) introduced Ghost convolution, replacing the C2f module in the neck with a lightweight C3Ghost structure to enhance feature extraction capabilities. H. Zhong et al. (2025) proposed PS-YOLO, which significantly improves the accuracy and inference speed of small target detection with low computational cost through a lightweight backbone, FasterBIFFPN neck and GSCD detection head, combined with Gaussian Wasserstein loss.
[0005] While existing small object detection methods have made some progress in feature modeling and detection accuracy, they are still prone to false positives and false negatives in low-resolution targets and complex backgrounds. Some methods improve performance by using complex structures such as stacked deep convolutional networks, multi-scale fusion, and multiple attention mechanisms, but these significantly increase the computational burden and make them difficult to deploy on resource-constrained devices.
[0006] Therefore, a new solution is needed to address the above problems. Summary of the Invention
[0007] The purpose of this invention is to provide a lightweight YOLO detection model construction method for low-resolution small targets, so as to solve the technical problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a lightweight YOLO detection model construction method for low-resolution small targets, comprising at least the following steps:
[0009] S1: Based on the YOLOv8n architecture, optimization is performed by replacing the original resampling method with the Dy_Sample-Adown collaborative sampling module. The Dy_Sample module improves upsampling accuracy by dynamically generating resampling kernels, while the Adown module uses a progressive strategy to retain global information. The two work together to improve the ability to retain details while reducing the amount of computation.
[0010] S2: Introduce OD Block, a full-dimensional dynamic convolution module, into the Backbone key layer. ODConv is used to realize multi-dimensional dynamic weight modulation of space, channels and kernel groups, which enhances the model's adaptive representation ability of small drones in complex backgrounds.
[0011] S3: Design an SA-Det detection head at the head end, enhance global context modeling capabilities by embedding a lightweight self-attention module, improve the detection sensitivity of small targets, and utilize the SA-Det detection head to integrate a lightweight self-attention mechanism to improve the detection capability of small targets.
[0012] Furthermore, the essence of the Dy_Sample module is to transform the upsampling process into a learnable offset-guided sampling problem, allowing the model to dynamically generate the corresponding sampling points for each position, thereby achieving semantically aware spatial recovery.
[0013] The Dy_Sample module treats upsampling as a "point resampling" process;
[0014] Let X, X′, O, and G represent the input feature, upsampled feature, generated offset, and original sampling grid, respectively; σ represents the Sigmoid function; sH represents the sampling height; and sW represents the sampling width.
[0015] After processing with a linear layer, gs 2 Divide the feature map into channels;
[0016] The Dysample network structure consists of the original sampling grid G and the generated offset O, given the input feature map X∈R. C×H × W The offset generator first extracts the two-dimensional offset corresponding to each output position from the input features through lightweight convolution, forming an offset tensor O∈R. 2×sH×sW Used to adjust the position of the sampling points;
[0017] The generation of the offset can be simplified as Equation (1):
[0018] O=λ·Linear(X)\*MERGEFORMAT(1)
[0019] Where λ is the factor that controls the offset amplitude (statically set to 0.25, or dynamically adjusted to 0.5sigmoid);
[0020] Subsequently, the offset tensor O is added to the original sampling grid G to construct a new set of sampling positions S = G + O, thereby achieving adaptive adjustment of the spatial sampling positions.
[0021] Finally, the content-aware resampling operation of the features is completed by bilinear interpolation on the original feature map at the newly constructed sampling points S using the grid_sample function in PyTorch, as expressed in equation (2):
[0022] X'=grid_sample(X,S)\*MERGEFORMAT(2)
[0023] It effectively enhances the responsiveness of edges and texture structures.
[0024] Furthermore, the Adown module adopts an asymmetric multi-branch structure, which integrates AvgPool2d, MaxPool2d and lightweight convolution in a collaborative manner;
[0025] The Adown module first fuses the features from both branches using a single convolution, and then dynamically adjusts the proportion of the two branches through learnable weight gates. This allows the network to retain both key details and overall semantic information after downsampling. Its core feature is:
[0026] The input features are first lightly compressed by AvgPool2d (H→H-1) to smooth the noise while preserving the global distribution;
[0027] Then, MaxPool2d is used to halve the scale (H→H / 2), forming a gradually refined spatial dimensionality reduction method, which can better mitigate the risk of losing key information compared to stride convolution in one step.
[0028] Furthermore, the introduction of heterogeneous branches, namely convolution and pooling, enhances the diversity of feature representation, and the fusion mechanism promotes the synergy of information at different scales, which helps to highlight the key structure of the target region and improve the discrimination ability. Its overall transformation is shown in Equation (3):
[0029] F Adown (ω)=G 3×3 (ω)+P avg (ω)·P max (ω)\*MERGEFORMAT(3)
[0030] Among them, G 3×3(ω) captures region edges and texture details, while P avg (ω)·P max (ω) then couples global background information and target salient response into “local-global collaborative” features through element-wise multiplication, thereby improving structural integrity and discriminability, and enhancing the perceptibility and detection accuracy of small targets in complex backgrounds.
[0031] Furthermore, the full-dimensional dynamic convolution module is embedded in layers B4 and B6, replacing static convolution with dynamic convolution based on Omni-Dimensional Dynamic Convolution (ODConv);
[0032] Specifically, the input features are first channel-adjusted through 1×1 convolution and divided into a main branch and a residual branch. The main branch keeps the original features unchanged, while the residual branch performs dynamic feature extraction through multiple Bottleneck modules that integrate ODConv.
[0033] The processing results at each level are then concatenated with the initial residual features, fused with the main branch features, and finally integrated into channels via 1×1 convolution.
[0034] The original feature reuse mechanism is maintained through the full-dimensional dynamic convolution module, while the weight adaptation is achieved by introducing ODConv-based dynamic convolution in the internal Bottleneck module.
[0035] Conventional convolutional layers use a set of pre-trained static weights W during the inference phase to apply weights to the input features. Convolution is represented by equation (4):
[0036] y=W*x\*MERGEFORMAT(4)
[0037] Where * represents a two-dimensional convolution operation, the convolution kernel in equation (4) remains unchanged for all samples, making it difficult to adaptively adjust for complex scenes or small targets. In order to improve the input dependence of features, one-dimensional dynamic convolution proposes to adjust N sets of basic kernels during the forward process. Perform linear weighting:
[0038]
[0039] Where α wi satisfy The weight scalar generated based on x;
[0040] However, Equation (5) only models dynamics at the kernel group level, ignoring the differences between the channel and spatial levels;
[0041] To further enhance the adaptability of the convolutional kernel to fine-grained context, ODConv is adopted, introducing a spatial (α) dimension in addition to the kernel group weights. si ), input channel (α) ci ) and output channel (α) fi Three types of attention coefficients simultaneously modulate the four key dimensions of the convolution weights;
[0042] Specifically, by applying element-wise weights to each basic kernel Wi in the spatial, input, and output dimensions, and then performing a soft combination in the kernel group dimension, a dynamic convolutional kernel related to the input can be obtained:
[0043] y=(α w1 ⊙α f1 ⊙α c1 ⊙α s1 ⊙W1+…+α fn ⊙α cn ⊙α sn ⊙W n )*x\*MERGEFORMAT(6)
[0044] Where ⊙ represents element-wise weighting in the corresponding dimension, and through Equation (6), the convolution kernel can be reconstructed in real time with the input in multiple dimensions such as space, channel and kernel group, thereby significantly enhancing the feature representation ability of small targets and complex backgrounds.
[0045] Furthermore, the SA-Det detection head is divided into two parallel branches: regression and classification, both of which incorporate the Self_Attn module for feature enhancement;
[0046] The Self_Attn module adopts a structure design of "bottleneck-channel compression-multi-head self-attention-channel recovery" and introduces residual connections to improve information transmission and gradient stability. It uses MHSA to build global perception capability and enhances feature expression by fusing compression-expansion paths and residual paths.
[0047] At the computational level, the core operations of the self-attention module are as follows:
[0048]
[0049] Where Q = XW Q K = XW K V = XW V They are linear mappings of the input features, d k This is the scaling factor;
[0050] The Self_Attn module is also designed to be lightweight, employing a bottleneck structure with a compression ratio r, resulting in the following parameter count:
[0051]
[0052] Compared to the parameter count P of a traditional 3×3 convolution... Conv =9C1 2 In comparison, with r=4, the parameters of the Self_Attn module are only about 6% of its original value.
[0053]
[0054] This structure significantly improves the detection performance for small targets and complex backgrounds while maintaining a compact model size, demonstrating a good performance-efficiency balance.
[0055] Compared with the prior art, the beneficial effects of the present invention are:
[0056] 1. This invention replaces the original nearest neighbor upsampling and stride convolution downsampling with the Dy_Sample–Adown collaborative sampling module, and integrates pixel-level dynamic upsampling and progressive lightweight downsampling mechanism, which significantly reduces the number of parameters and computational overhead while effectively preserving edge details and context information.
[0057] 2. The OD Block constructed in this invention is placed in layers B4 and B6, and four-dimensional dynamically modulated ODConv is introduced to enhance the network's adaptive feature expression capabilities in spatial, channel and group convolutional dimensions, effectively improving the recognition effect of small and medium-sized UAVs in complex backgrounds.
[0058] 3. This invention introduces an SA-Det detection head at the head end, embeds lightweight self-attention in the classification and regression branches, realizes global long-range dependency modeling, enhances the sensitivity of high-resolution P3 features to small targets, and maintains extremely low computation and parameter overhead by bottleneck compression. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a diagram illustrating the model structure of the LSD-YOLO of this invention.
[0061] Figure 2 This is a network architecture diagram of Dydample, the invention. Figure 2 (a) is Sampling based dynamicupsampling, Figure 2(b) is Sampling point generator in DySample;
[0062] Figure 3 This is a diagram of the Adown downsampling module of the present invention;
[0063] Figure 4 This is a structural diagram and internal structure diagram of the OD Block of the present invention. Figure 4 (a) is an OD Block. Figure 4 (b) is Bottleneck ODConv;
[0064] Figure 5 This is a schematic diagram illustrating the stepwise multiplication of the four attention mechanisms with the convolution kernel in ODConv of this invention. Figure 5 (a) represents the position attention multiplication operation along the spatial dimension. Figure 5 (b) is the channel attention multiplication operation performed along the input channel dimension. Figure 5 (c) represents the filter attention multiplication operation performed along the output channel dimension. Figure 5 (d) represents the kernel weight attention multiplication operation performed along the kernel dimension in the kernel space;
[0065] Figure 6 This is a structural diagram of the SA-Det and Self-Attention modules of this invention. Figure 6 (a) is the SA-Det plot. Figure 6 (b) is a diagram of the Self-Attention Module;
[0066] Figure 7 This is a diagram showing the setup of the experimental platform for this invention. Figure 7 (a) is a picture of the actual object. Figure 7 (b) and Figure 7 (c) shows the real-time detection results;
[0067] Figure 8 This is a diagram of the UAV dataset for this invention;
[0068] Figure 9 This is a comparison chart of the visualization detection results of the YOLOv8n model (left) and the LSD-YOLO model (right) of this invention. Figure 9 (a) A long-range UAV target under dim lighting conditions. Figure 9 (b) A drone target in daylight conditions with a cluttered background. Detailed Implementation
[0069] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0070] The proposed LSD-YOLO small-scale UAV detection model addresses the problem of low-resolution small target detection in complex low-altitude environments. Through optimized structural design, it achieves a good balance between detection accuracy and real-time performance. To verify the model's performance, static testing was conducted on a UAV dataset, and dynamic verification was performed using a visual tracking platform consisting of a high-precision electronically controlled 2D gimbal and a telephoto camera. Experimental results show that the model, while maintaining a lightweight design, exhibits excellent performance in both static detection and dynamic tracking scenarios, effectively meeting the real-time detection requirements in complex low-altitude environments.
[0071] YOLOv8, as a current advanced single-stage object detection framework, consists of three parts: Backbone, Neck, and Head. While it performs excellently in general object detection tasks, it still has significant shortcomings in detecting small UAVs in complex low-altitude scenarios. Its original nearest-neighbor upsampling and stride convolution downsampling methods easily lead to distortion of small target features, affecting the accurate localization of tiny UAVs; the static convolutional structure struggles to adapt to multi-scale changes in UAV targets and complex background interference; simultaneously, the detection head lacks global perception capabilities and is insufficiently sensitive to small targets in high-resolution features. To address these issues, this invention proposes the LSD-YOLO model to achieve effective improvements. Figure 1 The overall structure of the model is shown.
[0072] A lightweight YOLO detection model construction method for low-resolution small targets includes at least the following steps:
[0073] S1: Based on the YOLOv8n architecture, optimization is performed by replacing the original resampling method with the Dy_Sample-Adown collaborative sampling module. The Dy_Sample module improves upsampling accuracy by dynamically generating resampling kernels, while the Adown module uses a progressive strategy to retain global information. The two work together to improve the ability to retain details while reducing the amount of computation.
[0074] S2: Introduce OD Block, a full-dimensional dynamic convolution module, into the Backbone key layer. ODConv is used to realize multi-dimensional dynamic weight modulation of space, channels and kernel groups, which enhances the model's adaptive representation ability of small drones in complex backgrounds.
[0075] S3: Design an SA-Det detection head at the head end, enhance global context modeling capabilities by embedding a lightweight self-attention module, improve the detection sensitivity of small targets, and utilize the SA-Det detection head to integrate a lightweight self-attention mechanism to improve the detection capability of small targets.
[0076] In the YOLOv8 detection network, the traditional Feature Pyramid Network (FPN) plays a core role in multi-scale feature fusion and semantic information transfer. Upsampling, as a crucial step in achieving cross-scale information interaction, is typically performed using nearest-neighbor interpolation in FPN. However, this method only assigns interpolation weights based on the geometric position of pixels, failing to effectively mine semantic relationships and contextual features in the image, thus limiting the expressive power of the reconstructed features. This lack of semantic modeling capability easily leads to alignment deviations between high-level abstract features and low-level detailed features when dealing with small targets or complex scenes with blurred boundaries, resulting in feature distortion and semantic mismatch. To improve the spatial reconstruction quality of the upsampling stage, this invention introduces the DySample upsampling module, which achieves dynamic resampling through guided offset prediction, enabling more semantically perceptive dynamic resampling.
[0077] The essence of the Dy_Sample module is to transform the upsampling process into a learnable offset-guided sampling problem, allowing the model to dynamically generate the corresponding sampling points for each position, thereby achieving semantically aware spatial recovery.
[0078] The Dy_Sample module treats upsampling as a "point resampling" process; for example... Figure 2 As shown in the figure. In the figure, X, X′, O and G represent the input feature, upsampled feature, generated offset and original sampling grid, respectively; σ represents the Sigmoid function; sH represents the sampling height; sW represents the sampling width;
[0079] After processing with a linear layer, gs 2 Divide the feature map into channels;
[0080] The Dysample network structure consists of the original sampling grid G and the generated offset O, given the input feature map X∈R. C×H × W The offset generator first extracts the two-dimensional offset corresponding to each output position from the input features through lightweight convolution, forming an offset tensor O∈R. 2×sH×sW Used to adjust the position of the sampling points;
[0081] The generation of the offset can be simplified as Equation (1):
[0082] O=λ·Linear(X)\*MERGEFORMAT(1)
[0083] Where λ is the factor that controls the offset amplitude (statically set to 0.25, or dynamically adjusted to 0.5sigmoid);
[0084] Subsequently, the offset tensor O is added to the original sampling grid G to construct a new set of sampling positions S = G + O, thereby achieving adaptive adjustment of the spatial sampling positions.
[0085] Finally, the content-aware resampling operation of the features is completed by bilinear interpolation on the original feature map at the newly constructed sampling points S using the grid_sample function in PyTorch, as expressed in equation (2):
[0086] X'=grid_sample(X,S)\*MERGEFORMAT(2)
[0087] It effectively enhances the responsiveness of edges and texture structures.
[0088] In YOLOv8, downsampling primarily relies on stride convolution. While this can simultaneously extract features and compress resolution, it also leads to information loss, which accumulates as the feature map shrinks, creating a performance bottleneck, especially in complex backgrounds or small object detection. From an imaging perspective, stride convolution treats all regions equally, making it difficult to preserve fine-grained structures such as key edges and textures. To address these issues, this invention introduces the progressive multipath downsampling module Adown.
[0089] The Adown module employs an asymmetric multi-branch structure, co-embedding AvgPool2d, MaxPool2d, and lightweight convolutions. Its structure is as follows: Figure 3 As shown;
[0090] Max pooling tends to preserve the most salient local activations, helping to highlight key edges, textures, and salient features in fine-grained recognition; while average pooling, by integrating a wider range of responses, suppresses noise interference and provides a smoother and more robust feature representation.
[0091] The Adown module first fuses the features from both branches using a single convolution, and then dynamically adjusts the proportion of the two branches through learnable weight gates. This allows the network to retain both key details and overall semantic information after downsampling. Its core feature is:
[0092] The input features are first lightly compressed by AvgPool2d (H→H-1) to smooth the noise while preserving the global distribution;
[0093] Then, MaxPool2d is used to halve the scale (H→H / 2), forming a gradually refined spatial dimensionality reduction method, which can better mitigate the risk of losing key information compared to stride convolution in one step.
[0094] Furthermore, the introduction of heterogeneous branches, namely convolution and pooling, enhances the diversity of feature representation, and the fusion mechanism promotes the synergy of information at different scales, which helps to highlight the key structure of the target region and improve the discrimination ability. Its overall transformation is shown in Equation (3):
[0095] F Adown (ω)=G 3×3 (ω)+P avg (ω)·P max (ω)\*MERGEFORMAT(3)
[0096] Among them, G 3×3 (ω) captures region edges and texture details, while P avg (ω)·P max (ω) then couples global background information and target salient response into “local-global collaborative” features through element-wise multiplication, thereby improving structural integrity and discriminability, and enhancing the perceptibility and detection accuracy of small targets in complex backgrounds.
[0097] The YOLOv8 backbone continues the CSPDarknet architecture, introducing the C2f module in each layer's feature scale to achieve a balance between parameter compression and expression efficiency. C2f consists of 1×1 convolutional branches for feature segmentation, several Bottleneck concatenations, and a final 1×1 fusion. However, the 3×3 convolutional weights used within the module remain static after training, making it difficult to adaptively respond to texture differences across scenes and small object details.
[0098] The full-dimensional dynamic convolution module is embedded in layers B4 and B6, replacing static convolution with dynamic convolution based on Omni-DimensionalDynamic Convolution (ODConv);
[0099] Specifically, the input features are first channel-adjusted through 1×1 convolution and divided into a main branch and a residual branch. The main branch keeps the original features unchanged, while the residual branch performs dynamic feature extraction through multiple Bottleneck modules that integrate ODConv.
[0100] The processing results at each level are then concatenated with the initial residual features, fused with the main branch features, and finally integrated into channels via 1×1 convolution.
[0101] like Figure 4 As shown, the original feature reuse mechanism is maintained through the full-dimensional dynamic convolution module, while the weight adaptation is achieved by introducing ODConv-based dynamic convolution in the internal Bottleneck module.
[0102] Conventional convolutional layers use a set of pre-trained static weights W during the inference phase to apply weights to the input features. Convolution is represented by equation (4):
[0103] y=W*x\*MERGEFORMAT(4)
[0104] Where * represents a two-dimensional convolution operation, the convolution kernel in equation (4) remains unchanged for all samples, making it difficult to adaptively adjust for complex scenes or small targets. In order to improve the input dependence of features, one-dimensional dynamic convolution proposes to adjust N sets of basic kernels during the forward process. Perform linear weighting:
[0105]
[0106] Where α wi satisfy The weight scalar generated based on x;
[0107] However, Equation (5) only models dynamics at the kernel group level, ignoring the differences between the channel and spatial levels;
[0108] To further enhance the adaptability of the convolutional kernel to fine-grained context, ODConv is employed, such as... Figure 5 As shown, in addition to the kernel group weights, a space (α) is introduced. si ), input channel (α) ci ) and output channel (α) fi Three types of attention coefficients simultaneously modulate the four key dimensions of the convolution weights;
[0109] Specifically, by applying element-wise weights to each basic kernel Wi in the spatial, input, and output dimensions, and then performing a soft combination in the kernel group dimension, a dynamic convolutional kernel related to the input can be obtained:
[0110] y=(α w1 ⊙α f1 ⊙α c1 ⊙α s1 ⊙W1+…+α fn ⊙α cn ⊙α sn ⊙W n )*x\*MERGEFORMAT(6)
[0111] Where ⊙ represents element-wise weighting in the corresponding dimension. Through Equation (6), the convolution kernel can be reconstructed in real time with the input in multiple dimensions such as space, channel and kernel group, which significantly enhances the feature representation ability of small targets and complex backgrounds. Moreover, the additional computational overhead only comes from the attention branches constructed by a small number of 1×1 convolutions, and its impact on the overall inference efficiency is negligible.
[0112] To further improve the detection performance of the model in multi-scale target detection, especially in small target recognition scenarios, this invention proposes an improved detection head structure, SA-Det, which addresses the limitations of traditional convolutional structures in the YOLOv8 detection head on high-resolution feature maps.
[0113] like Figure 6 As shown, the SA-Det detection head is divided into two parallel branches: regression and classification, both of which introduce the Self_Attn module for feature enhancement;
[0114] The YOLOv8 detection head processes feature maps from three scales: P3, P4, and P5. The P3 layer has the highest spatial resolution and is crucial for small object detection. However, the inherent local receptive field limitation of convolutional operations makes it difficult to capture cross-regional contextual information in high-resolution feature maps, thus limiting its ability to recognize small objects. To address these limitations, this invention introduces a lightweight self-attention module, Self_Attn, into each scale branch of the A-Det detection head, enhancing the model's ability to model long-distance dependencies while maintaining spatial resolution.
[0115] The Self_Attn module adopts a structure design of "bottleneck-channel compression—multi-head self-attention—channel recovery", and introduces residual connections to improve information transmission and gradient stability, such as Figure 6 As shown, MHSA is used to build global perception capability, and feature representation is enhanced by fusing compressed-expanded paths and residual paths;
[0116] At the computational level, the core operations of the self-attention module are as follows:
[0117]
[0118] Where Q = XW Q K = XW K V = XW V They are linear mappings of the input features, d k This is the scaling factor;
[0119] This mechanism endows feature maps with the ability to model long-distance dependencies at the pixel level, effectively making up for the limitations of the receptive field of traditional convolution.
[0120] The Self_Attn module is also designed to be lightweight, employing a bottleneck structure with a compression ratio r, resulting in the following parameter count:
[0121]
[0122] Compared to the parameter count P of a traditional 3×3 convolution... Conv =9C1 2In comparison, with r=4, the parameters of the Self_Attn module are only about 6% of its original value.
[0123]
[0124] This structure significantly improves the detection performance for small targets and complex backgrounds while maintaining a compact model size, demonstrating a good performance-efficiency balance.
[0125] Based on the above embodiments, the following technical experimental verification is proposed:
[0126] Experimental Platform
[0127] To verify the deployability and real-time performance of the proposed method, this invention deployed the LSD-YOLO model on a PC platform equipped with an NVIDIA RTX 4060 graphics card and built a visual tracking experimental platform consisting of a high-precision electrically controlled 2D gimbal (specific parameters are shown in Table 1) and a 120mm telephoto camera lens, as follows: Figure 7 As shown in (a), the platform employs a PID closed-loop control strategy, combined with LSD-YOLO detection results to achieve adaptive tracking. Through the coordinated operation of target motion state estimation and adaptive PID control, the system can dynamically adjust the gimbal motion parameters and utilize visual feedback for real-time correction. The system achieves a pitch / azimuth control accuracy of ±0.03° and a maximum angular velocity of 15° / s, effectively tracking fast-flying UAV targets and meeting the engineering requirements for real-time and accurate tracking.
[0128] Table 1: 2D Gimbal Parameter Table
[0129]
[0130] The experiment was conducted in an open outdoor area, with the DJI Phantom 4 drone as the test target. The drone's maximum flight speed was 20 m / s, and the flight distance was between 100 and 200 meters. The experiment simulated the continuous flight of a small low-altitude aircraft and the tracking of a small target at a long distance. Figure 7(b) and (c) show the real-time visualization output of UAV detection and tracking during the experiment, displaying the detection and tracking status of the UAV from different perspectives. Offset X and offset Y, shown in the figures, represent the horizontal and vertical offsets of the UAV target relative to the image center point, respectively, used to guide the gimbal in adjusting its angle. Class ID:0 represents the UAV target category label number, and Confidence represents the detection confidence level; a higher value indicates a more reliable detection result. The FPS displayed in the upper left corner refers to the system's frame rate, reflecting the real-time detection speed and ensuring smooth target tracking and timely response. Experimental results show that the platform can achieve stable locking and continuous tracking of UAVs in complex backgrounds, effectively verifying the practical application value of the proposed method in low-altitude UAV monitoring. See also... Figure 7 .
[0131] Experimental setup
[0132] In this invention, YOLOv8n was selected as the baseline network and implemented using the PyTorch framework. The experimental platform was Ubuntu 20.04. To fully utilize the network's parallel computing performance, an NVIDIA RTX 4090 GPU with 24GB of video memory was used. Table 2 shows the hyperparameter settings.
[0133] Table 2: Hyperparameter Setting Table
[0134]
[0135]
[0136] To improve the model's generalization ability in complex scenarios, this invention constructs an anti-drone image dataset with diverse backgrounds and target distributions, such as... Figure 8 As shown. The data mainly comes from on-site photography (covering different time periods, weather conditions, and typical scenes such as urban building clusters, low-altitude airspace, and densely vegetated areas) and time-lapse photography, including a large number of drone images in complex scenes, significantly improving the environmental diversity and realism of the dataset. This experiment collected 26,145 images to construct the dataset, which were divided into training, validation, and test sets in an 8:1:1 ratio. (See reference...) Figure 8 .
[0137] ablation experiment
[0138] To systematically evaluate the impact of each improved module on detection accuracy and computational overhead, this invention designed an ablation experiment based on YOLOv8n, progressively stacking the improved modules. Specifically, this included: introducing the Dy_Sample upsampling module (A), replacing the original downsampling structure with the Adown module (B), integrating OD Block to enhance feature modeling (C), and replacing the original detection branch with a self-developed SA-Det detection head (D), thus progressively constructing a series of comparative models. The performance contribution of each module was quantitatively evaluated using multi-dimensional indicators such as recall, mAP50, mAP95, GFLOPs, and model parameters. The experimental results are shown in Table 3.
[0139] Table 3: Experimental results of various indices in the ablation test
[0140]
[0141] Compared with the baseline model YOLOv8n, the introduction of the Dy_Sample upsampling structure (A) improved mAP50 and mAP95 from 95.0% to 96.6% and 63.3% respectively, and the recall rate to 93.5%, without increasing computational complexity. This effectively enhanced the recovery of high-level feature details and demonstrated a good performance-efficiency balance. Subsequently, replacing the original downsampling structure with the lightweight Adown module (B) further improved the shallow semantic representation and spatial information preservation capabilities, increasing mAP95 to 63.6%, while significantly reducing GFLOPs to 7.2 and parameters to 2.59M. Combining A and B (A+B) maintained mAP50 at 96.7% and increased mAP95 to 63.9%, indicating a good synergistic effect between the upsampling and downsampling structures. Further introducing the designed OD Block (C) further improved mAP50 to 96.9% and the recall rate to 94.3%, demonstrating significant effects in enhancing semantic modeling capabilities and target perception. Although the number of parameters increased slightly (3.09M), GFLOPs remained at 7.6, maintaining excellent computational efficiency. When this module was integrated into A+B (A+B+C), mAP95 improved to 64.0%, and GFLOPs decreased to 6.2, further validating the synergistic optimization of accuracy and efficiency. Finally, replacing the original detection branch (D) with the self-developed SA-Det detection head achieved mAP50 of 97% and recall of 94.3% without significantly increasing the model size, fully demonstrating the effectiveness of this detection structure in improving target discrimination capabilities. The final model (A+B+C+D) constructed by integrating the four modules achieved mAP50 of 97.9% and mAP95 of 64.2%, with a further increase in recall to 95.3%, while keeping the computational load at 5.7 GFLOPs and the number of parameters at only 2.45M.
[0142] Experimental results demonstrate that the proposed improved modules significantly enhance the accuracy and robustness of small target detection, exhibiting excellent structural synergy, balancing performance and computational efficiency, and demonstrating adaptability and robustness in complex scenarios. The final model achieves 97.9% accuracy on mAP50 and 64.2% on mAP95, with computational complexity controlled at 5.7 GFLOPs and only 2.45 M parameters. This demonstrates both improved accuracy and lightweight, efficient inference, validating its application value in edge computing.
[0143] Comparative experiment
[0144] To further validate the detection accuracy and computational complexity of LSD-YOLO, a comprehensive comparison was conducted with several mainstream object detection models. Considering the high real-time requirements of UAV image processing, single-stage object detection algorithms with lower hardware dependence and higher detection accuracy were prioritized for comparison to better meet practical application needs. Evaluation metrics covered key aspects such as recall, mAP50, mAP95, computational complexity (GFLOPs), and model parameters.
[0145] Table 4: Comparison Results of Different Detection Models
[0146]
[0147] As shown in Table 4, LSD-YOLO's mAP95 is 64.5%, slightly lower than YOLOv5s (66.9%), but its GFLOPs and model parameters are only 5.7 and 2.55M, respectively, much smaller than YOLOv5s (23.8 and 9.11M). Secondly, LSD-YOLO's parameter count is 2.55M, slightly higher than YOLOv9t (1.73M), but it outperforms YOLOv9t in all other evaluation metrics. In comparative experiments with YOLOv5n, YOLOv6n, YOLOv7-tiny, YOLOv9t, YOLO10n, and YOLO11n, LSD-YOLO achieved superior results compared to existing methods in all key performance indicators, demonstrating more outstanding detection accuracy and overall performance advantages.
[0148] To further verify the detection performance of the proposed model in complex environments, this invention selected two representative complex scene images from the test set for visualization and compared them with the confidence results of the baseline model YOLOv8n. Figure 9As shown in Figure (a), the confidence value in the detection box represents the model's prediction confidence that the area belongs to the target category. The higher the value, the more certain the model's judgment that the area is a target. Figure (a) shows that under low light and long distance conditions, due to insufficient imaging resolution, the drone target exhibits significant blurring, leading to inaccurate boundary localization and decreased confidence in the YOLOv8n model detection. LSD-YOLO, through a combination of dynamic upsampling and progressive downsampling, effectively preserves target edge details and distant background context information, enabling small drones to be clearly identified even under low-light conditions at a distance, with a significantly improved detection confidence. Figure (b) reflects the detection performance under complex background interference conditions. The YOLOv8n model is prone to detection box offset issues under tree occlusion and urban background interference. The improved model introduces the OD Block module in layers B4 and B6, enhancing the feature adaptation capabilities of spatial, channel, and group convolution dimensions through ODConv, thus improving the ability to distinguish complex textures and interfering backgrounds. Furthermore, the lightweight self-attention mechanism (SA-Det) embedded in the detection head further enhances the model's ability to perceive the global context, enabling accurate localization and high-confidence judgment even when the target is partially occluded. The current LSD-YOLO model has demonstrated significant advantages in complex environments, but to further improve detection performance, future research can focus on two aspects: first, fusing infrared and visible light data to enhance detection capabilities under extreme lighting conditions; and second, employing neural architecture search techniques to dynamically adjust the network structure to balance accuracy and speed.
[0149] In summary:
[0150] This invention proposes a lightweight detection model, LSD-YOLO, for low-resolution small targets, significantly improving its detection performance in complex low-altitude environments. Firstly, a dynamic co-sampling mechanism is used to overcome the traditional resampling method's dilemma of balancing feature preservation and computational efficiency. Secondly, a multi-dimensional dynamic convolution design is employed to achieve accurate feature extraction of small targets in complex backgrounds. Finally, a lightweight self-attention mechanism is used in the detection head, reducing computational burden while enhancing long-distance dependency modeling capabilities. Experimental results show that compared to the baseline model YOLOv8n, the improved LSD-YOLO model achieves a 2.1% improvement in mAP95 on the self-built Anti-drone dataset, reaching 64.2%, while reducing computational cost (GFLOPs) by 29.6%.
[0151] The model has been deployed on a PC platform equipped with an NVIDIA RTX 4060 graphics card, realizing the construction of a visual tracking system based on a camera and an electronically controlled gimbal. It can drive the gimbal to perform adaptive target tracking in real time based on detection results. While maintaining the model's lightweight design, the network significantly improves detection accuracy and real-time performance, fully validating its practical value in low-altitude UAV monitoring scenarios.
[0152] The proposed method outperforms the benchmark model in both detection accuracy and computational efficiency. Its real-time performance and stability demonstrated in actual deployment tests fully prove the practical value of the method in low-altitude security scenarios.
[0153] The lightweight detection network proposed in this invention has been successfully deployed efficiently on edge devices, significantly improving the real-time detection performance of UAV targets in complex low-altitude environments.
[0154] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A lightweight YOLO detection model construction method for low-resolution small targets, characterized by: At least the following steps are included: S1: Based on the YOLOv8n architecture, optimization is performed by replacing the original resampling method with the Dy_Sample-Adown collaborative sampling module. The Dy_Sample module improves upsampling accuracy by dynamically generating resampling kernels, while the Adown module uses a progressive strategy to retain global information. The two work together to improve the ability to retain details while reducing the amount of computation. S2: Introduce OD Block, a full-dimensional dynamic convolution module, into the Backbone key layer. ODConv is used to realize multi-dimensional dynamic weight modulation of space, channels and kernel groups, which enhances the model's adaptive representation ability of small drones in complex backgrounds. S3: Design an SA-Det detection head at the head end, enhance global context modeling capabilities by embedding a lightweight self-attention module, improve the detection sensitivity of small targets, and utilize the SA-Det detection head to integrate a lightweight self-attention mechanism to improve the detection capability of small targets.
2. The lightweight YOLO detection model construction method for low-resolution small targets according to claim 1, characterized in that: The essence of the Dy_Sample module is to transform the upsampling process into a learnable offset-guided sampling problem, allowing the model to dynamically generate the corresponding sampling points for each position, thereby achieving semantically aware spatial recovery. The Dy_Sample module treats upsampling as a "point resampling" process; Let X, X′, O, and G represent the input feature, upsampled feature, generated offset, and original sampling grid, respectively; σ represents the Sigmoid function; sH represents the sampling height; and sW represents the sampling width. After processing with a linear layer, gs 2 Divide the feature map into channels; The Dysample network structure consists of the original sampling grid G and the generated offset O, given the input feature map X∈R. C×H × W The offset generator first extracts the two-dimensional offset corresponding to each output position from the input features through lightweight convolution, forming an offset tensor O∈R. 2×sH×sW Used to adjust the position of the sampling points; The offset is generated as expressed in equation (1): O=λ·Linear(X)\*MERGEFORMAT(1) Where λ is a factor that controls the magnitude of the offset; Subsequently, the offset tensor O is added to the original sampling grid G to construct a new set of sampling positions S = G + O, thereby achieving adaptive adjustment of the spatial sampling positions. Finally, the content-aware resampling operation of the features is completed by bilinear interpolation on the original feature map at the newly constructed sampling points S using the grid_sample function in PyTorch, as expressed in equation (2): X'=grid_sample(X,S)\*MERGEFORMAT(2) It effectively enhances the responsiveness of edges and texture structures.
3. The lightweight YOLO detection model construction method for low-resolution small targets according to claim 1, characterized in that: The Adown module adopts an asymmetric multi-branch structure, which integrates AvgPool2d, MaxPool2d and lightweight convolution. The Adown module first fuses the features from both branches using a single convolution, and then dynamically adjusts the proportion of the two branches through learnable weight gates. This allows the network to retain both key details and overall semantic information after downsampling. Its core feature is: The input features are first lightly compressed by AvgPool2d (H→H-1) to smooth the noise while preserving the global distribution; Then, MaxPool2d is used to halve the scale (H→H / 2), forming a gradually refined spatial dimensionality reduction method, which can better mitigate the risk of losing key information compared to stride convolution in one step. Furthermore, the introduction of heterogeneous branches, namely convolution and pooling, enhances the diversity of feature representation, and the fusion mechanism promotes the synergy of information at different scales, which helps to highlight the key structure of the target region and improve the discrimination ability. Its overall transformation is shown in Equation (3): F Adown (ω)=G 3×3 (ω)+P avg (ω)·P max (ω)\*MERGEFORMAT(3) Among them, G 3×3 (ω) captures region edges and texture details, while P avg (ω)·P max (ω) then couples global background information and target salient response into "local-global collaborative" features through element-wise multiplication, thereby improving structural integrity and discriminability, and enhancing the perceptibility and detection accuracy of small targets in complex backgrounds.
4. The lightweight YOLO detection model construction method for low-resolution small targets according to claim 1, characterized in that: The full-dimensional dynamic convolution module is embedded in layers B4 and B6, replacing static convolution with dynamic convolution based on Omni-DimensionalDynamic Convolution. Specifically, the input features are first channel-adjusted through 1×1 convolution and divided into a main branch and a residual branch. The main branch keeps the original features unchanged, while the residual branch performs dynamic feature extraction through multiple Bottleneck modules that integrate ODConv. The processing results at each level are then concatenated with the initial residual features, fused with the main branch features, and finally integrated into channels via 1×1 convolution. The original feature reuse mechanism is maintained through the full-dimensional dynamic convolution module, while the weight adaptation is achieved by introducing ODConv-based dynamic convolution in the internal Bottleneck module. Conventional convolutional layers use a set of pre-trained static weights W during the inference phase to apply weights to the input features. Convolution is represented by equation (4): y=W*x\*MERGEFORMAT(4) Where * represents a two-dimensional convolution operation, the convolution kernel in equation (4) remains unchanged for all samples, making it difficult to adaptively adjust for complex scenes or small targets. In order to improve the input dependence of features, one-dimensional dynamic convolution proposes to adjust N sets of basic kernels during the forward process. Perform linear weighting: Where α wi satisfy The weight scalar generated based on x; However, Equation (5) only models dynamics at the kernel group level, ignoring the differences between the channel and spatial levels; To further enhance the adaptability of the convolutional kernel to fine-grained context, ODConv is adopted, introducing a spatial (α) dimension in addition to the kernel group weights. si ), input channel (α) ci ) and output channel (α) fi Three types of attention coefficients simultaneously modulate the four key dimensions of the convolution weights; Specifically, for each basic kernel Wi, element-wise weights are applied sequentially in the spatial, input, and output dimensions, and then soft combination is performed in the kernel group dimension to obtain a dynamic convolutional kernel related to the input: y=(a w1 ⊙a f1 ⊙a c1 ⊙a s1 ⊙W1+…+α fn ⊙a cn ⊙a sn ⊙W n )*x\*MERGEFORMAT(6) Where ⊙ represents element-wise weighting in the corresponding dimension, and through Equation (6), the convolution kernel can be reconstructed in real time with the input in multiple dimensions such as space, channel and kernel group, thereby significantly enhancing the feature representation ability of small targets and complex backgrounds.
5. The lightweight YOLO detection model construction method for low-resolution small targets according to claim 1, characterized in that: The SA-Det detection head is divided into two parallel branches: regression and classification, both of which introduce the Self_Attn module for feature enhancement. The Self_Attn module adopts a "bottleneck-channel compression-multi-head self-attention-channel recovery" structural design, and introduces residual connections to improve information transmission and gradient stability. It uses MHSA to build global perception capabilities and enhances feature representation by fusing compression-expansion paths and residual paths. At the computational level, the core operations of the self-attention module are as follows: Where Q = XW Q K = XW K V = XW V They are linear mappings of the input features, d k This is the scaling factor; The Self_Attn module is also designed to be lightweight, employing a bottleneck structure with a compression ratio r, resulting in the following parameter count: Compared to the parameter count P of a traditional 3×3 convolution... Conv =9C1 2 In comparison, with r=4, the parameters of the Self_Attn module are only about 6% of its original value. While maintaining a compact model size, it significantly improves the detection performance for small targets and complex backgrounds, demonstrating a good performance-efficiency balance.