Lightweight aerial image target detection method based on fine-grained feature extraction

By introducing fine-grained feature extraction and feature fusion networks into UAV image target detection, combined with the balanced channel attention mechanism and spatial pyramid pooling, the problem of low UAV image target detection accuracy and limited computing resources is solved, and the Efficient lightweight object detection.

CN118736446AInactive Publication Date: 2024-10-01YELLOW RIVER CONSERVANCY TECHN INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410870106.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Target detection in UAV images is difficult to achieve high accuracy in limited computing resources and dense scenarios. Existing methods cannot effectively extract features, resulting in poor detection performance.

Method used

Adopt a lightweight aerial image target detection method based on fine-grained feature extraction, including building an image target detection network, using the backbone network, neck network and prediction head, introducing a fine-grained feature enhancement module and feature fusion network, combined with balanced channel attention mechanism and progressive spatial pyramid pooling to filter background information and generate high-quality feature maps.

Benefits of technology

It improves the target detection performance of the model in dense scenes, reduces the number of model parameters, and improves the detection accuracy and performance. It is suitable for target detection in UAV images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736446A_ABST
    Figure CN118736446A_ABST
Patent Text Reader

Abstract

The invention provides a lightweight aerial image target detection method based on fine-grained feature extraction. An image target detection network constructed in the method comprises a backbone network, a neck network and a prediction head; the neck network comprises a fine-grained feature enhancement module and a feature fusion network; the fine-grained feature enhancement module is used for aggregating three smaller feature maps output by the backbone network to obtain a first aggregated feature map, and generating a binary mask feature map containing target position information according to the first aggregated feature map; and acting the binary mask feature map on the first aggregated feature map to filter background information in the aerial image to obtain a second aggregated feature map, and generating three new feature maps with different sizes based on the second aggregated feature map. According to the method, the target feature discrimination capability of the model in the dense scene can be improved, so that the target detection performance of the whole model in the dense scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image target detection, and in particular to a lightweight aerial image target detection method based on fine-grained feature extraction. Background Art

[0002] Due to the advantages of low cost, good maneuverability and ease of use of drones, drone image object detection has become a research hotspot in recent years. However, due to the characteristics of drones and drone images, drone object detection faces the following challenges: (1) The computing resources of drone platforms are limited, and general detectors usually have large parameters, so it is difficult to deploy general detectors on drone platforms. (2) There are usually many scenes with densely arranged objects in drone images, such as parking lots and roadsides, which greatly tests the accuracy of feature extraction by detectors. Most existing object detection methods cannot achieve high detection accuracy requirements on drone images. Summary of the invention

[0003] In order to improve the accuracy of target detection on drone images and realize the lightweight of detection models, the present invention provides a lightweight aerial image target detection method based on fine-grained feature extraction.

[0004] The present invention provides a lightweight aerial image target detection method based on fine-grained feature extraction, comprising:

[0005] Step 1: construct an image object detection network, wherein the image object detection network includes a backbone network, a neck network and a prediction head; wherein the neck network includes a fine-grained feature enhancement module and a feature fusion network;

[0006] The backbone network is used to extract four feature maps of different sizes from the input aerial image;

[0007] The fine-grained feature enhancement module is used to aggregate three smaller feature maps output by the backbone network to obtain a first aggregated feature map, generate a binary mask feature map containing target location information based on the first aggregated feature map, apply the binary mask feature map to the first aggregated feature map to filter out background information in the aerial image, obtain a second aggregated feature map, and generate three new feature maps of different sizes based on the second aggregated feature map;

[0008] The feature fusion network is used to generate four new feature maps of different sizes by using a top-down and bottom-up fusion path for the largest feature map output by the backbone network and three new feature maps of different sizes output by the fine-grained feature enhancement module;

[0009] The prediction head is used to perform target detection according to four new feature maps of different sizes output by the feature fusion network;

[0010] Step 2: training the image object detection network to obtain an image object detection model;

[0011] Step 3: Input the aerial image to be tested into the image target detection model to obtain the detection result.

[0012] Furthermore, the backbone network includes two convolutional layers, four feature extraction layers and a spatial pyramid pooling module connected in sequence; wherein the feature extraction layer includes a downsampling module and an efficient feature extraction module connected thereto;

[0013] The downsampling module is used to reduce the size of the original input feature map by half and double the number of channels to obtain a new feature map;

[0014] The efficient feature extraction module is used to divide the original feature map output by the downsampling module into two groups of features from the channel dimension, refine one group of features using a balanced channel attention mechanism and a depth-separable convolution, and fuse the refined features with the other group of features to obtain a new feature map;

[0015] Correspondingly, the outputs of the first three efficient feature extraction modules and the output of the spatial pyramid pooling module are used as four feature maps of different sizes extracted by the backbone network.

[0016] Furthermore, the downsampling module is used to halve the size of the input original feature map and double the number of channels to obtain a new feature map, specifically including:

[0017] The input original feature map D in Generate two sets of features d1 and d2 from the channel dimension segmentation;

[0018] According to the following formula, the size of one set of features d1 is halved and the number of channels is doubled to obtain a new feature D1;

[0019] D1=Conv 1×1 (MaxPool(Conv 1×1 (d1)))

[0020] According to the following formula, the size of another set of features d2 is halved and the number of channels is doubled to obtain a new feature D2;

