Attention method and device for adaptively fusing multi-scale large kernel features

By constructing an attention method with multi-scale large core features, adaptively fusing attention weights at different scales, the problem of limited feature representation ability in convolutional neural networks is solved, and the accuracy and performance of object detection are improved.

CN120431428AActive Publication Date: 2025-08-05SOUTH CHINA UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510460317.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-08-05
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

Existing convolutional neural networks are difficult to effectively fuse attention weights at different scales in object detection, resulting in limited feature representation ability.

Method used

By constructing multiple large convolution kernel feature extraction branches with different convolution kernel sizes, we adaptively fuse attention weights of different scales to generate fused attention weights, and enhance the image convolution feature representation ability.

Benefits of technology

Effectively integrate multi-scale information, suppress redundant features, and improve target detection accuracy and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431428A_ABST
    Figure CN120431428A_ABST
Patent Text Reader

Abstract

The invention discloses an attention method and device for adaptively fusing multi-scale large kernel features. The method comprises the following steps: constructing a plurality of large convolution kernel feature extraction branches with different convolution kernel sizes, and carrying out multi-scale feature extraction on convolution features of an input image to obtain multi-scale large kernel features; splicing the multi-scale large-kernel features along channel dimensions, and generating an adaptive space selection weight through pooling, convolution and activation function operations; multiplying the adaptive space selection weight of each branch by the large kernel feature of the corresponding branch element by element, and performing fusion to obtain a fusion attention weight; and performing element-by-element multiplication on the fusion attention weight and the input feature to obtain an enhanced feature of the input image. According to the invention, attention weights of different scales are adaptively fused through the attention method, so that multi-scale information is effectively fused, features of a detection target in an input image are enhanced, irrelevant features are inhibited, and target detection performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and particularly relates to an attention method and device for adaptively fusing multi-scale large-kernel features. Background Art

[0002] Convolutional neural networks have been widely applied in fields such as object detection and recognition based on visual perception. The attention mechanism is a simple and efficient method to enhance the representation ability of image convolution features. The traditional attention mechanism can adaptively select and enhance the most relevant feature information by performing weighted operations on convolution features, suppressing redundant or irrelevant features, but it is difficult to effectively capture cross-scale and cross-region feature information in images. The multi-scale attention mechanism generates multi-scale attention weights by designing a multi-scale path structure with different convolution kernel sizes, and can extract features from multiple scales and different receptive fields simultaneously, capturing the image context information in a larger area, thereby improving the feature representation ability of the model. However, the attention weights of different scales are treated equally when fused, resulting in limited feature representation ability of the network. Therefore, adaptively fusing attention weights of different scales can enhance the representation ability of image convolution features and improve the object detection ability of convolutional neural networks. Summary of the Invention

[0003] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and propose an attention method and device for adaptively fusing multi-scale large-kernel features. This method performs multi-scale feature extraction on the convolution features of the input image by constructing multiple large convolution kernel feature extraction branches with different convolution kernel sizes, and adaptively fuses the attention weights of different scales to generate fused attention weights. This technology can effectively fuse multi-scale information, suppress redundant features, enhance the representation ability of image convolution features, and improve the object detection ability of convolutional neural networks.

[0004] To achieve the above first purpose, the present invention proposes an attention method for adaptively fusing multi-scale large-kernel features, and the attention method for fusing multi-scale large-kernel features includes the following steps: S1. Obtain an input feature P, where the input feature P is the convolution feature obtained by an image through a convolutional neural network; S2. Perform a convolution operation on the input feature P, and then use N large convolution kernel feature extraction branches with different convolution kernel sizes in a parallel structure to perform multi-scale feature extraction on the feature output by the convolution operation, obtaining N large-kernel features M0, M1, …, M i 、…, M N-1 , where N is the number of large convolution kernel feature extraction branches, and N≥2; S3. Tensor splice the N large-kernel features of different scales along the channel dimension to obtain a large-kernel multi-scale spliced feature Mall , subsequently, pooling operations, convolutional operations, and activation function operations are performed on the large kernel multi-scale splicing features to obtain the adaptive spatial selection weights W0, W1, …, W of N branches i , …, W N-1 ; S4. Element-wise multiplication is performed between the adaptive spatial selection weights of N branches and all channels of the large kernel features of the corresponding branches to obtain the attention weights WA0, WA1, …, WA of N scales i , …, WA N-1 ; S5. The attention weights of N scales are fused, and convolutional operations are performed on the fusion result to obtain the final fused attention weight W Fuse ; S6. Element-wise multiplication is performed between the fused attention weight W Fuse and the input feature P to obtain the image enhancement feature F, and the image enhancement feature F is used to enhance the features of the detection target in the image and suppress irrelevant features.

