Infrared unmanned aerial vehicle detection method based on local and global attention adaptive selection

By employing a local-global attention adaptive Top-k selection infrared UAV detection method, which combines the Unet basic network and the Transformer attention mechanism, the problems of sparse constraints and low efficiency of global feature extraction in infrared UAV detection are solved, achieving efficient and accurate UAV target detection.

CN120431486BActive Publication Date: 2025-12-30国网湖北省电力有限公司直流公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510313497.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-12-30
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

Existing infrared UAV detection methods lack effective sparsity constraints and efficient global feature extraction, resulting in poor model generalization performance and low computational efficiency.

Method used

An infrared UAV detection method using local-global attention adaptive Top-k selection is adopted, which combines the Unet basic network, the local attention adaptive Top-k selection network, and the global attention adaptive Top-k selection network. Through multi-scale feature extraction and sparse constraints, efficient detection of infrared UAV targets is achieved.

Benefits of technology

It improves the performance of local and global feature extraction of infrared UAV targets, enhances the model's detection performance and computational efficiency, reduces the loss of UAV targets, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431486B_ABST
    Figure CN120431486B_ABST
Patent Text Reader

Abstract

The application discloses an infrared unmanned aerial vehicle detection method based on local and global attention adaptive selection, and a local-global attention adaptive selection infrared unmanned aerial vehicle detection network model comprises an Unet basic network, a local attention adaptive Top-k selection network, a global attention adaptive Top-k selection network and a feature fusion network; the Unet basic network comprises a residual attention module and a multi-scale feature extraction structure; the local attention adaptive Top-k selection network comprises an edge enhancement module, an adaptive Top-k selection module and a progressive cascade network structure, and processes local features of an output target; the global attention adaptive Top-k selection network comprises a minimum scale feature map Transformer attention calculation module, an attention matrix row coefficient adaptive Top-k selection module, an attention matrix column coefficient adaptive Top-k selection module and a fusion module, and processes global features of the output target; and the feature fusion network processes results of the above three networks and outputs a final detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, and more specifically, relates to an infrared UAV detection model method that combines local and global attention adaptive selection. Background Technology

[0002] Infrared thermal imaging technology boasts advantages such as good concealment, strong penetration, and all-weather operation, making it widely used in military and civilian fields. Infrared UAV detection, as a key technology in its application, plays a crucial role in early warning, defense, and environmental monitoring systems. However, influenced by factors such as hardware and imaging environment, infrared UAV detection still faces several challenges. First, due to the long imaging distance, UAVs typically appear as small point targets in the image, resulting in a lack of obvious shape features. Second, the attenuation of UAV radiation energy over long distances leads to low signal-to-clutter ratios, making them easily obscured by the background. Furthermore, the significant scale variations of UAVs in different scenarios increase the difficulty of detection. Therefore, the challenges of UAV detection can be summarized as: small size, invisibility, low signal-to-clutter ratio, and large scale variations.

[0003] To address the aforementioned challenges, numerous traditional infrared UAV detection methods have been proposed, including those based on filters, human vision, local contrast, and low-rank sparsity. However, these methods rely on prior knowledge for model design, and their fixed parameters are ill-suited to handle the diverse challenges of infrared UAV detection, resulting in poor generalization performance.

[0004] Deep learning-based infrared drone detection methods, relying on their powerful feature extraction capabilities, have significantly outperformed traditional methods in various detection metrics. These methods can be categorized into bounding box-based detection and pixel segmentation-based detection. Bounding box-based infrared drone detection methods typically improve upon visible light target detection models. For example, Ciocarlan et al. designed a new detection head based on the YOLO network and incorporated a negative example decision method to prioritize excluding non-target regions, thereby improving the model's drone detection performance. Segmentation-based infrared drone detection can achieve pixel-level detection accuracy, thus attracting widespread attention. Most segmentation-based infrared drone detection networks are based on the Unet framework, such as the currently popular DNA-net, UIUnet, and ACM methods, which use Unet for multi-scale feature extraction and fusion to obtain rich target features. To obtain global target features, some researchers have proposed infrared drone detection networks incorporating Transformer, leveraging Transformer's powerful global feature extraction capabilities to improve model detection performance. Despite the superior performance of deep learning-based methods compared to traditional approaches, these methods still offer significant advantages. However, these methods still lack effective prior constraints. Most methods increase the model's connections to extract rich target features, inevitably increasing model complexity and leading to decreased computational efficiency. Similarly, the Transformer's multi-head self-attention mechanism has high memory and computational requirements, severely impacting the efficiency of the network model. Summary of the Invention

