Remote sensing image detection method based on posterior dynamic query and density attention

By using a remote sensing image detection method based on posterior dynamic query and density attention, the problem of insufficient representation ability of remote sensing image detection in complex scenes is solved, and high-precision and robust target detection is achieved, which can adapt to feature extraction and matching in regions with different density.

CN122024045APending Publication Date: 2026-05-12SHENYANG UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing remote sensing image detection technologies have limited representation capabilities in complex scenes and are difficult to adapt to uneven target density, resulting in low detection accuracy and wasted computing resources.

Method used

A remote sensing image detection method based on posterior dynamic query and density attention is adopted. Through a density adaptive attention module and a posterior dynamic query decoder, the feature extraction strategy is dynamically adjusted. Combined with multi-scale feature fusion and dynamic query generation, the target matching process is optimized.

Benefits of technology

It improves the accuracy and robustness of remote sensing image detection, adapts to target detection in complex scenarios, reduces the waste of computing resources, and achieves accurate identification of small targets and occluded targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122024045A_ABST
    Figure CN122024045A_ABST
Patent Text Reader

Abstract

The invention discloses a remote sensing image detection method based on posterior dynamic query and density attention, and provides a density adaptive attention module (DAA) on the basis of an RT-DETR model. The module predicts regional target density through a density estimation network, adopts a large convolution kernel to expand a receptive field for a high-density region to capture target association, and adopts a small convolution kernel to retain target details for a low-density region; and in combination with multi-branch feature processing and a weighted fusion strategy, dynamic allocation of computing resources is realized, and redundant background noise is suppressed. Meanwhile, a posterior dynamic query decoder (PDQD) is designed, a cross attention module is newly added to realize dynamic interaction between query and image features, a query vector is continuously optimized based on a preliminary prediction result depending on a multi-round iterative update mechanism, and the feature capture capability for small targets and occlusion regions is enhanced. According to the method, posterior dynamic query decoding and a density adaptive attention mechanism are fused, and the remote sensing image target detection performance is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection in remote sensing images, specifically to a remote sensing image detection method based on posterior dynamic query and density attention. It is suitable for accurate target detection in remote sensing images under complex scenarios and can be widely applied in fields such as urban planning, military monitoring, agricultural monitoring, and post-disaster assessment. Background Technology

[0002] With the rapid development of remote sensing technology, it has been widely used in various fields. Especially in important areas such as urban planning, military monitoring, agricultural monitoring, and post-disaster assessment, remote sensing imagery has become an indispensable tool.

[0003] However, in these complex scenarios, accurately detecting target information from remote sensing images, especially distinguishing and identifying targets against complex backgrounds, has gradually become a key technical means to improve intelligent decision-making and data analysis capabilities. Complex backgrounds refer to image interference caused by various external factors in remote sensing images. These factors include changes in lighting, the influence of weather conditions, natural obstructions, and uneven target density in the image. Changes in lighting, shadows, and meteorological factors (such as rain, fog, and snow) often significantly reduce image visibility and target recognition. Furthermore, urban environments often contain interference from dense buildings, traffic, and other dynamic elements, leading to unclear target boundaries or blurring with the background, further increasing the difficulty of target detection.

[0004] First, uneven target density in remote sensing images is a typical problem. In large-scale remote sensing images, target distribution often exhibits a high degree of non-uniformity. Second, some areas may have very dense targets, while other areas may have only a few targets or even none. This density difference makes it difficult for detection algorithms to process targets in different areas evenly, especially in low-density areas where small targets are easily overlooked or misjudged; while in high-density areas, targets may occlude or overlap, leading to detection difficulties.

[0005] Secondly, the complex background in remote sensing images further complicates target detection. In natural environments, remote sensing images are frequently affected by factors such as clouds, building shadows, and vegetation. These background elements can easily produce visual features similar to the target, severely impacting target feature extraction and reducing detection accuracy. This is especially true in high-resolution remote sensing images, where target boundaries are unclear, and complex background noise and occlusion further blur the target's visual features, resulting in insufficient representation capabilities.

[0006] The interaction between the query vector and features in the original RT-DETR model is limited to a fixed number of layers. After output, it cannot be dynamically adjusted based on initial predictions, leading to insufficient feature mining in complex scenes and limited model representation capabilities. Its AIFI module uses a fixed receptive field processing logic, which cannot adapt to scenes with drastic changes in target density. It struggles to capture target association information in high-density areas and easily introduces redundant background noise in low-density areas, affecting both detection accuracy and wasting computational resources. Therefore, there is an urgent need to develop a remote sensing image detection technology that can adapt to complex scenes and improve detection accuracy and robustness. Summary of the Invention

