Small target detection method for unmanned aerial vehicle data
By constructing a feature content analysis module and a PLDP-SPP module, and dynamically adjusting the pooling operation scale, the problem of insufficient accuracy of the YOLOv5s model in small target detection by UAVs is solved, achieving higher detection accuracy and real-time performance, and making it suitable for complex scenarios.
Patent Information
- Application Number
- CN202511488279.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-10-17
AI Technical Summary
The existing YOLOv5s model suffers from insufficient accuracy, high false detection rate, and high missed detection rate of occluded targets in small target detection by UAVs, and cannot meet the detection needs in complex scenarios.
A feature content analysis module is constructed to calculate a comprehensive score V through regional saliency score and texture complexity score, dynamically adjust the pooling operation scale, and optimize the target detection model in combination with the PLDP-SPP module, including feature content analysis, size decision mechanism and parallel pooling operation, to adapt to feature extraction in regions with different information density.
It improves the accuracy and stability of small target detection, reduces the false detection rate, meets the real-time and lightweight requirements of small target detection in UAV data, and is suitable for a variety of complex scenarios.
Smart Images

Figure CN120953859A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, specifically to a method for small target detection in drone data. Background Technology
[0002] Unmanned aerial vehicle (UAV) remote sensing technology has been widely applied in various fields due to its advantages such as high flexibility, wide coverage, and low data acquisition cost. However, the task of small target detection based on image data acquired by UAVs faces many challenges: On the one hand, when UAVs fly at high altitudes, the target occupies a very small proportion in the image, and the pixel size in UAV-acquired images is usually less than 32×32, which falls into the category of "small targets" in the COCO standard; the difficulty in small target identification is that it leads to a scarcity of target feature information, making it easy to be confused with background noise. On the other hand, UAVs face problems such as attitude jitter, changes in lighting, and complex background interference (such as tree occlusion and building shadows) during flight, which further reduce the accuracy and stability of small target detection.
[0003] Early traditional small target detection methods relied heavily on manual feature extraction, such as SIFT and HOG. However, these methods are poorly adaptable to complex scenes, struggle to capture the key features of small targets, and are slow, failing to meet the real-time data processing needs of UAVs. With the development of deep learning technology, convolutional neural network-based target detection algorithms have gradually become mainstream, especially after the introduction of the YOLOv5 model, which has become a commonly used target detection model. Because YOLOv5 adopts a single-stage target detection framework, it does not require generating region proposals first, and then classifying and locating these regions, as in two-stage detectors (such as Faster R-CNN). This process greatly simplifies the model structure and speeds up processing. YOLOv5 can effectively detect targets of different scales by fusing feature maps across multiple layers of the network; this multi-scale feature fusion capability is particularly important for small targets, as it can capture subtle differences in the image, thus more accurately identifying small targets.
[0004] However, in practice, it was found that YOLOv5s's SPP module uses fixed-scale pooling of "1×1 / 5×5 / 9×9 / 13×13", but still uses large-scale pooling of 9×9 / 13×13 for "high information density regions" where small targets are located. This leads to "over-aggregation" of small target features, resulting in the loss of key contour and texture information. Ultimately, this manifests as a small target accuracy of only 21.5% and a persistently high false negative rate. Furthermore, YOLOv5s' fixed-scale pooling cannot dynamically distinguish "target features". Compared to "background interference features," in complex drone scenarios, such as animals in forests or traffic signs in city streets, the YOLOv5s-SPP model is prone to misidentifying leaf textures as "small animals" and billboard text as "traffic signs," with a false detection rate typically exceeding 25%. Furthermore, in common drone image scenarios where large targets occlude small targets or the background occludes small targets—such as tree branches obscuring insulators on power lines or weeds obscuring trapped individuals—the YOLOv5s-SPP model fails to capture the local details of the occluded areas, resulting in "missing bounding boxes" of the occluded targets (e.g., only selecting the unoccluded portion of an insulator), leading to a recognition completeness of less than 60%.
[0005] These issues mean that YOLOv5s' detection accuracy cannot meet the needs of all small target detection scenarios in UAV data. Summary of the Invention
[0006] To address the issue that existing target detection models based on YOLOv5s cannot meet the accuracy requirements of small target detection scenarios using UAV data, this invention provides a method for small target detection using UAV data. This method can effectively improve detection accuracy while achieving a better balance between lightweight design, high precision, and real-time performance, making it applicable to a wider range of small target detection scenarios.
[0007] The technical solution of this invention is as follows: a method for small target detection in UAV data, characterized by comprising the following steps: S1: Construct a feature content analysis module; The feature content analysis module analyzes each pixel in the input feature map and extracts the region saliency score S and texture complexity score T corresponding to each pixel. Then, after normalizing the region saliency score S and texture complexity score T to the [0,1] interval, the comprehensive score V corresponding to each pixel is calculated. V = α*S + β*T; Where α and β are hyperparameters; The regional saliency score S comprehensively reflects the possibility that the target region where the pixel is located is a semantic key region, and is calculated by weighted fusion of local gradient magnitude and local contrast. The texture complexity score T reflects the richness of details of the features in the area where the pixel is located, and is calculated by fusing local entropy and LBP feature diversity; S2: Set different pooling operation mapping rules for different comprehensive scores V; If V ≥ 0.7, then the pooling scale = 1×1; If 0.3 < V < 0.7, then the pooling scale = 3×3; If V ≤ 0.3, then the pooling scale = 5×5; S3: Construct a size decision mechanism module; The size decision mechanism module divides the input feature map into non-overlapping window regions of a specified size, and dynamically matches different pooling scales for the features in each window region according to the pooling operation mapping rule corresponding to the V value of the pixel at the window center; specifically, it includes the following steps: a1: For the input feature map, based on the pre-set window for feature map division, divide the input feature map into non-overlapping feature sub-maps; Assume the size of the input feature map is F∈R C×H×W , split the feature map by channel, and then divide the feature map with a size of R×W for each channel based on the division window to obtain the feature sub-maps; where, the size of the division window is: Sw×Sw, and the size of the feature sub-maps is Sw×Sw; a2: For each of the feature sub-maps, obtain the V value corresponding to the pixel at the window center position, find the pooling scale corresponding to the V value in the pooling operation mapping rule, and set it as the scale value s corresponding to the feature sub-map; S4: Construct a PLDP-SPP module; The PLDP-SPP module includes, connected in sequence: a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations respectively correspond to one of the pooling scales in the pooling operation mapping rule; The operations performed in the PLDP-SPP module specifically include the following steps: b1: Send the input feature map into the feature content analysis module and the size decision mechanism module respectively; b2: The feature content analysis module outputs the comprehensive score V corresponding to each pixel in the input feature map; b3: The size decision mechanism module splits the input feature map by channel, then splits the feature map for each channel through windows to obtain the feature sub-maps, and then obtains the pooling scale s corresponding to each feature sub-map according to the V value of the central pixel point of the feature sub-map; then send each feature sub-map to the pooling operation corresponding to the scale; b4: In the pooling operation, the feature sub-image to be processed with a window size of Sw×Sw is pooled according to the scale value s, and the extracted feature vector is output. Concatenate all feature vectors output by pooling operation in their original spatial order to obtain an output feature map of size H×W. b5: After weighted fusion of the three output feature maps corresponding to each channel, output the fused feature map according to the channel; When fusing the output feature maps, the output feature map corresponding to the 1×1 pooling output is multiplied by the weight ω1=0.7, the output feature map corresponding to the 3×3 pooling output is multiplied by the weight ω2=0.2, and the output feature map corresponding to the 5×5 pooling output is multiplied by the weight ω3=0.1. S5: Construct a target detection model based on the LDP-SPP module; S6: Construct a training dataset and a validation dataset; train the object detection model using the training dataset to obtain the trained object detection model; S7: Deploy the trained target detection model on the drone, and use the image acquired by the image acquisition device on the drone as the image to be identified, and send it into the trained target detection model to achieve target recognition.
[0008] Its further features are: The method for calculating the regional significance score S specifically includes the following steps: c1: Calculate the local gradient magnitude; For the input feature map F∈R C×H×W First, downsample to obtain the feature map F′∈R C×H′×W′ The feature map F′ is divided into n parts using a sliding window. 2 There are three non-overlapping feature subgraphs F″, F″∈R. C×H′ / n×W′ / n ; Where: C is the number of channels, H and W are the height and width, H′=H / 2, W′=W / 2; c2: For each feature sub-map F″ to be computed, calculate the gradient using the Sobel operator: gradient in the x-direction: G x =Sobel(F",dx=1,dy=0); Gradient in the y-direction: G y =Sobel(F",dx=0,dy=1); Calculate the gradient magnitude G: ; Calculate the mean gradient of a single channel: ; Where, c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n]; Calculate the mean gradient S across channels G : ; c3: Local contrast calculation; For each channel of the feature sub-image F″ to be calculated, the difference between the maximum and minimum grayscale values of pixels within the region is calculated to obtain the single-channel contrast C. c :C c =max (F c "(i′,j′))-min(F c "(i′,j′)"; Where, c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n]; Calculate the cross-channel contrast mean S for each feature sub-map F″ to be calculated. C : ; c3: Calculate the cross-channel gradient mean S G With cross-channel contrast mean S C After normalization and weighted fusion, the regional saliency score S corresponding to the feature sub-map F" to be calculated is obtained; The cross-channel gradient mean S G Normalization process yields the normalized cross-channel gradient mean S G ′: ; Wherein, min(S) G S is the mean of all cross-channel gradients. G Minimum value, max(S) G S is the mean of all cross-channel gradients. G The maximum value in the middle; The cross-channel contrast mean S C Normalization process yields the normalized cross-channel gradient mean S C ′: ; Wherein, min(S) C S represents the mean cross-channel contrast for all channels. C Minimum value, max(S) C S represents the mean cross-channel contrast for all channels. C The maximum value in the middle; Calculate the regional significance score S = w1 * S G ′+w2* S C ′; Where w1 and w2 are the significance scores weighted; c4: The region saliency score S corresponding to each feature sub-map F″ to be calculated is concatenated according to the original position to obtain the region saliency score S of feature map F′ with size H′×W′; c5: Using bilinear interpolation S from H ′× W Map back to original size H × W The full-resolution saliency score map is obtained. S ∈[0,1] H × W, Then we obtain the region saliency score S corresponding to each pixel in the input feature map F; The significance scores are weighted by values of 0.7 and 0.3 for weights w1 and w2, respectively. The calculation of the texture complexity score T specifically includes the following steps: d1: For the input feature map F∈R C×H×W First, downsampling is used to obtain the downsampled feature map F′∈R. C×H′×W′ ; d2: Downsampled feature map F ′, obtained by dividing by a sliding window. 2 Non-overlapping feature sub-maps F」∈R C×H′ / n×W′ / n Then, calculate the information entropy corresponding to the feature sub-map F″ to be calculated; Quantize the pixel values within the feature sub-image F″ to be calculated as follows: K Given bins, obtain the probability distribution. P =[ p 1, p 2 , ..., pk, ..., pK ],in, pk The percentage of pixels in the k-th bin; Calculate the entropy E of the features within the region of the feature submap F". ; Calculate the mean entropy T of the feature subgraph F to be calculated and the whole graph. E : ; d3: Statistical LBP features; The downsampled feature map F′ is converted to grayscale to obtain the grayscale feature map F. gray : ; For the grayscale feature map F grayFor each pixel (i′, j′), the corresponding LBP value is calculated; where the LBP value is a binary number. The number of LBP values included in each feature sub-map F″ to be calculated is denoted as N. LBP ; d4: The mean entropy T based on the full graph corresponding to F″ E Based on LBP features, the texture complexity score T corresponding to F" is calculated using the following method: The N corresponding to the full graph of F" LBP Normalization is performed to obtain the normalized LBP quantity value T. L : T L = N LBP / N max ; where N max For N LBP The maximum value; The mean entropy of the entire graph for F" is T E After normalization, the mean entropy of the entire graph is obtained as T. E ′: T E ′=(T E -min(T E )) / (max(T E )-min(T E )); where, min(T E ) represents the minimum value of the entropy of all valid local windows in F, max(T) E ) represents the maximum value of the entropy of all valid local windows; The texture complexity score T corresponding to the feature sub-map F″ to be calculated is 0.5 * T. E +0.5*T L ; d5: The texture complexity score T corresponding to each feature sub-map F″ to be calculated is concatenated in its original position to obtain the texture complexity score T of the feature map F′ with size H′×W′; By mapping T from H′×W′ back to the original size H×W through bilinear interpolation, the full-resolution texture complexity score T∈[0,1]H×W is obtained; Then we obtain the texture complexity score T for each pixel in the input feature map F; Before step b4 is executed, the following steps also need to be performed: For each feature sub-image, based on the corresponding scale value s, it is determined that the feature sub-image needs to be padded before performing the pooling operation; padding = ceil ( (s- Sw) / 2); where ceil (.) is the floor function; If the calculated padding value is 0, then no padding operation is needed, and the feature submap is used as the feature submap to be processed. If the padding value is not 0, then perform a padding operation on the feature sub-map to obtain a padded feature sub-map, and use the padded feature sub-map as the feature sub-map to be processed. In step S5, the target detection model is constructed by replacing the SPP module with the PLDP-SPP module based on YOLOv5s. The target detection model includes: a backbone network, a PLDP-SPP, a neckline, and a detection head; The target detection model includes CSPDarknet53, PLDP-SPP, PANet and a detection head connected in sequence; The detection head performs multi-scale prediction and outputs feature maps at three different scales, corresponding to the detection of small, medium and large targets respectively; each detection head contains 3 convolutional layers, which output bounding box coordinates, confidence scores and class probabilities respectively.
[0009] This application provides a small target detection method for UAV data. In the feature content analysis module, a region saliency score S and a texture complexity score T are calculated for each pixel in the input feature map. S and T are used as quantification indicators to calculate a comprehensive score V. A larger comprehensive score V indicates high information density, and a smaller comprehensive score V indicates low information density. In this application, different pooling scales are preset for different ranges of comprehensive scores V to ensure that more detailed contextual information can be extracted from regions with high information density. In the size decision mechanism module, the input feature map is divided into non-overlapping feature sub-maps. A pooling scale is set for each feature sub-map based on the pixel coordinates of the center position of the feature sub-map. Targeted pooling operations are performed on each feature sub-map with different information densities to extract feature vectors. The feature vectors extracted by the pooling operation are then concatenated according to the original positions of the corresponding feature sub-maps to obtain an output feature map. The output feature maps corresponding to the three pooling scales are then weighted and fused with preset weights to obtain a fused feature map as the output. This method extracts more detailed information from high and medium information density regions and then performs weighted fusion with relatively large weights. The resulting fused feature map enhances the detailed information in high-information-density regions, making it particularly suitable for small target detection and effectively improving detection accuracy. Simultaneously, for low-information-density regions, large-scale pooling is performed with relatively small weights during weighted fusion, ensuring that the overall computation is not excessively increased and resources are not consumed. This achieves a good balance between accuracy, real-time performance, and lightweight operation. In particular, although this application sets three different pooling scales, the actual pooling operation is performed by dividing the feature map of the same channel into feature sub-maps and then performing pooling operations at different scales for each feature sub-map. The extracted feature vectors are then concatenated to form the output feature map. In effect, only one pooling operation is performed for each feature sub-map, thus not consuming more computational resources and achieving higher computational efficiency. This makes this method particularly suitable for scenarios with limited computational resources and high real-time requirements, such as UAV data target detection. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of the PLDP-SPP module. Figure 2 This is an example of an object detection model. Detailed Implementation
[0011] This application includes a method for small target detection in drone data, which includes the following steps.
[0012] S1: Construct a feature content analysis module.
[0013] This method sets regional saliency score S and texture complexity score T as quantitative indicators reflecting the "regional information value" and also as the basis for subsequent scale decisions.
[0014] The regional saliency score S comprehensively reflects the probability that the target region containing a pixel is a semantic key region, and is calculated by weighted fusion of local gradient magnitude and local contrast. To avoid excessive computation, this method first downsamples the input feature map by 1 / 2, calculates the above index on the low-resolution feature map, and then maps the result back to the original resolution through bilinear interpolation. This method has only negligible accuracy loss, but can reduce the computational cost by 4 times, effectively improving computational efficiency. The calculation method of the regional saliency score S includes the following steps.
[0015] c1: Calculate the local gradient magnitude; For the input feature map F∈R C×H×W First, perform 1 / 2 downsampling to obtain the feature map F′∈R. C×H′×W′ The feature map F′ is divided into n parts using a sliding window. 2 There are three non-overlapping feature subgraphs F″, F″∈R. C×H′ / n×W′ / n ; Where: C is the number of channels, H and W are the height and width, H′=H / 2, W′=W / 2; The specific value of n is set according to the calculation precision. In this embodiment, n is set to 5. The size of the downsampled feature map F′ is H′×W′. For example, when the input F is 512×20×20, after downsampling by 1 / 2, F′ becomes 512×10×10, that is, H′=10 and W′=10. The size of each non-overlapping feature sub-map F″ to be calculated is (H′ / n) × (W′ / n). In specific applications, H′ and W′ must be divisible by n to avoid inconsistent sub-map sizes. The total number of sub-maps is n×n (for example, when n=10, the 10×10 F′ is divided into 10×10=100 1×1 sub-maps; when n=5, it is divided into 5×5=25 2×2 sub-maps).
[0016] c2: For each feature sub-map F″ to be computed, calculate the gradient using the Sobel operator: gradient in the x-direction: G x =Sobel(F",dx=1,dy=0); Gradient in the y-direction: G y =Sobel(F",dx=0,dy=1); Calculate the gradient magnitude G: ; Calculate the mean gradient of a single channel: ; Where, c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n]; Calculate the mean gradient S across channels G : .
[0017] Gradient magnitude is a metric used in image processing to measure the rate of change in pixel intensity, indicating the degree of brightness variation at a specific location in an image. For multi-channel images, regions with higher mean gradients across channels typically contain more significant feature information.
[0018] c3: Local contrast calculation; For feature maps, regions with high contrast usually correspond to more important feature activations, which can help the model focus on key information.
[0019] For each channel of the feature sub-image F″ to be calculated, the difference between the maximum and minimum gray values of pixels (i′, j′) within the region is calculated to obtain the single-channel contrast C. c :C c =max (F c "(i′,j′))-min(F c "(i′,j′)"; Where c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n].
[0020] Calculate the cross-channel contrast mean S for each feature sub-map F″ to be calculated. c : .
[0021] c3: Calculate the cross-channel gradient mean S G With cross-channel contrast mean S C After normalization and weighted fusion, the regional significance score S corresponding to the feature sub-map F″ to be calculated is obtained; The cross-channel gradient mean S G Normalization process yields the normalized cross-channel gradient mean S G ′: ; Wherein, min(S) G S is the mean of all cross-channel gradients. G Minimum value, max(S) G S is the mean of all cross-channel gradients. G The maximum value in the middle; The cross-channel contrast mean S CNormalization process yields the normalized cross-channel gradient mean S C ′: ; Wherein, min(S) C S represents the mean cross-channel contrast for all channels. C Minimum value, max(S) C S represents the mean cross-channel contrast for all channels. C The maximum value in the middle.
[0022] Calculate the regional significance score S = w1 * S G ′+w2* S C ′; Where w1 and w2 are the significance scores weighted; the specific values of w1 and w2 were determined experimentally. In this embodiment, w1 is set to 0.7 and w2 to 0.3.
[0023] c4: Concatenate the region saliency scores S corresponding to each feature sub-map F″ to be calculated in their original positions to obtain the region saliency scores S of feature map F′ with size H′×W′.
[0024] c5: By using bilinear interpolation to map S back from H′×W′ to the original size H×W, we obtain the full-resolution saliency score map S∈[0,1]H×W, and then obtain the region saliency score S corresponding to each pixel in the input feature map F.
[0025] The texture complexity score T reflects the richness of detail in the region where a pixel is located, and is calculated by fusing local entropy and LBP feature diversity. The calculation of the texture complexity score T includes the following steps.
[0026] d1: For the input feature map F∈R C×H×W First, downsampling is used to obtain the downsampled feature map F′∈R. C×H′×W′ .
[0027] The information entropy of a feature map is an indicator that measures the uncertainty of the distribution of pixel values in the feature map. It is usually used to quantify the complexity or information content of the feature map. A high entropy value indicates that the feature map has strong randomness and complex texture, such as a small target focus area. A low entropy value indicates that the feature map has a concentrated distribution and simple structure, such as a solid color background.
[0028] d2: Downsampled feature map F ′, using a 3×3 sliding window with a step size of 1, divide the space to obtain n. 2 Non-overlapping feature sub-maps F」∈R C×H′ / n×W′ / n Then, the information entropy corresponding to the feature sub-map F″ to be calculated is calculated. The specific method is as follows: Quantize the pixel values within the feature sub-image F″ to be calculated as follows:K There are several bins (histogram bars). The specific K value is set according to the calculation precision. In this embodiment, K is set to 16.
[0029] Obtain the probability distribution P =[ p 1, p 2 , ..., pk, ..., pK ],in, pk The percentage of pixels in the k-th bin; Calculate the entropy E of the features within the region of the feature submap F". ; Calculate the mean entropy T of the feature subgraph F to be calculated and the whole graph. E : .
[0030] d3: Statistical LBP features; LBP features are typically used to reflect regional texture information.
[0031] The downsampled feature map F′ is converted to grayscale by taking the channel mean, resulting in the grayscale feature map F. gray : ; For the grayscale feature map F gray For each pixel (i′, j′), the corresponding LBP (Local Binary Pattern) value is calculated; the number of LBP value categories included in each feature sub-image F″ to be calculated is counted, denoted as N. LBP .
[0032] Wherein, the LBP value is a binary number. The specific calculation method of the LBP feature is implemented according to existing technology. In this embodiment, based on the original LBP operator definition, each pixel is taken as the center pixel, and its 8 neighboring pixels are compared with the gray value of the center pixel. If the neighboring pixels are greater than or equal to the center pixel, they are marked as 1; otherwise, they are marked as 0. Each center pixel corresponds to an 8-bit binary LBP feature value.
[0033] Number of types of LBP values N LBP This indicates how many different LBP values appear in the feature submap F″. For example, if all pixels in F″ correspond to only three LBP values: 00000000, 00011111, and 00011111, then N is... LBP The maximum LBP value is 3. Using the method of calculating the LBP value based on 8 neighboring pixels, the maximum LBP value can be 2. 8 =256 possible values, i.e., N LBP The maximum value N max It is 256. NLBP A higher value indicates higher image complexity.
[0034] d4: The mean entropy T corresponding to the entire graph F. E Based on LBP features, the texture complexity score T corresponding to F" is calculated using the following method: The N corresponding to the full graph of F" LBP Normalization is performed to obtain the normalized LBP quantity value T. L : T L = N LBP / N max =N LBP / 256; The mean entropy of the entire graph for F" is T E After normalization, the mean entropy of the entire graph is obtained as T. E ′: T E ′=(T E -min(T E )) / (max(T E )-min(T E )); where, min(T E ) represents the minimum value of the entropy of all valid local windows in F, max(T) E ) represents the maximum value of the entropy of all valid local windows.
[0035] The texture complexity score T corresponding to the feature sub-map F″ to be calculated is 0.5 * T. E +0.5*T L .
[0036] The texture complexity of a feature map stems from the texture of the original input image. The denser the texture and the richer the details, the higher the local window entropy value of the corresponding feature map, and the higher the maximum (T) value. E The larger the value of ) is, the smaller the value of min(T) becomes; conversely, the smaller the value of min( E The smaller the value of max(T), the better. For example, if the input image is a "forest scene," and its features include dense textures of leaves and branches, and the pixel values in the 3×3 window of the feature map are scattered (covering multiple bins after quantization), the window entropy is high. E It may reach 6~8, min(T) E The value might be 2-3. However, if the input image is a "solid color background + small object", such as a bird flying in a blue sky, the window pixel values of the feature map background region are concentrated (only covering 1-2 bins after quantization), the entropy value is low, and min(T) is less than 2-3. E The value of max(T) may be close to 0. E) is only 3 - 4 (only the entropy value of the target area is relatively high). At the same time, the feature map F' is the result of multi-channel downsampling. Different channels correspond to different semantics (such as edge detection, color, texture), and the strength of the channel response will also affect the distribution of the window entropy value. In the step of discretizing the window feature values, K is the number of bins for pixel value quantization (such as K = 16 in the previous text). The size of K will affect the calculation range of the window entropy value and indirectly change the values of max(T E ) and min(T E ).
[0037] d5: Concatenate the texture complexity scores T corresponding to each feature sub-map F〞 to be calculated according to the original positions to obtain the texture complexity score T of the feature map F' with the size of H'×W'; Map T from H'×W' back to the original size H×W through bilinear interpolation to obtain the full-resolution texture complexity score T∈[0,1]H×W; Then obtain the texture complexity score T corresponding to each pixel point in the input feature map F.
[0038] This method constructs a quantization index based on the "significance score + texture complexity score", designs the decision logic of the subsequent dynamic pooling operation, and maps the quantization index to specific pooling scales, such as: 1×1, 7×7, 15×15. Specifically, this method divides the index interval through a preset threshold, and each interval corresponds to a fixed pooling scale. Because the rule-based decision form based on the threshold has a very small calculation amount and no training cost, it is more suitable for task scenarios with high speed requirements and relatively fixed scenes, such as real-time detection tasks or classification tasks in the UAV scenario.
[0039] The feature content analysis module analyzes each pixel in the input feature map respectively, extracts the regional significance score S and texture complexity score T corresponding to each pixel; then normalizes the regional significance score S and texture complexity score T to the [0,1] interval, and calculates the comprehensive score V corresponding to each pixel; V = α*S + β*T; Among them, α and β are hyperparameters. The specific values of α and β can be determined through cross-validation. In this embodiment, α = 0.6 and β = 0.4, which can preferentially ensure the details of the target area.
[0040] S2: Set different pooling operation mapping rules for different comprehensive scores V; If V ≥ 0.7, then the pooling scale = 1×1, corresponding to high information value, such as the target core area; If 0.3 < V < 0.7, then the pooling scale = 3×3, corresponding to medium information value, such as the target edge, small background texture; If V ≤ 0.3, then the pooling scale = 5×5, which corresponds to low information value, such as large-area background.
[0041] The specific pooling scale can be set according to the detection needs. Since this method is mainly for the identification of small targets in data collected by UAVs, the pooling scale is set to 1×1, 3×3, and 5×5.
[0042] In this method, by setting different pooling methods for different comprehensive scores V, a clear reference is provided for subsequent dynamic delayed operations. The pooling scale of each feature subgraph in the dynamic pooling operation can be determined without complex calculations, thus improving computational efficiency. At the same time, through the pooling operation mapping rules, it is also ensured that the feature subgraph within each window only needs to undergo the most suitable pooling operation once, further reducing computational complexity and computational cost.
[0043] S3: Construct the size decision mechanism module.
[0044] The size decision mechanism module divides the input feature map into non-overlapping window regions of a specified size, and dynamically matches different pooling scales for features within each window region according to the pooling operation mapping rules corresponding to the V value of the center pixel of the window; specifically, it includes the following steps.
[0045] a1: For the input feature map, based on the pre-set feature map partitioning window, the input feature map is divided into non-overlapping feature sub-maps; Assume the size of the input feature map is F∈R C×H×W The feature map is split according to the channel, and then the feature map of each channel with a size of R×W is divided based on the partitioning window to obtain the feature sub-map; where the partitioning window size is Sw×Sw, and the feature sub-map size is Sw×Sw.
[0046] In this embodiment, the input feature map size is H×W, corresponding to 20×20. The 20×20 feature map is divided into non-overlapping windows of fixed size. The window size is strongly tied to the output resolution. For a 20×20 input, Sw=2 is chosen, i.e., a 2×2 window is used, so no additional padding is required. A total of 10×10 windows are divided, and each window corresponds to a 2×2 pixel region of the output feature map. A uniform dynamic pooling scale is used within each window. Through "window pooling + resolution restoration", the output is ensured to be 20×20.
[0047] For a 20×20 input, Sw=2 is selected, which means using a 2×2 window. No additional padding is required. A total of 10×10 windows are divided, and each window corresponds to a 2×2 pixel region of the output feature map. Finally, the pooling results of the 10×10 windows are concatenated to form a 20×20 output.
[0048] a2: For each feature sub-image, obtain the V value corresponding to the pixel located at the center of the window, find the pooling scale corresponding to the V value in the pooling operation mapping rule, and set it as the scale value s corresponding to the feature sub-image.
[0049] In specific implementation, the window partitioning method is as follows: the input feature map (B, 512, 20, 20) is expanded into a 2×2 window with a stride of 2 using the unfold operator, resulting in a window tensor of shape (B, 512×2×2, 10×10); where B is the batch size, 512×2×2 is the feature dimension of each window, and 10×10 is the total number of windows. If B=8, it means that the current batch processes 8 images simultaneously; each image generates a (512, 20, 20) feature map after forward propagation, so the shape of the entire input feature map is (8, 512, 20, 20). Batch processing of samples can fully utilize the parallel computing power of the GPU to improve training / inference efficiency; in dynamic pooling, all operations (window partitioning, pooling, and concatenation) are "synchronously executed" on the feature maps of B samples, and the final output still maintains the shape (B, 512, 20, 20), ensuring the processing consistency of all samples within the batch.
[0050] Scale assignment: For a 1×20×20 dynamic scale map, the scale value of the center pixel of the window is also taken in a 2×2 window with a step size of 2. The scale corresponding to the pixel at the center position (1,1) of each 2×2 window is taken to avoid edge deviation, resulting in a 1×1×10×10 window scale tensor, where each window corresponds to one scale value s.
[0051] In subsequent dynamic pooling operations, pooling is performed according to the window scale: for each window (a total of 10×10), s×s adaptive pooling is performed according to its corresponding scale value s, and the pooling result is reshaped to a size of 2×2 to match the output window resolution.
[0052] S4: Build the PLDP-SPP module.
[0053] Among them, PLDP stands for Pixel-adaptive Local Dynamic Pooling, and SPP stands for Spatial Pyramid Pooling.
[0054] like Figure 1 As shown, the PLDP-SPP module includes, in sequence, a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations correspond to a pooling scale in the pooling operation mapping rule.
[0055] The operations performed in the PLDP-SPP module specifically include the following steps: b1: The input feature map is sent to the feature content analysis module and the size decision mechanism module respectively.
[0056] b2: The feature content analysis module outputs the comprehensive score V corresponding to each pixel in the input feature map.
[0057] b3: The size decision mechanism module splits the input feature map by channel, and then splits the feature map of each channel by window to obtain feature sub-maps. Then, based on the V value of the center pixel of the feature sub-map, the pooling scale s corresponding to each feature sub-map is obtained; and then each feature sub-map is sent to the pooling operation of the corresponding scale.
[0058] Window feature extraction: Extract the features of a single window from the expanded window tensor. Shape: B,512×2×2,1. Reshape to B,512,2,2 to restore the spatial structure of the window.
[0059] Before step b4 is executed, the following steps also need to be performed: For each feature sub-image, based on the corresponding scale value s, it is determined that the feature sub-image needs to be padded before the pooling operation to ensure that the window features do not go out of bounds during pooling.
[0060] padding = ceil ( (s- Sw) / 2); where ceil (.) is the floor function; If the calculated padding value is 0, then no padding operation is needed, and the feature submap is used as the feature submap to be processed. If the padding value is not 0, then the padding operation is performed on the feature submap to obtain the padded feature submap, which is then used as the feature submap to be processed.
[0061] Specifically, based on the window size *s*, the padding required for pooling is calculated: padding = (s - 2) / 2. Since the window itself is 2×2, when *s* ≥ 2, padding ensures that the *s*×s pooling kernel completely covers the 2×2 window. For example, when *s* = 3, padding = 0.5, rounded up to 1, and padded with zeros using `torch.nn.functional.pad`. Here, `torch.nn.functional.pad` is a PyTorch function used for padding the boundaries of tensors.
[0062] Adaptive pooling: Call torch.nn.functional.adaptive_max_pool2d (or average pooling) to pool the features of a 2×2 window into 1×1 (kernel size s×s, stride 1), and then use interpolate (bilinear interpolation) to restore the 1×1 to 2×2 to match the 2×2 window size, obtaining the pooling result (B, 512, 2, 2) for this window.
[0063] Example 1: Assume that the central pixel V = 0.8 (≥0.7) of a certain 2×2 window in the dynamic scale map. According to the scale mapping rule, the pooling scale s of this window is 1×1.
[0064] Feature map window: A 2×2 window is divided from the input feature map (B, 512, 20, 20). After unfold, its shape is (B, 512×2×2, 1), and after reshape, it is (B, 512, 2, 2).
[0065] Dynamic scale adaptation: Calculate padding = (s - 2) / 2 = (1 - 2) / 2 = -0.5, and round up to 0, so no padding is required.
[0066] The adaptive pooling is as follows: Directly perform 1×1 adaptive max pooling (kernel = 1×1, stride = 1) on the (B, 512, 2, 2) features, and the output shape is (B, 512, 1, 1). Use bilinear interpolation to restore (B, 512, 1, 1) to (B, 512, 2, 2) to match the window output size.
[0067] The (B, 512, 2, 2) result of this window is concatenated with other windows in spatial order, and finally becomes the high-detail feature corresponding to the 2×2 region in the output feature map. Because the 1×1 pooling operation retains the original information for the target core.
[0068] Example 2: Assume that the central pixel V = 0.5 (0.3 < V < 0.7) of a certain 2×2 window in the dynamic scale map. According to the scale mapping rule, the pooling scale s of this window is 3×3.
[0069] Feature map window: Similarly, a 2×2 window is divided from the input and reshaped to (B, 512, 2, 2).
[0070] Scale assignment: The scale tensor value s of this window is 3.
[0071] Dynamic scaling: Calculate padding = (3-2) / 2 = 0.5, round up to 1, and add 1 layer of 0. Apply padding=1 to the feature (B,512,2,2) to get (B,512,4,4), then add 1 layer of 0 on each side, to avoid feature shift based on symmetrical padding.
[0072] Adaptive pooling: Perform 3×3 pooling (kernel = 3×3, stride = 1) on (B, 512, 4, 4), and the output shape is (B, 512, 2, 2). Because the output size after 3×3 pooling (stride 1) of a 4×4 input is 4-3+1=2, which perfectly meets the 2×2 requirement, no interpolation is needed, as the window size is already matched.
[0073] The (B,512,2,2) results of the window in this embodiment, after being concatenated, become the medium-abstract features of the corresponding region in the output feature map, because the 3×3 pooling operation balances details and redundancy for the target edge region.
[0074] Example 3: Assume that the center pixel V of a 2×2 window in a dynamic scale image is 0.2 (≤0.3). According to the scale mapping rule, the pooling scale of this window is 5×5.
[0075] Feature map window: Divide into 2×2 windows, reshape to (B,512,2,2).
[0076] Scale assignment: The scale tensor value of this window is s=5.
[0077] Dynamic scaling: Calculate padding = (5-2) / 2 = 1.5, round up to 2, then 2 layers of 0 need to be added. Apply padding=2 to the feature (B,512,2,2) to get (B,512,6,6), then add 2 layers of 0 on each side, to avoid feature shift based on symmetrical padding.
[0078] Adaptive pooling: Perform 5×5 pooling (kernel = 5×5, stride = 1) on (B, 512, 6, 6), and the output shape is (B, 512, 2, 2). Since the output size after 5×5 pooling (stride 1) of a 6×6 input is 6-5+1=2, which exactly meets the requirement of a 2×2 window size, no interpolation is needed.
[0079] In this embodiment, the (B,512,2,2) results of the window are concatenated to become the highly compressed features of the corresponding region in the output feature map, because 5×5 pooling compresses redundant information for the background region.
[0080] b4: In the pooling operation, the feature sub-map to be processed with a window size of Sw×Sw is pooled according to the scale value s, and the extracted feature vector is output. All feature vectors output by the pooling operation are concatenated in their original spatial order to obtain an output feature map of size H×W.
[0081] In this embodiment, the input feature map H×W is 20×20. Therefore, the pooling results of 10×10 windows (each with B, 512, 2, 2) are concatenated in their original spatial order: First, stitch along the width dimension (W): 10 2×2 windows are stitched horizontally to form 2×20 (2×(2×10)); Then, stitch along the height dimension (H): 10 rows of 2×20 features are stitched vertically to form a 20×20; The final output feature map has a shape of (B,512,20,20), which is completely consistent with the input resolution.
[0082] b5: After performing weighted fusion on the three output feature maps corresponding to each channel, output the fused feature map according to the channel; When fusing the output feature maps, the output feature map corresponding to the 1×1 pooling output is multiplied by the weight ω1=0.7, the output feature map corresponding to the 3×3 pooling output is multiplied by the weight ω2=0.2, and the output feature map corresponding to the 5×5 pooling output is multiplied by the weight ω3=0.1.
[0083] In this embodiment, the three 512*20*20 feature maps are finally fused by weighted averaging, with 1×1 pooling output and weight ω1=0.7; and 3×3 pooling output and weight: =0.2; 5×5 pooling output, weights: =0.1.
[0084] This application applies three scale pooling operations to the input feature map, and then concatenates the features extracted by the three pooling operations, followed by weighted fusion to further strengthen the dominance of high-information regions, fully realizing the design goal of the scale mapping rule. The PLDP-SPP module in this scheme retains the advantages of dynamic perception while controlling computational complexity through a sliding window design. Based on the window partitioning rule, windows of the same scale can be processed in batches; for example, multiple windows using 3×3 pooling can be merged for computation, with the computational load increasing by only 10%~15% compared to traditional SPP. Real-time inference can be achieved through parallel acceleration on GPUs. When partitioning the input image H×W into windows, the window size can be controlled according to the specific application scenario's UAV computing resources and real-time requirements, avoiding overly fine window partitioning. This is suitable for tasks with limited computing resources but sensitive to latency, such as real-time object detection and image classification.
[0085] The PLDP-SPP module constructed in this application can be applied to multi-scale feature extraction, enabling the fusion of features and global features. The feature content analysis module, size decision mechanism module, and dynamic pooling operation within the module can also be applied individually or in combination in different scenarios. In this embodiment, the PLDP-SPP module is applied to the YOLOv5s model to improve the performance of YOLOv5s for small object detection.
[0086] S5: Construct a target detection model based on the PLDP-SPP module.
[0087] The YOLOv5s model design is based on the classic YOLO framework, and its core structure consists of three parts: the backbone network, the neck network, and the head detection network. The architecture of YOLOv5s follows the design logic of "feature extraction - feature fusion - multi-scale prediction".
[0088] This application uses YOLOv5s as a base and replaces the SPP module with the PLDP-SPP module to construct an object detection model. For example... Figure 2 As shown, the target detection model includes a backbone network, a PLDP-SPP module, a neck network, and a detection head. Specifically, in this embodiment, the target detection model includes CSPDarknet53, PLDP-SPP, PANet, and a detection head connected in sequence. The detection head performs multi-scale prediction and outputs feature maps at three different scales, corresponding to the detection of small, medium, and large targets, respectively. Each detection head contains three convolutional layers, which output bounding box coordinates, confidence scores, and class probabilities, respectively. In this embodiment, the output scales of the three detection heads are, for example, 80×80, 40×40, and 20×20.
[0089] The backbone network CSPDarknet53 consists of 5 stages, each containing multiple C3 modules. The C3 modules employ cross-stage partial (CSP) connections, dividing the input features into two parts: one part is directly passed, and the other part is merged after a residual connection, effectively reducing computation and enhancing gradient propagation. Specifically, the C3 module structure includes 3 convolutional layers and 1 cross-stage partial (CSP) connection, where two branches process features from different channels respectively, and then merge them.
[0090] Stage 1: The Focus layer (slicing operation + convolution) halves the input size and doubles the number of channels. Stages 2-5: Each Stage contains a different number of C3 modules, progressively reducing the feature map size (e.g., from 640×640 to 20×20) while increasing the number of channels (e.g., from 64 to 1024). syncbn_fast optimization: The syncbn_fast setting in the configuration file enables synchronous BN (cross-GPU synchronized statistics) and lightweight convolutions, improving multi-GPU training stability and inference speed.
[0091] This method replaces the SPP module in YOLOv5s with the PLDP-SPP module. Through the dynamic multi-scale pooling perception module PLDP-SPP, max pooling quickly fuses multi-scale contextual information, which more efficiently preserves key details and extracts global contextual information, resulting in more accurate detection results. In the PLDP-SPP module, the input features first pass through the dynamic multi-scale pooling perception module, outputting three 512*20*20 feature maps. Finally, the feature maps are fused using a weighted average and output through a 1×1 convolution.
[0092] The path aggregation network PANet fuses deep semantic information with shallow location information through upsampling and lateral connections. For example, the feature map of Stage 5 (20×20) is upsampled to 40×40, added to the feature map of Stage 4, and then further processed by the C3 module.
[0093] Three detection heads perform multi-scale prediction, outputting feature maps at three different scales (e.g., 80×80, 40×40, and 20×20) to detect small, medium, and large targets respectively. Each detection head contains three convolutional layers, outputting bounding box coordinates, confidence scores, and class probabilities respectively. The bounding box coordinates include four values; the confidence score includes one value; and the class probability is, for example, an 80-dimensional classification probability vector designed for the COCO dataset.
[0094] This application replaces the SPP module with a dynamic multi-scale pooling perception module in its designed PLDP-SPP module, ensuring that the size of its input feature map and output feature map is consistent with that of the original SPP module. The computational load is controlled by the dynamic multi-scale pooling perception module, and the computational load in feature content analysis is reduced by downsampling the input feature map by 1 / 2.
[0095] S6: Construct training and validation datasets; train the object detection model using the training dataset to obtain a trained object detection model. The specific methods for constructing the training and validation sets and the training methods are implemented based on existing technologies.
[0096] S7: Deploy the trained target detection model on the drone, and use the images captured by the image acquisition device on the drone as the images to be identified, and feed them into the trained target detection model to achieve target recognition.
[0097] In this embodiment, the configuration file parameter mapping is as follows: In yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py, 8xb16 indicates that the batch size per GPU is 16, and the total batch size is 8 × 16 = 128. 300e indicates that the training is conducted for 300 epochs, using a cosine annealing learning rate scheduler.
[0098] Backbone network parameters: depth_multiple=0.33: controls the number of repetitions of the C3 module (e.g., repetition once when n=1); width_multiple=0.5: controls the scaling ratio of the number of channels (e.g., the basic number of channels changes from 64 to 32).
[0099] Neck network parameters: spp_size=[1, 3, 7]: pooling kernel size of the PDLP-SPP module; num_features=3: output feature maps at 3 scales.
[0100] Training hyperparameters: sync_bn=True: Enables synchronous Batch Normalization (BN), suitable for multi-GPU training. fast_forward=True: Simplifies some computational processes and improves inference speed.
[0101] To verify the performance of the PLDP-SPP module in this application, a comparative experiment was conducted between the object detection model built using the PLDP-SPP module instead of the SPP module in YOLOv5s and YOLOv5s-SPP. The object detection model in this application introduces dynamic perceptual pooling in YOLOv5s, while the original YOLOv5s-SPP model uses fixed-scale pooling. Based on the COCO 2017 dataset (118k training images, 5k validation images, containing 80 object classes), and by controlling the training hyperparameters to be consistent (input size 640×640, optimizer AdamW, learning rate 0.001, epoch 300, IoU threshold 0.5), the core metrics of YOLOv5s-PLDP-SPP (an improved version with dynamic perceptual pooling) and YOLOv5s-SPP (the original fixed-scale pooling) were compared. The specific results are shown in Table 1 below. Table 1 compares the key metrics of the two models on the COCO validation set.
[0102] Table 1: Comparison of Key Indicators
[0103] AP (Average Precision) is the core accuracy metric. 50 (AP at IoU=0.5) reflects the coarse-grained detection capability. 75 (AP at IoU=0.75) reflects fine-grained detection capability. s / AP m / AP l The detection accuracy corresponds to small (area < 32²), medium (32² ≤ area ≤ 96²), and large (area > 96²) targets, respectively; FPS reflects inference speed; the number of parameters reflects the lightweight nature of the model.
[0104] The data in Table 1 shows that: Overall accuracy improvement of PLDP-SPP: AP improved by 2.6 percentage points, AP 50 An increase of 2.8 percentage points, AP 75 The improvement of 3.4 percentage points indicates that PLDP-SPP has significantly optimized the "localization accuracy" and "bounding box fit" of the target. Dynamic pooling can match the optimal receptive field according to the feature content, avoiding the loss of details such as small target edges and large target local textures caused by the original fixed-scale pooling.
[0105] Breakthrough in Small Target Detection with PLDP-SPP: AP sThe improvement of 4.3 percentage points (from 21.5 to 25.8) is the most significant improvement among all indicators. The core reason is that PLDP-SPP automatically uses 1×1 / 3×3 small-scale pooling for the "high information density region" where small targets are located, retaining more detailed features; while the original SPP uses 1×1 / 5×5 / 9×9 / 13×13 pooling for all regions. Large-scale pooling can easily lead to "over-aggregation" of small target features, losing key discriminative information (such as the outline and texture of small targets).
[0106] PLDP-SPP Mid-Target Accuracy Optimization: AP m The accuracy improved by 3.3 percentage points (from 41.3 to 44.6) because PLDP-SPP uses 3×3 medium-scale pooling for the "edge transition region" of mid-range targets (such as the boundary between the target and the background) to balance local details and contextual relevance; the fixed scale of the original SPP is difficult to adapt to the "scale fluctuation" of mid-range targets (such as the size difference of mid-range targets of the same type), resulting in some mid-range targets being missed or falsely detected.
[0107] PLDP-SPP's large target accuracy is robust: AP l The improvement of 1.4 percentage points (from 49.8 to 51.2), although small, still demonstrates its advantages: PLDP-SPP uses 5×5 large-scale pooling for the "low information density background region" of large targets, which captures the global context more efficiently; although the original SPP's large-scale pooling (9×9 / 13×13) can cover large targets, it has "redundant calculations" and is not as accurate as PLDP-SPP in preserving local details of large targets.
[0108] PLDP-SPP achieves a balance between speed and parameter size: the number of parameters increases by only 0.3M (from 7.2 to 7.5), because PLDP-SPP's dynamic decision module (lightweight feature analysis + rule-based scale decision) has very few parameters and no additional heavyweight network, perfectly adapting to the memory limit of <10M parameters in UAV embedded devices; the FPS decreases by 13 frames (from 128 to 115), but still meets the real-time detection requirements (>100 FPS). The decrease is due to the small amount of additional computation required for the "regional scale adaptation" of dynamic pooling. In practical applications, the gap can be further narrowed through GPU parallel optimization (such as batch processing of regions of the same scale). PLDP-SPP achieves a 2.6 percentage point improvement in AP (core accuracy metric) (from 37.2% to 39.8%) at a very small speed cost, achieving a good balance between accuracy and efficiency.
[0109] The comparison is made using typical scenarios from the COCO dataset, such as densely packed small objects, complex backgrounds, and large object occlusion.
[0110] For scenarios with a high density of small targets, such as "crowds of people or flocks of birds": YOLOv5s-SPP: has a high false negative rate for densely packed small targets (such as heads in a crowd or birds in the sky). Some small targets cannot be correctly identified because their features are "diluted" by large-scale pooling. The bounding box offset is also significant. For example, the bounding box of a small target's head only covers a part of the area.
[0111] YOLOv5s-PLDP-SPP: The false negative rate is reduced by about 30%, the bounding box fit of small targets is significantly improved, and dynamic pooling preserves detailed features in small target regions, enabling the model to distinguish the "individual differences" of dense small targets, such as the outlines of different birds and the facial features of different people.
[0112] For complex background scenes, such as "city streets, forest animals": YOLOv5s-SPP: In complex backgrounds (such as billboards on the street or leaves in the forest), it is easy to misdetect background textures as targets (such as misdetecting billboard text as "traffic signs" and leaves as "small animals"), because fixed-scale pooling cannot effectively distinguish between "target features" and "background interference features".
[0113] YOLOv5s-PLDP-SPP: The false detection rate is reduced by about 25%. Dynamic pooling uses large-scale pooling for the background region to suppress redundant interference features, and small-scale pooling for the target region to enhance target discrimination features (such as the outline of an animal's limbs and the specific shape of a traffic sign), thus achieving accurate "target-background" separation.
[0114] For scenarios involving large objects being occluded, such as "occluded cars or pedestrians": YOLOv5s-SPP: It does not fully recognize the occluded parts of large targets (such as the car body obscured by trees or the legs of a pedestrian obscured by a backpack), and the bounding box is prone to "missing the box" (such as only selecting the unoccluded head of a car). Due to the fixed large-scale pooling, it cannot capture the local details of the occluded area.
[0115] YOLOv5s-PLDP-SPP: Dynamic pooling uses 3×3 medium-scale pooling for occluded regions (belonging to the "medium information density region"), preserving detailed features of the occlusion edges (such as the occlusion shadow of a car body and the residual outline of a pedestrian's legs), enabling the model to "complete" the bounding box of the occluded target. By adapting dynamic pooling to the feature density of different regions, it solves the problem of "over-aggregation" of small target features (AP). sIt improves accuracy by 4.3 percentage points, suppresses background interference (reducing false detection rate in complex scenes by 25%), and uses 3×3 medium-scale pooling for occluded areas, improving recognition integrity by 20%.
[0116] From the comparison of core quantitative indicators, YOLOv5s-PLDP-SPP performs better in AP and AP. 50 AP 75 APs, AP m AP l In terms of metrics, YOLOv5s-PLDP-SPP outperforms YOLOv5s-SPP. In scenes with dense small targets, YOLOv5s-PLDP-SPP reduces the false positive rate by approximately 30%. This is because its dynamic pooling preserves more detailed features in small target regions, enabling the model to distinguish individual differences among densely packed small targets. In complex background scenes, YOLOv5s-PLDP-SPP reduces the false positive rate by approximately 25%. Its dynamic pooling uses large-scale pooling for background regions, suppressing redundant interference features, and small-scale pooling for target regions, strengthening target discrimination features. In scenes with large target occlusion, YOLOv5s-PLDP-SPP improves the completeness of occluded region recognition by approximately 20%. Its dynamic pooling uses 3×3 medium-scale pooling for occluded regions, preserving detailed features at occlusion edges. Therefore, YOLOv5s-PLDP-SPP, with the PLDP module, outperforms YOLOv5s-SPP in different scenarios.
[0117] By using the technical solution of this invention, the PLDP-SPP module solves the problem of the original YOLOv5s-SPP module's inability to adapt to multi-scale targets due to its fixed scale by dynamically pooling to match the feature density of different regions. This results in stronger scale adaptability, particularly significant improvement in detection accuracy for small and medium-sized targets. The PLDP-SPP module also offers better balance between detail and global accuracy. Small-scale pooling preserves details in high-information regions, while large-scale pooling captures the global picture in low-information regions, avoiding "over-aggregation" or "detail loss" and improving fine-grained detection capabilities (AP). 75 (Significant improvement). The PLDP-SPP module offers high cost-effectiveness, adding only 0.3M parameters and 13 FPS latency while achieving a 2.6 percentage point improvement in AP. It achieves a better balance between accuracy, speed, and lightweight design, making it suitable for real-time detection scenarios (such as drone monitoring and autonomous driving). In summary, YOLOv5s-PLDP-SPP outperforms the original YOLOv5s-SPP across the board on the COCO dataset, especially in challenging scenarios with dense small targets, complex backgrounds, and target occlusion, where its advantages are even more pronounced, validating the effectiveness of the dynamic perception pooling module.
Claims
1. A method for small target detection using UAV data, characterized in that, It includes the following steps: S1: Construct a feature content analysis module; The feature content analysis module analyzes each pixel in the input feature map and extracts the region saliency score S and texture complexity score T corresponding to each pixel. Then, after normalizing the region saliency score S and texture complexity score T to the [0,1] interval, the comprehensive score V corresponding to each pixel is calculated. The regional saliency score S is calculated by weighted fusion of local gradient magnitude and local contrast. The texture complexity score T is calculated by fusing local entropy and LBP feature diversity. S2: Set different pooling operation mapping rules for different composite scores V; S3: Construct the size decision mechanism module; The size decision mechanism module divides the input feature map into non-overlapping window regions of a specified size, and dynamically matches different pooling scales for the features within each window region according to the pooling operation mapping rules corresponding to the V value of the center pixel of the window. S4: Construct the PLDP-SPP module; The PLDP-SPP module includes, in sequence, a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations correspond to a pooling scale in the pooling operation mapping rule. The operations performed in the PLDP-SPP module specifically include the following steps: b1: The input feature map is sent to the feature content analysis module and the size decision mechanism module respectively; b2: The feature content analysis module outputs a comprehensive score V corresponding to each pixel in the input feature map; b3: The size decision mechanism module splits the input feature map by channel, and then splits the feature map of each channel by window to obtain feature sub-maps. Then, based on the V value of the center pixel of the feature sub-map, the pooling scale s corresponding to each feature sub-map is obtained; and then each feature sub-map is sent to the pooling operation of the corresponding scale. b4: In the pooling operation, the feature sub-image to be processed with a window size of Sw×Sw is pooled according to the scale value s, and the extracted feature vector is output. Concatenate all feature vectors output by pooling operation in their original spatial order to obtain an output feature map of size H×W. b5: After weighted fusion of the three output feature maps corresponding to each channel, output the fused feature map according to the channel; S5: Construct a target detection model based on the LDP-SPP module; S6: Construct a training dataset and a validation dataset; train the object detection model using the training dataset to obtain the trained object detection model; S7: Deploy the trained target detection model on the drone, and use the image acquired by the image acquisition device on the drone as the image to be identified, and send it into the trained target detection model to achieve target recognition.
2. The method for small target detection based on UAV data according to claim 1, characterized in that: The method for calculating the regional significance score S is as follows: Includes the following steps: c1: Calculate the local gradient magnitude; For the input feature map F∈R C×H×W First, downsample to obtain the feature map F′∈R C×H′×W′ The feature map F′ is divided into n parts using a sliding window. 2 There are three non-overlapping feature subgraphs F″, F″∈R. C×H′ / n×W′ / n ; Where: C is the number of channels, H and W are the height and width, H′=H / 2, W′=W / 2; c2: For each feature sub-map F″ to be computed, calculate the gradient using the Sobel operator: gradient in the x-direction: G x =Sobel(F",dx=1,dy=0); Gradient in the y-direction: G y =Sobel(F",dx=0,dy=1); Calculate the gradient magnitude G: ; Calculate the mean gradient of a single channel: ; Where, c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n]; Calculate the mean gradient S across channels G : ; c3: Local contrast calculation; For each channel of the feature sub-image F″ to be calculated, the difference between the maximum and minimum grayscale values of pixels within the region is calculated to obtain the single-channel contrast C. c :C c =max (F c "(i′,j′))-min(F c "(i′,j′)"; Where, c∈[1,C], i′∈[1,H′ / n], j′∈[1,W′ / n]; Calculate the cross-channel contrast mean S for each feature sub-map F″ to be calculated. C : ; c3: Calculate the cross-channel gradient mean S G With cross-channel contrast mean S C After normalization and weighted fusion, the regional saliency score S corresponding to the feature sub-map F" to be calculated is obtained; The cross-channel gradient mean S G Normalization process yields the normalized cross-channel gradient mean S G ′: ; Wherein, min(S) G S is the mean of all cross-channel gradients. G Minimum value, max(S) G S is the mean of all cross-channel gradients. G The maximum value in the middle; The cross-channel contrast mean S C Normalization process yields the normalized cross-channel gradient mean S C ′: ; Wherein, min(S) C S represents the mean cross-channel contrast for all channels. C Minimum value, max(S) C S represents the mean cross-channel contrast for all channels. C The maximum value in the middle; Calculate the regional significance score S = w1 * S G ′+w2* S C ′; Where w1 and w2 are the significance scores weighted; c4: The region saliency score S corresponding to each feature sub-map F″ to be calculated is concatenated according to the original position to obtain the region saliency score S of feature map F′ with size H′×W′; c5: By bilinear interpolation, S is mapped back from H′×W′ to its original size H×W, resulting in a full-resolution saliency score map S∈[0,1]H×W. Then we obtain the region saliency score S corresponding to each pixel in the input feature map F.
3. The method for small target detection in UAV data according to claim 2, characterized in that: The significance scores are weighted by values of 0.7 and 0.3 for weights w1 and w2, respectively.
4. The method for small target detection based on UAV data according to claim 1, characterized in that: The calculation of the texture complexity score T specifically includes the following steps: d1: For the input feature map F∈R C×H×W First, downsampling is used to obtain the downsampled feature map F′∈R. C×H′×W′ ; d2: Downsampled feature map F ′, obtained by dividing by a sliding window. 2 Non-overlapping feature sub-maps F」∈R C ×H′ / n×W′ / n Then, calculate the information entropy corresponding to the feature sub-map F″ to be calculated; Quantize the pixel values within the feature sub-image F″ to be calculated as follows: K Given bins, obtain the probability distribution. P =[ p 1, p 2 , ..., pk, ..., pK ],in, pk The percentage of pixels in the k-th bin; Calculate the entropy E of the features within the region of the feature submap F". ; Calculate the mean entropy T of the feature subgraph F to be calculated and the whole graph. E : ; d3: Statistical LBP features; The downsampled feature map F′ is converted to grayscale to obtain the grayscale feature map F. gray : ; For the grayscale feature map F gray For each pixel (i′, j′), the corresponding LBP value is calculated; where the LBP value is a binary number. The number of LBP values included in each feature sub-map F″ to be calculated is denoted as N. LBP ; d4: The mean entropy T based on the full graph corresponding to F″ E Based on LBP features, the texture complexity score T corresponding to F" is calculated using the following method: The N corresponding to the full graph of F" LBP Normalization is performed to obtain the normalized LBP quantity value T. L : T L = N LBP / N max ; where N max For N LBP The maximum value; The mean entropy of the entire graph for F" is T E After normalization, the mean entropy of the entire graph is obtained as T. E ′: T E ′=(T E -min(T E )) / (max(T E )-min(T E )); where, min(T E ) represents the minimum value of the entropy of all valid local windows in F, max(T) E ) represents the maximum value of the entropy of all valid local windows; The texture complexity score T corresponding to the feature sub-map F″ to be calculated is 0.5 * T. E +0.5*T L ; d5: The texture complexity score T corresponding to each feature sub-map F″ to be calculated is concatenated in its original position to obtain the texture complexity score T of the feature map F′ with size H′×W′; By using bilinear interpolation, T is mapped back from H′×W′ to the original size H×W, resulting in a full-resolution texture complexity fraction map T∈[0,1]H×W; This yields the texture complexity score T for each pixel in the input feature map F.
5. The method for small target detection based on UAV data according to claim 1, characterized in that: Before step b4 is executed, the following steps also need to be performed: For each feature sub-image, based on the corresponding scale value s, it is determined that the feature sub-image needs to be padded before performing the pooling operation; padding = ceil ( (s- Sw) / 2); where ceil (.) is the floor function; If the calculated padding value is 0, then no padding operation is needed, and the feature submap is used as the feature submap to be processed. If the padding value is not 0, then a padding operation is performed on the feature sub-map to obtain a padded feature sub-map, which is then used as the feature sub-map to be processed.
6. The method for small target detection based on UAV data according to claim 1, characterized in that: In step S5, the target detection model is constructed by replacing the SPP module with the PLDP-SPP module based on YOLOv5s. The target detection model includes: a backbone network, a PLDP-SPP, a neck, and a detection head.
7. The method for small target detection in UAV data according to claim 6, characterized in that: The target detection model includes CSPDarknet53, PLDP-SPP, PANet and a detection head connected in sequence; The detection head performs multi-scale prediction and outputs feature maps at three different scales, corresponding to the detection of small, medium and large targets respectively; each detection head contains 3 convolutional layers, which output bounding box coordinates, confidence scores and class probabilities respectively.
8. The method for small target detection based on UAV data according to claim 1, characterized in that: The calculation method for the comprehensive score V is as follows: V = α*S + β*T; Here, α and β are hyperparameters.
9. The method for small target detection in UAV data according to claim 1, characterized in that: In step S2, the pooling operation mapping rule is as follows: If V ≥ 0.7, then the pooling scale = 1×1; If 0.3 < V < 0.7, then the pooling scale = 3 × 3; If V ≤ 0.3, then the pooling scale = 5×5.
10. The method for small target detection in UAV data according to claim 1, characterized in that: In step S3, based on the pooling operation mapping rule corresponding to the V value of the center pixel of the window, different pooling scales are dynamically matched to the features within each window region. This specifically includes the following steps: a1: For the input feature map, based on the pre-set feature map partitioning window, the input feature map is divided into non-overlapping feature sub-maps; Assume the size of the input feature map is F∈R C×H×W The feature map is split according to the channel, and then the feature map of each channel with a size of R×W is divided based on the partitioning window to obtain the feature sub-map; wherein, the partitioning window size is Sw×Sw, and the feature sub-map size is Sw×Sw; a2: For each feature sub-image, obtain the V value corresponding to the pixel located at the center of the window, find the pooling scale corresponding to the V value in the pooling operation mapping rule, and set it as the scale value s corresponding to the feature sub-image.
Citation Information
Patent Citations
Unmanned aerial vehicle small target detection method and system based on information enhancement and feature fusion
CN118196544A
Small target detection method for images acquired by unmanned aerial vehicle based on improved YOLOv8 algorithm
CN118628939A
Target detection method under view angle of unmanned aerial vehicle based on OSD-YOLO
CN120355894A
Unmanned aerial vehicle tiny target detection method based on SCCA-YOLO
CN120375243A
Multi-target traffic perception and intelligent detection method based on aerial photography of unmanned aerial vehicle
CN120689592A
Cited By
Aerial photography small target detection method and system based on YOLOv12n
CN122200431A