[0021] D2=Conv 1×1 (DWConv 3×3 (Conv 1×1 (d2)))

[0022] According to the following formula, the new feature D1 and the new feature D2 are fused to obtain the new feature map D out ;

[0023] D out=CS([D1,D2])

[0024] Among them, Conv 1×1 represents a 1×1 convolution operation, MaxPool represents a maximum pooling operation, and DWConv 3×3 denotes a 3×3 depthwise separable convolution operation, CS denotes a channel shuffle operation, and [·] denotes a channel concatenation operation.

[0025] Furthermore, the process of obtaining a new feature map by the efficient feature extraction module specifically includes:

[0026] The input original feature map E in Generate two sets of features f1 and f2 from the channel dimension split;

[0027] Use the balanced attention mechanism to process one of the features f2 to obtain a new feature B out ;

[0028] The new feature B is calculated according to the following formula out Perform refinement to obtain the refined feature E1;

[0029] E1=Conv 1×1 (DWConv 3×3 (DWConv 3×3 (B out )))

[0030] According to the following formula, the refined feature E1 and another set of features f1 are fused to obtain a new feature map E out ;

[0031] E2=Conv 1×1 ([f1,E1])

[0032] E out =CS([f1,E2,DWConv 3×3 (E2)])

[0033] Among them, Conv 1×1 Represents a 1×1 convolution operation, DWConv 3×3 represents a 3×3 depthwise separable convolution operation, E2 represents the intermediate feature, CS represents the channel shuffle operation, and [·] represents the channel concatenation operation.

[0034] Furthermore, the equal attention balance mechanism is used to process one of the features f2 to obtain a new feature B out , including:

[0035] The input original feature map B in= f2 performs a global average pooling operation to obtain a new feature map B1, and performs a Reshape operation on the feature map B1 according to the following formula to obtain a new feature map B2;

[0036] According to the following formula, the feature map B2 is processed using convolution and sigmoid function to obtain a feature map with different channel attention weights.

[0037]

[0038] Among them, C represents the feature map B in The number of channels, σ represents the sigmoid function; k represents the size of the convolution kernel; represents the element in the mth row and nth column in the k×k window centered on the i-th element in the feature graph B2; w mn represents the weight of the mth row and nth column of the convolution kernel; a i Represents the i-th element of feature map A;

[0039] First, reshape feature map A and then combine it with feature map B. in Perform multiplication operation and finally get the new feature B out .

[0040] Furthermore, the following formula is used to calculate the size k of the convolution kernel:

[0041] t=log2 C+1

[0042]

[0043] Furthermore, the feature processing process of the spatial pyramid pooling module includes:

[0044] S1=Conv 1×1 ([Conv 1×1 (S in ),MaxPool(Conv 1×1 (S in ))])

[0045] S2=Conv 1×1 ([S1,MaxPool(S1)])

[0046] S out =Conv 1×1 ([S2,MaxPool(S2)])

[0047] Among them, Conv 1×1represents a 1×1 convolution operation; MaxPool represents a maximum pooling operation. According to the order of feature processing, the kernel sizes are 5×5, 9×9, and 13×13 respectively.

[0048] Furthermore, the process of generating three new feature maps of different sizes by the fine-grained feature enhancement module specifically includes:

[0049] According to the following formula, three smaller feature maps F1, F2 and F3 output by the backbone network are adjusted to the same size and the same number of channels, the adjusted three feature maps are connected in the channel dimension, and then the channel information is fused using 1×1 convolution, and the number of channels is compressed to obtain the first aggregated feature map T1;

[0050] T1=Conv 1×1 ([Reshape(F1),Conv 1×1 (F2), Reshape (F3)])

[0051] Generate a binary mask feature map M containing target position information according to the following formula;

[0052] M=σ(Conv 1×1 (DWConv 3×3 (DWConv 3×3 (T1))))

[0053] The second post-polymerization characteristic graph T2 is obtained according to the following formula;

[0054]

[0055] The second aggregated feature map T2 is evenly divided into three groups of features in the channel dimension, and then the three groups of features are adjusted to the same size and the same number of channels as the features F1, F2 and F3, and then the adjusted three groups of features are connected with the corresponding features F1, F2 and F3 in the channel dimension to obtain three new feature maps F of different sizes. out_1 , F out_2 and F out_3 .

[0056] Furthermore, in step 2, during the training process, the loss function Loss used is:

[0057] Loss = λ1L box +λ2L obj +λ3L cls +λ4L mask

[0058] =λ1L CIOU (P box ,T box )+λ2L BCE (Pobj ,T obj )+λ3L BCE (P cls ,T cls )

[0059] +λ4L BCE (P mask ,T mask )

[0060] Among them, L box represents the bounding box regression loss, using the CIOU loss function; L obj , L cls and L mask They represent confidence loss, classification loss and mask loss respectively, all of which adopt binary cross entropy loss function; λ1, λ2, λ3 and λ4 are all weights.

[0061] Beneficial effects of the present invention:

[0062] (1) A fine-grained feature enhancement module is introduced into the image object detection model. This module can obtain finer-grained features to improve the model's ability to discriminate target features in dense scenes, thereby improving the target detection performance of the entire model in dense scenes.

[0063] (2) A lightweight and efficient feature extraction network is used as the backbone network in the image target detection model. While reducing the number of model parameters, more discriminative features can also be extracted, so that the entire model can improve the performance of drone image target detection under the condition of low parameter number.