[0007] In view of the shortcomings of the prior art, the purpose of this invention is to provide a remote sensing image detection method based on posterior dynamic query and density attention, which aims to solve the problems of limited representation ability of remote sensing image detection in complex scenes and poor adaptability to uneven target density in the prior art.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a remote sensing image detection method based on posterior dynamic query and density-adaptive attention includes: Step 1: Acquire remote sensing images and preprocess them to obtain standardized images; Step 2: Construct a baseline model architecture based on RT-DETR-R18, input standardized images into the backbone network, and extract multi-scale basic features; Step 3: Enhance the basic features using the density adaptive attention module, dynamically adjust the feature extraction strategy according to the target density in the region, and obtain the fused feature map; Step 4: Input the fused feature map into the posterior dynamic query decoder, and mine key features in complex scenarios through dynamic query generation and iterative update mechanism; Step 5: Based on the prediction results output by the decoder, the query and the real target are matched using the Hungarian algorithm, the comprehensive loss function is calculated to optimize the model parameters, and the final detection results are output.

[0009] Furthermore, in step 1, the acquired remote sensing images are preprocessed, including image resolution standardization and pixel intensity normalization, to ensure the consistency of data distribution; comprehensive data augmentation operations are used to improve the model's generalization ability, including random 90-degree rotation, random horizontal flipping, brightness and contrast adjustment, and Gaussian noise addition; all processed images and their corresponding target annotation information are stored in a standardized format to form standardized images.

[0010] Furthermore, in step 2, the baseline model architecture includes a backbone network, an efficient encoder, and an initial decoder. The backbone network uses the ResNet-18 architecture to extract multi-scale basic features of the image and performs preliminary fusion of features at different levels through a multi-scale fusion network. The encoder part uses the Transformer's Encoder layer to process the deep features output by the backbone network and introduces position encoding to inject spatial position information, thereby enhancing the model's ability to perceive the spatial relationships of the target.

[0011] Furthermore, in step 3, the density-adaptive attention module includes a density estimation network, a multi-branch feature processing unit, and a density-weighted fusion module: The density estimation network predicts the density of the input feature map through convolution operations and outputs the target density score for each region. The multi-branch feature processing unit has three parallel branches, which employ 3×3 convolutions (dilation rate 1), 5×5 convolutions (dilation rate 2), and 7×7 convolutions (dilation rate 3), respectively. All branches use depthwise separable convolutions to reduce the number of parameters. The weights of each branch are adaptively allocated according to the density score output by the density estimation network: the weights of the 7×7 large convolution kernel branch are increased in high-density regions to expand the receptive field and capture target association information; the weights of the 3×3 small convolution kernel branch are increased in low-density regions to preserve small target details; and the receptive field and detailed features are balanced through multi-branch weighted fusion in medium-density regions, thereby achieving dynamic allocation of computing resources.

[0012] The density-weighted fusion module performs weighted fusion of the output features of each branch, dynamically adjusts the feature information weights, and supplements key features through residual connections to enhance the model's adaptability to complex backgrounds and density changes, thereby obtaining enhanced feature maps.

[0013] Furthermore, the enhanced feature map output by the density-adaptive attention module is fused with the shallow and mid-level features output by the backbone network through multi-level linkage. A bidirectional fusion logic of top-down and bottom-up is adopted. First, the enhanced feature map is upsampled by bilinear interpolation and concatenated with the shallow and mid-level feature map through channels. After adjusting the channel dimension through 1×1 convolution, the complementary information is enhanced by the fusion unit guided by sparse attention, and multi-scale fused features are output. The receptive field is further expanded by dilated convolutional layers with dilation rates of 2, 4 and 6, respectively, and semantic and detailed information at different levels are fused in parallel, finally outputting a multi-scale fused feature map.

[0014] Furthermore, in step 4, global feature encoding is performed on the fused feature map to generate an initial set of query vectors. The confidence score of each query vector is calculated using an uncertainty evaluation function. The top 80% of high-confidence query vectors are selected, redundant and invalid queries are removed, and the selected query vectors are input into the posterior dynamic query decoder. The posterior dynamic query decoder includes a cross-attention module, a dynamic query update mechanism, and an anchor box prediction unit. The cross-attention module performs the first cross-attention calculation between the query vector and the fused feature map, achieving a preliminary match between the query and image features, and outputting preliminary prediction results; The dynamic query update mechanism calls the decoder through multiple rounds of iterations during the inference phase. Based on the preliminary prediction results, it calculates the feature response weights of the target region, dynamically adjusts the feature distribution of the query vector, and continuously optimizes the query vector. This breaks through the fixed number of interaction layers and fully explores the feature details of complex scenes. Finally, the target category label and bounding box coordinates are generated using the anchor box prediction unit.