[0005] In view of the shortcomings of existing technologies, the present invention aims to provide an infrared UAV detection method based on local-global attention adaptive Top-k selection, which aims to solve the problem of the lack of effective sparsity constraints and efficient global feature extraction in infrared UAV detection.

[0006] To address the aforementioned technical problems, this invention provides an infrared UAV detection method based on local-global attention adaptive Top-k selection. The method implements an infrared UAV detection model based on local-global attention adaptive Top-k selection, processes the input infrared UAV target image, and outputs the detection result of the UAV target.

[0007] The infrared UAV detection model based on local-global attention adaptive Top-k selection includes: a Unet base network, a local attention adaptive Top-k selection network, a global attention adaptive Top-k selection network, and a feature fusion network;

[0008] The Unet basic network includes a residual attention module and a multi-scale feature extraction structure. It processes infrared UAV target images as input and outputs the minimum-scale features, multi-scale features, and multi-scale fused features of the UAV target. The residual attention module is used for feature extraction in the downsampling, upsampling, and skip cascade processes of the multi-scale feature extraction structure to obtain feature maps at different scales. The multi-scale feature extraction structure is used to extract feature maps at different scales to obtain the minimum-scale features, multi-scale features, and multi-scale fused features of the UAV target.

[0009] The local attention adaptive Top-k selection network includes an edge enhancement module, an adaptive Top-k selection module, and a progressive cascaded network structure to process and output the local features of the UAV target. The edge enhancement module is used to enhance the edge features of the multi-scale features of the UAV target output by the Unet base network to obtain an edge-enhanced feature image. The adaptive Top-k selection module is used to calculate the attention of the edge-enhanced feature map at each scale and perform adaptive Top-k selection to obtain sparse attention at different scales. The progressive cascaded structure is used to progressively cascade the scale sparse attention at different scales and the edge-enhanced feature map to obtain the local feature map of the UAV target.

[0010] The global attention adaptive Top-k selection network includes a Transformer attention calculation module for the minimum scale feature map, an adaptive Top-k selection module for the row coefficients of the attention matrix, an adaptive Top-k selection module for the column coefficients of the attention matrix, and a fusion module. The Transformer attention calculation module for the minimum scale feature map is used to perform attention calculation on the minimum scale features of the UAV target output by the Unet base network to obtain an attention matrix. The adaptive Top-k selection module for the row coefficients of the attention matrix is ​​used to perform adaptive Top-k selection on the row coefficients of the input attention matrix to obtain a row-sparse attention matrix. The adaptive Top-k selection module for the column coefficients of the attention matrix is ​​used to perform adaptive Top-k selection on the column coefficients of the input row-sparse attention matrix to obtain a sparse attention matrix. The fusion module fuses the obtained sparse attention matrix with the feature vector to obtain the global feature image of the UAV target.

[0011] The fusion network is used to fuse the multi-scale fusion features of UAV targets output by the input Unet base network, the local features of UAV targets output by the local attention adaptive Top-k selection network, and the global features of UAV targets output by the global attention adaptive Top-k selection network to obtain the final target detection result.

[0012] The infrared UAV detection method based on local-global attention adaptive Top-k selection of the present invention further trains the infrared UAV detection model product based on local-global attention adaptive Top-k selection to obtain the trained infrared UAV detection model based on local-global attention adaptive Top-k selection.

[0013] The training loss includes the drone target loss for the original scale feature image and the drone target loss for the minimum scale feature image;