[0064] (3) A balanced channel attention mechanism is further designed in the efficient feature extraction network, which can improve the responsiveness of high-quality channel information in the feature extraction process and help the model extract features more effectively.

[0065] (4) Progressive spatial pyramid pooling is used in the image object detection model. This pooling operation can obtain features containing rich semantic information and further improve the performance of the model.

[0066] In summary, the experiments on the VisDrone dataset show that compared with other algorithms, the proposed method has better performance in drone image target detection. From the ablation experiment, it can be seen that each improved module proposed in the present invention can effectively improve the detection accuracy. Therefore, the algorithm proposed in the present invention is more suitable for drone image target detection, and has important practical significance for the research on drone image target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1The overall network structure of the image object detection network provided by the embodiment of the present invention;

[0068] Figure 2 (a) Structure diagram of efficient feature extraction module EFEM and (b) structure diagram of downsampling module DM provided by the embodiment of the present invention;

[0069] Figure 3 Provided for embodiments of the present invention: (a) ordinary convolution (b) depthwise separable convolution;

[0070] Figure 4 A structural diagram of the BCA Layer of the balanced channel attention mechanism provided by an embodiment of the present invention;

[0071] Figure 5 A PSPP structure diagram of progressive spatial pyramid pooling provided by an embodiment of the present invention;

[0072] Figure 6 A structural diagram of a fine-grained feature enhancement module FGM provided in an embodiment of the present invention;

[0073] Figure 7 Detection results of the baseline model provided in the embodiment of the present invention and the image target detection model BFDet of the present invention: (a1-a4) are the detection results of the baseline model; (b1-b4) are the detection results of BFDet. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] Example 1

[0076] The embodiment of the present invention provides a lightweight aerial image target detection method based on fine-grained feature extraction, comprising the following steps:

[0077] S101: Build an image target detection network, such as Figure 1 As shown, the image target detection network includes a backbone network (Backbone), a neck network (Neck) and a prediction head (Head); wherein the neck network includes a fine-grained feature enhancement module and a feature fusion network;

[0078] First, the backbone network is used to input feature information of the image. In order to detect objects of different sizes, the backbone network extracts four feature maps of different sizes from the input aerial image. In this embodiment, the sizes of the four feature maps are 160×160, 80×80, 40×40, and 20×20, respectively.

[0079] Next, the four output feature maps of the backbone network are used as the input of the neck network to obtain four new feature maps of different scales with rich context information. The feature processing process of the neck network specifically includes:

[0080] First, the fine-grained feature enhancement module is used to aggregate three smaller feature maps output by the backbone network to obtain a first aggregated feature map, a binary mask feature map containing target location information is generated based on the first aggregated feature map, the binary mask feature map is applied to the first aggregated feature map to filter out background information in the aerial image, and a second aggregated feature map is obtained. Three new feature maps of different sizes are generated based on the second aggregated feature map; then, the feature fusion network is used to generate four new feature maps of different sizes using top-down and bottom-up fusion paths for the largest feature map output by the backbone network and the three new feature maps of different sizes output by the fine-grained feature enhancement module;

[0081] Finally, the prediction head will perform target detection based on the four new feature maps of different sizes output by the feature fusion network to obtain the final detection result.

[0082] S102: training the image object detection network to obtain an image object detection model;

[0083] S103: Input the aerial image to be tested into the image target detection model to obtain the detection result.

[0084] There are many densely arranged targets in drone images, which greatly tests the model's ability to extract features. In order to improve the performance of the model in detecting dense targets, the lightweight aerial image target detection method based on fine-grained feature extraction provided by the embodiment of the present invention can filter out background information in aerial images by introducing a fine-grained feature enhancement module FGM into the image target detection network, so that the model pays more attention to the target area, thereby improving the detection ability of dense targets.

[0085] Example 2

[0086] On the basis of the above embodiment, in order to realize the lightweight of the model, the embodiment of the present invention provides an efficient feature extraction network (EFENet) as the backbone network, such as Figure 1As shown in the figure, the efficient feature extraction network (EFENet) includes two convolutional layers, four feature extraction layers and a spatial pyramid pooling module connected in sequence. The feature extraction process of the backbone network mainly includes: the original aerial image is processed by two convolutional layers in sequence, and then processed by four feature extraction layers in sequence, and finally processed by the spatial pyramid pooling module. The outputs of the first three efficient feature extraction modules and the output of the spatial pyramid pooling module are used as four feature maps of different sizes extracted by the backbone network.

[0087] The feature extraction layer consists of two core modules: Efficient Feature Extraction Module (EFEM) and Downsampling Module (DM). Their structure diagrams are shown in Figure 2. Figure 2 As shown in the figure, EFEM is used to extract robust features, and DM is used to downsample the features. EFENet can not only reduce the number of parameters required by the model, but also better extract target features.

[0088] EFEM is mainly used to divide the original feature map into two groups of features from the channel dimension, refine one group of features using the Balanced Channel Attention Layer (BCA Layer) and depth-wise separable convolution, and fuse the refined features with the other group of features to obtain a new feature map.

[0089] Since the depthwise separable convolution uses the same number of convolution kernels as the input feature channels, and each convolution kernel only performs convolution on one channel, the depthwise separable convolution can greatly reduce the number of parameters compared to ordinary convolution. Figure 3 shown.