[0015] Furthermore, in step 5, the Hungarian algorithm is used to match the query with the true target bounding box. The matching criteria combine category consistency and bounding box intersection-union ratio. The comprehensive loss function includes classification loss, bounding box regression loss, and matching loss, and the specific formula is as follows: The classification loss uses cross-entropy loss to measure the accuracy of class prediction. ; in, For the model to the first Query prediction categories The probability, The number of queries; The bounding box regression loss uses smoothed L1 loss to measure the accuracy of bounding box prediction. ; in, and The first Coordinates of the predicted bounding box and the ground truth bounding box for each query; Matching loss measures the quality of the match between the query and the target bounding box: ; in, and They are the first The true and predicted categories of each target. and These are the ground truth bounding box and the predicted bounding box, respectively. The total loss function is: ; The model parameters are optimized by minimizing the total loss function, and the final output is the image detection result including the target category, bounding box coordinates, and confidence score.

[0016] Furthermore, in step 5, the image detection results are post-processed and optimized. The non-maximum suppression algorithm is used to remove duplicate detection boxes, with the IOU threshold set to 0.5 to solve the problem of multiple annotations caused by target overlap. A confidence compensation mechanism is introduced to perform secondary feature verification on small targets with confidence in the range of [0.3, 0.5]. By matching the corresponding region features in the feature map, the detection reliability of small targets with low confidence is improved, and finally, standardized detection results are output.

[0017] Secondly, a remote sensing image detection system employing a remote sensing image detection method based on posterior dynamic query and density attention includes a backbone network, an efficient hybrid encoder, a cross-level feature fusion module, an uncertainty query selection module, a posterior dynamic query decoder, and a result post-processing module, with each module seamlessly connected through feature channels.

[0018] Thirdly, an electronic device for remote sensing image detection in complex scenes includes a processor, memory, input devices, output devices, and a data transmission module. These components are interconnected via a high-speed PCIe bus and DDR5 memory channel, forming a highly efficient and collaborative hardware architecture that ensures high-speed transmission, real-time computation, and stable output of massive amounts of remote sensing data. The memory pre-stores a computer-executable program, model training weight files, a remote sensing target category dictionary, and preset hyperparameter configurations. The processor loads and executes this computer program to accurately implement the aforementioned remote sensing image detection method based on posterior dynamic query and density-adaptive attention, completing the fully automated process from multi-source remote sensing data input to accurate target detection.

[0019] Fourthly, a computer-readable storage medium includes a computer program that, when executed by a processor, enables the implementation of the aforementioned remote sensing image detection method based on posterior dynamic query and density adaptive attention, processing remote sensing images and generating detection results.

[0020] The technical solution adopted in this invention has the following beneficial effects: This invention, based on the RT-DETR model, addresses core challenges in remote sensing images, such as large differences in target scale, uneven density distribution, complex background textures, and difficulty in capturing features of small or occluded targets. It constructs an end-to-end high-precision detection model by fusing a density-adaptive attention mechanism, a cross-level feature fusion strategy, and a posterior dynamic query decoding mechanism. The overall process follows the logic of "preprocessing - feature extraction - feature optimization - dynamic decoding - result output," sequentially completing image standardization, multi-scale feature enhancement, adaptive feature optimization, dynamic target matching, and detection result calibration, ultimately achieving accurate detection of remote sensing targets in complex scenes. Attached Figure Description

[0021] Figure 1 This is a flowchart of the target detection method in an embodiment of the present invention; Figure 2 This is a structural diagram of the target detection method in an embodiment of the present invention; Figure 3 This is a structural diagram of the DAA in an embodiment of the present invention; Figure 4 This is a structural diagram of the PDQD module in an embodiment of the present invention; Figure 5 This is a deployable electronic device according to an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0023] The flowchart of the proposed optimization method for remote sensing image target detection in complex scenes is shown below. Figure 1 As shown, this method, based on the RT-DETR model, addresses core challenges in remote sensing images, such as large differences in target scale, uneven density distribution, complex background textures, and difficulty in capturing features of small / occluded targets. It constructs an end-to-end high-precision detection model by fusing a density-adaptive attention mechanism, a cross-level feature fusion strategy, and a posterior dynamic query decoding mechanism. The overall process follows the logic of "preprocessing - feature extraction - feature optimization - dynamic decoding - result output," sequentially completing image standardization, multi-scale feature enhancement, adaptive feature optimization, dynamic target matching, and detection result calibration, ultimately achieving accurate detection of remote sensing targets in complex scenes.