[0014] The target loss of the original-scale image includes the Soft-IoU loss of the output image of the Unet base network, the Soft-IoU loss of the output image of the local attention adaptive Top-k selection network, the Soft-IoU loss of the output image of the global attention adaptive Top-k selection network, and the Soft-IoU loss of the output image of the fusion network; the expression for the target loss of the original-scale image is:

[0015]

[0016] Among them, L Origin For the target loss of the original scale image, L Soft-IoU (,) represents the corresponding loss. Y1 is the UAV target detection image output by the Unet base network; Y2 is the UAV target detection image output by the local attention adaptive Top-k selection network; Y3 is the UAV target detection image output by the global attention adaptive Top-k selection network; Y4 is the UAV target detection image output by the fusion network. It provides real drone target images, including label information for the real target and background.

[0017] The minimum scale feature image target loss L Down The Unet base network outputs the Soft-IoU loss between the minimum-scale feature map of the UAV target and the downsampled real target image; the expression for the minimum-scale feature map target loss is:

[0018]

[0019] Among them, L Down Y5 represents the minimum scale feature image target loss, where Y5 is the minimum scale feature image of the UAV target. This is the downsampled image of the real target, including label information for the real target and the background;

[0020] The infrared UAV detection method based on local-global attention adaptive Top-k selection of the present invention includes the following specific detection steps after training the infrared UAV detection network model based on local-global attention adaptive Top-k selection:

[0021] Input an infrared drone target image, output the image detected by the infrared drone.

[0022] Compared with the prior art, the above-described technical solutions conceived in this invention can achieve the following results.

[0023] Beneficial effects:

[0024] 1. This invention provides an infrared UAV detection method based on local-global attention adaptive Top-k selection. The local attention adaptive Top-k selection network helps improve the local feature extraction performance of infrared UAV targets; the global attention adaptive Top-k selection network helps improve the global feature extraction performance of infrared UAV targets. Therefore, compared with existing infrared UAV detection technologies, the sparse constraints combined with adaptive Top-k selection are more conducive to the feature extraction of UAV targets, improving the feature extraction efficiency of the network and thus improving the detection performance of the model.

[0025] 2. This invention provides an infrared UAV detection method based on local-global attention adaptive Top-k selection. The local attention adaptive Top-k selection network improves the performance of local feature extraction through a multi-scale feature edge enhancement module, an adaptive Top-k feature extraction module, and a cascaded structure feature extraction module. Existing local feature extraction techniques lack effective sparse attention constraints. The local attention adaptive Top-k selection network, however, applies sparse constraints to target features through Top-k selection technology, thereby effectively improving the final local feature extraction performance of the UAV target.

[0026] 3. This invention provides an infrared UAV detection method based on local-global attention adaptive Top-k selection. The global attention adaptive Top-k selection network improves the efficiency of global feature extraction through a Transformer attention calculation module based on the minimum scale feature map, a Top-k selection module for row coefficients of the attention matrix, a Top-k selection module for column coefficients of the attention matrix, and a fusion module. Existing Transformer-based target detection networks lack effective sparsity constraints or perform attention calculation based on the original scale feature map, resulting in low efficiency in network feature extraction. Because this invention performs global feature extraction of the Transformer based on the minimum scale feature map and adds Top-k sparsity constraints, it effectively improves the detection performance of the network.

[0027] 4. This invention provides an infrared drone detection method based on local-global attention adaptive Top-k selection. The loss function includes drone target loss from the original scale feature image and drone target loss from the minimum scale feature image. A downsampled drone target loss is added to the original scale feature image drone target loss to ensure the network can effectively extract global features of the drone target. Existing technologies neglect the attention to downsampling loss, leading to the easy loss of drone targets after downsampling. This invention uses the minimum scale feature map after downsampling for loss learning, reducing the loss of drone targets and effectively improving the model's detection performance. Attached Figure Description

[0028] Figure 1 This invention provides an infrared UAV detection network framework with local-global attention adaptive Top-k selection, as described in the embodiments of the present invention.

[0029] Figure 2 This is a block diagram of a local attention adaptive Top-k selection network provided in an embodiment of the present invention;