[0005] Further, in the step S2, convolutional operations are performed on the input feature P , and then N large convolutional kernel feature extraction branches with a parallel structure are used to perform multi-scale feature extraction on the features output by the convolutional operations to obtain N large kernel features M0, M1, …, M of different scales i , …, M N-1 , and in each of the N large convolutional kernel feature extraction branches, convolutional operations with large convolutional kernels are performed, the convolutional kernel sizes of each branch are different, and the convolutional kernel size of the i-th branch is K i × K i , satisfying: K0 < K1 <... K i <... < K N-1 ; Convolutional operations with different convolutional kernel sizes can extract features of different scales and capture context information in different ranges; Convolutional operations with large convolutional kernels can capture context information in a larger range; Using N large convolutional kernel feature extraction branches with a parallel structure can extract N features of different scales simultaneously; The large kernel feature of the i-th large convolutional kernel feature extraction branch in the step S2 ; Among them, ( ) represents the convolutional operation of the i-th large convolutional kernel feature extraction branch.

[0006] Further, in the step S3, the N large kernel features of different scales are tensor-spliced along the channel dimension to obtain the large kernel multi-scale splicing feature M all, the large kernel multi-scale splicing feature contains large kernel features of different scales; subsequently, max pooling and average pooling operations are respectively performed on the large kernel multi-scale splicing feature along the channel dimension to generate a max pooling result and an average pooling result; the max pooling result and the average pooling result are concatenated along the channel dimension to obtain a large kernel multi-scale pooling feature M pool ; The pooling operation compresses the large kernel multi-scale splicing feature along the channel dimension; different pooling operations can ensure the diversity of the compressed features; subsequently, a convolution operation is performed on the large kernel multi-scale pooling feature , and intermediate features of N branches are output; then, the intermediate features of the N branches are non-linearly activated through an activation function operation to obtain adaptive spatial selection weights W0, W1,..., W i ,..., W N-1 ; The convolution operation has an output channel of N, and each channel corresponds to the intermediate feature of a branch; the activation function operation uses the Sigmoid activation function to generate weights in the interval [0, 1], or uses the Softmax function to perform normalization processing along the channel dimension to generate weights in the interval [0, 1]; the activation function operation limits the values of the adaptive spatial selection weights within the interval of 0 to 1; through the above operations, the adaptive spatial selection weights of N branches are adaptively calculated according to the large kernel features of different scales; Large kernel multi-scale splicing feature ; Large kernel multi-scale pooling feature ; Adaptive spatial selection weight ; Among them, ( ) represents the activation function operation, [ ] represents the tensor concatenation along the channel dimension, ( ) represents the max pooling operation, ( ) represents the average pooling operation.

[0007] Furthermore, the attention weight of the i-th scale in the step S4 ; Among them, the operation symbol represents the element-wise multiplication operation for all channels; the large kernel features of different scales are weighted respectively using the adaptive spatial selection weights of different scales, and the attention weights of different scales are calculated, and the attention weights of different scales can be adaptively generated according to the input features.

[0008] Furthermore, in the step S5, the attention weights of N scales are fused, and the fusion method is element-wise addition, and a convolution operation is performed on the fusion result , to obtain the final fused attention weight , fused attention weights The calculation formula is as follows: Fused attention weights ; By fusing N different-scale attention weights, the fused attention weights can adaptively utilize features of different scales and capture context information in different ranges simultaneously.

[0009] Furthermore, the image enhancement features output in step S6 ; Among them, the operator represents element-wise multiplication operation; the fused attention weights perform weighted operations with different weights on different parts of the input feature P, enhance the feature information of the target, suppress redundant or irrelevant features, and improve the accuracy and performance of target detection.

