Unmanned aerial vehicle overlooking small target detection method based on density perception and spatial hierarchy

By employing an end-to-end hierarchical detection framework combining adaptive image slicing and density-aware dual-branch detection heads, the problem of small target detection under the top-down view of UAVs is solved. This framework enables accurate detection of tiny targets in high-resolution images and high-precision target differentiation in densely occluded scenes, thereby improving the practicality and robustness of UAV monitoring.

CN121640326AActive Publication Date: 2026-03-10CHINESE PEOPLES LIBERATION ARMY AIR FORCE SERVICE ACAD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610164371.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-05
Publication Date
2026-03-10
Estimated Expiration
2046-02-05

AI Technical Summary

Technical Problem

The detection of dense small targets from the top-down view of UAVs suffers from problems such as the disappearance of small target features, false suppression due to dense occlusion, and lack of explicit modeling of target distribution density. Existing detection methods are unable to accurately detect small targets and distinguish closely adjacent targets in high-resolution images, and their recall and precision are insufficient in high-density occlusion scenarios.

Method used

An end-to-end hierarchical detection framework is constructed using an adaptive image slicing and feature preservation module, a density-aware dual-branch detection head, and a repulsion constraint loss function. The original pixel features are preserved through adaptive image slicing, and the density-aware dual-branch detection head and density-guided adaptive NMS are combined to achieve real-time perception of target distribution and dynamic threshold adjustment, thereby optimizing the detection strategy.

Benefits of technology

It effectively solves the problems of missed detection of small targets and false suppression due to dense occlusion in the top-down view of UAVs, greatly improves the recall rate and detection accuracy, enhances the robustness and practicality of the algorithm in complex scenarios, and meets the monitoring needs of intelligent transportation and public safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640326A_ABST
    Figure CN121640326A_ABST
Patent Text Reader

Abstract

The invention discloses an unmanned aerial vehicle overlook small target detection method based on density perception and spatial hierarchy, and belongs to the technical field of computer vision. The invention provides an end-to-end detection framework aiming at the problems that small target features are easy to lose, dense shielding causes error suppression, density perception lacks and the like in an aerial photography scene of an unmanned aerial vehicle, and the method comprises the following steps: firstly, preprocessing a high-resolution image through a self-adaptive image slicing and feature retention module; the real-time performance is kept, and meanwhile, the small target features are reserved; secondly, acquiring multi-scale features by using a feature extraction and fusion network; a density sensing double-branch detection head is adopted to output target detection information and a pixel-level density thermodynamic diagram in parallel; through a total loss function optimization model containing repulsive force loss, and in combination with density-guided adaptive NMS, post-processing is carried out, so that the problems of missing detection of dense small targets and bounding box adhesion are effectively solved, the anti-interference capability of a complex background is enhanced, and efficient balance between detection precision and real-time performance is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision and deep learning, and particularly relates to a UAV overhead small target detection method based on density perception and spatial hierarchical. BACKGROUND

[0002] With the rapid development of UAV technology and the substantial reduction in cost, air monitoring based on UAV has become an important technical means in the fields of smart city construction, public safety prevention and control, traffic flow management, emergency rescue response, and so on, and thus puts forward more stringent requirements on target detection algorithms: both accurately detecting tiny targets in high-resolution images and distinguishing multiple targets in close proximity in high-density occlusion scenes. However, in the dense small target detection scene under the overhead perspective of the UAV (such as the VisDrone and UAVDT data sets), the existing detection methods have the following technical bottlenecks.

[0003] Firstly, the feature of small targets disappears. The resolution of UAV images is usually 1920x1080 pixels or even higher, and in order to adapt to the GPU memory, the existing detectors usually scale the input to 640x640 pixels. This causes the pedestrian or vehicle originally occupying only 20x20 pixels to be compressed to less than 5x5 pixels, and the convolution layer cannot extract effective features.

[0004] Secondly, dense occlusion leads to false suppression. In scenes such as traffic intersections and squares, targets are highly dense and there is serious occlusion. The non-maximum suppression algorithm of the existing detector uses a fixed IoU threshold (such as 0.5), and this strategy is easy to misjudge two real targets in close proximity as repeated detection and delete one of them, resulting in a serious decrease in recall rate.