[0090] In order to reduce the number of parameters when extracting features, the process of obtaining a new feature map by EFEM specifically includes:

[0091] S201: Input the original feature map Split from the channel dimension into two groups of features and

[0092] S202: Feature f1 is not processed in any way and is retained as the original feature to alleviate the problem that some important features are weakened during the processing; feature f2 is passed through the balanced channel attention mechanism (BCALayer) to obtain a feature containing channel attention weights to highlight important channel information.

[0093] Specifically, the channel attention mechanism can make high-quality channel information more prominent and help the model extract more robust features, which is very helpful for lightweight models.

[0094] As an implementation method, the structure of BCA Layer is as follows Figure 4 It balances the relationship between the number of parameters and the ability of information interaction between channels. It can allow more channels to participate in information interaction under the premise of low parameter quantity, while improving the responsiveness of high-quality channel information in the model. Figure 4 As shown, the BCA Layer processes feature f2 according to the following process to obtain a new feature B out :

[0095] First, the original feature map of the input Use the global average pooling operation to obtain a feature map with the same number of channels and a spatial size of 1×1. Then perform a Reshape operation on B1 to convert the channel dimension into a spatial dimension to obtain a feature map As shown in formula (1):

[0096]

[0097] Among them, W and H represent the width and height of the feature map; Represents feature map B in The element in the i-th row and j-th column of .

[0098] Then, the feature map B2 is processed using convolution and sigmoid functions to obtain a feature map with different channel attention weights. As shown in formula (2):

[0099]

[0100] Among them, σ represents the sigmoid function; k represents the size of the convolution kernel; represents the element in the mth row and nth column in the k×k window centered on the i-th element in the feature graph B2; w mn represents the weight of the mth row and nth column of the convolution kernel; a i Represents the i-th element of feature map A.

[0101] Finally, the feature A containing different channel attention weights is reshaped to convert the feature from the spatial dimension back to the channel dimension, and then combined with the feature B in Perform multiplication to get the final output feature As shown in formula (3):

[0102]

[0103] in, Represents the feature multiplication operation.

[0104] Furthermore, since the more channels the input feature has, the larger the feature space size obtained after the Reshape operation, in order to allow more channels to participate in information interaction, the size of k is determined by the number of channels of the input feature. The larger the number of channels, the larger k is, thereby strengthening the information interaction between channels. k is calculated by formula (5):

[0105] t=log2 C+1 (4)

[0106]

[0107] Among them, C is the number of channels of the input feature.

[0108] S203: Feature B processed by BCA Layer out Then use two DepthWise Convolutions with a kernel size of 3×3 and a step size of 1 to extract features, and then use a convolution with a kernel size of 1×1 to integrate the feature information of each channel to obtain the feature As shown in formula (6):

[0109] E1=Conv 1×1 (DWConv 3×3 (DWConv 3×3 (B out ))) (6)

[0110] S204: Connect features E1 and f1 in the channel dimension. The connected features are aggregated using a convolution with a convolution kernel size of 1×1, and the number of feature channels is reduced to the original Get Features As shown in formula (7):

[0111] E2=Conv 1×1 ([f1,E1]) (7)

[0112] Among them, [·] represents the channel connection operation. Then, DepthWiseConvolution with a convolution kernel size of 3×3 is used to further process the aggregated feature E2 to obtain the feature Then, the three groups of features f1, E2 and E3 are connected in the channel dimension, and finally the ChannelShuffle operation is used to mix the channels of the three groups of features to strengthen the information interaction between different groups of features and improve the robustness of the features. As shown in formula (8):

[0113] E out=CS([f1,E2,DWConv 3×3 (E2)]) (8)

[0114] Among them, CS represents the ChannelShuffle operation.

[0115] EFEM divides the input features into two groups, one of which is refined using convolution, and the other is not processed. There are two main benefits to this: first, convolution only processes half of the feature channels, which can greatly reduce the number of model parameters and the amount of calculation; second, half of the feature channels are reserved for fusion with the features after convolution processing, which can alleviate the problem of important information being weakened during the convolution process.

[0116] DM is mainly used to halve the size of the feature map and double the number of channels before EFEM processes the features. The DM feature processing process specifically includes:

[0117] S301: Input the original feature map Split from the channel dimension into and Two sets of features; so that different processing methods can be used for the two sets of features to reduce the size of the feature map.

[0118] S302: First, use a convolution with a kernel size of 1×1 to integrate channel information for feature d1, then use a maximum pooling layer with a kernel size of 2 and a stride of 2 to extract target boundary features and reduce the size of the feature map, and then use a 1×1 convolution to expand the number of channels to obtain feature As shown in formula (9):

[0119] D1=Conv 1×1 (MaxPool(Conv 1×1 (d1))) (9)

[0120] S303: First, use 1×1 convolution to integrate channel information for feature d2, then use Depthwise Convolution with a kernel size of 3×3 and a step size of 2 to extract local features and reduce the size of the feature map. Then use 1×1 convolution to expand the number of channels to obtain feature As shown in formula (10):

[0121] D2=Conv 1×1 (DWConv 3×3 (Conv 1×1 (d2))) (10)

[0122] S304: In order to improve the robustness of the feature, after connecting features D1 and D2 in the channel dimension, the two sets of features are mixed using the ChannelShuffle operation to strengthen the information interaction between different sets of features and obtain the feature As shown in formula (11):

