Feature hierarchical attention fusion and dynamic optimization method for single-stage target detection
By constructing a hierarchical attention fusion and dynamic optimization network (HAF-DRNet), the problems of insufficient autonomous optimization of feature extraction paths and cross-level interaction in single-stage object detection algorithms are solved, improving the accuracy and flexibility of object detection, and making it suitable for citrus maturity detection in the field of agricultural detection.
Patent Information
- Application Number
- CN202510870927.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-11-14
AI Technical Summary
Existing single-stage object detection algorithms cannot autonomously optimize feature extraction paths based on the characteristics of the input dataset, such as varying target scale and background complexity. This leads to missed detection of small targets and misjudgment in complex scenarios, resulting in a lack of flexibility and difficulty in meeting the needs of practical applications.
A hierarchical attention fusion and dynamic optimization network (HAF-DRNet) is constructed. By adaptively adjusting the attention weights of feature maps at different levels, it can accurately capture key information and effectively suppress irrelevant information, thereby improving the flexibility and accuracy of the model.
It improves the accuracy and flexibility of target detection, especially the target positioning accuracy in complex scenarios, and adapts to changing detection needs.
Smart Images

Figure CN120953787A_ABST
Abstract
Description
(I) Technical Field
[0001] This invention relates to a feature-level attention fusion and dynamic optimization method for single-stage object detection, applicable to single-stage object detection and recognition algorithms, and belonging to the fields of computer vision and agricultural and industrial inspection. (II) Technical Background
[0002] In the cutting-edge research field of image processing and computer vision, object detection technology, as a core research topic, has become a key technological support for many critical application areas due to its ability to accurately identify and locate specific target objects in complex scenes. It has wide applications in smart agriculture, smart healthcare, and industrial inspection. For single-stage object detection, its core task is to efficiently and accurately detect target objects of interest in static images or dynamic videos.
[0003] Currently, algorithms such as YOLO, SSD, and RetinaNet are widely used in many fields. However, most of these existing single-stage object detection algorithms use fixed network structures to extract image features. On the one hand, they cannot autonomously optimize the feature extraction path based on the varying target scale and background complexity of the input dataset. On the other hand, the cross-layer interaction between shallow details and deep semantics is insufficient, leading to missed detections of small targets and misjudgments in complex scenes. This results in models that can only achieve high accuracy for specific tasks, lacking flexibility and failing to meet the diverse detection needs of practical applications. To address this issue, a feature-hierarchical attention fusion and dynamic optimization method for single-stage object detection is proposed, aiming to overcome the shortcomings of the existing YOLO12 algorithm network architecture and improve the flexibility and accuracy of single-stage object detection. (III) Summary of the Invention
[0004] This invention addresses key issues in single-stage object detection using YOLOv12: the inability to autonomously optimize feature extraction paths based on varying target scales and background complexity in the input dataset, and insufficient cross-level interaction between shallow details and deep semantics, leading to missed detections of small targets and misjudgments in complex scenes. By constructing a Hierarchical Attention Fusion with Dynamic Refinement Network (HAF-DRNet), the invention optimizes the model's accuracy in locating targets in complex scenes and adaptively adjusts the attention weights of feature maps at different levels. This achieves accurate capture of key information and effective suppression of irrelevant information, providing technical support for practical applications of object detection.
[0005] The maturity detection of citrus fruits in the field of agricultural testing is used as an example to support the experimental data of this invention.
[0006] Step 1: Collect image data of citrus fruits at different stages of maturity, preprocess the image data, and divide the dataset into training set, test set, and validation set according to the proportions.
[0007] Step 2: Based on YOLO12 as the baseline model, retain the original backbone network and detection head, and improve the feature fusion part in the neck network structure to HAF-DRFPN, so that the model can detect small targets more accurately.
[0008] Step 3: Input the dataset for training, and finally obtain the HAF-DRNet model with improved neck network.
[0009] Furthermore, in step one, considering issues such as the quality of the dataset images, the images are preprocessed to meet the requirements of the input model, and the dataset is randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0010] Furthermore, in step two, a 640×640 resolution image is input into the model, and the convolutional layer expression is:
[0011] y = σ(W*x + b)
[0012] Where y is the output, W is the convolution kernel, x is the input, b is the bias, σ is the activation function, and * represents the convolution operation.
[0013] The input RGB citrus image is passed through layer zero, which converts the number of channels of the input image to 64 channels, and performs feature extraction and downsampling on the image through convolution operations with a kernel size of 3 and a stride of 2.
[0014] The first layer continues to perform convolution operations on the feature map.
[0015] With a kernel size of 3 and a stride of 2, the number of channels in the feature map increases from 64 to 128. The spatial size of the feature map decreases while the number of channels increases, thus enhancing the feature representation capability.
[0016] The second layer, C3k2, consists of a CSP structure containing three convolutional residual blocks, which enhances the input feature map and expands the channels to 256.
[0017] Then, a third Conv layer is used for downsampling to further reduce the spatial resolution of the feature map, while expanding the number of channels to 512 to extract higher-level semantic features.
[0018] The fourth layer performs convolution operations while maintaining the number of channels at 512. Through four convolutions, the relationships between features are further explored in depth, enhancing the expressive power of the features.
[0019] The fifth layer Conv performs a fourth downsampling, outputting a feature map with 512 channels and a resolution of 1 / 16.
[0020] The feature map is processed by the sixth layer A2C2f enhanced feature extraction module, which combines the Area-Attention mechanism of Transformer and the multi-layer perception mechanism, and combines shallow detail features and deep semantic features.
[0021] The input feature map is given, and the fused feature map Y can be represented as:
[0022] Y = α·X1 + β·X2
[0023] Here, α and β are weights determined by learning parameters through an attention mechanism.
[0024] The seventh convolutional layer has a kernel size of 3 and a stride of 2, increasing the number of channels in the feature map from 512 to 1024.
[0025] This layer downsamples the feature map again, further reducing the spatial resolution of the feature map, while increasing the number of channels to extract higher-level semantic features.
[0026] The eighth layer A2C2f module has 1024 input channels, a kernel size of 3, and repeats the convolution operation 4 times.
[0027] After a series of operations in the eight convolutional blocks of the backbone network, the processed feature map is fed into the neck network HAF-DRFPN.
[0028] In the neck network, the feature maps are first dynamically sampled through the ninth layer's lightweight dynamic upsampling module, DyUpsample, to adjust the spatial size of the feature maps. The core formula of DyUpsample is as follows:
[0029]
[0030] in These are the static range factor and dynamic range factor of the input feature map, respectively.
[0031] Subsequently, the tenth-layer multi-feature fusion modulation module (MFM) fuses feature maps from different layers, making it easier to characterize the various properties of the target object.
[0032] MFM generates attention weights through global average pooling (GAP), multilayer perceptron (MLP), and softmax processing, and then fuses different feature information by combining convolutional layers (Conv) and feature connection layers (Concat). The expression for MFM is as follows:
[0033]
[0034] Layers 11, 14, and 17 use a Feature Refinement Feed-forward Network (FRFN) to improve the Area-Attention mechanism of A2C2f.
[0035] FRFN employs enhancement and simplification schemes to eliminate feature redundancy in feature map channels, thereby enhancing the recovery of sharp latent images. The depthwise convolution expression involved is as follows:
[0036]
[0037] in This represents the spatial convolution operation.
[0038] Then, after upsampling at the twelfth layer, the shallow information from the fifth layer and the twelfth layer are used together as input and output to the thirteenth layer.
[0039] The feature maps MFM at different levels are connected together to form a feature map containing multi-scale information, including local details and global semantic information.
[0040] The data is then sent to the A2C2f-FRFN module at the fourteenth layer to refine the features and remove irrelevant background information with 256 channels.
[0041] The fifteenth Conv layer has a kernel size of 3 and a stride of 2, increasing the number of channels from 256 to 512.
[0042] The feature map is downsampled, and the number of channels is increased to extract higher-level features.
[0043] The sixteenth layer MFM fuses and modulates the outputs of the fifteenth and fourth layers with a channel count of 512.
[0044] The seventeenth-layer A2C2f-FRFN module further refines the output of the previous layer, optimizing the quality of the features.
[0045] The eighteenth layer performs downsampling, halves the feature map space size, expands the number of channels from 512 to 1024, and extracts higher-level semantic features.
[0046] The nineteenth layer integrates the local details and global semantic information of the eighteenth and eighth layers, which is the high-level feature fusion of 512 channels.
[0047] The twentieth layer's C3k2 residual connection convolutional block enhances high-level features with 1024 input channels by enabling shortcut connections, extracting more complex feature patterns.
[0048] For a shortcut mapping of the same dimension, adding F(x) to x is simply adding element-wise, as shown in the following expression:
[0049] y=F(x,W i F = W2σ(W1x) + x
[0050] Different dimension mappings require x to be mapped to match the dimension, as shown in the following expression:
[0051] y=F(x,W i )+W s x,F=W2σ(W1x)
[0052] The PSFM module in layer 21 performs deep semantic fusion based on cross-attention using feature map information from layers 6 and 17. Its core expression is:
[0053]
[0054] in Representing deep image features, Representing shallow image features, For the final output features, and For attention weight matrix, and For value features, Reshape is the dimension reshaping operation.
[0055] The PSFM module achieves dual-input feature fusion through a dual-branch dense layer, a projection layer, feature concatenation, and convolution.
[0056] The SDFM module in layer 22 performs shallow detail information fusion based on channel and spatial attention mechanisms on the feature map information of layers 8 and 20. Its core expression is:
[0057]
[0058] in Representing deep image features, Representing shallow image features, PwConv n GAP represents n-layer point convolution, and GAP represents global average pooling. This is the enhanced shallow feature for the final output.
[0059]
[0060] in Representing deep image features, Representing shallow image features, PwConv n GAP represents n-layer point convolution, and GAP represents global average pooling. This is the enhanced deep feature output.
[0061]
[0062] Indicates fusion weights, This is the final output feature.
[0063] The SDFM module processes the input feature map through pointwise convolution, global average pooling, and the Sigmoid function to achieve feature weighting and fusion.
[0064] The 23rd layer's Dynamic Scale Sequence Feature Fusion (DySSFF) module dynamically adjusts the feature map processing method according to the target's scale changes, generating feature maps of different scales for dynamic adjustment.
[0065] The input to the 23rd layer consists of feature map information from the 4th, 6th, and 8th layers at different scales and with different numbers of channels, and the output is a feature map with 256 channels.
[0066] The DySSFF module consists of dynamic upsampling and desequence, three layers stacked at different scales, 3D convolution, batch normalization, and SiLU activation function. The core component is the stacking of multi-branch dynamic upsampling, expressed as:
[0067]
[0068] The output of the 23rd layer is concatenated with the 14th layer, which also has 256 channels. The refined features of the shallow layer are combined with the features of dynamic sequence fusion to enhance the reusability of the features.
[0069] The feature information processed by SDFM, PSFM, and Add will enter the YOLO12 detector head decoder.
[0070] The YOLO12 detector head processes the input feature map information through convolutional layers and a loss optimization function module to predict the bounding boxes and maturity categories of citrus fruits. These feature maps are used to calculate the bounding box loss (Bbox_loss) and the classification loss (Cls.Loss). The expressions for Bbox_loss and Cls_loss are as follows:
[0071] L bbox =SmoothL1Loss(y pred ,y true )
[0072] L cls =CrossEntropyLoss(y pred ,y true)
[0073] Among them, L bbox It is the bounding box loss, L cls It is classification loss, y pred It is the predicted value, y true It is the actual value.
[0074] SmoothL1Loss is a hybrid loss function that combines mean squared error and mean absolute error.
[0075] CrossEntropyLoss is a loss function that evaluates model performance by measuring the difference between the probability distribution of the model's output and the true labels.
[0076] These two loss functions optimize the target's location and category prediction, respectively, to generate accurate target detection results.
[0077] The ultimate goal of the model is to achieve recognition functionality.
[0078] This method improves the feature representation capability of the feature map for object detection and increases the accuracy of object detection. (iv) Description of the attached drawings
[0079] Figure 1 This is a flowchart of the method of the present invention;
[0080] Figure 2 This is a diagram of the HAF-DRNet network framework; (V) Detailed Implementation
[0081] The purpose of this invention is to address the problems of the single-object detection algorithm YOLO12, which cannot autonomously optimize feature extraction paths based on the varying target scale and background complexity of the input dataset, and lacks cross-level interaction between shallow details and deep semantics, resulting in missed detection of small targets and misjudgment in complex scenes. This invention provides a hierarchical attention fusion and dynamic optimization algorithm architecture, HAF-DRNet, for single-stage object detection. This model optimizes the accuracy of target localization in complex scenes by adaptively adjusting the attention weights of feature maps at different levels, thereby achieving accurate capture of key information and effective suppression of irrelevant information, providing technical support for practical applications of object detection.
[0082] Step 1: Collect image data from specific agricultural and industrial application scenarios (taking citrus maturity detection in the field of agricultural testing as an example), preprocess the image data, and divide the dataset into training set, test set, and validation set according to the proportion.
[0083] Step 2: Based on YOLO12 as the baseline model, retain the original backbone network and detection head, and improve the feature fusion part in the neck network structure to HAF-DRFPN, so that the model can detect small targets more accurately.
[0084] Step 3: Input the dataset for training, and finally obtain the HAF-DRNet model with improved neck network.
[0085] Furthermore, in step one, considering issues such as the quality of the dataset images, the images are preprocessed to meet the requirements of the input model, and the dataset is randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0086] Furthermore, in step two, a 640×640 resolution image is input into the model, and the convolutional layer expression is:
[0087] y = σ(W*x + b)
[0088] Where y is the output, W is the convolution kernel, x is the input, b is the bias, σ is the activation function, and * represents the convolution operation.
[0089] The input RGB citrus image is passed through layer zero, which converts the number of channels of the input image to 64 channels, and performs feature extraction and downsampling on the image through convolution operations with a kernel size of 3 and a stride of 2.
[0090] The first layer continues to perform convolution operations on the feature map.
[0091] With a kernel size of 3 and a stride of 2, the number of channels in the feature map increases from 64 to 128. The spatial size of the feature map decreases while the number of channels increases, thus enhancing the feature representation capability.
[0092] The second layer, C3k2, consists of a CSP structure containing three convolutional residual blocks, which enhances the input feature map and expands the channels to 256.
[0093] Then, a third Conv layer is used for downsampling to further reduce the spatial resolution of the feature map, while expanding the number of channels to 512 to extract higher-level semantic features.
[0094] The fourth layer performs convolution operations while maintaining the number of channels at 512. Through four convolutions, the relationships between features are further explored in depth, enhancing the expressive power of the features.
[0095] The fifth layer Conv performs a fourth downsampling, outputting a feature map with 512 channels and a resolution of 1 / 16.
[0096] The feature map is processed by the sixth layer A2C2f enhanced feature extraction module, which combines the Area-Attention mechanism of Transformer and the multi-layer perception mechanism, and combines shallow detail features and deep semantic features.
[0097] The input feature map is given, and the fused feature map Y can be represented as:
[0098] Y = α·X1 + β·X2
[0099] Here, α and β are weights determined by learning parameters through an attention mechanism.
[0100] The seventh convolutional layer has a kernel size of 3 and a stride of 2, increasing the number of channels in the feature map from 512 to 1024.
[0101] This layer downsamples the feature map again, further reducing the spatial resolution of the feature map, while increasing the number of channels to extract higher-level semantic features.
[0102] The eighth layer A2C2f module has 1024 input channels, a kernel size of 3, and repeats the convolution operation 4 times.
[0103] After a series of operations in the eight convolutional blocks of the backbone network, the processed feature map is fed into the neck network HAF-DRFPN.
[0104] In the neck network, the feature maps are first dynamically sampled through the ninth layer's lightweight dynamic upsampling module, DyUpsample, to adjust the spatial size of the feature maps. The core formula of DyUpsample is as follows:
[0105]
[0106] in These are the static range factor and dynamic range factor of the input feature map, respectively.
[0107] Subsequently, the tenth-layer multi-feature fusion modulation module (MFM) fuses feature maps from different layers, making it easier to characterize the various properties of the target object.
[0108] MFM generates attention weights through global average pooling (GAP), multilayer perceptron (MLP), and softmax processing, and then fuses different feature information by combining convolutional layers (Conv) and feature connection layers (Concat). The expression for MFM is as follows:
[0109]
[0110] Layers 11, 14, and 17 use a Feature Refinement Feed-forward Network (FRFN) to improve the Area-Attention mechanism of A2C2f.
[0111] FRFN employs enhancement and simplification schemes to eliminate feature redundancy in feature map channels, thereby enhancing the recovery of sharp latent images. The depthwise convolution expression involved is as follows:
[0112]
[0113] in This represents the spatial convolution operation.
[0114] Then, after upsampling at the twelfth layer, the shallow information from the fifth layer and the twelfth layer are used together as input and output to the thirteenth layer.
[0115] The feature maps MFM at different levels are connected together to form a feature map containing multi-scale information, including local details and global semantic information.
[0116] The data is then sent to the A2C2f-FRFN module at the fourteenth layer to refine the features and remove irrelevant background information with 256 channels.
[0117] The fifteenth Conv layer has a kernel size of 3 and a stride of 2, increasing the number of channels from 256 to 512.
[0118] The feature map is downsampled, and the number of channels is increased to extract higher-level features.
[0119] The sixteenth layer MFM fuses and modulates the outputs of the fifteenth and fourth layers with a channel count of 512.
[0120] The seventeenth-layer A2C2f-FRFN module further refines the output of the previous layer, optimizing the quality of the features.
[0121] The eighteenth layer performs downsampling, halves the feature map space size, expands the number of channels from 512 to 1024, and extracts higher-level semantic features.
[0122] The nineteenth layer integrates the local details and global semantic information of the eighteenth and eighth layers, which is the high-level feature fusion of 512 channels.
[0123] The twentieth layer's C3k2 residual connection convolutional block enhances high-level features with 1024 input channels by enabling shortcut connections, extracting more complex feature patterns.
[0124] For a shortcut mapping of the same dimension, adding F(x) to x is simply adding element-wise, as shown in the following expression:
[0125] y=F(x,W i F = W2σ(W1x) + x
[0126] Different dimension mappings require x to be mapped to match the dimension, as shown in the following expression:
[0127] y=F(x,W i )+W s x,F=W2σ(W1x)
[0128] The PSFM module in layer 21 performs deep semantic fusion based on cross-attention using feature map information from layers 6 and 17. Its core expression is:
[0129]
[0130] in Representing deep image features, Representing shallow image features, For the final output features, and For attention weight matrix, and For value features, Reshape is the dimension reshaping operation.
[0131] The PSFM module achieves dual-input feature fusion through a dual-branch dense layer, a projection layer, feature concatenation, and convolution.
[0132] The SDFM module in layer 22 performs shallow detail information fusion based on channel and spatial attention mechanisms on the feature map information of layers 8 and 20. Its core expression is:
[0133]
[0134] in Representing deep image features, Representing shallow image features, PwConv n GAP represents n-layer point convolution, and GAP represents global average pooling. This is the enhanced shallow feature for the final output.
[0135]
[0136] in Representing deep image features, Representing shallow image features, PwConv n GAP represents n-layer point convolution, and GAP represents global average pooling. This is the enhanced deep feature output.
[0137]
[0138] Indicates fusion weights, This is the final output feature.
[0139] The SDFM module processes the input feature map through pointwise convolution, global average pooling, and the Sigmoid function to achieve feature weighting and fusion.
[0140] The 23rd layer's Dynamic Scale Sequence Feature Fusion (DySSFF) module dynamically adjusts the feature map processing method according to the target's scale changes, generating feature maps of different scales for dynamic adjustment.
[0141] The input to the 23rd layer consists of feature map information from the 4th, 6th, and 8th layers at different scales and with different numbers of channels, and the output is a feature map with 256 channels.
[0142] The DySSFF module consists of dynamic upsampling and desequence, three layers stacked at different scales, 3D convolution, batch normalization, and SiLU activation function. The core component is the stacking of multi-branch dynamic upsampling, expressed as:
[0143]
[0144] The output of the 23rd layer is concatenated with the 14th layer, which also has 256 channels. The refined features of the shallow layer are combined with the features of dynamic sequence fusion to enhance the reusability of the features.
[0145] The feature information processed by SDFM, PSFM, and Add will enter the YOLO12 detector head decoder.
[0146] The YOLO12 detector head processes the input feature map information through convolutional layers and a loss optimization function module to predict the bounding boxes and maturity categories of citrus fruits. These feature maps are used to calculate the bounding box loss (Bbox_loss) and the classification loss (Cls.Loss). The expressions for Bbox_loss and Cls_loss are as follows:
[0147] L bbox =SmoothL1Loss(y pred ,y true )
[0148] L cls =CrossEntropyLoss(y pred ,y true)
[0149] Among them, L bbox It is the bounding box loss, L cls It is classification loss, y pred It is the predicted value, y true It is the actual value.
[0150] SmoothL1Loss is a hybrid loss function that combines mean squared error and mean absolute error.
[0151] CrossEntropyLoss is a loss function that evaluates model performance by measuring the difference between the probability distribution of the model's output and the true labels.
[0152] These two loss functions optimize the target's location and category prediction, respectively, to generate accurate target detection results.
[0153] The ultimate goal of the model is to achieve recognition functionality.
[0154] This method improves the feature representation capability of the feature map for object detection and increases the accuracy of object detection.
[0155] The experimental environment and settings for this invention are as follows: The experimental system is Windows 11, equipped with an NVIDIA GeForce RTX 3060 graphics card, and runs on the Ultralytics 8.3.9 + Python-3.10.16torch-2.2.1 + cu121 deep learning framework. The training hyperparameters are as follows: the optimizer is stochastic gradient descent (SGD), using a linear decay learning rate adjustment strategy; other hyperparameters are at their default values; the batch size is 32; and the number of epochs is 200. The validation dataset uses a citrus maturity detection dataset as an example, with 2814 images in the training set, 805 images in the test set, and 1609 images in the validation set, divided into three categories: immature, half-mature, and mature.
[0156] Table 1 shows the comparative experimental results of the target detection model before and after the improvement.
[0157] As can be seen from the experimental results in Table 1, the model proposed in this invention, after passing through the HAF-DRNet network, significantly improves the detection accuracy on the agricultural citrus maturity detection dataset compared to the traditional YOLO12 model. The accuracy increases from 82.12% to 86.20%, an improvement of approximately 4.97%, resulting in a substantial enhancement in recognition accuracy. The mean accuracy (mAP0.5) increases from 82.42% to 82.33%, with the mean accuracy remaining almost unchanged. The mean accuracy (mAP0.75) increases from 67.71% to 68.35%, an improvement of approximately 0.95%. The mean accuracy (mAP0.5-0.95) also increases from 60.84% to 61.38%, an increase of approximately 0.89%.
[0158] The model of this invention has a significant improvement in detection accuracy, making it more suitable for application scenarios with high accuracy requirements compared to the original YOLO12 model.
[0159] In summary, this method improves the feature representation capability of the feature map in object detection and increases the accuracy of object detection.
[0160] Table 1 shows the comparative experimental results of the target detection model before and after the improvement.
[0161] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A feature-hierarchical attention fusion and dynamic optimization method for single-stage object detection. Its characteristics are: Includes the following steps: Step 1: Collect image data and build a dataset. Preprocess the image data to expand the dataset, and divide the dataset into training set, test set and validation set according to the proportion. Step 2: Using YOLO12 as the baseline model, connect the YOLO12 backbone network, HAF-DRFPN neck network, and the output layer of the YOLO12 detection head in sequence to obtain the HAF-DRNet object detection model. Step 3: Input the training set obtained by preprocessing in Step 1 into the HAF-DRNet object detection model for training. After training, the HAF-DRNet model file is obtained. Then, the model file is validated and compared with the training model evaluation metrics through the test set. Step 4: In the actual application scenario, use a camera device to acquire real-time images of the target, call the trained HAF-DRNet target detection model, and obtain the target's classification category, location information, and result confidence.
2. The feature-hierarchical attention fusion and dynamic optimization method according to claim 1, characterized in that, The specific content of step 2 is as follows: Step 2-1: In the neck network, DyUpsample constructs an upsampler by taking the sampling angle of a single pixel, gradually restoring the feature resolution lost by the downsampling feature extraction of the convolutional layer; Step 2-2: Linearly project the features into this module to generate a dynamic range factor for each pixel. Combined with a static range factor, this further enhances the flexibility of the input feature offset, achieving dynamic upsampling optimization. The formula used is: in These are the static range factor and dynamic range factor of the input feature map, respectively, and the activation function is sigmoid; Steps 2-3: The attention mechanism of the enhanced feature extraction module A2C2f is improved by using the Feature Refinement Feedforward Network (FRFN). This dynamically enhances label features and suppresses background noise through a gated residual mechanism. Furthermore, depthwise separable convolutions are used to further extract feature information. The formula for the depthwise convolution involved is as follows: Where reshape is the dimension reshaping operation. Indicates spatial convolution operation; Steps 2-4: The Feature Modulation Module (MFM) is used to perform adaptive selection and weighted fusion of the extracted features at different scales, further enhancing feature interaction and thus improving feature representation capabilities. The multilayer perceptron formula involved is as follows: MLP(x)=σ(W mlp x+b mlp ) Among them W mlp For the weight matrix, b mlp The bias is x, the activation function is σ (i.e., the sigmoid function), and the input is x. Furthermore, the feature modulation fusion formula is: in, and For input features; Steps 2-5: After feature extraction and fusion processing at different levels, the shallow information of the feature maps is fed to the SDFM module. The SDFM module fuses the shallow details of the feature maps based on channel and spatial attention mechanisms. Finally, the SDFM module outputs the final feature map to the detection head. The pointwise convolution calculation formula is as follows: Steps 2-6: Deep information is fed into the PSFM module. The PSFM module uses cross-attention-based deep semantic fusion, employing a dual-branch dense layer, projection layer, feature concatenation, and convolution to achieve dual-input feature fusion. Its core expression is: in Representing deep image features, Representing shallow image features, For the final output features, and Attention weight matrix, and For value features, Reshape is the dimension reshaping operation; Steps 2-7: The multi-level features extracted by downsampling from the backbone network are fed into the DySSFF dynamic scale sequence feature fusion module. Through a multi-branch dynamic sampling stacking architecture, adaptive fusion of cross-scale features is achieved. The formula for the dynamic upsampling solution sequence is as follows: Where F i The input features are (i∈{4,6,8}), i corresponds to features at different levels, φ is the dynamic weight set, and kernel is the kernel. k It is the upsampling convolution kernel of the k-th branch; Steps 2-8: The HAF-DRFPN neck network in the HAF-DRNet network consists of sixteen modules: four MFM modules, three A2C2f-FRFN modules, two DyUpsample modules, two Conv modules, one SDFM module, one PSFM module, one C3k2 module, one DySSFF module, and one Add module.
Citation Information
Cited By
Cross-scale image bridging decoupling target detection method based on dynamic adjacency
CN121236369A
Cell real-time detection method and device based on improved YOLOv12 and storage medium
CN121685440A
