Weakly supervised semantic segmentation method based on step-by-step inactivation of highly significant features
Through multi-scale image fusion and improved PDA method, the accuracy problem caused by significant area reduction in gigapixel image segmentation is solved, a more efficient semantic segmentation effect is achieved, the data annotation work is reduced, and the performance of the segmentation network is improved. .
Patent Information
- Application Number
- CN202311297475.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-10-09
AI Technical Summary
Semantic segmentation of gigapixel images is difficult and time-consuming. Existing methods fail to effectively utilize image context. The significant areas of the CAM images generated by the classification network shrink with iteration, resulting in low accuracy of the segmentation network.
Design a multi-scale segmentation network to provide global, structural and detailed information through the fusion of large, medium and small scale images, and use the improved Progressive Dropout Attention (PDA) method to reduce the activation value of the salient areas of the CAM image so that the classification network pays more attention to the non-salient region, generating more accurate pseudomasks for segmentation network training.
It effectively reduces the requirements for supervision information, improves the accuracy and performance of the segmentation network, ensures that the segmentation results are closer to the real value, reduces the data annotation work, and improves the segmentation effect of gigapixel-level images.
Smart Images

Figure CN118644670A
Abstract
Description
Technical Field
[0001] The invention relates to a weakly supervised semantic segmentation method based on gradual inactivation of highly significant features, and belongs to the field of computer vision. Background Art
[0002] The number of pixels in a gigapixel image is usually around 10 5 ×10 5 The size of each image is over 1G, and some even reach 3-5G. It will cost a lot of computing cost to operate and calculate it, so it is difficult to use gigapixel images for semantic segmentation. And it is very expensive and time-consuming to draw pixel-level labels on gigapixel images, so we use a weakly supervised semantic segmentation method based on the gradual inactivation of highly significant features to segment gigapixel images.
[0003] Currently, for gigapixel images, the common semantic segmentation method is to first set a sliding window on the image, crop the image into multiple slices, and then use the obtained slices to train the segmentation network. For example, Ronneberger et al. [1] The U-Net-based segmentation method was used to perform semantic segmentation on slice images, and good results were achieved. In addition, since the cost of drawing pixel-level labels for gigapixel images is too high, using image-level labels for weakly supervised semantic segmentation is one of the solutions. Weakly supervised segmentation methods using image-level labels require a good class activation map (CAM), so some studies have used different strategies to optimize the initially generated CAM map to obtain segmentation results. [2,3] Currently, there are few studies that use weakly supervised algorithms based on class activation mapping to segment gigapixel images, including Chan et al. [4] The Gradient-weighted Class Activation Mapping (Grad-CAM) method was used to generate the initial segmentation results, and the fully connected conditional random field was used to refine the segmentation results, but the results showed that its accuracy needs to be improved. On the one hand, the sliding window-based method does not consider the contextual relationship of the image. On the other hand, the salient area of the CAM map generated by the classification network in the CAM map-based method will gradually shrink to the most discriminative area as the number of training iterations increases, resulting in a large gap between the pseudo mask converted from the CAM map and the real mask, resulting in the low accuracy of the segmentation network trained using the pseudo mask.
[0004] When people observe gigapixel images, they always adjust the images to observe the target at different magnifications, and draw conclusions by integrating information of different scales. In order to comply with this observation logic, the present invention uses global and local information to supervise segmentation and input images of different scales into the segmentation network. In addition, because the classification network focuses more on the discriminative features, it will cause the significant area to gradually shrink. To solve this problem and make the CAM map generated by the classification network closer to the true value, the present invention reduces the activation value of the significant area in the activation map, prompting the classification network to pay more attention to the non-dominant area, so that the classification network generates a more accurate CAM map, and further obtains a more accurate pseudo mask.
[0005] References:
[0006] [1]Ronneberger, Olaf, Philipp Fischer, and Thomas Brox. "U-net: Convolutional networks for biomedical image segmentation." Medical ImageComputing and Computer-Assisted Intervention–MICCAI 2015:18th InternationalConference,Munich,Germany,October 5-9,2015,Proceedings,Part III 18.SpringerInternational Publishing,2015.
[0007] [2]Chang, Yu-Ting, et al. "Weakly-supervised semantic segmentation via sub-category exploration." Proceedings of the IEEE / CVF Conference on ComputerVision and Pattern Recognition. 2020.
[0008] [3] Selvaraju, Ramprasaath R., et al. "Grad-cam: Visual explanations from deep networks via gradient-based localization." Proceedings of the IEEEinternational conference on computer vision. 2017.
[0009] [4]Chan, Lyndon, et al. "Histosegnet: Semantic segmentation of histological tissue type in whole slide images." Proceedings of the IEEE / CVFInternational Conference on Computer Vision. 2019. Summary of the invention
[0010] The existing semantic segmentation method for gigapixel images slices the image through a sliding window and then trains it separately. However, a single slice cannot provide complete semantic information. To address this problem, the present invention designs a multi-scale segmentation network architecture, which uses three images of different scales as input to provide sufficient semantic information, including the largest scale image providing global background information; the medium-scale image providing structural information and serving as the image to be segmented; and the small-scale image providing detail information. The image features of these three scales are then fused to ensure that the features of images of different scales are fully utilized as much as possible. In addition, pixel-level annotation of gigapixel images is very time-consuming and laborious, so the present invention adopts a weakly supervised segmentation method, and uses the CAM map generated by the classification network as a pseudo-mask for the training of the segmentation network. However, because the salient areas in the CAM map generated by the classification network will shrink to only contain the most discriminative features, when the CAM map is used as a pseudo-mask for the segmentation network, the performance of the segmentation network will be greatly affected. To improve this situation, the present invention reduces the activation value of the salient area to encourage the classification network to pay more attention to the non-dominant area, thereby optimizing the CAM map.
[0011] The present invention adopts the following technical scheme: first, a gigapixel image is divided into three different scales: the large-scale image is defined as the whole image; the slice extracted by the sliding window, that is, the area to be segmented, is used as the medium-scale image; the small-scale image is obtained by cropping the medium-scale image, and the size is half of the medium-scale image, and the medium-scale and small-scale images have the same center. This method is divided into two networks: a classification network and a segmentation network. The classification network inputs the medium-scale image, and its function is to generate a CAM map. During the training process, we use the improved Progressive DropoutAttention (PDA) method to reduce the activation value of the high-significant features in the CAM, thereby reducing the contribution of the most discriminative area, so that the classification network pays more attention to other areas while not ignoring the features of the most discriminative area, and then classifies through the weighted feature map to expand the significant area of the CAM map generated by the classification network, thereby obtaining a more accurate CAM map, and the output of the final classification network is an optimized CAM map. The input of the segmentation network is three images of different scales, which is based on the U-Net network and consists of 3 encoders and 1 decoder. In the decoding stage, the network fuses the features of the three scales and uses the context information provided by the large and small scale images to obtain better segmentation performance. The output of the segmentation network is the final segmentation result. The specific network structure is shown in the attached figure. Figure 1 Segmentation results and CAM Figure 2 The valued pseudo-mask is used to optimize the segmentation network parameters by calculating the loss and back-propagating.
[0012] The specific scheme of the present invention is as shown in the attached Figure 2 shown.
[0013] Step 1: Image Preprocessing
[0014] The main task of image preprocessing is to crop each image in the data set into three images of different resolutions and unify the sizes of these three images. The data set referenced by the present invention is gigapixel data, such as the publicly available breast pathology slice image data set and remote sensing image data set. This step first crops the image, taking the original image as the large-scale image; using a sliding window to select the image to be segmented as the mesoscale image; selecting an area in the mesoscale image that is half the size and has the same center as the mesoscale image as the small-scale image. Then the large-scale image and the small-scale image are unified to the same size as the mesoscale image by downsampling and upsampling respectively.
[0015] Step 2: Get the class activation map
[0016] This step trains a classification network for the mesoscale image and then uses the Grad-CAM algorithm to generate a CAM map.
[0017] Step 2.1 Training the classification network: The present invention uses the classic convolutional neural network RseNet101 as the classification network, uses image-level classification labels as supervision information, and trains the network to predict category information (for example, predicting that the target in the remote sensing data set is an airplane, a ship, or a car).
[0018] Step 2.2 Calculate the CAM map: This step uses the Grad-CAM algorithm to generate the CAM map. We first extract the feature map of the last convolutional layer of the classification network in step 2.1; then back-propagate the prediction scores of each prediction category to obtain the gradient information of the prediction score relative to the output feature of the last convolutional layer; then average the gradient information to obtain the weight of each channel of the last layer of features for a category; finally, add the weight and feature layer weighted sum and activate it through ReLU (Rectified Linear Unit) to obtain the CAM map of the input image.
[0019] Step 3: Optimize the classification network
[0020] This step is performed during the training phase of the classification network. First, this step reduces the activation value of the significant area in the CAM map generated by the classification network to obtain the attention feature map; then it is used as a weight to act on the feature map output by the last convolutional layer of the classification network to prevent the model from over-focusing on the most discriminative areas with obvious features, and provide a more comprehensive feature representation; finally, the weighted feature map is predicted, the network is trained according to the real classification labels, and the network parameters are optimized.
[0021] Step 3.1: Reduce the activation value of the significant area in the CAM map: This step uses the improved PDA algorithm on the CAM to reduce the activation value of the significant area in the CAM. In order to make the network pay more attention to the area with non-significant features, the present invention sets a threshold to reduce the value of the area on the CAM map where the confidence is greater than the threshold, thereby reducing the weight of the corresponding area on the feature map, rather than directly setting the value of the area where the confidence is greater than the threshold to zero. In this way, the network can pay more attention to the non-dominant area while not ignoring these areas with highly significant features. And in order to prevent the trend of the significant area in the CAM map from gradually shrinking as the number of iterations increases, the present invention expands the area where the activation value is to be reduced by gradually lowering the threshold.
[0022] Step 3.2 generates an attention feature map: For the new CAM map generated in step 3.1, this step sums the CAM maps corresponding to different categories and calculates the average value to obtain the attention feature map.
[0023] Step 3.3 Optimize network parameters: This step first multiplies the attention feature map generated in step 3.2 with the feature map output by the last convolutional layer of the classification network to obtain a weighted feature map; then use this feature map for subsequent category prediction; finally calculate the loss with the true category label and back-propagate to update the network parameters. We predict category information through weighted feature maps, so that the classification network pays more attention to information outside the salient area. The CAM map generated by the optimized network will be closer to the true value, rather than generating a CAM map that only contains the most salient feature areas in the high-salient features.
[0024] Step 4: Training and predicting multi-scale segmentation network
[0025] In this step, we first use the classification network trained in step 3 to generate the CAM image of the mesoscale image, and convert it into a binary image as a pseudo mask for training the segmentation network; then the three images of different scales generated in step 1 are input into the three encoders of the segmentation network, and in the decoding stage, feature fusion and splicing are performed through jump connections and attention fusion modules to output the semantic segmentation results of the mesoscale image; finally, the trained segmentation network is used to perform segmentation prediction on the test set.
[0026] Step 4.1 Generate pseudo mask: In this step, the image to be segmented, i.e., the mesoscale image, is first input into the trained classification network to obtain the CAM map corresponding to the mesoscale image; then the category value corresponding to the maximum value of the same pixel position in the CAM map of each category is selected as the value of the position on the final CAM; finally, this CAM Figure 2 The pseudo mask obtained by quantization is used to train the segmentation network.
[0027] Step 4.2 Obtain multi-scale features: We input the three images of different scales obtained in step 1 into three different encoders of the segmentation network to obtain three sets of features of different scales. The three encoders use the encoder of the U-Net network architecture, which consists of convolution and downsampling.
[0028] Step 4.3 Feature fusion: This step is performed in the decoding stage of the segmentation network. We first upsample the output of the previous convolutional layer, and then use the skip connection structure to input the upsampled features and the features of the corresponding layers in the three encoders into the attention fusion module for fusion. The fused features are then input into the convolutional layer, and this cycle is repeated layer by layer to finally obtain the segmentation result.
[0029] Step 4.4 Segmentation network training and prediction: This step uses the pseudo mask obtained in step 4.1 to train the segmentation network, and then uses the trained segmentation network to segment the test set.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The weakly supervised semantic segmentation method based on the gradual inactivation of highly significant features adopted in the present invention effectively avoids the pixel-level labels required for fully supervised learning, reduces the requirements for supervisory information, and greatly reduces the work of data labeling.
[0032] 2. The weakly supervised semantic segmentation method based on the gradual inactivation of highly significant features adopted in the present invention uses an improved PDA method for CAM, so that the classification network pays more attention to the non-significant areas of the image while not ignoring the most discriminative areas, preventing the significant areas of the CAM image from shrinking, thereby obtaining a pseudo-mask that is closer to the true value.
[0033] 3. The weakly supervised semantic segmentation method based on the gradual inactivation of highly significant features adopted in the present invention divides the image into three different scales: large, medium and small, and performs feature map splicing and fusion in the segmentation network, so that the segmentation network can obtain as much semantic information as possible, including large-scale images providing global background information; medium-scale images providing structural information and serving as segmentation objects; small-scale images providing detail information, thereby obtaining more accurate segmentation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Schematic diagram of the network structure of the segmented network of the present invention.
[0035] Figure 2 The present invention provides an overall flow chart of the method. DETAILED DESCRIPTION
[0036] The following is a detailed description of the implementation examples of the present invention in conjunction with the accompanying drawings:
[0037] The present invention is a weakly supervised semantic segmentation method based on the gradual inactivation of highly significant features, which consists of four stages: the first stage is the image preprocessing stage, in which all images in the data set are first divided into images of three different scales, and the images of different scales are unified to the same size by upsampling or downsampling. The second stage is the generation of CAM images. This stage mainly includes the training of the classification network and the calculation method of extracting CAM from the classification network. The third stage is the optimization of the classification network. In the classification network training process, this stage first reduces the value of the area with high confidence in the CAM image by the improved PDA method; then various CAM images are fused to obtain an attention feature map; then the attention feature map is multiplied with the feature map output by the last convolutional layer of the classification network to obtain a weighted feature map, and then the feature map is used for subsequent prediction to obtain a category score; finally, the classification network parameters are optimized by the real category label, so that the CAM map generated by the classification network is more accurate. The fourth stage is the training and prediction of the segmentation network. In this stage, the classification network is first used to generate the CAM map of the medium-scale image, and its binarization is used as a pseudo-mask to supervise the training of the segmentation network; then the three images of different scales obtained by preprocessing are input into the segmentation network, and the features of different scales are obtained through three encoders respectively; then in the decoding stage, the features of different scales are fused using jump connections and attention fusion modules, and finally the prediction results are output; finally, the trained segmentation network is used to perform segmentation prediction on the gigapixel image.
[0038] Specifically, the method comprises the following steps:
[0039] Step 1: Image Preprocessing
[0040] The purpose of this step is to crop the original image into three images of different resolutions and unify the size of all images in the dataset. large is the original image; the mid-scale image p mid It is a 512*512 size image cropped by sliding window; small scale image p littleIt is cropped from the mesoscale image, its size is half of the mesoscale image, and it has the same center as the mesoscale image. The data referenced by the present invention are mainly gigapixel image data, such as the public breast pathology slice image data set and remote sensing image data set. The different images in the data set and the three different scale images obtained after cropping have different resolutions, and the fixed parameters in the classification network and the segmentation network cannot adapt to different image sizes, so the sizes of all input images must be unified. In order to reduce the loss of image information and prevent the subsequent calculation cost from being too large, we set the size of all images to 512*512. It should be noted that in the process of downsampling large-scale images, because large-scale images are used to provide background information, losing some information will not affect the segmentation results too much.
[0041] Step 2: Get the class activation map
[0042] In this step, a classification network is trained for the input image to be segmented, i.e., the mesoscale image, and then the Grad-CAM algorithm is used to obtain the CAM map of the mesoscale image.
[0043] Step 2.1: Training the classification network: The present invention uses the classic convolutional neural network RseNet101 as the classification network, which includes 100 convolutional layers and 1 fully connected layer. The present invention trains a classification network based on the category label for the input mesoscale image, denoted as Cls.
[0044] Step 2.2 Calculate the CAM graph: This step uses the Grad-CAM algorithm to generate the CAM graph. For the classification network Cls, we first extract the feature graph f output by its last convolutional layer, and perform back propagation on the prediction scores of each prediction category, and obtain the gradient information g of the prediction score relative to f by formula (1).
[0045]
[0046] where y c represents the score predicted by the network for category c, which is the score without softmax activation. The gradient information g is y c The partial derivative of f represents the partial derivative of each element in f with respect to y. c Then we calculate the average value of the gradient information g over the width w and height h to get the weight of feature f corresponding to channel k for category c Obtained by formula (2).
[0047]
[0048] where g k(i, j) represents the value of the gradient information at the coordinate (i, j) in channel k, and Z is equal to the value of the width w multiplied by the height h. Finally, we weight The weighted sum of the feature layer f and the ReLU activation is used to obtain the CAM map M of the input image for category c according to formula (3): c .
[0049]
[0050] where f k Represents the data of the kth channel of the feature map f. ReLU is the ReLU activation function, which can filter out negative activation values.
[0051] Step 3: Optimize the classification network
[0052] This step is performed during the training phase of the classification network. First, this step uses the improved PDA algorithm on the CAM map calculated in step 2.2 to reduce the activation value of its significant area, thereby obtaining an attention feature map; then the attention feature map is used as a weight to act on the feature map output by the last convolutional layer of the classification network; finally, the weighted feature map is input into the fully connected layer to obtain the classification result. The classification network is trained using real classification labels to optimize the parameters of the classification network, so that the model pays more attention to information outside the most discriminative feature area and can generate a more comprehensive feature representation.
[0053] Step 3.1: Reduce the activation value of the salient area in the CAM image: This step reduces the activation value of the CAM image M. c The improved PDA algorithm is used to reduce the activation value of the significant area in the CAM. First, the algorithm sets the threshold value to β, and reduces the activation value of the area on the CAM map that is greater than the threshold value to half of the original value, and obtains the new CAM map M′ corresponding to category c. c , as shown in formula (4).
[0054]
[0055] Among them, M c (i, j) represents the value at coordinate (i, j) in the CAM map corresponding to category c. β is a relative threshold value, which changes with the CAM map M. c β changes with the change of the maximum value, and β can be obtained by formula (5).
[0056] β=θ*max(M c )#(5)
[0057] θ is not a fixed value, it will gradually decrease with the increase of the number of iterations until it decreases to the pre-given lower bound l. Thus, the threshold β gradually decreases with the number of iterations. The value of θ is obtained by formula (6).
[0058]
[0059] Where ω represents the decay rate of θ, which is a fixed value, ω=0.985. θ t It represents the value of θ at the tth iteration, and its initial value θ1 is 1. The pre-given lower bound l is 0.65.
[0060] Step 3.2 generates the attention feature map: For the CAM map M′ newly obtained in step 3.1, this step sums up the CAM maps corresponding to different categories and calculates the average value, and obtains the attention feature map A according to formula (7).
[0061]
[0062] Where N represents the number of all categories. M′ c (i, j) represents the value at coordinate (i, j) in the new CAM map of category c.
[0063] Step 3.3 Optimize network parameters: As shown in formula (8), we multiply the attention feature map A generated in step 3.2 with the feature map f output by the last convolutional layer of the classification network Cls to obtain the weighted feature map
[0064]
[0065] Then we take the feature map The input is sent to the fully connected layer of the classification network for subsequent category prediction. Finally, we calculate the loss of the predicted information and the true category label and back-propagate to update the network parameters.
[0066] Step 4: Training and predicting multi-scale segmentation network
[0067] This step first uses the classification network trained in step 3 to generate a CAM image of the mesoscale image, and converts it into a binary image as a pseudo mask for training the segmentation network; then the three images of different scales generated in step 1 are respectively input into the three encoders of the segmentation network, and in the decoding stage, feature fusion and splicing are performed through jump connections and attention fusion modules, and finally the segmentation result of the mesoscale image is output; finally, the trained segmentation network is used to perform segmentation prediction on the test set.
[0068] Step 4.1 Generate pseudo mask: This step first converts the image to be segmented, i.e., the mid-scale image p mid Input it into the trained classification network Cls to obtain the CAM map corresponding to the mesoscale image; then select the category value corresponding to the maximum value of the same pixel position in the CAM map of each category as the value of the position on the final CAM, and the final class activation map M finalThe calculation formula of is shown in formula (9).
[0069] M final = argmax(M 1 , M 2 , ..., M N )#(9)
[0070] The function of argmax is to compare the values at the same coordinates in all CAMs and return the index corresponding to the maximum value, i.e., the category value. final Transformed into a binary pseudo mask for segmentation network training segmentation category c. Pseudo mask The value of the mid-coordinate (i, j) is determined by formula (10)
[0071]
[0072] Where c is the category to be segmented.
[0073] Step 4.2 Obtain multi-scale features: We take the three images of different scales obtained in step 1 large 、p mid 、p little They are input into three different encoders E1, E2, and E3 of the segmentation network to obtain three sets of features f of different scales. large 、f mid 、f little The structures of the three encoders refer to the encoder structure in the U-Net network, which consists of convolutional layers and downsampling.
[0074] Step 4.3 Feature Fusion: This step is performed in the decoding phase of the segmentation network. We first merge the previous convolutional layer The output of is upsampled, and the upsampling result is obtained by formula (11) Then, the upsampling result is transformed into and the features of the corresponding layers in the three encoders Input into the attention fusion module for fusion, the fused feature map Obtained by formula (12).
[0075]
[0076]
[0077] UP is the up-sampling operation. Represents the output of the i-1th convolutional layer. att The feature fusion module is an attention fusion module. The feature fusion process is as follows: First, the features output by the three different encoders are Perform splicing and obtain the splicing result by formula (13):
[0078]
[0079] in is the feature map concatenation operation, that is, merging the feature maps in the channel dimension. Then the attention fusion module performs convolution, pooling and activation operations on the concatenated feature maps, and obtains an attention map according to formula (14):
[0080]
[0081] Where W represents a series of operations including convolution, pooling and activation. Finally, the attention map is used Centering scale features The weighted result is the same as the upsampled feature After splicing, the attention fusion module Block is obtained by formula (15) att The final output.
[0082]
[0083] The fused features are then passed through the convolution layer to obtain the output of the i-th layer In this way, the segmentation result is finally obtained layer by layer.
[0084] Step 4.4 Segmentation network training and prediction: This step first uses the pseudo mask obtained in step 4.1 to train the segmentation network, and then uses the trained segmentation network to segment the test set.
Claims
1. A weakly supervised semantic segmentation method based on gradual inactivation of highly significant features, characterized by: Step 1: Image Preprocessing The original image is cropped into three images of different resolutions and the sizes of all images in the dataset are unified; the large-scale image p large is the original image; the mid-scale image p mid It is a 512*512 size image cropped by sliding window; small scale image p little It is cropped from the medium-scale image, and the size of all images is set to 512*512; Step 2: Get the class activation map This step trains a classification network for the input image to be segmented, i.e., the mesoscale image, and then uses the Grad-CAM algorithm to obtain the CAM map of the mesoscale image; Step 2.1: Train the classification network: Use the classic convolutional neural network RseNet101 as the classification network, which contains 100 convolutional layers and 1 fully connected layer; train a classification network based on the category label of the input mid-scale image, denoted as Cls; Step 2.2 Calculate the CAM graph: This step uses the Grad-CAM algorithm to generate the CAM graph. For the classification network Cls, first extract the feature graph f output by its last convolutional layer, and perform back propagation on the prediction scores of each prediction category to obtain the gradient information g of the prediction score relative to f using formula (1). where y c represents the score predicted by the network for category c, which is the score without softmax activation; the gradient information g is y c The partial derivative of f represents the partial derivative of each element in f with respect to y. c Contribution; then the gradient information g is averaged over width w and height h to obtain the weight of feature f corresponding to channel k for category c From formula (2), we get: where g k (i, j) represents the value of the gradient information at the coordinate (i, j) in channel k, and Z is equal to the value of the width w multiplied by the height h; finally, the weight The weighted sum of the feature layer f and the ReLU activation is used to obtain the CAM map M of the input image for category c according to formula (3): c ; where f k Represents the data of the kth channel of the feature map f; ReLU is the ReLU activation function, through which negative activation values can be filtered out; Step 3: Optimize the classification network This step is performed during the training phase of the classification network. First, the improved PDA algorithm is used on the CAM map calculated in step 2.2 to reduce the activation value of its significant area, thereby obtaining an attention feature map. Then, the attention feature map is used as a weight on the feature map output by the last convolutional layer of the classification network. Finally, the weighted feature map is input into the fully connected layer to obtain the classification result. Use the real classification labels to train the classification network, thereby optimizing the parameters of the classification network, so that the model pays more attention to information outside the most discriminative feature area and can generate a more comprehensive feature representation; Step 3.1: Reduce the activation value of the salient area in the CAM image: This step reduces the activation value of the CAM image M. c The improved PDA algorithm is used to reduce the activation value of the significant area in the CAM. First, the algorithm sets the threshold value to β, and reduces the activation value of the area on the CAM map that is greater than the threshold value to half of the original value, and obtains the new CAM map M′ corresponding to category C. c , as shown in formula (4); Among them, M c (i, j) represents the value at coordinate (i, j) in the CAM graph corresponding to category c; β is a relative threshold value, which changes with the CAM graph M c The maximum value of changes with the change of , β can be obtained by formula (5); β=θ*max(M c )#(5) Where θ is not a fixed value. It will gradually decrease with the increase of the number of iterations until it decreases to the pre-given lower bound l. Thus, the threshold β gradually decreases with the number of iterations. The value of θ is obtained by formula (6); Where ω represents the decay rate of θ, which is a fixed value, ω=0.985; θ t represents the value of θ at the tth iteration, and its initial value θ1 is 1; the pre-given lower bound l is 0.65; Step 3.2 Generate attention feature map: For the CAM map M′ newly obtained in step 3.1, this step sums up the CAM maps corresponding to different categories and calculates the average value, and obtains the attention feature map A according to formula (7); Where N represents the number of all categories; M′ c (i, j) represents the value at coordinate (i, j) in the new CAM map of category c; Step 3.3 Optimize network parameters: As shown in formula (8), multiply the attention feature map A generated in step 3.2 by the feature map f output by the last convolutional layer of the classification network Cls to obtain the weighted feature map Then the feature map Input to the fully connected layer of the classification network for subsequent category prediction; finally, the prediction information and the true category label are used to calculate the loss and back-propagate to update the network parameters; Step 4: Training and predicting multi-scale segmentation network This step first uses the classification network trained in step 3 to generate a CAM image of the mesoscale image, and converts it into a binary image as a pseudo mask for training the segmentation network; then the three images of different scales generated in step 1 are respectively input into the three encoders of the segmentation network, and in the decoding stage, feature fusion and splicing are performed through the jump connection and attention fusion module, and finally the segmentation result of the mesoscale image is output; finally, the trained segmentation network is used to perform segmentation prediction on the test set; Step 4.1 Generate pseudo mask: This step first converts the image to be segmented, i.e., the mid-scale image p mid Input it into the trained classification network Cls to obtain the CAM map corresponding to the mesoscale image; then select the category value corresponding to the maximum value of the same pixel position in the CAM map of each category as the value of the position on the final CAM, and the final class activation map M final The calculation formula of is shown in formula (9); M final =argmax(M 1 ,M 2 ,...,M N )#(9) The function of argmax is to compare the values at the same coordinates in all CAMs and return the index corresponding to the maximum value, i.e., the category value. final Transformed into a binary pseudo mask for segmentation network training segmentation category c; pseudo mask The value of the mid-coordinate (i, j) is determined by formula (10) Where c is the category to be segmented; Step 4.2 Obtain multi-scale features: The three images of different scales plarge, p mid 、p little They are input into three different encoders E1, E2, and E3 of the segmentation network to obtain three sets of features f of different scales. large 、f mid 、f little ; The structures of the three encoders refer to the encoder structure in the U-Net network, which consists of convolutional layers and downsampling; Step 4.3 Feature Fusion: This step is performed in the decoding phase of the segmentation network. First, the previous convolutional layer The output of is upsampled, and the upsampling result is obtained by formula (11) Then, the upsampling result is transformed into and the features of the corresponding layers in the three encoders Input into the attention fusion module for fusion, the fused feature map From formula (12), we get: Where UP is the upsampling operation; Represents the output of the i-1th convolutional layer; Block att The feature fusion module is an attention fusion module. The feature fusion process is as follows: First, the features output by the three different encoders are Perform splicing and obtain the splicing result by formula (13): in is the feature map concatenation operation, that is, merging the feature maps in the channel dimension; then the attention fusion module performs convolution, pooling and activation operations on the concatenated feature maps, and an attention map is obtained by formula (14): Where W represents a series of operations including convolution, pooling and activation; finally, the attention map is used Centering scale features The weighted result is the same as the upsampled feature After splicing, the attention fusion module Block is obtained by formula (15) att Final output: The fused features are then passed through the convolution layer to obtain the output of the i-th layer In this way, the segmentation result is finally obtained layer by layer. Step 4.4 Segmentation network training and prediction: This step first uses the pseudo mask obtained in step 4.1 to train the segmentation network, and then uses the trained segmentation network to segment the test set.
Citation Information
Patent Citations
Image semantic segmentation method and computer equipment
CN113159057A
Weak supervision semantic segmentation method based on non-salient region object mining
CN115393598A
Image semantic segmentation method, electronic equipment and computer readable storage medium
CN116258850A
Weak supervision semantic segmentation method of improved convolutional neural network
CN116310320A
Video semantic segmentation method based on active learning
US20220215662A1