[0010] Furthermore, the output image enhancement feature F has the same dimension as the input feature P; the attention method for adaptively fusing multi-scale large kernel features can be used as an independent module and integrated into various convolutional neural network structures; Among them, the dimension of the input feature P is C×H×W, and the dimensions of the large kernel features M0, M1, …, M i 、…, M N-1 of N branches are all C×H×W, the dimension of the large kernel multi-scale splicing feature M all is NC×H×W, the dimension of the large kernel multi-scale pooling feature M pool is 2×H×W, the dimensions of the adaptive spatial selection weights W0, W1, …, W i 、…、W N-1 of N branches are 1×H×W, the dimensions of the attention weights WA0, WA1, …, WA i 、…、WA N-1 are C×H×W, the dimension of the fused attention weight W Fuse is C×H×W, and the dimension of the output feature F is C×H×W; where C is the number of input feature channels, H is the height of the input feature, and W is the width of the input feature; the output image enhancement feature F has the same dimension C×H×W as the input feature P.

[0011] To achieve the above second object, the present invention proposes an attention device for adaptively fusing multi-scale large kernel features, which is used to execute the above attention method for adaptively fusing multi-scale large kernel features. The attention device for fusing multi-scale large kernel features includes: A feature input module, which is used to obtain the input feature P, and the input feature P is the convolution feature obtained by the image passing through the convolutional neural network; A multi-scale feature extraction module is used to perform a convolution operation on the input feature P, and then adopt N large convolution kernel feature extraction branches with different convolution kernel sizes in a parallel structure to perform multi-scale feature extraction on the feature output by the convolution operation, obtaining N large kernel features M0, M1, …, M i 、…, M N-1 , where N is the number of large convolution kernel feature extraction branches and N≥2; An adaptive spatial selection weight calculation module is used to perform tensor splicing on the N large kernel features with different scales along the channel dimension to obtain a large kernel multi-scale spliced feature M all . Subsequently, perform pooling operation, convolution operation and activation function operation on the large kernel multi-scale spliced feature to obtain adaptive spatial selection weights W0, W1, …, W i 、…、W N-1 ; An attention weight calculation module is used to perform element-wise multiplication of the adaptive spatial selection weights of N branches with all channels of the large kernel features of the corresponding branches to obtain attention weights WA0, WA1, …, WA i 、…、WA N-1 ; A fused attention weight calculation module is used to fuse the attention weights of N scales and perform a convolution operation on the fusion result to obtain the final fused attention weight W Fuse ; An image enhancement feature calculation module is used to perform element-wise multiplication of the fused attention weight W Fuse with the input feature P to obtain an image enhancement feature F, and the image enhancement feature F is used to enhance the features of the detection target in the image and suppress irrelevant features.

[0012] Compared with the prior art, the present invention has the following advantages and beneficial effects: (1) The present invention proposes an attention method for adaptively fusing multi-scale large kernel features. By calculating the adaptive spatial selection weights of large kernel features of different scales, fusing and generating a fused attention weight, adaptively fusing feature information of different scales, simultaneously capturing context information in different ranges, weighting different parts of the convolutional features of the input image, enhancing the features of the target, effectively enhancing the representation ability of the image convolutional features, and improving the target detection accuracy and performance.

[0013] (2) The attention device for adaptively fusing multi-scale large kernel features proposed by the present invention can be used as an independent module. The input and output of the independent module have the same dimension and can be seamlessly integrated into various convolutional neural network structures, having wide applicability. Description of the Drawings

[0014] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0015] Figure 1 It is a schematic diagram of the attention method for adaptively fusing multi-scale large kernel features disclosed in the present invention; Figure 2 It is a schematic diagram of the lane line detection network model structure of an embodiment of the present invention; Figure 3 It is a schematic diagram of the structure of the large convolution kernel feature extraction branch of an embodiment of the present invention; Figure 4 It is a schematic diagram of the lane line detection result without using the method of the present invention in an embodiment of the present invention; Figure 5 It is a schematic diagram of the lane line detection result using the method of the present invention in Embodiment 2 of the present invention; Figure 6 It is a schematic diagram of the structure of an attention device for adaptively fusing multi-scale large kernel features disclosed in Embodiment 3 of the present invention. Specific embodiments