[0123] D out =CS([D1,D2]) (11)

[0124] DM divides the features into two groups, one group uses the maximum pooling operation to extract boundary features, and the other group uses Depthwise Convolution to extract local features. The channels of the two groups of features are then mixed, which not only enhances the information interaction ability between different groups of features, but also improves the robustness of the features.

[0125] Preferably, in order to further improve the performance of aerial image target detection, the embodiment of the present invention also designs progressive spatial pyramid pooling PSPP to help the model extract features with richer semantic information. PSPP uses three maximum pooling layers with different kernel sizes to obtain features with large receptive fields, and the kernel sizes are 5×5, 9×9 and 13×13 respectively. PSPP adopts a progressive fusion method to fuse different features from small to large receptive fields in sequence to alleviate the problem of conflicting features of certain pixel points caused by fusing multiple features at one time. The structure diagram of PSPP is shown in the figure below. Figure 5 shown.

[0126] PSPP first uses a 1×1 convolution to transform the input features The number of channels is halved, and then a maximum pooling operation with a kernel size of 5×5 is used to obtain features with a large receptive field. The features before and after the maximum pooling layer are then connected in the channel dimension to obtain features containing two receptive fields. Finally, a 1×1 convolution is used to fuse the features of the two receptive fields and compress the feature channels. The subsequent processing method is similar. After each maximum pooling operation, the two sets of features before and after pooling are connected in the channel dimension, and then a 1×1 convolution is used to fuse and compress the channels. The specific formula is as follows:

[0127] S1=Conv 1×1 ([Conv 1×1 (S in ),MaxPool(Conv 1×1 (S in ))])

[0128] S2=Conv 1×1 ([S1,MaxPool(S1)])

[0129] S out =Conv 1×1 ([S2,MaxPool(S2)])

[0130] Among them, Conv 1×1 represents a 1×1 convolution operation; MaxPool represents a maximum pooling operation. According to the order of feature processing, the kernel sizes are 5×5, 9×9, and 13×13 respectively.

[0131] This progressive fusion method can alleviate the problem of feature information conflict caused by too many fused features, and the features are fused after one processing, which also avoids the problem that the information between features is very different after multiple processing, making fusion more difficult. This fusion method can also fuse features of different receptive fields to obtain feature maps with rich semantic information, further helping the model improve performance.

[0132] Example 3

[0133] Based on the above embodiments, the embodiment of the present invention provides a preferred structure of a neck network, which is composed of a fine-grained feature enhancement module and a feature fusion network. The fine-grained feature enhancement module (FGM) can help the model extract finer-grained features and help the model effectively detect dense targets. The feature fusion network fuses features of different scales to improve the model's ability to detect multi-scale targets.

[0134] The principle that FGM can improve the detection capability of dense targets is given above. The present invention is based on this principle and further provides specific implementation details. The structure is as follows: Figure 6 As shown in Figure 2, the process of generating three new feature maps of different sizes by the fine-grained feature enhancement module specifically includes:

[0135] S401: Three smaller feature maps output by the backbone network and Adjust to the same size and the same number of channels. Connect the three sets of features after adjustment in the channel dimension, and then use 1×1 convolution to fuse the channel information and compress the number of channels to obtain the feature As shown in formula (12):

[0136] T1=Conv 1×1 ([Reshape(F1),Conv 1×1 (F2), Reshape (F3)]) (12)

[0137] Where [·] represents a channel connection operation.

[0138] S402: Use two 3×3 DepthWise Convolutions to extract abstract features, then use 1×1 convolution to integrate all channel information, and finally use the sigmoid function for normalization to generate a predicted feature mask. As shown in formula (13):

[0139] M=σ(Conv 1×1 (DWConv 3×3 (DWConv 3×3 (T1)))) (13)

[0140] Where σ represents the sigmoid function.

[0141] S403: Multiply the predicted mask M and the feature T1 to filter the background information and make the target information contained in the feature more prominent. Then use 1×1 convolution to increase the number of channels of the filtered feature to obtain the feature As shown in formula (14):

[0142]

[0143] S404: Divide T2 into three groups of features in the channel dimension, adjust these three groups of features to the same size and the same number of channels as features F1, F2 and F3, and finally connect them in pairs in the channel dimension to obtain the final three output features. and

[0144] The feature fusion network takes the feature maps of three different scales output by the fine-grained feature enhancement module and the feature map output by the first EFEM in the backbone network as the input features of the feature fusion network, and uses top-down and bottom-up fusion paths to generate four features of different scales for target detection.

[0145] Furthermore, in the training phase, in order to guide the model to better generate the prediction mask, the embodiment of the present invention introduces the mask loss in the loss function, specifically: using the binary cross entropy loss function (Binary Cross Entropy WithLogits Loss, BCEWithLogitsLoss) to calculate the difference between the true value mask and the prediction mask, thereby guiding the model to better generate the prediction mask and improve the detection ability of the model. The binary cross entropy loss is shown in formula (15):

[0146]

[0147] Where N is the number of input vectors. and y are the prediction vector and true value vector respectively. σ is the sigmoid function.

[0148] Based on this, the loss function (LossFunction) adopted in the embodiment of the present invention mainly includes bounding box regression loss, confidence loss, classification loss and mask loss.

[0149] The CIOU loss function is used as the bounding box regression loss. The calculation formula of CIOU loss is shown in formula (16):