[0005] Thirdly, there is a lack of explicit modeling of target distribution density. The existing detector only outputs the bounding box, and cannot dynamically adjust the detection strategy according to the congestion degree of the region, which causes the algorithm to be unable to adopt differentiated processing strategies for dense and sparse regions, and it is difficult to meet the requirements of detection accuracy and robustness in actual applications.

[0006] Therefore, it is urgent to design a technical solution that can adapt to the characteristics of the UAV overhead scene, effectively solve the problems of small target feature extraction, dense occlusion distinction and density adaptive detection. SUMMARY

[0007] In order to solve the above technical problems, the present application provides a UAV overhead small target detection method based on density perception and spatial hierarchical, which constructs an end-to-end hierarchical detection framework through adaptive image slicing, density perception double-branch detection head, repulsive force constraint loss function and density-guided adaptive NMS, realizes the accurate and real-time detection of dense small targets in this scene, and meets the demand of UAV overhead monitoring in smart traffic, public safety and other fields.

[0008] The technical solution adopted by this invention to solve its technical problem is: a method for detecting small targets from above by a UAV based on density perception and spatial hierarchy, comprising the following steps: S1: The high-resolution input image acquired by the UAV is preprocessed by the adaptive image slicing and feature preservation module to obtain sub-images of uniform size and establish a global coordinate mapping relationship; S2: Input the preprocessed sub-image into the feature extraction system to obtain a multi-scale feature map. The feature extraction system includes a feature extraction backbone network, a spatial attention enhancement module, and a multi-scale feature fusion network. S3: Multi-scale feature map input density-aware dual-branch detection head, parallel output target detection information and pixel-level density heatmap, the target detection information including bounding box coordinates, class probability and target confidence; S4: During the training phase, the total loss function constrained by repulsion is used to optimize the detection model. During the inference phase, density-guided adaptive nonmaximum suppression is used to post-process the target detection information and output the final detection result.

[0009] Furthermore, the specific implementation process of the adaptive image slicing and feature preservation module in step S1 is as follows: Step-a1, Adaptive Slicing Parameter Calculation: Set the slice window size to... S x S The overlap rate of adjacent subgraphs is set to θ The width of the overlapping pixels is O = S x θ ; Calculate the number of horizontal slices based on the original image dimensions. N ω and the number of slices in the vertical direction N h The formula is: ; ; In the formula, W The horizontal pixel dimensions of the original image; H The vertical pixel dimensions of the original image; N ω , N h Round all up to the nearest whole number; total number of slices N = N ω ×N h ; Step-a2, Edge Reverse Alignment Strategy: During the sliding window cropping process, for the last sub-image of each row or column... P edge If the remaining pixels are insufficient S Then, a reverse alignment method is adopted, that is, tracing back from the boundary of the original image. SCrop each sub-image by one pixel to ensure all sub-images have a constant size. S x S ; Step-a3, for each subgraph Establish a coordinate transformation function, where i ∈[ 1,N ω ], j∈[ 1,N h ]; Set the coordinates of the local detection bounding box ( x local ,y local Map back to the original coordinate system x global ,y global ); The mapping formula is ; ; When dealing with subgraphs that are reverse-aligned at the edges, their offsets are directly set to... W - S or H - S .

[0010] Furthermore, the specific implementation process of the feature extraction system in step S2 is as follows: Step-b1: The feature extraction backbone network adopts the CSPDarknet network. S x S Feature extraction is performed on the sub-images of different sizes, and three feature layers C3, C4 and C5 with different scales are output, corresponding to resolutions of 80×80 pixels, 40×40 pixels and 20×20 pixels respectively; Step-b2, the implementation process of the spatial attention enhancement module is as follows: Max pooling and average pooling are performed on the feature layer in the channel dimension respectively. The pooling results are concatenated and then generated into a weight map through a 7×7 convolutional layer and a Sigmoid activation function. The weight map is multiplied with the original feature layer pixel by pixel to obtain the enhanced feature layer. Step-b3: The multi-scale feature fusion network adopts a structure combining a feature pyramid network and a path aggregation network. The feature pyramid network transmits deep semantic information from top to bottom, while the path aggregation network enhances shallow localization information from bottom to top, ultimately outputting three feature maps that fuse multi-scale information. F i This serves as the input for the subsequent dual-branch detection head.

