Convolutional feature enhancement method and related device based on long-range attention mechanism
By performing point convolution and long-distance attention mechanism enhancement on the original feature map of the image, combined with deep convolution, the problem of reduced image processing speed caused by the increase in the size of the Ghost module is solved, and the feature representation capability and processing speed are improved.
Patent Information
- Application Number
- CN202310254059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-03-09
AI Technical Summary
Existing image feature enhancement methods reduce the image processing speed, especially when using GhostNet and GhostNetV2, the Ghost module becomes larger and the forward inference speed becomes slower.
A convolutional feature enhancement method based on the long-distance attention mechanism is adopted. The intrinsic feature map is obtained by applying point convolution to the original feature map of the image. Then the long-distance attention mechanism and deep convolution are applied for feature enhancement, and finally the target enhanced feature map is obtained.
It improves the image processing speed, enhances the feature representation capability, and avoids the problem of slowing down the forward reasoning speed due to the increase in the size of the Ghost module.
Smart Images

Figure CN116363377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a convolutional feature enhancement method and related devices based on a long-range attention mechanism. Background Art
[0002] GhostNet (Image Feature Enhancement Network) is a lightweight convolutional neural network built for mobile or embedded platforms. The core of GhostNet is the Ghost module (Image Feature Enhancement Module). The Ghost module first uses ordinary convolution (e.g., 1×1 Point-wise Convolution) to generate intrinsic feature maps, and then uses 3×3 depthwise convolution as a cheap linear operation (e.g., 3×3 Depth-wise Convolution) to generate more redundant linear features. As a result, half of the features in the feature map generated by the Ghost module capture spatial information through cheap linear operations, while the remaining half are generated only through 1×1 point-by-point convolution and do not interact with other pixels. This results in a limited ability to capture spatial information, weakens feature representation capabilities, and may hinder further performance improvements. GhostNetV2, an enhanced version of GhostNet, uses a decoupled fully connected layer attention mechanism (DFC attention enhancement module) when constructing the Ghost module to capture long-range spatial dependencies. The DFC attention mechanism in the GhostV2 module acts on the Ghost module, that is, the DFC attention mechanism directly acts on the original feature map input to the Ghost module. Adding the DFC attention mechanism will cause the Ghost module to become larger and the forward reasoning speed to slow down.
[0003] In summary, existing image feature enhancement methods reduce the image processing speed.
[0004] Therefore, the existing technology needs to be improved and enhanced. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a convolutional feature enhancement method and related devices based on a long-range attention mechanism, which solves the problem that existing image feature enhancement methods reduce the image processing speed.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a convolutional feature enhancement method based on a long-range attention mechanism, comprising:
[0008] Applying point convolution to an original feature map of the image to obtain an intrinsic feature map of the original feature map;
[0009] Applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map;
[0010] Applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map;
[0011] A target enhanced feature map of the image is obtained according to the linear enhanced feature map and the intrinsic feature map.
[0012] In one implementation, applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map includes:
[0013] Determine the pooling layer, point convolution layer, horizontal convolution layer, vertical convolution layer, and upsampling layer connected in sequence included in the long-distance attention mechanism;
[0014] Inputting the intrinsic feature map into the pooling layer to obtain the reduced intrinsic feature map output by the pooling layer;
[0015] Inputting the reduced intrinsic feature map into the point convolution layer to obtain a feature map output by the point convolution layer;
[0016] Inputting the feature map output by the point convolution layer into the horizontal convolution layer to obtain a horizontal enhanced feature map output by the horizontal convolution layer;
[0017] Inputting the horizontal enhanced feature map into the vertical convolution layer to obtain the vertical enhanced feature map output by the vertical convolution layer;
[0018] Inputting the vertical enhancement feature map into the upsampling layer to obtain a sampling feature map output by the upsampling layer that matches the resolution of the intrinsic feature map;
[0019] An initial enhanced feature map is obtained according to the sampled feature map and the intrinsic feature map.
[0020] In one implementation, the long-range attention mechanism further includes a normalization layer, and obtaining an initial enhanced feature map based on the sampled feature map and the intrinsic feature map includes:
[0021] Inputting the sampled feature map into the normalization layer to obtain an attention weight value output by the normalization layer, wherein the attention weight value is within a set interval;
[0022] The attention weight value and the intrinsic feature map are multiplied pixel by pixel to obtain an initial enhanced feature map.
[0023] In one implementation, applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map includes:
[0024] Adding the initial enhanced feature map and the intrinsic feature map pixel by pixel to obtain an enhanced feature map after addition;
[0025] The enhanced feature map after addition is subjected to depthwise convolution to obtain a linear enhanced feature map.
[0026] In one implementation, obtaining the target enhancement feature map of the image based on the linear enhancement feature map and the intrinsic feature map includes:
[0027] The linear enhancement feature map and the intrinsic feature map are spliced together to obtain a three-dimensional target enhancement feature map.
[0028] In one implementation, the method further includes:
[0029] Determining the size of the pooling layer according to the original size of the intrinsic feature map;
[0030] The size of the horizontal convolution layer and the size of the vertical convolution layer are determined according to the size of the pooling layer.
[0031] In one implementation, the method further includes:
[0032] Assembling the point convolution, the depth convolution and the connection layer into a feature enhancement module;
[0033] Constructing a feature enhancement network according to a set number of the feature enhancement modules;
[0034] According to the feature enhancement network, a convolutional neural network structure is constructed;
[0035] Image processing is performed based on the convolutional neural network structure.
[0036] In a second aspect, an embodiment of the present invention further provides a convolutional feature enhancement device based on a long-range attention mechanism, wherein the device includes the following components:
[0037] a point convolution module for applying point convolution to an original feature map of an image to obtain an intrinsic feature map of the original feature map;
[0038] a long-range attention mechanism module, configured to apply a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map;
[0039] a depthwise convolution module, configured to apply depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map;
[0040] The enhancement module is used to obtain a target enhancement feature map of the image based on the linear enhancement feature map and the intrinsic feature map.
[0041] In the third aspect, an embodiment of the present invention also provides a terminal device, wherein the terminal device includes a memory, a processor, and a convolution feature enhancement program based on a long-distance attention mechanism stored in the memory and runnable on the processor. When the processor executes the convolution feature enhancement program based on the long-distance attention mechanism, the steps of the above-mentioned convolution feature enhancement method based on the long-distance attention mechanism are implemented.
[0042] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a convolutional feature enhancement program based on a long-distance attention mechanism is stored. When the convolutional feature enhancement program based on a long-distance attention mechanism is executed by a processor, the steps of the above-mentioned convolutional feature enhancement method based on a long-distance attention mechanism are implemented.
[0043] Beneficial effect: The present invention first applies point convolution to the original feature map of the image to obtain the intrinsic feature map of the image (the intrinsic feature map is the feature map after the original feature map is processed using ordinary convolution), and then applies the long-distance attention mechanism (DFC module) to the intrinsic feature map to obtain an initial enhanced feature map. Then, based on the intrinsic feature map, deep convolution is applied to the initial enhanced feature map to further enhance the features of the image and obtain a linear enhanced feature map (the initial enhanced feature map is a feature map enhanced by DFC attention on the intrinsic feature map, wherein the DFC attention enhancement module incorporates contextual information, and the linear enhanced feature map is obtained by performing a linear operation on the initial enhanced feature map plus the intrinsic feature map to improve network performance). Finally, based on the linear enhanced feature map and the intrinsic feature map, the target enhanced feature map of the image is obtained. From the above analysis, the DFC module of the present invention enhances the intrinsic feature map instead of the original feature map of the image, so that the DFC module acts on the outside of the Ghost enhancement module (point convolution and deep convolution constitute the Ghost enhancement module), that is, the DFC module and the Ghost enhancement module constitute a parallel relationship, thereby improving the processing speed of the enhanced image features. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is the overall flow chart of the present invention;
[0045] Figure 2 This is a structural diagram of the Ghost enhancement module and the DFC attention enhancement module in an embodiment of the present invention;
[0046] Figure 3 This is a block diagram of the internal structure of a terminal device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following is a clear and complete description of the technical solutions of the present invention in conjunction with the embodiments and the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0048] Research has found that GhostNet (Image Feature Enhancement Network) is a lightweight convolutional neural network built for mobile or embedded platforms. The core of GhostNet is the Ghost module (Image Feature Enhancement Module). The Ghost module first uses ordinary convolution (such as 1×1 Point-wise Convolution) to generate intrinsic feature maps, and then uses 3×3 depthwise convolution as a cheap linear operation (such as 3×3 Depth-wise Convolution) to generate more redundant linear features. Therefore, half of the features in the feature map generated by the Ghost module capture spatial information through cheap linear operations, while the remaining half are generated only through 1×1 point-by-point convolution and do not interact with other pixels. This results in a limited ability to capture spatial information, weakens feature representation capabilities, and may hinder further performance improvements. GhostNetV2, an enhanced version of GhostNet, uses a decoupled fully connected layer attention mechanism (DFC attention enhancement module) when constructing the Ghost module to capture long-range spatial dependencies. The DFC attention mechanism in the GhostV2 module acts on the Ghost module, that is, the DFC attention mechanism directly acts on the original feature map input to the Ghost module. Adding the DFC attention mechanism will cause the Ghost module to become larger and the forward reasoning speed to slow down.
[0049] To address the above technical issues, the present invention provides a convolutional feature enhancement method and related device based on a long-range attention mechanism, which addresses the problem that existing image feature enhancement methods reduce image processing speed. In specific implementation, point convolution is first applied to the original feature map of the image to obtain an intrinsic feature map of the original feature map. The intrinsic feature map is then enhanced by a long-range attention mechanism to obtain an initial enhanced feature map. Deep convolution is then applied to the initial enhanced feature map and the intrinsic feature map to further enhance the features and obtain a linear enhanced feature map. Finally, based on the linear enhanced feature map and the intrinsic feature map, a target enhanced feature map of the image is obtained.
[0050] Exemplary Methods
[0051] The convolution feature enhancement method based on the long-range attention mechanism of this embodiment can be applied to a terminal device, which can be a terminal product with an image acquisition function, such as a camera. Figure 1As shown in , the convolution feature enhancement method based on the long-range attention mechanism specifically includes the following steps:
[0052] S100, applying point convolution to an original feature map of an image to obtain an intrinsic feature map of the original feature map.
[0053] like Figure 2 As shown, first extract the original feature map of the image (i.e. Figure 2 Input feature map in ), input the original feature map into the point convolution algorithm ( Figure 2 Conv2dBlock1 in ), Conv2dBlock1 outputs the intrinsic feature map x1. In one embodiment, the size of Conv2dBlock1 is 1x1.
[0054] S200, applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map.
[0055] In one embodiment, Figure 2 As shown, the long-distance attention mechanism (DFC attention enhancement module) includes a pooling layer (average pooling layer AvgPool2d), a point convolution layer (Conv2dBlock1), a horizontal convolution layer (DWConldBlock31), a vertical convolution layer (DWConldBlock13), an upsampling layer (UpSampling), and a normalization layer (Sigmoid). In this embodiment, the steps of using the DFC attention enhancement module to enhance image features are as follows S201 to S207:
[0056] S201, input the intrinsic feature map to the pooling layer to obtain the intrinsic feature map after reduction output by the pooling layer.
[0057] In one embodiment, the average pooling operation downsamples the intrinsic feature map x1 to reduce its size. This allows all operations in the DFC attention enhancement module to be performed on the smaller intrinsic feature map x1, thereby increasing the speed at which the DFC attention enhancement module processes the intrinsic feature map. In this embodiment, the size of the average pooling layer is 4, thereby reducing the width and height of the intrinsic feature map to 1 / 4 of their original width and height. In another embodiment, the size of the average pooling layer can be customized based on the actual processing speed requirements of the DFC attention enhancement module.
[0058] S202: Input the reduced intrinsic feature map into the point convolution layer to obtain a feature map output by the point convolution layer.
[0059] Use the point convolution layer of Conv1x1 to reduce the intrinsic feature map x1∈R C×H×WConverted into a feature map that can be recognized by the DFC attention enhancement module.
[0060] S203: Input the feature map output by the point convolution layer to the horizontal convolution layer to obtain a horizontal enhanced feature map output by the horizontal convolution layer.
[0061] In one embodiment, the horizontal convolution layer is a one-dimensional convolution with a convolution kernel size of 1×K h , K h The value of is 3.
[0062] S204: Input the horizontal enhanced feature map to the vertical convolution layer to obtain the vertical enhanced feature map output by the vertical convolution layer.
[0063] In one embodiment, the vertical convolution is a one-dimensional convolution with a convolution kernel size of 1×K w , K w The value of is 3.
[0064] The horizontal and vertical directions refer to the horizontal and vertical directions of the image, respectively. For a rectangular image, the adjacent sides of the image are horizontal and vertical, respectively. This embodiment performs convolution in both the horizontal and vertical directions to decompose the original convolution into separate horizontal and vertical directions, reducing computational complexity.
[0065] S205 , inputting the vertical enhancement feature map into the upsampling layer to obtain a sampling feature map output by the upsampling layer that matches the resolution of the intrinsic feature map.
[0066] The feature maps that have undergone horizontal and vertical convolution are input into the upsampling layer UpSampling. UpSampling uses an upsampling interpolation algorithm to adjust the resolution of the vertical enhanced feature map to the same resolution as the intrinsic feature map.
[0067] S206: Input the sampled feature map into the normalization layer Sigmoid (·) to obtain the attention weight value output by the normalization layer, where the attention weight value is within a set range.
[0068] In one embodiment, Sigmoid(·) normalizes the sampled feature map to (0, 1) to obtain the attention weight value. That is, Sigmoid(·) normalizes the pixel value of each pixel in the sampled feature map to (0, 1).
[0069] S207: Multiply the attention weight value and the intrinsic feature map pixel by pixel to obtain an initial enhanced feature map.
[0070] like Figure 2 As shown in Figure 5, the attention weight value and the intrinsic feature map are multiplied pixel by pixel to obtain the enhanced intrinsic feature map (initial enhanced feature map) output by the DFC attention enhancement module.
[0071] S300 , applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map.
[0072] Step S200: After the intrinsic feature map x1 is enhanced by the DFC module, the enhanced intrinsic feature map is added pixel by pixel with the original intrinsic feature map to obtain the enhanced feature map ( Figure 2 x2 in , and then apply deep convolution (DWCon2dBlock3) to x2. After DWCon2dBlock3 processes x2, it outputs a linear enhanced feature map x3. The obtained x3 has richer feature information than x2.
[0073] S400 , obtaining a target enhancement feature map of the image according to the linear enhancement feature map and the intrinsic feature map.
[0074] like Figure 2 As shown, the linear enhanced feature map x3 and the intrinsic feature map x1 are concatenated using the Concat method to obtain the target enhanced feature map Y. The reason why the target enhanced feature map Y (output feature map) and the intrinsic feature map x1 are concatenated in this embodiment is to ensure that the target enhanced feature map Y maintains the same dimension as the original feature map.
[0075] In one embodiment, the point convolution and depthwise convolution are assembled into a feature enhancement module, and a feature enhancement network is constructed based on a set number of feature enhancement modules. A convolutional neural network structure is constructed based on the feature enhancement network, and image processing is performed based on the convolutional neural network structure. Specifically, different convolutional neural network models adopt an inverted bottleneck design, where two Ghost modules are combined to form a Ghostbottleneck. Ghostbottleneck is then used to construct different convolutional neural network structures for use in visual tasks such as image classification, image segmentation, and object detection.
[0076] In summary, the present invention first applies point convolution to the original feature map of the image to obtain the intrinsic feature map of the image, and then applies the long-distance attention mechanism (DFC module) to the intrinsic feature map to obtain the initial enhanced feature map. After that, based on the intrinsic feature map, the depth convolution is applied to the initial enhanced feature map to further enhance the features of the image and obtain the linear enhanced feature map. Finally, based on the linear enhanced feature map and the intrinsic feature map, the target enhanced feature map of the image is obtained. From the above analysis, the DFC module of the present invention enhances the intrinsic feature map instead of the original feature map of the image, so that the DFC module acts on the outside of the Ghost enhancement module (point convolution and depth convolution constitute the Ghost enhancement module), that is, the DFC module and the Ghost enhancement module constitute a parallel relationship, thereby improving the processing speed of enhancing image features.
[0077] Exemplary devices
[0078] This embodiment also provides a convolutional feature enhancement device based on a long-range attention mechanism, which includes the following components:
[0079] a point convolution module for applying point convolution to an original feature map of an image to obtain an intrinsic feature map of the original feature map;
[0080] a long-range attention mechanism module, configured to apply a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map;
[0081] a depthwise convolution module, configured to apply depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map;
[0082] The enhancement module is used to obtain a target enhancement feature map of the image based on the linear enhancement feature map and the intrinsic feature map.
[0083] Based on the above embodiment, the present invention further provides a terminal device, whose principle block diagram can be shown as follows: Figure 3 As shown. The terminal device includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected via a system bus. The processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a convolution feature enhancement method based on a long-distance attention mechanism is implemented. The display screen of the terminal device can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the terminal device is pre-set inside the terminal device to detect the operating temperature of the internal device.
[0084] Those skilled in the art will understand that Figure 3 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the terminal device to which the solution of the present invention is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0085] In one embodiment, a terminal device is provided. The terminal device includes a memory, a processor, and a convolutional feature enhancement program based on a long-range attention mechanism stored in the memory and executable on the processor. When the processor executes the convolutional feature enhancement program based on the long-range attention mechanism, the following operating instructions are implemented:
[0086] Applying point convolution to an original feature map of the image to obtain an intrinsic feature map of the original feature map;
[0087] Applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map;
[0088] Applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map;
[0089] A target enhanced feature map of the image is obtained according to the linear enhanced feature map and the intrinsic feature map.
[0090] Those skilled in the art will appreciate that all or part of the processes in the above-described embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described embodiments. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A convolutional feature enhancement method based on long-range attention mechanism, characterized in that: include: Applying point convolution to an original feature map of the image to obtain an intrinsic feature map of the original feature map; Applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map; Applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map; Obtaining a target enhanced feature map of the image based on the linear enhanced feature map and the intrinsic feature map; The applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map includes: Determine the pooling layer, point convolution layer, horizontal convolution layer, vertical convolution layer, and upsampling layer connected in sequence included in the long-distance attention mechanism; Inputting the intrinsic feature map into the pooling layer to obtain the reduced intrinsic feature map output by the pooling layer; Inputting the reduced intrinsic feature map into the point convolution layer to obtain a feature map output by the point convolution layer; Inputting the feature map output by the point convolution layer into the horizontal convolution layer to obtain a horizontal enhanced feature map output by the horizontal convolution layer; Inputting the horizontal enhanced feature map into the vertical convolution layer to obtain the vertical enhanced feature map output by the vertical convolution layer; Inputting the vertical enhancement feature map into the upsampling layer to obtain a sampling feature map output by the upsampling layer that matches the resolution of the intrinsic feature map; An initial enhanced feature map is obtained according to the sampled feature map and the intrinsic feature map.
2. The convolution feature enhancement method based on the long-range attention mechanism according to claim 1, characterized in that The long-range attention mechanism further includes a normalization layer, and the initial enhanced feature map is obtained based on the sampled feature map and the intrinsic feature map, including: Inputting the sampled feature map into the normalization layer to obtain an attention weight value output by the normalization layer, wherein the attention weight value is within a set interval; The attention weight value and the intrinsic feature map are multiplied pixel by pixel to obtain an initial enhanced feature map.
3. The convolution feature enhancement method based on the long-range attention mechanism according to claim 1, characterized in that Applying depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map comprises: Adding the initial enhanced feature map and the intrinsic feature map pixel by pixel to obtain an enhanced feature map after addition; The enhanced feature map after addition is subjected to depthwise convolution to obtain a linear enhanced feature map.
4. The convolution feature enhancement method based on the long-range attention mechanism according to claim 1, characterized in that The step of obtaining a target enhanced feature map of the image based on the linear enhanced feature map and the intrinsic feature map includes: The linear enhancement feature map and the intrinsic feature map are spliced together to obtain a three-dimensional target enhancement feature map.
5. The convolution feature enhancement method based on the long-range attention mechanism according to claim 1, characterized in that: Also includes: Determining the size of the pooling layer according to the original size of the intrinsic feature map; The size of the horizontal convolution layer and the size of the vertical convolution layer are determined according to the size of the pooling layer.
6. The convolution feature enhancement method based on the long-range attention mechanism according to claim 1, characterized in that Also includes: Assembling the point convolution, the depth convolution and the connection layer into a feature enhancement module; Constructing a feature enhancement network according to a set number of the feature enhancement modules; According to the feature enhancement network, a convolutional neural network structure is constructed; Image processing is performed based on the convolutional neural network structure.
7. A convolutional feature enhancement device based on a long-range attention mechanism, characterized in that: The device comprises the following components: a point convolution module for applying point convolution to an original feature map of an image to obtain an intrinsic feature map of the original feature map; a long-range attention mechanism module, configured to apply a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map; a depthwise convolution module, configured to apply depthwise convolution to the initial enhanced feature map and the intrinsic feature map to obtain a linear enhanced feature map; an enhancement module, configured to obtain a target enhancement feature map of the image based on the linear enhancement feature map and the intrinsic feature map; The applying a long-range attention mechanism to the intrinsic feature map to obtain an initial enhanced feature map includes: Determine the pooling layer, point convolution layer, horizontal convolution layer, vertical convolution layer, and upsampling layer connected in sequence included in the long-distance attention mechanism; Inputting the intrinsic feature map into the pooling layer to obtain the reduced intrinsic feature map output by the pooling layer; Inputting the reduced intrinsic feature map into the point convolution layer to obtain a feature map output by the point convolution layer; Inputting the feature map output by the point convolution layer into the horizontal convolution layer to obtain a horizontal enhanced feature map output by the horizontal convolution layer; Inputting the horizontal enhanced feature map into the vertical convolution layer to obtain the vertical enhanced feature map output by the vertical convolution layer; Inputting the vertical enhancement feature map into the upsampling layer to obtain a sampling feature map output by the upsampling layer that matches the resolution of the intrinsic feature map; An initial enhanced feature map is obtained according to the sampled feature map and the intrinsic feature map.
8. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a convolutional feature enhancement program based on a long-distance attention mechanism stored in the memory and runnable on the processor. When the processor executes the convolutional feature enhancement program based on the long-distance attention mechanism, the steps of the convolutional feature enhancement method based on the long-distance attention mechanism as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a convolutional feature enhancement program based on a long-distance attention mechanism. When the convolutional feature enhancement program based on a long-distance attention mechanism is executed by a processor, the steps of the convolutional feature enhancement method based on a long-distance attention mechanism as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
An image classification method based on separable convolution and attention mechanism
CN108985317A
Deep learning-based tea leaf identification method and system, and terminal device
CN115375990A