[0024] The proposed optimization method for remote sensing image target detection in complex scenes is described in this embodiment of the invention. (See also...) Figure 1 As shown, it includes: The S100 preprocesses the acquired images. Standardized preprocessing is performed on the acquired multi-source remote sensing images (covering different data sources such as aerial and satellite) to ensure the consistency and robustness of the model input. First, the image pixel intensity is normalized to the [0,1] interval to eliminate pixel distribution differences caused by different imaging devices and lighting conditions. Then, all images are uniformly resampled to a standard size of 896×896 pixels using a bicubic interpolation algorithm, balancing detection accuracy and computational efficiency. To improve the model's generalization ability to complex scenes, a comprehensive data augmentation strategy is designed: random 90° / 180° / 270° rotations (50% trigger probability) and random horizontal flips (50% trigger probability) are performed, while random brightness / contrast adjustments are introduced (brightness variation range ±10%, contrast variation range ±15%) to simulate remote sensing imaging scenarios under different weather and lighting conditions. All preprocessed images and corresponding target annotation information (including target category and bounding box coordinates) are stored in the COCO standard format for model training and validation.

[0025] The S110 uses ResNet-50 as its backbone network. Through five levels of convolution and downsampling operations, it extracts multi-scale basic features from remote sensing images layer by layer. The output feature maps are scaled at 1 / 4 (S2), 1 / 8 (S3), 1 / 16 (S4), and 1 / 32 (S5) of the input image, respectively. S3, S4, and S5 are the core feature layers, corresponding to shallow and mid-level detail features and deep semantic features, respectively. The feature maps output from the backbone network are input into an efficient hybrid encoder, the core of which is a density-adaptive attention module (DAA). Figure 3 As shown, this module is specifically designed to address the problem of uneven density distribution of remote sensing targets. The DAA module employs a three-branch parallel depthwise separable convolutional structure: a 3×3 convolutional branch (dilation rate = 1) adapts to low-density regions, preserving local details of small targets and compressing redundant dimensions; a 5×5 convolutional branch (dilation rate = 2) extracts the association features of targets in medium-density regions; and a 7×7 convolutional branch (dilation rate = 3) expands the receptive field to capture spatial relationships between targets in high-density regions. The outputs of each branch are weighted and fused using density scores, which enhances the extraction of global contextual information and effectively suppresses interference from complex backgrounds. After concatenating the output features of each branch along the channel dimension, they are fused through a 3×3 convolutional layer, and then enhanced with BN (batch normalization) and SiLU activation functions to improve nonlinear expressiveness. The final output is an enhanced feature map with uniform dimensions (denoted as F5), achieving adaptive feature extraction for target regions of different densities.

[0026] To address the issues of large scale differences in remote sensing targets and weak features of small targets, the S120 incorporates a cross-level feature fusion module (CCFF). This module performs multi-level linkage fusion of deep semantic features (F5) output from the encoder with shallow and mid-level features (S3, S4, S5) output from the backbone network. The module employs a bidirectional fusion logic of "top-down + bottom-up": First, F5 is upsampled by bilinear interpolation (by a factor of 2) and concatenated with the S4 feature map. After adjusting the channel dimensions through a 1×1 convolution, complementary information is enhanced by a sparse attention-guided fusion unit, outputting the fused feature F4. Subsequently, F4 is upsampled by a factor of 2 and concatenated with S3, repeating the above fusion operation to output the fused feature F3. Finally, F3, F4, and F5 are further expanded through dilated convolutional layers (dilation rates of 2, 4, and 6, respectively), fusing semantic and detail information at different levels in parallel, ultimately outputting a multi-scale fused feature map (denoted as F_fusion), effectively enhancing the feature recognition of small and occluded targets.

[0027] To address the shortcomings of the original RT-DETR model, such as fixed query vector interactions and insufficient feature mining, S130 designs a two-stage optimization mechanism: The first stage is the selection of queries with uncertainty. Global feature encoding is performed on the F_fusion feature map to generate an initial set of query vectors (containing 100 query vectors). The confidence score of each query vector is calculated using an uncertainty evaluation function. The top 80% of high-confidence query vectors are selected, and redundant and invalid queries are eliminated to improve decoding efficiency.

[0028] The second stage is posterior dynamic query decoding (PDQD), such as... Figure 4 As shown, the filtered query vector is input into the posterior dynamic query decoder, which includes a multi-round cross-attention interaction layer and an iterative update mechanism: First, the query vector and the F_fusion feature map perform the first cross-attention calculation to achieve a preliminary match between the query and image features, and output the preliminary prediction results (target class probability and bounding box coordinates); based on the preliminary prediction results, the feature response weights of the target region are calculated, and the feature distribution of the query vector is dynamically adjusted. Subsequently, the Hungarian algorithm is used to match the query with the ground truth bounding boxes. The matching criteria combine class consistency and bounding box intersection-union ratio (IU). The comprehensive loss function includes classification loss, bounding box regression loss, and matching loss, and the specific formula is as follows: The classification loss uses cross-entropy loss to measure the accuracy of class prediction. ; in, For the model to the first Query prediction categories The probability, The number of queries; The bounding box regression loss uses smoothed L1 loss to measure the accuracy of bounding box prediction. ; in, and The first Coordinates of the predicted bounding box and the ground truth bounding box for each query; Matching loss measures the quality of the match between the query and the target bounding box: ; in, and They are the first The true and predicted categories of each target. and These are the ground truth bounding box and the predicted bounding box, respectively. The total loss function is: ; The model parameters are optimized by minimizing the total loss function, and the final output is the image detection result including the target category, bounding box coordinates, and confidence score.

