A 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 accuracy and stability issues of the YOLOv5s model in small target detection on UAVs were resolved, achieving high-precision, lightweight, and real-time detection results.
Patent Information
- Application Number
- CN202511488279.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-10-17
AI Technical Summary
Existing YOLOv5s models suffer from low accuracy and high false negative rate when detecting small targets in UAV images. They cannot effectively distinguish between target features and background interference features, especially in complex scenes where the false positive rate is high and they cannot capture local details in occluded areas. As a result, the detection accuracy cannot meet the needs of small target detection scenarios in all UAV data.
A feature content analysis module is constructed, which calculates a comprehensive score V using the regional saliency score S and the texture complexity score T. The pooling operation scale is dynamically adjusted, and the PLDP-SPP module is used to replace the SPP module in YOLOv5s to construct an object detection model, realizing dynamic pooling and weighted fusion of feature maps.
It improves the accuracy and stability of small target detection, reduces the false detection rate, is applicable to more complex scenarios, and achieves a balance between lightweight, high accuracy and real-time performance, making it suitable for small target detection in UAV data.
Smart Images

Figure CN120953859B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, and particularly to a small target detection method for unmanned aerial vehicle data. BACKGROUND
[0002] Unmanned aerial vehicle remote sensing technology has been widely used in many fields due to its high flexibility, wide coverage, and low data acquisition cost. However, there are many challenges in achieving small target detection based on image data collected by unmanned aerial vehicles. On the one hand, when the unmanned aerial vehicle flies at a high altitude, the target occupies a very small proportion in the image, and the pixel size in the image collected by the unmanned aerial vehicle is usually less than 32x32, which belongs to the "small target" category in the COCO standard. The difficulty of small target recognition leads to a lack of target feature information and easy confusion with background noise. On the other hand, there are problems such as attitude jitter, light changes, complex background interference (such as tree obstruction, building shadow) during the flight of the unmanned aerial vehicle, which further reduces the accuracy and stability of small target detection.
[0003] Early traditional small target detection methods rely heavily on manual feature extraction, such as SIFT and HOG. However, such methods have poor adaptability to complex scenes, are difficult to capture key features of small targets, and have slow detection speed, which cannot meet the needs of real-time data processing of unmanned aerial vehicles. With the development of deep learning technology, target detection algorithms based on convolutional neural networks have gradually become mainstream. In particular, the YOLO5s model has become a commonly used target detection model. Since YOLO5s uses a single-stage target detection framework, it means that it does not need to generate candidate regions (Region Proposals) like two-stage detectors (such as Faster R-CNN), and then classify and locate these regions. This process greatly simplifies the model structure and speeds up the processing. YOLOv5 can effectively detect targets of different scales by fusing feature maps at multiple levels of the network. For small targets, this multi-scale feature fusion capability is particularly important because it can capture subtle differences in the image, thereby more accurately identifying small targets.
[0004] However, in practice, it is found that the SPP module of YOLOv5s uses fixed scale pooling of "1x1 / 5x5 / 9x9 / 13x13", and still uses 9x9 / 13x13 large scale pooling for "high information density areas" where small targets are located, resulting in "over-aggregation" of small target features, loss of key contour and texture information, and ultimately only 21.5% accuracy for small targets and high false detection rate; YOLOv5s fixed scale pooling cannot dynamically distinguish between "target features" and "background interference features", and in complex scenes such as unmanned aerial vehicles, such as animals in forests, traffic signs in city streets, etc. Scene, it is easy to misdetect tree texture as "small animals" and misdetect billboard text as "traffic signs", and the false detection rate is usually more than 25%; for common scenes in unmanned aerial vehicle images, such as large target occluding small targets and background occluding small targets, such as tree branches occluding insulators on power lines, and weeds occluding trapped personnel, the YOLOv5s-SPP model cannot capture the local details of the occluded area, resulting in "missing frames" of the occluded target boundary box (such as only the unoccluded part of the insulator is framed), and the recognition integrity is less than 60%.
[0005] These problems all lead to the fact that the detection accuracy of YOLOv5s cannot meet the needs of all unmanned aerial vehicle data small target detection scenes. SUMMARY
[0006] In order to solve the problem that the target detection model based on YOLOv5s in the prior art cannot meet the accuracy needs of all unmanned aerial vehicle data small target detection scenes, the present application provides a small target detection method for unmanned aerial vehicle data, which can effectively improve the detection accuracy and at the same time achieve a better balance in the aspects of lightweight, high precision and real-time, and can be applied to more small target detection scenes.
[0007] The technical solution of the present application is as follows: a small target detection method for unmanned aerial vehicle data, characterized in that it comprises the following steps:
[0008] S1: constructing a feature content analysis module;
[0009] The feature content analysis module analyzes each pixel in the input feature map respectively, extracts the region saliency score S and texture complexity score T corresponding to each pixel, and then normalizes the region saliency score S and texture complexity score T to the interval [0, 1] to calculate the comprehensive score V corresponding to each pixel;
[0010] V = α*S + β*T;
[0011] Wherein, α and β are hyperparameters;
[0012] The region significance score S comprehensively reflects the possibility of the target region where the pixel is located as a semantic key area, and is calculated by weighted fusion of local gradient amplitude and local contrast;
[0013] The texture complexity score T reflects the richness of details of the features of the region where the pixel is located, and is calculated by fusion of local entropy and LBP feature diversity;
[0014] S2: setting different pooling operation mapping rules for different comprehensive scores V;
[0015] If V ≥ 0.7, then the pooling scale = 1×1;
[0016] If 0.3<V<0.7, then the pooling scale = 3×3;
[0017] If V ≤ 0.3, then the pooling scale = 5×5;
[0018] S3: constructing a size decision mechanism module;
[0019] 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 center pixel of the window; specifically comprising the following steps:
[0020] a1: for the input feature map, based on the pre-set window for feature map division, the input feature map is divided into non-overlapping feature subgraphs;
[0021] Assuming that 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 division window to obtain the feature subgraph; wherein the size of the division window is: Sw×Sw, and the size of the feature subgraph is Sw×Sw;
[0022] a2: for each of the feature subgraphs, obtain the V value corresponding to the pixel located at the center position 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 subgraph;
[0023] S4: constructing a PLDP-SPP module;
[0024] The PLDP-SPP module comprises, connected in sequence: a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations correspond to one of the pooling scales in the pooling operation mapping rule respectively;
[0025] The operations performed in the PLDP-SPP module specifically comprise the following steps:
[0026] b1: input feature maps are sent into the feature content analysis module and the size decision mechanism module respectively;
[0027] b2: the feature content analysis module outputs a comprehensive score V corresponding to each pixel in the input feature map;
[0028] b3: the size decision mechanism module splits the input feature map according to the channel, then obtains the feature subgraph through window splitting for the feature map of each channel, and then obtains the pooling scale s corresponding to each feature subgraph according to the V value of the center pixel point of the feature subgraph; and then sends each feature subgraph to the corresponding scale of the pooling operation;
[0029] b4: in the pooling operation, the feature subgraph to be processed with a window size of SwxSw is subjected to the pooling operation according to the scale value s, and the extracted feature vector is output;
[0030] All feature vectors output by the pooling operation are spliced in the original spatial order to obtain an output feature map with a size of HxW;
[0031] b5: after the three output feature maps corresponding to each channel are weighted and fused, the fused feature map is output according to the channel;
[0032] When the output feature map is fused, the output feature map corresponding to the 1x1 pooling output is multiplied by the weight ω1=0.7, the output feature map corresponding to the 3x3 pooling output is multiplied by the weight ω2=0.2, and the output feature map corresponding to the 5x5 pooling output is multiplied by the weight ω3=0.1;
[0033] S5: constructing a target detection model based on the LDP-SPP module;
[0034] S6: constructing a training data set and a verification data set; training the target detection model through the training data set to obtain a trained target detection model;
[0035] S7: deploying the trained target detection model on the unmanned aerial vehicle, taking the image collected by the image acquisition device on the unmanned aerial vehicle as a to-be-identified image, and sending the image into the trained target detection model to realize target identification.
[0036] Further features thereof are:
[0037] The method for calculating the regional saliency score S specifically includes the following steps:
[0038] c1: calculating the local gradient amplitude;
[0039] For input feature map F ∈ R C×H×W , down-sampling first to get feature map F' ∈ R C×H′×W′ ; divide the feature map F' with sliding window to get n 2 non-overlapping feature sub-maps F'' to be calculated, F'' ∈ R C×H′ / n×W′ / n ;
[0040] Wherein: C is the number of channels, H and W are high and wide, H'=H / 2, W'=W / 2;
[0041] c2: for each feature sub-map F'' to be calculated, use Sobel operator to calculate gradient respectively:
[0042] x direction gradient: G x =Sobel(F'', dx=1, dy=0);
[0043] y direction gradient: G y =Sobel(F'', dx=0, dy=1);
[0044] Calculate gradient amplitude G:
[0045] ;
[0046] Calculate single-channel gradient mean value:
[0047] ;
[0048] Wherein, c ∈ [1, C], i' ∈ [1, H' / n], j' ∈ [1, W' / n];
[0049] Calculate cross-channel gradient mean value S G :
[0050] ;
[0051] c3: local contrast calculation;
[0052] For each channel of the feature sub-map F'' to be calculated, calculate the difference between the maximum and minimum pixel gray scale in the region to get single-channel contrast C c : C c =max (F c ''(i', j'))-min(F c ''(i', j'));
[0053] Wherein, c ∈ [1, C], i' ∈ [1, H' / n], j' ∈ [1, W' / n];
[0054] For each feature sub-map F'' to be calculated, calculate the cross-channel contrast mean value S C :
[0055] ;
[0056] c3: Mean of cross-channel gradient 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;
[0057] The cross-channel gradient mean S G Normalization process yields the normalized cross-channel gradient mean S G ′:
[0058] ;
[0059] 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;
[0060] The cross-channel contrast mean S C Normalization process yields the normalized cross-channel gradient mean S C ′:
[0061] ;
[0062] 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;
[0063] Calculate the regional significance score S = w1 * S G ′+w2* S C ′;
[0064] Where w1 and w2 are the significance scores weighted;
[0065] 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′;
[0066] 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,
[0067] Then we obtain the region saliency score S corresponding to each pixel in the input feature map F;
[0068] The significance scores are weighted by values of 0.7 and 0.3 for weights w1 and w2, respectively.
[0069] The calculation of the texture complexity score T specifically includes the following steps:
[0070] 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′ ;
[0071] 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;
[0072] 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;
[0073] Calculate the entropy E of the features within the region of the feature submap F". ;
[0074] Calculate the mean entropy T of the feature subgraph F to be calculated and the whole graph. E : ;
[0075] d3: Statistical LBP features;
[0076] The downsampled feature map F′ is converted to grayscale to obtain the grayscale feature map F. gray : ;
[0077] 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.
[0078] The number of LBP values included in each feature sub-map F″ to be calculated is denoted as N. LBP ;
[0079] 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:
[0080] The N corresponding to the full graph of F" LBP Normalization is performed to obtain the normalized LBP quantity value T. L :
[0081] T L = N LBP / N max ; where N max For N LBP The maximum value;
[0082] 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 ′:
[0083] 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;
[0084] The texture complexity score T corresponding to the feature sub-map F″ to be calculated is 0.5 * T. E +0.5*T L ;
[0085] 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′;
[0086] By using bilinear interpolation, T is mapped back from H′×W′ to the original size H×W, resulting in the full-resolution texture complexity score T∈[0,1]H×W;
[0087] Then we obtain the texture complexity score T for each pixel in the input feature map F;
[0088] Before step b4 is executed, the following steps also need to be performed:
[0089] 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;
[0090] padding = ceil ( (s- Sw) / 2);wherein ceil(.) is a ceiling function;
[0091] If the padding value is calculated as 0, no padding operation is needed, and the feature subgraph is taken as a feature subgraph to be processed.
[0092] If the padding value is not 0, a padding operation is performed on the feature subgraph to obtain a padded feature subgraph, and the padded feature subgraph is taken as a feature subgraph to be processed.
[0093] In step S5, the PLDP-SPP module is replaced with the SPP module based on YOLOv5s to construct the target detection model.
[0094] The target detection model comprises a backbone network, a PLDP-SPP, a neck, and a detection head.
[0095] The target detection model comprises a CSPDarknet53, a PLDP-SPP, a PANet, and a detection head connected in sequence.
[0096] The detection head performs multi-scale prediction to output three feature maps of different scales, which correspond to detection of small, medium, and large targets, respectively. Each detection head comprises three convolution layers to output, respectively, a bounding box coordinate, a confidence, and a class probability.
[0097] 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
[0098] Figure 1 This is a schematic diagram of the PLDP-SPP module.
[0099] Figure 2 This is an example of an object detection model. Detailed Implementation
[0100] This application includes a method for small target detection in drone data, which includes the following steps.
[0101] S1: Construct a feature content analysis module.
[0102] The method sets a region saliency score S and a texture complexity score T as quantitative indexes of reflecting the value of the region information, and also as the basis for subsequent scale decision.
[0103] The region saliency score S comprehensively reflects the possibility of the target region where the pixel is as a semantic key area, and is calculated by weighted fusion of the local gradient amplitude and the local contrast. To avoid increasing too much calculation, the method first performs 1 / 2 down-sampling on the input feature map, calculates the above indexes on the low-resolution feature map, and then maps the result back to the original resolution through bilinear interpolation. This method has almost negligible precision loss, but the calculation amount can be reduced by 4 times, which can effectively improve the calculation efficiency. The calculation method of the region saliency score S specifically includes the following steps.
[0104] c1: calculating the local gradient amplitude;
[0105] For the input feature map F∈R C×H×W , 1 / 2 down-sampling is first performed to obtain a feature map F'∈R C×H′×W′ ; the feature map F' is divided by a sliding window to obtain n 2 non-overlapping feature sub-maps F'' to be calculated, F''∈R C×H′ / n×W′ / n .
[0106] Wherein: C is the channel number, H and W are the height and width, H'=H / 2, W'=W / 2;
[0107] The specific value of n is set according to the calculation accuracy. In this embodiment, n is set to 5. The size of the down-sampled feature map F' is H'xW', for example, when the input F is 512x20x20, the down-sampled 1 / 2 F' is 512x10x10, i.e. H'=10, W'=10; the size of each non-overlapping feature sub-map F'' to be calculated is (H' / n)x(W' / n), and in specific applications, H' and W' should be divisible by n to avoid inconsistent sub-map sizes; the total number of sub-maps is n x n (for example, when n=10, the 10x10 F' is divided into 10x10=100 1x1 sub-maps; when n=5, it is divided into 5x5=25 2x2 sub-maps.
[0108] c2: for each feature sub-map F'' to be calculated, the Sobel operator is used to calculate the gradient:
[0109] The x-direction gradient is G x =Sobel(F'', dx=1, dy=0);
[0110] The y-direction gradient is G y =Sobel(F'', dx=0, dy=1);
[0111] Compute gradient magnitude G:
[0112] ;
[0113] Compute single-channel gradient mean C:
[0114] ;
[0115] where c∈[1,C], i'∈[1,H' / n], j'∈[1,W' / n];
[0116] Compute cross-channel gradient mean S G :
[0117] .
[0118] Gradient magnitude is an index to measure the rate of change of pixel intensity in image processing, which represents the intensity change of the image at a specific location. For multi-channel images, regions with higher cross-channel gradient mean usually contain more significant feature information.
[0119] c3: Local contrast calculation;
[0120] For feature maps, regions with high contrast usually correspond to more important feature activations, which can help the model focus on key information.
[0121] For each channel of the feature subgraph F to be calculated, calculate the difference between the maximum and minimum gray values of the pixel (i', j') in the region to obtain the single-channel contrast C c : C c =max (F c 〞(i', j'))-min(F c 〞(i', j'));
[0122] where c∈[1,C], i'∈[1,H' / n], j'∈[1,W' / n].
[0123] For each feature subgraph F to be calculated, calculate the cross-channel contrast mean S c :
[0124] .
[0125] c3: Normalize and weight fusion of cross-channel gradient mean S G and cross-channel contrast mean S C , and calculate the region saliency score S corresponding to the feature subgraph F to be calculated;
[0126] S = (S GNormalization process yields the normalized cross-channel gradient mean S G ′:
[0127] ;
[0128] 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;
[0129] The cross-channel contrast mean S C Normalization process yields the normalized cross-channel gradient mean S C ′:
[0130] ;
[0131] 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.
[0132] Calculate the regional significance score S = w1 * S G ′+w2* S C ′;
[0133] 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.
[0134] 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′.
[0135] 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.
[0136] 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.
[0137] 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′ .
[0138] The information entropy of a feature map is an index for measuring the uncertainty of pixel value distribution in the feature map, and is usually used to quantify the complexity or information amount of the feature map. A high entropy value indicates that the randomness of the feature map distribution is strong and the texture is complex, such as a small target focus area. A low entropy value indicates that the feature map distribution is concentrated and the structure is simple, such as a solid color background.
[0139] d2: downsampling feature map F F′, divide it into n 2 non-overlapping feature subgraphs F〞∈R C×H′ / n×W′ / n Then, the information entropy corresponding to the feature subgraph F〞to be calculated is calculated. The specific method is as follows:
[0140] The pixel values in the feature subgraph F〞to be calculated are quantized into K K bins (histogram columns). The specific value of K is set according to the calculation accuracy. In this embodiment, K is set to 16.
[0141] The probability distribution P [ p 1, p 2 , ..., pk, ..., pK ] is obtained, where pk is the pixel proportion of the kth bin.
[0142] The entropy E of the features in the feature subgraph F〞to be calculated is calculated as follows:
[0143] The average T of the feature subgraph F〞to be calculated is calculated as follows: E .
[0144] d3: statistic LBP feature; LBP feature is usually used to reflect the texture information of a region.
[0145] The downsampling feature map F′ is grayed by taking the channel average, and the grayed feature map F gray is obtained.
[0146] ;
[0147] The LBP (Local Binary Pattern) value corresponding to each pixel point (i′, j′) of the grayed feature map F gray is calculated. The number of types of LBP values included in each feature subgraph F〞to be calculated is counted and denoted as N LBP .
[0148] Wherein, the LBP value is a binary number. The specific calculation method of the LBP feature is realized according to the prior art. In the embodiment, the original LBP operator is defined, each pixel point is taken as a center pixel, and the gray values of the 8-neighborhood pixels and the center pixel are compared. If the neighborhood pixel is greater than or equal to the center point, it is marked as 1, otherwise it is marked as 0. An 8-bit binary LBP feature value is generated for each center pixel point.
[0149] The number N of LBP values LBP represents how many different LBP values are present in the feature subgraph F''. For example, if the LBP values corresponding to all pixel points in F'' only include 00000000, 00011111 and 00011111, then N LBP = 3. In terms of the method of calculating the LBP value based on the 8-neighborhood pixels, the LBP value can have a maximum of 2 8 = 256 possible values, i.e. N LBP = 256. The higher the value of N max , the higher the image complexity. LBP
[0150] d4: the average entropy T of the whole F'' E and the LBP feature, the texture complexity score T corresponding to F'' is calculated, and the specific method is as follows:
[0151] The N LBP of the whole F'' is normalized to obtain the normalized LBP quantity value T L :
[0152] T L = N LBP / N max =N LBP / 256;
[0153] The average entropy T E of the whole F'' is normalized to obtain the normalized average entropy T E ' of the whole image:
[0154] T E '= (T E -min(T E )) / (max(T E )-min(T E )); wherein min(T E ) is the minimum value of the entropy values of all effective local windows in F'', and max(T E ) is the maximum value of the entropy values of all effective local windows.
[0155] The texture complexity score T corresponding to the feature subgraph F'' to be calculated is 0.5* TE + 0.5 * T L .
[0156] The texture complexity of the feature map is derived from the texture of the original input image. The more intensive and detailed the image texture is, the higher the local window entropy value of the corresponding feature map is, and the larger max(T E ) is; otherwise, min(T E ) is smaller. For example, if the input image is a “forest scene”, the features are leaf and branch textures, and the pixel value distribution in the 3x3 window of the feature map is dispersed (after quantization, covering multiple bins), the window entropy value is high, max(T E ) can reach 6~8, and min(T E ) can be 2~3. If the input image is “solid color background + small target”, such as a bird in a blue sky, the window pixel value of the background area of the feature map is concentrated (after quantization, covering only 1~2 bins), the entropy value is low, min(T E ) can be close to 0, and max(T E ) is only 3~4 (only the target area has a high entropy value). At the same time, the feature map F' is a multi-channel down-sampling result, different channels correspond to different semantics (such as edge detection, color, texture), and the strength of the channel response will also affect the window entropy value distribution. In the window feature value discretization step, K is the number of bin quantization of the pixel value (such as K=16 in the previous text), and the size of K will affect the calculation range of the window entropy value, indirectly changing the values of max(T E ) and min(T E ).
[0157] d5: The texture complexity score T corresponding to each to-be-calculated feature sub-map F'' is spliced according to the original position to obtain the texture complexity score T of the feature map F' with a size of H'xW';
[0158] The T is mapped back to the original size HxW through bilinear interpolation to obtain the full-resolution texture complexity score T∈[0,1]HxW;
[0159] Then the texture complexity score T corresponding to each pixel point in the input feature map F is obtained.
[0160] The method is based on "saliency score + texture complexity score" to constitute a quantitative index, and designs the decision logic of subsequent dynamic pooling operation, and maps the quantitative index to a specific pooling scale, such as 1x1, 7x7, and 15x15. Specifically, the method divides the index interval by a preset threshold, and each interval corresponds to a fixed pooling scale. Because the threshold-based rule decision form has 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 unmanned vehicle scenes.
[0161] The feature content analysis module analyzes each pixel in the input feature map respectively, extracts the regional saliency score S and the texture complexity score T corresponding to each pixel, and then normalizes the regional saliency score S and the texture complexity score T to the interval [0, 1] to obtain the comprehensive score V corresponding to each pixel.
[0162] V = α*S + β*T;
[0163] Wherein, α and β are hyperparameters. The specific values of α and β can be determined by cross-validation. In the embodiment, α = 0.6 and β = 0.4, which can preferentially ensure the details of the target region.
[0164] S2: Set different pooling operation mapping rules for different comprehensive scores V;
[0165] If V ≥ 0.7, the pooling scale = 1x1, corresponding to high information value, such as target core area;
[0166] If 0.3 < V < 0.7, the pooling scale = 3x3, corresponding to medium information value, such as target edge and small background texture;
[0167] If V ≤ 0.3, the pooling scale = 5x5, corresponding to low information value, such as large area background.
[0168] The specific pooling scale can be set according to the detection needs. Because the method mainly aims at the identification of small targets in the data collected by the unmanned vehicle, the pooling scale is set to 1x1, 3x3, and 5x5.
[0169] In the method, different pooling operations are set for different comprehensive scores V to provide a clear reference for subsequent dynamic pooling operations, so that the pooling scale of each feature subgraph in the dynamic pooling operation can be determined without complex calculation, thereby improving the calculation efficiency. At the same time, through the pooling operation mapping rule, it is also ensured that the feature subgraph in each window only needs to perform one most suitable pooling operation, which further reduces the calculation complexity and the calculation amount.
[0170] S3: Construct a size decision mechanism module.
[0171] The size decision mechanism module divides the input feature map into non-overlapping window regions of a specified size, dynamically matches different pooling scales for the features in each window region according to the mapping rule of the pooling operation corresponding to the V value of the center pixel of the window; and specifically includes the following steps.
[0172] a1: For the input feature map, the input feature map is divided into non-overlapping feature subgraphs based on the pre-set window for feature map division;
[0173] Suppose the size of the input feature map is F ∈ R C×H×W , the feature map is split by channel, and then the feature map of each channel with a size of R × W is divided based on the division window to obtain a feature subgraph; wherein the size of the division window is: Sw × Sw, and the size of the feature subgraph is Sw × Sw.
[0174] In this embodiment, the size of the input feature map H × W is 20 × 20, and the 20 × 20 feature map is divided into non-overlapping windows of a fixed size. The window size is strongly bound to the output resolution. For a 20 × 20 input, Sw = 2 is selected, i.e., a 2 × 2 window is used, and no additional padding is required. A total of 10 × 10 windows are divided, each window corresponding to a 2 × 2 pixel region of the output feature map. A uniform dynamic pooling scale is used in each window, and "window pooling + resolution restoration" is used to ensure that the output is 20 × 20.
[0175] For a 20 × 20 input, Sw = 2 is selected, i.e., a 2 × 2 window is used, and no additional padding is required. A total of 10 × 10 windows are divided, each window corresponding to a 2 × 2 pixel region of the output feature map. The pooling results of the final 10 × 10 windows are spliced into a 20 × 20 output.
[0176] a2: For each feature subgraph, the V value corresponding to the pixel located at the center position of the window is obtained, the pooling scale corresponding to the V value in the pooling operation mapping rule is found, and it is set as the scale value s corresponding to the feature subgraph.
[0177] In a specific implementation, the window division method is: using the unfold operator to expand the input feature map (B, 512, 20, 20) according to a 2*2 window and a step of 2, to obtain a window tensor with a shape of (B, 512*2*2, 10*10); wherein 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 8 images are processed simultaneously in the current batch; after forward propagation, each image generates one feature map of (512, 20, 20), so the shape of the entire input feature map is (8, 512, 20, 20). Batch processing samples can fully utilize the parallel computing capability of the GPU, improving the training / inference efficiency; in dynamic pooling, all operations (window division, pooling, and splicing) are “synchronously executed” on the feature maps of B samples, and the final output still maintains the shape of (B, 512, 20, 20), ensuring the consistency of processing all samples in the batch.
[0178] Scale assignment: for the dynamic scale map of 1*20*20, the scale value of the center pixel is taken according to a 2*2 window and a step of 2. The scale corresponding to the pixel at the center (1, 1) position of each 2*2 window is taken to avoid edge deviation, to obtain a window scale tensor of 1*1*10*10, wherein each window corresponds to one scale value s.
[0179] Performing pooling according to window scale in subsequent dynamic pooling operation: for each window (a total of 10*10), according to the corresponding scale value s, s*s adaptive pooling is performed, and the pooling result is reshaped to 2*2 size to match the output window resolution.
[0180] S4: constructing a PLDP-SPP module.
[0181] Wherein, PLDP is Pixel-adaptive Local Dynamic Pooling, pixel adaptive local dynamic pooling; SPP is Spatial Pyramid Pooling, spatial pyramid pooling.
[0182] As shown in Figure 1 , the PLDP-SPP module includes, connected in turn: a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations correspond to one of the pooling scales in the pooling operation mapping rule.
[0183] The operations performed in the PLDP-SPP module specifically include the following steps:
[0184] b1: input feature maps are sent into the feature content analysis module and the size decision mechanism module, respectively.
[0185] b2: The feature content analysis module outputs the comprehensive score V corresponding to each pixel in the input feature map.
[0186] 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.
[0187] 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.
[0188] Before step b4 is executed, the following steps also need to be performed:
[0189] 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.
[0190] padding = ceil ( (s- Sw) / 2); where ceil (.) is the floor function;
[0191] 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.
[0192] 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.
[0193] 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.
[0194] Adaptive pooling: call torch.nn.functional.adaptive_max_pool2d (or average pooling) to pool the 2x2 window features into 1x1 (kernel size sxs, stride 1), then interpolate (bilinear interpolation) to restore 1x1 to 2x2, so that the result matches the 2x2 window size, and the pooling result of the window (B, 512, 2, 2) is obtained.
[0195] Example 1: suppose the center pixel V of a 2x2 window in the dynamic scale map is 0.8 (>=0.7), according to the scale mapping rule, the pooling scale s of the window is 1x1.
[0196] Feature map window: a 2x2 window is divided from the input feature map (B, 512, 20, 20), which is unfolded into (B, 512x2x2, 1) and reshaped into (B, 512, 2, 2).
[0197] Dynamic scale adaptation: calculate padding = (s-2) / 2 = (1-2) / 2 = -0.5, and take the upper integer as 0, so no padding is needed.
[0198] Adaptive pooling is:
[0199] Directly perform 1x1 adaptive max pooling on (B, 512, 2, 2) features (kernel = 1x1, stride = 1), and the output shape is (B, 512, 1, 1). Restore (B, 512, 1, 1) to (B, 512, 2, 2) by bilinear interpolation to match the window output size.
[0200] The (B, 512, 2, 2) result of this window is spliced with other windows in spatial order to become the high-detail feature of the corresponding 2x2 region in the output feature map. Because the 1x1 pooling operation preserves the original information for the target core.
[0201] Example 2: suppose the center pixel V of a 2x2 window in the dynamic scale map is 0.5 (0.3
[0202] Feature map window: also divide a 2x2 window from the input, and reshape it into (B, 512, 2, 2).
[0203] Scale allocation: the scale tensor value s of this window is 3.
[0204] Dynamic scale adaptation: padding = (3-2) / 2 = 0.5, rounding up to 1, padding 1 layer 0. Perform padding=1 on (B, 512, 2, 2) feature to get (B, 512, 4, 4), then pad 1 layer 0 on top, bottom, left and right to avoid feature offset based on symmetric padding.
[0205] Adaptive pooling: perform 3x3 pooling (kernel = 3x3, stride = 1) on (B, 512, 4, 4) to get (B, 512, 2, 2). Because 4x4 input is 3x3 pooled (stride 1), the output size is 4-3+1=2, which exactly meets the 2x2 requirement. Therefore, no interpolation is needed to supplement the window size.
[0206] The (B, 512, 2, 2) result of the window in this embodiment is spliced to become the medium abstract feature of the corresponding region in the output feature map, because the 3x3 pooling operation balances details and redundancy for the target edge region.
[0207] Embodiment 3: Assuming that the center pixel V of a certain 2x2 window in the dynamic scale map is 0.2 (≤0.3), according to the scale mapping rule, the pooling scale s of the window is 5x5.
[0208] Feature map window: divide into 2x2 window, reshape into (B, 512, 2, 2).
[0209] Scale allocation: the scale tensor value s of the window is 5.
[0210] Dynamic scale adaptation: padding = (5-2) / 2 = 1.5, rounding up to 2, then padding 2 layers of 0. Perform padding=2 on (B, 512, 2, 2) feature to get (B, 512, 6, 6), then pad 2 layers of 0 on top, bottom, left and right to avoid feature offset based on symmetric padding.
[0211] Adaptive pooling: perform 5x5 pooling (kernel = 5x5, stride = 1) on (B, 512, 6, 6) to get (B, 512, 2, 2). Because 6x6 input is 5x5 pooled (stride 1), the output size is 6-5+1=2, which exactly meets the window size 2x2 requirement, so no interpolation is needed to supplement.
[0212] The (B, 512, 2, 2) result of the window in this embodiment is spliced to become the high compression feature of the corresponding region in the output feature map, because the 5x5 pooling operation compresses the redundant information for the background region.
[0213] b4: In the pooling operation, the to-be-processed feature subgraph with a window size of SwxSw is pooled according to a scale value s, and a feature vector extracted is output.
[0214] All feature vectors output by the pooling operation are concatenated in the original spatial order to obtain an output feature map with a size of HxW.
[0215] In this embodiment, the input feature map HxW is 20x20, and therefore the pooling results of 10x10 windows (each being B, 512, 2, 2) are concatenated in the original spatial order as follows:
[0216] First, the 10 2x2 windows are horizontally concatenated into 2x20 (2x(2x10)) along the width dimension (W).
[0217] Then, the 10 rows of 2x20 features are vertically concatenated into 20x20 along the height dimension (H).
[0218] Finally, an output feature map with a shape of (B, 512, 20, 20) is obtained, which is completely consistent with the input resolution.
[0219] b5: After weighted fusion of the three output feature maps corresponding to each channel, the fused feature map is output according to the channel.
[0220] When the output feature map is fused, the output feature map corresponding to the 1x1 pooling output is multiplied by the weight ω1=0.7, the output feature map corresponding to the 3x3 pooling output is multiplied by the weight ω2=0.2, and the output feature map corresponding to the 5x5 pooling output is multiplied by the weight ω3=0.1.
[0221] In this embodiment, the three 512*20*20 feature maps are fused by weighted averaging, wherein the 1x1 pooling output has a weight ω1=0.7, the 3x3 pooling output has a weight: =0.2, and the 5x5 pooling output has a weight: =0.1.
[0222] The application further strengthens the dominant position of high information regions by weighting fusion after three scale pooling operations and splicing the features extracted by the three pooling operations, and fully achieves the design goal of scale mapping rules. The PLDP-SPP module in the scheme not only retains the advantages of dynamic perception, but also controls the computational complexity through the sliding window design. Based on the window division rule, the same scale window can be processed in batches, for example, multiple windows are all 3x3 pooled, and the calculation can be combined, and the calculation amount is only increased by 10%-15% compared with the traditional SPP. Real-time inference can be realized on GPU through parallel acceleration; for the input image HxW through window division, the size of the window can be controlled according to the specific requirements of the computing resources and real-time performance of the unmanned aerial vehicle in the specific application scene, so as to avoid too fine window division, and it is suitable for tasks with limited computing resources and sensitive to latency such as real-time target detection and image classification.
[0223] The PLDP-SPP module constructed in the application can be applied in multi-scale feature extraction and realize the scene with feature and global feature fusion. The feature content analysis module, size decision mechanism module and dynamic pooling operation in the module can also be applied alone or in combination in different scenes. In the embodiment, the PLDP-SPP module is applied in the YOLOv5s model to improve the performance of YOLOv5s for small target detection.
[0224] S5: Constructing a target detection model based on the PLDP-SPP module.
[0225] The model design of YOLOv5s is based on the classic YOLO framework, and its core structure includes three parts of backbone network, neck network and detection head. The architecture of YOLOv5s follows the design logic of "feature extraction - feature fusion - multi-scale prediction".
[0226] The application replaces the SPP module with the PLDP-SPP module based on YOLOv5s to construct a target detection model. As shown in Figure 2 The target detection model includes a backbone network, a PLDP-SPP module, a neck and a detection head. Specifically, the target detection model in the embodiment includes CSPDarknet53, PLDP-SPP, PANet and a detection head connected in sequence. The detection head performs multi-scale prediction and outputs three feature maps of different scales, which correspond to detection of small, medium and large targets respectively. Each detection head includes 3 convolution layers, which respectively output bounding box coordinates, confidence and class probability. In the embodiment, the output scales of the three detection heads are, for example, 80x80, 40x40 and 20x20.
[0227] The backbone network CSP Darknet53 consists of 5 stages, each of which contains multiple C3 modules. The C3 module adopts a cross-stage partial (CSP) connection to divide the input features into two parts, one of which is directly passed on, and the other is combined after residual connection, effectively reducing the amount of calculation and enhancing gradient propagation. Specifically, the C3 module structure contains 3 convolutional layers and 1 cross-stage partial (CSP) connection, in which two branches process the features of part of the channels respectively, and are finally combined.
[0228] In which, Stage 1: Focus layer (slice operation + convolution) reduces the input size by half and doubles the number of channels. Stage 2-5: Each stage contains different numbers of C3 modules, gradually reducing the size of the feature map (such as from 640×640 to 20×20), while increasing the number of channels (such as from 64 to 1024). syncbn_fast optimization: The syncbn_fast in the configuration file enables synchronous BN (cross-GPU synchronization statistics) and lightweight convolution, improving the stability of multi-card training and the speed of inference.
[0229] The method uses the PLDP-SPP module to replace the SPP in YOLOv5s. Through the dynamic multi-scale pooling perception module PLDP-SPP, the maximum pooling quickly fuses multi-scale context information, which can more efficiently preserve key details and extract global context information, making the detection result more accurate. In the PLDP-SPP module, the input features are first processed by the dynamic multi-scale pooling perception module, outputting three 512*20*20 feature information maps, and then the feature maps are fused by weighted averaging, and finally output through 1×1 convolution.
[0230] The path aggregation network PANet fuses deep semantic information and shallow location information through upsampling and horizontal connection. For example, the feature map of Stage 5 (20×20) is upsampled to 40×40 and added to the feature map of Stage 4, and then further processed by the C3 module.
[0231] Three detection heads perform multi-scale prediction, outputting three feature maps of different scales (such as 80×80, 40×40, 20×20), respectively detecting small, medium, and large targets. Each detection head contains 3 convolutional layers, which respectively output: bounding box coordinates, confidence, and class probability;
[0232] In which, the bounding box coordinates include 4 values; the confidence includes 1 value; the class probability, such as: for the COCO dataset, an 80-dimensional classification probability vector is designed.
[0233] The designed PLDP-SPP module, the dynamic multi-scale pooling perception module, replaces the SPP module, ensures that the input feature map and the output feature map size are consistent with the original SPP module, controls the amount of calculation through the dynamic multi-scale pooling perception module, and reduces the amount of calculation in feature content analysis by performing 1 / 2 downsampling on the input feature map.
[0234] S6: Construct a training data set and a verification data set; train the target detection model through the training data set to obtain a trained target detection model. The construction method of the specific training set and the verification set and the training method are realized based on the prior art.
[0235] S7: Deploy the trained target detection model on the unmanned aerial vehicle, take the image collected by the image acquisition device on the unmanned aerial vehicle as the to-be-identified image, and send it into the trained target detection model to realize target identification.
[0236] In this embodiment, the configuration file parameter mapping is as follows:
[0237] 8xb16 in yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py represents that the batch size of each GPU is 16, and the total batch size is 8x16=128. 300e represents training for 300 epochs, and a cosine annealing learning rate scheduler is used.
[0238] Main network parameters: depth_multiple=0.33: control the number of repetitions of the C3 module (such as n=1 for 1 repetition); width_multiple=0.5: control the scaling ratio of the channel number (such as the basic channel number 64 becomes 32).
[0239] Neck network parameters: spp_size=[1, 3, 7]: the pooling kernel size of the PDLP-SPP module; num_features=3: output 3 scale feature maps.
[0240] Training hyperparameters: sync_bn=True: enable synchronous BN, suitable for multi-GPU training. fast_forward=True: simplify part of the calculation process to improve inference speed.
[0241] In order to verify the performance of the PLDP-SPP module in the present application, a target detection model constructed by replacing the SPP in YOLOv5s with the PLDP-SPP module in the present application is compared with YOLOv5s-SPP in the comparative experiment. The target detection model in the present application introduces dynamic perception pooling in YOLOv5s, and the original YOLOv5s-SPP model is fixed scale pooling. Based on the COCO 2017 dataset (118k images in the training set, 5k images in the validation set, containing 80 target classes), by controlling the consistent training hyperparameters (input size 640x640, optimizer AdamW, learning rate 0.001, epoch 300, IoU threshold 0.5), the core indicators of YOLOv5s-PLDP-SPP (improved version introducing dynamic perception pooling) and YOLOv5s-SPP (original fixed scale pooling) are compared. Specifically, as shown in Table 1 below. Table 1 is the comparison of key indicators of the two models on the COCO validation set.
[0242] Table 1: Comparison of key indicators
[0243]
[0244] Among them, AP (Average Precision) is the core precision indicator, AP 50 (AP when IoU=0.5) reflects the coarse-grained detection ability, AP 75 (AP when IoU=0.75) reflects the fine-grained detection ability, AP s / AP m / AP l Corresponding to the detection accuracy of small (area < 32²), medium (32²≤area≤96²), and large (area > 96²) targets, respectively; FPS reflects the inference speed; the parameter amount reflects the lightweight degree of the model.
[0245] From the data in Table 1, it can be seen that:
[0246] Overall precision improvement of PLDP-SPP: AP improves by 2.6 percentage points, AP 50 improves by 2.8 percentage points, and AP 75 improves by 3.4 percentage points, indicating that PLDP-SPP has significantly optimized the "positioning accuracy" and "boundary box fitting degree" of the target, and 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.
[0247] Small target detection breakthrough of PLDP-SPP: AP sThe improvement of 4.3 percentage points (from 21.5 to 25.8) is the most significant among all indicators. The core reason is that PLDP-SPP automatically adopts 1x1 / 3x3 small-scale pooling in the "high information density area" where small targets are located, retaining more detailed features. The original SPP uniformly uses 1x1 / 5x5 / 9x9 / 13x13 pooling in all areas, and large-scale pooling easily leads to "over-aggregation" of small target features, losing key discriminative information (such as small target outlines and textures).
[0248] Medium target precision optimization of PLDP-SPP: AP m The improvement of 3.3 percentage points (from 41.3 to 44.6) is due to the use of 3x3 medium-scale pooling in the "edge transition area" of medium targets (such as the junction of targets and background) by PLDP-SPP, balancing local details and contextual association. The fixed scale of the original SPP cannot adapt to the "scale fluctuations" of medium targets (such as size differences among the same type of medium targets), leading to missed or false detections of some medium targets.
[0249] Robustness of large target precision of PLDP-SPP: AP l The improvement of 1.4 percentage points (from 49.8 to 51.2) is relatively small, but still reflects the advantage: PLDP-SPP uses 5x5 large-scale pooling in the "low information density background area" of large targets, more efficiently capturing global context. Although the large-scale pooling (9x9 / 13x13) of the original SPP can cover large targets, it has "redundant calculations" and is less precise than PLDP-SPP in retaining local details of large targets.
[0250] Speed and parameter balance of PLDP-SPP: Parameter quantity only increases by 0.3M (from 7.2 to 7.5), as the dynamic decision module (lightweight feature analysis + rule-based scale decision) of PLDP-SPP has very few parameters, without additional heavyweight networks, fully adapting to the memory limit of <10M for unmanned aerial vehicle embedded devices. The FPS drops by 13 frames (from 128 to 115), but still meets the real-time detection requirement (>100 FPS). The reason for the drop is that the "regional scale adaptation" of dynamic pooling requires a small amount of additional calculation, which can be further reduced through GPU parallel optimization (such as batch processing of the same scale area) in practical applications. PLDP-SPP achieves a 2.6 percentage point improvement (from 37.2% to 39.8%) in the core precision indicator, AP, with minimal speed cost, achieving a good balance between precision and efficiency.
[0251] Through the typical scenes in the COCO dataset, such as small target dense scenes, complex background scenes, and large target occlusion scenes, comparisons are made.
[0252] For small target dense scenes, such as “crowd, flock of birds”:
[0253] YOLOv5s-SPP: The detection rate of dense small targets (such as heads in crowds, birds in the sky) is relatively high, and some small targets are “diluted” by large-scale pooling, making them unable to be correctly identified; the boundary box offset is obvious. For example, the head boundary box of a small target only covers part of the area.
[0254] YOLOv5s-PLDP-SPP: The detection rate is reduced by about 30%, and the boundary box of the small target is significantly improved. Dynamic pooling preserves the details of small target areas, allowing 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.
[0255] For complex background scenes, such as “urban streets, forest animals”:
[0256] YOLOv5s-SPP: In complex backgrounds (such as billboards on the street, leaves in the forest), it is easy to misidentify background textures as targets (such as misidentifying billboard text as “traffic signs” and leaves as “small animals”), and fixed-scale pooling cannot effectively distinguish “target features” from “background interference features”.
[0257] YOLOv5s-PLDP-SPP: The misidentification rate is reduced by about 25%, and dynamic pooling uses large-scale pooling for background areas to suppress redundant interference features; small-scale pooling is used for target areas to strengthen target discrimination features (such as animal limb outlines and specific shapes of traffic signs), achieving accurate separation of “target-background”.
[0258] For large target occlusion scenes, such as “occluded cars, pedestrians”:
[0259] YOLOv5s-SPP: The occluded part of the large target (such as the body of a car obscured by trees, the legs of a pedestrian obscured by a backpack) is not fully recognized, and the boundary box is prone to “missing” (such as only framing the unobscured head of the car), and fixed large-scale pooling cannot capture local details in the occluded area.
[0260] YOLOv5s-PLDP-SPP: The dynamic pooling uses 3x3 medium-scale pooling for the occluded area (belongs to the "medium information density area"), which retains the detailed features of the occluded edge (such as the occluded shadow of the car body and the outline of the pedestrian's leg), so that the model can "complete" the bounding box of the occluded target. Through the adaptation of the dynamic pooling to the feature density of different areas, it not only solves the problem of "over-aggregation" of small target features (AP s increases by 4.3 percentage points), but also suppresses background interference (the false detection rate of complex scenes decreases by 25%), and uses 3x3 medium-scale pooling for the occluded area, which improves the recognition integrity by 20%.
[0261] From the comparison of the core quantitative indicators, YOLOv5s-PLDP-SPP is better than YOLOv5s-SPP in terms of AP, AP 50 , AP 75 , APs, AP m , AP l and other indicators. In the small target dense scene, the false detection rate of YOLOv5s-PLDP-SPP decreases by about 30%, because the dynamic pooling retains more detailed features in the small target area, so that the model can distinguish the individual differences of dense small targets. In the complex background scene, the false detection rate of YOLOv5s-PLDP-SPP decreases by about 25%, because the dynamic pooling uses large-scale pooling for the background area, which suppresses the redundant interference features, and uses small-scale pooling for the target area, which strengthens the target discrimination features. In the large target occlusion scene, the recognition integrity of YOLOv5s-PLDP-SPP for the occluded area improves by about 20%, because the dynamic pooling uses 3x3 medium-scale pooling for the occluded area, which retains the detailed features of the occluded edge. It can be seen that YOLOv5s-PLDP-SPP with the introduction of the PLDP module is better than YOLOv5s-SPP in different scenes.
[0262] After using the technical solution of the application, the PLDP-SPP module matches the feature density of different areas through dynamic pooling, solves the pain point of "fixed scale cannot adapt to multi-scale targets" in the original YOLOv5s-SPP, has stronger scale adaptability, and the detection accuracy of small targets and medium targets is significantly improved. The PLDP-SPP module is more balanced for details and global, small-scale pooling retains the details of high information areas, and large-scale pooling captures the global of low information areas, avoiding "over-aggregation" or "detail loss", and improving the fine-grained detection capability (AP 75The performance of YOLOv5s-PLDP-SPP is better than that of the original YOLOv5s-SPP on the COCO dataset, especially in challenging scenarios such as small target density, complex background, and target occlusion. The effectiveness of the dynamic perception pooling module is verified.
Claims
1. A small target detection method for unmanned aerial vehicle data, characterized in that, It comprises the following steps: S1: constructing a feature content analysis module; The feature content analysis module analyzes each pixel in the input feature map respectively, extracts the regional saliency score S and the texture complexity score T corresponding to each pixel, and then calculates the comprehensive score V corresponding to each pixel after normalizing the regional saliency score S and the texture complexity score T to the interval [0, 1]; The regional saliency score S is calculated by weighted fusion of local gradient amplitude and local contrast; The texture complexity score T is calculated by fusion of local entropy and LBP feature diversity; S2: setting different pooling operation mapping rules for different comprehensive scores V; S3: constructing 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 window center pixel; S4: constructing a PLDP-SPP module; The PLDP-SPP module comprises, connected in sequence: a feature content analysis module, a size decision mechanism module, and three parallel pooling operations; the three pooling operations correspond to one of the pooling scales in the pooling operation mapping rule respectively; The operations performed in the PLDP-SPP module specifically comprise the following steps: b1: inputting 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 according to the channel, then splits the feature map of each channel into feature subgraphs through window splitting, and then obtains the pooling scale s corresponding to each feature subgraph according to the V value of the center pixel point of the feature subgraph; then, each feature subgraph is sent to the pooling operation of the corresponding scale; b4: in the pooling operation, the feature vector extracted by performing the pooling operation on the feature subgraph to be processed with a window size of Sw×Sw according to the scale value s is outputted; All the feature vectors outputted by the pooling operation are concatenated in the original spatial order to obtain an output feature map with a size of H×W; b5: performing weighted fusion on the three output feature maps corresponding to each channel, and then outputting the fused feature map according to the channel; S5: constructing a target detection model based on the LDP-SPP module; S6: constructing a training data set and a verification data set; training the target detection model through the training data set to obtain a trained target detection model; S7: deploying the trained target detection model on a UAV, inputting the image collected by the image acquisition device on the UAV into the trained target detection model as a to-be-recognized image, and realizing target recognition. 2.The small target detection method for UAV data according to claim 1, characterized in that: The calculation method of the regional saliency score S specifically comprises the following steps: c1: calculating the local gradient amplitude; For input feature map F e R C×H×W , down-sampling is performed first to obtain feature map F' e R C×H′×W′ ; the feature map F' is divided by a sliding window to obtain n 2 non-overlapping feature sub-maps F'' to be calculated, F'' e R C×H′ / n×W′ / n ; wherein C is the number of channels, H and W are the height and width, H′=H / 2, and W′=W / 2; c2: For each feature subgraph F'' to be calculated, the gradient is calculated using the Sobel operator respectively: x-direction gradient: G x = Sobel(F, dx=1, dy=0); y direction gradient: G y = Sobel(F, dx=0, dy=1); Calculate the gradient amplitude G: ; Calculate the single-channel gradient mean value: ; Wherein, c∈[1,C], i'∈[1,H' / n], j'∈[1,W' / n]; Computing the cross-channel gradient mean S G : ; c3: Local contrast calculation; For each channel of the to-be-calculated feature subgraph F'', the difference between the maximum value and the minimum value of the pixel gray scale in the region is calculated to obtain a single-channel contrast C c : C c = max (F c ''(i', j')) - min (F c ''(i', j')) Wherein, c∈[1,C], i'∈[1,H' / n], j'∈[1,W' / n]; For each feature subgraph F" to be computed, compute the cross-channel contrast mean S C : ; c3: the cross-channel gradient mean S G the cross-channel contrast mean S C the normalized weighted fusion, to calculate the region saliency score S corresponding to the to-be-calculated feature subgraph F〞; The cross-channel gradient mean S is calculated as follows: G The normalized cross-channel gradient mean S is calculated as follows: G ′: ; where min(S G ) is the minimum value among all the cross-channel gradient mean S G , and max(S G ) is the maximum value among all the cross-channel gradient mean S G . The cross-channel contrast mean S is calculated as follows: C The normalized cross-channel gradient mean S is calculated as follows: C ′: ; where min(S C ) is the minimum value among all the cross-channel contrast mean values S C , and max(S C ) is the maximum value among all the cross-channel contrast mean values S C . Compute region saliency score S = w1* S G ′+w2* S C ′; Wherein, w1 and w2 are the weights of the saliency score; c4: The region saliency score S corresponding to each feature subgraph F'' to be calculated is spliced according to the original position to obtain the region saliency score S of the feature map F' with the size of H'×W'; c5: Map S from H'×W' back to the original size H×W through bilinear interpolation to obtain the full-resolution saliency score map S∈[0,1]H×W, Then the region saliency score S corresponding to each pixel point in the input feature map F is obtained. 3.The small target detection method for UAV data according to claim 2, characterized in that: The values of the saliency score weights w1 and w2 are 0.7 and 0.
3.
4. The small target detection method for UAV data according to claim 1, characterized in that: The calculation of the texture complexity score T specifically includes the following steps: d1: for input feature map F e R C×H×W , down-sampling to get down-sampled feature map F' e R C×H′×W′ ; d2: down-sampling feature map F F' is divided into 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'' is calculated. quantize the pixel values in the feature subgraph F" to be calculated into K bins to obtain a probability distribution P [ p 1, p 2 , ..., pk, ..., pK ], wherein pk is the proportion of pixels in the kth bin. calculating the entropy E of the features in the region of the feature subgraph F" to be calculated: ; calculating the feature sub-graph F" full graph entropy mean T E : ; d3: Statistics LBP features; grayscale the down-sampled feature map F' to obtain a grayscale feature map F gray : ; For each pixel point (i', j') of the grayed feature map F gray , a corresponding LBP value is calculated; wherein the LBP value is a binary number; Count the number of LBP value types included in each to-be-calculated feature subgraph F' ', denoted as: N LBP ; d4: the entropy average T corresponding to F E And the LBP feature, the texture complexity score T corresponding to F is calculated, the specific method is as follows: The F "full figure" corresponding N LBP The normalization processing, get normalized LBP quantity value T L : T L = N LBP / N max ; where N max For N LBP The maximum value; T: the average value of the whole map entropy of F E T: the average value of the whole map entropy of F 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; T = 0.5* T E ′+0.5*T L ; d5: The texture complexity score T corresponding to each feature subgraph F'' to be calculated is spliced according to the original position 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 map T∈[0,1]H×W; Then the texture complexity score T corresponding to each pixel point in the input feature map F is obtained.
5. The small target detection method for UAV data according to claim 1, characterized in that: Before step b4 is executed, the following steps also need to be executed: For each feature subgraph, according to the corresponding scale value s, it is judged whether padding needs to be performed on the feature subgraph before the pooling operation; Padding = ceil ( (s- Sw) / 2);Wherein, ceil(.) is the ceiling function; If the padding value calculated is 0, no padding operation is needed, and the feature subgraph is taken as the feature subgraph to be processed; If the padding value is not 0, perform padding operation on the feature subgraph to obtain the padded feature subgraph, and take the padded feature subgraph as the feature subgraph to be processed.
6. The small target detection method for UAV data according to claim 1, wherein: In step S5, the PLDP-SPP module is replaced with the SPP module based on YOLOv5s to construct the target detection model; The target detection model comprises a backbone network, a PLDP-SPP, a neck, and a detection head.
7. The method of claim 6, wherein: The target detection model comprises a CSPDarknet53, a PLDP-SPP, a PANet, and a detection head connected in sequence; The detection head performs multi-scale prediction to output three feature maps of different scales, corresponding to detection of small, medium, and large targets respectively; each detection head includes 3 convolutional layers, which respectively output bounding box coordinates, confidence, and class probability.
8. The small target detection method for UAV data according to claim 1, wherein: The calculation method of the comprehensive score V is: V = α*S + β*T; Wherein, α and β are hyperparameters.
9. The method of claim 1, wherein: In step S2, the pooling operation mapping rule is: If V ≥ 0.7, then the pooling scale = 1x1; If 0.3 < V < 0.7, then the pooling scale = 3x3; If V ≤ 0.3, then the pooling scale = 5x5.
10. The small target detection method for UAV data according to claim 1, wherein: In step S3, according to the V value of the window center pixel corresponding to the pooling operation mapping rule, different pooling scales are dynamically matched for the features in each window region, which specifically includes the following steps: a1: For the input feature map, based on the pre-set window for feature map division, the input feature map is divided into non-overlapping feature subgraphs; Assuming that the size of the input feature map is F e R C×H×W , the feature map is split by channel, and then the feature map with a size of R x W of each channel is divided based on a division window to obtain the feature sub-map; wherein the size of the division window is: Sw x Sw, and the size of the feature sub-map is Sw x Sw. a2: For each of the feature subgraphs, the V value corresponding to the pixel located at the center position of the window is obtained, and the pooling scale corresponding to the V value in the pooling operation mapping rule is found to set it as the scale value s corresponding to the feature subgraph.
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