[0030] Figure 3 This is a block diagram of an adaptive Top-k selection network provided in an embodiment of the present invention;

[0031] Figure 4 The diagram below shows the global attention adaptive Top-k selection network provided in this embodiment of the invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0033] The following description, in conjunction with a preferred embodiment, illustrates the content involved in the above embodiments.

[0034] like Figure 1 As shown, the present invention provides an infrared UAV detection method based on local-global attention adaptive Top-k selection, including the implementation of an infrared UAV detection model based on local-global attention adaptive Top-k selection. This model processes the input infrared UAV target image and outputs the detection result of the UAV target.

[0035] The infrared UAV detection model based on local-global attention adaptive Top-k selection includes: Unet basic network, local attention adaptive Top-k selection network, global attention adaptive Top-k selection network, and feature fusion network.

[0036] The Unet basic network includes a residual attention module and a multi-scale feature extraction structure. It is used to process the input infrared UAV image and process the output UAV target's minimum scale features, multi-scale features, and multi-scale fused features. The residual attention module is used for feature extraction in the downsampling, upsampling, and skip cascade processes in the multi-scale feature extraction structure to obtain feature maps at different scales. The multi-scale feature extraction structure is used to extract feature maps at different scales to obtain the UAV target's minimum scale features, multi-scale features, and multi-scale fused features.

[0037] The Local Attention Adaptive Top-k Selection Network comprises an edge enhancement module, an adaptive Top-k selection module, and a progressive cascaded network structure to process the local features of the output UAV target. The edge enhancement module enhances the multi-scale features of the UAV target output by the Unet base network to obtain an edge-enhanced feature map. The adaptive Top-k selection module calculates the attention for each scale of the edge-enhanced feature map and performs adaptive Top-k selection to obtain sparse attention at different scales. The progressive cascaded structure progressively cascades the multi-scale sparse attention and the edge-enhanced feature map to obtain the local feature map of the UAV target.

[0038] The global attention adaptive Top-k selection network comprises a Transformer attention computation module for minimum-scale feature maps, an adaptive Top-k selection module for row coefficients of the attention matrix, an adaptive Top-k selection module for column coefficients of the attention matrix, and a fusion module. The Transformer attention computation module for minimum-scale feature maps performs attention computation on the minimum-scale features of the UAV target output from the Unet base network to obtain an attention matrix. The adaptive Top-k selection module for row coefficients performs adaptive Top-k selection on the row coefficients of the input attention matrix to obtain a row-sparse attention matrix. The adaptive Top-k selection module for column coefficients performs adaptive Top-k selection on the column coefficients of the input row-sparse attention matrix to obtain a sparse attention matrix. The fusion module fuses the obtained sparse attention matrix with the feature vectors to obtain the global feature image of the UAV target.

[0039] The feature fusion network is used to fuse the multi-scale fusion features of the UAV target output by the Unet base network, the local features of the UAV target output by the local attention adaptive Top-k selection network, and the global features of the UAV target output by the global attention adaptive Top-k selection network to obtain the final target detection result.

[0040] This embodiment processes the input infrared UAV target image using the Unet basic network to obtain the minimum-scale and multi-scale features of the UAV target, which are then used in the local and global attention-adaptive Top-k selection network to obtain a multi-scale fusion feature F. U :

[0041] F U =w0Concat(UP(w1Concat(UP(w2Concat(UP(w3Concat(Up(F 4 ),F 3 )),F 2 )),F 1 )),F 0 )

[0042] Among them, F i This represents the feature maps at different scales after i downsampling operations in Unet, where i = [0, 1, ..., 4]; w i The fusion weights are represented by i = [0, 1, ..., 4]; UP(·) represents upsampling, and Concat(·) represents concatenation.

[0043] This embodiment employs a local attention adaptive Top-k selection network to perform Top-k extraction of local features from the multi-scale features of the input UAV target, achieving sparsity constraints to extract key target regions and thus improving the efficiency of network feature extraction. To achieve effective sparsity constraints, this invention uses multiple feature layers for progressive Top-k selection.