[0029] The S140 performs post-processing optimization on the detection results output by the PDQD decoder: Non-maximum suppression (NMS) is used (IOU threshold set to 0.5) to remove duplicate detection boxes, resolving the multi-labeling problem caused by target overlap; to address the missed detection problem of small targets, a confidence compensation mechanism is introduced. Secondary feature verification is performed on small targets (area less than 32×32 pixels) with confidence scores in the [0.3, 0.5] range. By matching corresponding region features in the F3 feature map, the detection reliability of low-confidence small targets is improved. The final output is standardized detection results, including target category, precise bounding box coordinates, and confidence score, supporting visualization and subsequent analysis applications.

[0030] Furthermore, embodiments of the present invention also propose a remote sensing image target detection system, such as... Figure 2 As shown, the system is an end-to-end architecture, mainly including a backbone network, a high-efficiency hybrid encoder, a cross-level feature fusion module (CCFF), an uncertain query selection module, a posterior dynamic query decoder (PDQD), and a result post-processing module. Each module is seamlessly connected through a feature channel to ensure the continuity and effectiveness of feature transfer.

[0031] 1. Backbone Network Using ResNet-18 (originally 50) as the basic backbone, this network extracts multi-scale features from shallow to deep images through 5 convolutional stages (Conv1-Conv5) and 4 downsampling operations, outputting four-level feature maps: S2, S3, S4, and S5. The network mitigates the gradient vanishing problem during deep network training through a residual connection mechanism, ensuring the effective transfer of detailed features from shallow and mid-level layers and providing high-quality basic features for subsequent feature optimization.

[0032] 2. High-efficiency hybrid encoder The core component is the Density Adaptive Attention (DAA) module, supplemented by convolution, batch normalization (BN), and activation functions to form feature enhancement units. The DAA module adapts to target regions of different densities through a multi-branch parallel structure, achieving adaptive feature extraction that preserves details in low-density regions and captures correlations in high-density regions. At the same time, it reduces computational complexity through channel compression and fusion, balancing detection accuracy and operational efficiency.

[0033] 3. Cross-level Feature Fusion Module (CCFF) It contains three levels of fusion units, corresponding to the fusion processes of S3 and F4, S4 and F5, and F3 and F4, respectively. Each fusion unit consists of a feature alignment layer, a sparse attention layer, and a fusion convolutional layer: the feature alignment layer unifies the channel dimension of the input features through 1×1 convolution; the sparse attention layer enhances the features of the target region and suppresses background interference by calculating feature response weights; the fusion convolutional layer uses 3×3 convolution to achieve deep fusion of features and outputs enhanced features that combine detail and semantics.

[0034] 4. Uncertainty Query Selection Module An uncertainty evaluation function is designed based on information entropy theory. By calculating the mutual information between the query vector and the feature map, the effective information content of the query vector is quantified, and high-confidence query vectors are selected. This module can dynamically adjust the selection threshold (default confidence threshold 0.8) to adapt to the target distribution characteristics in different scenarios, improving the targeting and efficiency of the decoding process.

[0035] 5. Posterior Dynamic Query Decoder (PDQD) It consists of a cross-attention layer, an iterative update layer, a classification head, and a regression head. The cross-attention layer enables dynamic interaction between the query vector and the feature map. The iterative update layer optimizes the query vector distribution based on the prediction results. The classification head uses a fully connected layer and a softmax activation function to output the target class probability. The regression head uses a fully connected layer to output the bounding box coordinate offset. Joint training achieves coordinated optimization of class determination and location regression.

[0036] 6. Result Post-processing Module It integrates non-maximum suppression (NMS), small target confidence compensation, and bounding box calibration functions. NMS removes duplicate detection boxes, small target confidence compensation improves the recall rate of small target detection, and the bounding box calibration algorithm (based on IoU coordinate fine-tuning) optimizes target localization accuracy, ensuring the accuracy and reliability of the final detection results.

