Complex scene small target detection system and method based on mask attention and context feature optimization

By integrating the mask attention mechanism and context-aware enhanced feature refining encoder in the small object detection system, the problems of CNN finite receptive field and insufficient detection effect of Deformable DETR in extremely small object are solved, and more efficient feature extraction and detection accuracy are achieved.

CN120219695APending Publication Date: 2025-06-27HANGZHOU VOCATIONAL & TECHN COLLEGE
View PDF 0 Cites 17 Cited by

Patent Information

Application Number
CN202510394766.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing convolutional neural network (CNN) has limited receptive fields and is difficult to capture global context information. The traditional Deformable DETR is insufficient in handling extremely small targets.

Method used

The ResNet50 backbone network using an integrated mask attention mechanism filters out redundant background information through the mask mechanism and outputs the refined multi-scale feature map. Then, multi-branching processing is performed through the context-aware enhanced feature refining encoder, including small-scale convolution, multi-scale convolution and deformable attention, and finally weighted fusion generates a multi-scale fusion feature sequence. This feature sequence is input to the deformable Transformer decoder, and the detection results are generated through the cross attention and self-attention module processing.

Benefits of technology

It significantly improves the detection performance of small targets in complex scenarios, effectively filters out background noise, enhances global context modeling capabilities, and improves feature extraction quality and detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219695A_ABST
    Figure CN120219695A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image target detection, and discloses a complex scene small target detection system and method based on mask attention and context feature optimization, and the system comprises a backbone network integrating a mask attention mechanism, a backbone network in which an original image is input into the integrated mask attention mechanism, and a background network in which the original image is input into the integrated mask attention mechanism. Redundant background information is filtered through a mask mechanism, and a multi-scale feature map is output; the context-aware enhanced feature refining encoder is used for carrying out multi-branch processing on the multi-scale feature map, and finally weighted fusion is carried out to generate a multi-scale fusion feature sequence; and the deformable Transform decoder inputs the multi-scale fusion feature sequence, processes the multi-scale fusion feature sequence through a cross attention and self-attention module, constructs a target query, and generates a detection result containing bounding box coordinates, category labels and confidence scores. According to the method, the performance of small target detection is improved by introducing efficient feature extraction, a fusion mechanism and a sampling and attention strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image target detection, and particularly to a complex-scene small-target detection system and method based on mask attention and context feature optimization. Background Art

[0002] In the field of small-target detection, the small targets significantly affect the detection accuracy due to characteristics such as tiny size and frequent occlusion. On the one hand, small targets usually have a low pixel ratio, which means that they occupy a very limited space in the image and the feature information available for extraction is relatively scarce. On the other hand, small targets are easily interfered by background noise, and the complex background environment may mask the true features of the target, further increasing the difficulty of detection.

[0003] For the small-target detection task, the traditional convolutional neural network (CNN) is difficult to capture global context information due to its limited receptive field. Since context information can help the model better understand the relationship between the target and its surrounding environment, thereby more accurately locating the target, context information is particularly important for small-target detection. However, the local receptive field of CNN limits its ability to integrate global information, resulting in the model being prone to losing important context clues when processing complex scenes.

[0004] In addition, to address this limitation, the end-to-end detector DETR based on Transformer has been proposed. However, the traditional deformable DETR detector also shows obvious deficiencies when dealing with extremely small targets. The deformable DETR enhances the model's adaptability to target deformation by introducing a deformable attention mechanism, but when dealing with extremely small targets that only occupy a few pixels, the design of its sampling points and offsets may not be able to fully capture the feature information of the target. Since the visible part of extremely small targets in the image is very small, the traditional sampling strategy may not cover the key areas of the target, resulting in poor detection effects. Summary of the Invention

[0005] The present invention provides a complex-scene small-target detection system and method based on mask attention and context feature optimization to solve the problem that the existing convolutional neural network (CNN) has a limited receptive field and is difficult to capture global context information, and the traditional Deformable DETR has insufficient detection effects for extremely small targets (such as those occupying a few pixels).

[0006] A complex-scene small-target detection system based on mask attention and context feature optimization provided by the present application includes:

[0007] ResNet50 backbone network integrated with mask attention mechanism. The original image is input into the ResNet50 backbone network integrated with mask attention mechanism. Redundant background information is filtered out through the mask mechanism, and a refined multi-scale feature map is output.