[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0017] Embodiment 1 This embodiment discloses an attention method for adaptively fusing multi-scale large kernel features applied to lane line detection; in the application of lane line detection, the detection target is the lane line in the image; the lane line detection network is as Figure 2 shown. The lane line detection network uses the CLRNet network as the framework, including a backbone network, a neck network, and a detection head network connected in sequence; the detection head network includes a classification branch and a regression branch connected in parallel; the backbone network, the neck network, and the detection head network all adopt the structure of the CLRNet network. The backbone network uses the ResNet18 network, and the neck network uses the Feature Pyramid Network FPN; the structure of the attention module implemented based on the attention method for adaptively fusing multi-scale large kernel features is as Figure 1As shown, the attention module is inserted in the form of a residual structure between the backbone network and the neck network of the CLRNet network; the output features of the attention module are added to the input features of the attention module and used as the output features of the insertion module to form the residual structure of the attention module, solving the problem of network degradation during network training; the backbone network extracts convolutional features from the input lane line image, enhances the features through the inserted residual structure of the attention module, and then completes the lane line detection task through the neck network and the detection head network, specifically including the following steps: S1. Obtain the input feature P of the attention module, where the input feature P is the convolutional feature obtained by passing the lane line image through the backbone network ResNet18; the dimension of the input feature P is C×H×W, where C is the number of input feature channels, H is the height of the input feature, and W is the width of the input feature; S2. Perform a convolution operation on the input feature P , and then use N large convolutional kernel feature extraction branches in a parallel structure to perform multi-scale feature extraction on the features output by the convolution operation, obtaining N large kernel features M0, M1, …, M i 、…, M N-1 , where each of the N large convolutional kernel feature extraction branches performs a convolution operation with a large convolutional kernel, and the convolutional kernel sizes of each branch are different. The convolutional kernel size of the i-th branch is K i ×K i ; in order to reduce the computational amount and the number of parameters, in this embodiment, the convolutional kernel size of the i-th branch is K i ×K i and is implemented by cascading two mutually perpendicular strip depth convolution operations 、 and a pointwise convolution operation . The strip depth convolution operations and of the i-th branch have convolutional kernel sizes of K i ×1 and 1×K i respectively, and the pointwise convolution operation has a convolutional kernel size of 1×1. In this embodiment, N = 3, K0 = 1, K1 = 7, K2 = 11, and the convolution operation is a depth convolution operation with a convolutional kernel size of 5×5; where the large kernel feature of the i-th large convolutional kernel feature extraction branch; where, ( ) represents the convolution operation of the i-th large convolutional kernel feature extraction branch, and the large kernel scale features M0, M1, …, M i 、…, M N-1All have dimensions of C×H×W; S3. Concatenate the large kernel features of the N different scales along the channel dimension to obtain the large kernel multi-scale concatenated feature M all , M all has dimensions of NC×H×W. Subsequently, perform max pooling and average pooling operations on the large kernel multi-scale concatenated feature along the channel dimension respectively to generate the max pooling result and the average pooling result; concatenate the max pooling result and the average pooling result along the channel dimension to obtain the large kernel multi-scale pooled feature M pool , M pool has dimensions of 2×H×W; subsequently, perform a convolution operation on the large kernel multi-scale pooled feature , output the intermediate features of N branches; then perform non-linear activation on the intermediate features of the N branches through an activation function operation to obtain the adaptive spatial selection weights W0, W1, …, W i , …, W N-1 . The dimensions of the adaptive spatial selection weights of the N branches are all 1×H×W; the convolution operation has an output channel of N, and each channel corresponds to the intermediate feature of a branch; in this embodiment, the convolution operation is a depth convolution operation with a convolution kernel size of 7×7, and the activation function operation uses a Sigmoid activation function to generate weights in the range of [0, 1]; large kernel multi-scale concatenated feature ; large kernel multi-scale pooled feature ; adaptive spatial selection weight ; Among them, represents the Sigmoid activation function operation, represents the tensor concatenation along the channel dimension, represents the max pooling operation, represents the average pooling operation; S4. Multiply each element of the adaptive spatial selection weights of the N branches with all channels of the large kernel features of the corresponding branches to obtain the attention weights WA0, WA1, …, WA i , …, WA N-1 . The dimensions of the attention weights of the N scales are all C×H×W; The attention weight of the i-th scale ; Among them, the operation symbol represents the element-wise multiplication operation for all channels; S5. Fuse the attention weights of the N scales. The fusion method uses element-wise addition, and perform a convolution operation on the fusion result , obtain the final fused attention weight , the fused attention weight W Fuse has a dimension of C×H×W; in this embodiment, the convolution operation is a pointwise convolution operation with a convolution kernel size of 1×1; The fused attention weight ; S6. Multiply the fused attention weight W Fuse element-wise with the input feature P to obtain the image enhancement feature F, and the dimension of the enhancement feature F is C×H×W; the enhancement feature is used to enhance the features of the lane lines in the image and suppress irrelevant features; The enhanced feature output by the attention module ; where the operation symbol ⊙ represents element-wise multiplication operation; In this embodiment, the above-mentioned enhanced feature F is added to the input feature P of the attention module and used as the input of the neck network. Through the classification branch and regression branch of the neck network and the detection head network, the final lane line detection result is obtained; Embodiment 2 Based on Embodiment 1, this embodiment further discloses an attention method for adaptively fusing multi-scale large-kernel features applied to lane line detection; the lane line detection network is as Figure 2 shown. The lane line detection network uses the CLRNet network as the framework, including a backbone network, a neck network, and a detection head network connected in sequence; the detection head network includes a classification branch and a regression branch connected in parallel; the backbone network, the neck network, and the detection head network all adopt the structure of the CLRNet network. The backbone network uses the ResNet18 network, and the neck network uses the Feature Pyramid Network FPN; the structure of the attention module implemented based on the attention method for adaptively fusing multi-scale large-kernel features is as Figure 1 shown. The attention module is inserted between the backbone network and the neck network of the CLRNet network in the form of a residual structure; the output feature of the attention module is added to the input feature of the attention module and used as the output feature of the inserted module, forming the residual structure of the attention module to solve the network degradation problem during network training; the backbone network extracts convolution features from the input lane line image, enhances the features through the inserted residual structure of the attention module, and then completes the lane line detection task through the neck network and the detection head network, which specifically includes the following steps: S1. Obtain the input feature P of the attention module. The dimension of the input feature P is C×H×W, where C is the number of input feature channels, H is the height of the input feature, and W is the width of the input feature. Specifically, refer to step S1 in Embodiment 1; S2. Perform a convolution operation on the input feature P , and then adopt N large convolution kernel feature extraction branches with a parallel structure to perform multi-scale feature extraction on the features output by the convolution operation, obtaining N large kernel features M0, M1, …, M i …, M N-1 , in each of the N large convolution kernel feature extraction branches, a convolution operation with a large convolution kernel is performed, and the convolution kernel sizes of each branch are different. The convolution kernel size of the i-th branch is K i ×K i ; in order to reduce the amount of calculation and the number of parameters, in this embodiment, the convolution operation with the convolution kernel size of K i ×K i of the i-th branch is implemented by two cascaded strip depth convolution operations 、 and a pointwise convolution operation . The convolution kernel sizes of the strip depth convolution operations and of the i-th branch are respectively K i ×1 and 1×K i , and the convolution kernel size of the pointwise convolution operation is 1×1. In this embodiment, N = 4, K0 = 1, K1 = 7, K2 = 11, K3 = 21, and the convolution operation is a depth convolution operation with a convolution kernel size of 5×5; Among them, the large kernel feature of the i-th large convolution kernel feature extraction branch; Among them, ( ) represents the convolution operation of the i-th large convolution kernel feature extraction branch. The dimensions of the large kernel scale features M0, M1, …, M i …, M N-1 of the N branches are all C×H×W; S3. Concatenate the N large kernel features with different scales along the channel dimension to obtain a large kernel multi-scale concatenated feature M all . Subsequently, perform a pooling operation, a convolution operation, and a Sigmoid activation function operation on the large kernel multi-scale concatenated feature to obtain the adaptive spatial selection weights W0, W1, …, W i …, W N-1 of the N branches. Specifically, refer to step S3 in Embodiment 1; S4. Multiply each element of the adaptive spatial selection weights of the N branches with all channels of the large kernel features of the corresponding branches to obtain the attention weights WA0, WA1, …, WA i …, WA N-1 of N scales. Specifically, refer to step S4 in Embodiment 1; S5. Fuse the attention weights of N scales. The fusion method uses element-wise addition, and perform a convolution operation on the fusion result to obtain the final fused attention weight W Fuse , which can be specifically referred to step S5 in Embodiment 1; S6. Multiply the fused attention weight W Fuse element-wise with the input feature P to obtain the image enhancement feature F. The image enhancement feature F is used to enhance the features of the lane lines in the image and suppress irrelevant features, which can be specifically referred to step S6 in Embodiment 1; In this embodiment, the above enhancement feature F is added to the input feature P of the attention module and used as the input of the neck network. Through the classification branch and regression branch of the neck network and the detection head network, the final lane line detection result is obtained; The lane line detection results for the images in the lane line public dataset CULane are as Figure 4 , Figure 5 shown Figure 4 are the detection results of the CLRNet network Figure 5 are the detection results after inserting the attention module residual structure of Embodiment 2 of the present invention into the CLRNet network. From the detection results, it can be seen that Figure 4 the lane lines that could not be detected in Figure 5 can be detected in