[0150]

[0151] Where ρ represents the Euclidean distance formula. b and b gt Denote the center points of the predicted box and the true value box respectively. B and B in formula (17) gt Denote the predicted box and the true value box respectively. c denotes the diagonal length of the minimum bounding rectangle of the predicted box and the true value box. v and α are defined as follows:

[0152]

[0153] Among them, w gt and h gt are the width and height of the true value box, w and h are the width and height of the predicted box. α represents the trade-off parameter, and v is used to measure the consistency of the aspect ratio between the predicted box and the true value box. In addition, the confidence loss and classification loss of the model are calculated using the binary cross entropy loss function, which is defined as shown in formula (15).

[0154] The overall loss function of BFDet can be obtained by combining bounding box regression loss, confidence loss, classification loss and mask loss. Its definition is shown in formula (20):

[0155] Loss = λ1L box +λ2L obj +λ3L cls +λ4L mask =

[0156] λ1L CIOU (P box ,T box )+λ2L BCE (P obj ,T obj )+λ3L BCE (P cls ,T cls )+

[0157] λ4L BCE (P mask ,T mask )(20)

[0158] Among them, L box , L obj , L cls and L mask They represent bounding box regression loss, confidence loss, classification loss, and mask loss respectively.

[0159] In order to verify the effects of the embodiments of the present invention, the present invention also provides the following experimental data.

[0160] Experimental environment: Verified on Ubuntu 18.04.6LTS system, Python version is 3.6, Pytorch version is 1.10.2, CPU is Intel(R) Xeon(R) Silver 4114CPU@2.20GHz, NVIDIA GeForce RTX3090(24G) is used as graphics processing unit for training and testing, and CUDA version is 11.7.

[0161] When training the model, the Stochastic Gradient Descent (SGD) optimizer with momentum is used for training. When training on the VisDrone dataset, the momentum parameter is set to 0.937, the initial learning rate is set to 0.01, the weight decay coefficient is set to 0.0005, the batch size is set to 8, the total number of training iterations is 300, and λ1, λ2, λ3, and λ4 are set to 0.05, 1.0, 0.5, and 0.05, respectively. When training on the UAVDT dataset, the momentum parameter is set to 0.937, the initial learning rate is set to 0.015, the weight decay coefficient is set to 0.0005, the batch size is set to 8, the total number of training iterations is 200, and λ1, λ2, λ3, and λ4 are set to 0.05, 1.0, 0.3, and 0.1, respectively.

[0162] The experiments on the VisDrone dataset and the comparison with other SOTA models are shown in Table 1. Compared with other SOTA models, the image target detection model BFDet of the present invention obtains the highest mAP0.5 value, which is 0.5% higher than CGMDet. BFDet ranks third in mAP0.75, 0.8% lower than CDMNet and 0.4% lower than CGMDet. However, BFDet of the present invention also has the best result in mAP value. BFDet has better detection effect on small targets than most SOTA models, achieving the second highest result, which is 1.0% lower than the result of NWD. Although the detection effect on medium-sized targets is 2.0% lower than that of CDMNet, which has the best effect, it is also better than most other models. However, in the detection of large targets, BFDet is quite different from the best DMNet, which is 6.3% lower, which shows that the detection performance of BFDet of the present invention for large targets needs to be improved.

[0163] Table 1 Comparison of the proposed method with other advanced methods on the VisDrone dataset

[0164]

[0165] In order to more intuitively demonstrate the superiority of BFDet, the detection results of the baseline model and BFDet are visualized, as shown in the figure. Figure 7 As shown in FIG. 1 , the visualization results in four different scenarios are respectively shown to determine whether the BFDet of the present invention can adapt to the detection of multiple scenarios. Figure 7 In the parking lot area shown in (a1) and (b1), the targets in this scene are densely packed and some targets are blocked by other targets. The baseline model has many missed detections in this scene, while the BFDet of the present invention can detect more targets and even detect some blocked targets accurately. This shows that the detection effect of the BFDet of the present invention in dense scenes is greatly improved compared with the baseline model. Figure 7 As shown in (a2) and (b2), in a dark scene, the shape of the vehicle in the captured image is relatively blurred, and the light of the vehicle will further increase the detection difficulty of the model, and the model needs strong feature extraction capabilities. The detection results of the baseline model in this scene are not satisfactory, and the vehicle in the center of the picture is not detected. The detection results of BFDet in this scene are significantly improved compared with the baseline model. This shows that BFDet has a strong feature extraction capability and can extract more discriminative features. The model also verifies the detection effect of small targets, such as Figure 7 (a3) and (b3). The baseline model can accurately detect targets close to the camera, but there are many errors for small targets far away. The BFDet of the present invention can alleviate this problem. The detection results of drone images in night scenes are also compared, as shown in Figure 2. Figure 7 (a4) and (b4). In the city night scene, the light is weak, the road is dim, and there are many light sources, which makes it very difficult to detect the target. The baseline model has redundant and inaccurate detection frames in the detection results of this scene. However, the detection results of BFDet in this scene are superior, there are no redundant detection frames, and the detection results are more accurate. This shows that our BFDet has a strong anti-interference ability. Even in complex night scenes, it can still extract high-quality features and accurately detect targets.