[0008] Context-aware enhanced feature refinement encoder. The multi-scale feature map is processed through multiple branches by the context-aware enhanced feature refinement encoder, including single-scale convolution to capture local details, multi-scale convolution to expand the receptive field, and deformable attention to capture global information. Finally, weighted fusion is performed to generate a multi-scale fusion feature sequence.

[0009] Deformable Transformer decoder. The multi-scale fusion feature sequence is input into the deformable Transformer decoder, processed through cross-attention and self-attention modules, constructs object queries, and generates detection results including bounding box coordinates, class labels, and confidence scores.

[0010] Furthermore, the structure of the ResNet50 backbone network integrated with mask attention mechanism includes:

[0011] Input feature processing module. The input feature processing module is used to process the multi-scale feature map through a standard convolutional layer to obtain a preliminary feature map.

[0012] Feature splitting module. The feature splitting module is used to split the preliminary feature map into three parts along the channel direction for mask generation and attention weight calculation.

[0013] Mask generation module. The mask generation module is used to generate a mask from a part of the split preliminary feature map through a convolutional layer and a Sigmoid activation function.

[0014] Attention weight module. The attention weight module adopts a self-attention mechanism, calculates an attention matrix through the other two parts of the split preliminary feature maps, and performs selective enhancement through the mask to obtain a modulated attention matrix.

[0015] Feature enhancement and residual connection module. The modulated attention matrix is combined with the original image, and through convolutional transformation and residual connection, a multi-scale feature map containing refined global context information and key information of the original input is output.

[0016] Furthermore, the context-aware enhanced feature refinement encoder includes:

[0017] Single-scale convolution branch. The single-scale convolution branch is used to perform single-layer convolution processing on the multi-scale feature map to capture the texture and fine-grained information of the target and generate local detail features.

[0018] A multi-scale convolutional combination branch, which is used to expand the receptive field of the multi-scale feature map through 3×3 convolution, and then combine 1×1 convolution for channel recombination and feature compression to generate global context features;

[0019] A deformable attention branch, which adaptively captures the features of different-scale targets in the multi-scale feature map based on dynamic sampling offsets and attention weights to generate adaptive global features;

[0020] A multi-branch feature fusion module, which is used to perform weighted fusion of local detail features, global context features, and adaptive global features through learnable weights, and combine linear transformation and activation functions to output the final multi-scale fusion feature sequence.

[0021] Furthermore, the deformable Transformer decoder includes:

[0022] A cross-attention module, which is used to integrate the multi-scale features output by the encoder and the target queries of the decoder to obtain adaptively enhanced fine-grained features;

[0023] A self-attention module, which is used to perform global relationship modeling on the target queries of the decoder to obtain consistent and mutually exclusive detection box predictions.

[0024] Furthermore, the deformable Transformer decoder also includes:

[0025] A preprocessing module, which is used to perform positional encoding and flattening on the multi-scale fusion feature sequence to form a feature vector.

[0026] The present invention also proposes a complex scene small target detection system method based on masked attention and context feature optimization. Based on the above system, it includes the following steps:

[0027] S1: Pass the original image through a ResNet50 backbone network integrated with a masked attention mechanism to extract a multi-scale feature map;

[0028] S2: The multi-scale feature map output by the backbone network passes through an encoder for context-aware enhanced feature refinement to obtain a multi-scale fusion feature sequence;

[0029] S3: Input the multi-scale fusion feature sequence into the Transformer decoder, and generate target queries through the cross-attention module and the self-attention module to output the prediction results.

[0030] Furthermore, the S1 step specifically includes:

[0031] S11: After the original image is processed by the convolutional layer, a preliminary feature map is obtained;

[0032] S11: After the original image is processed by the convolutional layer, a preliminary feature map is obtained;

[0033] S12: Split the preliminary feature map into three branches along the channel dimension: query branch F Q , key branch F K , mask generation branch F M ;

[0034] S13: Perform a convolution operation on F M to generate a preliminary mask M, and constrain the mask value to the interval [0, 1] through the Sigmoid activation function;

[0035] Meanwhile, calculate the dot product similarity between F Q and F K , scale it and normalize it through Softmax to obtain the attention matrix A;