[0037] III. Core Technological Advantages The method of this invention achieves three core technological breakthroughs through multi-module collaborative optimization: First, the DAA module solves the receptive field adaptation problem caused by uneven remote sensing target density through a multi-branch adaptive structure, taking into account both the details of low-density small targets and the correlation features of high-density targets. Secondly, the CCFF module enhances the complementarity of multi-scale features through bidirectional cross-level fusion, effectively improving the feature recognition of small targets and occluded targets. Third, the PDQD decoder, through multiple rounds of dynamic interaction and iterative updates, breaks through the limitations of fixed query vectors and achieves in-depth mining and accurate matching of target features.

[0038] The aforementioned technological innovations have collectively improved the model's detection accuracy, robustness, and scene adaptability in complex remote sensing scenarios.

[0039] To verify the feasibility and effectiveness of the embodiments of the present invention, a specific embodiment was selected and compared with other methods. Table 1 shows the experimental results of the method of the present invention on the RSOD remote sensing image dataset. The crossover ratio (mAP) was used as the evaluation metric in the experiment.

[0040] Table 1 This experiment was conducted on an NVIDIA RTX 4090 graphics card for training and validation. The PyTorch framework (version 2.1.0) was used for model building and optimization, leveraging CUDA 12.1 for accelerated computation to ensure training efficiency and stability. The hyperparameters were optimized through multiple rounds of tuning: batch size was set to 8, initial learning rate was 0.0001, cosine annealing decay strategy was adopted (annealing period of 50 rounds, minimum learning rate of 0.00001), total training rounds were 100, and weight decay coefficient was set to 0.0005 to suppress overfitting.

[0041] First, the images in the RSOD remote sensing dataset are standardized using step S100, resampling all images to a uniform size of 640×640 pixels, balancing detection accuracy and computational efficiency. Second, feature extraction is performed using the backbone network and efficient hybrid encoder in step S110. The ResNet-50 backbone network outputs multi-scale basic features, and the core density adaptive attention module (DAA) adaptively captures target features in regions of different densities through a four-branch parallel structure, providing a high-quality feature foundation for subsequent fusion.

[0042] After the S120 Cross-Level Feature Fusion (CCFF) stage, the model integrates shallow and mid-level detailed features with deep semantic features through bidirectional fusion logic, enhancing the feature recognition of small targets and occluded targets. The S130 stage selects effective query vectors through uncertain query selection, and combines the multi-round iterative update mechanism of the posterior dynamic query decoder (PDQD) to deeply mine the matching relationship between target features and query vectors, thereby improving the target localization accuracy in complex scenarios.

[0043] Finally, the target detection results are output in stage S140, and the mean accuracy (mAP) is used as the core evaluation index to comprehensively quantify the detection performance of the model. Experimental data in Table 1 show that the proposed method outperforms the comparative methods in all evaluation metrics on the RSOD dataset, especially in scenarios with small targets, high-density targets, and complex backgrounds. This fully demonstrates that the proposed method has stronger advantages in feature representation, adaptive scene adaptation, and accurate target matching.

[0044] In this embodiment of the invention, a structural diagram of an electronic device for target detection in remote sensing images of complex scenes is provided. Figure 5 As shown.

[0045] This electronic device integrates a processor, memory, input devices (such as remote sensing image acquisition units and high-precision interactive terminals), and output devices (such as 4K high-resolution displays and data interface modules) via a high-speed system bus. Multi-source remote sensing image data (including satellite and aerial data sources) acquired by the input devices is transmitted via the system bus to the memory for storage and the processor for computation. After the processor executes the target detection algorithm and performs in-depth data analysis, it transmits the detection results (including target category, bounding box, and confidence level) to the output device via the bus. The results are then presented in a visual format or exported through the data interface, providing accurate target information support for scenarios such as urban planning, military monitoring, and post-disaster assessment, assisting decision-makers in efficiently formulating plans.

[0046] The processor, the core of the device, loads and executes optimized target detection methods for complex scenes stored in memory. It integrates a multi-core CPU and a high-performance GPU (such as the NVIDIA RTX series), efficiently running core algorithms such as density-adaptive attention modules, cross-level feature fusion, and posterior dynamic query decoding through a parallel computing architecture. This enables multi-scale feature extraction, adaptive target matching, and precise localization of the input remote sensing images, rapidly outputting high-confidence target detection results to meet the real-time processing needs of massive amounts of remote sensing data.

[0047] The memory includes ROM (Read-Only Memory) and RAM (Random Access Memory), and is expanded with a high-speed SSD storage array to balance storage stability and read / write efficiency. ROM is used to store the system program, the target detection algorithm kernel, and preset parameters (such as dataset category dictionaries and initial hyperparameter values) to ensure rapid loading of core functions after device startup. RAM serves as a cache space, storing intermediate data, feature map tensors, and temporary prediction results during image preprocessing and decoding, ensuring the continuity and efficiency of algorithm execution. The SSD storage array is used for long-term storage of massive amounts of raw remote sensing image data, model training weight files, and historical detection results, supporting data backtracking and model iterative optimization.