[0166] The detection performance of the model for each category was tested on the VisDrone data, and the results are shown in Table 2. The BFDet of the present invention achieved the best results in the categories of pedestrian, people, bicycle, car, bus, and motor. In the pedestrian category, BFDet is 4.7% higher than the second-place CGMDet, and 3.0% higher in the bicycle category. However, BFDet is at a disadvantage in the results of the four categories of van, truck, tricycle, and awing-tricycle. However, compared with the baseline model YOLOv7-tiny, BFDet has greatly improved the detection results in each category. Among them, the improvement in the pedestrian category is the largest, with an increase of 11.9%. Although the improvement in the car and awing-tricycle categories is relatively small, it is also an increase of 4.0%.

[0167] Table 2 Detection results of each category on the VisDrone dataset

[0168]

[0169]

[0170] The present invention is also compared with other lightweight models, and the results are shown in Table 3. M The result is not the best, 2.0% lower than YOLOv8s. But it is the best value in other indicators that represent detection performance. The number of BFDet model parameters is only 5.6M, which is at a medium level. The inference speed of BFDet is lower than other lightweight models, but it also reaches 33FPS, which meets the requirements of real-time detection.

[0171] Table 3 Comparison of the proposed method with other lightweight detection methods on the VisDrone dataset

[0172]

[0173] A series of ablation experiments were conducted using the VisDrone dataset to verify the effectiveness of each method proposed in the present invention. YOLOv7-tiny was used as the baseline model, and the method proposed in the present invention was used to improve it. The experimental results after each improvement were compared to analyze whether the method proposed in the present invention can help the model improve performance. All experiments were completed in the same environment. The experimental results are shown in Table 4.

[0174] First, we use EFENet as the backbone network of the model to provide features of different scales for the neck network. Compared with the original backbone network of the baseline model, the model with EFENet has improved results in all evaluation indicators. In particular, the mAP0.5 indicator has the highest improvement, which has increased by 2.4%. And the number of parameters required by the model has been reduced by 1.5M. This shows that EFENet has a strong feature extraction capability.

[0175] After using PSPP, the mAP0.5 of the model increased by 1.3%. The detection performance of medium-sized targets and large targets increased by 1.2% and 1.8% respectively, but the detection performance of medium-sized and small targets only increased by 0.2%. This shows that the features extracted by PSPP are more conducive to the detection of medium and large targets. This is because in order to obtain features containing rich semantic information, PSPP uses three maximum pooling layers with gradually increasing kernel sizes. As a result, the receptive field of the generated feature map becomes larger, and a larger receptive field is more suitable for the detection of large targets. And judging from the improvement of various indicators, the progressive fusion method adopted by PSPP has largely alleviated the problem of losing some important feature information caused by fusing too many features at one time.

[0176] When FGM is added to the baseline model, although the AP S The result of this indicator is only improved by 0.4%, but the improvement of other indicators exceeds 1.0%. It can be seen that the FGM of the present invention can extract more fine-grained features by predicting the mask containing the precise location information of the target, helping the model to pay more attention to the target area and improve the detection performance.

[0177] In addition, in the baseline model, only the P3, P4 and P5 detection layers are detected; in the method of the present invention, in addition to target detection on the above three layers, target detection is also performed on the shallow P2 detection layer. The P2 layer uses a high-resolution feature map, which is helpful for the detection of small targets in aerial images.

[0178] From the experimental results, the BFDet of the present invention has greatly improved the results of various evaluation indicators. Among them, the mAP0.5 indicator has the highest improvement, which is 6.0%. Although the detection of medium targets has the least improvement, it has also increased by 3.3%. And the number of parameters of BFDet is also lower than that of the baseline model. In addition, the results of BFDet in each indicator are better than other results in the ablation experiment.

[0179] Table 4 Ablation experiments on the VisDrone dataset

[0180]

[0181]

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A lightweight aerial image target detection method based on fine-grained feature extraction, characterized in that: include: Step 1: construct an image object detection network, wherein the image object detection network includes a backbone network, a neck network and a prediction head; wherein the neck network includes a fine-grained feature enhancement module and a feature fusion network; The backbone network is used to extract four feature maps of different sizes from the input aerial image; The fine-grained feature enhancement module is used to aggregate three smaller feature maps output by the backbone network to obtain a first aggregated feature map, generate a binary mask feature map containing target location information based on the first aggregated feature map, apply the binary mask feature map to the first aggregated feature map to filter out background information in the aerial image, obtain a second aggregated feature map, and generate three new feature maps of different sizes based on the second aggregated feature map; The feature fusion network is used to generate four new feature maps of different sizes by using a top-down and bottom-up fusion path for the largest feature map output by the backbone network and three new feature maps of different sizes output by the fine-grained feature enhancement module; The prediction head is used to perform target detection according to four new feature maps of different sizes output by the feature fusion network; Step 2: training the image object detection network to obtain an image object detection model; Step 3: Input the aerial image to be tested into the image target detection model to obtain the detection result.

2. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 1 is characterized in that: The backbone network includes two convolutional layers, four feature extraction layers and a spatial pyramid pooling module connected in sequence; wherein the feature extraction layer includes a downsampling module and an efficient feature extraction module connected thereto; The downsampling module is used to reduce the size of the original input feature map by half and double the number of channels to obtain a new feature map; The efficient feature extraction module is used to divide the original feature map output by the downsampling module into two groups of features from the channel dimension, refine one group of features using a balanced channel attention mechanism and a depth-separable convolution, and fuse the refined features with the other group of features to obtain a new feature map; Correspondingly, the outputs of the first three efficient feature extraction modules and the output of the spatial pyramid pooling module are used as four feature maps of different sizes extracted by the backbone network.

3. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 2 is characterized in that: The downsampling module is used to reduce the size of the original input feature map by half and double the number of channels to obtain a new feature map, specifically including: The input original feature map D in Generate two sets of features d1 and d2 from the channel dimension segmentation; According to the following formula, the size of one set of features d1 is halved and the number of channels is doubled to obtain a new feature D1; D1=Conv 1×1 (MaxPool(Conv 1×1 (d1))) According to the following formula, the size of another set of features d2 is halved and the number of channels is doubled to obtain a new feature D2; D2=Conv 1×1 (DWConv 3×3 (Conv 1×1 (d2))) According to the following formula, the new feature D1 and the new feature D2 are fused to obtain the new feature map D out ; D out =CS([D1,D2]) Among them, Conv 1×1 represents a 1×1 convolution operation, MaxPool represents a maximum pooling operation, and DWConv 3×3 denotes a 3×3 depthwise separable convolution operation, CS denotes a channel shuffle operation, and [·] denotes a channel concatenation operation.

4. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 2 is characterized in that: The process of obtaining a new feature map by the efficient feature extraction module specifically includes: The input original feature map E in Generate two sets of features f1 and f2 from the channel dimension split; Use the balanced attention mechanism to process one of the features f2 to obtain a new feature B out ; The new feature B is calculated according to the following formula out Perform refinement to obtain the refined feature E1; E1=Conv 1×1 (DWConv 3×3 (DWConv 3×3 (B out ))) According to the following formula, the refined feature E1 and another set of features f1 are fused to obtain a new feature map E out ; E2=Conv 1×1 ([f1,E1]) E out =CS([f1,E2,DWConv 3×3 (E2)]) Among them, Conv 1×1 Represents a 1×1 convolution operation, DWConv 3×3 represents a 3×3 depthwise separable convolution operation, E2 represents the intermediate feature, CS represents the channel shuffle operation, and [·] represents the channel concatenation operation.

5. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 4 is characterized in that:Use the equal attention balance mechanism to process one of the features f2 to obtain a new feature B out , specifically including: The input original feature map B in = f2 performs a global average pooling operation to obtain a new feature map B1, and performs a Reshape operation on the feature map B1 according to the following formula to obtain a new feature map B2; According to the following formula, the feature map B2 is processed using convolution and sigmoid function to obtain a feature map with different channel attention weights. Among them, C represents the feature map B in The number of channels, σ represents the sigmoid function; k represents the size of the convolution kernel; represents the element in the mth row and nth column in the k×k window centered on the i-th element in the feature map B2; w mn represents the weight of the mth row and nth column of the convolution kernel; a i Represents the i-th element of feature map A; First, reshape feature map A and then combine it with feature map B. in Perform multiplication operation and finally get the new feature B out .

6. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 5 is characterized in that: The following formula is used to calculate the size k of the convolution kernel: t=log2 C+1 7. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 2 is characterized in that: The feature processing process of the spatial pyramid pooling module includes: S1=Conv 1×1 ([Conv 1×1 (S in ),MaxPool(Conv 1×1 (S in ))]) S2=Conv 1×1 ([S1,MaxPool(S1)]) S out =Conv 1×1 ([S2,MaxPool(S2)]) Among them, Conv 1×1 represents a 1×1 convolution operation; MaxPool represents a maximum pooling operation. According to the order of feature processing, the kernel sizes are 5×5, 9×9, and 13×13 respectively.

8. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 1 is characterized in that: The process of generating three new feature maps of different sizes by the fine-grained feature enhancement module specifically includes: According to the following formula, three smaller feature maps F1, F2 and F3 output by the backbone network are adjusted to the same size and the same number of channels, the adjusted three feature maps are connected in the channel dimension, and then the channel information is fused using 1×1 convolution, and the number of channels is compressed to obtain the first aggregated feature map T1; T1=Conv 1×1 ([Reshape(F1),Conv 1×1 (F2),Reshape(F3)]) Generate a binary mask feature map M containing target position information according to the following formula; M=σ(Conv 1×1 (DWConv 3×3 (DWConv 3×3 (T1)))) The second post-polymerization characteristic graph T2 is obtained according to the following formula; The second aggregated feature map T2 is evenly divided into three groups of features in the channel dimension, and then the three groups of features are adjusted to the same size and the same number of channels as the features F1, F2 and F3, and then the adjusted three groups of features are connected with the corresponding features F1, F2 and F3 in the channel dimension to obtain three new feature maps F of different sizes. out_1 , F out_2 and F out_3 .

9. The lightweight aerial image target detection method based on fine-grained feature extraction according to claim 1 is characterized in that: In step 2, during the training process, the loss function Loss used is: Loss=λ1L box +λ2L obj +λ3L cls +λ4L mask =λ1L CIOU (P box ,T box )+λ2L BCE (P obj ,T obj )+λ3L BCE (P cls ,T cls )+λ4L BCE (P mask ,T mask ) Among them, L box represents the bounding box regression loss, using the CIOU loss function; L obj , L cls and L mask They represent confidence loss, classification loss and mask loss respectively, all of which adopt binary cross entropy loss function; λ1, λ2, λ3 and λ4 are all weights.