[0036] S14: Multiply the mask M and the attention matrix element by element for mask modulation to suppress the response in the background area;

[0037] S15: Use the modulated attention matrix A' to perform weighted summation with the corresponding value feature F V , and perform convolution enhancement on the summation result to obtain the enhanced feature F refine ;

[0038] S16: Add the enhanced feature F refine to the original image, and output the optimized multi-scale feature map through ReLU activation.

[0039] Further, the S2 step specifically includes:

[0040] S21: Process the multi-scale feature map through three parallel branches to obtain three-branch features; the three parallel branches include a small-scale convolution branch, a multi-scale convolution combination branch, and a deformable attention branch;

[0041] S22: Weightedly fuse the three-branch features through learnable weights;

[0042] S23: Perform a fully connected layer mapping on the fusion result to generate the final multi-scale fusion feature sequence.

[0043] Further, the S3 step specifically includes:

[0044] S31: Initialize the target query feature vector based on preset learnable parameters;

[0045] S32: Through the deformable cross-attention module, the target query interacts with the multi-scale fusion features of the encoder, dynamically samples key regions and aggregates them with weights to generate preliminary detection boxes and class predictions;

[0046] S33: Through the deformable self-attention module, model the spatial and semantic dependency relationships between target queries, suppress redundant predictions and improve the global consistency of detection boxes;

[0047] S34: Map the optimized target query through a feed-forward network to obtain the final detection result.

[0048] Beneficial effects achieved by the present invention:

[0049] In the small object detection system for complex scenes based on masked attention and context feature optimization in the present invention, by integrating multiple innovative modules, the detection performance of small objects in complex scenes is significantly improved. First, the system adopts a ResNet50 backbone network integrating a masked attention mechanism. This network effectively filters out redundant background information through the masking mechanism, enhances the global context modeling ability, enables the network to focus on the target area, and ignores irrelevant background noise, thus significantly improving the quality of feature extraction and detection accuracy.

[0050] Secondly, the system introduces a Context-Aware Enhanced Feature Refinement Encoder (CAEFRE). This encoder realizes the effective fusion of multi-scale features through multi-branch processing. Specifically, CAEFRE combines a small-scale convolutional layer, a larger-scale feature extraction branch, and a deformable attention branch, and can capture both the local details of small objects and the context information at a larger scale. This fusion strategy not only improves the adaptability of the model to objects of different sizes, but also significantly improves the detection accuracy of small objects.

[0051] Finally, the system adopts a deformable Transformer decoder. This decoder further improves the overall detection performance through an adaptive attention and sampling mechanism. The deformable Transformer decoder can, while maintaining the integrity of global information, adaptively focus on and sample objects of different scales, which helps the model to more accurately locate objects. Brief Description of the Drawings

[0052] Figure 1 It is a schematic diagram of the system structure of the present invention;

[0053] Figure 2 It is a schematic diagram of the backbone network architecture of the present invention;

[0054] Figure 3 It is a schematic diagram of masked attention image processing of the present invention;

[0055] Figure 4Schematic diagram of the context-aware enhanced feature refinement encoder architecture of the present invention;

[0056] Figure 5 Flowchart of the method of the present invention;

[0057] Figure 6 Flowchart of sub-step S1 of the present invention;

[0058] Figure 7 Flowchart of sub-step S2 of the present invention;

[0059] Figure 8 Flowchart of sub-step S3 of the present invention.

[0060] The accompanying drawings are only for illustrative purposes and should not be construed as limiting the present patent; for better illustration of this embodiment, some components in the accompanying drawings will be omitted, enlarged or reduced, which do not represent the dimensions of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the accompanying drawings may be omitted; the same or similar reference numerals correspond to the same or similar components; the terms describing the positional relationship in the accompanying drawings are only for illustrative purposes and should not be construed as limiting the present patent. Detailed implementation manners

[0061] It should be noted that, without conflict, the embodiments in the present application and the technical features in the embodiments can be combined with each other. The detailed descriptions in the specific embodiments should be understood as explanatory descriptions of the gist of the present application and should not be regarded as an undue limitation of the present application.

[0062] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the present application in detail with reference to the accompanying drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not used to limit the scope of the present application.

[0063] As Figure 1 shown, a complex scene small object detection system based on masked attention and context feature optimization provided in this embodiment includes:

[0064] A ResNet50 backbone network integrated with a Mask Attention mechanism. The original image is input into the ResNet50 backbone network integrated with the Mask Attention mechanism, and redundant background information is filtered out through the mask mechanism to output a refined multi-scale feature map;

[0065] A Context-Aware Enhanced Feature Refinement Encoder (CAEFRE). The multi-scale feature map is processed through multiple branches by the Context-Aware Enhanced Feature Refinement Encoder, including small-scale convolution to capture local details, multi-scale convolution to expand the receptive field, and deformable attention to capture global information, and finally weighted fusion is performed to generate a multi-scale fusion feature sequence;

[0066] The deformable Transformer decoder, with the multi-scale fused feature sequence as input, processes through the Cross-attention and Self-attention modules to construct object queries and generate detection results including bounding box coordinates, class labels, and confidence scores.

[0067] To enhance the global image feature extraction ability of the backbone network, in this embodiment, Mask Attention is integrated into the backbone network as a core component. This component not only improves the backbone network's ability to capture global information but also filters redundant pixel data through the masking mechanism.

[0068] As Figure 5 shown, a method for a complex scene small object detection system based on Mask Attention and context feature optimization, based on the above system, includes the following steps:

[0069] S1: Pass the original image through the ResNet50 backbone network integrated with the Mask Attention mechanism to extract multi-scale feature maps;

[0070] S2: The multi-scale feature maps output by the backbone network pass through the encoder for context-aware enhanced feature refinement to obtain a multi-scale fused feature sequence;

[0071] S3: Input the multi-scale fused feature sequence into the Transformer decoder, and generate object queries through the Cross-attention module and the Self-attention module to output prediction results.

[0072] Specifically, in this embodiment, ResNet50 is used as the benchmark backbone network architecture, and its Basic Block is improved. As Figure 2 shown, after the input data is processed by the convolutional layer, it is split into three independent input sources and fed into the Mask Attention module. After being processed inside the Mask Attention module, a convolutional operation is performed again, and a residual connection (Summation) is performed with the original input, and finally, the output is generated through the ReLU activation function.

[0073] As Figure 6 shown, in the improved ResNet50 Basic Block, first, a convolutional operation is performed on the input feature X to obtain a preliminary feature map:

[0074] F = Conv1(X).

[0075] Subsequently, F is split into three parts along the channel dimension, denoted as FQ , F K and F M . Among them, F Q and F K are used as Query and Key respectively for subsequent calculation of attention weights; F M is used to generate the mask M to selectively enhance features and filter out redundant information.

[0076] (1) Mask generation

[0077] Using the specifically designed convolutional layer of F M , generate the mask M with pixel-level control ability:

[0078] M = σ(Conv mask (F M ))

[0079] where Conv mask is a 1×1 or 3×3 convolution operation; σ(·) is the Sigmoid activation function that maps the output value to the [0,1] interval. This mask will modulate the attention weights in the subsequent process, making the response values in the relevant regions tend to 0 when the input features do not contain the target to be detected, thus playing the role of filtering out redundant backgrounds.

[0080] (2) Attention weight calculation

[0081] Based on F Q , F K adopt a mechanism similar to self-attention to calculate the attention matrix A:

[0082]

[0083] where d is the scaling factor (usually taking the number of channels after splitting) to ensure that the dot product value will not be too large to cause gradient disappearance. Note that the specific arrangement of F Q and F K depends on the implementation details, and the similarity can be calculated in two-dimensional or flattened forms.

[0084] Subsequently, apply the generated mask M to the attention matrix to achieve selective enhancement:

[0085]

[0086] where ⊙ represents element-wise multiplication. Through such modulation, only the attention scores in the target region (where the mask value is close to 1) will be retained, and other regions will be suppressed.

[0087] (3) Feature enhancement and residual connection inside the module

[0088] Use the modulated attention matrix A′ and the corresponding value feature F V (usually can be combined with F K or directly use partial information of the original feature F to form) for weighted combination to obtain the feature F with enhanced attention att :

[0089] F att = A′·F V ,

[0090] where, "·" represents the weighted summation operation (which can be understood as matrix multiplication or per-position weighted aggregation).

[0091] Next, in order to further refine the feature representation, apply a convolutional transformation to F att :

