Unmanned aerial vehicle aerial image small target detection method and system based on AMTS-DETR model
By introducing the AMTS-DETR model, which incorporates ASGBlock, MSFI multi-scale feature interaction module, and TBTS dual-branch token selector into UAV aerial image detection, the problems of insufficient accuracy and low efficiency in small target detection in UAV aerial images are solved, achieving more efficient detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for small target detection in UAV aerial images suffer from insufficient detection accuracy, large positioning deviations, and limited inference speed when dealing with high-altitude perspectives, complex backgrounds, and dense targets. In particular, small target detection still suffers from problems such as missing information, scale ambiguity, and distraction in UAV aerial photography scenarios.
The AMTS-DETR model is adopted. By introducing the ASGBlock lightweight attention module into the backbone network, the model's attention to key features is improved. The MSFI multi-scale feature interaction module is introduced to realize multi-scale dynamic fusion. The TBTS dual-branch token selector is designed in the encoder to improve the model's detection capability for small target images.
It significantly improves the detection accuracy of small targets in UAV aerial images, enhances detection precision and efficiency, and reduces missed detections and false detections.
Smart Images

Figure CN121811281A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, and in particular relates to a method and system for small target detection in UAV aerial images based on the AMTS-DETR model. Background Technology
[0002] In recent years, drones have been widely used in urban management, traffic monitoring, agricultural inspection, and disaster relief. Drones equipped with cameras can efficiently acquire large-scale, high-resolution aerial images, providing rich data support for target detection and recognition. However, due to the characteristics of drone photography, such as high-altitude perspective, complex backgrounds, and large scale variations, targets in the images often exhibit problems such as large numbers, high density, small target size, and severe occlusion, posing a significant challenge to target detection algorithms.
[0003] Most existing target detection methods rely on sliding windows and manually designed features, which have limited detection capabilities and are ill-suited to the complex and varied appearance of targets in UAV aerial images. In recent years, deep learning-based target detection methods have made significant progress, but these methods generally depend on anchor box mechanisms and still suffer from insufficient detection accuracy, large localization errors, and limited inference speed when dealing with small and dense targets.
[0004] To overcome the shortcomings of anchor box methods, the academic community proposed the end-to-end detection framework DETR (DetectionTransformer) based on the Transformer encoder-decoder structure. This method utilizes a self-attention mechanism to model the global scope of the image, effectively avoiding the tedious process of manually designing anchor boxes. However, the original DETR model still suffers from drawbacks such as slow convergence speed, insensitivity to small targets, and insufficient feature utilization. To address these issues, researchers have successively proposed various improved models, such as DeformableDETR, SMCA-DETR, DAB-DETR, and DN-DETR, aiming to improve detection efficiency and small target recognition performance.
[0005] While the methods described above have improved upon the shortcomings of DETR to some extent, small target detection in UAV aerial photography scenarios still suffers from problems such as information loss, scale ambiguity, and distraction, resulting in unsatisfactory detection results and instances of missed detections and false detections. Therefore, improving the detection capability of small targets in UAV aerial images remains a pressing technical problem that needs to be solved. Summary of the Invention
[0006] Purpose of the invention: The purpose of this invention is to provide a method and system for detecting small targets in UAV aerial images based on the AMTS-DETR model, which can improve detection accuracy.
[0007] Technical solution: The present invention provides a method for small target detection in UAV aerial images based on the AMTS-DETR model, comprising:
[0008] (1) Preprocess the labels in the VisDrone drone aerial image dataset obtained in advance, and convert the label files in the dataset into COCO format;
[0009] (2) Parse the transformed dataset images and divide the dataset into training set, validation set and test set, and perform data augmentation processing on the training set images;
[0010] (3) Improve the RT-DETR model and construct a small target detection model for UAV aerial images based on the AMTS-DETR model;
[0011] (4) Input the data-enhanced training set images into the UAV aerial image small target detection model based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.
[0012] Further, step (1) includes:
[0013] First, iterate through all the annotation files in the VisDrone dataset and read the annotation information of each image in turn. Second, extract the size parameters of the image and the bounding box coordinates and category labels of the corresponding targets. Then, organize the image information, annotation information and category definitions in accordance with the annotation format of the COCO dataset to construct a JSON data structure. Finally, save the organized data as a JOSN file that conforms to the COCO format.
[0014] Further, the data augmentation process in step (2) includes:
[0015] RandomPhotometricDistort (random lighting perturbation), RandomZoomOut (random scaling and embedding), RandomIOUCrop (random cropping based on IOU), SanitizeBoundingBox (cleaning up invalid bounding boxes), image horizontal flipping, image resizing and type conversion, coordinate format conversion and normalization.
[0016] Furthermore, the RandomPhotometricDistort random lighting perturbation randomly adjusts the image height, contrast, saturation, and hue attributes with a preset probability; the RandomZoomOut random scaling and embedding randomly shrinks the image and places it into a canvas with a background filled with 0 pixels (i.e., black); the RandomIOUCrop random cropping based on IOU randomly crops the image with a preset probability; the SanitizeBoundingBox cleans up invalid boxes by setting min_size to 1 and removing abnormal boxes with a width or height less than 1 pixel; the image horizontal flipping uses a random method with a preset probability; the unified image size and type conversion specifically involves unifying the image size to 640×640 and converting it to a tensor type; the coordinate format conversion and normalization specifically involves converting the target box from the [x_min, y_min, x_max, y_max] format to the [center_x, center_y, width, height] format and normalizing it to the range [0,1].
[0017] Furthermore, the UAV aerial image small target detection model based on the AMTS-DETR model described in step (3) includes the ASGBlock module for improving the model's focus on key features and the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model, as well as the TBTS dual-branch token selector introduced in the encoder.
[0018] Furthermore, the implementation process of the ASGBlock module for improving the model's attention to key features is as follows: First, the input feature map is fed into a lightweight attention-enhancing convolutional layer ASGConv, which uses a 1×1 convolutional kernel to compress the input channels to achieve local feature extraction and channel dimension reduction. Second, the feature map output from this convolutional layer is sequentially subjected to batch normalization (BN) and SiLU activation operations to enhance the stability of the feature distribution and improve the model's nonlinear expressive ability. Then, when the stride is 2, a 3×3 depthwise separable convolutional layer DWConv is used to extract spatial features and downsample the feature map. The process involves performing BN normalization and SiLU activation functions sequentially to further extract spatial information features. Then, the extracted feature map is input into another 1×1 lightweight attention-enhanced convolutional layer, ASGConv, to adjust the channel dimensions and achieve deep feature fusion. BN normalization is then applied to ensure the stability of the feature distribution. Finally, the original input feature map is passed through a branch containing a 3×3 depthwise separable convolutional layer, a 1×1 convolutional layer, and a BN normalization layer to adjust the spatial size and number of channels. This is then combined with the deep feature map output from the main branch through element-wise weighted fusion, achieving efficient fusion of spatial and channel information to obtain the final output features.
[0019] Furthermore, the lightweight attention-enhanced convolutional layer ASGConv structure is as follows:
[0020] First, the input feature map is passed through a 1×1 convolutional layer and a 3×3 convolutional layer sequentially to dynamically adjust the number of channels and extract local features. Second, the feature map obtained after the above convolutional operation is concatenated with the original input feature map along the channel dimension. Then, the concatenated feature map is fed into the attention-weighted AS module. The AS module first extracts global channel information through a global average pooling layer, then passes through two 1×1 convolutional layers and a SiLU activation function to generate channel weight distribution, and performs normalization processing through a Sigmoid activation function. Then, the original feature map and the attention-weighted feature map are multiplied element-wise along the channel to achieve adaptive feature enhancement. Finally, a 1×1 convolutional layer is used to adjust the number of channels of the original feature map to keep the original feature map and the adaptively enhanced feature map consistent in the channel dimension, and weighted feature fusion is performed for output.
[0021] Furthermore, the implementation process of the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model is as follows: First, multi-scale feature maps are extracted sequentially through each stage of the backbone network. Then, by progressively performing convolution and downsampling operations on the input image, the output is the original... Figure 1Feature maps of four sizes are generated: 1 / 4, 1 / 8, 1 / 16, and 1 / 32. Next, a 1×1 convolution, batch normalization, and SiLU activation function are applied sequentially to adjust the channels of these four output feature maps. Then, upsampling or downsampling is performed on the channel-adjusted feature maps to unify the spatial dimensions of feature maps at different resolutions. Finally, the multi-scale features are fed into the RepC3 feature fusion module for deep fusion. The RepC3 feature fusion module employs a dual-branch structure. The first branch consists of a 1×1 convolutional layer, and the second branch first passes through a 1×1 convolutional layer, then three RepConv convolutional layers. The features output from the two branches are then element-wise added and fused. Finally, a 1×1 convolutional layer is used to integrate and compress the fused features, outputting the final fused feature map.
[0022] Furthermore, the implementation process of the TBTS dual-branch token selector introduced in the encoder is as follows:
[0023] First, the deepest scale feature map output by the backbone network is flattened, and each pixel in the feature map is mapped to a corresponding token, thus converting the two-dimensional feature representation into a one-dimensional sequence form.
[0024] Secondly, all the generated tokens are input into a self-attention module, and the importance score of each token is calculated through the self-attention mechanism.
[0025] Then, based on the obtained importance scores, all tokens are sorted in descending order, and the top K tokens with higher attention weights are selected as local tokens through the Top-K selection mechanism, while the remaining tokens are selected as global tokens.
[0026] Then, the local tokens and global tokens obtained from the partitioning are input into the local Transformer encoder and the global Transformer encoder, respectively, for feature encoding;
[0027] Finally, the features output by the local and global Transformer encoders are fused to output the final deep features;
[0028] The calculation formula for the self-attention mechanism is as follows:
[0029] ;
[0030] ;
[0031] in, For flattening operation, For feature maps, , and These represent the query matrix, key matrix, and value matrix, respectively. Represents the vector dimension. For self-attention mechanism, For normalization function, Indicates transpose;
[0032] The importance score of the Token is calculated using the following formula:
[0033] ;
[0034] ;
[0035] in, Indicates attention weights, The importance score of the token is indicated. This represents the summation operation. Indicates dimension.
[0036] Based on the same inventive concept, this invention also provides a small target detection system for UAV aerial images based on the AMTS-DETR model, comprising:
[0037] The preprocessing module is used to preprocess the labels in the pre-acquired VisDrone drone aerial image dataset, converting the label files in the dataset into COCO format;
[0038] The data augmentation module is used to parse the transformed dataset images and divide the dataset into training, validation and test sets, and perform data augmentation processing on the training set images.
[0039] The model building module is used to improve the RT-DETR model and build a small target detection model for UAV aerial images based on the AMTS-DETR model.
[0040] The detection module is used to input the augmented training set images into the small target detection model of UAV aerial images based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.
[0041] Beneficial Effects: Compared with existing technologies, this invention enhances the model's focus on key features and improves its expressive power by incorporating the ASGBlock lightweight attention module into the model's backbone network. It also introduces the MSFI multi-scale feature interaction module, enabling multi-scale dynamic fusion and enhancing the model's feature extraction capabilities. Furthermore, it designs a TBTS dual-branch token selector in the encoder to improve the model's detection capability for small target images. Compared to existing methods, the AMTS-DETR model proposed in this invention significantly improves the accuracy of small target detection in UAV aerial images and has promising application prospects. Attached Figure Description
[0042] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of the model network structure according to an embodiment of the present invention;
[0044] Figure 3 This is a structural diagram of the ASGBlock module according to an embodiment of the present invention;
[0045] Figure 4 This is a structural diagram of the ASGConv module according to an embodiment of the present invention;
[0046] Figure 5 This is a schematic diagram of the MSFI multi-scale feature interaction module according to an embodiment of the present invention;
[0047] Figure 6 This is a schematic diagram of the TBTS dual-branch token selector structure according to an embodiment of the present invention. Detailed Implementation
[0048] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0049] As attached Figure 1 As shown in this embodiment, the method for small target detection in UAV aerial images based on the AMTS-DETR model includes:
[0050] (1) Preprocess the labels in the VisDrone drone aerial image dataset obtained in advance, and convert the label files in the dataset into COCO format;
[0051] (2) Parse the transformed dataset images and divide the dataset into training set, validation set and test set, and perform data augmentation processing on the training set images;
[0052] (3) Improve the RT-DETR model and construct a small target detection model for UAV aerial images based on the AMTS-DETR model;
[0053] (4) Input the data-enhanced training set images into the UAV aerial image small target detection model based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.
[0054] Specifically, the process of converting the label files in the dataset into COCO format in step (1) is as follows: First, traverse all the label files in the VisDrone dataset and read the label information of each image in turn; second, extract the size parameters (height and width) of the image and the bounding box coordinates and category labels of the corresponding targets; then, standardize and organize the image information, label information and category definitions according to the label format of the COCO dataset to construct a JSON data structure; finally, save the organized data as a JOSN file that conforms to the COCO format.
[0055] The data augmentation process in step (2) includes RandomPhotometricDistort, which randomly adjusts the image's height, contrast, saturation, hue, and other attributes with a probability of 0.5; RandomZoomOut, which randomly shrinks the image and places it into a canvas with a background filled with 0 (i.e., black); RandomIOUCrop, which randomly crops the image based on IOU with a probability of 0.8; SanitizeBoundingBox, which cleans up invalid bounding boxes by setting min_size to 1 and removing abnormal bounding boxes with a width or height less than 1 pixel; horizontal image flipping with a random probability of 0.5; uniform image size to 640×640 and converting it to a tensor type; and converting the target bounding box from the [x_min, y_min, x_max, y_max] format to the [center_x, center_y, width, height] format and normalizing it to the range [0,1].
[0056] like Figure 2 As shown, the UAV aerial image small target detection model based on the AMTS-DETR model in step (3) includes the ASGBlock module for improving the model's attention to key features, the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model, and the TBTS dual-branch token selector introduced in the encoder.
[0057] The implementation process of the ASGBlock module used to improve the model's attention to key features is as follows: A lightweight ASGBlock attention module is integrated into the backbone network, such as... Figure 3 As shown, the working principle of this module is as follows: First, the input feature map is fed into a lightweight attention-enhanced convolutional layer ASGConv. This convolutional layer uses a 1×1 convolutional kernel to compress the input channels to achieve local feature extraction and dimensionality reduction of the channels. Second, the feature map output from this convolutional layer is sequentially subjected to batch normalization (BN) and SiLU activation to enhance the stability of the feature distribution and improve the nonlinear expressive power of the model. Then, when the stride is 2, a 3×3 depthwise separable convolutional layer DWConv is used to perform spatial feature extraction and downsampling operations on the feature map, and BN normalization is performed sequentially. The SiLU activation function is used to further extract spatial information features. Then, the extracted feature map is input into another 1×1 lightweight attention-enhanced convolutional layer ASGConv to adjust the channel dimension and achieve deep feature fusion. BN normalization is then used to ensure the stability of the feature distribution. Finally, the original input feature map is passed through a branch containing a 3×3 depthwise separable convolutional layer, a 1×1 convolutional layer, and a BN normalization layer to adjust the spatial size and number of channels of the input feature map. It is then fused element-wise with the deep feature map output from the main branch to achieve efficient fusion of spatial and channel information, thereby obtaining the final output feature.
[0058] like Figure 4 As shown, the lightweight attention-enhanced convolutional layer ASGConv structure is further described as follows: First, the input feature map is passed sequentially through a 1×1 convolutional layer and a 3×3 convolutional layer to dynamically adjust the number of channels in the feature map: when the input feature map is a high-resolution feature (i.e., convolution stride=1), the number of channels is compressed to reduce computational complexity and retain key feature information; when the input feature map is a low-resolution feature (i.e., convolution stride≠1), more channels are retained to enhance the extraction capability of global features; second, the feature map obtained after the above convolution operation is compared with the original input feature map along the channel dimension (dim=1). The first step involves concatenating the features using a concatenated layer (Concat). The concatenated feature maps are then fed into an attention-weighted (AS) module. This module first extracts global channel information using a global average pooling layer, followed by two 1×1 convolutional layers and a SiLU activation function to generate channel weight distributions. These weights are then normalized using a Sigmoid activation function. Next, the original feature map and the attention-weighted feature map are multiplied element-wise by channel to achieve adaptive feature enhancement. Finally, a 1×1 convolutional layer adjusts the number of channels in the original feature map to match the adaptively enhanced feature map in terms of channel dimension, and then weighted feature fusion is performed for output.
[0059] like Figure 5 As shown, the implementation process of the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model is as follows: First, multi-scale feature maps are extracted sequentially through each stage in the backbone network. By progressively performing convolution and downsampling operations on the input image, the output is the original... Figure 1 Feature maps of different sizes ( / 4, 1 / 8, 1 / 16, 1 / 32) are generated. Next, a 1×1 convolution, batch normalization, and SiLU activation function are sequentially applied to adjust the channels of these output feature maps of different sizes. Then, the channel-adjusted feature maps are upsampled or downsampled to unify the spatial dimensions of feature maps at different resolutions. Finally, the multi-scale features are fed into the RepC3 feature fusion module for deep fusion. The RepC3 feature fusion module uses a dual-branch structure. The first branch consists of a 1×1 convolutional layer, and the second branch first passes through a 1×1 convolutional layer, then three RepConv convolutional layers. The features output from the two branches are then element-wise added and fused. Finally, a 1×1 convolutional layer is used to integrate and compress the fused features, outputting the final fused feature map.
[0060] like Figure 6As shown, the implementation process of the TBTS dual-branch token selector introduced in the encoder is as follows: First, the deepest scale feature map (denoted as S5) output by the backbone network is flattened through the Flatten operation, mapping the two-dimensional spatial features to a one-dimensional sequence form, so that each pixel in the feature map corresponds to a feature token, realizing the transformation from two-dimensional feature representation to one-dimensional sequence representation; Second, all the tokens generated above are input into a self-attention module, and the attention weight score of each token is calculated through the self-attention mechanism to characterize the importance of features at different positions in global semantic modeling; Then, based on the obtained attention weight scores, all tokens are sorted in descending order of importance, and a Top-K selection mechanism is adopted. This mechanism determines the top K tokens with higher attention weights as local tokens according to the proportion of the number of tokens (i.e., setting a threshold ratio=0.25 and taking the top 25% of tokens with higher attention weights). The local tokens are divided into local tokens and global tokens. Then, the local tokens and global tokens are input into the local Transformer encoder and the global Transformer encoder respectively for feature encoding. Finally, the features output by the local and global Transformer encoders are fused to output the final deep features.
[0061] The formula for calculating the self-attention mechanism is as follows:
[0062] (1);
[0063] (2);
[0064] Where Flatten is the flattening operation, F is the feature map, and Q, K, and V represent the query matrix, key matrix, and value matrix, respectively. Represents the vector dimension.
[0065] The formula for calculating the importance score of a token (i.e., the attention weight score) is as follows:
[0066] (3);
[0067] (4);
[0068] Where weight represents attention weight, importance represents the importance score of the token (i.e. attention weight score), sum represents summation operation, and dim represents dimension.
[0069] In step (4), in order to fully utilize the computational performance of the experimental equipment and ensure the stability and convergence of the model training, the model is trained on the training set. Specifically, the batch size is set to 2, and the gradient accumulation steps are set to 2, achieving a training effect equivalent to a batch size of 4, thereby improving training efficiency under limited GPU memory conditions. This invention sets the number of model training iterations to 300 epochs (epoch=300). During training, an exponential moving average (EMA) mechanism is introduced, with an exponential decay coefficient of 0.9999. In the gradient backpropagation stage, a gradient clipping strategy is employed to limit the gradient norm to within 0.1. The AdamW optimization algorithm is selected as the optimizer for model parameters, with a global learning rate of 0.0001 and a weight decay coefficient of 0.0001. An early stopping mechanism is introduced: when the performance improvement on the validation set is less than 0.001 within 30 consecutive evaluation epochs (patience=30), the training process is automatically stopped to save computational resources and improve training efficiency. After training, the system automatically saves the model's last-epoch weight parameters and the optimal weight coefficients from the validation set. The optimal weight model trained for 300 epochs is then used for detecting small targets in UAV aerial images, achieving accurate identification and localization of small-scale targets.
[0070] This invention uses a common standard for evaluating the performance of target detection algorithms: Mean Average Precision (MAP).
[0071] Mean Average Precision (MAP): Represents the average accuracy of all samples; the formula is shown below:
[0072] (5); (6);
[0073] In the formula, AP represents the area enclosed by the curve formed by precision and recall, MAP represents the average of the mean precision of all samples, and c represents the number of samples.
[0074] The specific experimental results before and after the improvement are shown in Table 1.
[0075]
[0076] As shown in Table 1, compared with the RT-DETR model, the AMTS-DETR model improved the values of MAP_0.5, MAP_0.75, and MAP_0.5:0.95 by 3.4, 3.5, and 2.9 percentage points, respectively, significantly improving the detection accuracy of small targets in UAV aerial images.
[0077] This method integrates the ASGBlock lightweight attention module into the backbone network to improve the model's attention to key features and enhance its expressive power; it introduces the MSFI multi-scale feature interaction module to enable the model to achieve multi-scale dynamic fusion and enhance its feature extraction capabilities; then, it introduces the TBTS dual-branch token selector into the encoder to improve the model's ability to detect small target images, which has good application prospects.
[0078] Based on the same inventive concept, this invention also provides a small target detection system for UAV aerial images based on the AMTS-DETR model, comprising:
[0079] The preprocessing module is used to preprocess the labels in the pre-acquired VisDrone drone aerial image dataset, converting the label files in the dataset into COCO format;
[0080] The data augmentation module is used to parse the transformed dataset images and divide the dataset into training, validation and test sets, and perform data augmentation processing on the training set images.
[0081] The model building module is used to improve the RT-DETR model and build a small target detection model for UAV aerial images based on the AMTS-DETR model.
[0082] The detection module is used to input the augmented training set images into the small target detection model of UAV aerial images based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.
Claims
1. A method for small target detection in UAV aerial images based on the AMTS-DETR model, characterized in that, include: (1) Preprocess the labels in the VisDrone drone aerial image dataset obtained in advance, and convert the label files in the dataset into COCO format; (2) Parse the transformed dataset images and divide the dataset into training set, validation set and test set, and perform data augmentation processing on the training set images; (3) Improve the RT-DETR model and construct a small target detection model for UAV aerial images based on the AMTS-DETR model; (4) Input the data-enhanced training set images into the UAV aerial image small target detection model based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.
2. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 1, characterized in that, Step (1) includes: First, iterate through all the annotation files in the VisDrone dataset and read the annotation information of each image in turn. Second, extract the size parameters of the image and the bounding box coordinates and category labels of the corresponding targets. Then, organize the image information, annotation information and category definitions in accordance with the annotation format of the COCO dataset to construct a JSON data structure. Finally, save the organized data as a JOSN file that conforms to the COCO format.
3. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 1, characterized in that, The data augmentation process in step (2) includes: RandomPhotometricDistort (random lighting perturbation), RandomZoomOut (random scaling and embedding), RandomIOUCrop (random cropping based on IOU), SanitizeBoundingBox (cleaning up invalid bounding boxes), image horizontal flipping, image resizing and type conversion, coordinate format conversion and normalization.
4. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 3, characterized in that, The RandomPhotometricDistort method randomly adjusts the image's height, contrast, saturation, and hue attributes with a preset probability; the RandomZoomOut method randomly shrinks the image and places it into a canvas with a background filled with 0 pixels (black); the RandomIOUCrop method randomly crops the image based on IOU with a preset probability; the SanitizeBoundingBox method cleans up invalid bounding boxes by setting min_size to 1 and removing abnormal bounding boxes with a width or height less than 1 pixel; the image horizontal flipping method uses a random method with a preset probability; the unified image size and type conversion specifically involves unifying the image size to 640×640 and converting it to a tensor type; the coordinate format conversion and normalization specifically involves converting the target bounding box from the [x_min, y_min, x_max, y_max] format to the [center_x, center_y, width, height] format and normalizing it to the range [0,1].
5. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 1, characterized in that, The small target detection model for UAV aerial images based on the AMTS-DETR model in step (3) includes the ASGBlock module for improving the model’s focus on key features and the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model, and the TBTS dual-branch token selector introduced in the encoder.
6. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 5, characterized in that, The implementation process of the ASGBlock module used to improve the model's attention to key features is as follows: First, the input feature map is fed into a lightweight attention-enhancing convolutional layer ASGConv. This convolutional layer uses a 1×1 convolutional kernel to compress the input channels to achieve local feature extraction and dimensionality reduction of the channels. Second, the feature map output from this convolutional layer is sequentially subjected to batch normalization (BN) and SiLU activation to enhance the stability of the feature distribution and improve the nonlinear expressive power of the model. Then, when the stride is 2, a 3×3 depthwise separable convolutional layer DWConv is used to perform spatial feature extraction and downsampling operations on the feature map, and BN normalization and SiLU activation are sequentially executed to further extract spatial information features. Then, the extracted feature map is input into another 1×1 lightweight attention-enhanced convolutional layer ASGConv to adjust the channel dimensions and achieve deep feature fusion. BN normalization is then used to ensure the stability of the feature distribution. Finally, the original input feature map is passed through a branch containing a 3×3 depthwise separable convolutional layer, a 1×1 convolutional layer, and a BN normalization layer to adjust the spatial size and number of channels of the input feature map. It is then fused element-wise with the deep feature map output from the main branch to achieve efficient fusion of spatial and channel information, thereby obtaining the final output feature.
7. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 6, characterized in that, The lightweight attention-enhanced convolutional layer ASGConv structure is as follows: First, the input feature map is passed through a 1×1 convolutional layer and a 3×3 convolutional layer sequentially to dynamically adjust the number of channels and extract local features. Second, the feature map obtained after the above convolutional operation is concatenated with the original input feature map along the channel dimension. Then, the concatenated feature map is fed into the attention-weighted AS module. The AS module first extracts global channel information through a global average pooling layer, then passes through two 1×1 convolutional layers and a SiLU activation function to generate channel weight distribution, and performs normalization processing through a Sigmoid activation function. Then, the original feature map and the attention-weighted feature map are multiplied element-wise along the channel to achieve adaptive feature enhancement. Finally, a 1×1 convolutional layer is used to adjust the number of channels of the original feature map to keep the original feature map and the adaptively enhanced feature map consistent in the channel dimension, and weighted feature fusion is performed for output.
8. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 5, characterized in that, The implementation process of the MSFI multi-scale feature interaction module for realizing multi-scale dynamic fusion of the model is as follows: First, multi-scale feature maps are extracted sequentially through each stage of the backbone network. By performing convolution and downsampling operations on the input image step by step, the output is feature maps of four sizes: 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the original image. Secondly, the four output feature maps of the above output are sequentially subjected to channel adjustment operations through a 1×1 convolution, batch normalization, and SiLU activation function. Then, the channel-adjusted feature maps are upsampled or downsampled to unify the spatial size of feature maps of different resolutions. Finally, the multi-scale features are fed into the RepC3 feature fusion module for deep fusion. The RepC3 feature fusion module adopts a dual-branch structure. The first branch consists of a 1×1 convolutional layer. The second branch first passes through a 1×1 convolutional layer, then through three RepConv convolutional layers. The features output from the two branches are then added element-wise and fused. Finally, a 1×1 convolutional layer is used to integrate and compress the fused features to output the final fused feature map.
9. The method for small target detection in UAV aerial images based on the AMTS-DETR model according to claim 5, characterized in that, The implementation process of the TBTS dual-branch token selector introduced in the encoder is as follows: First, the deepest scale feature map output by the backbone network is flattened, and each pixel in the feature map is mapped to a corresponding token, thus converting the two-dimensional feature representation into a one-dimensional sequence form. Secondly, all the generated tokens are input into a self-attention module, and the importance score of each token is calculated through the self-attention mechanism. Then, based on the obtained importance scores, all tokens are sorted in descending order, and the top K tokens with higher attention weights are selected as local tokens through the Top-K selection mechanism, while the remaining tokens are selected as global tokens. Then, the local tokens and global tokens obtained from the partitioning are input into the local Transformer encoder and the global Transformer encoder, respectively, for feature encoding; Finally, the features output by the local and global Transformer encoders are fused to output the final deep features; The calculation formula for the self-attention mechanism is as follows: ; ; in, For flattening operation, For feature maps, , and These represent the query matrix, key matrix, and value matrix, respectively. Represents the vector dimension. For self-attention mechanism, For normalization function, Indicates transpose; The importance score of the Token is calculated using the following formula: ; ; in, Indicates attention weights. The importance score of the token is indicated. This represents the summation operation. Indicates dimension.
10. A small target detection system for UAV aerial images based on the AMTS-DETR model, characterized in that, include: The preprocessing module is used to preprocess the labels in the pre-acquired VisDrone drone aerial image dataset, converting the label files in the dataset into COCO format; The data augmentation module is used to parse the transformed dataset images and divide the dataset into training, validation and test sets, and perform data augmentation processing on the training set images. The model building module is used to improve the RT-DETR model and build a small target detection model for UAV aerial images based on the AMTS-DETR model. The detection module is used to input the augmented training set images into the small target detection model of UAV aerial images based on the AMTS-DETR model for training, obtain the pre-trained AMTS-DETR model weights, and use the pre-trained AMTS-DETR model weights to detect small targets in UAV aerial images.