Unmanned aerial vehicle target detection method based on lightweight backbone and parameter-free attention
Patent Information
- Application Number
- CN202611400323.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]本发明提供基于轻量化主干与无参数注意力的无人机目标检测方法,通过硬件感知网络设计、加权特征融合与无参数注意力机制协同优化,旨在解决无人机嵌入式平台算力受限与航拍复杂背景下目标检测精度不足的矛盾
硬件感知的极致轻量化:ShuffleNetV2的四条硬件感知准则首次被系统性地引入无人机目标检测领域。区别于仅关注FLOPs的传统方法,本发明从通道平衡、分组卷积代价、碎片化程度和逐元素操作四个维度同时优化,参数量由基线1.90M降至1.25M(降低约34%),同时有效降低内存访问成本和推理延迟。
Smart Images

Figure CN122967162A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and target detection technology, and in particular to a UAV target detection method based on lightweight backbone and parameterless attention. Background Technology
[0002] Drone aerial target detection tasks require algorithms to run in real time on airborne embedded platforms (such as edge computing devices like the NVIDIA Jetson Nano), facing dual limitations in computing resources and power consumption. While single-stage detection algorithms, such as YOLOv5, have high end-to-end efficiency, their CSPDarknet backbone network suffers from parameter redundancy and high memory access costs, limiting inference speed when deployed directly.
[0003] The existing lightweighting research has the following shortcomings: (1) Most of them use floating-point operations (FLOPs) as an efficiency indicator, but ignore the impact of memory bandwidth bottleneck and network fragmentation on actual inference speed; (2) Feature fusion networks (such as PANet) assign equal weights to inputs at each scale during fusion, which is not conducive to the feature preservation of targets with a very small scale ratio in the perspective of UAVs; (3) The introduction of conventional attention modules (such as SE, CBAM) will significantly increase the number of parameters, which is contrary to the goal of lightweighting.
[0004] Therefore, there is an urgent need for a lightweight target detection method that can comprehensively consider memory access efficiency, multi-scale feature fusion quality, and background noise suppression capability under extremely low parameter constraints. Summary of the Invention
[0005] This invention provides a UAV target detection method based on a lightweight backbone and parameterless attention. Through hardware perception network design, weighted feature fusion and parameterless attention mechanism synergistic optimization, it aims to solve the contradiction between the limited computing power of UAV embedded platforms and the insufficient target detection accuracy in complex aerial photography backgrounds.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: UAV target detection methods based on lightweight backbone and parameterless attention include: The input drone aerial images are preprocessed to obtain preprocessed images; The preprocessed image is input into a lightweight backbone network built on ShuffleNetV2 units for multi-scale feature extraction, and at least three feature maps of different scales are output. The feature maps of at least three different scales are input into a bidirectional weighted feature pyramid network for cross-scale weighted feature fusion, and the fused multi-scale feature map is output. The fused multi-scale feature map is input into a parameterless attention module for feature enhancement, and the enhanced feature map is output. The enhanced feature map is input into the target detection head for target category prediction and bounding box regression, and the target detection result is output.
[0007] In summary, the present invention has at least the following beneficial effects: Extremely Lightweight Hardware Awareness: ShuffleNetV2's four hardware-aware criteria are systematically introduced into the field of UAV target detection for the first time. Unlike traditional methods that only focus on FLOPs, this invention optimizes four dimensions simultaneously: channel balance, grouped convolution cost, fragmentation degree, and element-wise operations. The number of parameters is reduced from the baseline of 1.90M to 1.25M (a reduction of approximately 34%), while effectively reducing memory access costs and inference latency.
[0008] Dynamic multi-scale adaptive fusion: BiFPN replaces the equal-weight fusion of traditional PANet with a learnable cross-scale weighted fusion strategy, enabling the network to adaptively adjust the contribution of features at different scales according to the current scene, thus solving the feature matching problem caused by drastic changes in target scale in UAV aerial photography.
[0009] Parameter-free attention enhancement: The SimAM module achieves joint attention weighting across spatial and channel dimensions based on the neuron energy function without introducing any new parameters. Unlike SE-Net, which requires fully connected layers, and CBAM, which requires additional convolutions, SimAM relies entirely on feature statistics to derive attention weights, improving mAP by 4.54 percentage points while keeping the number of parameters constant at 1.90M.
[0010] Hard sample focusing optimization: Focal EIoU loss decomposes the aspect ratio penalty coupled in CIoU into independent width and height losses, which solves the problem that CIoU produces the same gradient in the regression of very small targets due to the same aspect ratio but different absolute size. Combined with the Focal mechanism, hard samples are given higher weights, which effectively improves the boundary regression accuracy of occluded and small pixel targets. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.
[0012] Figure 1 This is a schematic diagram of a UAV target detection method based on a lightweight backbone and parameterless attention.
[0013] Figure 2 This is a schematic diagram comparing standard convolution and depthwise separable convolution.
[0014] Figure 3 This is a schematic diagram illustrating the mapping principle between the SimAM energy function and salient neurons. Detailed Implementation
[0015] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0016] The following disclosure provides many different implementations or examples for carrying out different structures of the embodiments of the present invention. To simplify the disclosure of the embodiments of the present invention, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the embodiments of the present invention. Furthermore, reference numerals and / or reference letters may be repeated in different examples of the embodiments of the present invention; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various implementations and / or arrangements discussed.
[0017] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0018] like Figure 1 As shown, this embodiment provides a UAV target detection method based on a lightweight backbone and parameterless attention, including: The input drone aerial images are preprocessed to obtain preprocessed images; The preprocessed image is input into a lightweight backbone network built on ShuffleNetV2 units for multi-scale feature extraction, and at least three feature maps of different scales are output. The feature maps of at least three different scales are input into a bidirectional weighted feature pyramid network for cross-scale weighted feature fusion, and the fused multi-scale feature map is output. The fused multi-scale feature map is input into a parameterless attention module for feature enhancement, and the enhanced feature map is output. The enhanced feature map is input into the target detection head for target category prediction and bounding box regression, and the target detection result is output.
[0019] In some embodiments, the lightweight backbone network is composed of multiple stages stacked sequentially, each stage including alternating basic units with a step size of 1 and downsampling units with a step size of 2; The basic unit splits the input features into two branches. One branch retains the original features with an identity mapping, and the other branch extracts features by sequentially passing through ordinary convolution, depthwise separable convolution, and ordinary convolution. The output features of the two branches are concatenated in the channel dimension and then channel rearrangement is performed. Both branches of the downsampling unit use depthwise separable convolution with a stride of 2 for spatial dimensionality reduction. The number of channels is doubled after the output features of the two branches are concatenated in the channel dimension.
[0020] In some embodiments, the bidirectional weighted feature pyramid network employs a fast normalization fusion strategy for cross-scale feature fusion, specifically including: In the top-down path, the high-level feature map is upsampled to match its spatial size with that of the low-level feature map; In the bottom-up path, the lower-level feature maps are downsampled to match their spatial dimensions with those of the higher-level feature maps; Learnable fusion weights are assigned to the input features at the same level, the high-level features after upsampling, and the low-level features after downsampling. The output features at that level are obtained by weighted summation based on each fusion weight.
[0021] In some embodiments, the parameterless attention module calculates the energy value of each neuron in the fused multi-scale feature map based on the neuron energy function, determines the importance weight of each neuron according to the energy value, and uses the importance weight to reweight the features of the fused multi-scale feature map to obtain the enhanced feature map. The energy value is calculated based on the mean and variance of the channel in which each neuron is located. The lower the energy value, the higher the importance of the neuron.
[0022] In some embodiments, the target detection head is an anchor-box-based detection head. The anchor-box-based detection head presets multiple anchor boxes of different sizes at various spatial locations of the enhanced feature map. For each anchor box, it predicts the target class probability, target confidence, and bounding box coordinate offset. The prediction results are filtered by non-maximum suppression, and the final target detection result is output.
[0023] In some embodiments, the size of the anchor frame is obtained by clustering the real target frames in the UAV aerial target detection dataset. After clustering, the obtained anchor frames are sorted by size from smallest to largest and then assigned to feature maps of different scales.
[0024] In some embodiments, the preprocessing includes normalizing the pixel values of the original image to the [0,1] interval, standardizing the normalized image using statistical parameters from the ImageNet dataset, and scaling the standardized image to a preset size.
[0025] In some embodiments, a static matching strategy based on the cross-union ratio (CUR) is used to assign positive and negative samples during model training: anchor boxes with an CUR greater than a first preset threshold are marked as positive samples, anchor boxes with an CUR less than a second preset threshold are marked as negative samples, and anchor boxes with an CUR between the second preset threshold and the first preset threshold are marked as ignored samples.
[0026] In some embodiments, the Focal EIoU loss function is used as the loss function for bounding box regression during model training. The Focal EIoU loss function decomposes the loss of bounding box regression into four components: crossover ratio loss, center distance loss, width loss, and height loss, and assigns higher loss weights to samples with large crossover ratio errors.
[0027] In some embodiments, model training is divided into a freeze phase and a unfreeze phase: in the freeze phase, the parameters of the lightweight backbone network are frozen, and only the parameters of the bidirectional weighted feature pyramid network and the target detection head are trained; in the unfreeze phase, all network parameters are unfrozen for end-to-end joint training.
[0028] In some embodiments, after receiving the feature maps of at least three different scales, the bidirectional weighted feature pyramid network evaluates the information content of each level of feature map and selects differentiated feature transmission paths for different levels based on the evaluation results. The information content assessment includes calculating the information entropy of each level of feature map, which is determined based on the normalized contribution probability of the feature values at each position in the feature map of that level; The feature transmission path for each level is selected based on the magnitude of the information entropy: when the information entropy is higher than the first information entropy threshold, the feature map of that level is simultaneously input into the top-down path and the bottom-up path of the bidirectional weighted feature pyramid network for bidirectional weighted fusion; when the information entropy is lower than the second information entropy threshold, the feature map of that level is only input into the top-down path for unidirectional transmission, skipping the fusion calculation of the bottom-up path; the first information entropy threshold is greater than the second information entropy threshold.
[0029] In some embodiments, a progressive early termination inference mechanism based on the dynamic evolution of detection confidence is introduced during the continuous video stream processing in the model inference phase. The progressive early termination inference mechanism includes: determining the detection quality score of the current frame based on the confidence of all detection boxes output by the target detection head in the current frame, and determining the detection quality level of the current frame based on the sliding average of the detection quality score and its changing trend within the time window; The progressive early termination inference mechanism includes multiple early termination levels, each corresponding to a different calculation skipping strategy. When the moving average of the detection quality score is higher than a first quality threshold and the absolute value of the change trend is lower than a first trend threshold, the first level of early termination is executed, skipping the feature extraction calculation of the last stage in the lightweight backbone network. When the moving average of the detection quality score is higher than a second quality threshold and the absolute value of the change trend is lower than a second trend threshold, the second level of early termination is executed, skipping the feature extraction calculation of the last stage in the lightweight backbone network and the feature fusion calculation of the highest level in the bidirectional weighted feature pyramid network. When the moving average of the detection quality score is higher than a third quality threshold and the absolute value of the change trend is lower than a third trend threshold, the third level of early termination is executed, skipping the feature extraction calculation of the last two stages in the lightweight backbone network and the feature fusion calculation of all levels in the bidirectional weighted feature pyramid network, directly reusing the feature map of the corresponding level of the current frame for target detection. The first quality threshold is greater than the second quality threshold, which is greater than the third quality threshold; the first trend threshold is greater than the second trend threshold, which is greater than the third trend threshold.
[0030] In some embodiments, the loss function also introduces cross-level gradient direction consistency loss as a regularization term, which is used to constrain the gradient direction of the output features after fusion of adjacent levels to remain consistent during backpropagation. The gradient direction consistency loss is calculated by comparing the differences between the gradient directions obtained by the output features of adjacent layers during backpropagation. The smaller the difference in gradient direction, the higher the gradient direction consistency between adjacent layers. The sum of the gradient direction consistency losses of all adjacent layers is multiplied by a preset gradient consistency loss weight coefficient and then added to the loss function.
[0031] The technical concept of this invention is as follows: A UAV target detection method based on lightweight backbone and parameterless attention includes the following steps: Step S0: Image preprocessing.
[0032] The pixel values of the original image were normalized from [0,255] to the [0,1] interval (i.e., divided by 255), and then standardized using the statistical parameters of the ImageNet dataset, with the mean set to [0.485, 0.456, 0.406] and the standard deviation set to [0.229, 0.224, 0.225]. The standardized images were then uniformly scaled to 640×640 using bilinear interpolation.
[0033] Step S1: Construct a lightweight ShuffleNetV2 backbone network that follows hardware-aware principles.
[0034] Using YOLOv5n as a baseline, CSPDarknet was stripped away, and ShuffleNetV2 units were introduced to reconstruct the backbone. The design of the ShuffleNetV2 units strictly followed the following four hardware-aware principles: Rule 1 (Channel Balancing): Maintain an equal number of input and output channels to minimize the memory access cost (MAC). Regarding computational complexity... MAC satisfies According to the AM-GM inequality, when The MAC value is at its minimum. in, The computational cost of the convolutional layer, For the input feature map height, The width of the input feature map. Input the number of channels. MAC represents the number of output channels and memory access cost.
[0035] Rule 2 (Cost of Grouped Convolution): Limit the number of groups To avoid MAC A dramatic increase; Guideline 3 (Reduce Fragmentation): Reduce multi-branch structures and avoid the overhead of scheduling a large number of small operators, which reduces the efficiency of GPU / NPU parallel computing. Rule 4 (Reduce element-by-element operations): Replace addition with concatenation (Concat) to simplify activation layers and improve inference throughput.
[0036] The lightweight backbone network is built based on ShuffleNetV2 units, and its core operator is depthwise separable convolution. For example... Figure 2 As shown, standard convolution and depthwise separable convolution have fundamental differences in structure. Depthwise separable convolution decomposes standard convolution into two cascaded stages: channel-wise depthwise convolution and pixel-wise pointwise convolution. This achieves physical separation between spatial feature extraction and channel information fusion, thereby significantly reducing parameter redundancy and computational complexity.
[0037] In the ShuffleNetV2 basic unit (stride 1), the input features are split into two branches via channel splitting: one branch retains the original features through identity mapping, and the other branch extracts local features sequentially through ordinary convolution, depthwise separable convolution, and ordinary convolution. The two branches are then concatenated and subjected to a channel shuffle operation to achieve cross-group information exchange. This operation is completed through a three-step cascade of reshape, transpose, and flatten. In the downsampling unit (stride 2), channel splitting is eliminated, and both branches undergo spatial dimensionality reduction using depthwise separable convolution with a stride of 2. After concatenation, the number of channels is doubled.
[0038] The ShuffleNetV2 backbone network consists of 5 stages (Stage 0 to Stage 4). Stage 0 consists of a 3×3 convolutional layer with a stride of 2 and a 3×3 max pooling layer with a stride of 2, which compresses the input image of size 640×640 to 160×160 and expands the number of channels to 24. Stages 1 to 4 are all composed of alternating basic units with a stride of 1 (ShuffleUnit1) and downsampling units with a stride of 2 (ShuffleUnit2), with the number of stacks in each stage being [4, 8, 4, 4]. The feature map resolutions output from Stage 1 to Stage 4 are 1 / 8, 1 / 16, 1 / 32, and 1 / 32 of the original image, respectively, with corresponding output channel numbers of 116, 232, 464, and 1024 (standard ShuffleNetV2 1.0× configuration). Stage 4 does not contain downsampling units, and its output resolution is the same as Stage 3, but the number of channels is expanded to 1024. This 1024-channel feature map is not directly used as input for multi-scale feature fusion.
[0039] The number of stacks in Stage 1 to Stage 4 [4,8,4,4] is consistent with the standard ShuffleNetV2 1.0× architecture, where Stage 1 corresponds to the first stage of the standard network (including downsampling units), and Stages 2 to 4 correspond to the subsequent three stages of the standard network.
[0040] P3, P4, and P5 are derived from the ends of Stage 1 (1 / 8 downsampling), Stage 2 (1 / 16 downsampling), and Stage 3 (1 / 32 downsampling), respectively. The 1024-channel feature map output from Stage 4 does not directly participate in multi-scale feature fusion. The three-layer feature maps are input into the subsequent BiFPN network.
[0041] Step S2: Construct a weighted bidirectional feature fusion network based on BiFPN.
[0042] The three scale feature layers P3, P4, and P5 from the ShuffleNetV2 backbone output in step S1 are introduced into BiFPN (Bidirectional Weighted Feature Pyramid). The structural improvements of BiFPN include: (1) removing redundant nodes with only one input edge to save computational resources; (2) adding skip connections between input and output nodes at the same level to retain more original features; and (3) adopting a fast normalization fusion strategy to assign learnable fusion weights to different input features.
[0043] The mathematical expression for the fast normalization fusion is: ; in, Indicates the input number of the first... Layer features, For the corresponding learnable weights (guarantee) ), To prevent small constants with denominators of zero (in this invention, we take...) This weight can dynamically evolve according to the scale distribution pattern of the current observation scene, enabling the network to more effectively preserve edge and texture features that are conducive to the localization of small targets in complex backgrounds.
[0044] In BiFPN, the top-down path uses bilinear interpolation upsampling to progressively enlarge high-level features to the same spatial size as low-level features; the bottom-up path uses 3×3 convolutions with a stride of 2 for downsampling. At the same level, the input features and the corresponding level features after upsampling and downsampling are weighted and summed using a fast normalization fusion formula. Taking layer P3 as an example, its output features... It consists of three weighted parts: features upsampled from the previous level (P4), features from the input skip connections of this level (P3), and features downsampled from the next level (P2) (if any), with specific weighting coefficients. Automatic learning is achieved through backpropagation, with all initial values set to 1.0.
[0045] Step S3: Embed the SimAM parameterless attention mechanism for feature enhancement.
[0046] The parameterless attention module includes, but is not limited to, the SimAM (Simple Attention Module) module. Any attention mechanism module that does not introduce learnable parameters and calculates attention weights based on feature statistics can be applied to this invention. The SimAM module is described below as a preferred embodiment.
[0047] A parameter-free attention mechanism module, SimAM (Simple Attention Module), is embedded between the output of BiFPN and the detection head. SimAM is based on the principle of spatial inhibition in neuroscience and evaluates the importance of each neuron by calculating the linear separability between each neuron and other neurons in the same layer, without introducing any learnable weight parameters.
[0048] For the target neuron in the feature map and other neurons in the same channel Its energy function Defined as: ; This represents the total number of neurons within the channel. These are placeholders for the label parameters in the energy function. and For the label values, take the following in SimAM: and ; , , , are the linear transformation estimates of the target neuron and other neurons, respectively; and Let represent the weights and biases of the linear transformation. Minimizing this energy function is equivalent to making the linear transformation value of the target neuron approach 1 and the linear transformation values of other neurons approach -1, that is, maximizing the linear separability of the target neuron from its surrounding neurons. By mathematical transformation and using the Lagrange multiplier method to solve the optimal solution of this quadratic equation in two variables, the analytical solution of the energy function is obtained: ; In this invention, when the SimAM module calculates the energy function of each neuron, its mean value is... and variance All of these are within the channel dimension of a single feature map, covering all spatial pixel positions of the current channel (i.e. Statistical estimation is performed on each location. Each channel independently calculates its own... and It avoids cross-channel interaction and does not use other sample information from the batch, thus ensuring determinism during inference. As the regularization parameter, in this invention, we take... .
[0049] Energy value The lower the value, the better for the target neuron. The greater the difference between the neuron and the background neurons, the higher the importance of that neuron. It should be noted that this energy function originates from the principle of spatial inhibition in neuroscience. Its physical meaning is: the higher the linear separability of a neuron from its surrounding neurons, the more unique its encoded features, and the lower the energy required to inhibit that neuron. Therefore, a lower energy value indicates a more significant contribution of that neuron to target detection.
[0050] The SimAM module is based on the principle of spatial inhibition in neuroscience and assesses the importance of each neuron through an energy function. For example... Figure 3 As shown in the figure, the horizontal axis represents the spatial location of the neuron's receptive field, describing the spatial positional changes of the stimulus. The vertical axis represents the neuron's response intensity, representing the output activation level of the neuron after receiving external stimuli. The solid curve represents the neuron's response change when the target stimulus is input, and the dashed curve represents the neuron's response change when the ordinary background stimulus is input. As the spatial location of the stimulus moves, the neuron's output response changes accordingly. The red dots in the figure represent the spatial locations of significant neurons, where the neurons exhibit characteristic response states, demonstrating that the neuron has a differentiated response to target and background stimuli. SimAM uses the mean and variance of the feature tensor to calculate the energy value of each neuron. The lower the energy value, the greater the difference between the neuron and surrounding neurons, i.e., the higher the importance of the neuron. This generates a 3D attention weight matrix consistent with the input feature dimension.
[0051] SimAM reconstructs the feature map by normalizing the reciprocal of the energy value using the Sigmoid function. ; in, To be compared with the input feature map Having the same spatial dimensions The energy matrix, each element of which Corresponding position Neuron energy value at the location .symbol" " indicates taking the reciprocal of each element of the energy matrix, i.e. The matrix after taking the reciprocal is then normalized element-wise using the Sigmoid function, mapping the weight values to the (0,1) interval. This Sigmoid normalization operation does not include learnable parameters; it is performed only on the statistics of the current feature map. This indicates element-wise multiplication.
[0052] This mechanism achieves an organic unity of spatial and channel attention, eliminating the need for serial or parallel dimensionality separation calculations like CBAM. Since the weights are directly derived from the statistical properties of neurons without generating any new parameters, it effectively suppresses the interference of complex backgrounds (such as vegetation and building shadows) on target features without increasing the inference load.
[0053] Step S4: Use Focal EIoU loss to optimize boundary regression and label assignment.
[0054] During model training, the allocation of positive and negative samples adopts a static matching strategy based on the intersection-over-union (IoU). For each ground truth bounding box, its IoU value with all preset anchor boxes is calculated. Anchor boxes with an IoU greater than a set threshold are marked as positive samples; anchor boxes with an IoU less than 0.3 are marked as negative samples (background). Anchor boxes in between are ignored during training and do not participate in loss calculation. In this invention, the positive sample threshold is set to 0.5, and the negative sample threshold is set to 0.3. This matching strategy remains consistent across all training rounds.
[0055] Focal EIoU Loss was used as the bounding box regression loss function. The EIoU loss decomposes the aspect ratio loss into independent measures of width and height difference. ; in, and These are the width and height of the smallest bounding rectangle that covers the predicted bounding box and the ground truth bounding box, respectively. Represents Euclidean distance. The diagonal length of the minimum bounding rectangle that covers both the predicted and ground truth boxes. and These are the center coordinates of the predicted bounding box and the ground truth bounding box, respectively. and These are the widths of the predicted bounding box and the ground truth bounding box, respectively. and These are the heights of the predicted bounding box and the ground truth bounding box, respectively. This is the intersection-union ratio (IU) between the predicted bounding box and the ground truth bounding box.
[0056] In this invention, the EIoU loss consists of three components (crossover ratio loss). Center distance loss Width and height loss All are added with equal weights (coefficient of 1.0), without introducing additional hyperparameters for weighting.
[0057] Building upon this, the concept of Focal Loss is introduced, assigning higher weights to difficult samples with larger IoU errors. The complete expression of the Focal EIoU loss function is: ; in The modulation coefficient is taken in this invention. .when The smaller the value (i.e., the lower the overlap between the predicted bounding box and the ground truth bounding box), The larger the value, the higher the weight is assigned to the regression loss of that sample, thus focusing on difficult samples and forcing the optimizer to tilt the focus of loss reduction during backpropagation towards highly difficult samples that are difficult to match due to severe occlusion or extremely small pixels. Total Loss Function Among them, the regression loss weight Set to 5.0, the classification loss uses binary cross-entropy loss, and binary classification prediction is performed independently for each category.
[0058] Step S5: Output prediction based on the Anchor-based detection head.
[0059] The detection head employs a decoupled structure, with three independent detection head branches for each of the P3, P4, and P5 scales. Each detection head branch contains two parallel sub-networks: a classification sub-network and a regression sub-network. The classification sub-network consists of two 3×3 convolutional layers, with the number of output channels equal to the number of classes (10 classes in this invention), used to predict the class probability corresponding to each anchor box. The regression sub-network consists of two 3×3 convolutional layers, with four output channels, used to predict the center coordinate offset and width / height scaling factors of the bounding box. The confidence branch shares features with the regression sub-network and outputs an additional channel for predicting the target confidence.
[0060] The anchor-based detection head presets three different sizes of anchor boxes on feature maps at three scales: P3, P4, and P5. For a 640×640 input image, the anchor box size is obtained by clustering the sizes of all ground truth boxes in the VisDrone2019 training set using the K-means clustering algorithm, with the number of clusters set to 9, distributed across the three scales.
[0061] The distance metric used in clustering is This distance measures the difference in cross-union ratio between the ground truth bounding box and the cluster center box, and is more in line with the evaluation criteria for anchor box matching in object detection tasks than the Euclidean distance.
[0062] The maximum number of iterations for the K-means clustering algorithm is set to 100 rounds. Cluster centers are initially selected randomly. When the change in cluster centers is less than a threshold... The iteration is terminated early.
[0063] After clustering, the nine anchor boxes obtained are sorted by size from smallest to largest and assigned to layers P3 (minimum 3), P4 (middle 3), and P5 (maximum 3) to match the feature maps of different layers and design the network to detect targets of different scales.
[0064] Specifically: At the P3 level (80×80 grid), the anchor frame size is set to [(10,13),(16,30),(33,23)]; At level P4 (40×40 grid), the anchor frame size is set to [(30,61),(62,45),(59,119)]; At the P5 level (20×20 grid), the anchor frame size is set to [(116,90),(156,198),(373,326)].
[0065] The regression objective for each anchor frame is the center offset relative to the top-left corner of the grid and a scaling factor relative to the width and height of the anchor frame. The decoding method for the predicted coordinates is shown in the following formula: ; ; ; ; in For grid coordinates, To set the width and height of the preset anchor frame, For the Sigmoid function, , , , To detect the raw predicted values output by the head network, , These are the coordinates of the center point of the decoded bounding box. , This represents the width and height of the bounding box after decoding.
[0066] The three scale feature maps after feature enhancement in step S3 are input into the corresponding detection heads, and the output prediction tensors (including class probability, target confidence, and bounding box coordinate offset) are processed by non-maximum suppression (NMS) to obtain the final bounding box coordinates and class probability. The IoU threshold for NMS is set to 0.45, and the confidence threshold is set to 0.25.
[0067] In some embodiments, after receiving the feature maps at least three different scales, the bidirectional weighted feature pyramid network first evaluates the information content of each level of feature map, and selects differentiated feature transfer paths for feature maps at different levels based on the evaluation results.
[0068] Specifically, for the first Feature maps of hierarchical input ,in, , , The first The number of channels, height, and width of a hierarchical feature map define the information entropy of that hierarchical feature map. for: ; in For position The normalized contribution probability of the eigenvalue at a given location in the entire feature map. To prevent zero small constants.
[0069] According to information entropy The numerical value of is the first Different feature propagation paths are selected at different levels: when When the information entropy is higher than the first information entropy threshold, it is determined that the feature map of this level contains rich and effective information. The feature map of this level is then simultaneously input into the top-down path and bottom-up path of the bidirectional weighted feature pyramid network for bidirectional weighted fusion. when When the information entropy is below the second information entropy threshold, it is determined that the feature map of this level contains less effective information. The feature map of this level is then only input into the top-down path of the bidirectional weighted feature pyramid network for one-way transmission, skipping the fusion calculation of the bottom-up path. when When the information entropy value falls between the second and first information entropy thresholds, the hierarchical feature map is input into the top-down path of the bidirectional weighted feature pyramid network, and input with a preset probability. Randomly skip parts of the bottom-up path fusion calculation. The value range is [0.3, 0.7], and the specific value can be adjusted according to the trade-off between target detection accuracy and inference latency.
[0070] The first information entropy threshold is greater than the second information entropy threshold. For example, the first information entropy threshold can be set to 0.7, and the second information entropy threshold can be set to 0.3. These thresholds can be adaptively determined by performing statistical analysis on the information entropy distribution on the validation set. Specifically, the information entropy values of all hierarchical feature maps are calculated on the validation set, an information entropy distribution histogram is plotted, and the 75th percentile is taken as the first information entropy threshold, and the 25th percentile as the second information entropy threshold.
[0071] The inter-layer routing mechanism in this embodiment implements dynamic routing at the feature propagation path level between layers. Based on the information entropy of the feature maps at each layer, it determines which fusion paths a feature map participates in at the granularity of the entire feature map, rather than sparsifying or weighting at the granularity of a single neuron or weight. This embodiment extends neuron-level dynamism to feature map-level path routing. This embodiment achieves dynamism at the feature propagation path level, determining "which path to take" rather than "how many weights to assign."
[0072] In some embodiments, during model training, in addition to the inter-layer feature consistency loss... In addition, a cross-level gradient consistency constraint is introduced to align and regularize the gradient directions of the output features after fusion of each level.
[0073] Definition of the first The output features after hierarchical fusion are The gradient obtained by this feature during backpropagation is ,in Let be the overall loss function for the current batch. Define the ... Layer-wise gradient direction consistency loss for: ; in Represents the vector dot product. Denotes the Euclidean norm. Indicates from the first Spatial resolution upsampling of hierarchical feature maps to the th Mapping operation of spatial resolution of hierarchical feature maps (implemented using bilinear interpolation). To prevent zero constants. When the number of channels in adjacent layers... and In case of inconsistency, only the former shall be taken. The inner product of each channel is calculated, and any excess channels are discarded. The value range is [0,2]. The closer the value is to 0, the higher the consistency of the gradient direction between adjacent layers. The closer the value is to 2, the opposite the gradient direction. The smaller the value, the more consistent the gradient direction of the feature maps of adjacent layers.
[0074] The gradient direction consistency loss is added as a regularization term to the total loss function in step S4. The total loss function after regularization is obtained is: ; in These are the weighting coefficients for the feature consistency loss. These are the weighting coefficients for the gradient direction consistency loss; This represents the total number of levels in the bidirectional weighted feature pyramid network.
[0075] This embodiment uses gradient direction consistency constraints to ensure the consistency of gradient directions during backpropagation. This ensures that feature maps at different levels evolve in a common direction during parameter updates, avoiding gradient direction conflicts and training instability caused by independent optimization at each level. The consistency constraint is extended from forward features to backward gradients. This embodiment achieves backward gradient consistency by adding a gradient direction regularization term to the loss function.
[0076] In some embodiments, a progressive early termination inference mechanism based on the dynamic evolution of detection confidence is introduced during the continuous video stream processing in the model inference phase.
[0077] Specifically, define the first Frame image detection quality score for: ; in For the first The number of targets detected in the frame. For the first Confidence of each detection box, As the effective confidence threshold, in this invention, we take... This is consistent with the confidence threshold for nonmaximum suppression during the inference phase. For indicator functions; when Equal to 0, It is 0.
[0078] Define the moving average of the detection quality score for: ; in This is a smoothing coefficient used to suppress random fluctuations in the detection quality score of a single frame.
[0079] Define the long-term trend of the test quality score for: ; in The time window length is taken in this invention. That is, the long-term trend is calculated by taking the detection quality scores of the previous 5 frames. This reflects the trend of changes in testing quality within a recent time window.
[0080] The progressive early termination reasoning mechanism comprises three progressive levels: Level 1 (Mild Early Departure): When Higher than the first quality threshold and When the value is below the first trend threshold, the feature extraction calculation of the last stage in the lightweight backbone network is skipped for the next frame image, while the complete fusion calculation of the bidirectional weighted feature pyramid network is retained. Level Two (Moderate Early Departure): When Above the second quality threshold and When the value is below the second trend threshold, the feature extraction calculation of the last stage in the lightweight backbone network and the feature fusion calculation of the highest and second-highest levels in the bidirectional weighted feature pyramid network are skipped for the next frame image, while the feature fusion calculation of the lowest level is retained. Level 3 (Deep Early Departure): When Above the third quality threshold and When the value is below the third trend threshold, the feature extraction calculation of the last two stages in the lightweight backbone network and the feature fusion calculation of all levels in the bidirectional weighted feature pyramid network are skipped for the next frame image. The feature map of the corresponding level in the previous frame is directly reused for target detection.
[0081] The first quality threshold is greater than the second quality threshold, which in turn is greater than the third quality threshold; the first trend threshold is greater than the second trend threshold, which in turn is greater than the third trend threshold. For example, the first quality threshold can be set to 0.7, the second quality threshold to 0.5, and the third quality threshold to 0.3; the first trend threshold can be set to 0.15, the second trend threshold to 0.10, and the third trend threshold to 0.05. These thresholds can be adaptively determined by performing statistical analysis on the detection quality scores on the validation set.
[0082] When the detection quality score Below the fourth quality threshold or When the value exceeds the fourth trend threshold, the complete inference calculation process is resumed. For example, the fourth quality threshold can be set to 0.2, and the fourth trend threshold can be set to 0.20.
[0083] The core difference between the progressive early termination reasoning mechanism and existing early termination technologies lies in: 1. Multi-level rather than binary: Existing early termination technology usually adopts binary decision-making (early termination or no early termination), while this embodiment adopts a three-level progressive early termination, which can dynamically select different depths of computation skipping strategy according to the stability of the scene, and achieve a more refined balance between computing power and accuracy.
[0084] 2. Trend-aware rather than state-aware: Existing early termination techniques typically make decisions based solely on the state of the current frame (such as the confidence level of intermediate layers), while this embodiment introduces a moving average. and long-term trends It not only considers the current detection quality, but also its evolution trend within the time window, to avoid false triggering caused by single-frame noise.
[0085] 3. Gradual recovery rather than abrupt recovery: Existing early regression techniques typically directly restore the complete calculation when detection quality deteriorates, while this embodiment uses a four-level threshold ( Below the fourth quality threshold or (Recovery occurs when the threshold is above the fourth trend threshold) This achieves a gradual recovery from deep premature termination to moderate premature termination to mild premature termination to complete inference, avoiding performance fluctuations caused by frequent abrupt switching.
[0086] In some embodiments, after performing path selection, the dynamic routing mechanism re-inputs the output features processed by the selected path into the information entropy evaluation module, updates the information entropy value of that level, and dynamically adjusts the path selection strategy for the next time step based on the updated information entropy value, forming a feedback iteration mechanism of "evaluation-routing-re-evaluation-re-routing".
[0087] Specifically, for the first Hierarchy, set as number The information entropy at the next iteration is After selecting the feature transfer path based on the information entropy, the output features processed through the selected path are obtained. .Will Re-enter the information entropy evaluation module to calculate the updated information entropy. The calculation formula is: ; in It contributes the probability to the normalization of the updated eigenvalues.
[0088] When the change in information entropy When the change amount exceeds a preset threshold, it is determined that the information content of the feature map at that level has changed significantly after processing through the current path, triggering a path reselection operation. A new feature transmission path is then selected for that level based on the magnitude of the information entropy. For example, the change amount threshold can be set to... When the change in information entropy falls below this threshold, convergence is considered achieved, and the iteration terminates. A maximum number of iterations is also set. When the number of iterations exceeds The iteration is forcibly terminated at certain times to balance accuracy gain and inference latency.
[0089] The feedback iteration mechanism enables information entropy evaluation and path selection to form a feedback loop: path selection changes the information distribution of the feature map, and the change in information distribution in turn triggers path reselection, thereby dynamically tracking the optimal feature transfer path in the continuous iteration process.
[0090] In some embodiments, the cross-level gradient direction consistency loss and the inter-level feature consistency loss in step S4 together constitute a bidirectional coupling constraint.
[0091] The specific implementation of the bidirectional coupling constraint is as follows: during the forward propagation process, the inter-level feature consistency loss... The constraint ensures that the output features at each level maintain semantic consistency in spatial response distribution, and its calculation formula is as follows: ; Indicates from the first Spatial resolution upsampling of hierarchical feature maps to the th Mapping operation of spatial resolution of hierarchical feature maps (implemented using bilinear interpolation). Indicates from the first The spatial resolution of the hierarchical feature map is downsampled to the th The spatial resolution mapping operation of the hierarchical feature maps is implemented using a 3×3 convolution with a stride of 2.
[0092] During backpropagation, the cross-level gradient direction consistency loss To ensure that the gradient directions of the output features at each level remain consistent during backpropagation, the calculation formula is as follows: ; The two processes alternate and iterate during training, promoting each other: To ensure consistent semantic responses among feature maps at each level during forward propagation, providing a stable feature space for backpropagation; This ensures that the gradient directions of each level remain consistent during backpropagation, providing a stable direction for parameter updates during forward propagation.
[0093] The bidirectional coupling constraint is added to the total loss function described in step S4. The total loss function after bidirectional coupling extension is obtained: ; in The total number of levels in the bidirectional weighted feature pyramid network. The coupling loss weight coefficient has a range of values. This is used to adjust the contribution ratio of the coupling term to the total loss.
[0094] The bidirectional coupling constraint, through the collaborative optimization of "forward alignment + backward alignment", ensures that the feature maps of each level maintain semantic consistency during forward propagation and gradient direction consistency during backward propagation, thus avoiding semantic and gradient direction conflicts caused by independent optimization of each level.
[0095] In some embodiments, the first quality threshold, the second quality threshold, and the third quality threshold are adaptively adjusted based on the current flight altitude of the UAV and the image acquisition frame rate.
[0096] Specifically, let the current flight altitude of the drone be... The reference height is (The reference altitude is the average flight altitude when the training dataset was collected), define the altitude adjustment factor. for: ; Assume the current image acquisition frame rate is The baseline frame rate is (The baseline frame rate is the target inference frame rate set during model design), define the frame rate adjustment factor. for: ; First quality threshold Second quality threshold and the third quality threshold The adaptive adjustment formula is: ; in For the preset first Quality threshold benchmark value For the adaptively adjusted first Quality threshold, It is a highly sensitive coefficient. This is the frame rate sensitivity coefficient; both are greater than zero. For example, ∈[0.5,1.5], ∈[0.5,1.5], the specific value can be adjusted according to the range of flight altitude changes and frame rate fluctuations in the actual scenario. When the flight altitude change has a significant impact on the detection accuracy, it can be increased. When frame rate changes significantly impact inference speed, the speed can be increased. .
[0097] The adaptive threshold adjustment mechanism ensures that: when the flight altitude is higher than the reference altitude ( Each quality threshold is automatically increased, making it more difficult for the progressive early termination inference mechanism to trigger early termination, thus prioritizing detection accuracy; when the frame rate is lower than the baseline frame rate ( Each quality threshold is automatically reduced, and the progressive early termination inference mechanism is more likely to trigger early termination, prioritizing inference speed; when the flight altitude is high and the frame rate is low, the two effects are superimposed to achieve a dynamic balance between accuracy and speed.
[0098] In some embodiments, the progressive early termination inference mechanism further includes detection box spatial distribution density assessment, which enables spatially selective differential early termination inference based on the distribution density of the detection boxes in the image space.
[0099] Specifically, the current frame image is divided into A uniform grid, preferably That is, dividing the image into There are three uniform grid regions, each with a size of [missing value]. Pixel. and The value can be adjusted based on the target size distribution and computational resources. Count the number of detection boxes within each grid region. ,in , Definition of the first Spatial distribution density of each grid region for: ; in This represents the maximum number of detection boxes across all grid regions. To prevent zero small constants.
[0100] When the Spatial distribution density of each grid region When the density exceeds a certain threshold, the region is determined to be a dense target region. The corresponding feature layer at the feature layer level is used to retain the complete cross-scale weighted feature fusion calculation, without any early termination or skipping. When the spatial distribution density... When the density falls below the specified density threshold, the region is determined to be a sparse target region. The progressive early termination inference mechanism is then executed at the feature layer level corresponding to this region, selecting the appropriate early termination level for calculation and skipping based on the detection quality score and its changing trend. For example, the density threshold can be set to 0.3, and this value can be adjusted according to the statistical distribution of target density in the actual scene.
[0101] The spatially selective differential early termination inference mechanism enables: complete computation to be retained in dense target regions to ensure detection accuracy, and early termination to be performed in sparse target regions to save computational resources, thereby achieving differentiated computational resource allocation for different spatial regions within the same frame image.
[0102] The spatially selective differential early termination inference mechanism and the progressive early termination inference mechanism work together with the following priority: spatial distribution density assessment takes precedence over detection quality score assessment—when a region is determined to be a dense target region, early termination is not executed regardless of the detection quality score; only when a region is determined to be a sparse target region is the corresponding early termination level executed based on the detection quality score and the trend of change.
[0103] Example 1: This example provides a UAV target detection method based on a lightweight backbone and parameterless attention, specifically including the following steps: (1) Dataset Preparation: The VisDrone2019 drone aerial target detection dataset was used for experimental verification. This dataset contains 10 main target categories (pedestrians, vehicles, bicycles, etc.). During the shooting process, various models of drones were used, and the scenes involved various environments such as cities and rural areas. Weather and lighting conditions included sunny, cloudy, foggy, daytime, and nighttime conditions. Small targets with an area smaller than 32×32 pixels accounted for more than 60%. This dataset was constructed by the Tianjin University team and contains 10 target categories (pedestrians, vehicles, bicycles, etc.). The training set contains 6,471 images, and the validation set contains 548 images. During the shooting process, various models of drones were used, and the scenes involved various environments such as cities and rural areas. Weather and lighting conditions included sunny, cloudy, foggy, daytime, and nighttime conditions. The training phase combined advanced mixing enhancement strategies such as MixUp (mixing coefficients) to enhance the target. From Beta distribution (Medium sampling) to enrich the sample diversity under extreme flight perspectives and prevent the model from overfitting on extremely small target distributions.
[0104] (2) Image preprocessing and network parameter settings: The input image size was standardized to 640×640. Image preprocessing adopted the method described in step S0, that is, after the pixel values were normalized to [0,1], they were standardized using the ImageNet mean [0.485,0.456,0.406] and standard deviation [0.229,0.224,0.225]. The baseline model was YOLOv5n. The optimizer adopted stochastic gradient descent (SGD), with an initial learning rate of 0.01. The learning rate was adjusted using a cosine annealing strategy, and the minimum learning rate was set to 0.0001. The batch size was set to 32, and the training epochs were 300. The weight decay coefficient was set to 0.0005, and the momentum was set to 0.937.
[0105] (3) Backbone network replacement: The original CSPDarknet backbone network of YOLOv5n is replaced with ShuffleNetV2. Specifically, the YOLOv5 configuration file is modified to change the backbone part to call the ShuffleNetV2 module. The number of output channels in each stage of the ShuffleNetV2 network structure is configured as follows: Stage 0 is 24, Stage 1 is 116, Stage 2 is 232, Stage 3 is 464, and Stage 4 is 1024 (standard ShuffleNetV2 1.0× configuration). The number of ShuffleUnit stacks in each stage are [4, 8, 4, 4]. Three scale feature layers (P3, P4, P5) are set to output the feature maps of Stage 1 (downsampling factor of 8, number of channels 116), Stage 2 (downsampling factor of 16, number of channels 232), and Stage 3 (downsampling factor of 32, number of channels 464), respectively. The 1024-channel feature map output by Stage 4 does not directly participate in multi-scale feature fusion.
[0106] (4) Feature Fusion Network Reconstruction: The original PANet feature fusion network was replaced with BiFPN. Specifically, the P3, P4, and P5 features output from ShuffleNetV2 were input into BiFPN, and cross-scale weighted fusion was performed using a fast normalization fusion strategy. In BiFPN, redundant single-input nodes were removed, and skip connections were added between input and output nodes at the same level. The top-down path used bilinear interpolation upsampling with scaling factors of 2 and 4, respectively; the bottom-up path used 3×3 convolutions with a stride of 2 for downsampling. Learnable weights were set. The initial values are all 1.0, and are automatically adjusted during the training process.
[0107] (5) Attention Module Embedding: The SimAM module is sequentially connected between the output of the BiFPN and the detection head. The SimAM module is embedded after the feature fusion output of each detection branch (P3, P4, P5) and before the detection head convolution. The enhanced feature map output by the SimAM module is directly input to the detection head at the corresponding scale. When the number of channels in the feature map output by the BiFPN is inconsistent with the expected number of input channels of the detection head, a 1×1 convolution layer can be added between the SimAM module and the detection head to align the number of channels. The number of input channels of the 1×1 convolution is the number of output channels of the BiFPN, and the number of output channels is the expected number of input channels of the detection head. The SimAM module directly uses the mean and variance of the feature tensor to calculate the energy function, generating a 3D weight matrix that is completely consistent with the input feature dimension, and completes feature reconstruction by element-wise multiplication. The calculation of the mean and variance is performed on the same channel. It takes place in space.
[0108] (6) Loss function and label assignment configuration: The IoU threshold for positive samples is set to 0.5, the IoU threshold for negative samples is set to 0.3, and the IoU interval for ignored samples is (0.3, 0.5). Focal EIoU Loss is used as the bounding box regression loss function. Focal parameters are set: class balance parameter. Focal modulation coefficient To adjust the weights of hard samples. The classification loss uses binary cross-entropy loss. The total loss function is... Among them, the regression loss weight Set to 5.0. The three components of the EIoU loss (crossover ratio loss, center distance loss, and width-height loss) are all added together with equal weights (coefficient of 1.0).
[0109] (7) Model training and inference: Training was performed on an NVIDIA GeForce RTX 4060 GPU.
[0110] Training is divided into a freeze phase and a unfreeze phase: In the freeze phase (first 50 epochs), the backbone network parameters are frozen, and only the Neck and Head parts are trained, with a learning rate of 0.001. This value is chosen empirically to ensure that the Neck and Head parts converge sufficiently with the backbone parameters fixed, thus providing a relatively stable gradient direction in the subsequent unfreeze phase. In the unfreeze phase (epochs 50 to 300), all network parameters are unfrozen for end-to-end training, with the learning rate restored to 0.01 and decaying to 0.0001 using a cosine annealing strategy. The total number of training epochs in both phases is 300.
[0111] After training, the model was converted to ONNX format and deployed to an embedded drone platform (NVIDIA Jetson Nano) for inference testing. Non-maximum suppression (NMS) was used during inference, with an IoU threshold of 0.45 and a confidence threshold of 0.25.
[0112] Experimental Verification: To verify the effectiveness of this invention, the following experiments were designed: To verify the effectiveness of this invention, training and testing were conducted on the VisDrone2019 UAV aerial target detection dataset. As shown in Table 1, the experiment used a unified hardware and software platform configuration, with Python 3.9 as the programming language, Windows 11 as the operating system, PyTorch 2.0.1+cu118 as the deep learning framework, and an NVIDIA RTX 4060 graphics card. During training, the input image size was normalized to 640×640, the optimizer used stochastic gradient descent (SGD), the initial learning rate was set to 0.01, the learning rate was adjusted using a cosine annealing strategy, the minimum learning rate was set to 0.0001, the batch size was set to 32, the training epochs were 300, the weight decay coefficient was set to 0.0005, and the momentum was set to 0.937.
[0113] Table 1. Aero-YOLO and related experimental configurations ; To quantitatively verify the actual effects of each improved module, ablation experiments were designed to progressively accumulate module effectiveness verification. As shown in Table 2, the native YOLOv5n was used as the baseline model (experimental group 1), and ShuffleNetV2 backbone network (experimental group 2), BiFPN feature fusion (experimental group 3), SimAM parameterless attention mechanism (experimental group 4), and combined configurations of each module were gradually introduced (experimental groups 5 to 7). The quantitative results of each ablation experimental group are shown in Table 3. The evaluation metrics include precision, recall, mean precision, and number of parameters.
[0114] Table 2. Schedule of Aero-YOLO-related ablation experiments ; Table 3. Detailed Results of Important Parameters in Ablation Experiments ; Ablation experiments: Using native YOLOv5n as a baseline, ShuffleNetV2 backbone, BiFPN feature fusion, SimAM attention mechanism, and Focal EIoU loss were gradually introduced. Experimental results show that the proposed invention (Aero-YOLO) achieves an mAP@0.5 of 25.58% with only 1.25M parameters (approximately 34% lower than the baseline), outperforming the baseline model's 21.21%. Ablation experiments show that introducing BiFPN alone (Exp3) increases the mAP to 26.42% with 2.12M parameters; the complete solution (Exp7), with a further reduction in parameters to 1.25M (approximately 41% lower than Exp3), still achieves an mAP of 25.58%, significantly outperforming the baseline model. These results demonstrate that the complete solution achieves an effective balance between accuracy and model size under **extremely low parameter constraints**. It should be noted that SimAM further focuses on salient regions based on BiFPN, which may excessively suppress weak but still valuable background context features in some scenarios, resulting in a slight decrease in mAP of the complete solution compared to BiFPN alone. However, in the scenario of UAV embedded platform deployment with limited parameters, the complete solution achieves competitive detection accuracy with a smaller model size and has higher practical value.
[0115] To further define the performance level of this invention in UAV target detection tasks, a horizontal comparison was conducted between this invention and mainstream lightweight target detection algorithms. As shown in Table 4, the comparison models include YOLOv3-tiny and YOLOv4-tiny, and the evaluation metrics remain consistent with the ablation experiments.
[0116] Table 4. Comparison of Aero-YOLO and Mainstream Models ; Comparative experiment: Compared with the mainstream lightweight models YOLOv3-tiny (8.67M parameters, mAP 14.85%) and YOLOv4-tiny (6.06M parameters, mAP 18.20%), this invention achieves the highest detection accuracy with the smallest number of parameters (1.25M).
[0117] Visual Analysis: To intuitively evaluate the actual detection performance of this invention in complex aerial photography scenarios, a visual comparison test was conducted in a high-density crowd scene at night. The detection results of this invention (Aero-YOLO) were compared side-by-side with the baseline YOLOv5n model. In the high-density crowd scene at night, the baseline YOLOv5n could only recall a few individuals with complete outline features in the foreground of the image. This invention (Aero-YOLO), through the spatial discrimination capability of the SimAM attention mechanism, successfully identified distant targets with relatively indistinct features, and its localization of partially overlapping targets was more accurate.
[0118] The embodiments described above are for illustrative purposes only and are not intended to limit the invention. Therefore, any changes in numerical values or substitutions of equivalent elements should still fall within the scope of this invention.
[0119] The above detailed description will enable those skilled in the art to understand that the present invention can indeed achieve the aforementioned objectives and has complied with the provisions of the Patent Law.
[0120] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention. The above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the invention should be included within the scope of protection of the invention.
[0121] It should be noted that the above description of the process is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art can make various modifications and changes to the process under the guidance of this specification. However, these modifications and changes remain within the scope of this specification.
[0122] The basic concepts have been described above. Obviously, for those skilled in the art who have read this application, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore, such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of this application.
[0123] Furthermore, this application uses specific terms to describe its embodiments. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of this application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different positions in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application can be appropriately combined.
[0124] Furthermore, those skilled in the art will understand that aspects of this application can be described and illustrated through several patentable types or situations, including any new and useful combination of processes, machines, products, or substances, or any new and useful improvements thereof. Therefore, aspects of this application can be implemented entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. All of the above hardware or software can be referred to as a “unit,” “module,” or “system.” Furthermore, aspects of this application can take the form of a computer program product embodied in one or more computer-readable media, wherein computer-readable program code is contained therein.
[0125] The computer program code required for the operation of each part of this application can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, and Python; general programming languages such as C; Visual Basic, Fortran2103, Perl, COBOL2102, PHP, and ABAP; dynamic programming languages such as Python, Ruby, and Groovy; or other programming languages. This program code can run entirely on the user's computer, or as a standalone software package on the user's computer, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as Software as a Service (SaaS).
[0126] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this application are not intended to limit the order of the processes and methods of this application. Although some currently considered useful embodiments of the invention have been discussed in the foregoing disclosure by way of various examples, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the substance and scope of the embodiments of this application. For example, although the implementation of the various components described above can be embodied in a hardware device, it can also be implemented as a purely software solution, such as an installation on an existing server or mobile device.
[0127] Similarly, it should be noted that, in order to simplify the description of the present application and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of the embodiments of the present application sometimes combines multiple features into a single embodiment, drawing, or description thereof. However, this approach of the present application should not be construed as reflecting an intention that the claimed subject matter requires more features than expressly recited in each claim. Rather, the subject of the invention should possess fewer features than in any single embodiment described above.
Claims
1. A UAV target detection method based on a lightweight backbone and parameterless attention, characterized in that, include: The input drone aerial images are preprocessed to obtain preprocessed images; The preprocessed image is input into a lightweight backbone network built on ShuffleNetV2 units for multi-scale feature extraction, and at least three feature maps of different scales are output. The feature maps of at least three different scales are input into a bidirectional weighted feature pyramid network for cross-scale weighted feature fusion, and the fused multi-scale feature map is output. The fused multi-scale feature map is input into a parameterless attention module for feature enhancement, and the enhanced feature map is output. The enhanced feature map is input into the target detection head for target category prediction and bounding box regression, and the target detection result is output.
2. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 1, characterized in that, The lightweight backbone network is composed of multiple stages stacked sequentially, each stage containing alternating basic units with a step size of 1 and downsampling units with a step size of 2; The basic unit splits the input features into two branches. One branch retains the original features with an identity mapping, and the other branch extracts features by sequentially passing through ordinary convolution, depthwise separable convolution, and ordinary convolution. The output features of the two branches are concatenated in the channel dimension and then channel rearrangement is performed. Both branches of the downsampling unit use depthwise separable convolution with a stride of 2 for spatial dimensionality reduction. The number of channels is doubled after the output features of the two branches are concatenated in the channel dimension.
3. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 1, characterized in that, The bidirectional weighted feature pyramid network employs a fast normalization fusion strategy for cross-scale feature fusion, specifically including: In the top-down path, the high-level feature map is upsampled to match its spatial size with that of the low-level feature map; In the bottom-up path, the lower-level feature maps are downsampled to match their spatial dimensions with those of the higher-level feature maps; Learnable fusion weights are assigned to the input features at the same level, the high-level features after upsampling, and the low-level features after downsampling. The output features at that level are obtained by weighted summation based on each fusion weight.
4. The UAV target detection method based on lightweight backbone and parametric attention according to claim 3, characterized in that, After receiving the feature maps of at least three different scales, the bidirectional weighted feature pyramid network evaluates the information content of each level of feature map and selects differentiated feature transmission paths for different levels based on the evaluation results. The information content assessment includes calculating the information entropy of each level of feature map, which is determined based on the normalized contribution probability of the feature values at each position in the feature map of that level; The feature transmission path is selected for each level based on the value of the information entropy: when the information entropy is higher than the first information entropy threshold, the feature map of that level is simultaneously input into the top-down path and the bottom-up path of the bidirectional weighted feature pyramid network for bidirectional weighted fusion; when the information entropy is lower than the second information entropy threshold, the feature map of that level is only input into the top-down path for unidirectional transmission, skipping the fusion calculation of the bottom-up path; the first information entropy threshold is greater than the second information entropy threshold.
5. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 1, characterized in that, The target detection head is an anchor-box-based detection head. The anchor-box-based detection head presets multiple anchor boxes of different sizes at various spatial locations of the enhanced feature map. For each anchor box, it predicts the target class probability, target confidence, and bounding box coordinate offset. The prediction results are filtered by non-maximum suppression, and the final target detection result is output.
6. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 5, characterized in that, The size of the anchor frame is obtained by clustering the real target boxes in the UAV aerial target detection dataset. After clustering, the obtained anchor frames are sorted by size from smallest to largest and then assigned to feature maps of different scales.
7. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 5, characterized in that, In the continuous video stream processing during the model inference stage, a progressive early termination inference mechanism based on the dynamic evolution of detection confidence is introduced. The progressive early termination inference mechanism includes: determining the detection quality score of the current frame based on the confidence of all detection boxes output by the target detection head in the current frame, and determining the detection quality level of the current frame based on the sliding average of the detection quality score and its changing trend within the time window; The progressive early termination inference mechanism includes multiple early termination levels, each corresponding to a different calculation skipping strategy. When the moving average of the detection quality score is higher than a first quality threshold and the absolute value of the change trend is lower than a first trend threshold, the first level of early termination is executed, skipping the feature extraction calculation of the last stage in the lightweight backbone network. When the moving average of the detection quality score is higher than a second quality threshold and the absolute value of the change trend is lower than a second trend threshold, the second level of early termination is executed, skipping the feature extraction calculation of the last stage in the lightweight backbone network and the feature fusion calculation of the highest level in the bidirectional weighted feature pyramid network. When the moving average of the detection quality score is higher than a third quality threshold and the absolute value of the change trend is lower than a third trend threshold, the third level of early termination is executed, skipping the feature extraction calculation of the last two stages in the lightweight backbone network and the feature fusion calculation of all levels in the bidirectional weighted feature pyramid network, directly reusing the feature map of the corresponding level of the current frame for target detection. The first quality threshold is greater than the second quality threshold, which is greater than the third quality threshold; the first trend threshold is greater than the second trend threshold, which is greater than the third trend threshold.
8. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 5, characterized in that, During model training, a static matching strategy based on the cross-union ratio (CUI) is used to assign positive and negative samples: anchor boxes with an CUI greater than a first preset threshold are marked as positive samples, anchor boxes with an CUI less than a second preset threshold are marked as negative samples, and anchor boxes with an CUI between the second preset threshold and the first preset threshold are marked as ignored samples.
9. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 5, characterized in that, During model training, the Focal EIoU loss function is used as the loss function for bounding box regression. The Focal EIoU loss function decomposes the loss of bounding box regression into four components: intersection-union ratio loss, center distance loss, width loss, and height loss, and assigns higher loss weights to samples with large intersection-union ratio errors.
10. The UAV target detection method based on lightweight backbone and parameterless attention according to claim 9, characterized in that, The loss function also introduces cross-level gradient direction consistency loss as a regularization term. The cross-level gradient direction consistency loss is used to constrain the gradient direction of the output features after fusion of adjacent levels to remain consistent during the backpropagation process. The gradient direction consistency loss is calculated by comparing the differences between the gradient directions obtained by the output features of adjacent layers during backpropagation. The smaller the difference in gradient direction, the higher the gradient direction consistency between adjacent layers. The sum of the gradient direction consistency losses of all adjacent layers is multiplied by a preset gradient consistency loss weight coefficient and then added to the loss function.