[0092] F refine = Conv2(F att ),

[0093] Finally, perform a residual connection on the feature after passing through the masked attention module and convolutional transformation and the original input X, and then pass through the ReLU activation function to obtain the final output:

[0094] Y = ReLU(F refine + X),

[0095] This residual connection ensures that after introducing the new module, the network can still retain the original information, effectively alleviates the problem of gradient disappearance, and promotes training stability.

[0096] Figure 3 Shows the principle of Mask Attention in image processing. After the input feature data is extracted, Mask Attention performs selective enhancement on the image features. When the input features do not contain the target to be detected, the mask mechanism will remove the irrelevant data, effectively optimizing the feature information extraction and dimensionality reduction process.

[0097] To improve the performance of small target detection, in this embodiment, the deformable attention mechanism (Deformable Attention) is combined with the convolutional layer: on the one hand, the small-scale convolutional layer (Small-scale Convolutions) extracts the local features of tiny pixel targets; on the other hand, the high sensitivity of the convolutional layer to texture information can enhance the capture of texture features of the input image. In addition, the deformable attention mechanism ensures the feature integrity of targets at different scales, thereby enhancing the model stability.

[0098] Such as Figure 4As shown, the image features extracted by the backbone and the neck module are processed in parallel by three information extraction branches: the small-scale convolution branch, the larger-scale feature extraction branch, and the deformable attention branch. Among them, the single-layer convolution layer captures small pixel features, the combination of 3×3 and 1×1 convolutions enhances the larger-scale feature capture ability, and the deformable attention component ensures optimal performance in large pixel regions. Finally, by aggregating the information of these three branches, a new image feature sequence is generated and fed into the decoder.

[0099] As Figure 7 shown, the specific technical details are as follows.

[0100] (1) Three information extraction branches

[0101] ① Small-scale convolution branch

[0102] This branch is mainly used to capture the local texture and detail information of small targets. Given the input feature map f, a single-layer convolution operation is used to obtain local features:

[0103]

[0104] Among them, F s (x, y) represents the feature of the output of the small-scale convolution branch at the position (x, y), which is mainly used to capture local detail information; x, y represent the spatial coordinates of a certain pixel point in the feature map; i, j represent the offsets within the convolution kernel, that is, the row (i) and column (j) indices relative to the current pixel position; K s (i, j) is the weight of the small-scale convolution kernel (1×1) at the offset (i, j); b s is the bias term; σ R (·) is the ReLU activation function.

[0105] ② Larger-scale feature extraction branch

[0106] In order to obtain a larger range of context information, this branch adopts a combination strategy of first 3×3 convolution and then 1×1 convolution:

[0107] First, use 3×3 convolution to expand the receptive field:

[0108]

[0109] Then, use 1×1 convolution for channel recombination and feature compression:

[0110]

[0111] Among them, F 3×3 is the intermediate feature obtained after the 3×3 convolution operation; F lThe features output for large-scale branches are obtained after adjusting the channels through 1×1 convolutions, and are used to integrate richer context information; K 3×3 and b 3×3 represent the weights and bias terms of the 3×3 convolution kernel respectively; K 1×1 and b 1×1 represent the weights and bias terms of the 1×1 convolution kernel respectively.

[0112] This combination not only expands the receptive field of the features, but also effectively integrates context information, making up for the global features that cannot be captured by a single local convolution.

[0113] ③ Deformable attention branch

[0114] To ensure that target features can be adaptively captured within large-scale regions, the deformable attention mechanism in Deformable DETR is referred to. For each query position q, its output is defined as:

[0115]

[0116] where, F d (q) is the output feature of the deformable attention branch at the query position q, which captures global information using dynamic sampling; N is the number of attention heads; K is the number of sampling points within each head; A qmk represents the attention weights of the corresponding sampling points (usually normalized by softmax); W m is the linear mapping matrix; Δp qmk is the learned sampling offset, which allows the module to dynamically adjust the sampling positions; x(·) represents the features sampled at the offset positions.

[0117] This branch enables the model to adaptively focus on and sample targets at different scales while maintaining the integrity of global information.

[0118] (2) Multi-branch feature fusion

[0119] Denote the outputs of the above three branches as F s (small-scale features), F l (larger-scale features) and F d (deformable attention features) respectively, and then adopt a weighted fusion strategy to generate the final feature representation:

