A method for detecting small targets in infrared infrared targets on UAVs based on PGF-RTDETR
By optimizing feature representation through polarization channel gating units and adaptive convolution enhancement modules in the PGF-RTDETR model, and combining partial convolution to optimize the backbone network, the accuracy and efficiency issues in UAV infrared small target detection are solved, achieving efficient and accurate target recognition.
Patent Information
- Application Number
- CN202511727455.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-11-24
AI Technical Summary
Existing RT-DETR models suffer from insufficient expressive power of the neck network feature fusion module and computational redundancy in the backbone network for infrared small target detection on UAVs. This results in low detection accuracy, susceptibility to interference from complex backgrounds, and difficulty in efficient deployment on UAV platforms with limited computing power.
The PGF-RTDETR model is adopted, and the discriminative power of features is enhanced by the polarization channel gated unit PCG. The backbone network is optimized by combining the adaptive convolution enhancement module gConvC3 and the partially convolutional PConv to reduce the computational burden and achieve efficient feature selection and enhancement.
It significantly improves the detection accuracy and average precision of infrared small targets, reduces the false detection and missed detection rates, and reduces the number of model parameters and computational load, making it suitable for UAV platforms with limited computing power.
Smart Images

Figure CN121191040B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to a method for detecting small infrared targets on unmanned aerial vehicles based on PGF-RTDETR. Background Technology
[0002] With the popularization of drone technology, its application in emergency rescue and border patrol is becoming increasingly sophisticated. In these complex scenarios, target detection is a key technology for achieving situational awareness and autonomous navigation. Infrared imaging, due to its advantages such as all-weather operation and strong anti-interference capabilities, has become an important means of drone detection. However, drones are usually far from their targets when performing missions, resulting in targets in infrared images being small in size, having low signal-to-noise ratios, and weak feature representation. Coupled with complex and variable backgrounds, accurate and efficient detection of small infrared targets has become a severe technical challenge.
[0003] Currently, deep learning-based object detection algorithms have become mainstream, mainly divided into two categories: two-stage and single-stage. While two-stage algorithms, represented by Faster R-CNN, offer high detection accuracy, their complex processing flow, high computational cost, and significant inference latency make them unsuitable for the real-time and lightweight requirements of UAV platforms. In contrast, single-stage algorithms, represented by the YOLO and DETR series, significantly improve detection speed through end-to-end network structures, making them more suitable for deployment on UAV platforms with limited computing power. Among these, algorithms like the YOLO series have been widely studied due to their efficiency. However, these algorithms rely excessively on the local receptive field of convolutional operations, making it difficult to capture global dependencies. When processing infrared images with weak texture features and low contrast, they are highly susceptible to interference from complex backgrounds, leading to increased false positive and false negative rates. Furthermore, their reliance on non-maximum suppression post-processing often results in false suppression when dealing with dense targets, further limiting detection performance.
[0004] In recent years, the Transformer architecture has made breakthroughs in the field of object detection. Its representative model, DETR (DEtectionTRansformer), achieves end-to-end matching and localization, omitting steps such as candidate box generation and non-maximum suppression, and has advantages in global modeling. RT-DETR (Real-Time Detection Transformer), as a real-time object detection model based on the DETR architecture, achieves a better balance between detection speed and accuracy by integrating an efficient hybrid encoder and an uncertainty-guided query mechanism, providing a more advantageous structural foundation for UAV infrared small target detection.
[0005] However, existing RT-DETR models still have limitations when applied to UAV infrared small target detection tasks. On the one hand, the feature fusion module of its neck network is insufficient in representing the features of small-sized, weak-signal infrared targets, making it difficult to effectively enhance the discernibility of small targets under complex background noise. On the other hand, the traditional residual structure used in its backbone network has computational redundancy when extracting features, resulting in a high number of model parameters and computational cost. This not only limits the deployment efficiency of the model on UAV platforms with limited computing power, but also fails to specifically optimize the feature extraction path for small-scale targets. Summary of the Invention
[0006] To address the above technical problems, this invention provides a method for detecting small infrared targets on unmanned aerial vehicles (UAVs) based on PGF-RTDETR, comprising the following steps:
[0007] S1. Prepare the UAV infrared image dataset in advance and perform preprocessing operations to obtain the UAV infrared small target detection dataset.
[0008] S2. Construct a UAV infrared small target detection model PGF-RTDETR based on RT-DETR, and input the UAV infrared small target detection dataset into the PGF-RTDETR model for training to obtain the trained best weight file. The PGF-RTDETR model includes a backbone network, a neck network, and a decoder. The backbone network includes a residual block FasterBlock, and the neck network includes a polarization channel gate unit PCG and an adaptive convolutional enhancement module gConvC3. The backbone network is used to extract the initial multi-scale feature map, the neck network is used to fuse and filter the initial multi-scale feature map, and the output feature map is sent to the decoder. The decoder parses the features and generates the final target category and bounding box coordinates.
[0009] In the neck network, the polarization channel gating unit (PCG) includes a polarization-aware linear attention (Pola) module and a gated convolutional linear unit (CGLU) module. In the polarization-aware linear attention (Pola) module, the input features are first linearly transformed into a query Q, a key K, and a value V. The key K is then encoded at the superposition position to obtain the enhanced key K', which is calculated as follows:
[0010]
[0011] Where K represents the original key feature after linear transformation; PE(K) represents the two-dimensional positional code generated for the key feature, used to introduce absolute or relative positional information; K' represents the enhanced key feature after fusing positional information;
[0012] Subsequently, a polarity decomposition mechanism is employed, using the ReLU activation function to project the query Q and the enhanced key K' onto the positive and negative polarity spaces respectively, resulting in positive and negative polarity branches. This process is illustrated in the following equation:
[0013]
[0014]
[0015]
[0016]
[0017] Where ReLU(⋅) represents the rectified linear unit activation function; and These represent the projection components of the query feature in the positive and negative polarity spaces, respectively. and These represent the projection components of the reinforcing bond features in the positive and negative polarity spaces, respectively.
[0018] Simultaneously, the value V is spatially enhanced through a depthwise separable convolution (DWConv) to obtain V'. Then, the positive and negative polarity branches are concatenated and subjected to a Hadamard product operation with the enhanced value feature V' to complete the attention calculation. Finally, it is residually connected to the original input X through a linear layer to output the fused feature, calculated as follows:
[0019]
[0020]
[0021] Where X represents the input feature. This represents Hadamard multiplication, and Concat represents the concatenation operation;
[0022] The adaptive convolutional enhancement module gConvC3 adopts a cross-stage local CSP structure. The feature map input to this module is first divided into two parallel paths in the channel dimension: the backbone path and the residual path. The residual path is directly connected to the end of the module through an identity mapping. The backbone path is then processed by a series of cascaded gated convolutional units gConv for feature extraction and enhancement. The output of the backbone path is then concatenated with the output of the residual path in the channel dimension. Finally, the concatenated feature map is integrated through a convolutional layer to generate the final output of the adaptive convolutional enhancement module gConvC3.
[0023] S3. Based on the trained weights, input the infrared image of the UAV to be detected into the PGF-RTDETR model for detection;
[0024] S4. Output the detection results and evaluate the model performance.
[0025] The technical solution further defined in this invention is:
[0026] Furthermore, in step S1, the UAV infrared small target detection dataset is divided into a training set, a validation set, and a test set in a ratio of 7:2:1; and all images in the dataset are uniformly scaled to 640×640 pixels and normalized.
[0027] As described above in the UAV infrared small target detection method based on PGF-RTDETR, in the backbone network of step S2, the residual block FasterBlock adopts a partially convolutional PConv mechanism. Inside the residual block FasterBlock, the channel dimension of the input feature map is divided into two parts: computational channels and identity mapping channels. The number of computational channels is c. p The number of identity mapping channels is cc p The partial ratio r is the ratio of the number of calculated channels to the total number of channels, i.e. .
[0028] As mentioned earlier, the UAV infrared small target detection method based on PGF-RTDETR uses a partial convolution PConv mechanism that only performs convolution on a subset of channels. By changing a portion of the scaling factor r, the floating-point operation volume (FLOPs) and memory access volume (MAC) are reduced. The calculation formula is as follows:
[0029]
[0030]
[0031] Where h and w represent the dimensions of the feature map, and k represents the size of the convolution kernel.
[0032] As described above, in the UAV infrared small target detection method based on PGF-RTDETR, in step S2, when the data flows through the residual block FasterBlock, only the computation channel performs spatial feature extraction operations through a standard convolution kernel, while the data of the identity mapping channel does not participate in the convolution calculation and is directly retained. Subsequently, the result of the convolution operation is concatenated with the data of the identity mapping channel in the channel dimension, and the channel information is exchanged through a 1×1 pointwise convolution. Finally, it is added to the original input of the residual block FasterBlock through the residual connection. After multi-layer processing of this backbone network, an input 640×640 pixel image is converted into an initial feature map set containing three different spatial resolutions and semantic levels. This set includes initial feature images one, two, and three. From initial feature image one to initial feature image three, the resolution gradually decreases, while the semantic information gradually increases.
[0033] As described above, in the UAV infrared small target detection method based on PGF-RTDETR, the input feature X in the gated convolutional linear unit (CGLU) module is first expanded through a 1×1 convolution to obtain the intermediate feature Z. Then, Z is divided into two branches. One branch extracts spatial features through a depthwise separable convolution (DWConv), resulting in feature branch F. The other branch, as a gated branch, generates a modulation signal G through a 1×1 convolution and a sigmoid activation function. Finally, regional gating calculations are performed within each feature channel. By performing a Hadamard product operation between feature branch F and modulation signal G, the information flow is adjusted. This process is shown in the following equation:
[0034]
[0035]
[0036]
[0037]
[0038] Among them, Conv 1×1 Represents a 1×1 convolution. represents the Sigmoid activation function, and Y represents the final output feature of the gated convolutional linear unit (CGLU) module.
[0039] As described above, in the UAV infrared small target detection method based on PGF-RTDETR, the gated convolutional unit gConv takes the input feature as an input feature. The input features are simultaneously fed into the parallel feature extraction branch and the gating branch. The gating branch uses a pointwise convolution and a sigmoid activation function to process the input features. The transformation is to a weight mask x1 with the same size as the input feature, which is calculated as follows:
[0040]
[0041] Where x1 represents the generated weight mask; This represents the Sigmoid activation function, used to map values to the [0,1] interval; PWConv1 represents the first pointwise convolution in the gated branch; This represents the normalized input feature map;
[0042] Meanwhile, the feature extraction branch processes the input features through a pointwise convolution and a depthwise separable convolution. The local spatial features x2 are extracted through processing, and the calculation formula is as follows:
[0043]
[0044] Where x2 represents the extracted local spatial features, DWConv represents depthwise separable convolution, and PWConv2 represents the second pointwise convolution in the feature extraction branch.
[0045] Next, the weight mask x1 and the local spatial feature x2 are multiplied by Hadamard. Finally, the result of the gated computation is linearly mapped through a pointwise convolution, and then residually concatenated with the original input x of the gated convolutional unit gConv to form the final output y of the unit. The calculation formula is as follows:
[0046]
[0047] Where y represents the final output of the unit; x represents the original input of the unit, used for residual connections; PWConv3 represents the third pointwise convolution used for linear mapping; This indicates the Hadamard product operation, which is element-wise multiplication.
[0048] As described above, in the UAV infrared small target detection method based on PGF-RTDETR, in step S2, the decoder adopts a Transformer decoder architecture. First, it initializes a set of learnable target queries and receives feature maps output from the neck network. In the multi-layer structure of the decoder, each target query interacts iteratively with the image features through a cross-attention mechanism, thereby gradually locating the target it represents and determining its category. Furthermore, each updated query vector output by the last layer of the decoder is fed into independent classification and regression heads to generate the target's category confidence and bounding box coordinates, respectively.
[0049] The beneficial effects of this invention are:
[0050] (1) In this invention, by deeply optimizing the feature processing module, the technical problem of weak infrared small target features and easy confusion with the background is effectively solved. The PCG module uses the polarized linear attention mechanism to enhance the discriminativeness of features by separating positive and negative polarities, so that the model can more sensitively capture the subtle differences between the target and the background. At the same time, it combines gated convolutional network to filter irrelevant information, thereby greatly improving the attention to small targets and effectively suppressing background interference. The gConvC3 module realizes adaptive filtering and enhancement of feature stream through its built-in gated convolutional unit, so that it can dynamically amplify fine-grained features that are beneficial to the detection task, which is crucial for accurate identification and positioning of small targets. Through the synergistic effect of the above two modules, the feature expression and discrimination ability of the entire network is qualitatively improved, which is ultimately reflected in a significant increase in detection accuracy and mean accuracy, and significantly reduces the false detection rate.
[0051] (2) In this invention, the backbone network is optimized by introducing the FasterBlock module, which successfully reduces the computational burden of the model. The core technology of FasterBlock is partial convolution PConv. By performing convolution calculation on only some channels, redundant floating-point operations and memory access are fundamentally reduced. Compared with traditional convolution, the amount of computation and the number of parameters are significantly reduced. Experiments show that without sacrificing or even improving the feature expression ability, the overall number of parameters of the model is reduced by about 20.7% and the amount of computation is reduced by about 25%. This means that the method of this invention has lower hardware resource requirements and faster inference speed, which makes it easy to deploy on UAV airborne platforms with limited computing power, memory and power consumption, and meet the application requirements of real-time detection.
[0052] (3) In this invention, while improving detection accuracy, model efficiency is also taken into account, and a good balance is achieved between the two. Unlike the technical path of simply increasing the model size to improve performance, this invention optimizes the model's computational paradigm and feature processing flow through a series of efficient structural designs. While significantly improving detection accuracy, this invention significantly reduces the computational complexity and number of parameters of the model, effectively solving the long-standing technical contradiction between accuracy, speed and model resource consumption in UAV infrared small target detection tasks, and providing an effective technical approach for the actual deployment of this technology on resource-constrained platforms. Attached Figure Description
[0053] Figure 1 This is a schematic diagram of the overall process of the present invention;
[0054] Figure 2 This is a schematic diagram of the structure of the PGF-RTDETR model in an embodiment of the present invention;
[0055] Figure 3 This is a schematic diagram of the structure of the residual block FasterBlock in an embodiment of the present invention;
[0056] Figure 4 This is a schematic diagram of the structure of the polarization channel gating unit PCG in an embodiment of the present invention;
[0057] Figure 5 This is a schematic diagram of the adaptive convolution enhancement module gConvC3 in an embodiment of the present invention;
[0058] Figure 6 This is a comparison chart of the detection effects of the RT-DETR-R18 algorithm and the PGF-RTDETR algorithm in an embodiment of the present invention. The chart in column (a) on the left is a schematic diagram of the detection effect of the RT-DETR-R18 algorithm, and the chart in column (b) on the right is a schematic diagram of the detection result of the PGF-RTDETR algorithm of the present invention. Detailed Implementation
[0059] This embodiment provides a method for detecting small infrared targets on a UAV based on PGF-RTDETR, such as... Figure 1 As shown, it includes the following steps:
[0060] S1. Prepare the UAV infrared image dataset in advance and perform preprocessing operations to obtain the UAV infrared small target detection dataset.
[0061] We obtained the publicly available HIT-UAV drone infrared dataset, which contains 2,898 infrared thermal images taken by drones at high altitudes, covering various real-world environments such as schools, parking lots, roads, and playgrounds. The images contain five target categories: pedestrians, bicycles, cars, other vehicles, and an undetermined category (Don't care), with a total of approximately 25,000 targets. The dataset was divided into a training set (2,029 images), a validation set (579 images), and a test set (290 images) in a 7:2:1 ratio. All images were then uniformly scaled to 640×640 pixels and normalized.
[0062] S2. Construct a UAV infrared small target detection model PGF-RTDETR based on RT-DETR, and input the UAV infrared small target detection dataset into the PGF-RTDETR model for training to obtain the trained best weight file.
[0063] like Figure 2 As shown, the PGF-RTDETR model includes a backbone network, a multi-scale sensing neck network, and a decoder. The backbone network includes a residual block FasterBlock, the neck network includes a polarization channel gating unit PCG and an adaptive convolution enhancement module gConvC3, and the decoder is set to a Transformer decoder.
[0064] The cropped image is input into the lightweight backbone network of the PGF-RTDETR model, which is built based on the lightweight residual block FasterBlock, to obtain high-dimensional feature vectors. Then, the initial multi-scale feature map output from the backbone network is fed into the multi-scale perceptual neck network, where it undergoes deep fusion and adaptive filtering via the PCG and gConvC3 modules to enhance the saliency features of small targets and suppress background interference. The feature map output from the neck network is then fed into the Transformer decoder to parse the features and generate the final target category and bounding box coordinates. Finally, the constructed model is trained on a specified dataset, and its performance is evaluated on the validation set. The optimal best weight file is then saved.
[0065] In this embodiment, the experimental environment was configured as follows: the system environment was Windows 11, the graphics card (GPU) was NVIDIA GeForce RTX 4090, the deep learning framework was based on PyTorch 2.5.1, the acceleration environment was CUDA 12.4, and the language was Python 3.10; the input image size used in the experiment was uniformly 640×640, the number of training rounds was set to 300, the batch size was set to 4, the models in the experiment did not use pre-trained weights, the initial learning rate during the training phase was set to 0.0001, the optimizer was AdamW, and all experiments used the same hyperparameters for training and validation.
[0066] By constructing a lightweight backbone network, a set of initial multi-scale feature maps with hierarchical structure can be efficiently extracted from the input UAV infrared images while controlling the consumption of computing resources. In the backbone network, an efficient residual structure FasterBlock is constructed to replace the traditional residual network module, aiming to reduce computational redundancy and improve feature extraction efficiency.
[0067] like Figure 2 As shown, the backbone network extracts features from the input image at different scales through a series of efficient residual structure FasterBlock operations, and uses the initial feature images one, two, and three output from the last three stages as core processing data input into the subsequent networks.
[0068] like Figure 3 As shown, the core technology of the FasterBlock module is the PConv (Partial Convolution) mechanism, which aims to reduce redundant computation and memory access while maintaining sufficient extraction of spatial detail features through differentiated structural design. When data flows through the residual block FasterBlock, only the computation channel performs spatial feature extraction operations through a standard convolution kernel, while the data of the identity mapping channel does not participate in the convolution calculation and is directly retained. Subsequently, the result of the convolution operation is concatenated with the data of the identity mapping channel in the channel dimension, and the channel information is exchanged through a 1×1 pointwise convolution. Finally, it is added to the original input of the module through residual connections. After multi-layer processing by this backbone network, an input 640×640 pixel image is converted into an initial feature map set containing three different spatial resolutions and semantic levels. This set includes initial feature images one, two, and three. Among them, initial feature image one has the highest resolution and the richest detail texture information, while initial feature image three has the lowest resolution but contains the strongest abstract semantic information.
[0069] The PConv mechanism leverages the correlation between feature map channels. Its working principle is as follows: select either the first or last continuous c-value of the input feature map. p One channel undergoes a regular convolution operation, while other related channels are not included in the computation and are directly preserved through an identity mapping; the ratio of the number of channels involved in the computation to the total number of channels, i.e., the partial ratio r, is defined by the following formula: .
[0070] By employing this selective computation method, PConv can effectively reduce computational complexity and parameter count. When a portion of the ratio r is set to 1 / 4, its floating-point operations (FLOPs) are only 1 / 16 of those of traditional convolution, and the memory access MAC is also reduced to 1 / 4 of that of traditional convolution. The calculation formula is as follows:
[0071]
[0072]
[0073] Where h and w represent the dimensions of the feature map, and k represents the size of the convolution kernel.
[0074] Inside the FasterBlock module, in order to reduce computational redundancy while maintaining the integrity of feature information and the stability of gradient propagation, an inverse residual connection is incorporated after PConv, which enables the convolutional features to be added to the input features element by element, achieving efficient cross-layer fusion of information.
[0075] like Figure 2 As shown, the multi-scale sensing neck network includes a polarization channel gated unit PCG and a gated convolutional unit gConv. Their collaborative design aims to perform deep fusion and adaptive filtering of the initial feature maps output by the backbone network to enhance the salient features of small targets and suppress background interference.
[0076] To address the shortcomings of traditional AIFI (Attention-based Intra-scale Feature Interaction) modules, such as insufficient representation of small target features and susceptibility to complex background interference, this embodiment constructs a polarization channel gating unit (PCG), as follows: Figure 4 As shown, this unit, through its internal polarimetric linear attention Pola and gated convolutional network CGLU, can more effectively capture the salient features of small targets and suppress background noise. The polarimetric linear attention module is used to doubly improve the discriminativeness and modeling ability of features, while the subsequent gated convolutional linear unit further improves the spatial structure modeling ability and channel selectivity of features through the gating mechanism.
[0077] In the polarimetric linear attention Pola module, the input features are first projected through a linear layer into three branches: Q (Query), K (Key), and V (Value). To enhance spatial awareness, PE (Position Encoding) is superimposed on the key K to obtain the enhanced key K', which is calculated as follows:
[0078]
[0079] Where K represents the original key feature after linear transformation; PE(K) represents the two-dimensional positional encoding generated for the key feature, used to introduce absolute or relative positional information; and K' represents the enhanced key feature after fusing positional information.
[0080] Subsequently, to enhance feature discriminative power, a polarity decomposition mechanism is employed. The query Q and the enhanced key K' are projected onto the positive and negative polarity spaces respectively using the ReLU activation function, resulting in positive and negative polarity branches. This process aims to simultaneously capture the similarity and complementarity relationships between features, and its calculation is shown in the following formula:
[0081]
[0082]
[0083]
[0084]
[0085] Where ReLU(⋅) represents the rectified linear unit activation function; and These represent the projection components of the query feature in the positive and negative polarity spaces, respectively. and These represent the projection components of the reinforcing bond features in the positive and negative polarity spaces, respectively.
[0086] Meanwhile, the value V is spatially enhanced through a depthwise separable convolution (DWConv) to obtain V'. Based on this, the positive and negative polarity branches are concatenated and then subjected to a Hadamard product with the enhanced value feature V' to complete the attention calculation. Finally, a linear layer is used to perform a residual connection with the original input X to output the fused feature, calculated as follows:
[0087]
[0088]
[0089] Where X represents the input feature. This represents Hadamard multiplication, and Concat represents concatenation.
[0090] Subsequently, the features output by the Pola module are fed into the CGLU module for information flow refinement. In the gated convolutional linear unit (CGLU) module, the input feature X is first expanded through a 1×1 convolution to obtain the intermediate feature Z. Then, the intermediate feature Z is fed into two parallel branches for processing. One branch extracts spatial features through a depthwise separable convolution (DWConv) to obtain the feature branch F. The other branch, as a gated branch, generates a modulation signal G through a 1×1 convolution and a sigmoid activation function. Finally, regional gating calculations are performed within each feature channel. By performing a Hadamard product operation between the feature branch F and the modulation signal G, adaptive adjustment of the information flow is achieved. This process is shown in the following equation:
[0091]
[0092]
[0093]
[0094]
[0095] Among them, Conv 1×1 Represents a 1×1 convolution. Y represents the Sigmoid activation function, and Y represents the final output feature of the CGLU module.
[0096] In the feature pyramid path of the neck network, the traditional RepC3 module has shortcomings in feature selectivity and adaptability. The standard convolution it relies on lacks the ability to adaptively filter key information when facing complex backgrounds and weak targets, making it difficult to effectively distinguish between targets and backgrounds, thus affecting detection accuracy.
[0097] To address the aforementioned limitations, this embodiment employs the adaptive convolution enhancement module gConvC3, such as... Figure 5As shown, this module adopts a CSP (Cross Stage Partial) structure design. Its core is a series of gConv (gated convolution blocks). The feature map input to the adaptive convolution enhancement module gConvC3 is first divided into two parallel paths in the channel dimension: the backbone path and the residual path. The residual path is directly connected to the end of the module through an identity mapping to preserve the original feature information. The backbone path is then subjected to deep feature extraction and enhancement through a series of cascaded gConv gated convolution blocks. The output of the backbone path is then concatenated with the output of the residual path in the channel dimension. Finally, the concatenated feature map is integrated through a convolutional layer to generate the final output of the adaptive convolution enhancement module gConvC3.
[0098] Within each gConv unit, the given input feature x is first processed through a batch normalization layer (BatchNorm) to stabilize the training process and reduce internal covariate bias, thereby obtaining the normalized feature map. ; then, Simultaneously, the feature extraction branch and the gating branch are fed in parallel.
[0099] First, the gated branch uses a pointwise convolution (PWConv1) and a sigmoid activation function to process the input features. The transformation is converted into a weight mask x1; simultaneously, the feature extraction branch processes the input features through a pointwise convolution (PWConv2) and a depthwise separable convolution (DWConv). The local spatial features x2 are extracted by processing the feature map. Based on this, the Hadamard product operation is performed between the weight mask x1 and the local spatial features x2 to achieve adaptive enhancement or suppression of different spatial locations and channels of the feature map. Finally, the result after gating is linearly mapped through a pointwise convolution (PWConv3) and then residually connected with the original input x of the gConv unit to form the final output y of the unit.
[0100] Its core calculation process can be represented as follows:
[0101]
[0102]
[0103]
[0104] Where PWConv represents pointwise convolution, This represents the normalized feature map.
[0105] The decoder adopts a Transformer decoder architecture. First, it initializes a set of learnable target queries and receives feature maps from the output of the neck network. In the multi-layer structure of the decoder, each target query interacts iteratively with the image features through a cross-attention mechanism, thereby gradually and finely locating the target it represents and determining its category. Each updated query vector output by the last layer of the decoder is fed into independent classification and regression heads to generate the target's category confidence and bounding box coordinates, respectively.
[0106] Finally, the processed UAV infrared image training set was input into the constructed PGF-RTDETR model for training. AdamW was used as the optimizer during the training process, with an initial learning rate of 0.0001, a batch size of 4, and a training epoch of 300. No pre-trained weights were loaded into the model before training began.
[0107] In each training round, the model calculates the difference between the predicted result and the true label using a predefined loss function, and the optimizer updates all the learnable parameters of the model through the backpropagation algorithm. To determine and generate the optimal weights, the performance of the current model is evaluated using a validation set after each training round, and key metrics such as mean average precision (mAP50) are continuously monitored. The system records the model network parameters corresponding to the round with the best performance on the validation set and saves it as the final trained best weight file for subsequent detection.
[0108] S3. Based on the trained weights, input the infrared image of the UAV to be detected into the PGF-RTDETR model for detection.
[0109] S4. Output the detection results and evaluate the model performance.
[0110] To comprehensively evaluate the effectiveness of the PGF-RTDETR model in infrared small target detection for UAVs, this embodiment uses P (Precision), R (Recall), AP (Average Precision), mAP (mean Average Precision), computational cost (GFLOPs), and model parameter count (Params) as evaluation metrics.
[0111] Among them, GFLOPs measures the model's time complexity, while Params reflects the model's space complexity; P, R, and mAP are used to evaluate the model's detection accuracy, with higher values indicating higher detection accuracy; GFLOPs and parameters measure the model's lightweightness, with lower values indicating a lighter model and correspondingly lower hardware performance requirements; the performance metrics are calculated as follows:
[0112]
[0113]
[0114]
[0115]
[0116] Where TP stands for True Positive Example, which refers to the number of sample instances that the model correctly predicts as positive; FP stands for False Positive Example, which refers to the number of sample instances that the model incorrectly predicts as positive; FN stands for False Negative Example, which refers to the number of positive samples that are incorrectly predicted as negative; and n represents the number of classes.
[0117] To verify the effectiveness of the improved algorithm, the model in this embodiment was compared with algorithms with similar parameter values such as YOLOv5m, YOLOv8m, YOLOv11m, and RT-DETR-R18. The results are shown in Table 1 below.
[0118] Table 1. Detection results of each model on the HIT-UAV dataset.
[0119]
[0120] As shown in Table 1 above, the PGF-RTDETR model in this embodiment exhibits significant advantages in all key indicators. In terms of detection accuracy, its accuracy (P) reaches 93.8% and its mean average precision (mAP50) reaches 85.7%, both of which are significantly higher than all comparative models, including YOLOv8m (P = 91.9%, mAP50 = 84.2%) and RT-DETR-R34 (P = 89.5%, mAP50 = 85.0%).
[0121] In terms of model complexity, the model in this embodiment has only 15.7M parameters and 43.7 GFLOPs of computation, which is the lowest among all the comparison models. Compared with the benchmark model RT-DETR-R18 (P = 87.2%, mAP50 = 83.1%, 19.8M parameters, and 58.3 GFLOPs of computation), the model in this embodiment improves mAP50 by 2.6 percentage points while reducing the number of parameters and computation by 20.7% and 25% respectively, achieving a dual improvement in accuracy and efficiency.
[0122] To verify the independent contribution and synergistic effect of each key technical feature (PCG, gConvC3, FasterBlock) in this invention, multiple ablation experiments were conducted in this embodiment, and the results are shown in Table 2 below.
[0123] Table 2 Ablation Experiment Results
[0124]
[0125] The experiment used RT-DETR-R18 as the baseline model, achieving an accuracy (P) of 87.2%, an mAP50 of 83.1%, 19.8M parameters, and a computational cost of 58.3 GFLOPs. As shown in Table 2, the introduction of the PCG module alone, through its unique polarization attention and gating mechanism, effectively deepened the semantic fusion of multi-scale features. With almost no change in computational cost, the mAP50 improved by 1.4 percentage points, significantly enhancing the model's ability to perceive and recall weak infrared targets. Building upon this, the gConvC3 module was further introduced. Its gated convolution mechanism adaptively filters features, more accurately locating and enhancing key region information based on the rich semantic information provided by the PCG module, resulting in an improvement in the model's accuracy and mAP50 to 92.1% and 85.3%, respectively. Finally, to address the computational redundancy issue in the backbone network, the FasterBlock module was introduced, forming the final PGF-RTDETR model. FasterBlock's core convolution mechanism effectively reduces computational burden and memory access, resulting in a 20.7% and 25% reduction in the number of parameters and computational cost of the PGF-RTDETR model compared to the baseline model.
[0126] Introducing the FasterBlock module alone improved mAP50 to 84.3%, with the most significant reductions in parameter count and computational cost. When all three modules were integrated, the model performance reached its optimal level, achieving an accuracy (P) of 93.8% and an mAP50 of 85.7%, while reducing the parameter count and computational cost to 15.7M and 43.7 GFLOPs, respectively. These results strongly demonstrate that the three core technical features of the method in this embodiment all contribute positively to the final performance, and their combination can produce a significant synergistic gain effect.
[0127] To verify the universality and robustness of the method in this embodiment under different data distributions, this embodiment uses another publicly available thermal imaging dataset, FLIR, for generalization ability testing under the same experimental environment. The experimental results are shown in Table 3. On this dataset, the baseline model RT-DETR-R18 has an accuracy (P) of 84.4%, a recall (R) of 74.1%, and an mAP50 of 82.6%. In comparison, the PGF-RTDETR model in this embodiment performs better, with an accuracy of 84.8%, a recall of 74.7%, and an mAP50 of 83.2%. The above results demonstrate that the method in this embodiment is not only effective for a specific dataset, but also maintains good detection performance under different scenarios and data distributions, exhibiting strong generalization ability.
[0128] Table 3. Experimental results of the model in this embodiment on the FLIR dataset.
[0129]
[0130] like Figure 6 As shown, the graphs in column (a) on the left are the detection results of the RT-DETR-R18 model on the UAV infrared small target detection dataset, and the graphs in column (b) on the right are the detection results of the PGF-RTDETR algorithm in this embodiment. Figure 6 The detection results shown demonstrate that the PGF-RTDETR method proposed in this embodiment can accurately identify small targets in UAV infrared images against complex backgrounds.
[0131] Compared with existing methods, the method in this embodiment demonstrates superior accuracy and robustness in target detection. The detection box closely covers the target boundary, and the occurrence of missed detections and false detections is significantly reduced. This result fully demonstrates the effectiveness of the method in improving the feature representation of small targets, suppressing background interference, and ensuring real-time performance. It verifies the feasibility and superiority of the method. This method can solve the problems of weak features, susceptibility to complex background interference, and low detection accuracy of small targets in UAV infrared images, achieving fast, accurate, and robust detection of small infrared targets and effectively improving the situational awareness capability of UAVs in complex environments.
[0132] In addition to the embodiments described above, the present invention may have other implementations. All technical solutions formed by equivalent substitution or equivalent transformation fall within the protection scope claimed by the present invention.
Claims
1. A method for detecting small infrared targets based on PGF-RTDETR, characterized in that: The method comprises the following steps: Step S1, an unmanned aerial vehicle infrared image data set is prepared in advance and a pretreatment operation is performed to obtain an unmanned aerial vehicle infrared small target detection data set; Step S2, an unmanned aerial vehicle infrared small target detection model PGF-RTDETR based on RT-DETR is constructed, and the unmanned aerial vehicle infrared small target detection data set is input into the PGF-RTDETR model for training to obtain a trained best weight file; the PGF-RTDETR model comprises a backbone network, a neck network and a decoder, the backbone network comprises a residual block FasterBlock, and the neck network comprises a polarization channel gating unit PCG and an adaptive convolution enhancement module gConvC3; the backbone network is used for extracting an initial multi-scale feature map, the neck network is used for fusing and screening the initial multi-scale feature map, and the output feature map is input into the decoder, and the decoder is used for analyzing the features and generating a final target class and a bounding box coordinate; In the neck network, the polarization channel gating unit PCG comprises a polarization perception linear attention Pola module and a gated convolution linear unit CGLU module; in the polarization perception linear attention Pola module, input features are first linearly transformed into query Q, key K and value V, the key K is superimposed with position encoding to obtain enhanced key K', and the calculation is as follows: Wherein, K represents the original key feature after linear transformation; PE(K) represents two-dimensional position encoding generated for the key feature, which is used to introduce absolute or relative position information; K' represents the enhanced key feature fused with the position information; Subsequently, a polarity decomposition mechanism is adopted, the query Q and the enhanced key K' are projected into positive and negative polarity spaces through a ReLU activation function to obtain positive and negative polarity branches, and the process is as follows: where ReLU(·) denotes a rectified linear unit activation function; and denote the projection components of the query feature in the positive and negative polarity spaces, respectively; and denote the projection components of the enhanced key feature in the positive and negative polarity spaces, respectively; At the same time, the value V is subjected to spatial information enhancement through a depth separable convolution DWConv to obtain V'; then, the positive and negative polarity branches are spliced, and the Hadamard product operation is performed on the enhanced value feature V' to complete the attention calculation, and finally a linear layer is used for residual connection between the original input X and the fused feature, and the calculation formula is as follows: wherein X represents input features, denotes Hadamard multiplication, and Concat denotes concatenation operation. In the gated convolution linear unit CGLU module, the input feature X is first subjected to channel expansion through a 1x1 convolution to obtain an intermediate feature Z; then, Z is divided into two branches, one branch is subjected to spatial feature extraction through a depth separable convolution DWConv to obtain a feature branch F; the other branch is used as a gating branch, a 1x1 convolution and a Sigmoid activation function are used to generate a modulation signal G; finally, regional gating calculation is performed in each feature channel, the Hadamard product operation is performed on the feature branch F and the modulation signal G to adjust the information flow, and the process is as follows: wherein, Conv 1×1 denotes a 1x1 convolution, denotes a Sigmoid activation function, Y denotes the final output feature of the Gated Convolution Linear Unit, CGLU module; The adaptive convolution enhancement module gConvC3 adopts a cross-stage local CSP structure. The feature map input to the module is first divided into a main path and a residual path in the channel dimension for parallel processing. The residual path is directly connected to the end of the module through an identity mapping. The main path is processed through a series of cascaded gate convolution units gConv for feature extraction and enhancement. The outputs of the main path and the residual path are spliced in the channel dimension. Finally, the spliced feature map is integrated through a convolution layer to generate the final output of the adaptive convolution enhancement module gConvC3. Step S3: inputting the unmanned aerial vehicle infrared image to be detected into the PGF-RTDETR model for detection according to the trained weight; Step S4: outputting the detection result and evaluating the model performance.
2. The PGF-RTDETR based UAV infrared small target detection method according to claim 1, characterized in that: In step S1, the unmanned aerial vehicle infrared small target detection dataset is divided into a training set, a validation set and a test set according to a ratio of 7:2:
1. All images in the dataset are uniformly scaled to 640x640 pixels and normalized.
3. The PGF-RTDETR based UAV infrared small target detection method according to claim 1, characterized in that: In the backbone network of the step S2, the residual block FasterBlock adopts a partial convolution PConv mechanism, in the residual block FasterBlock, the channel dimension of the input feature map is divided into two parts of a calculation channel and an identity mapping channel, the number of the calculation channel is c p , the number of the identity mapping channel is c-c p , and the partial ratio r is the ratio of the calculation channel to the total channel number, that is .
4. The PGF-RTDETR based UAV infrared small target detection method according to claim 3, characterized in that: The partial convolution PConv mechanism only performs convolution on part of the channels, and reduces the floating point operation amount FLOPs and the memory access amount MAC by changing the partial ratio r. The calculation formula is as follows: Where h and w represent the dimensions of the feature map, and k represents the size of the convolution kernel.
5. The PGF-RTDETR based UAV infrared small target detection method according to claim 4, characterized in that: In step S2, when the data flows through the residual block FasterBlock, only the calculation channels perform spatial feature extraction operation through a standard convolution kernel, and the data of the identity mapping channels is directly reserved without participating in the convolution calculation. Then, the results of the convolution operation and the data of the identity mapping channels are spliced in the channel dimension, and a 1x1 pointwise convolution is performed for channel information interaction. Finally, the residual connection is added to the original input of the residual block FasterBlock. After multiple layers of processing of the backbone network, an input 640x640 pixel image is converted into an initial feature map set containing three different spatial resolutions and semantic levels, including initial feature images one, two and three. From the initial feature image one to the initial feature image three, the resolution gradually decreases, and the semantic information gradually increases.
6. The PGF-RTDETR based UAV infrared small target detection method according to claim 1, characterized in that: In the gConv unit, input features are simultaneously fed into parallel feature extraction branches and a gating branch. The gating branch transforms the input features into a weight mask x1 with the same size as the input features by a point-wise convolution and a sigmoid activation function, which is calculated as follows: wherein x1 represents the generated weight mask; denotes a Sigmoid activation function for mapping a value to the interval [0, 1]; PWConv1 denotes a first point-wise convolution in the gating branch; denotes a normalized input feature map; Meanwhile, the feature extraction branch processes the input features through a pointwise convolution and a depthwise separable convolution. The local spatial features x2 are extracted through processing, and the calculation formula is as follows: Where x2 represents the extracted local spatial feature, DWConv represents the depth separable convolution, and PWConv2 represents the second pointwise convolution in the feature extraction branch. Then, the weight mask x1 and the local spatial feature x2 are subjected to Hadamard product operation. Finally, the result of the gating calculation is linearly mapped through a pointwise convolution, and then the residual connection is performed with the original input x of the gating convolution unit gConv to form the final output y of the unit, and the calculation formula is as follows: where y denotes the final output of the unit; x denotes the original input of the unit, used for residual connection; PWConv3 denotes the third point-wise convolution for linear mapping; denotes the Hadamard product operation, i.e., element-wise multiplication.
7. The PGF-RTDETR based UAV infrared small target detection method according to claim 1, characterized in that: In step S2, the decoder adopts a Transformer decoder architecture. A set of learnable target queries are initialized, and the feature map output from the neck network is received. In the multi-layer structure of the decoder, each target query iteratively interacts with the image feature through the cross-attention mechanism, so as to gradually locate the target represented by it and determine its category. And the updated query vector of the last decoder output is sent to the independent classification head and regression head, respectively generating the target class confidence and bounding box coordinates.
Citation Information
Patent Citations
Unmanned aerial vehicle aerial photography small target detection method based on improved RT-DETR network
CN118521929A