Target detection method for view angle of unmanned aerial vehicle
By building a CT-RODN network, combining frequency domain analysis and attention prediction heads, the accuracy of small object detection in high dynamic environments under the perspective of the drone is solved, and the reliable object detection in complex backgrounds and multi-scale scenarios is achieved sex.
Patent Information
- Application Number
- CN202411049687.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing target detection system has the accuracy and practicality problems when detecting small targets in high dynamic environments, especially in complex backgrounds and multi-scale target scenarios from the perspective of drones.
Using a target detection method for drone perspective, the object detection network CT-RODN is constructed, including the frequency domain-based chunked composite attention module FBAM and the CNN-Transformer module FCTB, combined with frequency domain analysis and attention prediction head, Enhance the understanding of small goals and global information acquisition, and improve cross-scale detection performance through feature fusion module.
Improve the recognition accuracy and detection accuracy of small targets, especially in occlusion, and enhance the system's recognition capabilities in high dynamic environments, ensuring the performance and reliability of the drone when performing critical missions.
Smart Images

Figure CN119048730A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of target recognition and detection, and in particular relates to a target detection method oriented to the perspective of an unmanned aerial vehicle. Background Art
[0002] With the rapid development of modern drone technology, target detection has become a key research area, especially for real-time and accurate target recognition and positioning in complex environments such as urban landscapes or crowded places. Target detection aims to detect the position and size of the target object in a given image or video, and perform related tasks such as classification or recognition.
[0003] However, the current target detection system, due to the application field (basically monitors or smart car driving), mostly detects from a static perspective or a ground perspective. The characteristics of the detection object are quite different from those of drones. Therefore, traditional target detection systems face many challenges, including small target size, easy fusion with the background, and occlusion, which seriously affect the accuracy and practicality of detection. Although there are many deep learning-based target detection algorithms, such as SSD, YOLO, and Faster R-CNN, which have improved the accuracy and speed of detection to a certain extent, there are still many deficiencies in dealing with small target detection in highly dynamic environments. Especially when observing from the perspective of a drone, the small size and dynamic changes of the target make detection more difficult.
[0004] Therefore, how to ensure the effectiveness of small target detection in high-dynamic environments, thereby ensuring the reliability of target detection results of UAVs in complex backgrounds and multi-scale target scenes, has become a problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a target detection method for the perspective of a drone, which can ensure the effectiveness of small target detection in a high dynamic environment, thereby ensuring the reliability of the target detection results of the drone in complex backgrounds and multi-scale target scenes.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A method for detecting a target from a drone perspective includes the following steps:
[0008] S1. Construct a target detection network CT-RODN. CT-RODN includes a backbone network, a feature fusion module, and an attention prediction head. The backbone network is used to extract features from the input image. The feature fusion module is used to fuse the extracted features at each level. The attention prediction head is used to extract the key areas of the fused feature map and perform target detection and recognition based on the extracted key areas.
[0009] The backbone network includes a frequency-domain-based block composite attention module FBAM and a frequency-domain-based CNN-Transformer module FCTB; the FBAM module enhances the understanding of small aerial targets by combining frequency-domain analysis; the FCTB module is used to process and aggregate the feature maps obtained by convolution to obtain the global information of the image;
[0010] The working process of the backbone network includes: first, for the input image, four times downsampling is performed through the convolution modules Conv1 and Conv2; then, the FBAM module and the Conv module are used to alternately perform feature extraction and image downsampling; then, the FCTB module is used to process and aggregate the feature map information captured by the convolution to obtain the global information of the image, and the fast spatial pyramid pooling SPPF is introduced to construct feature maps of different scales through multi-branch pooling layers, and they are fused to enhance the expressiveness of the features;
[0011] S2, obtain the images taken from the perspective of the drone and process them to obtain training data; and use the training data to train the target detection network CT-RODN;
[0012] S3. Use the trained target detection network CT-RODN to perform actual drone target detection tasks.
[0013] Compared with the prior art, the present invention has the following beneficial effects:
[0014] 1. When using this method for target recognition, the FBAM module enhances the understanding of small aerial targets by combining frequency domain analysis. In this way, by emphasizing the important frequency components in the image, the network can focus more on important local features, thereby improving the recognition accuracy of small and low-contrast targets. The FCTB module is used to process and aggregate the feature maps obtained by convolution to obtain the global information of the image. In this way, by combining the contextual environment around the target and analyzing the overall spectral information, the accuracy of target detection is improved, especially when the target is partially obscured. This context-aware approach significantly enhances the system's recognition capabilities in highly dynamic and complex environments, ensuring the performance and reliability of drones when performing critical tasks.
[0015] 2. In this method, the feature fusion module FFM can inject more high-level semantic information into low-level features and provide richer details for high-level features, thereby enhancing the cross-scale detection performance of the detector for small targets.
[0016] 3. The setting of the attention prediction head can extract the key areas of the fused feature map. By introducing the attention mechanism, the ability to detect targets in complex backgrounds can be improved, and targets of different scales can be detected from feature maps of different resolutions.
[0017] The target detection network CT-RODN constructed by this method can take into account both the complexity of the model and the detection accuracy. It not only improves the speed and accuracy of target detection, but also significantly enhances the application potential of UAVs in actual operating environments, meeting the urgent needs of modern UAV technology development for real-time and accurate target detection.
[0018] In summary, the use of this method can ensure the effectiveness of small target detection in high dynamic environments, thereby ensuring the reliability of target detection results of UAVs in complex backgrounds and multi-scale target scenes.
[0019] Preferably, the working process of the FBAM module includes:
[0020] First, the input feature map F∈R C×H×W Evenly split into multiple local blocks F along the spatial dimension P ; Then further divided into multiple local sub-blocks C in equal proportion along the channel dimension i , i∈{1,2,…,n}; where C i ∈R (C / n)×P×P ; P represents the size of the local block; n is the number of equal divisions;
[0021] Then, for each local sub-block C i , extract its frequency component, and compare the frequency component with the corresponding local sub-block C i Perform element-by-element multiplication to obtain the corresponding frequency component features; and convert each local sub-block C i The frequency component features of the local block are concatenated and combined to form the channel frequency attention vector Freq of the local block;
[0022] Next, the frequency attention vector Freq and the corresponding local block feature F P Perform element-by-element multiplication to obtain the block frequency channel attention feature combination; and restore the block frequency channel attention feature combination to its original size to obtain the complete aggregation vector F c ; F c Concat it with the original feature vector F to obtain an intermediate feature map with a channel dimension of 2C, and use a convolution layer with a convolution kernel size of 1×1 to reduce its channel number to C to obtain a feature map -s ;
[0023] Then, for the feature map F s , perform maximum pooling and average pooling along the channel direction to generate feature map F s max ∈R 1×H×w and F s avg ∈R 1×H×w ; F s max and E s avg Splicing is performed along the channel, and the spliced features are reduced in dimension using a 7×7 convolution, and then the Sigmoid activation function is used to generate feature E s ∈R 1×H×w ;
[0024] Finally, E s With F S Multiply them together to get the attention feature F after the channel and spatial information are aggregated o .
[0025] With such a setting, the frequency domain-based block composite attention module (FBAM) enhances the understanding of small aerial targets by combining frequency domain analysis, greatly enriches the diversity of different frequency features, and optimizes the utilization of frequency information.
[0026] Preferably, a two-dimensional discrete cosine transform 2D-DCT is used to extract the local sub-block C i frequency components.
[0027] In this way, 2D-DCT is introduced into the channel attention mechanism to adaptively obtain more robust frequency domain features on different frequency components.
[0028] Preferably, the FCTB module works by:
[0029] First, the feature map is subjected to a 1×1 convolution operation with a stride of 1, which halves the number of channels of the feature map and keeps the spatial size of the feature map unchanged;
[0030] After that, the feature map is processed through two branches respectively; one branch enters the SpectralBlock operation to capture the frequency components in the feature map; the other branch enters the convolutional multi-head self-attention CMHSA mechanism, and processes the feature map through CMHSA to capture the dependency and global information between different positions in the feature map;
[0031] Then, the output feature maps of the two branches are concatenated, and the concatenated feature map is subjected to another 1×1 convolution operation with a stride of 1 to obtain the final feature map.
[0032] With this setup, the FCTB module can simultaneously capture frequency components and global dependencies in feature maps through a combination of spectral blocks and convolutional multi-head self-attention mechanisms. This multi-scale, multi-angle feature fusion helps enhance the representation capabilities of the model, enabling it to more fully understand the input data. In addition, for tasks that require consideration of both local details and global information (such as image recognition, video analysis, etc.), the FCTB module may bring performance improvements. By integrating the advantages of spectral blocks and convolutional multi-head self-attention mechanisms, the model can more accurately capture and understand key information in the input data.
[0033] Preferably, the Spectral Block is composed of a spectrum gating network; the spectrum gating network includes a Fast Fourier Transformation FFT layer, a weighted gating and an Inverse Fast Fourier Transformation IFFT layer.
[0034] Preferably, the working process of the Spectral Block includes:
[0035] First, use FFT to convert the image space into spectrum space;
[0036] Afterwards, weighted gating applies a specific learnable weight parameter w c To determine the weight of each frequency component and learn through back-propagation technology to capture the lines and edges of the image;
[0037] Then, the weighted spectrum data is converted back to the image space through IFFT, normalized through layer normalization, and channel mixing is achieved through the multi-layer perceptron MLP block to obtain the frequency domain feature extraction result;
[0038] Finally, the frequency domain feature extraction result is element-wise added to the original input in a residual connection manner.
[0039] This setting, through the Spectral Block, can capture the different frequency components in the image to understand the local frequency.
[0040] The image is converted from the spatial domain to the frequency domain through FFT, so that the high-frequency components such as lines and edges in the image and the low-frequency components such as background and smooth areas can be separated in the spectrum. The weighted gating mechanism uses the learnable weight parameter w c Weighting different frequency components helps the model learn which frequency components are more important for specific tasks during training. Compared with directly performing convolution operations in the spatial domain, this frequency domain feature extraction method can more directly focus on the texture, structure and other characteristics of the image.
[0041] The weighted gating mechanism can not only help the model capture important frequency components, but also suppress noise or unnecessary frequency components to a certain extent. Because noise is often distributed in high-frequency areas, weighted gating can reduce the contribution of these areas through learned weight parameters. In addition, by converting the weighted spectrum data back to image space through IFFT and combining layer normalization and MLP blocks for further processing, the model's ability to extract important features can be further enhanced and noise interference can be reduced.
[0042] The MLP block plays the role of channel mixing in the spectrum block, which can fuse the features of different channels to enhance the representation ability of the model. This channel mixing method helps the model understand the image from multiple angles and capture richer feature information. Finally, the frequency domain feature extraction results are added element by element with the original input through residual connection, which helps to maintain the integrity of the input information and reduce the gradient vanishing or gradient exploding problems in deep networks. Residual connection makes it easier for the model to converge during training and can also improve the generalization ability of the model.
[0043] Preferably, the process of processing the feature map by the convolutional multi-head self-attention CMHSA mechanism includes:
[0044] Flatten the projected markers into a one-dimensional vector:
[0045]
[0046] in, is the labeled input of the Q / K / V matrix of the i-th layer; Flatten() represents the flattening operation; Conv is the standard convolution operation; s=1 represents the size of the convolution kernel; x i It is the mark before convolution projection;
[0047] The attention function between Q, K and V is:
[0048]
[0049] Where c is the number of channels of the input token; k = 4 represents the number of heads of CMHSA; Conv represents a standard 1×1 convolution operation; the dot product matrix is calculated by instance normalization IN after Softmax;
[0050] The output values of each head are concatenated through linear projection and adjusted into a two-dimensional feature map as the final output.
[0051] Thus, compared with linear projection, each convolutional projection of CMHSA only requires s 2 C 2 Parameters and O(s 2 C 2T) FLOPs, where T is the number of tags processed and C is the channel dimension of the tags. These parameters are negligible compared to the FLOPs and total parameters of the model. In vehicle target detection from the perspective of drones, the use of the traditional multi-head self-attention mechanism MSHA has the problems of high computational complexity, large number of parameters, and less effective processing of local features than convolution operations. In contrast, the convolutional multi-head self-attention CMHSA designed in the present invention has the advantages of low computational complexity and small number of parameters.
[0052] Preferably, the attention prediction head APH is set based on the normalized attention module NAM attention mechanism; the attention prediction head APH infers the attention map of the input image in two independent dimensions, channel and space, respectively, and uses these attention maps to weight the input feature map, thereby adaptively capturing the salient areas of the image.
[0053] Such a setting can extract key areas, make the model focus on useful objects, and improve the detection model's ability to resist confusing information.
[0054] Preferably, the attention prediction head APH includes a channel attention submodule and a spatial attention submodule; the channel attention submodule uses a batch normalized scaling factor to reflect the importance of each channel; the spatial attention submodule uses the same normalization method to process each pixel in the space to suppress irrelevant features;
[0055] Wherein, the scaling factor B out The calculation formula is as follows:
[0056]
[0057] In the formula, BN represents the batch normalization operation, μ B and σ B are the mean and standard deviation of the small batch samples B, respectively, while γ and β are trainable affine transformation parameters; ε is a small constant, usually 10-5 or 10-6, to prevent zero division and improve the numerical stability of the calculation; B in Input feature map to the channel attention submodule;
[0058] The expression of the channel attention submodule is:
[0059] M C =sigmoid(w γ (BN(F1)));
[0060] Among them, M c represents the output feature, γ is the scaling factor for each channel; weight w γ =γ i / ∑ j=0 γ j .
[0061] The expression of the spatial attention submodule is:
[0062] M s =sigmoid(W λ (BN(F2)));
[0063] Among them, M s represents the output feature, λ is the scaling factor for each channel, and the weight w λ =λ i / ∑ j=0 λ j .
[0064] In this way, APH, which combines the channel attention submodule and the spatial attention submodule, can adaptively weight the input feature map from both the channel and spatial dimensions, thereby more accurately capturing the salient areas and key features in the image. This mechanism helps to improve the overall performance of the model, including classification accuracy, detection accuracy, and robustness. At the same time, since both submodules use normalization methods for calculation, the overall computational efficiency is also high, which is suitable for deployment in practical applications.
[0065] Preferably, the feature fusion module is a feature fusion module based on a bidirectional feature pyramid network BiFPN. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0067] Figure 1 Schematic diagram of target detection network CT-RODN in the embodiment;
[0068] Figure 2 Schematic diagram of the FBAM module in the embodiment;
[0069] Figure 3 This is a schematic diagram of the FCTB module in the embodiment;
[0070] Figure 4 Schematic diagram of feature fusion module FFM in the embodiment;
[0071] Figure 5 This is a schematic diagram of a weighted fusion module in an embodiment;
[0072] Figure 6 Schematic diagram of the attention prediction head APH in the embodiment. DETAILED DESCRIPTION
[0073] The following is a further detailed description through specific implementation methods:
[0074] Example:
[0075] This embodiment discloses a target detection method for a drone perspective, including the following steps:
[0076] S1. Construct the target detection network CT-RODN. The structure of the target detection network CT-RODN is as follows: Figure 1 As shown in the figure, CT-RODN includes a backbone network, a feature fusion module and an attention prediction head; the backbone network is used to extract features from the input image; the feature fusion module is used to fuse the extracted features at each level; the attention prediction head is used to extract the key areas of the fused feature map and perform target detection and recognition based on the extracted key areas;
[0077] Among them, the backbone network includes a frequency-domain-based block composite attention module FBAM and a frequency-domain-based CNN-Transformer module FCTB; the FBAM module is used to enhance the understanding of small aerial targets by combining frequency-domain analysis; the FCTB module is used to process and aggregate the feature maps obtained by convolution to obtain the global information of the image; the working process of the backbone network includes: first, for the input image, four times downsampling is performed through the convolution modules Conv1 and Conv2; then, the FBAM module and the Conv module are used to alternately perform feature extraction and image downsampling; then, the FCTB module is used to process and aggregate the feature map information captured by the convolution to obtain the global information of the image, and at the same time, the fast spatial pyramid pooling SPPF is introduced to construct feature maps of different scales through multi-branch pooling layers, and they are fused to enhance the expression ability of the features.
[0078] This paper takes Convolutional Neural Network (CNN) and Transformer as the basic structure, introduces attention mechanism and frequency domain feature extraction technology, and proposes a CNN and Transformer based Real-time Object Detection Network (CT-RODN) to achieve accurate recognition of large, medium and small targets from the perspective of drones.
[0079] CT-RODN mainly consists of four parts: Frequency-domain based Block-and-compound Attention Module (FBAM), Frequency-domain based CNN-Transformer Block (FCTB), Feature Fusion Module (FFM) and Attention Prediction Head (APH). The backbone network consists of FBAM and FCTB, which is used to efficiently extract the features of the input image.
[0080] The network is a single-stage detection network, which only requires a forward network to directly predict the location and category of the target, and uses non-maximum suppression (NMS) to remove redundant low-quality detection frames to generate the final result. In order to balance the detection accuracy and speed, the present invention adjusts the resolution of all input images to 640×640. After the image is input into the CT-RODN network, it is firstly downsampled four times by convolution modules Conv1 and Conv2 to reduce the parameters and calculation amount of the network, and then the FBAM module and Conv module are used to alternately perform feature extraction and image downsampling. Then, the FCTB module is used to process and aggregate the feature map information captured by the convolution to obtain the global information of the image, and introduces the fast spatial pyramid pooling (Spatial Pyramid Pooling-Fast, SPPF), constructs feature maps of different scales through multi-branch pooling layers, and fuses them to enhance the expression ability of the features. The above modules constitute the backbone network of the model. On the basis of the backbone network, the present invention designs the FFM module to fuse the different levels of features in the network backbone. FFM injects more high-level semantic information into low-level features, and provides richer details for high-level features, thereby enhancing the detector's cross-scale detection performance for small targets. By fusing multi-scale features, the network's cross-scale target detection capability is improved. Finally, the present invention designs an APH detection head to output the final detection result of the model. APH introduces an attention mechanism to improve the ability to detect targets in complex backgrounds, and detects targets of different scales from feature maps of different resolutions.
[0081] Frequency-domain based block composite attention module FBAM
[0082] The frequency domain-based block composite attention module FBAM enhances the understanding of small aerial targets by combining frequency domain analysis, greatly enriches the diversity of different frequency features, and optimizes the use of frequency information. The module first divides the input features into blocks in space, extracts frequency domain information from them, and then combines the frequency component features of different blocks to form local channel features, which are then spliced with the original features that have not been extracted in the frequency domain. Finally, a 1×1 convolutional layer is used to output a feature map of the same size as the original, thereby improving the ability to recognize targets and enhancing the overall performance of the model.
[0083] The structure of the FBAM module is as follows Figure 2 In specific implementation, the working process of the FBAM module includes:
[0084] First, the input feature map F∈R C×H×W Evenly split into multiple local blocks F along the spatial dimension P ; Then further divided into multiple local sub-blocks C in equal proportion along the channel dimension i , i∈{1,2,…,n}; where C i ∈R (C / n)×P×P ; P represents the size of the local block; n is the number of equal divisions.
[0085] In specific implementation, the selection of the local block size P should follow the following principles:
[0086] In order to adapt to the characteristics of the network using multi-scale feature maps for detection, the local block size on each feature map should be kept consistent;
[0087] The width and height of the local block should be able to divide the width and height of the feature map to avoid the use of padding operations and thus prevent the introduction of irrelevant information.
[0088] Then, for each local sub-block C i , extract its frequency component, and compare the frequency component with the corresponding local sub-block C i Perform element-by-element multiplication to obtain the corresponding frequency component features; and convert each local sub-block C i The frequency component features of the local block are concatenated and combined to form the channel frequency attention vector Freq of the local block.
[0089] Each local sub-block C i A corresponding 2D-DCT frequency component is assigned for element-wise multiplication with the corresponding block. Each DCT frequency component can be expressed by the following formula:
[0090]
[0091] where ui and v i Represents the corresponding X i The two-dimensional index of the frequency components of It is a multidimensional vector obtained by aggregation. After frequency domain feature extraction, the generated vector contains the feature information of different frequency components in the frequency domain. These vectors are concatenated to form a channel frequency attention vector Freq of a local block. The formula is as follows:
[0092] Freq=cat([Freq1,Freq2,…,Freq n ]).
[0093] Next, the frequency attention vector Freq and the corresponding local block feature F P Perform element-by-element multiplication to obtain the block frequency channel attention feature combination; and restore the block frequency channel attention feature combination to its original size to obtain the complete aggregation vector F c ; F c Concat it with the original feature vector F to obtain an intermediate feature map with a channel dimension of 2C, and use a convolution layer with a convolution kernel size of 1×1 to reduce its channel number to C to obtain the feature map F s ; The calculation formula is as follows:
[0094] F s =Conv 1×1 (F c ; F).
[0095] The purpose of this operation is to ensure the integrity of spatial information by combining features that have not been extracted in the frequency domain, while reducing misunderstandings or biases that may be caused by a single source of information.
[0096] Then, for the feature map F s , perform maximum pooling and average pooling along the channel direction to generate feature map F s max ∈R 1×H×w and F s avg ∈R 1×H×w ; F s max and F s avg Splicing is performed along the channel, and the spliced features are reduced in dimension using a 7×7 convolution, and then the Sigmoid activation function is used to generate feature E s ∈R 1×H×w ;
[0097] Finally, E s With F S Multiply them together to get the attention feature F after the channel and spatial information are aggregated oThe calculation formula is as follows:
[0098] F o =E s ·F s =σ(Conv 7×7 (MaxPool(F s ); AvgPool(F s )))·F s .
[0099] With such a setting, the frequency domain-based block composite attention module (FBAM) enhances the understanding of small aerial targets by combining frequency domain analysis, greatly enriches the diversity of different frequency features, and optimizes the utilization of frequency information.
[0100] In the specific implementation, two-dimensional discrete cosine transform 2D-DCT is used to extract the local sub-block C i frequency components.
[0101] In order to retain and introduce more frequency domain information, the present invention uses Two Dimensional Discrete Cosine Transform (2D-DCT) to map the input features to the frequency domain. The result of the 2D-DCT transform includes a direct current component (DC coefficient) and an alternating current component (AC coefficient), where the DC coefficient represents the average component of the image and reflects low-frequency information; the AC coefficient captures high-frequency information, such as line boundaries and textures. 2D-DCT converts a two-dimensional image to the frequency domain, calculates which two-dimensional cosine waves the image consists of, and identifies areas with a higher degree of change in the image (for example, target boundary areas are rich in high-frequency information). Let represents a two-dimensional image, then The pixel value corresponding to the input position (i, j). Here i represents the row index, j represents the column index, i∈{0,1,…,H-1}, j∈{0,1,…,W-1}, so the two-dimensional discrete cosine transform can be expressed by the following formula:
[0102]
[0103] in It is a 2D-DCT spectrum diagram. h and w represent the position of the spectrum diagram. In the frequency spectrum, h∈{0,1,…,H-1}, w∈{0,1,…,W-1}. is defined as the basis function of the two-dimensional discrete cosine transform. The basis function is expressed as The formula is abbreviated as follows:
[0104]
[0105] When h and w in the above formula are both zero, the formula calculation result is equivalent to global average pooling (GAP), which is expressed as That is, the calculation result of GAP is proportional to the lowest frequency of 2D-DCT, which shows that GAP is a special case of 2D-DCT. The use of global average pooling (GAP) in the channel attention mechanism tends to retain low-frequency information and discard components of other frequencies. Therefore, the present invention introduces 2D-DCT in the channel attention mechanism to adaptively obtain more robust frequency domain features on different frequency components.
[0106] Frequency Domain Based CNN-Transformer Module (FCTB)
[0107] The structure of the FCTB module is as follows: Figure 3 The work of the FCTB module includes:
[0108] First, the feature map is subjected to a 1×1 convolution operation with a stride of 1, which halves the number of channels of the feature map from c1 to c2 / 2, keeping the spatial size of the feature map unchanged;
[0109] After that, the feature map is processed through two branches respectively; one branch enters the SpectralBlock operation to capture the frequency components in the feature map; the other branch enters the convolutional multi-head self-attention CMHSA mechanism, and processes the feature map through CMHSA to capture the dependency and global information between different positions in the feature map;
[0110] Then, the output feature maps of the two branches are concatenated, and the concatenated feature map is subjected to another 1×1 convolution operation with a stride of 1 to obtain the final feature map. The number of channels of the final output feature map is c2.
[0111] With this setup, the FCTB module can simultaneously capture frequency components and global dependencies in feature maps through a combination of spectral blocks and convolutional multi-head self-attention mechanisms. This multi-scale, multi-angle feature fusion helps enhance the representation capabilities of the model, enabling it to more fully understand the input data. In addition, for tasks that require consideration of both local details and global information (such as image recognition, video analysis, etc.), the FCTB module may bring performance improvements. By integrating the advantages of spectral blocks and convolutional multi-head self-attention mechanisms, the model can more accurately capture and understand key information in the input data.
[0112] 1) About Spectral Block
[0113] like Figure 3As shown in the left part of the figure, in specific implementation, the spectrum block is composed of a spectrum gating network; the spectrum gating network includes a fast Fourier transform FFT layer, a weighted gating and an inverse fast Fourier transform IFFT layer. The working process of the spectrum block includes:
[0114] First, use FFT to convert the image space into spectrum space;
[0115] Afterwards, weighted gating applies a specific learnable weight parameter w c To determine the weight of each frequency component and learn through back-propagation technology to capture the lines and edges of the image;
[0116] Then, the weighted spectrum data is converted back to the image space through IFFT, normalized through layer normalization, and channel mixing is achieved through the multi-layer perceptron MLP block to obtain the frequency domain feature extraction result;
[0117] Finally, the frequency domain feature extraction result is element-wise added to the original input in a residual connection manner.
[0118] This setting can capture different frequency components in the image through the Spectral Block to understand the local frequency. The image is converted from the spatial domain to the frequency domain through FFT, so that high-frequency components such as lines and edges in the image and low-frequency components such as background and smooth areas can be separated in the spectrum. The weighted gating mechanism uses a learnable weight parameter w cWeighting different frequency components helps the model learn which frequency components are more important for a specific task during training. This frequency domain feature extraction method can focus more directly on the texture, structure and other characteristics of the image compared to directly performing convolution operations in the spatial domain. The weighted gating mechanism can not only help the model capture important frequency components, but also suppress noise or unnecessary frequency components to a certain extent. Because noise is often distributed in high-frequency areas, weighted gating can reduce the contribution of these areas through learned weight parameters. In addition, by converting the weighted spectrum data back to the image space through IFFT, and further processing it with layer normalization and MLP blocks, the model's ability to extract important features can be further enhanced and the interference of noise can be reduced. The MLP block plays the role of channel mixing in the spectrum block, which can fuse the features of different channels to enhance the representation ability of the model. This channel mixing method helps the model understand the image from multiple perspectives and capture richer feature information. Finally, the frequency domain feature extraction results are element-wise added to the original input through residual connections, which helps to maintain the integrity of the input information and reduce the gradient disappearance or gradient explosion problems in deep networks. Residual connections make it easier for the model to converge during training and also improve the generalization ability of the model.
[0119] 2) About Convolutional Multi-Head Self-Attention CMHSA
[0120] In vehicle target detection from the perspective of drones, the use of traditional multi-head self-attention mechanism (MSHA) has the problems of high computational complexity, large number of parameters, and less effective processing of local features than convolution operations. In contrast, the convolutional multi-head self-attention (CMHSA) designed in the present invention has the advantages of low computational complexity and small number of parameters. Specifically, CMHSA reduces the computational complexity and number of parameters and improves computational efficiency by introducing convolutional projection to replace the position linear projection in the original MHSA. In addition, the introduction of convolutional layers enables CMHSA to better capture local features, which is particularly important for vehicle target detection from the perspective of drones.
[0121] Figure 3 The right part shows how the input 2-D Token map is projected through the convolutional projection layer.
[0122] The process of processing the feature map by the convolutional multi-head self-attention CMHSA mechanism includes:
[0123] The projected markers are flattened into one-dimensional vectors for subsequent processing, which can be expressed as:
[0124]
[0125] in, is the labeled input of the Q / K / V matrix of the i-th layer; Flatten() represents the flattening operation; Conv is the standard convolution operation; s=1 represents the size of the convolution kernel; x i It is the mark before convolution projection;
[0126] The attention function between Q, K and V is:
[0127]
[0128] Where c is the number of channels of the input token; k = 4 represents the number of heads of CMHSA; Conv represents a standard 1×1 convolution operation; the dot product matrix is calculated by instance normalization IN after Softmax;
[0129] The output values of each head are concatenated through linear projection and adjusted into a two-dimensional feature map as the final output.
[0130] Thus, compared with linear projection, each convolutional projection of CMHSA only requires s 2 C 2 Parameters and O(s 2 C 2 T) FLOPs, where T is the number of tags processed and C is the channel dimension of the tags. These parameters are negligible compared to the FLOPs and total parameters of the model. In vehicle target detection from the perspective of drones, the use of the traditional multi-head self-attention mechanism MSHA has the problems of high computational complexity, large number of parameters, and less effective processing of local features than convolution operations. In contrast, the convolutional multi-head self-attention CMHSA designed in the present invention has the advantages of low computational complexity and small number of parameters.
[0131] Feature Fusion Module (FFM)
[0132] Because the drone flies at high altitude, the target size in its field of view is small and lacks visual details, which means that it is very difficult for the detection model to detect small targets well. Affected by various emergencies, the flight altitude of the drone in the working scene may change dramatically, and the target scale in its field of view is also fluctuating, which requires the detection model to have a strong cross-scale target detection capability. Based on this, the present invention introduces a feature fusion module (Feature Fusion Module, FFM) based on a bidirectional feature pyramid network (Bidirectional Feature Pyramid Network, BiFPN) to fuse different levels of features, so as to predict different scale targets using different levels of feature maps.
[0133] BiFPN is optimized based on the PANet network of Yolov5. Figure 4 (a). When the network has only one input edge, the node does not perform feature fusion and contributes little to the fusion of different features. Therefore, the present invention removes these nodes to simplify the network structure. Figure 4 As shown in (b), BiFPN removes the and The present invention also adds skip connections between sibling input and output nodes so that more features can be fused without significantly increasing the computational cost, such as Figure 4 In addition, the contributions of input features of different resolutions are different. The present invention adds additional weights to each input and proposes an efficient weighted fusion module (Weighted Fusion Module), as shown in Figure 5 The calculation formula is as follows:
[0134]
[0135] in, represents the input feature, ω i is a learnable weight, and ω u ≥0. In order to improve the stability of training, the present invention normalizes the weights to between [0,1] and sets ε to a smaller value to improve the stability of calculation. Figure 4 Taking the third layer in (b) as an example, the calculation process of the two feature fusion is as follows:
[0136]
[0137] Among them, Resize is a downsampling or upsampling operation used to match the resolution of different fusion features, and Conv represents a standard 1×1 convolution. is the intermediate feature of layer 3 in the top-down pathway, and is the output feature of layer 3 in the bottom-up path. Features at other positions are fused in a similar way.
[0138] Attention Prediction Head APH
[0139] In drone images, the wide field of view always contains many confusing environmental factors. In order to improve the detection model's ability to resist confusing information, the present invention applies the normalization-based attention module (NAM) attention mechanism to form an attention prediction head (APH) before the detection head, thereby extracting key areas and allowing the model to focus on useful objects. NAM is a lightweight and efficient attention mechanism that adopts the integration method of the convolutional block attention module (CBAM) and redesigns the channel and spatial attention submodules. For the channel attention submodule, it uses the batch normalized scaling factor to reflect the importance of each channel.
[0140] The attention prediction head APH is based on the normalized attention module NAM attention mechanism setting; the attention prediction head APH infers the attention map of the input image in two independent dimensions, channel and space, and uses these attention maps to weight the input feature map, thereby adaptively capturing the salient areas of the image. This setting can extract key areas, allowing the model to focus on useful objects and improve the detection model's ability to resist confusing information.
[0141] The attention prediction head APH includes a channel attention submodule and a spatial attention submodule; the channel attention submodule uses a batch normalization scaling factor to reflect the importance of each channel; the spatial attention submodule uses the same normalization method to process each pixel in the space to suppress irrelevant features;
[0142] Wherein, the scaling factor B out The calculation formula is as follows:
[0143]
[0144] In the formula, BN represents the batch normalization operation, μ B and σ B are the mean and standard deviation of the mini-batch samples B, respectively, while γ and β are trainable affine transformation parameters; ε is a small constant, usually 10 -5 or 10 -6 , to prevent division by zero and improve the numerical stability of the calculation; B in Input feature map to the channel attention submodule;
[0145] The channel attention submodule is as follows Figure 6 (a), its expression is:
[0146] M c =sigmoid(wγ (BN(F1)));
[0147] Among them, M c represents the output feature, γ is the scaling factor for each channel; weight w γ =γ i / ∑ j=0 γ j .
[0148] The spatial attention submodule is as follows Figure 6 (b) is shown, and its expression is:
[0149] M s =sigmoid(W λ (BN(F2)));
[0150] Among them, M s represents the output feature, λ is the scaling factor for each channel, and the weight w λ =λ i / ∑ j=0 λ j .
[0151] In this way, APH, which combines the channel attention submodule and the spatial attention submodule, can adaptively weight the input feature map from both the channel and spatial dimensions, thereby more accurately capturing the salient areas and key features in the image. This mechanism helps to improve the overall performance of the model, including classification accuracy, detection accuracy, and robustness. At the same time, since both submodules use normalization methods for calculation, the overall computational efficiency is also high, which is suitable for deployment in practical applications.
[0152] S2, obtain the images taken from the perspective of the drone and process them to obtain training data; and use the training data to train the target detection network CT-RODN;
[0153] S3. Use the trained target detection network CT-RODN to perform actual drone target detection tasks.
[0154] When using this method to identify targets, the FBAM module enhances the understanding of small targets in the air by combining frequency domain analysis. In this way, by emphasizing the important frequency components in the image, the network can focus more on the important local features, thereby improving the recognition accuracy of small and low-contrast targets. The FCTB module is used to process and aggregate the feature maps obtained by convolution to obtain the global information of the image. In this way, by combining the contextual environment around the target and analyzing the overall spectral information, the accuracy of target detection is improved, especially when the target is partially occluded. This context-aware method significantly enhances the recognition ability of the system in high-dynamic and complex environments, ensuring the performance and reliability of drones when performing critical tasks. In addition, in this method, the feature fusion module FFM can inject more high-level semantic information into low-level features, while providing richer details for high-level features, thereby enhancing the cross-scale detection performance of the detector for small targets. In addition, the setting of the attention prediction head can extract the key areas of the fused feature map. By introducing the attention mechanism, the ability to detect targets in complex backgrounds can be improved, and targets of different scales can be detected from feature maps of different resolutions. In addition, a novel real-time target detection network framework based on CNN and Transformer is designed to balance the complexity of the model and the detection accuracy. This invention is expected to not only improve the speed and accuracy of target detection, but also significantly enhance the application potential of drones in actual operating environments, meeting the urgent needs of modern drone technology development for real-time and accurate target detection.
[0155] Using this method, the effectiveness of small target detection in highly dynamic environments can be guaranteed, thereby ensuring the reliability of target detection results of UAVs in complex backgrounds and multi-scale target scenes.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. A target detection method for drone perspective, characterized in that: The following steps are involved: S1. Construct the target detection network CT-RODN. CT-RODN includes a backbone network, a feature fusion module and an attention prediction head. The backbone network is used to extract features from the input image. The feature fusion module is used to fuse the extracted features at each level; the attention prediction head is used to extract the key areas of the fused feature map and perform target detection and recognition based on the extracted key areas; The backbone network includes a frequency-domain-based block composite attention module FBAM and a frequency-domain-based CNN-Transformer module FCTB; the FBAM module enhances the understanding of small aerial targets by combining frequency-domain analysis; the FCTB module is used to process and aggregate the feature maps obtained by convolution to obtain the global information of the image; The working process of the backbone network includes: first, for the input image, four times downsampling is performed through the convolution modules Conv1 and Conv2; then, the FBAM module and the Conv module are used to alternately perform feature extraction and image downsampling; then, the FCTB module is used to process and aggregate the feature map information captured by the convolution to obtain the global information of the image, and the fast spatial pyramid pooling SPPF is introduced to construct feature maps of different scales through multi-branch pooling layers, and they are fused to enhance the expressiveness of the features; S2, obtain the images taken from the perspective of the drone and process them to obtain training data; and use the training data to train the target detection network CT-RODN; S3. Use the trained target detection network CT-RODN to perform actual drone target detection tasks.
2. The target detection method for drone perspective as claimed in claim 1, characterized in that: The working process of the FBAM module includes: First, the input feature map F∈R C×H×W Evenly split into multiple local blocks F along the spatial dimension P ; Then further divided into multiple local sub-blocks C in equal proportion along the channel dimension i , i∈{1, 2, ..., n}; where C i ∈R (C / n)×P×P ; P represents the size of the local block; n is the number of equal divisions; Then, for each local sub-block C i , extract its frequency component, and compare the frequency component with the corresponding local sub-block C i Perform element-by-element multiplication to obtain the corresponding frequency component features; and convert each local sub-block C i The frequency component features of the local block are concatenated and combined to form the channel frequency attention vector Freq of the local block; Next, the frequency attention vector Freq and the corresponding local block feature F P Perform element-by-element multiplication to obtain the block frequency channel attention feature combination; and restore the block frequency channel attention feature combination to its original size to obtain the complete aggregation vector F c ; F c Concat the original feature vector F to obtain an intermediate feature map with a channel dimension of 2C, and use a convolution layer with a convolution kernel size of 1×1 to reduce its channel number to C to obtain the feature map F s ; Then, for the feature map F s , perform maximum pooling and average pooling along the channel direction to generate feature maps and Will and Splicing is performed along the channel, and the spliced features are reduced in dimension using 7×7 convolution, and then the Sigmoid activation function is used to generate feature E s ∈R 1×H×w ; Finally, E s With F S Multiply them together to get the attention feature F after the channel and spatial information are aggregated o .
3. The target detection method for drone perspective as claimed in claim 2, characterized in that: Use 2D-DCT to extract the local sub-block C i frequency components.
4. The target detection method for drone perspective according to claim 1, characterized in that: The work of the FCTB module includes: First, the feature map is subjected to a 1×1 convolution operation with a stride of 1, which reduces the number of channels of the feature map by half and keeps the spatial size of the feature map unchanged; After that, the feature map is processed through two branches respectively; one branch enters the SpectralBlock operation to capture the frequency components in the feature map; the other branch enters the convolutional multi-head self-attention CMHSA mechanism, and processes the feature map through CMHSA to capture the dependency and global information between different positions in the feature map; Then, the output feature maps of the two branches are concatenated, and the concatenated feature map undergoes another 1×1 convolution operation with a stride of 1 to obtain the final feature map.
5. The target detection method for drone perspective as claimed in claim 4, characterized in that: The spectrum block SpectralBlock is composed of a spectrum gating network; the spectrum gating network includes a fast Fourier transform FFT layer, a weighted gating and an inverse fast Fourier transform IFFT layer.
6. The target detection method for drone perspective as claimed in claim 5, characterized in that: The working process of SpectralBlock includes: First, use FFT to convert the image space into spectrum space; Afterwards, weighted gating applies a specific learnable weight parameter w c To determine the weight of each frequency component and learn through back-propagation technology to capture the lines and edges of the image; Then, the weighted spectrum data is converted back to the image space through IFFT, normalized through layer normalization, and channel mixing is achieved through the multi-layer perceptron MLP block to obtain the frequency domain feature extraction result; Finally, the frequency domain feature extraction result is element-wise added to the original input in a residual connection manner.
7. The target detection method for drone perspective as claimed in claim 4, characterized in that: The process of processing the feature map by the convolutional multi-head self-attention CMHSA mechanism includes: Flatten the projected markers into a one-dimensional vector: in, is the labeled input of the Q / K / V matrix of the i-th layer; Flatten() represents the flattening operation; Conv is the standard convolution operation; s=1 represents the size of the convolution kernel; x i It is the mark before convolution projection; The attention function between Q, K and V is: Where c is the number of channels of the input token; k = 4 represents the number of heads of CMHSA; Conv represents a standard 1×1 convolution operation; the dot product matrix is calculated by instance normalization IN after Softmax; The output values of each head are concatenated through linear projection and adjusted into a two-dimensional feature map as the final output.
8. The target detection method for drone perspective as claimed in claim 1, characterized in that: The attention prediction head APH is based on the normalized attention module NAM attention mechanism setting; The attention prediction head (APH) infers the attention maps of the input image in two independent dimensions, channel and space, and uses these attention maps to weight the input feature map to adaptively capture the salient areas of the image.
9. The target detection method for drone perspective as claimed in claim 8, characterized in that: The attention prediction head APH includes a channel attention submodule and a spatial attention submodule; the channel attention submodule uses a batch normalized scaling factor to reflect the importance of each channel; The spatial attention submodule uses the same normalization method to process each pixel in space to suppress irrelevant features; Wherein, the scaling factor B out The calculation formula is as follows: In the formula, BN represents the batch normalization operation, μ R and σ B are the mean and standard deviation of the mini-batch samples B, respectively, while γ and β are trainable affine transformation parameters; ε is a constant; B in Input feature map to the channel attention submodule; The expression of the channel attention submodule is: M C =sigmoid(w γ (BN(F1))); Among them, M C represents the output feature, γ is the scaling factor for each channel; weight w γ =γ i / ∑ j=0 γ j . The expression of the spatial attention submodule is: M s =sigmoid(W λ (BN(F2))); Among them, M s represents the output feature, λ is the scaling factor for each channel, and the weight w k =λ i / ∑ j=0 λ j .
10. The target detection method for drone perspective according to claim 1, characterized in that: The feature fusion module is a feature fusion module based on the bidirectional feature pyramid network BiFPN.
Citation Information
Patent Citations
Attention-driven adaptive feature fusion lightweight target detection method
CN117710839A
Dark weak target detection method based on unsteady clutter suppression
CN118212401A
Target detection method and device based on frequency domain characteristics and ConvNeXt
CN118262094A
Spectral data-oriented target detection model generation method and target detection method
CN118366025A
Cited By
Lithology real-time prediction method in tunneling process of tunnel boring machine
CN119274718A
Unmanned aerial vehicle power transmission line target detection method, computer device, medium and product
CN119360005A
Infrared small target detection method and system based on frequency domain attention and storage medium
CN119762761A
Infrared and visible light fusion method based on spectrum attention generative adversarial network
CN119762927A
Millimeter wave radar and visual information fusion detection method for internal lake ship
CN119881875A