[0018] Table 1. Comparison of experimental results of embodiments

[0019] Embodiment 3 As Figure 6 shown, this embodiment provides an attention device for adaptively fusing multi-scale large kernel features. The attention device includes: a feature input module 601, a multi-scale feature extraction module 602, an adaptive spatial selection weight calculation module 603, an attention weight calculation module 604, a fused attention weight calculation module 605, and an image enhancement feature calculation module 606. The specific functions of each module are as follows: The feature input module 601 is used to obtain the input feature P, and the input feature P is the convolution feature obtained by the image through a convolutional neural network; The multi-scale feature extraction module 602 is configured to perform a convolution operation on the input feature P, and then adopt N large convolution kernel feature extraction branches with different convolution kernel sizes in a parallel structure to perform multi-scale feature extraction on the feature output by the convolution operation, obtaining N large kernel features M0, M1, …, M i …, M N-1 , where N is the number of large convolution kernel feature extraction branches and N≥2; The adaptive spatial selection weight calculation module 603 is configured to perform tensor splicing on the N large kernel features of different scales along the channel dimension to obtain a large kernel multi-scale spliced feature M all . Subsequently, perform pooling operation, convolution operation and activation function operation on the large kernel multi-scale spliced feature to obtain adaptive spatial selection weights W0, W1, …, W i …, W N-1 ; The attention weight calculation module 604 is configured to perform element-wise multiplication of the adaptive spatial selection weights of N branches with all channels of the large kernel features of the corresponding branches to obtain attention weights WA0, WA1, …, WA i …, WA N-1 ; The fused attention weight calculation module 605 is configured to fuse the attention weights of N scales and perform a convolution operation on the fusion result to obtain the final fused attention weight W Fuse ; The image enhancement feature calculation module 606 is configured to perform element-wise multiplication of the fused attention weight W Fuse with the input feature P to obtain an image enhancement feature F, and the image enhancement feature F is used to enhance the features of the detection targets in the image and suppress irrelevant features.