[0120] F fusion = σ R (W fusion ·(αF s + βF l + γF d ) + b),

[0121] Among them, α, β, and γ are learnable fusion weights, usually normalized by softmax to ensure that the contributions of each branch to the fusion result are reasonable; W fusion is the linear transformation matrix after fusion; b is the bias term.

[0122] As Figure 8 shown, in this embodiment, the design of the deformable Transformer decoder is based on the Deformable DETR framework, combining the dynamic sampling offset and the multi-scale feature alignment mechanism. The specific implementation steps are as follows:

[0123] 1. Target query initialization

[0124] The decoder initializes a set of learnable target query parameters (Object Queries). Each query is a high-dimensional embedding vector (e.g., dimension d = 256), representing the abstract position and category information of potential targets.

[0125] The number of queries is usually preset to a fixed value (e.g., 100 or 300), covering the maximum number of possible targets in the image.

[0126] Initially, the queries are independent of the input features and their representational capabilities are gradually optimized through training.

[0127] 2. Deformable Cross-Attention module

[0128] The multi-scale fusion feature sequence output by the encoder (the features generated by CAEFRE) and the target queries are input into the cross-attention module. Each target query generates reference point coordinates (such as the center point x, y) through a linear mapping as the initial attention position.

[0129] Each query predicts multiple groups of dynamic offsets and corresponding attention weights. According to each offset, multi-scale features are sparsely sampled around the reference point to calculate the weighted aggregation result.

[0130] The responses in non-target regions are suppressed by the attention weights, strengthening the local features of small targets. Intermediate features related to the target position and category are generated, including the coordinates of the preliminary detection box and the category confidence.

[0131] 3. Deformable Self-Attention module

[0132] The self-attention module acts on the target query features, restricting each query to only focus on other spatially adjacent queries (e.g., within the Euclidean distance threshold) through dynamic proximity constraints. Each query predicts the self-attention sampling offset to sparsify the interaction range and reduce redundant calculations.

[0133] Model the spatial exclusivity (such as avoiding detection box overlap) and semantic relevance (such as category co-occurrence) between queries, and output optimized target query features.

[0134] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments. The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A small target detection system in complex scenes based on mask attention and context feature optimization, characterized by: include: The ResNet50 backbone network with integrated mask attention mechanism inputs the original image into the ResNet50 backbone network with integrated mask attention mechanism, filters out redundant background information through the mask mechanism, and outputs a refined multi-scale feature map; A context-aware enhanced feature refinement encoder, wherein the multi-scale feature map is processed by a context-aware enhanced feature refinement encoder in multiple branches, including small-scale convolution to capture local details, multi-scale convolution to expand the receptive field, and deformable attention to capture global information, and finally weighted fusion to generate a multi-scale fused feature sequence; Deformable Transformer Decoder,The multi-scale fused feature sequence is input into the deformable Transformer decoder,,which is processed by the cross-attention and self-attention modules to construct the,object query and generate the detection results containing the bounding box,coordinates, category labels and confidence scores.

2. The complex scene small target detection system based on mask attention and context feature optimization according to claim 1 is characterized in that: The structure of the ResNet50 backbone network with integrated mask attention mechanism includes: An input feature processing module, wherein the input feature processing module is used to process the multi-scale feature map through a standard convolution layer to obtain a preliminary feature map; A feature splitting module, which is used to split the preliminary feature map into three parts along the channel direction for mask generation and attention weight calculation; A mask generation module, wherein the mask generation module is used to generate a mask from a portion of the split preliminary feature maps through a convolution layer and a Sigmoid activation function; An attention weight module, wherein the attention weight module adopts a self-attention mechanism, calculates an attention matrix through preliminary feature maps split from the other two parts, and selectively enhances the attention matrix through masks to obtain a modulated attention matrix; The feature enhancement and residual connection module combines the modulated attention matrix with the original image, and outputs a multi-scale feature map containing refined global context information and key information of the original input through convolution transformation and residual connection.

