An unmanned aerial vehicle aerial photograph image target detection method and system based on edge feature enhancement and dynamic query
The target detection method for UAV aerial images, which utilizes edge feature enhancement and dynamic querying, solves the problems of low accuracy and false negatives in small target detection, achieving efficient and accurate target detection in UAV aerial images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUILIN UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-24
AI Technical Summary
Small target detection in drone aerial images suffers from low accuracy and high false positive/false negative rates, making it difficult to balance accuracy and real-time performance. Existing DETR-type networks perform poorly in small target detection and lack sufficient semantic information capture during the feature extraction stage.
We design a target detection method for UAV aerial images based on edge feature enhancement and dynamic query. We enhance the feature representation of small targets through the MEFE module, and use SOAP feature fusion network and AEQ module to adapt to changes in the number of target instances, and build a visual detection system.
It improves the detection accuracy of small targets, reduces false negatives and missed detections, and achieves a good balance between detection accuracy and real-time performance, making it suitable for scenarios such as agricultural monitoring, disaster emergency response, and urban management.
Smart Images

Figure CN122454446A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology in UAV aerial imagery, specifically to a method and system for target detection in UAV aerial imagery based on edge feature enhancement and dynamic querying. Background Technology
[0002] The development of unmanned aerial vehicle (UAV) technology began with military applications, initially for reconnaissance and surveillance missions. With the advancement of UAV technology, UAV-based image target detection has been widely applied in various fields such as agricultural monitoring, disaster emergency response, and urban management. However, images from a UAV's perspective are characterized by a wide field of view and numerous small targets, posing significant challenges to target detection tasks. Because small targets have low resolution and limited learnable contextual information, they often coexist with large targets, with large targets often dominating the feature learning process, making small targets difficult to detect. To address this issue, existing technologies often employ methods such as pyramid pooling, multi-scale convolution, and multi-scale feature fusion to attempt to capture feature information at different scales to improve the accuracy of small target detection.
[0003] Convolutional neural networks (CNNs) demonstrate good performance and robustness in image object detection tasks due to their local feature extraction and weight sharing capabilities. However, their difficulty in modeling global context and long-range dependencies limits their application in complex scenes. DETR-type object detection networks combine the advantages of CNNs and Transformers, improving the ability to integrate global information. However, they suffer from high computational cost and insufficient real-time performance. RTDETR, as an improved DETR network, combines ResNet and Transformer, enhancing feature representation and global information integration through residual connections and self-attention mechanisms, thus improving detection accuracy. However, due to the inherent characteristics of the Transformer architecture, it relies excessively on global context, leading to the weakening of local detail information. This results in poor performance in small object detection, and insufficient semantic information capture during the feature extraction stage, making it prone to losing weak features of small objects in the early stages.
[0004] Furthermore, existing DETR-type network decoders use a fixed number of queries, which cannot adapt to changes in the number of target instances in different images. This leads to missed detections in dense scenes and false detections in sparse scenes. Simultaneously, traditional feature fusion networks have weak small target representation capabilities and are prone to losing feature information during upsampling, further affecting the accuracy of small target detection. Therefore, how to balance the accuracy and real-time performance of target detection in UAV aerial images while solving the problems of missed and false detections of small targets has become a pressing technical challenge for those skilled in the art. Summary of the Invention
[0005] To address the technical problems of low accuracy in small target detection, high false negative and false positive rates, and difficulty in balancing accuracy and real-time performance in existing UAV aerial image target detection technologies, this invention provides a UAV aerial image target detection method and system based on edge feature enhancement and dynamic query. By designing a dedicated feature fusion network and dynamic query mechanism, the method strengthens the representation of small target features, adapts to changes in the number of target instances in different scenarios, improves detection accuracy and real-time performance, and simultaneously constructs a visual detection system to enhance detection efficiency.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a target detection method for UAV aerial images based on edge feature enhancement and dynamic query, comprising the following steps:
[0007] S1. Preprocess the drone aerial image dataset. Preprocessing includes converting the format of the annotation files and removing incorrect category labels, and dividing the dataset into training set, validation set and test set.
[0008] S2. Construct a target detection model for UAV aerial images based on edge feature enhancement and dynamic query. The target detection model is an enhanced RTDETR model, including a feature extraction network Backbone, a feature fusion network Neck, and a detection head. The feature extraction network Backbone uses multiple residual modules connected in series to form a ResNet network. The feature fusion network Neck adds a small target detection head and embeds a multi-scale edge feature enhancement module MEFE to form a new small target-aware feature fusion network SOAP. The detection head consists of an IoU-aware Query Selection module and a decoder with an added adaptive entropy query module AEQ. The construction process is as follows: the feature extraction network Backbone extracts feature maps from the UAV aerial images, inputs them into the feature fusion network Neck for fusion, generates a fused feature output map, and finally inputs it into the detection head for target localization and classification.
[0009] S3. Input the training set of the dataset into the target detection model for iterative training to obtain the target detection model of UAV aerial image;
[0010] S4. Input the test set of the dataset into the target detection model of the UAV aerial image for testing, obtain the model test results, and evaluate the performance of the target detection model;
[0011] S5. Load the UAV aerial image target detection model into the UAV image detection system, detect the UAV aerial image to be detected, obtain the detection visualization result and save it.
[0012] Preferably, in step S2, the specific process of constructing the target detection model is as follows:
[0013] S21. Feature Extraction: ResNet is used as the backbone network to extract four feature maps of different scales from the drone aerial images, denoted as C1, C2, C3 and C4 respectively. The spatial resolution of each feature map decreases in sequence, with C1 having the highest resolution and retaining the richest low-level detail information, and C4 having the lowest resolution and stronger global semantics.
[0014] S22. Feature Fusion: The multi-scale feature maps extracted from the backbone network are input into the feature fusion network SOAP for bidirectional fusion, generating output feature maps P1, P2, P3, and P4 of four sizes: 160×160, 80×80, 40×40, and 20×20, respectively. The specific fusion process is as follows:
[0015] P1 feature map (160×160): obtained by stitching together the C1 feature map, the C2 feature map after 2x deconvolution upsampling, the C3 feature map after 4x deconvolution upsampling, and the C4 feature map after 8x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0016] P2 feature map (80×80): obtained by stitching together the C1 feature map after 2x downsampling, the C2 feature map, the C3 feature map after 2x deconvolution upsampling, and the C4 feature map after 4x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0017] P3 feature map (40×40): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0018] P4 feature map (20×20): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0019] The MEFE edge feature enhancement module consists of a Local Feature Enhancement (LFE) module and a Multi-Scale Edge Feature Fusion (MUEG) module. The specific workflow is as follows: First, the extracted feature map is fed into the LFE module, which integrates a shifted convolution kernel. By enhancing local details and suppressing redundant background information, it enriches the feature representation of small targets and reduces the loss of key local features. Then, the feature map output by the LFE module is fed into the MUEG module. A 3×3 average pooling layer smooths the input feature map, extracting low-frequency background components and suppressing noise. Next, the smoothed feature map is subtracted from the original input feature map to separate high-frequency edge information, highlighting the fine-grained details of small targets. Then, a Scharr filter is used to refine the high-frequency edge information and suppress non-critical regions. Finally, the refined edge information is fused with the original input feature map by adding the residuals, generating a feature map with a clearer target outline, providing support for subsequent target localization and classification.
[0020] S23. Object Detection: The P1, P2, P3, and P4 feature maps output by the SOAP feature fusion network are fed into the detection head. First, features are filtered through the IoU-aware Query Selection module. This module is only enabled during the training phase. Its core mechanism guides the detection head to establish a positive correlation between feature classification confidence and localization accuracy, enabling IoU-aware... Features with higher QuerySelection scores receive higher classification scores, while those with lower scores receive lower scores, ensuring that the predicted bounding boxes corresponding to the selected Top-K features simultaneously possess high classification confidence and high localization accuracy. Subsequently, the input features are fed into the Decoder, which divides the input features into three parts: Q, K, and V. The Adaptive Entropy Query (AEQ) module calculates the information content of the input feature map and dynamically adjusts the number of queries Q in the decoder to adapt to changes in the number of target instances in different images, mitigating the problems of missed detections in dense scenes and false detections in sparse scenes. Next, Q and K are added to the learned position encoding and then input into the multi-head self-attention module in the decoder for modification. The output result is then processed by residual connections and a feedforward neural network (FFN) to complete the decoding, achieving target localization and classification. The FFN consists of two linear layers.
[0021] Preferably, the calculation steps of the Adaptive Entropy Query Module (AEQ) are as follows:
[0022]
[0023] Among them, E i The information entropy of the feature map, The probability distribution is calculated using the formula below:
[0024]
[0025] Indicates the first The feature map value (non-feature value) of the sample falls into the first... The frequency of each histogram interval can be used to capture the overall distribution characteristics of eigenvalues. This method is not affected by the absolute magnitude of the eigenvalues, but only focuses on their relative distribution. H i The calculation method for (k) is as follows.
[0026]
[0027] Among them, H i (k) represents the first The sample in the histogram is number 1. The count value within each interval This is the index of the samples in the batch. For the histogram of the th Index of each interval, It is the first One sample in the channel ,Location eigenvalues at that location This refers to the channel index of the feature map. For the height index of the feature map, This is the width index of the feature map. This is an indicator function (it takes a value of 1 when the condition is met, and 0 otherwise); This is the histogram scaling factor. This is the histogram offset; finally, the entropy values of all samples in the current batch are normalized (linearly mapped to the [0,1] interval), and a threshold is set.
[0028] Preferably, in step S3, the iterative training process uses the SGD optimizer, with 200 iterations until the model converges. The optimal weight parameter model is obtained through multiple rounds of iterative training, which serves as the optimal target detection model for UAV aerial images.
[0029] Preferably, in step S5, the UAV image detection system uses PyQt5 technology to implement the interactive interface, integrating functions such as model loading, data input, parameter configuration, result display, log recording, and result saving. The specific operation process is as follows:
[0030] 1) Model loading: The user selects the model weight file, and the system performs an integrity check on the file. If the check passes, the loading is successful; if the check fails, an error message is displayed and the user is guided to reload.
[0031] 2) Data Input: The system supports three input methods: single image, batch data from folders, and video stream files. Users can choose the input source according to their needs.
[0032] 3) Parameter configuration: Users can adjust the confidence threshold and select the computing device through the interactive interface. After configuration, click the "Start Detection" button to start inference.
[0033] 4) Results Display: The original input image and the detection result image with labeled boxes are displayed synchronously in the center of the interface. Different types of targets are distinguished by different colored labeled boxes; the detection log is displayed in real time on the right side of the interface, including detection time, result storage path, and count statistics of various targets; the statistics panel at the bottom of the interface presents key performance indicators such as total number of targets, inference latency, and refresh rate.
[0034] 5) Result saving: Users can save the detection result image with annotation boxes and statistical data to a specified local path to complete the detection process.
[0035] A target detection system for UAV aerial images based on edge feature enhancement and dynamic query is disclosed. The system includes a preprocessing module, a model building module, a model training module, a model testing module, and a visualization detection module. The modules work together to achieve efficient and accurate detection of UAV aerial images.
[0036] The preprocessing module loads the VisDrone2019 public dataset, partitions and optimizes the data, and outputs training, validation, and test sets adapted for model training. The model building module constructs an enhanced RTDETR model containing a ResNet backbone network, a SOAP feature fusion network, and a detection head with an AEQ module. The model training module executes iterative training and outputs the optimal object detection model. The model testing module executes the testing process and outputs detection results and performance evaluation reports. The visualization detection module builds a PyQt5 interactive interface to implement model loading, data input, parameter configuration, result display, and saving functions, improving the convenience of detection operations.
[0037] Compared with the prior art, the present invention has the following advantages:
[0038] 1. This invention designs an edge feature enhancement module (MEFE), which combines LFE local feature enhancement and MUEG multi-scale edge fusion to strengthen the feature representation of small targets and suppress redundant background information, thus solving the problem of low detection accuracy caused by low resolution and weak features of small targets in UAV aerial images.
[0039] 2. An AEQ adaptive entropy query module is introduced, which dynamically adjusts the number of decoder queries based on image information entropy to adapt to changes in the number of target instances in different scenarios. This effectively alleviates the problems of missed detections in dense scenes and false detections in sparse scenes, and improves the adaptability of the model.
[0040] 3. Design a SOAP feature fusion network, using deconvolution upsampling instead of traditional interpolation upsampling to reduce feature information loss. At the same time, add a high-resolution detection head to enhance the perception of small targets and further improve the detection accuracy of small targets.
[0041] 4. The model structure was optimized to improve detection accuracy while controlling the computational complexity of the model, keeping the model's GFLOPs at 86.3, which is significantly lower than similar high-performance models, achieving a good balance between detection accuracy and real-time performance;
[0042] 5. Build a PyQt5-based visual detection system that integrates functions such as model loading, data input, parameter configuration, result display and saving, shields the complexity of the underlying code, improves the ease of operation, and is suitable for various practical application scenarios such as agricultural monitoring, disaster emergency response, and urban management;
[0043] 6. Experimental results show that, compared with the baseline RT-DETR, the model of this invention improves AP by 4.7% and APs by 3.6 percentage points. Compared with other mainstream models, it has better detection accuracy and higher computational efficiency, and has good practicality and promotion value. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the process of the present invention.
[0045] Figure 2 This is a structural diagram of the target detection method of the present invention.
[0046] Figure 3 This is a schematic diagram of the AEQ module algorithm of the present invention.
[0047] Figure 4 This is a structural diagram of the MEFE module of the present invention.
[0048] Figure 5 This is a diagram of the SOAP feature network structure of the present invention.
[0049] Figure 6 This is a visual comparison of the VisDrone dataset before and after the improvements of this invention.
[0050] Figure 7 This is a schematic diagram of the detection process of the UAV detection system of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] This embodiment provides a target detection method and system for UAV aerial images based on edge feature enhancement and dynamic query. The specific implementation process of the detection method is as follows:
[0053] Step S1: Dataset Preprocessing
[0054] The VisDrone2019 public dataset was used as the basis for training, validation, and testing. This dataset contains 8,629 aerial images taken from the perspective of drones, covering 10 categories: bicycles, sunshade tricycles, tricycles, pedestrians, people, cars, vans, buses, trucks, and motorcycles. The dataset was divided into training, validation, and testing sets according to the proportions, with 6,470 images in the training set, 548 in the validation set, and 1,610 in the testing set, which were used for model training, validation, and performance testing.
[0055] Step S2: Object Detection Model Construction
[0056] The constructed target detection model is an enhanced RTDETR target detection model, which consists of three parts: a feature extraction network, a feature fusion network, and a detection head. The construction process is roughly as follows: the feature extraction network Backbone extracts feature maps from the drone aerial images, inputs them into the feature fusion network Neck for fusion, generates a fused feature output map, and finally inputs it into the detection head Head for target localization and classification.
[0057] Specifically as follows:
[0058] 1. Feature Extraction Network (Backbone): The ResNet network is used as the backbone network. This network consists of multiple residual modules connected in series. It extracts four feature layers C1, C2, C3, and C4 at different scales from the input UAV aerial image. The spatial resolution of each feature layer decreases sequentially. C1 has the highest resolution, retains rich low-level details, and can capture subtle features of small targets. C4 has the lowest resolution, has stronger global semantics, and can capture the overall features of the target, providing a foundation for subsequent feature fusion.
[0059] 2. Feature Fusion Network (Neck): This network adds a small target detection head and embeds a MEFE multi-scale edge feature enhancement module to strengthen the feature representation of small targets. The feature fusion process is divided into four stages, generating feature maps of four sizes: P1, P2, P3, and P4. The specific fusion method is as follows:
[0060] P1 feature map (160×160): obtained by stitching together the C1 feature map, the C2 feature map after 2x deconvolution upsampling, the C3 feature map after 4x deconvolution upsampling, and the C4 feature map after 8x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0061] P2 feature map (80×80): obtained by stitching together the C1 feature map after 2x downsampling, the C2 feature map, the C3 feature map after 2x deconvolution upsampling, and the C4 feature map after 4x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0062] P3 feature map (40×40): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0063] P4 feature map (20×20): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module;
[0064] The MEFE module consists of the LFE local feature enhancement module and the MUEG multi-scale edge feature fusion module. The LFE module integrates a displacement convolution kernel, which can enhance local details and suppress redundant background information. The MUEG module smooths the feature map through a 3×3 average pooling layer, separates high-frequency edge information, refines it through a Scharr filter, and then fuses it with the original feature map by adding the residuals to improve feature clarity.
[0065] 3. Detection Head: Composed of an IoU-aware Query Selection module and a decoder with an AEQ adaptive entropy query module added; the IoU-aware Query Selection module is only enabled during the training phase and is used to establish a positive correlation between classification confidence and localization accuracy; the AEQ module is used to calculate the information entropy of the input feature map and dynamically adjust the number of query Qs in the decoder according to the information entropy, adapting to changes in the number of target instances in different images. The calculation steps of the AEQ adaptive entropy query module are as follows:
[0066]
[0067] Among them, E i The information entropy of the feature map, The probability distribution is calculated using the formula below:
[0068]
[0069] Indicates the first The feature map value (non-feature value) of the sample falls into the first... The frequency of each histogram interval can be used to capture the overall distribution characteristics of eigenvalues. This method is not affected by the absolute magnitude of the eigenvalues, but only focuses on their relative distribution. H i The calculation method for (k) is as follows.
[0070]
[0071] Among them, H i (k) represents the first The sample in the histogram is number 1. The count value within each interval This is the index of the samples in the batch. For the histogram of the th Index of each interval, It is the first One sample in the channel ,Location eigenvalues at that location This refers to the channel index of the feature map. For the height index of the feature map, This is the width index of the feature map. This is an indicator function (it takes a value of 1 when the condition is met, and 0 otherwise); This is the histogram scaling factor. This is the histogram offset; finally, the entropy values of all samples in the current batch are normalized (linearly mapped to the [0,1] interval), and a threshold is set.
[0072] Step S3: Model Training
[0073] The preprocessed training set was input into the constructed object detection model, and the SGD optimizer was used for iterative training for 200 rounds until the model converged. The training hyperparameters were set as follows: initial learning rate 0.01, batch size 4, IOU threshold 0.5, momentum 0.937, works 8, and image size adjusted to 640×640. Using the RT-DETR-r18 model size as a training example, the weight parameters were optimized through multiple rounds of iteration to obtain the optimal UAV aerial image detection model.
[0074] Alternatively, the Adamw optimizer can be used for training, also iterating for 200 rounds, with hyperparameter settings consistent with the SGD optimizer. Both methods can achieve model convergence and obtain the optimal model.
[0075] Step S4: Model Testing
[0076] The preprocessed test set is input into the optimal UAV aerial image target detection model to execute the inference process and obtain the detection results. Precision (P), recall (R), average precision (AP), average small target precision (APs), FLOPs, and FPS are used as evaluation metrics to comprehensively evaluate the model performance, among which:
[0077] Precision P = TP / (TP+FP) reflects the reliability of the model's predictions; where TP represents true positives and FP represents false positives. Precision reflects the reliability of the model's prediction results, that is, the probability that the model correctly classifies a sample as positive. A higher precision means a lower probability that the model will misclassify a negative sample as a positive sample.
[0078] Recall R = TP / (TP + FN), where FN represents false negatives. Recall reflects the model's ability to cover positive samples, that is, what proportion of true positive samples the model can find. A higher recall means a lower probability of the model missing positives.
[0079] Average Precision (AP) is a core metric in object detection used to quantitatively evaluate model performance. Essentially, it is defined as the area under the precision-recall curve (PR curve), with AP ranging from 0 to 1. An AP value closer to 1 indicates that the model possesses both high recall and precision for that category. This metric comprehensively measures the model's performance in object classification and localization tasks by integrating the change in precision under different recall rates. Its mathematical expression is shown below:
[0080]
[0081] In evaluating the performance of object detection models, to more precisely measure the model's ability to perceive targets at different scales, fine-grained evaluation metrics based on target size are introduced on top of the average precision (AP). These metrics, namely APs, APm, and APl, are statistically stratified based on the pixel area of the ground truth bounding boxes. The specific categorization criteria are as follows: APs is for small-scale targets, defined as samples with a pixel area less than 32×32; APm is for medium-scale targets, corresponding to samples with a pixel area between 32×32 and 96×96; and APl is for large-scale targets, applicable to samples with a pixel area greater than 96×96. By introducing these scale-specific evaluation metrics, the performance differences of the model in multi-scale object detection tasks can be revealed more comprehensively.
[0082] FPS represents the number of frames processed per second, and is a core metric for evaluating the real-time performance of object detection models. This metric directly reflects the number of images the model can process per unit of time, and its mathematical expression is shown below:
[0083]
[0084] Where T represents the average inference time per image. A higher FPS value means lower inference latency and stronger real-time response capability of the model.
[0085] FLOPs are used to measure the total number of floating-point operations required by a model in a single forward propagation (or including backpropagation). They are a key indicator of computational complexity and are usually counted in units of the number of floating-point operations required per sample.
[0086] Step S5: Visual Inspection
[0087] A UAV image detection system was built based on PyQt5 technology, realizing functions such as model loading, data input, parameter configuration, result display, log recording, and result saving. The specific operation process is as follows:
[0088] 1. Model Loading: The user selects a model weight file. The system verifies the integrity of the file. If the verification passes, the model is loaded. If the verification fails, an error message is displayed and the user is guided to reload the model.
[0089] 2. Data Input: Users can select a single image, a batch of images from a folder, or a video stream file as the input source;
[0090] 3. Parameter Configuration: Users can adjust the confidence threshold using the slider, select the computing device (supporting CUDA GPU acceleration), and click "Start Detection" to start inference;
[0091] 4. Results Display: The center of the interface displays the original image and the detection results with labeled boxes in two columns, with different colored boxes distinguishing different target categories; the log area on the right displays the detection time, result storage path, and target count for each category in real time; the statistics panel at the bottom displays the total number of targets, inference latency, and refresh rate;
[0092] 5. Result saving: When the user clicks the "Save" button, the detected image with the annotation box and the statistical data are saved to the local specified path, completing the detection process.
[0093] This invention comprehensively evaluates the model performance under the following conditions.
[0094] The test hardware environment consisted of an Intel Core i5-12400F processor, 32GB of RAM, and an NVIDIA RTX 4060 Ti 16GB graphics card; the software platform was Windows-based PyTorch 2.0.1, Python interpreter version 3.9.1, and CUDA version 12.1. The hyperparameter settings are shown in the table below.
[0095]
[0096] To verify the effectiveness of the present invention, the following experiment was conducted:
[0097] Ablation experiments were conducted on the VisDrone dataset, using RT-DETR as the baseline, to verify the effectiveness of the three improved modules. To address the low accuracy of small target detection caused by the sparsity of global features in the Transformer, a dynamic target query mechanism module A was introduced, improving AP, AP50, AP75, and APs by 1.0%, 1.8%, 0.7%, and 0.9%, respectively. A high-resolution detection head module B was used to preserve detail information, improving accuracy by 2.3%, 3.0%, 2.5%, and 2.6%, respectively. A multi-scale edge feature enhancement module C was added to alleviate occlusion interference, improving accuracy by 0.8%, 1.5%, 0.9%, and 0.7%, respectively. The combined use of these three modules achieved optimal performance, with overall improvements in AP, AP50, AP75, and APs of 3.2%, 4.6%, 3.5%, and 3.6%, respectively, demonstrating that the synergy of these modules effectively improves the accuracy of small target detection. The table below shows the experimental data.
[0098]
[0099] The proposed UAV target detection method AyME-RTDETR, based on edge feature enhancement and dynamic query, is compared with the current mainstream target detection models in terms of detection accuracy and computational complexity for UAV image datasets. The results of different models are shown in the table below.
[0100]
[0101] In comparative experiments with various advanced methods, the improved AqME-RTDETR achieved the highest mean accuracy (AP) of 29.5% among all evaluation models. Compared to the baseline RT-DETR, its AP is significantly improved by 4.7%; it also maintains a 0.4% lead over the second-best performing DINO, demonstrating that the proposed improvement effectively enhances detection accuracy. The model performs excellently across different target scales: for small target detection, the AP reaches 21.6%, a 3.6 percentage point improvement over RT-DETR-R18; for medium target detection, the APm is 39.9%, a 3.3 percentage point improvement; and for large target detection, the APl is 42.7%, a 0.3 percentage point improvement. These results indicate that AqME-RTDETR is enhanced across various target detection tasks, with a particularly significant improvement in small target detection.
[0102] Furthermore, the model maintains a good balance between performance and efficiency. The computational cost of AqME-RTDETR is 86.3 GFLOPs, which, while higher than some lightweight models, is significantly lower than computationally more expensive models, such as YOLOv8-L's 164.9 GFLOPs, indicating that it achieves superior detection performance with moderate computational overhead. The consistent improvement in AP, AP50, and AP75 metrics validates the effectiveness of improvements such as the dynamic query selection mechanism, edge feature extraction module, and enhanced prediction head; these designs significantly enhance the model's overall detection capabilities.
[0103] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A target detection method for UAV aerial images based on edge feature enhancement and dynamic query, characterized in that: Includes the following steps: S1. Preprocess the drone aerial image dataset. Preprocessing includes converting the format of the annotation files and removing incorrect category labels, and dividing the dataset into training set, validation set and test set. S2. Construct a target detection model for UAV aerial images based on edge feature enhancement and dynamic query. The target detection model is an enhanced RTDETR model, including a feature extraction network Backbone, a feature fusion network Neck, and a detection head. The feature extraction network Backbone uses multiple residual modules connected in series to form a ResNet network. The feature fusion network Neck adds a small target detection head and embeds a multi-scale edge feature enhancement module MEFE to form a new small target-aware feature fusion network SOAP. The detection head consists of an IoU-aware Query Selection module and a decoder with an added adaptive entropy query module AEQ. The construction process is as follows: the feature extraction network Backbone extracts feature maps from the UAV aerial images, inputs them into the feature fusion network Neck for fusion, generates a fused feature output map, and finally inputs it into the detection head for target localization and classification. S3. Input the training set of the dataset into the target detection model for iterative training to obtain the target detection model of UAV aerial image; S4. Input the test set of the dataset into the target detection model of the UAV aerial image for testing, and obtain the model test results and the model performance evaluation results; S5. Load the UAV aerial image target detection model into the UAV image detection system, detect the UAV aerial image to be detected, obtain the detection visualization result and save it.
2. The method according to claim 1, characterized in that, In step S2, the specific process of constructing the target detection model is as follows: S21. Feature Extraction: ResNet is used as the backbone network to extract four feature maps of different scales from the drone aerial images, denoted as C1, C2, C3 and C4 respectively. The spatial resolution of each feature map decreases in sequence, with C1 having the highest resolution and retaining the richest low-level detail information, and C4 having the lowest resolution and stronger global semantics. S22. Feature Fusion: The multi-scale feature maps extracted from the backbone network are input into the feature fusion network SOAP for bidirectional fusion, generating output feature maps P1, P2, P3, and P4 of four sizes: 160×160, 80×80, 40×40, and 20×20, respectively. The specific fusion process is as follows: P1 feature map (160×160): obtained by stitching together the C1 feature map, the C2 feature map after 2x deconvolution upsampling, the C3 feature map after 4x deconvolution upsampling, and the C4 feature map after 8x deconvolution upsampling, and then performing feature enhancement through the MEFE module; P2 feature map (80×80): obtained by stitching together the C1 feature map after 2x downsampling, the C2 feature map, the C3 feature map after 2x deconvolution upsampling, and the C4 feature map after 4x deconvolution upsampling, and then performing feature enhancement through the MEFE module; P3 feature map (40×40): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module; P4 feature map (20×20): obtained by concatenating the C1 feature map after 4x downsampling, the C2 feature map after 2x downsampling, and the C3 and C4 feature maps after 2x deconvolution upsampling, and then performing feature enhancement through the MEFE module; The MEFE edge feature enhancement module consists of a Local Feature Enhancement (LFE) module and a Multi-Scale Edge Feature Fusion (MUEG) module. The specific workflow is as follows: First, the extracted feature map is fed into the LFE module, which integrates a shifted convolution kernel. By enhancing local details and suppressing redundant background information, it enriches the feature representation of small targets and reduces the loss of key local features. Then, the feature map output by the LFE module is fed into the MUEG module. A 3×3 average pooling layer smooths the input feature map, extracting low-frequency background components and suppressing noise. Next, the smoothed feature map is subtracted from the original input feature map to separate high-frequency edge information, highlighting the fine-grained details of small targets. Then, a Scharr filter is used to refine the high-frequency edge information and suppress non-critical regions. Finally, the refined edge information is fused with the original input feature map by adding the residuals, generating a feature map with a clearer target outline, providing support for subsequent target localization and classification. S23. Object Detection: The P1, P2, P3, and P4 feature maps output by the SOAP feature fusion network are fed into the detection head. First, features are filtered through the IoU-aware Query Selection module. This module is only enabled during the training phase. Its core mechanism guides the detection head to establish a positive correlation between feature classification confidence and localization accuracy, enabling the IoU-aware Query... Features with higher selection scores receive higher classification scores, while features with lower selection scores receive lower classification scores, ensuring that the predicted bounding boxes corresponding to the selected Top-K features have both high classification confidence and high localization accuracy. Subsequently, the input is fed into the decoder, where the decoder divides the input features into three parts: Q, K, and V. The adaptive entropy query module (AEQ) calculates the information content of the input feature map and dynamically adjusts the number of queries Q in the decoder to adapt to changes in the number of target instances in different images, mitigating the problems of missed detections in dense scenes and false detections in sparse scenes. Next, Q and K are added to the learned position encoding and then input into the multi-head self-attention module in the decoder for modification. The output result is then processed by residual connections and a feedforward neural network (FFN) to complete the decoding, achieving target localization and classification. The FFN consists of two linear layers.
3. The method according to claim 2, characterized in that, The calculation steps for the Adaptive Entropy Query (AEQ) module are as follows: Among them, E i The information entropy of the feature map, The probability distribution is calculated using the formula below: ; Indicates the first The feature map value (non-feature value) of the sample falls into the first... The frequency of each histogram interval can be used to capture the overall distribution characteristics of eigenvalues. This method is not affected by the absolute magnitude of the eigenvalues, but only focuses on their relative distribution. H i The calculation method for (k) is as follows: Among them, H i (k) represents the first The sample in the histogram is number 1. The count value within each interval This is the index of the samples in the batch. For the histogram of the th Index of each interval, It is the first One sample in the channel ,Location eigenvalues at that location This refers to the channel index of the feature map. For the height index of the feature map, This is the width index of the feature map. This is an indicator function (it takes a value of 1 when the condition is met, and 0 otherwise); This is the histogram scaling factor. This is the histogram offset; finally, the entropy values of all samples in the current batch are normalized (linearly mapped to the [0,1] interval), and a threshold is set.
4. The method according to claim 1, characterized in that, In step S3, the iterative training process uses the SGD optimizer, with 200 iterations until the model converges. The optimal weight parameter model is obtained through multiple rounds of iterative training, which serves as the optimal target detection model for UAV aerial images.
5. The method according to claim 1, characterized in that: In step S5, the UAV image detection system uses PyQt5 technology to implement the interactive interface, integrating functions such as model loading, data input, parameter configuration, result display, log recording, and result saving. The specific operation process is as follows: 1) Model loading: The user selects the model weight file, and the system performs an integrity check on the file. If the check passes, the loading is successful; if the check fails, an error message is displayed and the user is guided to reload. 2) Data Input: The system supports three input methods: single image, batch data from folders, and video stream files. Users can choose the input source according to their needs. 3) Parameter configuration: Users can adjust the confidence threshold and select the computing device through the interactive interface. After configuration, click the "Start Detection" button to start inference. 4) Results Display: The original input image and the detection result image with labeled boxes are displayed simultaneously in the center of the interface. Different categories of targets are distinguished by different colored labeled boxes; The right side of the interface displays the detection log in real time, including detection time, result storage path, and various target count statistics; the statistics panel at the bottom of the interface presents key performance indicators such as total number of targets, inference latency, and refresh rate. 5) Result saving: Users can save the detection result image with annotation boxes and statistical data to a specified local path to complete the detection process.
6. A target detection system for UAV aerial images based on edge feature enhancement and dynamic query, characterized in that: The system includes a preprocessing module, a model building module, a model training module, a model testing module, and a visualization detection module. These modules work together to achieve efficient and accurate detection of UAV aerial images. The preprocessing module loads the VisDrone2019 public dataset, partitions and optimizes the data, and outputs training, validation, and test sets adapted for model training. The model building module constructs an enhanced RTDETR model containing a ResNet backbone network, a SOAP feature fusion network, and a detection head with an AEQ module. The model training module executes iterative training and outputs the optimal object detection model. The model testing module executes the testing process and outputs detection results and performance evaluation reports. The visualization detection module builds a PyQt5 interactive interface to implement model loading, data input, parameter configuration, result display, and saving functions, improving the convenience of detection operations.