[0011] Furthermore, the density-aware dual-branch detection head described in step S3 employs a parallel dual-branch decoupled architecture to receive multi-scale feature maps output from the multi-scale feature fusion network. F i The density-sensing dual-branch detection head specifically includes the following two task branches: The first is the object detection branch: the object detection branch adopts a decoupled head design, and extracts category features and localization features through two sets of parallel 3×3 convolutional layers respectively; The output tensor dimension of the classification sub-branch is... H '× W '× C ,in C The number of categories is used to predict the target category probability at each location. P cls The regression subbranch output tensor has a dimension of . H '×W'×5, used to predict bounding box offset ( x, y, w, h ) and target confidence level conf; The second is the density estimation branch: the density estimation branch shares shallow features with the target detection branch, and the deep features are decoupled through an independent three-layer convolutional module; The three-layer convolutional module includes two 3×3 convolutional layers and one 1×1 convolutional layer. Each convolutional layer is followed by a BN layer and a ReLU activation function, outputting a pixel-level single-channel density heatmap. D ∈ R H'×W'×1 ; True value of a single-channel density heatmap ; in δ For Dirac δ function, G σ The variance is σ A two-dimensional Gaussian filter; σ Adaptively adjusts based on the average size of the target bounding box; M For the target total number, p k Let be the center coordinates of the k-th target.

[0012] Furthermore, the total loss function of the repulsive force constraint mentioned in step S4 is: L total =L cls +L box +L density + λL Rep ; in, L cls For classifying losses, L box For bounding box regression loss, L density For density map loss, L RepLoss due to repulsive force λ The repulsive force loss weight hyperparameter; L cls For training to monitor sub-branches, a binary cross-entropy loss is used, calculated as follows: ; In the formula, y For real category labels, p The predicted class probability; L box To monitor the localization accuracy of the regression sub-branch, the CIoU loss function is used, which simultaneously considers the overlap area, center point distance, and aspect ratio. The formula is as follows: ; In the formula, IoU is the crossover-union ratio. The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. c The length of the diagonal of the minimum bounding rectangle. αυ This is a penalty term for aspect ratio; L density The training of the density estimation branch is supervised, and the predicted density map is calculated using the mean squared error. D With the truth density plot D GT The pixel-level difference between them is expressed by the formula: ; In the formula, To predict the density map at the pixel p The value at that location, For the true density map in pixels p The value at; L Rep This is used to introduce a rejection mechanism to prevent the predicted bounding box from shifting excessively towards adjacent interfering targets; the formula is: ; In the formula, For the first i One prediction box, For the first j There are 1 non-target truth boxes, and 1[・] is an indicator function that applies a penalty only when the predicted box overlaps with the non-target truth box.

