Remote sensing target detection method based on hierarchical differential attention embedding
Patent Information
- Application Number
- CN202611204268.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-30
AI Technical Summary
此外,部分基于Transformer的全局建模方法虽能提升精度,但计算负载较高,不利于在资源受限的边缘端实时部署
[0022](1)设计了C3-AEM注意力增强模块,将ECA与CA以插件式结构嵌入YOLOv5的C3残差分支末端,在尽量保持原有网络结构的基础上增强通道筛选与空间位置表达能力。
Smart Images

Figure CN123016229A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of remote sensing observation technology, and in particular to a remote sensing target detection method based on hierarchical differential attention embedding. Background Technology
[0002] Remote sensing image target detection has significant application value in fields such as military reconnaissance, land resource monitoring, and disaster assessment. With the rapid development of high-resolution Earth observation technology, deep learning-based target detection methods have gradually become mainstream. Single-stage detectors, represented by YOLOv5, have gained widespread attention in engineering remote sensing detection tasks due to their advantages such as fast detection speed, small parameter size, and ease of deployment.
[0003] However, when general object detectors are directly transferred to remote sensing image scenes, detection performance often drops significantly. The main reasons include: First, the proportion of target pixels in remote sensing images is extremely low, with small targets (pixel size less than 32×32) typically accounting for more than 60%, and the high-magnification downsampling operation in traditional detectors can easily cause the fine-grained features of small targets to disappear in deep networks; Second, the background of remote sensing images is complex, and interference information such as clouds, vegetation textures, and dense building clusters can easily be confused with target features, leading to an increased false detection rate; Third, targets of different scales have different effective representation levels in the feature pyramid. If the same attention configuration is used at each level, it can easily lead to insufficient shallow detail enhancement, accumulation of redundant responses in deep layers, and a decline in cross-scale fusion quality.
[0004] In existing technologies, researchers have attempted to alleviate the aforementioned problems by introducing attention mechanisms. For example, SE-Net enhances feature discriminativity through channel recalibration, CBAM combines channel attention and spatial attention, and coordinate attention (CA) further incorporates coordinate position information. However, these improved schemes are mostly embedded in the network as independent modules, rarely considering the inherent differences in receptive field size, spatial resolution, and semantic abstraction levels among different network layers. They generally adopt a homogeneous embedding strategy of "one attention method applicable to all layers," making it difficult to fully leverage the complementary role of attention mechanisms in multi-level features. Furthermore, while some Transformer-based global modeling methods can improve accuracy, they have high computational loads, making them unsuitable for real-time deployment at resource-constrained edge environments.
[0005] Therefore, how to design an attention embedding scheme that can adapt to the differences in expression of different feature layers and has a small parameter increment, while maintaining lightweight and real-time performance, is a technical problem that urgently needs to be solved by those skilled in the art. This is to address the problems in remote sensing target detection such as the easy loss of details of small targets, redundancy in cross-scale feature fusion, and severe interference from complex backgrounds. Summary of the Invention
[0006] The purpose of this invention is to provide a remote sensing target detection method based on hierarchical differential attention embedding.
[0007] To achieve the above objectives, the present invention is implemented according to the following technical solution:
[0008] This invention provides a remote sensing target detection method based on hierarchical differential attention embedding, comprising the following steps:
[0009] S1: Acquire the remote sensing image to be detected;
[0010] S2: Input the remote sensing image into the improved YOLOv5 target detection network, wherein the improved YOLOv5 target detection network includes a backbone network, a neck network, and a detection head;
[0011] S3: In the shallow feature layer P2 of the backbone network, a C3-ECA attention enhancement module based on the ECA module is embedded to enhance the channel discriminative features of small-scale targets; in the deep feature layer P5 of the backbone network, a C3-ECA attention enhancement module based on the ECA module is embedded to suppress deep semantic interference from complex backgrounds.
[0012] S4: In the middle feature layer P3 of the backbone network, a C3-CA attention enhancement module based on the CA module is embedded to enhance the spatial location representation of the target and the ability to preserve local structure.
[0013] S5: In the multi-scale feature fusion path of the neck network, independent ECA modules are inserted on the FPN feature pyramid path and PAN path respectively to optimize the fusion quality of multi-scale features;
[0014] S6: Output the detection results of target objects in the remote sensing image through the improved YOLOv5 target detection network. The detection results include target category, confidence score and bounding box position.
[0015] Furthermore, the C3-ECA attention enhancement module is configured as follows: the ECA module is embedded as a plug-and-play component at the end of the residual branch of the original YOLOv5 C3 module, the main branch retains its original structure, and the residual branch features enhanced by attention are channel-splitting and fusion with the main branch features.
[0016] The C3-CA attention enhancement module is configured as follows: the coordinate attention CA module is embedded as a plug-and-play component into the end of the residual branch of the original YOLOv5 C3 module, the main branch retains its original structure, and the residual branch features enhanced by the CA module are channel-joined and fused with the main branch features.
[0017] The independently inserted ECA modules in the neck network act on the top-down FPN feature fusion path and the bottom-up PAN feature aggregation path, respectively, to enhance the effective information transmission in the multi-scale feature fusion process.
[0018] Specifically, the improved YOLOv5 object detection network retains the original C3 module structure in its middle feature layer P4, which is used to indirectly receive attention enhancement information from layers P3 and P5 through the upsampling and downsampling paths of the feature pyramid.
[0019] Furthermore, the hierarchical differentiated attention embedding strategy configures different types of attention enhancement structures for shallow feature layers, middle feature layers, deep feature layers, and neck fusion paths according to the spatial resolution, receptive field size, and semantic abstraction of different feature layers, so as to maintain real-time reasoning capability while improving the accuracy of remote sensing target detection.
[0020] Experimental results show that, on the NWPU VHR-10 remote sensing dataset, the improved YOLOv5 target detection network increases mAP@0.5 from 86.83% to 91.67% while maintaining an inference speed of 101 FPS, provided that the number of parameters increases from 7.2M to 8.6M.
[0021] The beneficial effects of this invention are:
[0022] (1) A C3-AEM attention enhancement module was designed, which embeds ECA and CA into the end of the C3 residual branch of YOLOv5 in a plug-in structure to enhance the channel filtering and spatial location expression capabilities while maintaining the original network structure as much as possible.
[0023] (2) A hierarchical differentiated attention embedding strategy is proposed: Based on the receptive field, spatial resolution and semantic abstraction of each layer, appropriate attention enhancement structures are configured for the P2 layer, P3 layer, P5 layer and neck fusion path respectively, so as to alleviate the problem of insufficient adaptability when a single attention mechanism is applied to all levels.
[0024] (3) Experiments on the NWPU VHR-10 remote sensing benchmark dataset show that the proposed method increases mAP@0.5 from 86.83% to 91.67% (+4.84 percentage points) at the cost of increasing 1.4M parameters (7.2M→8.6M), while maintaining an inference speed of 101 FPS. It achieves good results in small target recognition, complex background suppression and target spatial location representation. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the improved YOLOv5-LAE network structure of this invention.
[0026] Figure 2This is a schematic diagram of the C3-AEM attention enhancement module structure of the present invention. Detailed Implementation
[0027] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The illustrative embodiments and descriptions herein are used to explain the present invention, but are not intended to limit the present invention.
[0028] In the many research areas of computer vision, deep learning-based object detection holds a crucial position. Its fundamental goal is to enable models to automatically infer the spatial location and semantic category of various objects from input images, so that the final output of the model simultaneously contains the object's location information and category label. Compared to traditional detection methods that rely on manually designed features, deep convolutional neural networks significantly improve detection accuracy and generalization due to their powerful feature extraction capabilities. Based on differences in network structure and inference process, existing methods are mainly divided into two categories: two-stage detectors and single-stage detectors.
[0029] Taking Faster R-CNN, a typical example of a two-stage detector, as an example, its inference process is divided into two independent stages: region candidate generation and subsequent classification regression. The advantage of this architecture lies in its superior localization and recognition accuracy, but it also brings problems such as complex model structure, large parameter scale, and high inference latency. In contrast, single-stage detectors such as the YOLO series, SSD, and RetinaNet unify target localization and classification into a regression task, eliminating the separate region proposal stage and achieving end-to-end inference. This type of method achieves a better balance between detection speed and accuracy, and is particularly suitable for engineering deployment.
[0030] Modern deep learning object detection networks typically consist of three parts: a backbone feature extraction network, a neck feature fusion network, and a head detection output module. Each part has a clear division of labor and works collaboratively. The specific division of labor is shown in Table 1.
[0031] Table 1 Functional Modules of the Target Detection Network
[0032] Module Name core role Function Description Backbone Feature Extraction Network Feature extraction Extracting features from the original image, capturing shallow texture, edge information, and deep semantic information layer by layer, is the foundation of detection models. Neck Feature Fusion Network Feature fusion and enhancement By fusing multi-scale features from the backbone output, shallow spatial information and deep semantic information are complemented, thereby enhancing feature representation capabilities. Head detection output module (Head) Detection output Class prediction and bounding box regression are performed on the fused features to generate the final object detection results.
[0033] YOLOv5, released by Ultralytics in 2020, is a lightweight, single-stage object detection network. Although the YOLO family has undergone continuous iterations, YOLOv5 remains a commonly used benchmark for lightweight customization in specific domains due to its high industrial stability and mature deployment ecosystem. Building upon the core design principles of the YOLO family, such as end-to-end inference and speed-first approach, this model introduces a CSP (Cross-Stage Partial) cross-stage local network structure to reduce computational redundancy. It uses PANet as the feature aggregation module to construct a bidirectional cross-scale information transfer path that balances high-level semantics and low-level details. Early versions also incorporated a Focus slice downsampling module to reduce information loss. These improvements achieve a good balance between detection speed, parameter count, and accuracy, making YOLOv5 one of the widely adopted benchmark detectors in both industry and academia.
[0034] The YOLOv5 architecture follows a three-part structure: backbone, neck, and head. The input image first passes through the backbone network to extract multi-scale features, then is fed into the neck network. The PANet structure performs bidirectional aggregation of these multi-scale features to enhance the information representation of targets at different scales. Finally, the head, on three feature layers with different downsampling factors, is responsible for class prediction and bounding box regression for small, medium, and large-sized targets, respectively.
[0035] Attention mechanisms, based on the channel or spatial information of feature maps, dynamically adjust feature responses to guide the network in enhancing target-related regions or channels during the feature learning phase while suppressing background interference. This is a crucial technical approach for improving the performance of lightweight detection networks. Unlike traditional convolutional operations that apply fixed weights to local receptive fields, attention mechanisms dynamically generate weight matrices based on the input feature content, achieving selective enhancement of feature information. Based on different modeling perspectives, existing attention methods can be categorized as follows:
[0036] When processing complex scenes, the human visual system does not process all information equally across the entire field of vision. Instead, it concentrates cognitive resources on key areas based on the task objective, maintaining only low-resolution monitoring of surrounding areas. This selective attention concept inspired the development of attention mechanisms in deep neural networks. In terms of implementation, the core of the attention mechanism lies in input-dependent adaptive weighting. During forward propagation, the network dynamically generates weight distributions based on the contextual information of the feature maps, performing differential recalibration of the original feature maps in terms of spatial location or channel dimension, thereby enhancing the response of target-related regions and suppressing background interference.
[0037] Based on the differences in the dimensions of attention weight generation, existing methods can be broadly categorized into channel attention, spatial attention, and hybrid attention. Furthermore, improved methods, such as coordinate attention (CA), incorporate location information on top of channel attention, enhancing the spatial representation of the target region.
[0038] Different attention paradigms have significantly different applicable scenarios and computational costs in remote sensing target detection, as shown in Table 2.
[0039] Table 2 Comparison of Typical Attention Mechanism Modules
[0040] Model Core Mechanism computational complexity Enhanced Dimensions SE Global average pooling, fully connected stimulus Low aisle ECA One-dimensional convolutional local cross-channel interaction Low aisle CBAM Channel attention and spatial attention concatenation higher Channel-space CA Biaxial directional pooling, coordinate information embedding middle Channel - Location
[0041] While general-purpose object detectors have achieved remarkable results on natural images, direct application to remote sensing images faces numerous challenges due to the unique imaging mechanisms and target attributes. To clarify the sources of improvement needs, this paper first formally describes the detection task, and then systematically analyzes the structural limitations of YOLOv5 in remote sensing scenarios based on imaging characteristics.
[0042] Given a remote sensing image, represent it as a three-dimensional tensor. ,in These correspond to the number of channels, image height, and width, respectively. The goal of object detection is to learn a mapping function. Map the input image to a set of target instances. .in Indicates the first The bounding box (center coordinates and width and height) of each target. The target confidence score, For category labels, This represents the total number of targets detected.
[0043] YOLOv5 implements the above mapping in an end-to-end manner, and its processing flow is as follows: Figure 1 As shown. The backbone network constructs a multi-scale feature pyramid through multi-layer convolution and downsampling; the neck network adopts a combination structure of FPN top-down path and PAN bottom-up path to perform bidirectional semantic transfer between features at each scale. The feature fusion method is channel dimension splicing, as shown in Equation (1); the head performs bounding box regression and class prediction on the output feature maps at three different scales respectively.
[0044]
[0045] Remote sensing images are acquired by airborne or spaceborne sensors from high altitudes. Their imaging methods differ fundamentally from natural images, mainly in the following three aspects.
[0046] 1. Extremely low target pixel ratio. Due to limitations imposed by flight altitude and ground resolution, ground targets typically have small pixel sizes in remote sensing images, resulting in a low percentage of the overall image. Furthermore, similar targets may be densely distributed in specific areas with small inter-target spacing, easily leading to insufficient representation of small-scale target features.
[0047] 2. Significant differences in target scale. Remote sensing images exhibit a wide scale range among different target categories, with small-scale, medium-scale, and large-scale targets having different effective representation levels in the feature pyramid. Using a uniform feature enhancement method or the same attention configuration can easily lead to insufficient shallow detail enhancement, accumulation of redundant responses in deeper layers, and a decline in the quality of cross-scale fusion.
[0048] 3. Complex background and low target signal-to-noise ratio. The background of remote sensing images is usually composed of a mixture of various land features such as roads, buildings, vegetation, and water bodies. These land features and targets interfere with each other in terms of color and texture. The effective target area occupies a much smaller proportion of the total image area than in natural images, resulting in a weak target response in the overall feature representation.
[0049] The aforementioned three imaging differences constrain YOLOv5's detection capabilities in complex remote sensing scenes in the following ways. First, YOLOv5's multi-level downsampling operation can easily lead to the attenuation of fine-grained spatial information of small targets, affecting the recall ability of small-scale targets. Second, the Neck part mainly fuses features of different scales through channel stitching, which, while introducing deep semantic information, may also superimpose redundant background information, weakening the response intensity of the target region. Furthermore, different network layers differ in spatial resolution, receptive field size, and semantic abstraction level; if a homogeneous attention embedding method is used, it is difficult to fully leverage the complementary effects of different attention mechanisms in multi-level features.
[0050] Therefore, relying solely on the original network structure is insufficient to effectively address the unique characteristics of remote sensing images. This invention introduces a hierarchical differentiated attention embedding strategy tailored to the features of each network layer. In the shallow layer P2, C3-ECA enhances the channel discriminativeness of small-scale targets; in the middle layer P3, C3-CA enhances the spatial representation of targets and the preservation of local structure; in the deep layer P5, C3-ECA suppresses deep semantic interference from complex backgrounds; and in the neck fusion path, an independent ECA module optimizes the quality of multi-scale feature fusion.
[0051] This invention proposes the YOLOv5-LAE network, based on the YOLOv5 architecture, aiming to address issues in remote sensing target detection such as the easy loss of features from small targets, redundancy in cross-scale feature fusion, and severe interference from complex backgrounds. To address these problems, the model selectively introduces differentiated attention mechanisms in key layers of the backbone and neck networks. Specifically, this invention designs the C3-AEM attention enhancement module as a general integration unit, embedding ECA or CA attention modules into the ends of the C3 residual branches as plug-ins. Building upon this, a hierarchical differentiated attention embedding strategy is further proposed, matching appropriate attention types based on the receptive field size, spatial resolution, and semantic abstraction level of different layers. The overall improved YOLOv5-LAE network structure, with its backbone and neck structures as shown below... Figure 1 As shown.
[0052] The choice of attention type is not uniformly applied to all layers, but rather differentiated based on the receptive field size, feature map spatial resolution, and remote sensing detection task requirements of each layer. In convolutional neural networks, the first... The size of the original image region corresponding to each location in the layer feature map is called the receptive field (RF), and its size determines the range of target scales that the layer can perceive. For a YOLOv5 backbone network with an input resolution of 640×640, the downsampling ratio, feature map size, and main adaptation target range of each stage feature layer are shown in Table 3.
[0053] Table 3 Comparison of Feature Layer Downsampling and Adaptation Target Range
[0054] Feature layer downsampling factor Feature map size Perceptible target range P2 ×4 160×160 8~32 px P3 ×8 80×80 32~80 px P4 ×16 40×40 80~160 px P5 ×32 20×20 >160 px
[0055] (1) The P2 layer has high resolution but relatively weak semantic information, making it suitable for preserving the local texture and edge information of small targets. The discriminative difference of the channel dimension in this layer is an important factor in suppressing shallow background noise. Therefore, a C3-ECA attention enhancement module based on the ECA module is introduced into the P2 layer to recalibrate shallow features through channel attention, enhance the channel response related to small-scale targets, and suppress interference from complex ground backgrounds.
[0056] (2) The P3 layer strikes a good balance between spatial resolution and semantic representation, preserving certain spatial location information while also possessing good local structure representation capabilities. Therefore, a C3-CA attention enhancement module based on the CA module is introduced into the P3 layer to enhance the spatial location representation and local structure preservation capabilities of the target region through coordinate attention.
[0057] (3) The P5 layer has the richest semantic information, but its spatial resolution is low, and it mainly carries deep semantic features related to categories. Therefore, a C3-ECA attention enhancement module based on the ECA module is introduced into the P5 layer to strengthen the channel features related to categories and suppress deep semantic interference in complex backgrounds.
[0058] (4) The P4 layer retains the original C3 module structure. This layer indirectly receives attention enhancement information from the P3 and P5 layers through the upsampling and downsampling paths of the feature pyramid, thus avoiding additional computational overhead while maintaining detection accuracy.
[0059] Based on the design analysis of the above layers, this invention adopts a hierarchical differentiated attention embedding strategy: C3-ECA attention enhancement modules are embedded in the shallow layer P2 and deep layer P5 of the backbone network, respectively; a C3-CA attention enhancement module is embedded in the middle layer P3 of the backbone network; the original C3 module structure remains unchanged in layer P4; and independent ECA modules are inserted into the FPN feature pyramid path and PAN path of the neck network to enhance the effective information transmission during multi-scale feature fusion. Through this hierarchical configuration, the attention mechanism is matched with the feature expression requirements of each layer.
[0060] To enhance feature representation capabilities while maintaining a lightweight model, this invention designs the C3-AEM (C3-Attention Enhancement Module), whose structure is as follows: Figure 2 As shown. This module does not simply chain attention layers together in the network, but rather deeply integrates the attention mechanism into the internal residual branch of the C3 module. Its mathematical expression is shown in the following equation:
[0061]
[0062] in and These represent the convolutional preprocessing of the residual branch and the main branch, respectively. This indicates the selected enhancement operator.
[0063] To more clearly demonstrate the data flow within the module, Algorithm 1 provides the forward propagation pseudocode for C3-AEM.
[0064] Algorithm 1: Forward Propagation of C3-AEM Module Input: Input feature tensor Attention type Bottleneck stack count Output: Enhanced feature tensor 1. Phase I: Initialization Phase 2. Calculate the number of intermediate channels. 3. Main path characteristics: The output dimension is 4. Residual branch initialization: The output dimension is 5. Phase II: Residual Feature Extraction 6. For to do 7. 8. End For 9. If then 10. 11. Else If then 12. 13. End If 14. Phase III: Feature Fusion Stage 15. Stitching along the channel dimension: 16. Global Feature Fusion: 17. Return
[0065] Compared to the native C3 module, C3-AEM's advantage lies in its asymmetric enhancement design. It introduces an attention mechanism only at the end of the residual branch, while the main branch retains its original structure, creating an asymmetric configuration in the processing path. This design offers two benefits. First, the attention operator recalibrates the features extracted from the residual branch before fusing them with the main branch features, effectively enhancing the response intensity of the target region while suppressing background clutter interference, thus achieving feature refinement. Second, by flexibly changing the type of attention operator, C3-AEM can dynamically switch between channel enhancement and spatial enhancement, adapting to the feature requirements of different network layers.
[0066] Based on the aforementioned analysis of the limitations of remote sensing image features, a hierarchical differential enhancement strategy is proposed. This strategy deploys an appropriate C3-AEM variant for each layer according to the receptive field size and feature abstraction level, thereby achieving hierarchical optimization of the feature pyramid.
[0067] Specifically, the shallow layer P2 has high resolution but weak semantics. It integrates C3-ECA (C3-AEM with ECA) to recalibrate shallow features using channel attention, enhancing the key channel responses of small targets while suppressing interference from complex backgrounds. The mid-layer P3 strikes a good balance between spatial resolution and semantic representation. It integrates C3-CA (C3-AEM with CA) to enhance the spatial representation of target regions and preserve local structure using coordinate attention. The deep layer P5 has the richest semantics and also employs C3-ECA to further strengthen category-related channel features, ensuring stable category recognition capabilities in complex backgrounds. To balance computational efficiency and detection accuracy, the P4 layer retains the original C3 structure and indirectly receives attention enhancement information from layers P3 and P5 through upsampling and downsampling paths in the feature pyramid. Furthermore, in the multi-scale feature fusion path of the neck network, this invention independently inserts two ECA modules acting on the FPN and PAN paths respectively to enhance effective information transmission during the multi-scale feature fusion process.
[0068] The hierarchical attention embedding strategy selection algorithm is as follows:
[0069] Algorithm 2: Layered Attention Embedding Strategy Selection Algorithm Input: Network layer set L, downsampling rate S of each layer, detection task requirement T Output: Attention configuration scheme M of each layer 1. Initialize M ← ∅ 2 for each level l ∈ L do 3 if l = P2 then 4 M ← M ∪ {(P2, replace C3→C3-ECA, ECA)} #Ultra-small target layer: receptive field ~24px, channel noise suppression prioritized 5 elif l = P3 then 6 M ← M ∪ {(P3, replace C3→C3-CA, CA)} #Middle-layer feature layer: spatial location representation and local structure preservation take priority 7 elif l = P4 then 8 M ← M ∪ {(P4, Keep original C3, None)} #Medium target layer: Indirectly receives attention enhancement information from P3 / P5, maintaining the original structure 9 elif l = P5 then 10 M ← M ∪ {(P5, replace C3→C3-ECA, ECA)} #High-level semantic layer: channel discrimination takes priority, spatial attention has limited significance 11 elif l = Neck then 12 M ← M ∪ {(FPN path, independent insertion of ECA, ECA)} 13 M ← M ∪ {(PAN path, independent insertion of ECA, ECA)} 14 end if 15 end for 16 return M
[0070] Analysis of experimental results:
[0071] Experimental setup:
[0072] (1) Dataset:
[0073] This invention uses the NWPU VHR-10 high-resolution remote sensing target detection dataset released by Northwestern Polytechnical University. The dataset contains 800 high-resolution remote sensing images with spatial resolutions ranging from 0.5m to 2m, sourced from Google Earth satellite imagery and Vaihingen aerial data. It covers 10 typical land surface targets and includes 3651 valid labeled instances. All labels are in the form of horizontal rectangular boxes, and the distribution of samples across categories is relatively balanced, making it one of the commonly used performance evaluation benchmarks in the field of remote sensing detection.
[0074] According to the MS COCO evaluation criteria, the target box area is smaller than Defined as small targets, the dataset was statistically analyzed based on the area of the bounding boxes. The results showed that small target instances accounted for approximately 62%, while medium targets ( ) and big goals They account for approximately 28% and 10% respectively. This scale distribution dominated by small targets places high demands on the detector's multi-scale feature extraction capabilities, providing an ideal scenario for verifying the sensitivity of the improved model to small targets.
[0075] Remote sensing imaging environments are complex, with some images containing background interference such as cloud cover, shadows, and dense building clusters, making it easy for targets and background features to be confused. This invention aims to enhance the model's target response capability in complex semantic environments and suppress interference from invalid background information by embedding an ECA-CA collaborative attention mechanism.
[0076] (2) Experimental environment setup:
[0077] To ensure the objectivity and reproducibility of the experimental conclusions, this invention strictly standardizes the training and evaluation environment for YOLOv5-LAE. Specific hardware and software configurations are shown in Table 4.
[0078] Table 4 Experimental Environment Configuration Table
[0079] category Configuration GPU NVIDIA RTX 5080 (16GB VRAM) operating system Windows 11 Deep learning framework PyTorch 2.8.0 + CUDA 12.8 Python version 3.9.25 Development tools PyCharm 2025
[0080] The setting of each training hyperparameter follows the principles below, and the specific parameter values are shown in Table 5.
[0081] Table 5 Model Training Hyperparameter Configuration Table
[0082] Optimizer SGD Initial learning rate 0.01 Final learning rate 0.0001 momentum 0.937 Weight decay 0.0005 Batch size 16 Number of training rounds 200 Input image size 640×640 Learning rate scheduling strategy Cosine annealing warm-up learning rate 0.0001 loss function CIoU + BCE
[0083] (3) Algorithm evaluation metrics:
[0084] Performance evaluation of object detection tasks needs to consider both classification accuracy and spatial positioning accuracy. This invention uses the following indicator system to comprehensively evaluate the model.
[0085] Intersection over Union (IoU): This measures the degree of spatial overlap between the predicted bounding box and the ground truth bounding box. It is a core criterion for determining the validity of a single detection result. The calculation formula is as follows:
[0086]
[0087] Basic classification metrics: Based on the IoU threshold, detection results are divided into true positives (TP), false positives (FP), and false negatives (FN). Precision (P) and recall (R) are defined to reflect the model's ability to suppress false positives and cover target information, respectively.
[0088]
[0089]
[0090] Average Precision (AP): Calculated by the area under the integral precision-recall curve (PR curve), it comprehensively characterizes the detection stability of the model at different confidence thresholds, where mAP@0.5 corresponds to the average precision of each class when the IoU threshold is 0.5.
[0091] Mean Average Precision (mAP): mAP is the average AP across multiple classes, measuring the overall performance of the model. The calculation formula is as follows: where N is the number of classes (N=10 in the NWPU VHR-10 dataset).
[0092]
[0093] Computational efficiency and real-time performance metrics: To further evaluate the deployment applicability of the model, this invention simultaneously measures inference speed, parameter size, and computational complexity. Specifically, FPS measures the model's ability to complete image inference per unit time; a higher FPS indicates stronger real-time processing capability. Parameter size (Params) characterizes the scale of learnable weights in the network, indirectly reflecting the model's storage overhead and deployment burden. Floating-point operations (FLOPs) estimate the computational requirements of a single forward inference process; a lower FLOPs generally indicate lower computational resource consumption.
[0094] Furthermore, to refine the analysis of the model's detection capabilities under different target characteristics, this invention combines the category AP results to conduct comparative analysis on small-scale dense targets, complex background targets, and targets with obvious structural boundaries, and uses P, R, mAP@0.5 and mAP@0.5:0.95 as the main evaluation indicators in the ablation experiment.
[0095] Analysis of experimental results:
[0096] Multi-model horizontal comparison:
[0097] To comprehensively evaluate the overall performance of YOLOv5-LAE, this invention compares it with mainstream detection algorithms on the NWPU VHR-10 dataset in terms of accuracy, number of parameters, computational cost, and inference speed. The results are shown in Table 6.
[0098] Table 6 Comparative experimental results on the NWPU VHR-10 dataset
[0099] method mAP@0.5 mAP@0.5:0.95 Number of parameters (M) FLOPs(G) FPS YOLOv5s 86.83 51.72 7.2 16.0 112 Faster R-CNN 96.27 60.40 41.1 267.6 15 Mask R-CNN 97.18 61.53 51.7 325.1 12 YOLOv7-tiny 88.46 56.33 6.2 13.7 146 YOLOv8s 91.73 59.86 11.7 28.6 85 YOLOv5-LAE 91.67 53.52 8.6 18.1 101
[0100] Based on the distribution patterns of the various indicators in Table 6, the performance characteristics of YOLOv5-LAE can be analyzed as follows:
[0101] (1) A longitudinal performance comparison was conducted using the lightweight mainstream model YOLOv5s as the baseline. Experiments show that the mAP@0.5 of YOLOv5-LAE improved from 86.83% of the baseline to 91.67%, with an absolute accuracy improvement of 4.84 percentage points; at the same time, the more stringent mAP@0.5:0.95 index improved from 51.72% to 53.52%, an improvement of 1.80 percentage points. Both indices showed a positive improvement under different IoU thresholds, indicating that the attention enhancement module introduced in this invention does indeed help to refine the modeling of the discriminative features of the target. The improvement in model performance does not simply rely on the superficial gain brought about by the relaxed threshold, and the improvement mechanism is effective.
[0102] (2) Compared with the two-stage detector, Faster R-CNN and Mask R-CNN still have an accuracy advantage at mAP@0.5, but their parameter counts reach 41.1M and 51.7M respectively, FLOPs exceed 260G, and inference frame rates are only 15 FPS and 12 FPS respectively. In contrast, the method of this invention achieves a more reasonable balance between accuracy and real-time performance with 8.6M parameters and an inference speed of 101 FPS, and has more obvious applicability in resource-constrained engineering deployment scenarios.
[0103] (3) In the single-stage lightweight detector, YOLOv5-LAE only adds 1.4M parameters, which improves mAP@0.5 to 91.67%, which is 3.21 percentage points higher than YOLOv7-tiny (88.46%) and basically on par with YOLOv8s (91.73%). At the same time, FLOPs (18.1G) are also lower than YOLOv8s (28.6G). At the more stringent mAP@0.5:0.95 index, the method of this invention reaches 53.52%, which is 1.80 percentage points higher than the baseline model, indicating that the method still maintains stable detection performance under multiple threshold evaluation.
[0104] In summary, YOLOv5-LAE achieves significant accuracy gains with relatively small parameter increments, making it highly valuable for engineering applications in edge device deployment and real-time remote sensing target detection tasks.
[0105] Table 7 Comparison of AP@0.5 for each target in YOLOv5s and YOLOv5-LAE on the NWPU-VHR-10 dataset.
[0106] Target Category YOLOv5s (baseline) YOLOv5-LAE (Ours) Increase (↑) airplane 85.4 92.3 +6.9 Ships 84.2 90.1 +5.9 oil storage tank 93.3 96.2 +2.9 Baseball field 84.4 93.5 +9.1 tennis court 86.9 90.8 +3.9 basketball court 89.5 92.3 +2.8 Ground track and field 91.3 93.1 +1.8 port 83.6 88.5 +4.9 bridge 87.2 89.4 +2.2 vehicle 82.5 90.5 +8.0 mAP@0.5 86.83 91.67 +4.84
[0107] The baseline model YOLOv5s is limited in its ability to detect small-scale targets such as vehicles and ships. This is mainly due to the multi-level downsampling of the backbone network: as the downsampling layers deepen, the effective response region of small targets in deep feature maps shrinks continuously, resulting in a significant loss of fine-grained spatial information. For categories with complex backgrounds, such as ports and bridges, background activations and target features overlap semantically, weakening the discriminative power of the features. For categories with clear structural boundaries, such as airplanes, baseball fields, and tennis courts, enhancing the spatial location representation in the middle layers helps improve the feature aggregation effect of the target region.
[0108] The improvements made by YOLOv5-LAE are closely related to the targeted design of the hierarchical differentiated attention embedding strategy, which is mainly reflected in the following categories of objectives:
[0109] Small-scale dense targets include vehicles and ships. The C3-ECA module embedded in the shallow P2 layer compensates to some extent for the loss of fine-grained features caused by deep downsampling by dynamically adjusting channel weights. The AP for vehicles increased from 82.5% to 90.5%, an improvement of 8.0 percentage points; the AP for ships increased from 84.2% to 90.1%, an improvement of 5.9 percentage points. This indicates that shallow channel recalibration helps to enhance the relevant response of small targets and improve the recall capability of small-scale targets.
[0110] ② Complex background interference targets include ports and bridges. The C3-ECA module of the deep P5 layer and the independent ECA module of the neck network work together to effectively suppress redundant background activations in the fused feature map. The AP of ports increased from 83.6% to 88.5%, an improvement of 4.9 percentage points; the AP of bridges increased from 87.2% to 89.4%, an increase of 2.2 percentage points from the baseline. This indicates that the cross-layer channel attention mechanism has practical effect in filtering semantic background interference.
[0111] ③ Large targets with already relatively high accuracy include oil storage tanks and athletic fields. Under a relaxed IoU threshold, the improvement in accuracy for these two types of targets is relatively limited (oil storage tanks +2.9 percentage points, athletic fields +1.8 percentage points), but the consistency of bounding boxes under strict localization conditions has improved, reflecting ECA's continuous optimization capability for deep semantic channel discrimination. This indicates that the method also has a certain degree of generalization adaptability to high-precision detection requirements.
[0112] ④ Targets with relatively obvious structural features include airplanes, baseball fields, and tennis courts. The CA module in layer P3 enhances the ability of mid-layer features to express the spatial distribution of target regions through coordinate position modeling. The AP of airplanes increased from 85.4% to 92.3%, an increase of 6.9 percentage points; the AP of baseball fields increased from 84.4% to 93.5%, an increase of 9.1 percentage points; and the AP of tennis courts increased from 86.9% to 90.8%, an increase of 3.9 percentage points. This result indicates that coordinate attention has a certain enhancing effect on categories with relatively clear structural boundaries.
[0113] (4) Ablation test
[0114] To quantitatively analyze the independent contributions of each attention component and their combined synergistic effects, this invention designed a systematic ablation experiment on the NWPU VHR-10 dataset with YOLOv5s as the baseline. The specific scheme is shown in Table 8. The evaluation dimensions cover four indicators: precision (P), recall (R), mAP@0.5, and mAP@0.5:0.95.
[0115] Table 8 Ablation Experiment Setup Scheme
[0116] experimental group Embedding strategy Design Goals Baseline Original YOLOv5s Benchmark performance comparison G1 P2 is replaced with C3-ECA Validating the improvement of ECA in small target detection G2 P3 is replaced with C3-CA Verify CA's improvement in representing obvious targets and spatial location information at structural boundaries. G3 P5 is replaced with C3-ECA Verify the effect of ECA on background noise suppression. G4 Neck network multi-scale feature fusion path insertion independent ECA module Analysis of the optimization effect of multi-scale feature fusion G5 G1+G2 Light and medium layer combination effect G6 G2+G3 Mid-to-deep combination effect G7 G3+G4 The combined effect of deep semantics and Neck fusion path Full Model Combine all improvements from G1 to G4 Comprehensive performance evaluation
[0117] Table 9 Ablation Experiment Results
[0118] experimental group P(%) R(%) mAP@0.5(%) mAP@0.5:0.95(%) Baseline 90.10 81.17 86.83 51.72 G1 88.11 84.63 88.98 51.81 G2 89.86 81.55 89.43 52.42 G3 90.94 80.70 88.69 51.81 G4 87.30 84.79 88.61 52.14 G5 90.71 84.10 90.19 53.17 G6 92.44 78.72 88.91 52.34 G7 92.36 81.74 90.86 52.32 Full 93.91 86.55 91.67 53.52
[0119] The ablation experiment results are shown in Table 9. The performance changes of each group are analyzed as follows:
[0120] Compared to the baseline, G1's overall mAP@0.5 improved from 86.83% to 88.98% (+2.15 percentage points), and its recall improved from 81.17% to 84.63% (+3.46 percentage points). This result indicates that introducing ECA channel attention in the shallow P2 layer enhances the model's response to key texture channels of small targets, while suppressing activation of some background channels, thus improving recall of small-scale, dense targets.
[0121] G2's mAP@0.5 improved to 89.43% (+2.60 percentage points), and its mAP@0.5:0.95 improved to 52.42% (+0.70 percentage points), indicating that introducing CA in layer P3 helps enhance the spatial representation of mid-level features. Compared to G1, G2's recall improvement was smaller, but its overall average precision was higher, suggesting that coordinate attention has a more direct effect on improving the representation of obvious targets at structural boundaries and their spatial locations.
[0122] G3 achieved an mAP@0.5 of 88.69% (+1.86 percentage points) and improved precision to 90.94%, but its recall was slightly lower than the baseline. This indicates that introducing ECA channel attention into the deep P5 layer helps enhance the discriminativeness of category-related semantic channels, but when applied alone to the deep layer, its ability to compensate for details of small targets in the shallow layer is limited.
[0123] G4 improved its mAP@0.5 to 88.61% (+1.78 percentage points) and recall to 84.79% (+3.62 percentage points). This improvement indicates that the ECA module in Neck is more focused on optimizing the information transmission quality during multi-scale feature fusion, possibly filtering out some redundant activations in the feature fusion stages of the FPN and PAN paths to ensure that effective target signals are preserved during cross-scale transmission. Further comparative experiments show that G5 reached 90.19% and G7 reached 90.86%, both higher than their corresponding single-module solutions, indicating a complementary effect between hierarchical attention methods.
[0124] It is noteworthy that the recall of the G6 combination (P3-CA+P5-ECA) dropped to 78.72%, lower than the baseline of 81.17%, but its precision increased to 92.44%. This anomaly suggests that the direct superposition of mid-level coordinate attention and deep channel attention may excessively suppress the diversity of feature responses, causing some small targets with weak semantic responses to be misclassified as background and filtered out, thus increasing the number of missed detections. Although the quality of the retained predicted boxes is high and AP is still improved, coverage is sacrificed. This negative coupling also verifies the necessity of P2-ECA in the Full model: only by introducing shallow detail compensation can the recall be improved to 86.55%, forming a synergistic closed loop of "preserving recall and improving precision".
[0125] The full model ultimately achieved a success rate of 91.67%, validating the overall effectiveness of the joint configuration of P2-ECA, P3-CA, P5-ECA, and Neck-ECA.
[0126] This invention addresses common problems in remote sensing image target detection, such as the easy loss of details in small targets, redundancy in cross-scale fusion, and false alarm interference caused by complex backgrounds. It proposes an improved detection model based on a hierarchical differentiated attention embedding strategy, named YOLOv5-LAE. This method designs a lightweight C3-AEM attention enhancement module, integrating ECA and CA as plug-ins at the end of the C3 residual branch of YOLOv5. Furthermore, based on the receptive field size and semantic abstraction level of different layers, different types of attention modules are configured in the shallow (P2), middle (P3), deep (P5), and neck fusion paths of the backbone network to alleviate the insufficient adaptability problem caused by applying a single attention mechanism to all layers in traditional schemes.
[0127] Experimental results on the NWPU VHR-10 remote sensing dataset show that YOLOv5-LAE, with an increase of 1.4M parameters (from 7.2M to 8.6M), improves mAP@0.5 from 86.83% to 91.67% while maintaining an inference speed of 101 FPS. Ablation experiments further demonstrate that each component plays its role at different levels of the feature pyramid: P2-ECA enhances the channel discriminative power of small-scale dense targets; P3-CA improves the spatial representation of mid-level features; P5-ECA suppresses semantic interference in complex backgrounds at a deeper level; and Neck-ECA improves information transfer during multi-scale feature fusion. Overall, the results preliminarily validate the effectiveness of the hierarchical differential attention embedding strategy.
[0128] The method of this invention still has certain limitations. First, the current model mainly focuses on feature enhancement and hierarchical attention configuration, and has not yet further discussed the specialized modeling problem of targets with more complex geometric shapes. Second, the efficiency of the current model when using sliding window inference on ultra-high resolution remote sensing imagery still has room for improvement. Future work will focus on the following directions: designing a lighter dynamic attention to reduce deployment costs, optimizing the inference process for large-format remote sensing imagery, and migrating the hierarchical embedding strategy of this invention to updated detection frameworks such as YOLOv8 and YOLOv10 to further test the generality and transferability of this strategy.
[0129] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.
Claims
1. A remote sensing target detection method based on hierarchical differential attention embedding, characterized in that, Includes the following steps: S1: Acquire the remote sensing image to be detected; S2: Input the remote sensing image into the improved YOLOv5 target detection network, wherein the improved YOLOv5 target detection network includes a backbone network, a neck network, and a detection head; S3: In the shallow feature layer P2 of the backbone network, a C3-ECA attention enhancement module based on the ECA module is embedded; in the deep feature layer P5 of the backbone network, a C3-ECA attention enhancement module based on the ECA module is embedded. S4: In the middle feature layer P3 of the backbone network, a C3-CA attention enhancement module based on the CA module is embedded; S5: In the multi-scale feature fusion path of the neck network, insert independent ECA modules on the FPN feature pyramid path and the PAN path respectively; S6: Output the detection results of target objects in the remote sensing image through the improved YOLOv5 target detection network. The detection results include target category, confidence score and bounding box position.
2. The remote sensing target detection method based on hierarchical differential attention embedding according to claim 1, characterized in that, The C3-ECA attention enhancement module is configured as follows: the ECA module is embedded as a plug-and-play component at the end of the residual branch of the original YOLOv5 C3 module, the main branch retains its original structure, and the residual branch features enhanced by attention are spliced and fused with the main branch features.
3. The remote sensing target detection method based on hierarchical differential attention embedding according to claim 1, characterized in that, The C3-CA attention enhancement module is configured as follows: the coordinate attention CA module is embedded as a plug-and-play component into the end of the residual branch of the original YOLOv5 C3 module, the main branch retains its original structure, and the residual branch features enhanced by the CA module are channel-joined and fused with the main branch features.
4. The remote sensing target detection method based on hierarchical differential attention embedding according to claim 1, characterized in that, The ECA modules, which are independently inserted into the neck network, act on the top-down FPN feature fusion path and the bottom-up PAN feature aggregation path, respectively, to recalibrate the channel response of multi-scale fused features and enhance the effective information transmission in the cross-scale feature fusion process.
5. The remote sensing target detection method based on hierarchical differential attention embedding according to claim 1, characterized in that, The improved YOLOv5 object detection network retains the original C3 module structure in its middle feature layer P4, which is used to indirectly receive attention enhancement information from layers P3 and P5 through the upsampling and downsampling paths of the feature pyramid.
6. The remote sensing target detection method based on hierarchical differential attention embedding according to claim 1, characterized in that, The hierarchical differentiated attention embedding strategy configures different types of attention enhancement structures for shallow feature layers, middle feature layers, deep feature layers, and neck fusion paths based on the spatial resolution, receptive field size, and semantic abstraction level of different feature layers, so as to improve the accuracy of remote sensing target detection while maintaining real-time inference capabilities.
