Unmanned aerial vehicle multi-scale target detection method based on DINO framework
By improving the hybrid Transformer backbone network of the DINO framework and combining PatchPartition, DA-STB and CGTB modules, the problem of insufficient detection accuracy in multi-scale and complex backgrounds of UAV target detection is solved, and efficient and accurate target detection and recognition are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-14
AI Technical Summary
Existing UAV target detection methods lack accuracy in multi-scale target detection and detection under complex backgrounds, especially in small target detection and complex background interference environments, making it difficult to effectively extract and identify targets.
We employ a hybrid Transformer backbone network based on the DINO framework, combining PatchPartition, DA-STB, and CGTB modules. By improving the backbone network structure, we optimize feature extraction and object detection, including feature enhancement from Patch Merging, DA-STB, and CGTB modules, to capture long-range dependencies and suppress complex background noise.
It significantly improves the accuracy and efficiency of multi-scale target detection, especially in small targets and complex backgrounds, and enhances the model's adaptability in complex environments.
Smart Images

Figure CN121861518A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) target detection technology, and in particular to a multi-scale UAV target detection method based on the DINO framework. Background Technology
[0002] With the rapid development of drone technology, it has been widely used in transportation, military reconnaissance, civilian surveying and mapping, logistics and distribution, security monitoring and other fields. In these application scenarios, drones need to have the ability to accurately detect various targets in order to achieve functions such as autonomous navigation and mission execution.
[0003] Existing technologies in the field of UAV image target detection are mainly based on Convolutional Neural Networks (CNNs), Transformers, and combinations of both. These solutions aim to address the challenges of target detection in UAV images, such as complex backgrounds, diverse scales, and uneven target distribution.
[0004] (1) CNN-based object detection
[0005] CNNs possess powerful adaptive learning and feature extraction capabilities, but they suffer from the following drawbacks: When handling multi-scale targets, CNN-based models primarily rely on large-scale proposals, anchor boxes, or window centers for class prediction. The repetitive design of prediction boxes and anchor boxes, as well as the allocation between objects and anchor boxes, severely impacts the model's post-processing performance. Furthermore, this model struggles to effectively capture global features, such as long-range dependencies, limiting its ability to detect small targets and handle complex backgrounds.
[0006] (2) Target detection based on Transformer
[0007] The Transformer, based on a self-attention mechanism, enables long-distance dependency modeling and has been applied in computer vision tasks. However, it suffers from several drawbacks: Transformer-based models have high computational complexity, with quadratic computational complexity related to image resolution or the number of tokens, resulting in massive attention computation costs when processing long sequences of tokens. Furthermore, this model lacks the ability to capture spatial information within image patches, easily losing local information. Simultaneously, Transformer-based models require large-scale training datasets and high-performance computing resources; with limited data or training resources, their performance is inferior to CNN-based models with the same number of parameters. Current Transformer architectures exhibit redundant computation when modeling long-distance dependencies and perform poorly in separating small targets from the background, leading to decreased detection accuracy in complex scenes. The original Swin Transformer has limited ability to model the spatial distribution of targets in the deep feature extraction stage, making it difficult to adequately adapt to variations in small targets, dense targets, and complex backgrounds.
[0008] (3) CNN-Transformer hybrid method
[0009] By constructing a hybrid model that combines the advantages of CNNs and Transformers, the following drawbacks exist: on the one hand, further research is needed to effectively integrate the local and global features in CNNs and Transformers; on the other hand, this hybrid model also requires a large amount of data and a long training time, otherwise it is difficult to achieve good performance.
[0010] In addition to the problems mentioned above, existing UAV target detection methods also have the following shortcomings:
[0011] 1. Difficulty in multi-scale target detection: UAV aerial images contain multi-scale objects ranging from pixel-level small targets (such as pedestrians) to hundred-meter-level large targets (such as buildings). Traditional feature extraction methods are difficult to take into account both details and semantic information. Furthermore, the existing FPN structure has insufficient fusion efficiency, insufficient multi-scale target detection accuracy, and insufficient global dependency modeling in complex backgrounds.
[0012] 2. Loss of features for small targets: Small targets have too low resolution in deep feature maps. In aerial images, the proportion of targets is often less than 1%. Traditional CNNs are prone to losing detailed features, and existing methods have a bottleneck in small target detection.
[0013] 3. Complex image background: During actual shooting, the lighting conditions of drones are constantly changing and the environment is complex and diverse, which can easily introduce redundant or interfering information, thus significantly increasing the difficulty of target detection and recognition tasks.
[0014] The invention patent with publication number CN117593716 A discloses a lane line recognition method and system based on UAV inspection images, which uses a Swing Transformer network model to recognize lane lines in UAV inspection images. However, the Swing Transformer network model in this scheme uses a multilayer perceptron (MLP) layer for nonlinear transformation and mapping of feature dimensions. The MLP cannot achieve nonlinear enhancement of features and channel self-adjustment, resulting in insufficient local feature modeling capabilities.
[0015] The DINO (Detection with Improved Neural Network Optimization) framework, as an advanced object detection framework, requires further optimization tailored to the characteristics of UAV images when applied to UAV object detection. Therefore, developing an algorithm that fully leverages the advantages of the DINO framework and combines it with a novel Transformer structure to improve UAV object detection performance is of significant practical importance. Summary of the Invention
[0016] The purpose of this invention is to at least address one of the aforementioned technical deficiencies.
[0017] Therefore, the purpose of this invention is to propose a UAV multi-scale target detection method based on the DINO framework, which can significantly improve the accuracy and efficiency of multi-scale target detection, especially in small target detection and complex background interference environments, and has stronger target perception and extraction capabilities.
[0018] To achieve the above objectives, embodiments of the present invention provide a UAV multi-scale target detection method based on the DINO framework, comprising the following steps:
[0019] S1, Construct a hybrid Transformer backbone network, which includes: a PatchPartition image preprocessing layer, a first-stage DA-STB structure, a second-stage DA-STB structure, a third-stage DA-STB structure, and a fourth-stage cross-gated CGTB structure; wherein, the first-stage DA-STB structure and the second-stage DA-STB structure each use 2 consecutive DA-STB modules, and the third-stage DA-STB structure uses 18 consecutive DA-STB modules, with every 2 consecutive DA-STB modules forming a group;
[0020] S2, the image to be processed is input to the Patch Partition image preprocessing layer, which divides the image into segments. The feature map, where H is the height of the input image resolution and W is the width of the input image resolution;
[0021] S3, the The feature map is input into the first-stage DA-STB structure for processing to extract local features from the feature map output by the upper layer, thus obtaining the feature map. The feature map The input is processed in the second-stage DA-STB structure to increase the number of channels, and then passed through two consecutive DA-STB modules to obtain the feature map. The feature map The input is processed by the third-stage DA-STB structure, and then passed through 18 consecutive DA-STB modules to obtain the feature map.
[0022] S4, feature map The input is fed into the fourth-stage cross-gated CGTB structure for feature enhancement, including: first, the feature map... The input is downsampled into the Patch Merging layer, and then the layer is normalized. The normalized feature map is processed by the cross-shaped window self-attention CSWSA module to capture long-distance dependencies. The feature map processed by the CSWSA module is then input into the gated deep convolutional feedforward network GDFN module for further processing, and is used as the multi-scale feature output of the hybrid Transformer backbone network.
[0023] S5. The multi-scale features output by the hybrid Transformer backbone network are input into the original Neck module of the DINO model to construct a feature pyramid. The feature pyramid generates global features through the encoder of the DINO framework. The decoder of the DINO framework performs hybrid query initialization and contrastive denoising training on the global features output by the encoder, and outputs the target category and bounding box prediction results.
[0024] Furthermore, in S2, the input image with dimensions H×W×3 is first divided into... Each image patch is divided into 4×4×3 blocks. Each block is then concatenated according to the channel direction of its pixels to form a token for each patch. This generates a token sequence. The feature maps are used as input for the Transformer architecture; each token corresponds to a local region of the image, providing input for the subsequent Patch Merging downsampling and window self-attention modules, while taking into account both local spatial information and the sequence input requirements of the Transformer.
[0025] Furthermore, the two consecutive DA-STB modules in the first-stage DA-STB structure, the second-stage DA-STB structure, and the third-stage DA-STB structure are configured as follows: the first DA-STB module includes a layer normalized LN layer, a window-based multi-head self-attention layer W-MSA layer, and a dual adaptive neural block DA module; the second DA-STB module includes an LN layer, a SW-MSA layer, and a DA module.
[0026] Furthermore, the execution flow of the first DA-STB module is as follows:
[0027] Perform layer normalization on the input feature map;
[0028] The normalized feature map is divided into non-overlapping windows. Multi-head self-attention (W-MSA) calculation is performed in each window. The attention outputs of different heads are then concatenated and projected through a linear layer to obtain the window attention output.
[0029] The window attention output is added to the input feature map to perform the first residual connection;
[0030] The summed feature maps are then normalized layer by layer and then input into the dual adaptive neural block DA module.
[0031] A dual adaptive neural block DA module is used to perform mixed projection on the input features through pointwise convolution to obtain the fused feature map. A dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature.
[0032] The final feature output by the dual adaptive neural block (DA) module is added to the feature map of the first residual connection, and a second residual connection is performed to obtain the output feature map of the first DA-STB module.
[0033] Furthermore, the execution flow of the second DA-STB module is as follows:
[0034] Perform layer normalization on the feature map output by the first DA-STB module;
[0035] The normalized feature map is input into the SW-MSA layer, and a shift operation is performed on the feature map to fuse the spatial information of adjacent positions. After the shift operation, the new feature map is divided into non-overlapping windows, and multi-head self-attention is calculated in each window to obtain the shifted window attention output.
[0036] The shifted window attention output is added to the feature map output by the first DA-STB module to perform the first residual connection;
[0037] The summed feature maps are then normalized layer by layer and then input into the dual adaptive neural block DA module.
[0038] A dual adaptive neural block DA module is used to perform mixed projection on the input features through pointwise convolution to obtain the fused feature map. A dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature.
[0039] The final feature output by the dual adaptive neural block (DA) module is added to the feature map of the first residual connection, and a second residual connection is performed to obtain the output feature map of the second DA-STB module.
[0040] Furthermore, in S3, the aforementioned The feature map is input into the first-stage DA-STB structure for processing, including:
[0041] The The feature map is input into the Linear Embdding layer, and a 1×1 convolution is used to adjust the number of channels of the feature map output by the PatchPartition layer to C, resulting in a new feature map z. l-1 Then the feature map z l-1 The feature maps are obtained by sequentially passing through two consecutive DA-STB modules.
[0042] Furthermore, in S3, the feature map is... The input is fed into the second-stage DA-STB structure for processing to increase the number of channels and form hierarchical features, including:
[0043] First, the feature map The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels, forming hierarchical features; then the hierarchical features are passed sequentially through two consecutive DA-STB modules to obtain the feature map.
[0044] Furthermore, in S3, the feature map is... The input is fed into the third-stage DA-STB structure for processing to extract features with semantic information, including:
[0045] First, the feature map The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels. Then, it passes sequentially through nine DA-STB module groups, each consisting of two consecutive DA-STB modules, to obtain the feature map.
[0046] Further, in S4, the processing of the feature map through the cross-shaped window self-attention CSWSA module includes:
[0047] The normalized feature map is input into the CSWSA module. The input features are first divided into strips in the horizontal and vertical directions. The heads of different groups perform self-attention calculations on the horizontal and vertical strips respectively. Finally, the two sets of results are concatenated and projected to obtain the self-attention output features. The self-attention output features are then residually connected with the input features.
[0048] Further, in S4, the step of inputting the feature map processed by the CSWSA module into the GDFN module for processing includes:
[0049] Features after residual connection Layer normalization is performed, and then the data is input into the GDFN module. The calculation process of the GDFN module is as follows:
[0050] First of all Gating mechanisms and deep convolution calculations are performed; then, the output features processed by gating mechanisms and deep convolutions are compared with the input features. The sum of.
[0051] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows:
[0052] The UAV multi-scale target detection method proposed in this invention, based on the DINO framework, significantly improves the accuracy and efficiency of multi-scale target detection by optimizing the backbone structure and combining DA-STB and CGTB (Cross-Gated Transformer Block) modules. It has a stronger target perception and extraction capability, especially in small target detection and complex background interference environments.
[0053] 1. This invention, taking into account the unique characteristics of UAV images, constructs a target detection model for small targets in UAV images. Through the design and optimization of the model structure, detection accuracy is effectively improved, and the model's adaptability in complex environments is enhanced. This invention achieves efficient detection and high-precision localization of multi-scale targets in UAV images, especially small targets and targets against complex backgrounds, by improving the backbone network structure.
[0054] 2. This invention first employs the Swing Transformer as the backbone network, utilizing its hierarchical structure and window self-attention mechanism to effectively construct cross-scale feature representations. An optimized DA-STB module is used, replacing the traditional multilayer perceptron structure with a Dual Adaptive Neural Block (DA) module while maintaining the original Swing Transformer's hierarchical sliding window attention mechanism. The Dual Adaptive Neural Block DA module achieves non-linear feature enhancement and channel self-adjustment through grouped convolutions and dual-channel adaptive activation. Simultaneously, combined with a 1×1 convolutional post-fusion structure, it effectively improves local feature modeling capabilities and context-dependent expression.
[0055] 3. The cross-gated CGTB module proposed in this invention combines innovative feature learning strategies, including cross-shaped window self-attention (CSWSA) and gated deep convolutional feedforward network (GDFN). CSWSA effectively captures long-distance correlations in feature maps, thereby better extracting the boundaries between small objects and complex backgrounds in UAV images. GDFN introduces a gated deep convolution mechanism to achieve non-linear enhancement of features and suppression of invalid information, effectively reducing the number of parameters and thus improving detection accuracy and computational efficiency.
[0056] 4. This invention uses the CGTB module to accurately perceive the spatial distribution of targets and adapt to scale changes in various scenarios, giving it a significant advantage in dealing with dense targets, small objects and background interference in UAV images, thus enabling more stable extraction of key target information from complex environments.
[0057] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0058] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0059] Figure 1 This is a flowchart of a UAV multi-scale target detection method based on the DINO framework according to an embodiment of the present invention;
[0060] Figure 2 This is a flowchart illustrating the four stages of feature sampling according to an embodiment of the present invention;
[0061] Figure 3 The execution flowcharts for the first DA-STB module and the second DA-STB module according to embodiments of the present invention are shown below.
[0062] Figure 4This is an execution flowchart of the CGTB module according to an embodiment of the present invention;
[0063] Figure 5 This is a schematic diagram illustrating the visualization detection results of the method according to an embodiment of the present invention applied to a scene with high target density;
[0064] Figure 6 This is a schematic diagram illustrating the visualization of detection results when the method according to an embodiment of the present invention is applied to a scenario where the target distribution is relatively sparse.
[0065] Figure 7 This is a schematic diagram illustrating the visualization detection results of the method according to an embodiment of the present invention applied to a scene with low overall scene contrast.
[0066] Figure 8 This is a schematic diagram illustrating the visualization detection results of the method according to an embodiment of the present invention applied under high-angle overhead conditions. Detailed Implementation
[0067] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0068] This invention provides a multi-scale target detection method for UAVs based on the DINO framework. By improving the backbone network structure, it achieves efficient detection and high-precision localization of multi-scale targets in UAV images, especially small targets and targets in complex backgrounds.
[0069] like Figure 1 and Figure 2 As shown in the figure, the UAV multi-scale target detection method based on the DINO framework of this invention includes the following steps:
[0070] S1. Construct a hybrid Transformer backbone network, which includes: PatchPartition image preprocessing layer, first-stage DA-STB structure, second-stage DA-STB structure, third-stage DA-STB structure and fourth-stage cross-gated CGTB structure.
[0071] Specifically, this step designs a hybrid backbone network architecture, constructing a four-stage hybrid Transformer backbone network. The first three stages employ an optimized Swing Transformer Block (Dual Adaptive Swing Transformer Block, DA-STB). While maintaining the original Swing Transformer's hierarchical sliding window attention mechanism (W-MSA / SW-MSA), the traditional Multi-Layer Perceptron (MLP) structure is replaced with a Dual Adaptive Neural Block. The DA module achieves non-linear feature enhancement and channel self-adjustment through grouped convolutions and dual-channel adaptive activation (using GELU and Sigmoid activation functions). Combined with a 1×1 convolutional post-fusion structure, it effectively improves local feature modeling capabilities and context-dependent representation.
[0072] The first-stage DA-STB structure and the second-stage DA-STB structure each use two consecutive DA-STB modules, while the third-stage DA-STB structure uses 18 consecutive DA-STB modules, with each group consisting of two consecutive DA-STB modules.
[0073] The fourth stage employs the CGTB (Cross-Gated Transformer Block) module, which integrates innovative feature learning strategies, including the CSWSA (Cross-ShapedWindow Self-Attention) module and the GDFN (Gated-Dconv Feed-Forward Network) module.
[0074] Through the above four-stage structure, a hierarchical feature extraction system is constructed, progressing from local to global and from low resolution to high resolution.
[0075] S2, the image to be processed is input into the Patch Partition image preprocessing layer, which divides the image into segments. The feature map is given by H, where H is the height of the input image resolution and W is the width of the input image resolution.
[0076] Specifically, the input image with dimensions H×W×3 is first divided into... Each image patch is divided into 4×4×3 blocks. Each block is then concatenated according to the channel direction of its pixels to form a token for each patch. This generates a token sequence. The feature maps are used as input for the subsequent Transformer architecture. Each token corresponds to a local region of the image, providing input for subsequent Patch Merging downsampling and window self-attention modules, while balancing local spatial information with the sequence input requirements of the Transformer.
[0077] In the Swin Transformer, the Patch Partition layer is the first step of the network, used to transform the input image into a sequence of tokens that the Transformer can process. The Patch Partition layer receives an RGB image of size H×W×3, divides the image into small patches of size P×P×3 (usually P=4), and generates... Each patch is processed by flattening pixels row-wise and concatenating the R, G, and B channels of each pixel into a one-dimensional vector of length P×P×3, thus forming a token for each patch. For example, a 4×4×3 patch flattens to obtain a 48-dimensional vector. The final output is a feature map of size H / P×W / P×(P×P×3), where each token corresponds to a local region of the image, providing input for subsequent Patch Merging and window self-attention modules, while balancing local spatial information with the sequential input requirements of the Transformer. For example:
[0078] Original patch:
[0079]
[0080] After flattening:
[0081] [R11,G11,B11,R12,G12,B12,R13,G13,B13,R14,G14,B14,R21,G21,B21,...,R44,G44,B44] → Length 4×4×3=48
[0082] S3, will The feature map is input into the first-stage DA-STB structure for processing to extract local features from the feature map output by the upper layer, thus obtaining the feature map. feature map The input is processed in the second-stage DA-STB structure to increase the number of channels, and then passed through two consecutive DA-STB modules to obtain the feature map. feature map The input is processed through the third-stage DA-STB structure, and then through 18 consecutive DA-STB modules to obtain the feature map.
[0083] The first three stages of the backbone network of this invention are mainly composed of DA-STB modules. Specifically, the first stage uses two consecutive DA-STB modules, the second stage uses two consecutive DA-STB modules, and the third stage uses 18 DA-STB modules. The 18 DA-STB modules in the third stage are divided into 9 groups, with each group consisting of 2 consecutive DA-STB modules.
[0084] It should be noted that the structures of the two consecutive DA-STB modules in the first-stage, second-stage, and third-stage DA-STB structures are identical. In the third stage, each of the nine groups of two consecutive DA-STB modules involves repeatedly executing two consecutive DA-STB modules nine times.
[0085] The design and execution flow of the two consecutive DA-STB modules are described below:
[0086] like Figure 3 As shown, the two consecutive DA-STB modules include: the first DA-STB module and the second DA-STB module.
[0087] The first DA-STB module includes: an LN (Layer Normalization) layer, a W-MSA (Window-based Multi-Head Self-Attention) layer, and a dual adaptive neural block DA module; the second DA-STB module includes an LN layer, a SW-MSA layer, and a DA module.
[0088] The execution flow of the first DA-STB module is as follows:
[0089] (1) Perform layer normalization on the input feature map.
[0090] Specifically, a layer normalization operation is performed on the input feature map X, normalizing the feature map along the channel dimension of each sample to obtain... This makes the mean of the feature map 0 and the variance 1.
[0091] The specific calculation formula is as follows:
[0092]
[0093] in:
[0094] x i,c.h.w: The pixel value of the i-th sample in channel c, height h, and width w;
[0095] μ i The average value of pixels across all channels, height, and width of the i-th feature map, calculated using the following formula:
[0096] The sample variance of the i-th feature map is calculated using the following formula:
[0097] ∈: A very small constant; in layer normalization (LayerNorm), ∈ is a small positive number added to avoid division by zero or numerical instability caused by variance approaching zero, typically taking a value in the range of 10. -3 Up to 10 -8 In practice, PyTorch defaults to using 10. -5 TensorFlow uses 10 by default -6 It should be noted that ∈ being too small may lead to computational instability, while being too large may slightly affect the normalization effect; therefore, 10 is generally chosen. -5 Or 10 -6 This achieves a balance between stability and accuracy.
[0098] (2) Divide the normalized feature map into non-overlapping windows, perform multi-head self-attention W-MSA calculation in each window, then stitch together the attention outputs of different heads, and project them through a linear layer to obtain the window attention output.
[0099] In this invention, the normalized feature map is divided into non-overlapping windows, and multi-head self-attention calculation is performed within each window, including the following steps:
[0100] First, for each window, the feature map is linearly projected onto three matrices: Query, Key, and Value.
[0101] Then, the attention score (the dot product of the query matrix and the key matrix) is calculated within each window, and then scaled and smoothed using Softmax.
[0102] Secondly, the attention scores are used to perform a weighted summation of the value matrix to obtain the attention output within each window.
[0103] In the W-MSA of the Swing Transformer, the features within each window are first linearly mapped to a query (Q), key (K), and value (V) matrix, and then the attention score is calculated by the dot product of the query and the key. Attention weights are then obtained by scaling with Softmax. Ensure that the sum of the weights of each query position is 1.
[0104] The attention output at each position is obtained by weighting and summing the value matrix V using these weights. or matrix form
[0105] This operation makes the new features at each location an adaptive linear combination of features at other locations within the window, where value vectors with high relevance to the query are given greater weight, thereby effectively integrating local contextual information within the window.
[0106] Finally, the attention outputs from different heads are concatenated and then projected through a linear layer to obtain the final window attention output.
[0107] (3) Add the window attention output to the input feature map to perform the first residual connection.
[0108] Specifically, the window attention output is added to the input feature map X, that is:
[0109] X1=X+WMSA(LayerNorm(X)) (2)
[0110] The vanishing gradient problem can be mitigated by using residual connections as described above.
[0111] (4) Perform layer normalization on the summed feature map X1, and then input it into the dual adaptive neural block DA module.
[0112] Specifically, layer normalization is performed on X1 to obtain... Then Input to the dual adaptive neural block DA module.
[0113] (5) A dual adaptive neural block DA module is used to perform pointwise convolution on the input features. Hybrid projection is performed to obtain the fused feature map, and a dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the Sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature.
[0114] In this invention, the Adaptive Neural Block (DA) module is used to replace the original Multilayer Perceptron (MLP) structure, so as to enhance the dependency modeling ability between feature points while maintaining global semantics.
[0115] Specifically, the DA module first performs pointwise convolution P mix (·) Perform a fusion projection on the input features to obtain the fused feature map.
[0116] Subsequently, the DA module introduces a dual-way adaptive structure to simultaneously capture local contextual dependencies and cross-regional global relationships. The dual-way adaptive structure extracts two sets of channel features in the spatial dimension through group convolutions (7×7 kernel size). Right now Where i = 1, ..., C represents the channel.
[0117] Then, the DA module uses the Sigmoid and GELU activation functions to adaptively weight and filter the two sets of features, achieving dynamic dependency modeling:
[0118] Finally, the output is convolved pointwise by P fus (·) The fusion yields the final feature representation:
[0119] Through this dual-branch dynamic weighting mechanism, the DA module can establish global dependencies between different spatial locations of the feature map while preserving local structural information, thereby improving the discriminative power and context-awareness of feature representation. Compared with traditional MLP layers, the DA module significantly enhances the network's ability to recognize small targets and complex scenes with minimal increase in parameters and computational cost.
[0120] (6) Add the final feature output by the dual adaptive neural block DA module to the feature map of the first residual connection, perform the second residual connection, and use it as the output feature map of the first DA-STB module.
[0121] Specifically, the output characteristics of the DA module Adding it to X1 gives X out1 The output feature map of the first DA-STB module is further input into the second DA-STB module.
[0122] The execution flow of the second DA-STB module is as follows:
[0123] (1) Perform layer normalization on the feature map output by the first DA-STB module.
[0124] Specifically, for the X output of the first DA-STB module out1 Perform layer normalization to obtain feature maps
[0125] (2) Input the normalized feature map into the SW-MSA layer, perform a shift operation on the feature map, fuse the spatial information of adjacent positions, divide the new feature map into non-overlapping windows after the shift operation, and perform multi-head self-attention calculation in each window to obtain the shifted window attention output.
[0126] The offset window multi-head self-attention (SW-MSA) layer is designed to increase information exchange between windows by shifting the feature map and fusing spatial information from adjacent locations. After the shift, the new feature map is divided into non-overlapping windows, and multi-head self-attention is computed within each window. To avoid multi-head attention computation between different windows after the shift, a mask is introduced to prevent attention computation across windows.
[0127] (3) Add the shifted window attention output to the feature map output by the first DA-STB module to perform the first residual connection.
[0128] Specifically, the attention output of the shifted window With X out1 Adding together, that is:
[0129]
[0130] (4) Perform layer normalization on the summed feature map and then input it into the dual adaptive neural block DA module.
[0131] Specifically, perform layer normalization on X3 to obtain... Then Input to the dual adaptive neural block DA module.
[0132] (5) A dual adaptive neural block DA module is used to perform pointwise convolution on the input features. Hybrid projection is performed to obtain the fused feature map, and a dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the Sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature.
[0133] The execution flow of the dual adaptive neural block DA module in the second DA-STB module is the same as that of the DA module in the first DA-STB module, and will not be described again.
[0134] (6) Add the final feature output by the dual adaptive neural block DA module to the feature map of the first residual connection, perform the second residual connection, and use it as the output feature map of the second DA-STB module.
[0135] Specifically, the output characteristics of the DA module Adding this to X3 yields the outputs of two consecutive DA-STB modules.
[0136] Based on the execution flow of the two consecutive DA-STB modules described above, the workflow of the DA-STB structure in the first to third stages is explained below:
[0137] Stage 1:
[0138] The first stage DA-STB structure is used to extract local features from the feature map output by the upper layer, which helps to identify small target objects and lays the foundation for subsequent modules of the backbone network to extract higher-level features.
[0139] Will The feature maps are input into the first-stage DA-STB structure for processing, including:
[0140] Output from the upper layer The feature map is input to the Linear Embedding layer, and the number of channels of the feature map output from the Patch Partition layer is adjusted to C using a 1×1 convolution to obtain a new feature map z. l-1 Input the next two consecutive DA-STBs.
[0141] Then feature map z l-1 The process is sequentially passed through two consecutive DA-STB modules. The feature map z is obtained through the first DA-STB module. l The feature map z is obtained through the second DA-STB module. l+1 The feature map z l+1 The shape is That is, the output feature map of the first-stage DA-STB structure. The two consecutive DA-STB modules are as described above: the first DA-STB module includes an LN layer, a W-MSA layer, and a dual adaptive neural block DA module; the second DA-STB module includes an LN layer, a W-MSA layer, and a DA module. The subsequent two consecutive DA-STB modules in the second and third stages are similar and will not be elaborated further.
[0142] Stage 2:
[0143] The second-stage DA-STB structure is used to halve the feature map size, increase the number of channels, and further extract high-level features.
[0144] feature map z l and z l+1The input is fed into the second-stage DA-STB structure for processing to increase the number of channels and form hierarchical features, including:
[0145] To achieve the effect of convolution, the feature map z is first processed before entering the DA-STB in Stage 2. l and z l+1 The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels, forming hierarchical features.
[0146] Then, the hierarchical features are passed sequentially through two consecutive DA-STB modules to obtain the feature map.
[0147] Stage 3:
[0148] The third-stage DA-STB structure is used to further extract more abstract and semantically informative features, which helps in identifying larger targets.
[0149] feature map The input is processed in the third-stage DA-STB structure to extract features with semantic information, including:
[0150] Before entering the new DA-STB module, the feature map is first... The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels.
[0151] Then, the feature map is obtained by sequentially passing through 18 consecutive DA-STBs, repeating the two consecutive DA-STB modules of Stage 1 nine times. That is, the feature map is obtained by passing through 9 groups of DA-STB modules, each group consisting of 2 consecutive DA-STB modules.
[0152] In summary, in this invention, the first three stages use DA-STB hierarchical feature extraction: by Patch Partitioning, W-MSA / SW-MSA window self-attention, dual adaptive neural blocks, and Patch Merging downsampling, multi-scale feature maps (4×, 4×, 8×, 16× downsampling) are generated to capture local details of targets at different scales. In this process, the feature map size is only changed after PatchMerging downsampling. In the first stage, Patch Merging is not performed, so the feature map size remains unchanged. In the second stage, Patch Merging downsampling is performed, which concatenates the features of adjacent 2×2 patches in the channel dimension (stacks the channels of 4 tokens into 4C), and then uses a linear projection (or 1×1 conv / FC) to reduce the dimension to 2C. Therefore, the height and width are reduced by a factor of 2 (spatial resolution / 2), and the number of channels is doubled (C→2C). In the third stage, PatchMerging downsampling is performed in the same way as the second stage. The feature map in the third stage is reduced by a factor of 2 in both height and width (spatial resolution / 2) on the basis of the second stage, and the number of channels is doubled (2C→4C).
[0153] S4, feature map The input is fed into the fourth-stage cross-gated CGTB structure for feature enhancement, including: first, the feature map... The input is downsampled to the Patch Merging layer, and then the layer is normalized. The normalized feature map is processed by the cross-shaped window self-attention CSWSA module to capture long-distance dependencies. The feature map processed by the CSWSA module is then input into the gated deep convolutional feedforward network GDFN module for further processing, and is used as the multi-scale feature output of the hybrid Transformer backbone network.
[0154] The CGTB structure utilizes cross-shaped window attention (CSWSA) to model long-distance dependencies, thereby better extracting the boundaries between small objects and complex backgrounds in UAV images. GDFN employs feature response adjustment mechanisms and efficient convolution operations to accurately uncover complex feature relationships, suppress complex background noise, and enhance the representation of small target features. The CGTB structure can capture richer cross-regional feature relationships, improving feature representation efficiency and discriminative ability.
[0155] In this invention, the feature map is processed using a cross-shaped window self-attention CSWSA module, including:
[0156] Output and Layer Normalization: The input is the feature map X output from the third stage. l-1 First, perform layer normalization on it. This ensures a stable distribution of data when it enters subsequent modules, accelerating model training and improving performance.
[0157] Normalized feature maps The input features are first divided into strips in the horizontal and vertical directions. The heads of different groups perform self-attention calculations on the horizontal and vertical strips respectively. Finally, the two sets of results are concatenated and projected to obtain the self-attention output features. The self-attention output features are then residually connected with the input features.
[0158] (1) Horizontal strip self-attention calculation: The input feature X is uniformly divided into non-overlapping horizontal strips X. 1 ,…,X M M represents the number of horizontal stripes. For each head k, calculate its query, key, and value projections on the horizontal stripes to obtain... Then calculate the attention output. Finally, the attention outputs of all horizontal strips are concatenated to obtain... Where H represents a horizontal stripe.
[0159] (2) Vertical strip self-attention calculation: Similar to horizontal strip self-attention calculation, the input features are divided vertically and the attention output is calculated, denoted as V-Attention. k (X). Where V represents a vertical stripe.
[0160] (3) Multi-head grouping and concatenation: Divide the k heads into two groups on an equal basis. One group calculates self-attention on the horizontal strip, and the other group calculates it on the vertical strip. Finally, concatenate the attention outputs of the two groups along the head dimension and project them using the projection matrix W. O Project onto the target output dimension.
[0161] That is, CSWin-Attention(X)=Concat(head1,...,head k W O , among which, head k H-Attention is taken according to the grouping of the head. k (X) or V-Attention k (X).
[0162] (4) Residual connection: Connect the output of the self-attention module with the input feature X. l-1 Perform residual connection to obtain
[0163] like Figure 4 As shown, the feature map processed by the CSWSA module is input into the GDFN module for further processing, including:
[0164] Features after passing through the self-attention module and residual connection Then perform layer normalization to obtain Then input the data into the GDFN module. The GDFN module's calculation process is as follows:
[0165] First of all Gating mechanisms and deep convolution calculations are performed; then, the output features processed by gating mechanisms and deep convolutions are compared with the input features. The sum of.
[0166] (1) Gating mechanism and deep convolution calculation:
[0167]
[0168] Where Wp represents a 1×1 pointwise convolution operation, and Wd represents a 3×3 depthwise convolution. denoted as GELU nonlinear function, and ⊙ represents element-wise multiplication.
[0169] (2) Output calculation: The GDFN module outputs the features after gating and deep convolution processing, and the input features. The sum of,
[0170]
[0171] In summary, the feature map X output in the third stage l-1 Before entering CSWSA, the feature maps are first processed through a Patch Merging layer, which halves the feature map resolution and doubles the number of channels. Then, the CGTB module first processes the feature maps through a cross-shaped window attention module to capture long-distance dependencies and significantly expand the receptive field. The features processed by the attention module are then input into the GDFN module. The GDFN module, by introducing a gating mechanism and depthwise separable convolution, enhances the model's non-linear feature interaction capabilities, thereby improving the representation of details of small objects. Finally, the features output by the GDFN module are normalized and processed before being used as the output of the last stage of the backbone network.
[0172] S5 inputs the multi-scale features output from the hybrid Transformer backbone network into the original Neck module of the DINO model to construct a feature pyramid. The feature pyramid generates global features through the encoder of the DINO framework. The decoder of the DINO framework performs hybrid query initialization and contrastive denoising training on the global features output by the encoder, and outputs the target category and bounding box prediction results.
[0173] Specifically, the Neck module connects the backbone network to the Transformer encoder-decoder structure, enabling unified channel mapping of feature maps at different scales and the construction of a multi-level feature pyramid. The core structure of the Neck module is the ChannelMapper, composed of multiple ConvModules. Each ConvModule contains a 1×1 convolutional layer (for channel adjustment), a GroupNorm normalization layer (num_groups = 32), and an optional ReLU activation function. The input channels are [96, 192, 384, 768], and the output is uniformly 256. When more scales are needed, the last layer of features is downsampled using a convolution with stride = 2 to generate additional feature layers, thus outputting a five-layer multi-scale feature pyramid with unified channels. The Neck module achieves multi-scale feature fusion through lightweight channel mapping and scalable convolutions while preserving detailed information, providing stable input for the subsequent Transformer encoder.
[0174] Subsequently, the feature pyramid is fed into the encoder module of the DINO framework. The encoder consists of multiple stacked EncoderLayers, each containing a multi-head self-attention layer (MSDeformable Attention), a feedforward network, and layer normalization and residual connection structures. The encoder's main function is to establish global contextual relationships between multi-scale feature maps, enabling the model to learn long-distance dependencies between different spatial locations and scales. Through this global feature aggregation, the encoder enhances the model's ability to perceive and distinguish complex scenes, occluded targets, and small objects, forming a high-dimensional semantic representation with global consistency. Finally, the fused features output by the encoder, containing global contextual information, serve as the input to the decoder.
[0175] DINO's decoder module is responsible for generating target predictions based on the global features output by the encoder. To overcome the slow convergence speed of the traditional DETR framework, DINO introduces a hybrid query initialization mechanism, the workflow of which is as follows: the decoder's input queries (query embeddings) consist of three parts—learnable query vectors, top-K proposals selected from the encoder output, and perturbed denoising queries. This design provides better prior knowledge of target locations in the early stages of training, improving the model's convergence speed and stability. Furthermore, DINO introduces a contrastive denoising training mechanism during the training phase. By adding noise perturbations (position or category) to some queries, it forces the model to learn and recover the correct label, thereby improving the robustness and generalization ability of target recognition.
[0176] The Head is used for object classification prediction and bounding box regression, while introducing denoising to enhance model robustness. Inherited from the Deformable DETR Head, it includes a classification branch (Focal Loss), a bounding box regression branch (L1 Loss), and an IoU branch (GIoULoss), and implements end-to-end matching through a Hungarian Assigner. Its main process involves splitting the decoder output into a matching query and a denoising query, calculating the classification, regression, and IoU losses separately, and providing additional supervision to the proposals. By training the model through a denoising task to correct perturbations, employing multi-branch loss joint optimization, and a quality-focus Hungarian matching strategy, the model achieves end-to-end convergence and high detection accuracy.
[0177] The following uses the Visdrone-2019 validation set test scenario as an example to illustrate the comparison results between the present invention and existing methods. Table 1 compares the detection performance of the existing method and the method of the present invention. Table 2 compares the core evaluation index mAP@50 of various objects in the validation set of the existing method and the method of the present invention. Figures 5 to 8 The image shows the detection results of the UAV multi-scale target detection method based on the DINO framework of this invention.
[0178] Table 1 Comparison of detection performance of different methods
[0179]
[0180] Table 2. mAP@50 of various objects in the validation set
[0181]
[0182] By comparing Tables 1 and 2, it can be seen that the detection performance and mAP@50 index of various objects in the validation set achieved by the method of the present invention for UAV target detection are higher than those of the methods in the prior art.
[0183] Specifically, Figure 5 The detection performance is shown when the target density is high. Figure 6 The detection results are shown when the target distribution is relatively sparse. Figure 7 The detection results are shown when the overall contrast of the corresponding scene is low. Figure 8 The target recognition performance under high-angle overhead conditions is demonstrated. Among them, Figures 5 to 8 The main detection categories include: cars (orange), people (blue), bicycles (green), scooters (pink), vans (red), buses (sky blue), tricycles (brown), and motorcycles (yellow). These categories are labeled with consistent colors across different scenarios to facilitate comparative analysis.
[0184] From the above Figures 5-8 The results show that the method provided by this invention can maintain stable and reliable detection performance under varying environmental conditions.
[0185] refer to Figure 5 Even when there is significant overlap between objects in a dense scene, this method can still effectively distinguish between different categories of targets, successfully reducing false detections and false negatives caused by feature overlap.
[0186] refer to Figure 6 In scenes with sparse targets, the detection boxes are accurately located and the category determination is clear, demonstrating that the model has good feature extraction and background suppression capabilities.
[0187] refer to Figure 7 In low-contrast environments, this method, relying on its robust feature representation mechanism, can still maintain a high detection confidence even under conditions of weakened texture information and indistinct edges, fully demonstrating its good adaptability to adverse factors such as insufficient lighting and poor image quality.
[0188] refer to Figure 8 In high-angle overhead shots, although the target scale is reduced and accompanied by certain deformation, this method can still accurately identify various small targets, demonstrating the model's advantages in multi-scale feature fusion and long-distance small target detection.
[0189] comprehensive Figures 5 to 8As can be seen from the detection performance, the method provided by this invention exhibits low false negative rate, high accuracy and good generalization ability in different complex environments. It can effectively cope with challenges such as changes in illumination, changes in viewing angle, occlusion and changes in target density in real-world scenarios, and has high engineering application value and practical reliability.
[0190] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0191] It will be readily understood by those skilled in the art that this invention includes any combination of the inventive description and specific embodiments outlined in the foregoing specification, as well as the various parts shown in the accompanying drawings. Due to space limitations and for the sake of brevity, not all of these combinations have been described in detail. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
[0192] Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention without departing from the principles and spirit of the invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A multi-scale target detection method for unmanned aerial vehicles (UAVs) based on the DINO framework, characterized in that, include: S1, Construct a hybrid Transformer backbone network, which includes: a PatchPartition image preprocessing layer, a first-stage DA-STB structure, a second-stage DA-STB structure, a third-stage DA-STB structure, and a fourth-stage cross-gated CGTB structure; wherein, the first-stage DA-STB structure and the second-stage DA-STB structure each use 2 consecutive DA-STB modules, and the third-stage DA-STB structure uses 18 consecutive DA-STB modules, with every 2 consecutive DA-STB modules forming a group; S2, the image to be processed is input to the Patch Partition image preprocessing layer, which divides the image into segments. The feature map is given by H, where H is the height of the input image resolution, W is the width of the input image resolution, and C is the number of channels. S3, the The feature map is input into the first-stage DA-STB structure for processing to extract local features from the feature map output by the upper layer, thus obtaining the feature map. The feature map The input is processed in the second-stage DA-STB structure to increase the number of channels, and then passed through two consecutive DA-STB modules to obtain the feature map. The feature map The input is processed by the third-stage DA-STB structure, and then passed through 18 consecutive DA-STB modules to obtain the feature map. S4, feature map The input is fed into the fourth-stage cross-gated CGTB structure for feature enhancement, including: first, the feature map... The input is downsampled into the Patch Merging layer, and then the layer is normalized. The normalized feature map is processed by the cross-shaped window self-attention CSWSA module to capture long-distance dependencies. The feature map processed by the CSWSA module is then input into the gated deep convolutional feedforward network GDFN module for further processing, and is used as the multi-scale feature output of the hybrid Transformer backbone network. S5. The multi-scale features output by the hybrid Transformer backbone network are input into the original Neck module of the DINO model to construct a feature pyramid. The feature pyramid generates global features through the encoder of the DINO framework. The decoder of the DINO framework performs hybrid query initialization and contrastive denoising training on the global features output by the encoder, and outputs the target category and bounding box prediction results.
2. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S2, the input image with dimensions H×W×3 is first divided into... Each image patch is divided into 4×4×3 blocks. Each block is then concatenated according to the channel direction of its pixels to form a token for each patch. This generates a token sequence. The feature maps are used as input for the Transformer architecture; each token corresponds to a local region of the image, providing input for the subsequent Patch Merging downsampling and window self-attention modules, while taking into account both local spatial information and the sequence input requirements of the Transformer.
3. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, The two consecutive DA-STB modules in the first-stage DA-STB structure, the second-stage DA-STB structure, and the third-stage DA-STB structure are configured as follows: the first DA-STB module includes a layer normalized LN layer, a window-based multi-head self-attention layer W-MSA layer, and a dual adaptive neural block DA module; the second DA-STB module includes an LN layer, a SW-MSA layer, and a DA module.
4. The UAV multi-scale target detection method based on the DINO framework according to claim 3, characterized in that, The execution flow of the first DA-STB module is as follows: Perform layer normalization on the input feature map; The normalized feature map is divided into non-overlapping windows. Multi-head self-attention (W-MSA) calculation is performed in each window. The attention outputs of different heads are then concatenated and projected through a linear layer to obtain the window attention output. The window attention output is added to the input feature map to perform the first residual connection; The summed feature maps are then normalized layer by layer and then input into the dual adaptive neural block DA module. A dual adaptive neural block DA module is used to perform mixed projection on the input features through pointwise convolution to obtain the fused feature map. A dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature. The final feature output by the dual adaptive neural block (DA) module is added to the feature map of the first residual connection, and a second residual connection is performed to obtain the output feature map of the first DA-STB module.
5. The UAV multi-scale target detection method based on the DINO framework according to claim 3, characterized in that, The execution flow of the second DA-STB module is as follows: Perform layer normalization on the feature map output by the first DA-STB module; The normalized feature map is input into the SW-MSA layer, and a shift operation is performed on the feature map to fuse the spatial information of adjacent positions. After the shift operation, the new feature map is divided into non-overlapping windows, and multi-head self-attention is calculated in each window to obtain the shifted window attention output. The shifted window attention output is added to the feature map output by the first DA-STB module to perform the first residual connection; The summed feature maps are then normalized layer by layer and then input into the dual adaptive neural block DA module. A dual adaptive neural block DA module is used to perform mixed projection on the input features through pointwise convolution to obtain the fused feature map. A dual-path adaptive structure is introduced to simultaneously capture local contextual dependencies and cross-regional global relationships. Two sets of channel features are extracted in the spatial dimension through group convolution. Then, the sigmoid and GELU activation functions are used to adaptively weight and filter the two sets of channel features to achieve dynamic dependency modeling. Finally, the output is fused through pointwise convolution to obtain the final feature. The final feature output by the dual adaptive neural block (DA) module is added to the feature map of the first residual connection, and a second residual connection is performed to obtain the output feature map of the second DA-STB module.
6. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S3, the aforementioned The feature map is input into the first-stage DA-STB structure for processing, including: The The feature map is input into the Linear Embdding layer, and a 1×1 convolution is used to adjust the number of channels of the feature map output from the Patch Partition layer to C, resulting in a new feature map z. l-1 Then the feature map z l-1 The feature maps are obtained by sequentially passing through two consecutive DA-STB modules.
7. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S3, the feature map The input is fed into the second-stage DA-STB structure for processing to increase the number of channels and form hierarchical features, including: First, the feature map The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels, forming hierarchical features; then the hierarchical features are passed sequentially through two consecutive DA-STB modules to obtain the feature map.
8. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S3, the feature map The input is fed into the third-stage DA-STB structure for processing to extract features with semantic information, including: First, the feature map The input is fed into the Patch Merging layer for downsampling to halve the resolution and double the number of channels. Then, it passes sequentially through nine DA-STB module groups, each consisting of two consecutive DA-STB modules, to obtain the feature map.
9. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S4, the processing of the feature map using the cross-shaped window self-attention CSWSA module includes: The normalized feature map is input into the CSWSA module. The input features are first divided into strips in the horizontal and vertical directions. The heads of different groups perform self-attention calculations on the horizontal and vertical strips respectively. Finally, the two sets of results are concatenated and projected to obtain the self-attention output features. The self-attention output features are then residually connected with the input features.
10. The UAV multi-scale target detection method based on the DINO framework according to claim 1, characterized in that, In S4, the step of inputting the feature map processed by the CSWSA module into the GDFN module for further processing includes: Features after residual connection Layer normalization is performed, and then the data is input into the GDFN module. The calculation process of the GDFN module is as follows: First of all Gating mechanisms and deep convolution calculations are performed; then, the output features processed by gating mechanisms and deep convolutions are compared with the input features. The sum of.
Citation Information
Patent Citations
Lane line identification method and system based on inspection image of unmanned aerial vehicle
CN117593716A