3. The complex scene small target detection system based on mask attention and context feature optimization according to claim 1 is characterized in that: The context-aware enhanced feature refining encoder comprises: A small-scale convolution branch, which is used to perform a single-layer convolution process on the multi-scale feature map, capture the texture and fine-grained information of the target, and generate local detail features; A multi-scale convolution combination branch, which is used to expand the receptive field of the multi-scale feature map through 3×3 convolution, and then combine it with 1×1 convolution to perform channel reorganization and feature compression to generate global context features; A deformable attention branch, which adaptively captures features of objects of different scales in a multi-scale feature map based on a dynamic sampling offset and an attention weight, and generates an adaptive global feature; The multi-branch feature fusion module is used to perform weighted fusion of local detail features, global context features, and adaptive global features through learnable weights, and output a final multi-scale fusion feature sequence by combining linear transformation and activation function.

4. The complex scene small target detection system based on mask attention and context feature optimization according to claim 1, characterized in that: The deformable Transformer decoder comprises: A cross-attention module, which is used to integrate the multi-scale features output by the encoder with the target query of the decoder to obtain adaptively enhanced fine-grained features; A self-attention module is used to perform global relationship modeling on the decoder's target query to obtain consistent and mutually exclusive detection box predictions.

5. The complex scene small target detection system based on mask attention and context feature optimization according to claim 4 is characterized in that: The deformable Transformer decoder also includes: The preprocessing module is used to perform position encoding and flattening on the multi-scale fusion feature sequence to form a feature vector.

6. A method for detecting small targets in complex scenes based on mask attention and context feature optimization, based on the system described in any one of claims 1 to 5, characterized in that: The following steps are involved: S1: The original image is passed through a ResNet50 backbone network with a masked attention mechanism to extract multi-scale feature maps; S2: The multi-scale feature map output by the backbone network is refined through the context-aware enhanced feature encoder to obtain a multi-scale fused feature sequence; S3: The multi-scale fused feature sequence is input into the Transformer decoder, and the target query is generated through the cross-attention module and the self-attention module to output the prediction result.

7. The complex scene small target detection system method based on mask attention and context feature optimization according to claim 6 is characterized in that: The S1 step specifically includes: S11: After the original image is processed by the convolution layer, a preliminary feature map is obtained; S12: Split the preliminary feature map into three branches along the channel dimension: query branch F Q , key branch F K , mask generation branch F M ; S13: F M Perform convolution operation to generate a preliminary mask M, and constrain the mask value to the [0,1] interval through the Sigmoid activation function; At the same time, calculate F Q With F K The dot product similarity is scaled and normalized by Softmax to obtain the attention matrix A; S14: Multiply the mask M by the attention matrix element by element to perform mask modulation to suppress the response of the background area; S15: Use the modulated attention matrix A′ and the corresponding value feature F V Weighted summation is performed, and convolution enhancement is performed on the summation result to obtain the enhanced feature F refine ; S16: Enhance feature F refine Add it to the original image and output the optimized multi-scale feature map through ReLU activation.

8. The complex scene small target detection system method based on mask attention and context feature optimization according to claim 6 is characterized in that: The S2 step specifically includes: S21: Processing the multi-scale feature map through three parallel branches to obtain three-way branch features; the three parallel branches include a small-scale convolution branch, a multi-scale convolution combination branch and a deformable attention branch; S22: weighted fusion of three-way branch features through learnable weights; S23: Perform full connection layer mapping on the fusion result to generate the final multi-scale fusion feature sequence.

9. The complex scene small target detection system method based on mask attention and context feature optimization according to claim 6 is characterized in that: The S3 step specifically includes: S31: Initializing a target query feature vector based on preset learnable parameters; S32: Through the deformable cross attention module, the target query interacts with the encoder's multi-scale fusion features, dynamically samples key areas and weighted aggregates them to generate preliminary detection boxes and category predictions; S33: Modeling spatial and semantic dependencies between target queries through deformable self-attention modules, suppressing redundant predictions and improving global consistency of detection boxes; S34: Map the optimized target query to the final detection result through the feedforward network.

Citation Information

Cited By

  • Perception optimization video coding quantization parameter prediction method based on attention mechanism

    CN120416478A

  • Image processing method based on non-uniform sampling and scale adaptive supervision

    CN120765459A

  • Infrared weak and small target detection network under complex background based on multi-level feature combination

    CN120852794A

  • Traffic monitoring video rapid target extraction method for edge device

    CN120953871A

  • An edge device-oriented traffic monitoring video fast target extraction method

    CN120953871B