[0013] Furthermore, the specific implementation process of density-guided adaptive nonmaximum suppression in step S4 is as follows: Step-c1: Extract regional crowding index: Read the density heatmap output by the density estimation branch. D For each candidate box output by the detection branch B i Extract the coordinates of its center point ( x c , y cTo enhance robustness, the average density within the candidate box coverage area is used as an indicator of crowding. d i The formula is: ; in, w i and h i These are the width and height of the candidate box, respectively; Step-c2, Constructing a density-threshold adaptive mapping function: Establishing a mapping function based on crowding index d i To the dynamic IoU threshold T i The mapping function; the adaptive formula is: ; In the formula, T base The set baseline suppression threshold, α For density-adjusted gain coefficient, d max The maximum density observation in the current image; the mapped value. T i Constraints on [ T min ,T max Within the specified range, this effectively curbs the accidental deletion of densely packed targets; Step-c3, Candidate Box Filtering: Sort all candidate boxes in descending order of confidence (conf), and select the box with the highest confidence. B max As a benchmark, calculate B max With remaining candidate boxes B j IoU, if IoU( B max ,B j )> T max_idx Then remove B j Otherwise, retain; repeat the above process until all candidate boxes have been processed to obtain the final detection result; where T max_idx For the reason B max The dynamic threshold obtained from the calculation of regional density.

[0014] Furthermore, the basic suppression threshold T base =0.45, dynamic threshold range [ T min ,Tmax = [0.45, 0.75].

[0015] The beneficial effects of this invention are: This invention uses an adaptive slicing technique based on overlap rate to completely preserve the original pixel features during the inference stage, effectively solving the problem of missed detection of small targets at a distance, significantly improving the recall performance on datasets such as VisDrone, and effectively improving the problem of the disappearance of small target features in high-resolution images.

[0016] This invention achieves real-time perception and dynamic threshold adjustment of regional congestion by combining a density-sensing dual-branch detection head with a density-guided adaptive NMS. In densely occluded scenarios such as traffic intersections and squares, it effectively avoids the false deletion of real targets caused by traditional fixed IoU thresholds, and significantly improves the detection accuracy in dense scenarios.

[0017] This invention introduces a repulsive force constraint loss function, which applies targeted penalties to force the predicted bounding box to shrink toward the real target and move away from adjacent interfering targets, making the output bounding box more compact and effectively reducing the common problems of predicted bounding box "sticking" and positioning deviation in dense scenes.

[0018] This invention, by embedding a spatial attention mechanism in the feature extraction stage, can automatically suppress complex background noise such as trees and shadows, focus on foreground target features, effectively reduce the false detection rate under the premise of real-time performance, and enhance the robustness and practicality of the algorithm in real-world complex application scenarios. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention.

[0020] Figure 2 This is a schematic diagram of the adaptive image slicing logic in this invention.

[0021] Figure 3 This is a schematic diagram of the density-sensing dual-branch detection head structure in this invention.

[0022] Figure 4 This is a comparison diagram of the density-guided adaptive NMS logic in this invention.

[0023] Figure 5 This is a performance comparison chart of the algorithms in this invention. Detailed Implementation

[0024] The present invention will be further described in detail below with reference to the accompanying drawings.

[0025] This invention discloses a method for detecting small targets from above by UAVs based on density perception and spatial hierarchy. In one specific embodiment, the feature extraction network can be implemented using an existing convolutional neural network structure, but is not limited to a specific network form.

[0026] Reference Figures 1 to 5 A method for detecting small targets from above by a UAV based on density perception and spatial hierarchy includes the following steps: S1. The high-resolution input image acquired by the UAV is preprocessed through the adaptive image slicing and feature preservation module to obtain sub-images of uniform size and establish a global coordinate mapping relationship.

[0027] High-resolution input images acquired by drones typically have a resolution of no less than 1920×1080 pixels, denoted as I ∈ R H ×W×3 Direct scaling can lead to the loss of features for small targets smaller than 20×20 pixels. Therefore, preprocessing is performed using adaptive image slicing and a feature preservation module. The specific method is as follows: Step-a1, Adaptive Slicing Parameter Calculation: Set the slice window size to... S x S In this embodiment S =640 pixels; adjacent subimage overlap rate set to 640 pixels; θ , θ Within the range of 10%-30%, this embodiment preferably has a lower concentration. θ =25%; therefore, the overlapping pixel width is calculated to be... O = S x θ = Figure 2 160 pixels; reference O = S x θ This is a schematic diagram of the adaptive image slicing logic. In the diagram, the original image refers to the raw high-resolution image captured by the drone. I ∈ R H×W×3 Sub-images refer to uniformly sized S×S pixel blocks of the image to be detected, obtained by cropping using adaptive slicing parameters and an edge-reverse alignment strategy. Overlapping bands refer to the overlapping areas between adjacent sub-images, designed to prevent the target from being truncated at the edges; their width is [missing information]. N = N .

[0028] Calculate the number of horizontal slices based on the original image dimensions. N ω and the number of slices in the vertical direction N h ; ; ; In the formula, W The horizontal pixel dimensions of the original image; H The vertical pixel dimensions of the original image; Nω , N h Round all up to the nearest whole number; total number of slices S x S, ω ×N h .

[0029] Step-a2, Edge Reverse Alignment Strategy: During the sliding window cropping process, for the last sub-image P in each row or column... edge If its remaining pixels are insufficient S Then, a reverse alignment method is adopted, that is, tracing back from the boundary of the original image. S Crop each sub-image by one pixel to ensure all sub-images have a constant size. W - S Effectively avoids the loss of texture information of edge targets.

[0030] Step-a3, for each subgraph Establish a coordinate transformation function, where i ∈[ 1,N ω ], j ∈[ 1,N h ]; Set the coordinates of the local detection bounding box ( x local ,y local Map back to the original coordinate system x global ,y global ); The mapping formula is ; ; When dealing with subgraphs that are reverse-aligned at the edges, their offsets are directly set to... H - S or S x S This ensures the accuracy of coordinates in subsequent global detection results.

[0031] S2. Input the preprocessed sub-image of uniform size into the feature extraction system consisting of a feature extraction backbone network, a spatial attention enhancement module, and a multi-scale feature fusion network to obtain a multi-scale feature map adapted for small object detection; the specific steps are as follows: Step-b1: The feature extraction backbone network adopts the CSPDarknet network. x, y, w, h Feature extraction is performed on sub-images of different sizes, and three feature layers C3, C4 and C5 with different scales are output, corresponding to resolutions of 80×80 pixels, 40×40 pixels and 20×20 pixels respectively, to adapt to the feature requirements of targets of different sizes.

[0032] Step-b2: The spatial attention enhancement module is used to suppress complex background noise such as trees and shadows. Max pooling and average pooling are performed on each feature layer in the channel dimension. The two pooling results are concatenated and then passed through a 7×7 convolutional layer and a Sigmoid activation function to generate a pixel-level weight map. The weight map is multiplied pixel by pixel with the original feature layer to obtain the enhanced feature layer, thereby enhancing the foreground target features and suppressing background noise, and improving the recognition of small target features.

[0033] Step-b3: The multi-scale feature fusion network (Neck) adopts a structure combining FPN (Feature Pyramid Network) and PAN (Path Aggregation Network). FPN passes the semantic information of the deep C5 feature from top to bottom to the C4 and C3 feature layers, compensating for the lack of semantic information in shallow features. PAN enhances the localization information of the shallow C3 feature from bottom to top to the C4 and C5 feature layers, solving the problem of insufficient localization accuracy of deep features. Finally, it outputs three feature maps that fuse multi-scale information. F i ( i =1,2,3), which serve as the input for the subsequent dual-branch detection head.

[0034] S3, Multi-scale Feature Map F i The input density-aware dual-branch detection head adopts a parallel dual-branch decoupled architecture, which simultaneously performs target detection and density estimation, realizing the collaboration between detection and perception. The density-aware dual-branch detection head specifically includes the following two task branches: The first is the object detection branch: The object detection branch adopts a decoupled head design, which extracts category features and localization features through two sets of parallel 3×3 convolutional layers to avoid feature interference; The output tensor dimension of the classification sub-branch is... H '× W '× C ,in C The number of categories, such as pedestrians and vehicles in intelligent transportation scenarios, is used to predict the probability of the target category at each location. P cls The regression subbranch output tensor has a dimension of . H '× W ×5, used to predict bounding box offset ( δ ) and target confidence level conf 。

[0035] The second is the density estimation branch: the density estimation branch shares shallow features with the object detection branch to reduce computational cost, while the deep layers are decoupled through independent three-layer convolutional modules; This three-layer convolutional module includes two 3×3 convolutional layers and one 1×1 convolutional layer. Each convolutional layer is followed by a Batch Normalization (BN) layer and a ReLU activation function, outputting a pixel-level single-channel density heatmap. D ∈ R H'×W'×1 ; True value of a single-channel density heatmap Through the formula: calculate; in δ For Dirac σ function, G σ The variance is σ A two-dimensional Gaussian filter; + λL The value is adaptively adjusted based on the average size of the target bounding box, typically set to 0.3 times the target's width and height. M For the target total number, p k Let be the center coordinates of the k-th target. This formula transforms discrete target labels into a continuous probability density distribution, enabling the network to accurately learn the spatial crowding information between targets.

[0036] S4. During the training phase, the total loss function constrained by repulsion force is used to optimize the detection model. During the inference phase, density-guided adaptive nonmaximum suppression is used to post-process the target detection information and output the final detection result.

[0037] The total loss function using repulsive force constraints during the training phase is: L total =L cls +L box +L density λ Rep ; in, L cls For classifying losses, L box For bounding box regression loss, L density For density map loss, L Rep Loss due to repulsive force αυ This is a hyperparameter for the repulsive force loss weight, with a value range of 0.1 to 0.5, used to balance the repulsive force loss weight. L cls The training used for monitoring sub-branches employs binary cross-entropy (BCE) loss, as shown in the formula: ; In the formula, y The labels are for the real categories (1 for target, 0 for background).p This represents the predicted class probability. L box To monitor the localization accuracy of the regression sub-branch, the CIoU loss function is used, which simultaneously considers the overlap area, center point distance, and aspect ratio. The formula is as follows: ; In the formula, IoU is the crossover-union ratio. The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. c The length of the diagonal of the minimum bounding rectangle. ​ This is a penalty term for aspect ratio; L density The training of the density estimation branch is supervised, and the predicted density map is calculated using mean squared error (MSE). D With the truth density plot D GT The pixel-level difference between them is expressed by the formula: ; In the formula, To predict the density map at the pixel p The value at that location, For the true density map in pixels p The value at; L Rep This is used to introduce a rejection mechanism to prevent the predicted bounding box from shifting excessively towards adjacent interfering targets; the formula is: ; In the formula, For the first i One prediction box, For the first j The loss term provides a list of other target bounding boxes adjacent to the current predicted target's spatial location, with 1[・] serving as an indicator function that applies a penalty only if the predicted box overlaps with a non-target ground truth box. This loss term effectively solves the common problems of predicted box adhesion and false suppression in traditional algorithms under dense overhead views by forcing the predicted box away from adjacent non-matching interfering targets and forcing it to shrink and fit tightly against the center of the real target.

[0038] During the inference phase, density-guided adaptive nonmaximum suppression (NMS) is used to post-process the target detection information, avoiding the false suppression problem of traditional fixed-threshold NMS in dense scenes, as detailed below: Step-c1: Extract regional crowding index: Read the density heatmap output by the density estimation branch. D For each candidate box output by the detection branch B i Extract the coordinates of its center point ( x c ,y cTo enhance robustness, the average density within the candidate box coverage area is used as an indicator of crowding. d i The formula is: ; in, w i and h i These are the width and height of the candidate box, respectively; Step-c2, Constructing a density-threshold adaptive mapping function: Establishing a mapping function based on crowding index d i To the dynamic IoU threshold T i The mapping function; the adaptive formula is: ; In the formula, T base =0.45 is the set basic suppression threshold; α This is the density-adjustable gain coefficient, with a value ranging from 0.1 to 0.5. d max The maximum density observation in the current image; the mapped value. T i Constraints on [ T min ,T max Within the interval [0.45, 0.75], this design maintains strong suppression in sparse regions and weak suppression in dense regions, effectively curbing the false deletion of dense targets.

[0039] Step-c3, Candidate Box Filtering: First, map the coordinates of all candidate boxes output from the slice detection back to the original image's global coordinate system while retaining local density values. Then, sort all candidate boxes by confidence level (conf) from high to low and extract the box with the highest confidence level. B max As a benchmark, calculate B max With remaining candidate boxes B j IoU, if IoU( B max ,B j )> T max_idx Then remove B j Otherwise, retain; repeat the above process until all candidate boxes have been processed to obtain the final detection result; where T max_idx For the reason B max The dynamic threshold obtained from the calculation of regional density.

[0040] To verify the effectiveness and reliability of the method of this invention, experiments were conducted on the VisDrone dataset. The experimental environment was an Ubuntu operating system, with an NVIDIA GeForce RTX 3090 (24G) GPU, and the model was built based on the PyTorch framework. The training parameters were set to batch-size=16, iteration epochs=150, and initial learning rate=0.01 to ensure that the model fully converged. This invention adopts a common evaluation metric in the field of object detection: mAP50 is the average precision when the intersection-over-union (IoU) threshold is set to 0.5, and mAP50-95 refers to the average precision at 10 thresholds with IoU thresholds from 0.5 to 0.95 and a step size of 0.05. Precision reflects the accuracy of the detection results, recall reflects the completeness of the detection results, and bounding box regression loss reflects the degree of localization deviation between the predicted box and the ground truth box. The verification results show that the algorithm of this invention achieves 0.401 mAP@0.5, which is 40.7% higher than the benchmark algorithm's 0.285. The recall rate is improved from 0.368 to 0.385, and the inference speed is maintained at 52.1 FPS, meeting the requirements for real-time detection.

[0041] The results of the ablation experiment are shown in the table below:

[0042] Ablation experiments further validated the effectiveness of each module: A comparison between group 1 and group 2 shows a significant improvement in mAP@0.5, demonstrating that preserving original pixel features instead of direct scaling effectively addresses the pain point of "missed detection of small targets at long distances" under the UAV's top-down view. Comparing group 3 and group 4, a repulsive force loss was introduced. L Rep Subsequently, the mAP metric jumped again. Experiments showed that this module forces the predicted bounding box away from non-target ground truth boxes, effectively reducing the "boundary box sticking" phenomenon in congested traffic or densely populated scenes, resulting in tighter localization. In group 5, by adjusting the suppression threshold in real-time using the density map D, the mAP reached a peak of 0.401, verifying that the proposed "density-aware" mechanism enables the algorithm to adaptively increase the IoU threshold in dense areas, thereby preserving overlapping targets mistakenly deleted by traditional algorithms and achieving optimal coverage for detecting dense small targets.

[0043] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A method for detecting small targets from an aerial view based on density perception and spatial hierarchy, characterized in that: The method comprises the following steps: S1: preprocessing the high-resolution input image collected by the unmanned aerial vehicle through an adaptive image slicing and feature reservation module to obtain a sub-image with uniform size and establish a global coordinate mapping relationship; S2: inputting the preprocessed sub-image into a feature extraction system to obtain a multi-scale feature map, the feature extraction system comprising a feature extraction backbone network, a spatial attention enhancement module, and a multi-scale feature fusion network; S3: inputting the multi-scale feature map into a density-aware dual-branch detection head to output target detection information and a pixel-level density heat map in parallel, the target detection information comprising bounding box coordinates, class probability, and target confidence; S4: in the training phase, a repulsive force constraint total loss function is used to optimize the detection model, and in the inference phase, the target detection information is post-processed through density-guided adaptive non-maximum suppression to output the final detection result. 2.The method of claim 1, wherein: The specific implementation process of the adaptive image slicing and feature reservation module in step S1 is as follows: Step-a1, adaptive slice parameter calculation: set the slice window size as SxS , the adjacent subgraph overlap rate as θ , and the overlapping pixel width as O=Sxθ ; Number of horizontal slices calculated from the original image size N ω Number of vertical slices N h ; the formula is: ; ; In the formula, W is the horizontal pixel size of the original image; H is the vertical pixel size of the original image; N ω , N h are all rounded up, the total number of slices N=N ω ×N h ; Step-a2, edge reverse alignment strategy: in the sliding window clipping process, for the last piece of sub-graph of each row or each column P edge If the remaining pixels are insufficient S , a reverse alignment method is adopted, that is, the original image boundary is traced back S pixels for clipping to ensure that the size of all sub-graphs is constant SxS ; Step-a3, for each subgraph A coordinate transformation function is established, wherein i ∈[ 1,N ω ], j ∈[ 1,N h ] ; map the local detection bounding box coordinates ( x local ,y local ) back to the original image coordinate system ( x global ,y global ); ; ; When a subgraph involving edge reverse alignment is involved, its offset is set directly to W-S or H-S . 3.The method of claim 2, wherein: The specific implementation process of the feature extraction system in step S2 is as follows: Step-b1, the feature extraction backbone network adopts a CSPDarknet network, which extracts features from subgraphs of different sizes and outputs three feature layers C3, C4 and C5 of different scales, corresponding to resolutions of 80x80 pixels, 40x40 pixels and 20x20 pixels, respectively; SxS Step-b1, the feature extraction backbone network adopts a CSPDarknet network, which extracts features from subgraphs of different sizes and outputs three feature layers C3, C4 and C5 of different scales, corresponding to resolutions of 80x80 pixels, 40x40 pixels and 20x20 pixels, respectively; Step-b2: the implementation process of the spatial attention enhancement module is as follows: maximum pooling and average pooling are respectively performed on the feature layer in the channel dimension, the pooled results are spliced, a 7x7 convolution layer and a Sigmoid activation function are used to generate a weight map, and the weight map and the original feature layer are multiplied pixel by pixel to obtain an enhanced feature layer; Step-b3, the multi-scale feature fusion network adopts the structure combined with the feature pyramid network and the path aggregation network, the feature pyramid network transmits the deep semantic information from top to bottom, the path aggregation network enhances the shallow positioning information from bottom to top, and finally outputs three feature maps fused with multi-scale information F i , as the input of the subsequent double-branch detection head.

4. The method of claim 3, wherein the method further comprises: The density-aware dual-branch detection head in step S3 adopts a parallel dual-branch decoupling architecture to receive the multi-scale feature maps output from the multi-scale feature fusion network F i The density-aware dual-branch detection head specifically includes the following two task branches: One is the target detection branch: the target detection branch adopts a decoupling head design, and two groups of parallel 3x3 convolution layers are used to extract class features and positioning features respectively; wherein the classification sub-branch outputs a tensor with dimensions H 'x W' 'x C wherein C is the number of classes, and is used to predict the target class probability at each location P cls ; the regression sub-branch outputs a tensor with dimensions H 'x W 'x5, which is used to predict the bounding box offset ( x, y, w, h ) and the target confidence conf; The second is the density estimation branch: the density estimation branch shares shallow features with the target detection branch, and deep features are decoupled through an independent three-layer convolution module; The three-layer convolution module comprises two 3*3 convolution layers and one 1*1 convolution layer, and a BN layer and a ReLU activation function are sequentially connected after each convolution, and a single-channel density heat map at a pixel level is output D ∈ R H'×W'×1 ; The true value of the single-channel density heat map ; wherein δ is the Dirac δ function, G σ is a two-dimensional Gaussian filter with variance σ ; σ The average size is adaptively adjusted according to the target frame average; M is the total number of targets, p k is the center coordinate of the kth target.

5. The method of claim 4, wherein: The repulsion force in step S4 constrains the total loss function as: L total =L cls +L box +L density +λL Rep ; wherein, L cls is a classification loss, L box is a bounding box regression loss, L density is a density map loss, L Rep is a repulsion loss, λ is a repulsion loss weight hyperparameter; L cls For training of monitoring sub-branch, binary cross-entropy loss is adopted, and the calculation formula is: ; wherein y is the true class label, p is the predicted class probability; L box The positioning accuracy of the supervised regression sub-branch adopts a CIoU loss function to simultaneously consider the overlapping area, center point distance, and aspect ratio, and the formula is: ; where IoU is the intersection over union, is the Euclidean distance between the center of the predicted box and the ground truth box, c is the diagonal length of the minimum bounding box, αυ is the aspect ratio penalty term; L density For the training of the supervised density estimation branch, the mean square error is used to calculate the predicted density map D and the ground truth density map D GT The pixel-level difference between them is calculated as follows: ; wherein is the value of the predicted density map at pixel p is the value of the true density map at pixel is the value of the predicted density map at pixel p is the value of the true density map at pixel L Rep To introduce a repulsion mechanism to prevent the prediction box from shifting too much towards the neighboring interfering target; the formula is: ; wherein is the i th predicted box, is the j th non-target ground truth box, and 1[·] is an indicator function that imposes a penalty only when the predicted box overlaps with the non-target ground truth box.

6. The method of claim 5, wherein: The specific implementation process of the density-guided adaptive non-maximum suppression in step S4 is as follows: Step-c1: Extract regional crowding index: Read the density heatmap output by the density estimation branch. D For each candidate box output by the detection branch B i Extract the coordinates of its center point ( x c , y c To enhance robustness, the average density within the candidate box coverage area is used as an indicator of crowding. d i The formula is: ; wherein, w i and h i are the width and height of the bounding box, respectively. Step-c2, constructing density-threshold adaptive mapping function: establishing a mapping function from the congestion index d i to dynamic IoU threshold T i The adaptive formula is: ; In the formula, T base is a set base inhibition threshold, α is a density adjustment gain coefficient, d max is a maximum density observation in the current image; the mapped T i is constrained in the interval T min ,T max interval to effectively curb the false deletion of dense targets; Step-c3, candidate box screening: sort all candidate boxes by confidence conf from high to low, take out the highest confidence box B max As a benchmark, calculate B max The IoU of the remaining candidate boxes B j , if IoU( B max ,B j ) T max_idx , then eliminate B j , otherwise keep; repeat the above process until all candidate boxes are processed, and the final detection result is obtained; wherein T max_idx is a dynamic threshold obtained by B max region density calculation.

7. The method of claim 6, wherein: The base suppression threshold T base = 0.45, dynamic threshold interval T min ,T max = [0.45, 0.75].

Citation Information

Patent Citations

  • Traffic scene small target detection method based on adaptive spatial aggregation pyramid

    CN120599223A

  • Three-dimensional target detection method for improving multi-modal fusion

    CN120877050A

  • Dense small target detection method for unmanned aerial vehicle aerial photography scene

    CN121438142A

  • Population quantity determination method and apparatus, device, storage medium, and program product

    WO2022179474A1