A global feature enhancement method, device, equipment and readable storage medium
By combining a global feature enhancement module and a self-attention layer, the problem of insufficient global feature information extraction in deep networks is solved, improving the model's ability to recognize objects at the edge of images and its computational efficiency.
Patent Information
- Application Number
- CN202410857297.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Existing feature extraction models cannot fully acquire global feature information in deep networks, resulting in insufficient ability of the models to identify objects at the edge of images in industrial inspection.
By introducing a global feature enhancement module, the feature map group is fused from top to bottom and from bottom to top using a self-attention layer. Combined with channel concatenation and convolution operations, the global feature extraction capability is enhanced.
It improves the model's ability to acquire global feature information and its computational efficiency, enhances its ability to recognize objects at the edge of images, and improves the accuracy of semantic segmentation.
Smart Images

Figure CN118537576B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and in particular to a global feature enhancement method, apparatus, device, and readable storage medium. Background Technology
[0002] In deep networks, the size of the receptive field roughly reflects the contextual information that a deep learning model can acquire. Although theoretically, the receptive field of existing feature extraction models is larger than the image size, in practice, the receptive field is much smaller. This causes many models to fail to fully integrate contextual information, limiting their expressive power. In practical industrial inspection projects, it is found that semantic segmentation models focus more on objects in the image center while ignoring objects at the image edges. This is because the model's receptive field does not fully cover the entire image, failing to acquire more global feature information.
[0003] Therefore, current feature extraction models suffer from insufficient extraction of global feature information. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a global feature enhancement method, apparatus, device and readable storage medium, which solves the technical problem of insufficient extraction of global feature information in the prior art.
[0005] To address the aforementioned technical problems, this invention provides a global feature enhancement method, comprising:
[0006] The feature map set output by the feature extraction network is input into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map set;
[0007] The feature map set output by the feature extraction network is input into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map set, and the bottom path is used for global average pooling layer operations on the feature map set, and the pooling window size of the intermediate path and the bottom path gradually increases.
[0008] After pooling the intermediate path and the bottom path, the size is transformed using an upsampling layer to obtain data with the same size as the integrated data image.
[0009] The data in the intermediate and bottom paths after size transformation are processed using a self-attention layer, and the integrated data and the data processed by the self-attention layer are integrated using a channel splicing layer and a convolutional layer to obtain the target global augmentation data.
[0010] Optionally, the window size of the multiple paths corresponding to the intermediate path is 2*(k+N)+1; where k is an even number, k>=2, and N gradually increases.
[0011] Optionally, the integration of the integrated data and the data processed by the self-attention layer using the channel splicing layer and convolutional layer to obtain the target global augmentation data includes:
[0012] The integrated data and the data processed by the self-attention layer are integrated using the channel splicing layer, and cross-channel interaction and information integration are performed using a 1*1 convolutional layer to obtain the target global augmented data.
[0013] Optionally, the process of using a self-attention layer to process the data in the sized intermediate path and the bottom path includes:
[0014] The self-attention layer is used to perform top-down and bottom-up feature fusion processing on the data in the intermediate path and the bottom path after size transformation; wherein, the top-down refers to the process from the initial path of the intermediate path to the bottom path, and the bottom-up refers to the process from the bottom path to the top path.
[0015] Optionally, there are three intermediate paths: the top path is designated as path 1, the corresponding paths of the intermediate paths are path 2, path 3 and path 4, and the bottom path is designated as path 5.
[0016] Optionally, the step of using the self-attention layer to perform top-down and bottom-up feature fusion processing on the data in the size-transformed intermediate path and bottom path includes:
[0017] The data from path 2 is pooled and upsampled before being fed into the self-attention layer 1 for global feature extraction. The output data from the self-attention layer 1 is then fed into path 7 and path 8 respectively.
[0018] The data from path 8 and path 9 are fused, and the fused data is fed into self-attention layer 2 for calculation. The output data of self-attention layer 2 is fed into path 9 and path 10 respectively; path 24 is the data from path 3 after pooling and upsampling.
[0019] The data from path 10 and path 11 are fused, and the fused data is fed into self-attention layer 3 for calculation. The output data of self-attention layer 3 is fed into path 12 and path 13 respectively. Path 11 is the data from path 4 after pooling and upsampling.
[0020] The data from path 13 and path 14 are fused, and the fused data is fed into self-attention layer 4 for calculation. The output data of self-attention layer 4 is fed into path 15 and path 16 respectively, and the data from path 15 is fed into channel splicing layer; path 14 is the data from path 5 after pooling and upsampling.
[0021] The data from path 16 and path 12 are merged, and the merged result is sent to path 18 and path 17. The result from path 17 is sent to the channel splicing layer.
[0022] The data from path 18 and path 9 are merged, and the merged result is sent to path 19 and path 20. The result from path 19 is sent to the channel splicing layer.
[0023] The data from path 20 and path 7 are merged, and the merged result is sent to paths 21 and 22. The result from path 21 is sent to the channel splicing layer.
[0024] The data from path 22 and path 6 are merged, and the merged data from path 23 is sent to the channel splicing layer; path 6 is the data obtained from path 1 after pooling.
[0025] Optionally, the size of the convolution window corresponding to the top path is 1*1.
[0026] This application also provides a global feature enhancement device, including:
[0027] The top path processing module is used to input the feature map group output by the feature extraction network into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map group.
[0028] The intermediate path and bottom path processing modules are used to input the feature map group output by the feature extraction network into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map group, and the bottom path is used for global average pooling layer operations on the feature map group, and the pooling window size of the intermediate path and the bottom path gradually increases.
[0029] The upsampling module is used to perform size transformation on the intermediate path and the bottom path after pooling, and then use the upsampling layer to obtain data with the same size as the integrated data image.
[0030] A self-attention layer processing module is used to process the data in the intermediate path and the bottom path after size transformation, and a channel splicing layer and a convolutional layer are used to integrate the integrated data and the data processed by the self-attention layer to obtain the target global augmentation data.
[0031] This application also provides a global feature enhancement device, including:
[0032] Memory, used to store computer programs;
[0033] A processor is used to implement the steps of the global feature enhancement method described above when executing the computer program.
[0034] This application also provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the global feature enhancement method described above.
[0035] As can be seen, this invention processes the feature map group output by the feature extraction network into the top path of the global feature enhancement module to obtain integrated data. The top path is used to perform convolution operations on the feature map group. The feature map group output by the feature extraction network is then processed into the middle and bottom paths of the global feature enhancement module. The middle path includes multiple paths for pooling operations on the feature map group, and the bottom path is used for global average pooling operations on the feature map group. The pooling window sizes of the middle and bottom paths gradually increase. After pooling processing in the middle and bottom paths, upsampling layers are used to perform size transformations to obtain data with the same size as the integrated data image. A self-attention layer is used to process the data in the size-transformed middle and bottom paths, and a channel concatenation layer and a convolutional layer are used to integrate the integrated data and the data processed by the self-attention layer to obtain the target global enhanced data. This application introduces a self-attention layer, which better captures global feature information by leveraging the long-distance dependency capture capability of self-attention. Furthermore, this capability is enhanced at each layer through deep aggregation (layer-by-layer stacking of self-attention data), thereby improving the sufficiency of global feature information extraction.
[0036] In addition, the present invention also provides a global feature enhancement device, apparatus, and readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1 A flowchart illustrating a global feature enhancement method provided in an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the overall structure of a visual inspection task provided in an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the overall structure of a global feature enhancement method provided in an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the structure of a self-attention layer provided in an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of the structure of a global feature enhancement device provided in an embodiment of the present invention;
[0043] Figure 6 This is a schematic diagram of a global feature enhancement device provided in an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] Some terms that appear in the description of the embodiments of this application are subject to the following interpretation:
[0046] Global features: Global features refer to the overall attributes of an image. Common global features include color features, texture features, and shape features, such as intensity histograms. Because they are low-level visual features at the pixel level, global features have good invariance, are computationally simple, and are intuitively represented. However, their high feature dimensionality and computational cost are their fatal weaknesses. Furthermore, global feature descriptions are not suitable for images with aliasing or occlusion. Local features, on the other hand, are features extracted from local regions of an image, including edges, corners, lines, curves, and regions with special attributes. Common local feature descriptions include two main categories: corner-based and region-based descriptions.
[0047] Self-attention primarily introduces weights based on pairwise relationships. At both the channel and spatial levels, it strengthens the connections between pairs of data by calculating the values between channels and between pixels, thereby improving the accuracy of semantic segmentation.
[0048] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a global feature enhancement method provided in an embodiment of the present invention. The method may include:
[0049] S101, the feature map group output by the feature extraction network is input into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map group.
[0050] The execution subject of this embodiment is an electronic device. The feature extraction network in this embodiment is a network layer used for feature extraction, and it is a prior art feature extraction network. This application mainly improves upon all feature enhancement modules. In this embodiment, the top path refers to inputting the feature map group into the top path for convolution. The integrated data in this embodiment refers to the data after convolution through the top path. This embodiment does not limit the specific window size corresponding to the top path, as long as it is smaller than the middle and bottom paths.
[0051] It should be further noted that, in order to improve the efficiency of top path processing, the convolution window size corresponding to the top path is 1*1. In this embodiment, the convolution window size corresponding to the top path is 1*1, which allows for only one interaction, thus improving the efficiency of top path processing.
[0052] It should be further explained that, in order to improve the efficiency of information integration, the above-mentioned integration of the integrated data and the data processed by the self-attention layer using the channel splicing layer and convolutional layer to obtain the target global augmented data may include: integrating the integrated data and the data processed by the self-attention layer using the channel splicing layer, and using a 1*1 convolutional layer for cross-channel interaction and information integration to obtain the target global augmented data. This embodiment uses a 1*1 convolutional layer for cross-channel interaction and information integration to obtain the target global augmented data. Since a 1*1 convolutional layer represents a single data interaction, it can improve the efficiency of information integration.
[0053] S102, the feature map group output by the feature extraction network is input into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map group, and the bottom path is used for global average pooling layer operations on the feature map group, and the pooling window size of the intermediate path and the bottom path gradually increases.
[0054] The intermediate path in this embodiment may include multiple paths. This embodiment does not limit the specific number of paths included in the intermediate path. For example, the intermediate path may include two paths; or the intermediate path in this embodiment may include three paths. The pooling window of the intermediate path in this embodiment gradually increases from small to large.
[0055] It should be further explained that, in order to improve the receptive field of the model, the window size of the multiple paths corresponding to the above intermediate paths is 2*(k+N)+1; where k is an even number, k>=2, and N gradually increases. The window size in this embodiment refers to the pooling window size. This embodiment does not limit the specific window size of each path in the intermediate path. For example, the intermediate paths in this embodiment can be 2*(k+1)+1, 2*(k+2)+1, and 2*(k+3)+1 from left to right; or the intermediate paths in this embodiment can be 2*(k+1)+1, 2*(k+3)+1, and 2*(k+5)+1 from left to right. This embodiment shows the rule for increasing the pooling window to improve the receptive field of the model.
[0056] S103 After pooling the middle and bottom paths, the size is transformed using the upsampling layer to obtain data with the same size as the integrated data image.
[0057] S104 uses a self-attention layer to process the data in the intermediate and bottom paths after size transformation, and uses a channel splicing layer and a convolutional layer to integrate the integrated data and the data processed by the self-attention layer to obtain the target global augmentation data.
[0058] This embodiment utilizes a self-attention layer to process data in the intermediate and bottom paths after size transformation. This embodiment is not limited to the specific process of using a self-attention layer. For example, this embodiment can use a self-attention layer to perform top-down feature fusion processing on the data processed by the top, intermediate, and bottom paths; or this embodiment can also use a self-attention layer to perform bottom-up feature fusion processing on the data processed by the top, intermediate, and bottom paths; or this embodiment can also use a self-attention layer to perform both top-down and bottom-up feature fusion processing on the data processed by the top, intermediate, and bottom paths.
[0059] It should be further explained that, in order to improve the accuracy of global feature extraction, the above-mentioned processing of the data in the intermediate path and the bottom path after size transformation using a self-attention layer may include: using a self-attention layer to perform top-down and bottom-up feature fusion processing on the data in the intermediate path and the bottom path after size transformation; wherein, top-down refers to from the initial path of the intermediate path to the bottom path, and bottom-up refers to from the bottom path to the top path. This embodiment, by performing data flow in a top-down and bottom-up manner, can make full use of the data redundancy of the feature map group, mine potential feature information that is helpful to the current task, and provide the information mining capability of the global feature enhancement module.
[0060] It should be further explained that, in order to improve the processing efficiency of intermediate paths, there are three intermediate paths: the top path is designated as path 1, the corresponding intermediate paths are path 2, path 3, and path 4, and the bottom path is designated as path 5. It is understandable that, through experiments, having three intermediate paths allows for comprehensive mining of global features with high efficiency, thus improving the processing efficiency of intermediate paths.
[0061] It should be further explained that, in order to improve the accuracy of top-down and bottom-up feature fusion, the above-mentioned top-down and bottom-up feature fusion processing using a self-attention layer on the data in the intermediate and bottom paths after size transformation can include: pooling and upsampling the data from path 2 before feeding it into self-attention layer 1 for global feature extraction; the output data from self-attention layer 1 is then fed into paths 7 and 8 respectively; feature fusion is performed on the data from path 8 and path 9, and the fused data is fed into self-attention layer 2 for calculation; the output data from self-attention layer 2 is then fed into paths 9 and 10 respectively; path 24 consists of pooled and upsampled data from path 3; feature fusion is performed on the data from path 10 and path 11, and the fused data is fed into self-attention layer 3 for calculation; the output data from self-attention layer 3 is then fed into paths 12 and 13 respectively; path 11 consists of pooled and upsampled data from path 4; and the output data from path 13 is fed into self-attention layer 1 for global feature extraction. The data from path 14 and path 16 are fused, and the fused data is fed into the self-attention layer 4 for calculation. The output data of the self-attention layer 4 is fed into path 15 and path 16 respectively, and the data from path 15 is fed into the channel splicing layer. Path 14 is the data from path 5 after pooling and upsampling. The data from path 16 and path 12 are fused, and the fused result is fed into path 18 and path 17. The result of path 17 is fed into the channel splicing layer. The data from path 18 and path 9 are fused, and the fused result is fed into path 19 and path 20. The result of path 19 is fed into the channel splicing layer. The data from path 20 and path 7 are fused, and the fused result is fed into path 21 and path 22. The result of path 21 is fed into the channel splicing layer. The data from path 22 and path 6 are fused, and the fused data from path 23 is fed into the channel splicing layer. Path 6 is the data obtained from path 1 after pooling. This embodiment improves the accuracy of top-down and bottom-up feature fusion by providing specific feature fusion methods for top-down and bottom-up approaches.
[0062] This invention provides a global feature enhancement method, which may include: S101, inputting the feature map group output by the feature extraction network into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map group; S102, inputting the feature map group output by the feature extraction network into the middle path and bottom path of the global feature enhancement module for processing; wherein, the middle path includes multiple paths for pooling operation on the feature map group, and the bottom path is used for global average pooling layer operation on the feature map group, and the pooling window size of the middle path and the bottom path gradually increases; S103, after the pooling processing of the middle path and the bottom path is completed, upsampling layers are used to perform size transformation to obtain data with the same size as the integrated data image; S104, using a self-attention layer to process the data in the middle path and the bottom path after size transformation, and using a channel splicing layer and a convolutional layer to integrate the integrated data and the data processed by the self-attention layer to obtain target global enhanced data. This application introduces a self-attention layer, leveraging its long-distance dependency capture capability to better acquire global feature information. This capability is further enhanced at each layer through deep aggregation (layer-by-layer stacking of self-attention data), improving the sufficiency of global feature information extraction. Furthermore, the top path's convolutional window size is 1*1, requiring only one interaction, thus improving top path processing efficiency. The embodiment also provides a pattern for increasing the pooling window size, improving the effectiveness of intermediate paths in processing feature map data. Moreover, the top-down and bottom-up data flow fully utilizes the redundancy of feature map data, mining potential features helpful to the current task, providing information mining capabilities for the global feature enhancement module. Setting three intermediate paths allows for comprehensive and efficient mining of global features, improving intermediate path processing effectiveness. Finally, the embodiment improves the accuracy of top-down and bottom-up feature fusion by providing specific top-down and bottom-up feature fusion methods.
[0063] For a clearer understanding of this invention, please refer to the following details. Figure 2 , Figure 2This is a schematic diagram of the overall structure of a visual detection task provided by an embodiment of the present invention. Specifically, it can include four parts: input, a feature extraction network, a global feature enhancement module, and output. The global feature enhancement method is only one component of the entire visual task (such as object detection, semantic segmentation), and it is mainly connected after the feature extraction network (such as ResNet deep residual network, DenseNet dense connection network, and VGGNet ultra-deep convolutional network for large model recognition). The input of this module is the feature map set obtained by the feature extraction network. Specifically, this invention is a... Figure 1 The global feature enhancement module operates without involving the input, feature extraction network, or output.
[0064] The overall structure of the global feature enhancement module of the present invention is as follows: Figure 3 As shown, Figure 3 This is a schematic diagram of the overall structure of a global feature enhancement method provided in an embodiment of the present invention. This method is an improvement upon the SPPNet (object detection) spatial pyramid pooling method, introducing a self-attention mechanism and top-up and top-down data flow methods. It mainly includes the following steps:
[0065] Step 1: Obtain the feature map set output by the feature extraction network;
[0066] Step 2: Copy the feature map group into 5 copies and enter path 1, path 2, path 3, path 4 and path 5 respectively for global feature extraction; among them, path 1 is used to perform convolution operation on the data to realize cross-channel interaction and information integration. The pooling window size gradually increases from path 2 to path 4. Path 5 is used to perform global average pooling (GAP) operation on the data to obtain global channel information.
[0067] Step 3: The data in path 1 will first be fed into a convolutional layer with a convolutional window size of 1*1 for calculation, and the convolution result will be sent to path 6.
[0068] In this embodiment, the data in path 1 is first fed into a convolutional layer (1*1, conv) with a convolutional window size of 1*1.
[0069] The data from steps 4, 2, 3, and 4 will be fed into pooling layers with pooling window sizes of 2*k+1, 2*(k+1)+1, and 2*(k+2)+1, respectively, to obtain various corresponding pooling results. These results will then be fed into an upsampling layer for size transformation, upsampling to the same size as the image from path 6; where k is an even number, k>=2.
[0070] The upsampling method used in this embodiment can be bilinear interpolation, which has both good speed and performance. Alternatively, it can be nearest neighbor or cubic interpolation.
[0071] Step 5: The data from path 5 will enter a global average pooling layer to obtain global channel information;
[0072] Step 6: After pooling and upsampling, path 2 enters its corresponding self-attention layer for global feature extraction. The output data of self-attention layer 1 will be sent to path 7 and path 8 respectively.
[0073] In this embodiment, the data from path 2, after pooling and upsampling, enters the self-attention layer 1 for global feature extraction. The self-attention layer performs better than traditional convolutional layers in global feature extraction. The structure of the self-attention layer is as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of a self-attention layer structure provided in an embodiment of the present invention, taking the data from path 2 as an example. The input is the data processed by path 2, which is then divided into three parts and fed into three fully connected layers (fully connected layer_1, fully connected layer_2, and fully connected layer_3) with an output dimension of d, respectively, to perform data calculations and obtain feature matrices Q, K, and V. These three feature matrices are then used to calculate the following formula:
[0074] ;
[0075] in This represents the result of self-attention calculation. Represents a query. Representative key, Representative values, respectively corresponding to Figure 3 Q, K, and V in It is the weight calculation function. Representing the output dimension of the fully connected layer, d is set to 64 in this invention. This represents the matrix transpose operation. The output after self-attention computation is data with global information. The output data of self-attention layer 1 will be sent to path 7 and path 8 respectively.
[0076] The data from step 7 and path 8 will be fused with the data from path 24 by adding them point by point. The fused data will be fed into self-attention layer 2 for calculation. The output data of self-attention layer 2 will be fed into path 9 and path 10 respectively.
[0077] This embodiment does not limit the specific feature fusion method. For example, in addition to point-by-point addition, the feature fusion method in this embodiment can also be channel splicing.
[0078] Step 8: The data from path 10 and the data from path 11 will be fused by adding them point by point. The fused data will be sent to the self-attention layer 3 for calculation. The output data of the self-attention layer 3 will be sent to path 12 and path 13 respectively.
[0079] Step 9: The data from path 13 and the data from path 14 will be fused by adding them point by point. The fused data will be fed into the self-attention layer 4 for calculation. The output data of the self-attention layer 4 will be fed into path 15 and path 16 respectively.
[0080] The data from step 10 and path 15 will be sent to the channel splicing layer;
[0081] In this embodiment, the data flow is top-down, used to exchange high-level information with low-level information.
[0082] The data from step 11 and path 16 will be merged with the data from path 12 by adding them point by point. The merged result will be sent to path 18 and path 17; the result of path 17 will be sent to the channel splicing layer.
[0083] Step 12: The data from path 18 will be merged with the data from path 9. The merged result will be sent to path 19 and path 20. The result from path 19 will be sent to the channel splicing layer.
[0084] Step 13: The data from path 20 will be merged with the data from path 7. The merged result will be sent to paths 21 and 22. The result from path 21 will be sent to the channel splicing layer.
[0085] Step 14: The data from path 22 will be merged with that from path 6. After merging, the data from path 23 will be sent to the channel splicing layer.
[0086] In this embodiment, the data flow is bottom-up, used to interact lower-level data with higher-level data. By using both top-down and bottom-up approaches, the data redundancy of feature map groups can be fully utilized to uncover potential feature information helpful to the current task.
[0087] Step 15: Use the channel splicing layer to fuse the data processed from path 1 to path 5. After fusion, feed the result into a 1*1 convolutional layer for cross-channel interaction and information integration, and finally obtain the result after global feature enhancement.
[0088] This invention provides an effective global feature enhancement method with the following advantages:
[0089] 1. Enhanced global information acquisition capability and improved computational efficiency. By introducing a self-attention layer, the long-distance dependency capture capability of self-attention allows for better acquisition of global feature information. This capability is further strengthened at each layer through deep aggregation (layer-by-layer stacking of self-attention data). Furthermore, thanks to the parallel computation of self-attention, the computational efficiency of the method in this invention is also improved.
[0090] 2. Enhanced information mining capabilities: By using top-down and bottom-up approaches to data flow, the redundancy of feature map groups can be fully utilized to uncover potential feature information that is helpful to the current task.
[0091] The global feature enhancement device provided in the embodiments of the present invention will be described below. The global feature enhancement device described below can be referred to in correspondence with the global feature enhancement method described above.
[0092] Please refer to the details. Figure 5 , Figure 5 A schematic diagram of a global feature enhancement device provided in an embodiment of the present invention may include:
[0093] The top path processing module 100 is used to input the feature map group output by the feature extraction network into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map group.
[0094] The intermediate path and bottom path processing module 200 is used to input the feature map group output by the feature extraction network into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map group, and the bottom path is used for global average pooling layer operations on the feature map group, and the pooling window size of the intermediate path and the bottom path gradually increases.
[0095] The upsampling module 300 is used to perform size transformation on the intermediate path and the bottom path after pooling, respectively, using the upsampling layer to obtain data with the same size as the integrated data image.
[0096] The self-attention layer processing module 400 is used to process the data in the intermediate path and the bottom path after size transformation using the self-attention layer, and to integrate the integrated data and the data processed by the self-attention layer using the channel splicing layer and the convolutional layer to obtain the target global augmentation data.
[0097] Furthermore, based on the above embodiments, the window size of the multiple paths corresponding to the intermediate path is 2*(k+N)+1; where k is an even number, k>=2, and N gradually increases.
[0098] Furthermore, based on any of the above embodiments, the self-attention layer processing module 400 may include:
[0099] The information integration unit is used to integrate the integrated data and the data processed by the self-attention layer using the channel splicing layer, and to perform cross-channel interaction and information integration using a 1*1 convolutional layer to obtain the target global augmented data.
[0100] Furthermore, based on any of the above embodiments, the self-attention layer processing module 400 may include:
[0101] The top-down and bottom-up feature fusion unit is used to perform top-down and bottom-up feature fusion processing on the data in the intermediate path and the bottom path after size transformation using the self-attention layer; wherein, the top-down refers to the process from the initial path of the intermediate path to the bottom path, and the bottom-up refers to the process from the bottom path to the top path.
[0102] Furthermore, based on any of the above embodiments, there are three intermediate paths: the top path is designated as path 1, the paths corresponding to the intermediate paths are path 2, path 3, and path 4, and the bottom path is designated as path 5.
[0103] Furthermore, based on any of the above embodiments, the top-down and bottom-up feature fusion unit may include:
[0104] The global feature extraction subunit is used to extract global features from the data of path 2 after pooling and upsampling, and the output data of the self-attention layer 1 will be sent to path 7 and path 8 respectively.
[0105] The first feature fusion subunit is used to fuse the data from path 8 and path 9. The fused data is sent to the self-attention layer 2 for calculation. The output data of the self-attention layer 2 is sent to path 9 and path 10 respectively. Path 24 is the data from path 3 after pooling and upsampling.
[0106] The second feature fusion subunit is used to fuse the data of path 10 and path 11, and send the fused data to the self-attention layer 3 for calculation. The output data of the self-attention layer 3 is sent to path 12 and path 13 respectively. Path 11 is the data of path 4 after pooling and upsampling.
[0107] The third feature fusion subunit is used to fuse the data of path 13 and the data of path 14, and send the fused data to the self-attention layer 4 for calculation. The output data of the self-attention layer 4 is sent to path 15 and path 16 respectively, and the data of path 15 is sent to the channel splicing layer. Path 14 is the data of path 5 after pooling and upsampling.
[0108] The fourth feature fusion subunit is used to fuse the data of path 16 and the data of path 12, and send the fused result to path 18 and path 17. The result of path 17 is sent to the channel splicing layer.
[0109] The fifth fusion subunit is used to fuse the data of path 18 and the data of path 9, send the fused result to path 19 and path 20, and send the result of path 19 to the channel splicing layer.
[0110] The sixth fusion subunit is used to fuse the data of path 20 and the data of path 7, and send the fused result to path 21 and path 22. The result of path 21 is sent to the channel splicing layer.
[0111] The seventh fusion subunit is used to fuse the data of path 22 and path 6, and send the fused data of path 23 to the channel splicing layer; where path 6 is the data obtained by pooling path 1.
[0112] Furthermore, based on any of the above embodiments, the size of the convolution window corresponding to the top path is 1*1.
[0113] It should be noted that the order of the modules and units in the aforementioned global feature enhancement device can be changed without affecting the logic.
[0114] The global feature enhancement device provided in this embodiment of the invention may include: a top path processing module 100 for processing feature map groups output by a feature extraction network by inputting them into the top path of a global feature enhancement module to obtain integrated data; wherein the top path is used to perform convolution operations on the feature map groups; and a middle path and bottom path processing module 200 for processing feature map groups output by the feature extraction network by inputting them into the middle path and bottom path of the global feature enhancement module; wherein the middle path includes multiple paths for performing pooling operations on the feature map groups, and the bottom path is used to perform full convolution operations on the feature map groups. The local average pooling layer operation gradually increases the pooling window size of the intermediate path and the bottom path. The upsampling module 300 performs pooling processing on the intermediate and bottom paths, then uses the upsampling layer to perform size transformation to obtain data with the same size as the integrated data image. The self-attention layer processing module 400 processes the data in the size-transformed intermediate and bottom paths using a self-attention layer, and integrates the integrated data and the data processed by the self-attention layer using a channel concatenation layer and a convolutional layer to obtain the target global augmented data. This application introduces a self-attention layer, which, through its long-distance dependency capture capability, better acquires global feature information. Furthermore, through deep aggregation (layer-by-layer stacking of self-attention data), this capability is enhanced at each layer, improving the sufficiency of global feature information extraction. Furthermore, in this embodiment, the convolution window size corresponding to the top path is 1*1, allowing for only one interaction, thus improving the efficiency of top path processing. This embodiment also provides a pattern for increasing the pooling window size, improving the effectiveness of intermediate paths in processing feature map data. Moreover, this embodiment utilizes top-down and bottom-up data flow to fully leverage the data redundancy of feature map groups, mining potential feature information helpful to the current task, and providing information mining capabilities for the global feature enhancement module. Furthermore, setting three intermediate paths allows for comprehensive and efficient mining of global features, thus improving the processing effect of intermediate paths. Finally, this embodiment improves the accuracy of top-down and bottom-up feature fusion by providing specific feature fusion methods for top-down and bottom-up approaches.
[0115] The following is a description of a global feature enhancement device provided by an embodiment of the present invention. The global feature enhancement device described below can be referred to in correspondence with the global feature enhancement method described above.
[0116] Please refer to Figure 6 , Figure 6A schematic diagram of a global feature enhancement device provided in an embodiment of the present invention may include:
[0117] Memory 10 is used to store computer programs;
[0118] Processor 20 is used to execute computer programs to implement the global feature enhancement method described above.
[0119] The memory 10, processor 20, and communication interface 30 all communicate with each other through the communication bus 40.
[0120] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 10 may store programs for implementing the following functions:
[0121] The feature map set output by the feature extraction network is input into the top path of the global feature enhancement module for processing to obtain integrated data; the top path is used to perform convolution operations on the feature map set.
[0122] The feature map set output by the feature extraction network is input into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map set, and the bottom path is used for global average pooling layer operations on the feature map set, and the pooling window size of the intermediate path and the bottom path gradually increases.
[0123] After pooling the middle and bottom paths, the upsampling layers are used to perform size transformations to obtain data with the same size as the integrated data image.
[0124] The self-attention layer is used to process the data in the intermediate and bottom paths after size transformation, and the channel splicing layer and convolutional layer are used to integrate the integrated data and the data processed by the self-attention layer to obtain the target global augmentation data.
[0125] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.
[0126] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.
[0127] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.
[0128] The communication interface 30 can be an interface for the communication module, used to connect with other devices or systems.
[0129] Of course, it should be noted that, Figure 6 The structure shown does not constitute a limitation on the global feature enhancement device in the embodiments of the present invention. In practical applications, the global feature enhancement device may include more than Figure 6 More or fewer components as shown, or combinations of certain components.
[0130] The readable storage medium provided in the embodiments of the present invention is described below. The readable storage medium described below can be referred to in correspondence with the global feature enhancement method described above.
[0131] The present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the global feature enhancement method described above.
[0132] The readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0133] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0134] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0135] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0136] The above provides a detailed description of a global feature enhancement method, apparatus, device, and readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A global feature enhancement method based on images, characterized in that, include: The feature map set output by the feature extraction network is input into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map set; The feature map set output by the feature extraction network is input into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map set, and the bottom path is used for global average pooling layer operations on the feature map set, and the pooling window size of the intermediate path and the bottom path gradually increases. After pooling the intermediate path and the bottom path, the size is transformed using an upsampling layer to obtain data with the same size as the integrated data image. The data in the intermediate and bottom paths after size transformation are processed using a self-attention layer, and the integrated data and the data processed by the self-attention layer are integrated using a channel splicing layer and a convolutional layer to obtain the target global augmentation data. Specifically, the data in the intermediate and bottom paths after size transformation are processed using a self-attention layer, including: The self-attention layer is used to perform top-down and bottom-up feature fusion processing on the data in the intermediate path and the bottom path after size transformation; wherein, top-down refers to the process from the initial path of the intermediate path to the bottom path, and bottom-up refers to the process from the bottom path to the top path; there are 3 intermediate paths, with the top path designated as path 1, the corresponding paths of the intermediate paths being path 2, path 3, and path 4, and the bottom path designated as path 5; Specifically, the self-attention layer is used to perform top-down and bottom-up feature fusion processing on the data in the size-transformed intermediate path and bottom path, including: The data from path 2 is pooled and upsampled before being fed into the self-attention layer 1 for global feature extraction. The output data from the self-attention layer 1 is then fed into path 7 and path 8 respectively. The data from path 8 and path 24 are fused, and the fused data is fed into self-attention layer 2 for calculation. The output data of self-attention layer 2 is fed into path 9 and path 10 respectively. Path 24 is the data from path 3 after pooling and upsampling. The data from path 10 and path 11 are fused, and the fused data is fed into self-attention layer 3 for calculation. The output data of self-attention layer 3 is fed into path 12 and path 13 respectively. Path 11 is the data from path 4 after pooling and upsampling. The data from path 13 and path 14 are fused, and the fused data is fed into self-attention layer 4 for calculation. The output data of self-attention layer 4 is fed into path 15 and path 16 respectively, and the data from path 15 is fed into channel splicing layer; path 14 is the data from path 5 after pooling and upsampling. The data from path 16 and path 12 are merged, and the merged result is sent to path 18 and path 17. The result from path 17 is sent to the channel splicing layer. The data from path 18 and path 9 are merged, and the merged result is sent to path 19 and path 20. The result from path 19 is sent to the channel splicing layer. The data from path 20 and path 7 are merged, and the merged result is sent to paths 21 and 22. The result from path 21 is sent to the channel splicing layer. The data from path 22 and path 6 are merged, and the merged data from path 23 is sent to the channel splicing layer; path 6 is the data obtained from path 1 after pooling.
2. The image-based global feature enhancement method according to claim 1, characterized in that, The window size for the multiple paths corresponding to the intermediate path is 2. (k+N)+1; where k is an even number, k>=2, and N gradually increases.
3. The image-based global feature enhancement method according to claim 1, characterized in that, The method of integrating the integrated data and the data processed by the self-attention layer using a channel splicing layer and a convolutional layer to obtain target global augmentation data includes: The integrated data and the data processed by the self-attention layer are integrated using the channel splicing layer, and 1 is used. A convolutional layer performs cross-channel interaction and information integration to obtain the target global augmentation data.
4. The image-based global feature enhancement method according to claim 1, characterized in that, The size of the convolution window corresponding to the top path is 1.
1.
5. An image-based global feature enhancement device, characterized in that, The image-based global feature enhancement method according to claim 1 includes: The top path processing module is used to input the feature map group output by the feature extraction network into the top path of the global feature enhancement module for processing to obtain integrated data; wherein, the top path is used to perform convolution operation on the feature map group. The intermediate path and bottom path processing modules are used to input the feature map group output by the feature extraction network into the intermediate path and bottom path of the global feature enhancement module for processing; wherein, the intermediate path includes multiple paths for pooling operations on the feature map group, and the bottom path is used for global average pooling layer operations on the feature map group, and the pooling window size of the intermediate path and the bottom path gradually increases. The upsampling module is used to perform size transformation on the intermediate path and the bottom path after pooling, and then use the upsampling layer to obtain data with the same size as the integrated data image. A self-attention layer processing module is used to process the data in the intermediate path and the bottom path after size transformation, and a channel splicing layer and a convolutional layer are used to integrate the integrated data and the data processed by the self-attention layer to obtain the target global augmentation data.
6. The image-based global feature enhancement device according to claim 5, characterized in that, The window size for the multiple paths corresponding to the intermediate path is 2. (k+N)+1; where k is an even number, k>=2, and N gradually increases.
7. The image-based global feature enhancement device according to claim 5, characterized in that, The self-attention layer processing module includes: A convolutional layer is used to integrate information units, which are used to integrate the integrated data and the data processed by the self-attention layer using the channel splicing layer, and to utilize 1 A convolutional layer performs cross-channel interaction and information integration to obtain the target global augmentation data.
8. The image-based global feature enhancement device according to claim 5, characterized in that, The size of the convolution window corresponding to the top path is 1.
1.
9. An image-based global feature enhancement device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the image-based global feature enhancement method as described in any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the image-based global feature enhancement method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Remote sensing image directional target detection method based on multi-feature aggregation and interaction
CN114926747A
Method and device for detecting passenger behaviors in escalator scene based on global information
CN115424301A