[0048] The input device comprises two core components: first, a remote sensing image acquisition unit, which can connect to satellite data receiving modules, aerial photography equipment, etc., to directly acquire multi-resolution, multispectral remote sensing images, or import stored remote sensing datasets via a network interface; second, a high-precision interactive terminal, including a touch screen and a professional drawing board, which supports users in performing operations such as parameter adjustment (e.g., confidence threshold, NMS threshold), image cropping / scaling, target annotation correction, etc., to achieve human-machine collaborative detection optimization.

[0049] The output device is centered around a 4K high-resolution display, supplemented by data interface modules (such as USB 3.2 and Ethernet interfaces). The high-resolution display can visualize the target detection results, annotating the target area with overlaid colored bounding boxes, and simultaneously displaying the target category and confidence score. It supports comparison between the original image and the detection results, making it easy for users to accurately identify the target location. The data interface module can export the detection results to standard format files (such as XML and JSON) or directly transmit them to subsequent analysis systems (such as Geographic Information System (GIS), meeting the data application needs of multiple scenarios.

[0050] Based on the above embodiments, the electronic device provided by the present invention can directly execute the remote sensing image target detection optimization method for complex scenarios, adapt to multi-source remote sensing data processing scenarios, and has high compatibility and scalability.

[0051] This invention can be implemented in various forms, including methods, systems, and computer program products. Specifically, it can be implemented in pure hardware (such as Application-Specific Integrated Circuits (ASICs), in pure software (with the algorithm program deployed on a general-purpose computer), or in a combination of hardware and software (embedded processor + customized algorithm chip), flexibly adapting to the resource constraints of different application scenarios. Furthermore, this invention can also be implemented as a computer program product, with the program code stored in a computer-recognizable storage medium (such as a hard disk, optical disc, USB flash drive, or cloud storage server), supporting portability and deployment across different electronic devices.

[0052] The specific implementation process of this invention can be referred to the relevant flowcharts. The diagrams clearly illustrate the operating logic and algorithm execution steps of the electronic device. Each functional module is implemented through a series of computer program instructions. These instructions can be transmitted to the processing unit of a general-purpose computer, a dedicated processing device, or an embedded system. The device will execute the instructions according to the predetermined logic to complete the remote sensing image processing and target detection functions. These instructions can also be stored in a computer-readable storage medium. When the device loads and executes them, they guide the device to complete preset functions or achieve personalized adjustments to the algorithm through combinations of instructions.

[0053] Although the main embodiments of the present invention have been described, those skilled in the art, after understanding the core innovative ideas, can make reasonable modifications or adjustments without departing from the technical framework (such as expanding the data source compatibility of the input device, optimizing the storage architecture of the memory). Therefore, the appended claims should cover all such modifications and changes, provided that they fall within the protection scope defined by the present invention.

Claims

1. A remote sensing image detection method based on posterior dynamic query and density attention, characterized in that, include: Step 1: Acquire remote sensing images and preprocess them to obtain standardized images; Step 2: Construct a baseline model architecture based on RT-DETR-R18, input standardized images into the backbone network, and extract multi-scale basic features; Step 3: Enhance the basic features using the density adaptive attention module, dynamically adjust the feature extraction strategy according to the target density in the region, and obtain the fused feature map; Step 4: Input the fused feature map into the posterior dynamic query decoder, and mine key features in complex scenarios through dynamic query generation and iterative update mechanism; Step 5: Based on the prediction results output by the decoder, the query and the real target are matched using the Hungarian algorithm, the comprehensive loss function is calculated to optimize the model parameters, and the final detection results are output.

2. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 1, characterized in that, In step 1, the acquired remote sensing images are preprocessed, including image resolution standardization and pixel intensity normalization, to ensure the consistency of data distribution. Comprehensive data augmentation operations are used to improve the model's generalization ability. These operations include random 90-degree rotation, random horizontal flipping, brightness and contrast adjustment, and Gaussian noise addition. All processed images and their corresponding target annotation information are stored in a standardized format to form standardized images.

3. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 1, characterized in that, In step 2, the baseline model architecture includes a backbone network, an efficient encoder, and an initial decoder. The backbone network uses the ResNet-18 architecture to extract multi-scale basic features of the image and performs preliminary fusion of features at different levels through a multi-scale fusion network. The encoder part uses the Transformer's Encoder layer to process the deep features output by the backbone network and introduces position encoding to inject spatial position information, thereby enhancing the model's ability to perceive the spatial relationships of the target.

4. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 1, characterized in that, In step 3, the density-adaptive attention module includes a density estimation network, a multi-branch feature processing unit, and a density-weighted fusion module: The density estimation network predicts the density of the input feature map through convolution operations and outputs the target density score for each region. The multi-branch feature processing unit has three parallel branches, which use 3×3 convolution, 5×5 convolution, and 7×7 convolution respectively. All branches use depthwise separable convolution to reduce the number of parameters. The weights of each branch are adaptively allocated according to the density score output by the density estimation network: the weights of the 7×7 large convolution kernel branch are increased in high-density regions to expand the receptive field and capture target association information; the weights of the 3×3 small convolution kernel branch are increased in low-density regions to preserve small target details; and the receptive field and detailed features are balanced by multi-branch weighted fusion in medium-density regions, so as to achieve dynamic allocation of computing resources. The density-weighted fusion module performs weighted fusion of the output features of each branch, dynamically adjusts the feature information weights, and supplements key features through residual connections to enhance the model's adaptability to complex backgrounds and density changes, thereby obtaining enhanced feature maps.

5. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 4, characterized in that, The enhanced feature map output by the density-adaptive attention module is fused with the shallow and mid-level features output by the backbone network through multi-level linkage. A bidirectional fusion logic of top-down and bottom-up is adopted. First, the enhanced feature map is upsampled by bilinear interpolation and concatenated with the shallow and mid-level feature map through channels. After adjusting the channel dimension by 1×1 convolution, the complementary information is enhanced by the fusion unit guided by sparse attention, and multi-scale fused features are output. The receptive field is further expanded by the dilated convolutional layers with dilation rates of 2, 4 and 6, respectively, and the semantic and detailed information at different levels is fused in parallel, finally outputting a multi-scale fused feature map.

6. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 1, characterized in that, In step 4, global feature encoding is performed on the fused feature map to generate an initial set of query vectors. The confidence score of each query vector is calculated using an uncertainty evaluation function. The top 80% of high-confidence query vectors are selected, and redundant and invalid queries are removed. The selected query vectors are then input into the posterior dynamic query decoder, which includes a cross-attention module, a dynamic query update mechanism, and an anchor box prediction unit. The cross-attention module performs the first cross-attention calculation between the query vector and the fused feature map, achieving a preliminary match between the query and image features, and outputting preliminary prediction results; The dynamic query update mechanism calls the decoder through multiple rounds of iterations during the inference phase. Based on the preliminary prediction results, it calculates the feature response weights of the target region, dynamically adjusts the feature distribution of the query vector, and continuously optimizes the query vector. This breaks through the fixed number of interaction layers and fully explores the feature details of complex scenes. Finally, the target category label and bounding box coordinates are generated using the anchor box prediction unit.

7. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 1, characterized in that, In step 5, the Hungarian algorithm is used to match the query with the ground truth bounding boxes. The matching criteria combine class consistency and bounding box intersection-union ratio (IU). The comprehensive loss function includes classification loss, bounding box regression loss, and matching loss, and the specific formula is as follows: The classification loss uses cross-entropy loss to measure the accuracy of class prediction. ; in, For the model to the first Query prediction categories The probability, The number of queries; The bounding box regression loss uses smoothed L1 loss to measure the accuracy of bounding box prediction. ; in, and The first Coordinates of the predicted bounding box and the ground truth bounding box for each query; Matching loss measures the quality of the match between the query and the target bounding box: ; in, and They are the first The true and predicted categories of each target. and These are the ground truth bounding box and the predicted bounding box, respectively. The total loss function is: ; The model parameters are optimized by minimizing the total loss function, and the final output is the image detection result including the target category, bounding box coordinates, and confidence score.

8. The remote sensing image detection method based on posterior dynamic query and density attention according to claim 7, characterized in that, In step 5, post-processing optimization is performed on the image detection results. The non-maximum suppression algorithm is used to remove duplicate detection boxes, with the IOU threshold set to 0.5 to solve the problem of multiple annotations caused by target overlap. A confidence compensation mechanism is introduced to perform secondary feature verification on small targets with confidence in the range of [0.3, 0.5]. By matching the corresponding region features in the feature map, the detection reliability of small targets with low confidence is improved, and finally, standardized detection results are output.

9. A remote sensing image detection system employing the remote sensing image detection method based on posterior dynamic query and density attention as described in claim 1, characterized in that, It includes a backbone network, a high-efficiency hybrid encoder, a cross-level feature fusion module, an uncertain query selection module, a posterior dynamic query decoder, and a result post-processing module. The modules are seamlessly connected through feature channels.

10. A computer-readable storage medium comprising a computer program, which, when executed by a processor, is capable of implementing the remote sensing image detection method based on posterior dynamic query and density attention as described in claim 1, processing remote sensing images and generating detection results.