[0044] In this embodiment, the Local Attention Adaptive Top-k Selection Network operates on the coding layers: L1, L2, L3, and L4, and its structure is as follows: Figure 2 As shown. Since the edges of infrared UAV images are usually blurry, the network first performs multi-scale edge attention enhancement. The enhanced edge feature map F... B It can be represented as:

[0045]

[0046] In the formula, and These represent the max pooling and average pooling features extracted with a kernel size of i, respectively.B The weights are mixed for edge features.

[0047] Secondly, the edge feature map F B Weights w are calculated after attention. s The activation of the σ(Sigmoid(·)) function is converted into the spatial attention score S to be selected:

[0048] S=σ(w s F B )

[0049] Next, an adaptive Top-k selection is performed on the attention score S in the space, the process of which is as follows: Figure 3 As shown. This embodiment first extracts sparse attention with different selection rates, and then uses weights w k Adaptive cascaded mixing is performed. Therefore, the sparse spatial attention score S of local features is obtained through the Top-k selection module. k :

[0050]

[0051] in, Indicates the selection rate as k l The spatial attention score is given below, where (i,j) represents the spatial coordinates, and {k} l |l∈[1,2,…,m]} represents multiple selection rates (i.e., retaining the top k). l The proportion of attention, as used in this embodiment with four selectivity rates: 0.1, 0.2, 0.4, and 0.8), w k The mixed weights are for the Top-k scores. It can be represented as:

[0052]

[0053] in, Represents the top k after sorting by spatial attention score. l The coordinates of a larger fraction.

[0054] Finally, the attention score of the current feature map is applied to the larger-scale feature map of the next layer to perform Top-k calculation for that layer:

[0055]

[0056] Among them, S next , and These represent the attention score, attention calculation weight, and edge features of the larger-scale feature map in the next layer, respectively.

[0057] The local features F of the final UAV target are obtained through multi-layer progressive cascading.L :

[0058]

[0059] in, S represents the edge enhancement feature map of coding layer L1. 2 The attention score is obtained after multi-layer cascading computation of the L2 edge enhancement feature map, the L3 and L4 feature maps, and the attention calculated in the manner described above.

[0060] In this embodiment, the global attention adaptive Top-k selection network operates on the last layer of the network downsampling module, namely the Unet base network, which outputs the minimum scale features of the UAV target. The minimum scale feature map is used for loss learning and Transformer Top-k selection to achieve efficient global feature extraction.

[0061] The overall structure of the global attention adaptive Top-k selection network is as follows: Figure 4 As shown, the network first performs spatial block embedding on the feature map to obtain a vector for each spatial block, and then performs feature mapping to obtain the vectors Q, K, and V for self-attention computation. Next, it calculates the similarity matrix between spatial blocks. Here, c represents the number of spatial blocks, and this matrix describes the correlation between each spatial block on the feature map. A higher correlation coefficient in matrix C indicates a greater likelihood that the spatial block at that location contains the target. Therefore, this embodiment applies sparse constraints to Top-k selection based on this matrix to improve network performance. Simultaneously, this invention performs target loss learning on the input feature map, enhancing the difference between the target and the background, which helps improve the accuracy of Top-k selection.

[0062] Due to the sparsity of infrared UAV targets, the Transformer self-attention score matrix also exhibits sparsity. However, according to the formula for calculating the self-attention score, Softmax(QK)... T As can be seen from V, the self-attention score of a spatial block is the result of multiplying the row coefficients of the corresponding C matrix of that block by V (all spatial blocks). Therefore, directly performing Top-k selection of the space based on the C matrix may result in the background block attention corresponding to the row coefficients of the C matrix having a high correlation with the target block (easily retained), thus affecting the accuracy of the background attention score calculation. Therefore, this invention first performs Top-k selection of the row coefficients of the C matrix to obtain a row-sparse matrix.

[0063]

