A salient object detection method based on self-attention mechanism
Through the combination of the self-attention mechanism and the multi-scale feature enhancement module, the problem of poor salient target detection in the existing technology is solved, and more accurate and efficient salient target detection is achieved.
Patent Information
- Application Number
- CN202111278451.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-10-30
AI Technical Summary
Existing salient target detection methods cannot accurately predict salient targets when the salient target size is small, the semantic information is complex, and the background contrast is low, resulting in poor detection results.
A salient target detection method based on the self-attention mechanism is used to extract feature maps through a convolutional neural network, fuse and generate low-level and high-level integrated features, and use the self-attention module to exchange semantic information, combined with a multi-scale feature enhancement module and a cascade decoder , to generate the final salient object detection map.
Effective use of the self-attention mechanism and multi-scale feature enhancement module improves the accuracy and efficiency of salient target detection, exceeding the evaluation indicators of existing cutting-edge methods on multiple data sets.
Smart Images

Figure CN114119993B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer machine vision technology, and in particular to a salient target detection method based on a self-attention mechanism. Background Art
[0002] Computer vision is the use of computers to realize human visual functions - the perception, recognition and understanding of three-dimensional scenes in the objective world. The human eye has the ability to quickly detect the surrounding environment and filter out secondary information to locate the main target in the scene. This mechanism is called the human eye visual attention mechanism. In the field of computer vision, understanding and simulating this attention mechanism of the human visual system has received great attention from the academic community and has shown broad application prospects. Studies have shown that the human visual system will pay more attention to certain targets in the image, which are called salient targets.
[0003] Image saliency detection refers to the use of computers to simulate the human visual attention mechanism and establish a complete image saliency detection model, so as to accurately and quickly detect the area of the image where the human eye is looking and express it in the form of a saliency map. The purpose of salient object detection is to highlight the most visually unique part of the image, but salient object detection requires the computer to have a deep understanding of the semantics of the entire image and the detailed structure of the object. Traditional saliency detection uses manual features, but these hand-crafted features cannot capture high-level semantics, and saliency prediction cannot achieve satisfactory results. With the application of convolutional neural networks and the generation of high-quality data sets, salient object detection based on deep learning has made substantial progress.
[0004] Fully convolutional neural network is the main method for salient object detection. Fully convolutional neural network superimposes multiple convolution and pooling layers, gradually increases the receptive field and generates high-level semantics, which plays a very important role in salient object detection. For the numerous and complex semantic information in images, some people have proposed methods based on fully convolutional neural networks to enhance detection capabilities. For example, reference 1 (Chen LC, Papandreou G, Kokkinos I, et al. DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018, 40 (4): 834-848.) improves detection capabilities by multi-scale context fusion; reference 2 (Ding H. Context Contrasted Feature and Gated Multi-scale Aggregation for Scene Segmentation [C] / / IEEE / CVF Conference on Computer Vision & Pattern Recognition. IEEE, 2018.) proposes an encoder-decoder structure to fuse multi-scale semantic features.
[0005] The essence of the attention mechanism comes from the human visual attention mechanism, and the self-attention mechanism is a kind of attention mechanism and an important part of the transformer. Reference 3 (A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, ANGomez, and Kaiser, “Attention is all you need,” in Advances in Neural Information Processing Systems (NIPS), 2017, pp. 6000–6010.) introduced this mechanism in detail. Its characteristic is that it ignores the distance between features and directly calculates the dependency. At present, some achievements have been made in this regard, such as reference 4 (Tan Z, Wang M, Xie J, et al. Deep Semantic Role Labeling with Self-Attention [J]. 2017.) and reference 5 (Verga P, Strubell E, McCallum A. Simultaneously Self-Attending to All Mentions for Full-Abstract Biological Relation Extraction [J]. 2018.).
[0006] However, in challenging situations such as small size of salient objects, complex semantic information and low background contrast, existing methods still cannot accurately predict salient objects due to missing semantic information and weak feature dependency, resulting in poor final salient object detection effect. Summary of the invention
[0007] The purpose of the present invention is to provide a salient object detection method based on a self-attention mechanism, which improves the salient object detection effect by making full use of image semantic information.
[0008] The technical solution to achieve the purpose of the present invention is: a salient object detection method based on a self-attention mechanism, comprising the following steps:
[0009] Step 1: Use a convolutional neural network to extract features from the input image and generate a set of feature maps, including shallow feature maps and deep feature maps, each of which has semantic information of different scales;
[0010] Step 2: Fuse the shallow feature maps to generate low-level integrated features, and merge the deep feature maps to form high-level integrated features;
[0011] Step 3: Based on the self-attention mechanism, a self-attention module is constructed, and the low-level integrated features and high-level integrated features are input into the self-attention module to capture the features of high-level features and low-level features respectively, and exchange semantic information to form a dependency relationship;
[0012] Step 4: Enhance the obtained features through a multi-scale feature enhancement module, and send the fused and enhanced features to the cascade decoder to generate the final salient object detection map.
[0013] Furthermore, the convolutional neural network described in step 1 is as follows:
[0014] The ResNet-101 convolutional neural network is selected as the image feature extractor. The ResNet-101 convolutional neural network contains 5 convolution groups, each of which contains a convolution calculation process. Each convolution group contains a downsampling operation. The first convolution group contains only one convolution calculation operation, and the 2nd to 5th convolution groups contain multiple identical residual units. The last global pooling layer and fully connected layer are discarded.
[0015] Furthermore, the feature integration in step 2 is as follows:
[0016] The shallow feature map fuses multiple feature maps through the Concat operation to generate low-level integrated features, and the deep feature map merges multiple feature maps through the Concat operation to form high-level integrated features; the generated high-level integrated features provide a lot of semantic information, and the low-level integrated features contain spatial details that help to refine the boundaries of objects. The two contain complementary information.
[0017] Furthermore, in step 3, a self-attention module is constructed based on the self-attention mechanism, as follows:
[0018] The self-attention module consists of two 1*1 convolutional layers and six 3*3 convolutional layers. The two features are reduced in dimension into query, key and value through the embedded convolutional layer, and the matrix and pooling operations are performed at the same time. Then, the dot product attention calculation between the features of different time steps is performed to obtain a 1*1 convolutional map for long-distance spatiotemporal interaction. Finally, the convolutional map and the original features are element-wise summed to obtain the final representation of the long-distance contextual information.
[0019] Furthermore, the multi-scale feature enhancement module in step 4 is specifically as follows:
[0020] The multi-scale feature enhancement module contains one group of 1*1 convolutional layers and three 3*3 convolutional layers. The number of channels of the three 3*3 convolutional layers is 2, 4, and 6 respectively. The feature map after dimension reduction by the three 3*3 convolutional layers is concat-operated, and then dot-multiplied with the feature map after the 1*1 convolutional layer to form an enhanced map.
[0021] The multi-scale feature enhancement module is used to extract spatial information of different scales, use dilated convolution to expand the receptive field, merge multi-scale information, obtain a fused and optimized feature information output, and then use cascade decoding to predict the two sets of features to form a prediction graph.
[0022] Compared with the prior art, the present invention has the following significant advantages: (1) it effectively utilizes the self-attention mechanism to exchange and fuse semantic information and spatial edge information, and uses the dot product attention method to complete the calculation and obtain the final representation of long-distance context information; (2) it simultaneously utilizes the multi-scale feature enhancement module to perform dilated convolution on the feature map at different dilation rates, effectively expanding the receptive field while ensuring the semantic information, thereby improving the efficiency of salient target detection; (3) it finally uses the cascade decoder to obtain the final prediction map. Experiments show that the present invention achieves good results on three evaluation indicators of five public data sets, surpassing the current cutting-edge salient target detection methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is the overall framework diagram of the neural network model based on the self-attention mechanism in the present invention.
[0024] Figure 2 It is a structural diagram of the self-attention module in the present invention.
[0025] Figure 3 This is a diagram of the multi-scale feature enhancement method in the present invention.
[0026] Figure 4 This is the structure diagram of the multi-scale feature enhancement module in the present invention DETAILED DESCRIPTION
[0027] The present invention provides a salient object detection method based on a self-attention mechanism, comprising the following steps:
[0028] Step 1: Use a convolutional neural network to extract features from the input image and generate a set of feature maps, including shallow feature maps and deep feature maps, each of which has semantic information of different scales;
[0029] Step 2: Fuse the shallow feature maps to generate low-level integrated features, and merge the deep feature maps to form high-level integrated features;
[0030] Step 3: Based on the self-attention mechanism, a self-attention module is constructed, and the low-level integrated features and high-level integrated features are input into the self-attention module to capture the features of high-level features and low-level features respectively, and exchange semantic information to form a dependency relationship;
[0031] Step 4: Enhance the obtained features through a multi-scale feature enhancement module, and send the fused and enhanced features to the cascade decoder to generate the final salient object detection map.
[0032] As a specific example, step 1 is as follows: use a convolutional neural network to extract features from the input image and generate a set of feature maps R1, R2, R3, R4, and R5, which contain low-level feature maps and high-level feature maps with semantic information at different scales. Then we fuse the shallow feature maps to generate low-level integrated features L, and merge the deep feature maps to form high-level integrated features R. Then, the integrated features are input into the designed self-attention module based on the self-attention mechanism, and then the obtained features are enhanced through the multi-scale feature enhancement module to finally obtain the prediction map.
[0033] The convolutional neural network is specifically as follows:
[0034] The ResNet-101 convolutional neural network is selected as the image feature extractor. The ResNet-101 convolutional neural network contains 5 convolution groups, each of which contains a convolution calculation process. Each convolution group contains a downsampling operation. The first convolution group contains only one convolution calculation operation, and the 2nd to 5th convolution groups contain multiple identical residual units. The last global pooling layer and fully connected layer are discarded.
[0035] As a specific example, step 2 is as follows: the high-level integrated feature H formed in step 1 provides a large amount of semantic information, and the low-level integrated feature L contains spatial details that help refine the object boundary. H and L contain complementary information. The self-attention module uses the self-attention machine to reduce the dependence on external information and is better at capturing the internal correlation of data or features. The two features are embedded in the convolutional layer for dimensionality reduction, and then the dot product attention calculation between the features of different time steps is used for long-distance spatiotemporal interaction. Finally, the result and the original feature are summed element-wise to obtain the final representation F' and L' of the long-distance context information.
[0036] Feature integration, as follows:
[0037] The shallow feature map fuses multiple feature maps through the Concat operation to generate low-level integrated features, and the deep feature map merges multiple feature maps through the Concat operation to form high-level integrated features; the generated high-level integrated features provide a lot of semantic information, and the low-level integrated features contain spatial details that help to refine the boundaries of objects. The two contain complementary information.
[0038] As a specific example, step 3 is as follows: high-level integrated features provide a lot of semantic information, and low-level integrated features contain spatial details that help refine the boundaries of objects. The two contain complementary information. The self-attention module uses the characteristics of the self-attention machine to reduce the dependence on external information and is better at capturing the internal correlation of data or features. The two features are embedded in the convolutional layer for dimensionality reduction, and then the dot product attention calculation between the features of different time steps is used for long-distance spatiotemporal interaction. Finally, the result and the original feature are summed element-wise to obtain the final representation of the long-distance context information.
[0039] The self-attention module consists of two 1*1 convolutional layers and six 3*3 convolutional layers. The two features are reduced in dimension into query, key and value through the embedded convolutional layer, and the matrix and pooling operations are performed at the same time. Then, the dot product attention calculation between the features of different time steps is performed to obtain a 1*1 convolutional map for long-distance spatiotemporal interaction. Finally, the convolutional map and the original features are element-wise summed to obtain the final representation of the long-distance contextual information.
[0040] As a specific example, step 4 is as follows: after the feature extraction of steps 1 and 2 and the feature dot product attention calculation of step 3, F' and L' need to be sent to the multi-scale feature enhancement module. The multi-scale feature enhancement module is used to extract spatial information of different scales, use the hole convolution to expand the receptive field, merge the multi-scale information, and obtain a fused and optimized feature information output. Then, the two sets of features are predicted using cascade decoding to form a prediction graph.
[0041] The multi-scale feature enhancement module is specifically as follows:
[0042] The multi-scale feature enhancement module contains a group of 1*1 convolutional layers and three 3*3 convolutional layers. The number of channels of the three 3*3 convolutional layers is 2, 4, and 6 respectively. The feature map after dimension reduction by the three 3*3 convolutional layers is concat-operated, and then dot-multiplied with the feature map after the 1*1 convolutional layer to form an enhanced map.
[0043] The following is a further detailed description of the specific implementation of the present invention in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.
[0044] Example
[0045] like Figure 1 to Figure 4 As shown, a salient target detection method based on a self-attention mechanism of the present invention mainly includes the following steps:
[0046] Step a: Use the multi-scale feature extraction module to extract multi-scale convolution features.
[0047] We select ResNet-101 as the image feature extractor. We select the five convolutional modules after ResNet-101 and discard the last global pooling layer and the fully connected layer to meet our actual needs. We obtain multi-scale feature maps R1, R2, R3, R4, and R5. These feature maps contain low-level details and high-level feature maps with semantic information of different scales. We fuse the shallow feature maps to generate low-level integrated features (denoted as L) and merge the deep feature maps together to form high-level integrated features (denoted as H).
[0048] Step b: Use the self-attention module to capture the features of high-level features and low-level features respectively and exchange semantic information to form dependencies.
[0049] The high-level integrated features H in the self-attention module provide a lot of semantic information, while the low-level integrated features L contain spatial details that help refine the object boundaries. The two contain complementary information. The two features are embedded in the convolutional layer for dimensionality reduction, denoted as H∈R C*H*W , L∈R C*H*W Use the convolutional layer to transform the features into query q, key k, and value v, denoted as H q , H k , H v , L q , L k , L v , in order to make the embedding cost-effective and able to capture spatial information, for the query, key, and value embedding layers, we use 1*1 convolution to reduce the dimensionality of the semantic channel, and then use 3*3 convolution layers to extract spatial information. After that, we implement dot product attention between two features to capture the long-range relationship between the two features. The calculation process is as follows:
[0050] DA(H q ,L k ,L v )=softmax((H q ) T L k )(L v ) T
[0051] DA(L q ,H k ,H v )=softmax((L q ) T H k )(H v ) T
[0052] The query embedding layer and the key embedding layer interact with each other to form a spatial attention matrix, which models the spatial relationship between any two pixels of the feature. Subsequently, the attention matrix and the value embedding layer perform matrix multiplication, and the result of the multiplication and the original matrix features are summed element-wise to obtain the final representation of the long-distance context information to obtain H' and L'. The calculation process is as follows:
[0053]
[0054]
[0055] Step c: Perform multi-scale feature enhancement on the feature map obtained in step b, and then send the enhanced features to the cascade decoder to generate the final salient object detection map.
[0056] The H' and L' feature maps are input to the multi-scale feature enhancement module and output to four convolution modules in parallel. The first module undergoes average pooling, and the 1*1 convolution layer performs channel transformation. The second to fifth modules perform dilated convolutions, and the diffusion rates of 2, 4, and 6 are selected. The outputs of the four modules are then concatenated together to obtain an enhanced feature map. The output feature map is then cascade decoded to obtain a prediction map.
[0057] Experimental process and results:
[0058] The present invention first uses the DUTS-TR dataset to train the proposed model. It contains 10,533 images with high-quality pixel-level annotations. The training set is increased by horizontal and vertical flipping and image cropping to alleviate the overfitting problem. The final network model is obtained after pre-training and fine-tuning.
[0059] After training, the network model is evaluated on five benchmark datasets widely used in the field of saliency detection, namely ECCSD, DUT-OMRON, HKU-IS, PASCAL-S, and DUTS-TE. All of these datasets are manually labeled with pixel-level true values for quantitative evaluation. Evaluation indicators include precision-recall, F-measure, and mean absolute error (MAE). The precision-recall (PR) curve is a standard metric for evaluating saliency performance. F-measure is expressed as F β, is an overall performance indicator, calculated by weighted reconciliation of precision and recall. MAE is the mean absolute error, which is used to measure the average difference between the predicted saliency map and the true value. Compared with the existing methods, the present invention has achieved good results in three evaluation indicators of five public data sets. The present invention can accurately locate salient targets in each data set and accurately segment complete salient targets.
[0060] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A salient object detection method based on self-attention mechanism, It is characterized in that The following steps are involved: Step 1: Use a convolutional neural network to extract features from the input image and generate a set of feature maps, including shallow feature maps and deep feature maps, each of which has semantic information of different scales; Step 2: Fuse the shallow feature maps to generate low-level integrated features, and merge the deep feature maps to form high-level integrated features; Step 3: Based on the self-attention mechanism, a self-attention module is constructed, and the low-level integrated features and high-level integrated features are input into the self-attention module to capture the features of high-level features and low-level features respectively, and exchange semantic information to form a dependency relationship; Step 4: Enhance the obtained features through a multi-scale feature enhancement module, and send the fused and enhanced features to the cascade decoder to generate the final salient object detection map.
2. The salient object detection method based on the self-attention mechanism according to claim 1, It is characterized in that The convolutional neural network described in step 1 is as follows: The ResNet-101 convolutional neural network is selected as the image feature extractor. The ResNet-101 convolutional neural network contains 5 convolution groups, each of which contains a convolution calculation process. Each convolution group contains a downsampling operation. The first convolution group contains only one convolution calculation operation, and the 2nd to 5th convolution groups contain multiple identical residual units. The last global pooling layer and fully connected layer are discarded.
3. The salient object detection method based on the self-attention mechanism according to claim 1, It is characterized in that The feature integration in step 2 is as follows: The shallow feature map fuses multiple feature maps through the Concat operation to generate low-level integrated features, and the deep feature map merges multiple feature maps through the Concat operation to form high-level integrated features; the generated high-level integrated features provide a lot of semantic information, and the low-level integrated features contain spatial details that help to refine the boundaries of objects. The two contain complementary information.
4. The salient object detection method based on the self-attention mechanism according to claim 1, It is characterized in that In step 3, a self-attention module is constructed based on the self-attention mechanism, as follows: The self-attention module consists of two 1*1 convolutional layers and six 3*3 convolutional layers. The two features are reduced in dimension into query, key and value through the embedded convolutional layer, and the matrix and pooling operations are performed at the same time. Then, the dot product attention calculation between the features of different time steps is performed to obtain a 1*1 convolutional map for long-distance spatiotemporal interaction. Finally, the convolutional map and the original features are element-wise summed to obtain the final representation of the long-distance contextual information.
5. The salient object detection method based on the self-attention mechanism according to claim 1, It is characterized in that The multi-scale feature enhancement module described in step 4 is as follows: The multi-scale feature enhancement module contains one group of 1*1 convolutional layers and three 3*3 convolutional layers. The number of channels of the three 3*3 convolutional layers is 2, 4, and 6 respectively. The feature map after dimension reduction by the three 3*3 convolutional layers is concat-operated, and then dot-multiplied with the feature map after the 1*1 convolutional layer to form an enhanced map. The multi-scale feature enhancement module is used to extract spatial information of different scales, use dilated convolution to expand the receptive field, merge multi-scale information, obtain a fused and optimized feature information output, and then use cascade decoding to predict the two sets of features to form a prediction graph.
Citation Information
Patent Citations
CNN-based saliency detection system and method
CN112927209A
Pedestrian detection method based on multi-scale self-attention feature fusion
CN113537013A
General target detection method for adaptive attention guidance mechanism
WO2021139069A1
