A small target feature enhanced image segmentation method and system
The image segmentation method is enhanced by introducing small target features into the image segmentation method, combining the ASPP module and the pixel space attention module to extract and fuse small target and edge features, and use the supervised loss function for training, which solves the problem of small targets and edges in the existing technology. The problem of loss of details improves the accuracy of image segmentation and model representation capabilities.
Patent Information
- Application Number
- CN202210643405.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image segmentation methods based on deep learning are difficult to meet the requirements of network feature representation capabilities in dense image classification and image segmentation tasks. In particular, they pay less attention to the semantic categories of small targets and edge details, resulting in a decline in segmentation performance.
A small target feature-enhanced image segmentation method is adopted. By inputting the image to be processed into the backbone network, the backbone network features are obtained, and then input into the ASPP module and the pixel space attention module PAM, combined with the small target extraction module TTE and the edge feature extraction module. EEM performs feature fusion and uses small target loss function, edge loss function and segmentation loss function for supervised training to improve the extraction ability of small target and edge features.
It improves the accuracy of image segmentation, especially the segmentation performance of small targets and edges, enhances the details and semantic information of the image, corrects the category labels, and improves the representation ability of the model.
Smart Images

Figure CN114937148B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a small target feature enhanced image segmentation method and system. Background Art
[0002] Accurate perception and understanding of content in scene parsing is crucial for computer vision in the field of artificial intelligence. In recent years, deep convolutional neural networks have achieved great success in object recognition.
[0003] For image segmentation methods based on deep learning, most of them are migrated from the field of image classification, and fail to meet the requirements of dense image classification or image segmentation tasks on the strength of network feature representation capabilities. In fact, they pay less attention to detailed semantic categories such as edges and small objects.
[0004] In addition, the frequent pooling operations and convolution step size settings in the classification network reduce the spatial resolution, resulting in the loss of many small targets such as traffic signs. The loss of spatial details also leads to reduced segmentation performance. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a small target feature enhanced image segmentation method, aiming to solve the problem raised in the third part of the background technology.
[0006] The embodiment of the present invention is implemented as follows: a small target feature enhanced image segmentation method, the method comprising:
[0007] Inputting the image to be processed into the backbone network to obtain backbone network features, wherein the backbone network features include backbone network first layer features, backbone network second layer features, backbone network third layer features and backbone network fourth layer features;
[0008] Input the fourth layer features of the backbone network into the ASPP module to obtain the ASPP feature output features;
[0009] The ASPP feature output features and the first layer features of the backbone network are simultaneously input into the pixel space attention module PAM to obtain the pixel space features;
[0010] The pixel spatial features are simultaneously input into the small target extraction module TTE and the edge feature extraction module EEM to obtain the small target features and edge features respectively;
[0011] The first layer features of the backbone network, ASPP feature output features, small target features and edge features are fused and output.
[0012] Preferably, supervised learning of small target features is performed through small target real-time images, and the supervised learning process adopts a small target loss function L tiny :
[0013]
[0014]
[0015] in Assign a probability distribution to the label at pixel j, y j It is the label of the live image.
[0016] Preferably, the edge loss function L is used edge Supervise edge features, L edge The definition is as follows:
[0017]
[0018]
[0019] Preferably, the segmentation loss function L is used seg Supervise the segmentation process of the backbone network, and the segmentation loss function L seg It is expressed as:
[0020]
[0021] in Assign a probability distribution to the label at pixel j, y j It is the label of the live image.
[0022] Preferably, the total loss in network modeling is expressed as:
[0023]
[0024] Among them, L total is the total loss function, L seg is the segmentation loss function, L tiny is the small target loss function, L edge is the marginal loss function, is the network hyperparameter, is the segmentation loss weight coefficient, is the small target loss weight coefficient, is the weight coefficient of edge loss.
[0025] Preferably, the step of obtaining the pixel spatial feature specifically includes: converting the high-level feature y output by different expansion rates ASPP ASPP ∈R W×H×C and the first layer feature y of the backbone network res1 ∈R W×H×C As input, where C represents the channel dimension, WxH represents the spatial resolution, and y ASPP With y res1The feature resolution of each channel of the high-level features is consistent. Each channel undergoes global average pooling and maximum pooling, and then passes through a shared network to generate a channel attention map. The shared network is composed of a multi-layer perception network consisting of two fully connected layers and an activation function. The scale of the hidden layer activation function is set to R (C×1×1) / r , r is the channel reduction rate, and then the two outputs are merged by element-wise summation,
[0026]
[0027] Then perform a global pooling operation to obtain features of two dimensions, namely and Merge and input into the single-layer perception operation. The specific process is as follows:
[0028]
[0029] The symbol || represents the convolution concatenation operation, which performs feature fusion on channel attention and spatial attention, and the fused features are output after normalization BN:
[0030] PAM(y ASPP ,y res1 )=BN(y ASPP +Y C +Y S ),
[0031] + indicates pixel-level addition.
[0032] Preferably, the edge feature y is obtained by the edge extraction module EEM edge The steps specifically include: convolving the output of the PAM module into a feature map M∈R of K channels W×H×K , perform argmax operation on M, obtain label maps of K categories, and perform gradient transformation Get K edge masks After normalization, it is combined with the features M∈R of K channels W×H×K Multiply them together to get the edge feature map B∈R containing the semantic category W×H×K , where K is the number of categories. In this step:
[0033]
[0034] Preferably, the small target feature y is obtained by the small target extraction module TTE tiny The steps specifically include: statistically analyzing and sorting the number of each target pixel in the feature map output by the PAM module, and comparing the target pixel number with the maximum target pixel number in turn by setting a threshold tv. When it is less than a preset value, it is assumed to be a small target in the feature map, and a small target mask is used to obtain a small target feature map.
[0035] Preferably, in the step of fusing and outputting the first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features, the formula used is as follows:
[0036] y=y res1 +y ASPP +y edge +y tint ,
[0037] Among them, y res1 is the first layer feature of the backbone network, y ASPP Output feature for ASPP feature, y tiny is the small target feature, y edge is the edge feature, res1 ,y ASPP ,y tiny and edge 1x1 convolution is used for dimensionality reduction, so that all feature dimensions are consistent with y res1 The output dimensions are consistent, all features are upsampled, restored to a uniform resolution, and then pixel-level superposition is performed.
[0038] Another object of the present invention is to provide a small target feature enhanced image segmentation system, the system comprising:
[0039] A backbone network module, used to input the image to be processed into the backbone network to obtain backbone network features, wherein the backbone network features include backbone network first layer features, backbone network second layer features, backbone network third layer features and backbone network fourth layer features;
[0040] The ASPP feature output module is used to input the fourth layer features of the backbone network into the ASPP module to obtain the ASPP feature output features;
[0041] The spatial feature output module is used to input the ASPP feature output features and the first layer features of the backbone network into the pixel spatial attention module PAM at the same time to obtain the pixel spatial features;
[0042] The feature extraction module is used to input the pixel space features into the small target extraction module TTE and the edge feature extraction module EEM at the same time to obtain the small target features and edge features respectively;
[0043] The feature fusion module is used to fuse and output the first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features.
[0044] In a small target feature enhanced image segmentation method provided by the present invention, a new lightweight attention module PAM is provided, which obtains high-level semantic information in the low layer with rich details; then the edge and small target modeling are performed on the output features of the module respectively, and the small target and edge features are extracted. Finally, the corresponding loss functions are set for the modeling and extraction results for supervised training. Since the small target and edge features are extracted in the PAM module at the bottom of the network, they have rich details and semantic category information. The trained features are fused with the features output by ASPP and the first layer features of the backbone network, so that the small target features, edge features, and main network image features interact with each other. While enhancing the small target and edge features, the category labels of the image pixels are also corrected, thereby improving the segmentation accuracy of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Implementation flow chart of image segmentation method for small object feature enhancement;
[0046] Figure 2 This is the workflow diagram of the PAM module;
[0047] Figure 3 It is the workflow diagram of edge extraction module EEM;
[0048] Figure 4 This is the workflow diagram of the small target extraction module TTE;
[0049] Figure 5 Visualization results of FCN, Deeplabv3+ and the segmentation algorithm in this paper;
[0050] Figure 6 This is the edge visualization result diagram of FCN and the segmentation algorithm in this paper;
[0051] Figure 7 This is the edge visualization result diagram of Deeplabv3+ and the segmentation algorithm in this paper;
[0052] Figure 8 This is a visualization result diagram of each module in the algorithm network of this article;
[0053] Fig. 9 Visualize the result graphs for each feature in PAM;
[0054] Fig.10 Flowchart of steps for small object feature enhancement image segmentation method;
[0055] Fig.11 Architecture diagram of a small object feature enhanced image segmentation system. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0057] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0058] In the present invention, ASPP (Atrous Spatial Pyramid Pooling) is a dilated spatial convolutional pooling pyramid; TTE (The Tiny Target Extraction Module) is a small target extraction module; EEM (The Edge Extraction Module) is an edge feature extraction module; PAM (Pixel spatial Attention Module) is a pixel spatial attention module.
[0059] Incorporating multi-scale features into deep convolutional neural networks (DCNNs) is one of the key factors to achieve optimal performance in semantic segmentation. A multi-scale feature extraction scheme has been proposed to expand the spatial receptive field by using dilated spatial pyramid pooling (ASPP). The ASPP structure is generally composed of parallel dilated convolutions with different dilation rates. Dilated convolution is a common signal optimization algorithm, which is proposed to achieve high performance and efficient calculation of unsampled wavelet transform. Suppose that after the two-dimensional image signal passes through the backbone network, the input feature x at each position i is passed through the convolution filter w to obtain the corresponding output feature y. The specific process of dilated convolution on the feature map x is as follows:
[0060] y[i]=∑ k x[i+rk]w[k],
[0061] Where r is the dilation rate of the dilated convolution, which indicates the stride size of the input signal sampling. When r = 1, it is a standard conventional convolution. The receptive field suitable for targets of different scales can be obtained by modifying the value of r. The features output by the backbone network are processed by the ASPP module with convolutions of different dilation rates, which enhances the perception ability of the network and outputs high contextual semantic information. Fusion with shallow features can not only increase some detail information and obtain semantic information that meets targets of different scales, but also alleviate the grid effect caused by dilated convolution to a certain extent. However, it will also lead to the loss of spatial structure and the loss of details such as a large number of edges and tiny targets.
[0062] In the current image semantic segmentation model, the high-level image features output by DCNNs have high semantic information but lack detail information, while the shallow image features are rich in detail information but lack semantic information. It is difficult to improve the segmentation accuracy by simply fusing high-level features with low-level features. For this reason, some people use multi-scale feature extraction schemes to expand the spatial receptive field. These schemes only focus on local feature relationships and generate limited contextual semantic information. Recently, a spatial sparse attention mechanism is used to obtain context information, which reduces the computational complexity of the model and improves the spatial contextual semantic information without reducing network performance. In the prior art, an efficient compressed attention network structure (SANet) is proposed to enable the network to pay attention to more details by enhancing the network representation ability. However, the relationship between pixels and categories is not considered to directly construct spatial context information. These relationships not only help to reduce noise information in the context, but also make the spatial context more interpretable. Therefore, if these spatial context-based methods do not consider effective channel information in representation learning, they cannot obtain good semantic information well. In order to obtain a pixel space with strong semantic information, the present invention provides a pixel space attention mechanism that organically combines spatial attention and channel attention.
[0063] Fig.10 The flowchart of the small target feature enhancement image segmentation method is shown in the following figure. Figure 1 As shown in the figure, the backbone network ResNet101 is output to the ASPP module, and convolutions with different expansion rates are used to obtain feature maps of different scales. It is obvious that although the ASPP output can obtain better semantic information, the feature map of the last layer of the network cannot restore all the lost information. Therefore, it is input into a pixel space attention module PAM to obtain feature maps that adapt to different scales and pixel space features with strong semantic relationships. It is output to the edge feature extraction module EEM to obtain edge features with category information, and the edge reality map is used to supervise the learning of this feature. At the same time, another path is output to the small target extraction module TTE to obtain the small target feature y with category information. tiny, and use the small target real-life image to supervise the learning of this feature. And design a special loss function. Finally, the small target feature y tiny , edge feature y edge , the ASPP feature output feature y ASPP With the backbone network feature y res1 , and then fuse the output, after repeated supervised learning and training correction, the segmentation performance of edges and small targets is improved without reducing the performance of other categories. The specific formula is as follows: y = y res1 +y ASPP +y edge +y tiny , where y res1 is the first layer feature of the backbone network, y ASPP Output feature for ASPP feature, y tiny is the small target feature, y edge is the edge feature, res1 ,y ASPP ,y tiny and edge 1x1 convolution is used for dimensionality reduction, so that all feature dimensions are consistent with y res1 The output dimensions are consistent. At the same time, inspired by the simple decoding structure (upsampling) in Deeplabv3+, this operation is used to upsample all features to a uniform resolution and then perform pixel-level superposition.
[0064] In the current semantic segmentation algorithm that enhances feature representation capabilities and optimizes spatial details, due to the loss of edge and small target features, small targets and edges are difficult to be accurately segmented. To this end, the present invention provides a pixel space attention module (PAM) that organically combines spatial attention and channel attention. To obtain image features with strong semantic information in pixel space. That is, by feeding back the features with strong semantic information output by the high-level to the shallow layer, the high-level features in PAM guide the shallow feature training, so that the shallow features have both rich detail information and strong semantic information. Finally, the pixel space is obtained with strong semantic information, which solves the problem that the shallow image features in the model have pixel space semantic information to a certain extent. The specific principles are as follows:
[0065] exist Figure 2In the method, the high-level features processed by the ASPP module are subjected to global pooling to obtain global context information as the guiding information of the shallow features, and then parallel avg&max lightweight pooling is performed to strengthen the attention of the spatial details of the global category. Specifically, the high-level features processed by the ASPP module are sequentially subjected to global pooling, batch normalization (BatchNormalization, BN) and nonlinear transformation, 1×1 convolution and other operations to generate features with global context information, and then multiplied with the low-level features to obtain the channel semantic relationship of the image. Then avg&max parallel lightweight pooling is used to strengthen spatial attention. Finally, the high-level features and channel features with global context information are fused and output. Different from the prior art, the PAM module in the present invention can not only effectively adapt to feature mappings at different scales, but also provide guiding information for low-level feature mappings in a simple way, and the pixel space in the features it outputs has a strong semantic relationship.
[0066] The high-level features y output by ASPP with different expansion rates ASPP ∈R W×H×C and the first layer feature y of the backbone network res1 ∈R W ×H×C As input, where C represents the channel dimension, WxH represents the spatial resolution, and y ASPP With y res1 The feature resolution of each channel of the high-level features is consistent. Each channel undergoes global average pooling and maximum pooling, and then passes through a shared network to generate a channel attention map. The shared network is a multi-layer perception network composed of two fully connected layers and a nonlinear sigmoid function. The hidden layer activation function scale is set to R (C×1×1) / r , r is the channel reduction rate, and then the two outputs are merged by element-wise summation,
[0067]
[0068] Then perform a global pooling operation to obtain features of two dimensions, namely and Merge and input into the single-layer perception operation. The specific process is as follows:
[0069]
[0070] The symbol || represents the convolution concatenation operation, which performs feature fusion on channel attention and spatial attention, and the fused features are output after normalization BN:
[0071] PAM(y ASPP ,y res1 )=BN(y ASPP +Y C +Y S),
[0072] + indicates pixel-level addition.
[0073] In order to obtain edge features with semantic categories, the output of the PAM module is convolved into a feature map M∈R with K channels. W×H×K , perform argmax operation on M, obtain label maps of K categories, and perform gradient transformation Get K edge masks After normalization, it is combined with the features M∈R of K channels W×H×K Multiply them together to get the edge feature map B∈R containing the semantic category W×H×K , where K is the number of categories, and the process is as follows Figure 3 As shown. In this process, since the pixel spatial position in the features output by the PAM module has a strong semantic relationship, the extracted edge features contain semantic category information. Although the obtained edge may be relatively rough, after training and fusion training after sigmoid processing, the present invention alleviates the problem of rough and sparse segmentation edges in the prior art to a certain extent. Similarly, a real-life edge map can be obtained.
[0074] In order to obtain the small target features with semantic categories, the number of target pixels in the feature map output by the PAM module is statistically analyzed and sorted. By setting the threshold tv, the number of target pixels num k Sequentially with the maximum target pixel number num max When the relative contrast is less than 0.01 (adjustable), this is the default small target of the feature map. Using the small target mask, you can get the small target feature map.
[0075] In order to obtain the small target features with semantic categories, the number of each target pixel in the feature map output by the PAM module is statistically analyzed and sorted. The number of target pixels is relative to the maximum number of target pixels in turn. When this value is less than 0.01 (adjustable), it is defined as a small target in the feature map by default. Using the small target mask, a small target feature map can be obtained. Since the pixel spatial position in the features output by the PAM module has a strong semantic relationship, the extracted small target features contain semantic category information. The process is as follows Figure 4 As shown. Figure 4 In the process, the small target mask is multiplied with the feature map of K channels, and finally the small target feature map with semantic information is output. Similarly, the number of target pixels in the real-life image annotated by the dataset is statistically analyzed. When the number of target pixels obtained is less than 0.01 (adjustable) compared with the maximum number of target pixels, it is assumed that the small target is annotated in the real-life image. Then the small target mask can be used to obtain the real-life image of the small target.
[0076] The present invention not only performs loss function supervision calculation on the final segmentation feature map of the backbone network, but also supervises the calculation of the extracted edge and small target feature outputs. To this end, this algorithm adds an edge loss function L edge And the small target loss function L tiny To supervise the learning process of semantic edges and semantic small objects. Considering that the pixels at the edge and small object positions also have semantic category information, in order to better supervise them, we choose to use the cross entropy loss function to supervise them, which is defined as follows:
[0077]
[0078]
[0079]
[0080]
[0081] in Assign a probability distribution to the label at pixel j, which is the ground truth image label.
[0082] In addition, the backbone network segmentation supervision loss function is expressed as:
[0083]
[0084] in Assign a probability distribution to the label at pixel j, y j It is the label of the live image.
[0085] The total loss in network modeling is expressed as:
[0086]
[0087] Among them, L total is the total loss function, L seg is the segmentation loss function, L tiny is the small target loss function, L edge is the marginal loss function, is the network hyperparameter, is the segmentation loss weight coefficient, is the small target loss weight coefficient, is the weight coefficient of edge loss.
[0088] In order to verify the effect of the present invention, the present application conducted quantitative and qualitative experiments on Cityscapes, PASCAL VOC, ADE20K and Camvid datasets. Based on the experimental results, the present invention compared the experimental results of the algorithm in this paper with the current most advanced methods on the Cityscapes dataset and conducted a series of ablation experiments, and analyzed the results. Finally, the experimental results were compared and analyzed on the PASCAL VOC, ADE20K and Camvid datasets. The experimental results on the four datasets show that the present algorithm is superior to other algorithms.
[0089] 1. Experimental environment and evaluation standards:
[0090] This experiment is conducted in Linux environment, based on Python programming language, with Intel E5-2650 V4 CPU and MSI NVIDIA GeForce RTX 2080Ti GPU. The Cityscapes dataset is derived from street scenes in 50 different cities, with a total of 5,000 finely labeled (precisely labeled), 2,975 training images, 500 verification images, and 1,525 test images. There are 8 major categories in the labeled pixel categories, each of which contains several subcategories, for a total of 30 subcategories. Excluding some categories with low pixel frequency, 19 categories are used for evaluation. The standard mIoU (mean Intersection over Union, mIoU) is used to evaluate the prediction segmentation accuracy, that is, the ratio of the intersection and union of the two sets of true values and predicted values. The calculation formula is:
[0091]
[0092] p ji represents the number of true values j and predicted values i, and K+1 is the number of categories (including background categories). jj is the true value, p ji is the number of j predicted as i, i.e., false positive. ij It means that the true value is i and the number of predicted values is j, that is, false negative.
[0093] 2. Experimental parameter settings:
[0094] Loss function setting: Cross entropy, OHEM (Online Hard Example Mining, OHEM) and binary cross entropy loss functions are used to supervise the training process, among which the cross entropy loss function obtains a good result of 82.8%. The loss coefficients of the edge branch and the small target branch are set to 1 respectively.
[0095] Cityscapes training strategy settings: In order to further eliminate the contingency of the experiment, all networks are set the same during the training process. Optimizer: In order to ensure the accuracy of parameter updates and the cost of running time during training, SGD (Stochastic Gradient Descent, SGD) is selected as the optimizer for network training, with an initial learning rate of 0.01, a momentum parameter of 0.9, and a learning rate attenuation strategy of ploy. During training, 4 graphics cards (GPUs) are used, and the batch size of each GPU is set to 2. Data enhancement uses random flipping, random resizing, random cropping and other means, where the range of random resizing is (0.5, 2.0) and the scale of random cropping is. In addition, a multi-scale scheme with scales of 0.5, 1.0 and 2.0 is used for verification, and no coarsely labeled datasets are used during training.
[0096] PASCAL VOC, ADE20K and Camvid dataset training strategy settings: During the training process, a polynomial decay strategy was adopted, the initial learning rate was 0.01, and cropping sampling was used as preprocessing, the cropping size was 512×512, and the batch normalization parameters were fine-tuned during the training process. The number of iterations was 160,000.
[0097] 3. Experimental results:
[0098] In order to verify the effectiveness of the algorithm in this paper, this algorithm is experimentally compared with the following latest algorithms on Cityscapes data: FCN, PSPNet, Deeplabv3+, GSCNN, DSNet, EAMNet, PSANet, DANet, Maskformer. The experimental results are shown in Table 1 and Table 2, and the ablation experimental results are shown in Table 3. The visualization results are shown in Figure 7 As shown in Figure 2. From these segmentation results, we can see that this algorithm can obtain better segmentation results in some more complex scenes.
[0099] Table 1 shows the performance improvement compared with the current state-of-the-art methods (calculating GFLOPs when the input image size is 512x512):
[0100]
[0101] As can be seen from Table 1, the performance of this algorithm is improved compared with PSPNet, Deeplabv3+, DSNet and Maskformer algorithms when the backbone networks are ResNet50 and ResNet101 respectively. Among them, ResNet50 is used as the backbone network, and the performance of this algorithm is improved by about 2.8% compared with Deeplabv3+, and the number of parameters is reduced by 12GFLOPs. Compared with DSNet, the segmentation performance of this algorithm is improved by 0.6%. When ResNet101 is selected as the backbone network, the segmentation performance of this algorithm is improved by 3.0% and 0.2% respectively compared with Deeplabv3+ and DSNet, and the number of parameters is reduced by 20.5GFLOPs and 29.2GFLOPs. The module provided by the present invention can greatly improve the model segmentation performance without increasing network parameters.
[0102] Table 2 shows the segmentation results of each category on the Cityscapes validation set:
[0103]
[0104] Visual analysis: From Figure 5 From the visualization of the feature map, we can see that compared with FCN, the internal texture of large targets is smoothed, so the segmentation performance of large objects such as buses and cars is greatly improved. Compared with Deeplabv3+, the main improvement is the segmentation effect of small targets such as pedestrians in the distance in the scene. Because the ASPP module can aggregate the context well, it can alleviate the internal inconsistency phenomenon. However, the ASPP module aggregates the context based on the semantic information obtained at the output of the network, and its small targets and edges and other detailed information are already incomplete, so an edge enhancement module with correction is added to alleviate edge noise on the one hand and improve the segmentation effect of some small target objects on the other hand. However, the proportion of small targets and edges in the overall pixels is very small, so even if these detailed segmentation effects are improved, the overall segmentation performance will not be greatly improved. This is consistent with the above experimental results.
[0105] From the above visualization results, this algorithm can well handle the inconsistencies between the upper and lower parts of the large target in the FCN method, such as Figure 6 In all the places selected by the rectangular box, this algorithm alleviates the inconsistency of the internal texture of the large-sized bus. Figure 7 In all the rectangular boxes in the image, this algorithm corrects the pixel categories of traffic lights and road edges, suppresses the pixel categories of non-edge positions, handles small targets in Deeplabv3+ well, and alleviates edge noise.
[0106] Visualization results of each branch are displayed; in order to analyze the module effect provided by the present invention more intuitively, the output characteristics of each module in the algorithm of this paper are visualized. Figure 8 It can be seen that the high-level feature map contains a lot of spatial structure information, the channel feature map contains object contour information, which can well enhance the edge features of objects. The spatial feature map contains small target information such as traffic lights and pedestrians in the distance. The object contours in the output fusion feature map are significantly enhanced, and the features of distant objects are also more obvious.
[0107] Ablation experiment:
[0108] Table 3 shows the ablation experiment on the Cityscape validation set using FCN as the baseline:
[0109]
[0110] Improvement on the backbone network: We selected ResNet50 and ResNet101 as the backbone networks for the fully convolutional FCN backbone network, and conducted ablation experiments. As shown in Table 3(a), when ResNet50 is used as the backbone network, the mIoU of the original FCN is 71.4%, and the accuracy of the FCN with the ASPP module is 76.6%. When the model is embedded, the segmentation accuracy is improved by 3.5%. When ResNet101 is used as the backbone network, the segmentation accuracy is improved by 3.3%. The model based on ResNet50 is only 0.7% higher than the model based on ResNet101, indicating that when the network reaches a certain number of layers, its performance improvement is not proportional to the depth of the network layer.
[0111] Comparison with similar methods: Table 3(b) compares the performance of this algorithm with the current most similar methods. The present invention selects four methods that are closest to this algorithm in recent work, including: DCN, GSCNN, DSNet, and STLNet. The above experimental results show that compared with the first three most similar methods, this algorithm improves by 2.6%, 3%, and 0.7% respectively, and the module provided in the present invention has the best performance. Even compared with the latest international work STLNet, the performance of the algorithm in this paper is comparable.
[0112] Supervised ablation experiment: In Table 3(c), the loss function of the proposed method is subjected to an ablation experiment. If only the edge loss function is used to supervise the baseline network, the segmentation performance is improved by 0.2%. Edge enhancement can remove target edge noise, but the target edge pixels account for a very small proportion of the target, so the segmentation performance is only slightly improved by supervising the boundary. However, by supervising the edge and the segmented body at the same time, using the binary loss function and OHEM respectively, the segmentation accuracy is improved by 1% and 3.5%. This shows that the comprehensive loss function can better mine the pixel category information based on the boundary shape and position, and there is orthogonality between the edge and the body.
[0113] Ablation experiments of each part: Table 3(d) shows the ablation experiments of each module. In order to verify the impact of this algorithm on network performance, TTE and EEM are removed. If the TTE module is not used, the mIoU increases to 79.0% after the introduction of this algorithm. At the same time, after using TTE and EEM, the mIoU increases from 77.5% to 80.8%.
[0114] Other data experiments:
[0115] Table 4 shows the experimental results of the VOC 2012 dataset (calculating GFLOPs when the input image size is 512x512):
[0116]
[0117] Table 5 shows the experimental results of the ADE20K dataset (calculating GFLOPs when the input image size is 512x512):
[0118]
[0119]
[0120] Table 6 shows the experimental results of the Camvid dataset (calculating GFLOPs when the input image size is 512x512):
[0121]
[0122] From the above experimental results, compared with Deeplabv3+ and other methods, the proposed method has improved the segmentation accuracy of small target images to a certain extent. Figure 6 and Fig. 9From the visualization results, the detailed information of pedestrians in the distance has increased significantly, and the network output features contain a lot of spatial details and rich semantic information. Compared with similar methods, since the edges and small targets extracted in this paper have semantic category information, and the edge and small target pixel categories are trained and corrected, they can interact and fuse better with the main network image features. This not only improves the resolution of small targets and improves the segmentation effect of edges, but also makes the outline of large targets clearer, alleviates the fuzziness and confusion near the edges, and improves the segmentation accuracy of large targets. The overall image segmentation accuracy has increased by about 2%.
[0123] The differences between this algorithm and previous methods are mainly in the following three aspects. First, a new lightweight attention module PAM is designed, which obtains high-level semantic information in the low layer with rich details; then the edge and small target modeling of the module output features are performed respectively, and the small target and edge features are extracted. Finally, the corresponding loss function is set for the modeling and extraction results for supervised training. Since the small target and edge features are extracted in the PAM module at the bottom of the network, they have rich details and semantic category information. The trained features are fused with the features output by ASPP and the first layer features of the backbone network, so that the small target features, edge features, and main network image features interact with each other. While enhancing the small target and edge features, the category labels of the image pixels are also corrected, which improves the image segmentation accuracy.
[0124] Fig.11 The following is an architecture diagram of a small target feature enhanced image segmentation system, wherein the system comprises:
[0125] A backbone network module, used to input the image to be processed into the backbone network to obtain backbone network features, wherein the backbone network features include backbone network first layer features, backbone network second layer features, backbone network third layer features and backbone network fourth layer features;
[0126] The ASPP feature output module is used to input the fourth layer features of the backbone network into the ASPP module to obtain the ASPP feature output features;
[0127] The spatial feature output module is used to input the ASPP feature output features and the first layer features of the backbone network into the pixel spatial attention module PAM at the same time to obtain the pixel spatial features;
[0128] The feature extraction module is used to input the pixel space features into the small target extraction module TTE and the edge feature extraction module EEM at the same time to obtain the small target features and edge features respectively;
[0129] The feature fusion module is used to fuse and output the first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features.
[0130] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0132] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0134] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A small target feature enhanced image segmentation method, It is characterized in that The method comprises: Inputting the image to be processed into the backbone network to obtain backbone network features, wherein the backbone network features include backbone network first layer features, backbone network second layer features, backbone network third layer features and backbone network fourth layer features; Input the fourth layer features of the backbone network into the ASPP module to obtain the ASPP feature output features; The ASPP feature output features and the first layer features of the backbone network are simultaneously input into the pixel space attention module PAM to obtain the pixel space features; The pixel spatial features are simultaneously input into the small target extraction module TTE and the edge feature extraction module EEM to obtain the small target features and edge features respectively; The first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features are fused and output; The step of obtaining the pixel spatial feature specifically includes: converting the high-level feature y output by different expansion rates ASPP into ASPP ∈R W ×H×C and the first layer feature y of the backbone network res1 ∈R W×H×C As input, where C represents the channel dimension, WxH represents the spatial resolution, and y ASPP With y res1 The feature resolution of each channel of the high-level features is consistent. Each channel undergoes global average pooling and maximum pooling, and then passes through a shared network to generate a channel attention map. The shared network is composed of a multi-layer perception network consisting of two fully connected layers and an activation function. The scale of the hidden layer activation function is set to R (C×1×1) / r , r is the channel reduction rate, and then the two outputs are merged by element-wise summation, Then perform a global pooling operation to obtain features of two dimensions, namely and Merge and input into the single-layer perception operation. The specific process is as follows: The symbol || represents the convolution concatenation operation, which performs feature fusion on channel attention and spatial attention, and the fused features are output after normalization BN: PAM(and ASPP ,and res1 )=BN(and ASPP +And c +And s ), + indicates pixel-level addition; In the step of fusing and outputting the first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features, the formula used is as follows: y=y res1 +y ASPP +y edge +y tiny , Among them, y is the fusion output result, y res1 is the first layer feature of the backbone network, y ASPP Output feature for ASPP feature, y tiny is the small target feature, y edge is the edge feature, res1 ,y ASPP ,y tiny and edge 1x1 convolution is used for dimensionality reduction, so that all feature dimensions are consistent with y res1 The output dimensions are consistent, all features are upsampled, restored to a uniform resolution, and then pixel-level superposition is performed.
2. The small target feature enhanced image segmentation method according to claim 1, It is characterized in that The small target features are supervised and learned through the small target real-time image. The supervised learning process uses the small target loss function L tiny : in Assign a probability distribution to the label at pixel j, y j It is the label of the live image.
3. The small target feature enhanced image segmentation method according to claim 2, It is characterized in that Using the marginal loss function L edge Supervise edge features, L edge The definition is as follows:
4. The small target feature enhanced image segmentation method according to claim 3, It is characterized in that Using segmentation loss function L seg Supervise the segmentation process of the backbone network, and the segmentation loss function L seg It is expressed as: in Assign a probability distribution to the label at pixel j, y j It is the label of the live image.
5. The small target feature enhanced image segmentation method according to claim 4, It is characterized in that The total loss in network modeling is expressed as: Among them, L total is the total loss function, L seg is the segmentation loss function, L tiny is the small target loss function, L edge is the marginal loss function, is the network hyperparameter, is the segmentation loss weight coefficient, is the small target loss weight coefficient, is the weight coefficient of edge loss.
6. The small target feature enhanced image segmentation method according to claim 1, It is characterized in that The edge feature y is obtained by edge extraction module EEM edge The steps specifically include: convolving the output of the PAM module into a feature map M∈R of K channels W×H×K , perform argmax operation on M, obtain label maps of K categories, and perform gradient transformation Get K edge masks After normalization, it is combined with the features M∈R of K channels W×H×K Multiply them together to get the edge feature map B∈R containing the semantic category W×H×K , where K is the number of categories. In this step:
7. The small target feature enhanced image segmentation method according to claim 1, It is characterized in that The small target feature y is obtained through the small target extraction module TTE tiny The steps specifically include: statistically analyzing and sorting the number of each target pixel in the feature map output by the PAM module, and comparing the target pixel number with the maximum target pixel number in turn by setting a threshold tv. When it is less than a preset value, it is assumed to be a small target in the feature map, and a small target mask is used to obtain a small target feature map.
8. A small target feature enhanced image segmentation system, used to implement the small target feature enhanced image segmentation method according to any one of claims 1 to 7, It is characterized in that The system comprises: A backbone network module, used to input the image to be processed into the backbone network to obtain backbone network features, wherein the backbone network features include backbone network first layer features, backbone network second layer features, backbone network third layer features and backbone network fourth layer features; The ASPP feature output module is used to input the fourth layer features of the backbone network into the ASPP module to obtain the ASPP feature output features; The spatial feature output module is used to input the ASPP feature output features and the first layer features of the backbone network into the pixel spatial attention module PAM at the same time to obtain the pixel spatial features; The feature extraction module is used to input the pixel space features into the small target extraction module TTE and the edge feature extraction module EEM at the same time to obtain the small target features and edge features respectively; The feature fusion module is used to fuse and output the first layer features of the backbone network, the ASPP feature output features, the small target features and the edge features.