[0064] Where (i,:) represents the index position of all relevance coefficients corresponding to row index i. This represents the row indices of the k largest values ​​in matrix C after sorting by the sum of their row coefficients. After considering various selection ratios r... k ∈[r k1 ,r k2 ,...,r km and adaptive weights w r The mixture yields the final row sparse matrix C. r :

[0065]

[0066] C r The sparse rows of the matrix allow attention calculations to focus more intently on the target region, thus improving the accuracy of attention calculations. However, in the case of target block attention corresponding to C... r The row correlation coefficients of the matrix also contain a large number of coefficients related to the background blocks. Due to the spatial sparsity of infrared targets, the correlation calculations between many targets and the background become overly redundant, affecting the accuracy of the attention calculation. Therefore, this invention performs a second Top-k selection to reduce redundant attention calculations for each candidate target block, obtaining a sparse matrix C. k :

[0067]

[0068] Where, index k Indicate C r The indices of the first k maximum values ​​of the coefficients in each row. Similarly, through various selection rates k∈[k1,k2,...,k g The sparse matrix is ​​used for subsequent adaptive attention calculation.

[0069] Finally, the obtained sparse matrix is ​​subjected to self-attention computation to obtain the target's contextual information, and multiple sparse attention operations are fused to obtain the final global feature F of the UAV target. G :

[0070]

[0071] Among them, w g This uses a global attention-mixed weighting. Therefore, only selected image spatial blocks can participate in the global self-attention calculation, making the Transformer focus more on global feature extraction of the target region, thereby improving the network's detection performance.

[0072] In this embodiment, the outputs of the Unet base network, the local attention adaptive Top-k selection network, and the global attention adaptive Top-k selection network are fused to obtain the final prediction Y:

[0073] Y = wConcat(F)U ,F L ,F G )

[0074] Where w is the fusion weight.

[0075] The training method of the infrared UAV detection model based on local-global attention adaptive Top-k selection in this embodiment trains the aforementioned model to obtain the trained infrared UAV detection model based on local-global attention adaptive Top-k selection.

[0076] The training loss includes the drone target loss for the original scale feature image and the drone target loss for the minimum scale feature image;

[0077] The target loss of the original-scale image includes the Soft-IoU loss of the output image of the Unet base network, the Soft-IoU loss of the output image of the local attention adaptive Top-k selection network, the Soft-IoU loss of the output image of the global attention adaptive Top-k selection network, and the Soft-IoU loss of the output image of the fusion network; the expression for the target loss of the original-scale image is:

[0078]

[0079] Among them, L Origin For the target loss of the original scale image, L Soft-IoU (,) represents the corresponding loss. Y1 is the UAV target detection image output by the Unet base network; Y2 is the UAV target detection image output by the local attention adaptive Top-k selection network; Y3 is the UAV target detection image output by the global attention adaptive Top-k selection network; Y4 is the UAV target detection image output by the fusion network. The images are of real drone targets, including label information for the real targets and backgrounds.

[0080] Minimum Scale Feature Image Target Loss L Down The Unet base network outputs the Soft-IoU loss between the minimum-scale feature map of the UAV target and the downsampled real target image; the minimum-scale feature image target loss L Down The expression is:

[0081]

[0082] Where Y5 is the smallest-scale feature image of the UAV target. This is the downsampled image of the real target, including label information for the real target and the background;

[0083] This implementation inputs an infrared UAV target image into the local-global attention adaptive Top-k selection infrared UAV detection network model provided in the example. After a series of image processing steps, it outputs an image after infrared UAV detection. Because the Top-k selection of local-global features applies sparsity constraints to the extracted feature maps and attention, the model's efficiency is effectively improved, thereby enhancing the performance of UAV detection. Furthermore, due to the loss learning of downsampled feature maps, the loss from UAV downsampling is effectively reduced, improving the accuracy of UAV detection.

[0084] The infrared UAV detection method based on local-global attention adaptive Top-k selection provided in this invention is implemented based on the trained local-global attention adaptive Top-k selection infrared UAV detection network model provided in any embodiment of this invention, and has corresponding beneficial effects.

[0085] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An infrared UAV detection method based on local and global attention adaptive selection, characterized in that, An infrared unmanned aerial vehicle detection model based on local and global attention adaptive selection is implemented based on an Unet basic network, a local attention adaptive Top-k selection network, a global attention adaptive Top-k selection network, and a feature fusion network; The Unet basic network comprises a residual attention module and a multi-scale feature extraction structure, is used for processing an input infrared unmanned aerial vehicle target image, and outputs minimum scale features, multi-scale features, and multi-scale fusion features of the unmanned aerial vehicle target; wherein the residual attention module is used for feature extraction in a down-sampling, up-sampling, and jump cascade process in the multi-scale feature extraction structure, to obtain feature maps of different scales; and the multi-scale feature extraction structure is used for extracting feature maps of different scales, to obtain the minimum scale features, the multi-scale features, and the multi-scale fusion features of the unmanned aerial vehicle target; The local attention adaptive Top-k selection network comprises an edge enhancement module, an adaptive Top-k selection module, and a progressive cascade network structure, is used for processing local features of the unmanned aerial vehicle target, the edge enhancement module is used for performing edge feature enhancement on the multi-scale features of the unmanned aerial vehicle target output by the Unet basic network, to obtain an edge-enhanced feature map, the adaptive Top-k selection module is used for calculating attention and performing adaptive Top-k selection on each scale of the edge-enhanced feature map, to obtain sparse attention under different scales, and the progressive cascade network structure is used for progressively cascading the sparse attention under different scales and the edge-enhanced feature map, to obtain a local feature map of the unmanned aerial vehicle target; The global attention adaptive Top-k selection network comprises a Transformer attention calculation module of minimum scale feature maps, an adaptive Top-k selection module of row coefficients of an attention matrix, an adaptive Top-k selection module of column coefficients of the attention matrix, and a fusion module; the Transformer attention calculation module of the minimum scale feature maps is used for performing attention calculation on the minimum scale features of the unmanned aerial vehicle target output by the Unet basic network, to obtain an attention matrix; the adaptive Top-k selection module of the row coefficients of the attention matrix is used for performing adaptive Top-k selection on the row coefficients of the attention matrix, to obtain a row-sparse attention matrix; the adaptive Top-k selection module of the column coefficients of the attention matrix is used for performing adaptive Top-k selection on the column coefficients of the row-sparse attention matrix, to obtain a sparse attention matrix; and the fusion module is used for fusing the obtained sparse attention matrix and a feature vector, to obtain a global feature image of the unmanned aerial vehicle target; The feature fusion network is used for fusing the multi-scale fusion features of the unmanned aerial vehicle target output by the Unet basic network, the local features of the unmanned aerial vehicle target output by the local attention adaptive Top-k selection network, and the global features of the unmanned aerial vehicle target output by the global attention adaptive Top-k selection network, to obtain a final target detection result.

2. The method of claim 1, wherein, The infrared unmanned aerial vehicle detection model based on local and global attention adaptive selection is further trained using infrared unmanned aerial vehicle images before use, and the training loss includes target loss of an original scale feature image and target loss of a minimum scale feature image; The target loss of the original scale feature image includes a Soft-IoU loss of an Unet base network output image, a Soft-IoU loss of a local attention adaptive Top-k selection network output image, a Soft-IoU loss of a global attention adaptive Top-k selection network output image, and a Soft-IoU loss of a fusion network output image.

3. The method of claim 2, wherein, The target loss of the original scale feature image is: ; wherein, L Origin is the original scale feature image target loss, L Soft-IoU (,) represents the corresponding loss, Y1 is the detection image of the unmanned aerial vehicle target output by the Unet basic network; Y2 is the detection image of the unmanned aerial vehicle target output by the local attention adaptive Top-k selection network; Y3 is the detection image of the unmanned aerial vehicle target output by the global attention adaptive Top-k selection network; Y4 is the detection image of the unmanned aerial vehicle target output by the fusion network; is the image of the real unmanned aerial vehicle target, including the label information of the real target and the background.

4. The method of claim 2, wherein, The minimum scale feature map image target loss L Down The minimum scale feature map image target loss L is a Soft-IoU loss between the minimum scale feature map of the Unet base network output and the real target image after down-sampling. ; wherein L Down is the minimum scale feature image target loss, L Soft-IoU denotes the corresponding loss, Y5 is the minimum scale feature image of the UAV target, is the down-sampled real target image, including the label information of the real target and the background.

5. The method for infrared drone detection based on local and global attention adaptive selection according to claim 1, characterized in that, The multiscale fusion feature output by the Unet base network is: F U = w0 Concat (UP(w1 Concat (UP(w2 Concat (UP(w3 Concat (Up(F 4 ), F 3 )), F 2 )), F 1 )), F 0 ) where F U denotes the multi-scale fusion feature, F i denotes the feature map of different scales after down-sampling i times in Unet, i = [0, 1, …, 4]; w i denotes the fusion weight, i = [0, 1, …, 4]; UP(·) denotes up-sampling, and Concat(·) denotes concatenation.

6. The infrared unmanned aerial vehicle detection method based on local and global attention adaptive selection according to claim 1, characterized in that, In the local attention adaptive Top-k selection network, the local attention adaptive Top-k selection network acts on the encoding layers: L1, L2, L3 and L4. The local attention adaptive Top-k selection network first performs multi-scale edge attention enhancement on the feature map F B is represented as: ; In the formula, and are the maximum pooling and average pooling features extracted under the convolution kernel size i, w B is the mixed weight of edge features; Edge-enhanced feature map F B Attention-computed weights w s and a σ (Sigmoid(·)) function activation to spatial attention scores S to be selected: S = σ(w s F B ); Then, the attention score S of the space is subjected to adaptive Top-k selection, sparse attention is first extracted at different selection rates, and then the sparse spatial attention score S of the local feature is obtained through the weight w k Adaptive cascade mixing is performed, and the sparse spatial attention score S of the local feature is obtained through the adaptive Top-k selection module k : ; wherein, represents the selection rate is k l under the spatial attention score, (i, j) is the spatial coordinate position, {k l | l ∈ [1, 2, …, m]} represents a plurality of selection rates, w k is the mixing weight of Top-k score, is: ; wherein, represent the coordinates of the top k l larger scores ordered by spatial attention score magnitude. Finally, the attention score of the current feature map is applied to the feature map of the next layer with a larger scale to perform Top-k calculation of the layer: ; wherein S next 、 and respectively represent the attention score, the attention calculation weight and the edge feature of the larger scale feature map of the subsequent layer. The final UAV target local feature F is obtained through multi-layer progressive cascade L : ; wherein, denotes the edge enhanced feature map of the encoding layer L1, S 2 denotes the attention score obtained after the multi-level concatenation computation of the edge enhanced feature map of the encoding layer L2, S 7. The method of claim 1, wherein the method is based on local and global attention adaptive selection for infrared drone detection. The global attention adaptive Top-k selection network first performs spatial block embedding on the feature map to obtain a vector of each spatial block, and performs feature mapping to obtain vectors Q, K and V for self-attention calculation; secondly, a similarity matrix between spatial blocks is calculated where c is the number of spatial blocks; performing a row coefficient Top-k selection of the C matrix to obtain a row sparse matrix ; ; where (i, :) denotes the index position of all correlation coefficients corresponding to the row index i, denotes the row index corresponding to the first k largest values of the matrix C sorted according to the size of the sum of row coefficients, through a variety of selection rates r k k1 k2 km and adaptive weights w r The final row sparse matrix C r is obtained by mixing​​​ ; A second Top-k selection is performed to reduce the redundant attention computation for each candidate target block, obtaining a sparse matrix C k : ; wherein index k represents the index of the k-th largest coefficient in each row of C r ; the subsequent adaptive attention calculation is performed by sparse matrices with various selection rates k∈[k1,k2,...,k g ] Finally, the obtained sparse matrix is subjected to self-attention calculation to obtain context information of the target, and fusion of multiple sparse attentions is performed to obtain the final global feature F of the UAV target G : ; where w g is a global attention mixing weight.

Citation Information

Patent Citations

  • Target detection method and network based on feature enhancement and global attention

    CN118644757A

  • Infrared small target detection network based on feature enhancement

    CN118736214A