[0020] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0021] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.

Claims

1. An attention method that adaptively fuses multi-scale large kernel features, characterized by: The attention method for fusing multi-scale large kernel features includes the following steps: S1. Obtain input feature P, where the input feature P is a convolution feature obtained by passing the image through a convolutional neural network; S2, perform convolution operation on the input feature P, and then use N large convolution kernel feature extraction branches with different convolution kernel sizes in parallel structure to perform multi-scale feature extraction on the features output by the convolution operation, and obtain N large kernel features M0, M1, ..., M i ,…,M N-1 , where N is the number of large convolution kernel feature extraction branches, N ≥ 2; S3, the N large core features of different scales are tensor-joined along the channel dimension to obtain the large core multi-scale stitching feature M all , then perform pooling, convolution and activation function operations on the large-core multi-scale splicing features to obtain the adaptive spatial selection weights W0, W1, ..., W of the N branches i ,…,W N-1 ; S4, multiply the adaptive spatial selection weights of the N branches by all channels of the large core features of the corresponding branches element by element to obtain the attention weights WA0, WA1, ..., WA i ,…,WA N-1 ; S5. Fuse the attention weights of N scales and perform convolution operation on the fusion result to obtain the final fusion attention weight W Fuse ; S6. Fusion attention weight W Fuse The image enhancement feature F is obtained by element-by-element multiplication with the input feature P. The image enhancement feature F is used to enhance the features of the detected target in the image and suppress irrelevant features.

2. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: In step S2, a convolution operation is performed on the input feature P. Then, N large convolution kernel feature extraction branches with parallel structure are used to extract multi-scale features of the features output by the convolution operation, and N large kernel features of different scales M0, M1, ..., M are obtained. i ,…,M N-1 Each of the N large convolution kernel feature extraction branches performs a convolution operation with a large convolution kernel. The size of the convolution kernel of each branch is different. The size of the convolution kernel of the i-th branch is K i ×K i , satisfying: K0 <K1<... K i <... <K N-1 ; The large kernel feature of the i-th large convolution kernel feature extraction branch in step S2 ; in, ( ) represents the convolution operation of the i-th large convolution kernel feature extraction branch.

3. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: In step S3, the N large core features of different scales are tensor-joined along the channel dimension to obtain a large core multi-scale joint feature M all , then perform maximum pooling and average pooling operations on the large core multi-scale splicing features along the channel dimension to generate maximum pooling results and average pooling results; perform tensor splicing on the maximum pooling results and average pooling results along the channel dimension to obtain the large core multi-scale pooling feature M pool ; Then perform convolution operation on the large kernel multi-scale pooling features , output the intermediate features of N branches; Then, the intermediate features of the N branches are nonlinearly activated by the activation function operation to obtain the adaptive spatial selection weights W0, W1, ..., W of the N branches. i ,…,W N-1 ; The convolution operation The output channel of is N, each channel corresponds to the intermediate feature of a branch; the activation function operation uses the Sigmoid activation function to generate a [0, 1] interval weight, or uses the Softmax function to perform normalization along the channel dimension to generate a [0, 1] interval weight; Large kernel multi-scale splicing features ; Large kernel multi-scale pooling features ; Adaptive spatial selection weights ; in, ( ) represents the activation function operation, [ ] represents the tensor concatenation of channel dimensions, ( ) represents the maximum pooling operation, ( ) represents the average pooling operation.

4. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: The attention weight of the i-th scale in step S4 ; The operator symbol indicates that all channels are multiplied element by element.

5. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: In step S5, the attention weights of N scales are fused by element-by-element addition, and a convolution operation is performed on the fusion result. , get the final fusion attention weight , fusion attention weight The calculation formula is as follows: 。 6. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: The image enhancement features output in step S6 ; Among them, the operator symbol Represents element-wise multiplication operation.

7. The attention method for adaptively fusing multi-scale large kernel features according to claim 1, characterized in that: The output image enhancement feature F has the same dimension as the input feature P; Among them, the dimension of the input feature P is C×H×W, and the large core features of N branches M0, M1, ..., M i ,…,M N-1 The dimensions are C×H×W, and the large-core multi-scale splicing feature M all The dimension is NC×H×W, and the large-core multi-scale pooling feature M pool The dimension is 2×H×W, and the adaptive spatial selection weights of the N branches are W0, W1, ..., W i ,…,W N-1 The dimension is 1×H×W, and the attention weights WA0, WA1, ..., WA i ,…,WA N-1 The dimension is C×H×W, and the fusion attention weight W Fuse The dimension of is C×H×W, and the dimension of the output feature F is C×H×W; where C is the number of input feature channels, H is the input feature height, and W is the input feature width.

8. An attention device for adaptively fusing multi-scale large kernel features, used to execute the attention method for adaptively fusing multi-scale large kernel features according to any one of claims 1 to 7, characterized in that: The attention device integrating multi-scale large kernel features includes: A feature input module is used to obtain input features P, where the input features P are convolution features obtained by passing the image through a convolutional neural network; The multi-scale feature extraction module is used to perform convolution operation on the input feature P, and then use N large convolution kernel feature extraction branches with different convolution kernel sizes in a parallel structure to perform multi-scale feature extraction on the features output by the convolution operation to obtain N large kernel features M0, M1, ..., M i ,…,M N-1 , where N is the number of large convolution kernel feature extraction branches, N ≥ 2; The adaptive spatial selection weight calculation module is used to perform tensor splicing on the N large core features of different scales along the channel dimension to obtain the large core multi-scale splicing feature M all , then perform pooling, convolution and activation function operations on the large-core multi-scale splicing features to obtain the adaptive spatial selection weights W0, W1, ..., W of the N branches i ,…,W N-1 ; The attention weight calculation module is used to multiply the adaptive spatial selection weights of N branches by all channels of the large core features of the corresponding branches element by element to obtain the attention weights WA0, WA1, ..., WA i ,…,WA N-1 ; The fusion attention weight calculation module is used to fuse the attention weights of N scales and perform convolution operation on the fusion result to obtain the final fusion attention weight W Fuse ; Image enhancement feature calculation module, used to fuse attention weight W Fuse The image enhancement feature F is obtained by element-by-element multiplication with the input feature P. The image enhancement feature F is used to enhance the features of the detected target in the image and suppress irrelevant features.

Citation Information

Patent Citations

  • Remote sensing image multi-scale target detection method based on large kernel decomposition network

    CN118691797A