A semantic segmentation method based on inverse attention model

By introducing the reverse attention model and Gumbel softmax loss function in the semantic segmentation model, the problem of low segmentation accuracy of small goals and complex scenes in the existing technology is solved, the segmentation accuracy and model training efficiency are improved, and the model structure is simplified.

CN111680695BActive Publication Date: 2024-11-26HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010513903.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-08
Publication Date
2024-11-26
Estimated Expiration
2040-06-08

Smart Images

  • Figure CN111680695B_ABST
    Figure CN111680695B_ABST
Patent Text Reader

Abstract

The invention relates to a semantic segmentation method based on an inverse attention model. The method mainly comprises the following steps: firstly obtaining an image data set, constructing a training set and a test set; constructing a deep semantic segmentation network model, wherein the deep semantic segmentation network model comprises a basic network model and an inverse attention model; inputting the features output by the basic network into the inverse attention model to calculate an attention view, and gradually reacting the attention view to the low-level output features of the basic semantic segmentation network, and fusing the attention view with the output features of the basic network and its up-sampled features to obtain a final segmentation result; the model only uses the output features of the basic semantic segmentation network to calculate the attention view, and guides the low-level features to be integrated into the output features of the basic semantic segmentation network, thereby suppressing the noise in the low-level features of the model, and improving the robustness and segmentation accuracy of the semantic segmentation model; meanwhile, a loss function based on Gumbel softmax is added to the high-level output features of the basic semantic segmentation model to speed up the model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a semantic segmentation method based on an inverse attention model. Background Art

[0002] In recent years, deep learning has made rapid progress. Deep learning models represented by convolutional neural networks (CNN) have once again ignited the once dormant neural networks and set off a wave of deep learning in academia and industry.

[0003] Early DNN-based segmentation models were limited by the fixed size of the input image. To solve this problem, Long and Shelhamer from the University of Berkeley proposed a fully convolutional network (FCN) for image semantic segmentation. By using convolution instead of the fully connected layer, and using deconvolution and upsampling techniques to map the dense prediction map output by the network to the original image, end-to-end semantic segmentation is achieved, and the DNN model can process images of any size. Increasing the receptive field is an important factor in obtaining image semantic information, but multiple downsampling can easily cause problems such as loss of image details and boundary offset. On this basis, DeeplabV2 model, DeeplabV3 model, DeeplabV3+ model, PSPNet model and U-net model and their improved models have been proposed one after another, with improvements in model architecture, upsampling strategy, receptive field size, etc., especially the Deeplab series, which has effectively improved segmentation accuracy by introducing the dilated convolution technology.

[0004] At present, all semantic segmentation methods based on deep learning are developed based on the idea of ​​full convolutional networks, which greatly improves the accuracy of segmentation. However, most algorithms are based on public data sets. In actual scene images, there are often some small targets or complex scenes, which poses a challenge to existing models. In recent years, researchers have applied the attention model to the convolutional neural network model, trying to extract accurate pixel-level attention features from the high-level features of CNN to improve the segmentation effect from another perspective. Among them, the attention model in deep learning actually simulates the attention model of the human brain, which assigns greater weight to the things of concern. Li et al. proposed a pyramid attention network, which uses the global context information of the image to solve the semantic segmentation problem, and combines the attention mechanism with the spatial pyramid to extract accurate and dense features and obtain pixel labels. Fu et al. proposed DANet, a scene segmentation network integrating a dual-path attention mechanism. The latest semantic segmentation framework is the Gated Shape CNNs (GSCNN) network proposed by Takikawa et al., which uses the Gated Convolutional Layer to convert the information in the conventional semantic network flow into the shape information of the object, thereby adding a Shape flow to the typical network architecture. That is, the Gated convolutional layer combines the shape flow and the regular flow to finally obtain the final segmentation result.

[0005] However, this method increases the number of model learning parameters and is more complicated. In addition, cross attention models and convolutional block attention models have also been widely used. Summary of the invention

[0006] The purpose of the present invention is to provide a semantic segmentation method based on an inverse attention model to improve the performance of image semantic segmentation.

[0007] To solve the above technical problems, the technical solution of the present invention is: a semantic segmentation method based on a reverse attention model, comprising the following steps:

[0008] (1) Obtain image datasets and construct training and test sets;

[0009] (2) constructing a deep semantic segmentation network model, wherein the deep semantic segmentation network model includes a basic network model and a reverse attention model;

[0010] The basic network model includes a plurality of convolution modules and an ASPP output module connected in sequence, and the ASPP output module is used for outputting the output features of the basic network model;

[0011] The processing process of the reverse attention model is:

[0012] 1) The output features of the basic network model are passed through a convolution layer to obtain a reduced-dimensional output feature, and the reduced-dimensional output feature is input into an attention calculation model to obtain a first attention view, and the reduced-dimensional output feature is dot-multiplied with the first attention view, and then superimposed with the reduced-dimensional output feature to obtain a first output feature;

[0013] 2) upsampling the first output feature to obtain features of at least two different scales, calculating an attention view for the features of each scale, and performing dot multiplication of the obtained attention views of different scales with the feature map of the basic network model, superimposing the results of the dot multiplication with the features of the corresponding scales, obtaining output feature maps of different scales, and fusing the output feature maps of different scales with the first output feature to obtain an output result;

[0014] (3) inputting the training set into the deep semantic segmentation network model for training to obtain a trained deep semantic segmentation network model;

[0015] (4) Input the test set into the trained deep semantic segmentation network model to obtain the image segmentation results.

[0016] The beneficial effects of the present invention are:

[0017] In the present invention, the attention view of the high-level features of the model is iteratively reacted to the low-level features of the model to improve the accuracy of the semantic segmentation results. Compared with the traditional attention model in the semantic segmentation method, the self-attention model in the traditional method is a method of calculating the attention view of the output features of the current layer in the model and then acting on the output features of the current layer, while the method in the present invention uses the semantic information in the reverse attention model to suppress the noise in the low-level features of the model, that is, the attention view is calculated based on the final output features of the basic model, and the low-level features of the model are integrated into the final output features of the basic model as a guide. The final output features integrate the high-level semantic information and the low-level boundary information. The reverse attention model in the present invention can also accelerate the convergence process of the parameters of the back propagation process of the deep convolutional neural network model. In addition, the loss function based on Gumbel softmax is used to calculate the difference between the model prediction boundary and the labeled image boundary, thereby guiding the deep convolutional neural network model to pay more attention to the boundary information of the image and accelerate the speed of model training.

[0018] Furthermore, the loss functions adopted by the deep semantic segmentation network model include a cross entropy loss function and a Gumbel softmax-based loss function.

[0019] Furthermore, the attention calculation model adopts a combination of channel attention and spatial attention, that is, M(F) = σ(M c (F)+M s (F)),

[0020] where F∈R H×W×C is the input feature, H is the length of the image, W is the width of the image, C is the number of channels, M c is the channel attention calculation function, c is the channel attention, M s is the spatial attention calculation function, s is the spatial attention, σ is the sigmoid function; M c and M s They are defined as follows:

[0021] M c (F) = BN(MLP(AvgPool(F)))

[0022] =BN(w1(w0AvgPool(F)+b0)+b1)

[0023]

[0024] Among them, MLP represents multi-layer perceptron, that is, fully connected; AvgPool is the average pooling layer, BN is batch normalization, w0 and w1 are network weights, b0 and b1 are offset parameters, w0∈R C / r×C , b0∈R C / r , w1∈R C×C / r and b1∈R C , r is the channel scaling ratio, C is the number of channels; f0, f1, f2, f3 are convolution operations, 1×1 and 3×3 are the convolution kernel sizes.

[0025] Furthermore, the loss function calculation process based on Gumbel softmax is as follows:

[0026] 1) The first output feature passes through the convolutional layer and the output dimension is the feature Y of the number of semantic segmentation categories N×c , each sample i(y i =[y i1 ,...,y ic ]) generate c independent samples ∈1,...,∈ c ;

[0027] 2) The calculated noise is G i =-log(-log(∈ i ));

[0028] 3) Add the randomly generated samples and the network model output feature Y to obtain the Gumbel distribution:

[0029] v i =[y i1 +G1,...,y ic +G c ];

[0030] 4) The softmax function is used to calculate the probability of the output feature to obtain a category in approximate one-hot form:

[0031]

[0032] Among them, τ is the temperature parameter, which controls the degree to which the Gumbel softmax output is close to one-hot. The smaller the temperature coefficient value, the closer the output result is to the one-hot form, and vice versa, the closer it is to uniform distribution; v i and v j is the Gumbel distribution obtained by adding noise to sample y;

[0033] 5) For σ τ (v i ) performs Gaussian smoothing and calculates its gradient to obtain boundary information Then, the labeled image is converted into one-hot form, Gaussian smoothing is performed and the gradient information B is calculated. The L1 norm between α and B is used as the loss function of the last layer of the base network model.

[0034] Furthermore, when the basic network model is DeeplabV2 based on VGG16, the basic network model includes five feature extraction blocks and an ASPP module, and the five feature extraction blocks include a first convolution module, a first pooling layer, a second convolution module, a second pooling layer, a third convolution module, a third pooling layer, a fourth convolution module, a fourth pooling layer, a fifth convolution module, and a fifth pooling layer in sequence; wherein each convolution module contains 2 to 3 convolution layers, and the convolution layers of the fourth convolution module and the fifth convolution module are hollow convolutions; and the ASPP module is a pyramid structure with hollow convolutions.

[0035] Furthermore, the first convolution module in the VGG16 includes 2 3×3 convolution layers with an output dimension of 64; the second convolution module includes 2 3×3 convolution layers with an output dimension of 128; the third convolution module includes 3 3×3 convolution layers with an output dimension of 256; the fourth convolution module includes 3 3×3 convolution layers with an output dimension of 512; the fifth convolution module includes 3 3×3 convolution layers with an output dimension of 512; the output of the fifth convolution module is connected to the ASPP module.

[0036] Furthermore, the deep semantic segmentation model is a deeplabv3 model based on VGG16. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the semantic segmentation method of the reverse attention model based on the Deeplab V2 network model of the present invention. DETAILED DESCRIPTION

[0038] In order to elaborate on the purpose, technical solutions and advantages of the present invention, the present invention is further described in detail below in conjunction with specific implementation steps and drawings.

[0039] The present invention provides a semantic segmentation method based on an inverse attention model. In the commonly used fully convolutional network (CNN) semantic segmentation model, an inverse attention model is introduced to react the attention view of the high-level output features of the model to the low-level features of the model, and multi-feature fusion is performed to maintain the boundary information in the segmentation result, while filtering out some noise information and improving the accuracy of the semantic segmentation result.

[0040] Since the present invention adds a loss function based on Gumbel softmax to the features of the last layer of output features of the basic semantic segmentation model after attention self-enhancement, and since Gumbel softmax is more similar to the classification results in one-hot form, the boundary error can be calculated through the loss function, which can accelerate the convergence of model training parameters.

[0041] Specifically, the semantic segmentation method of the present invention is introduced below by taking the deeplabV2 network architecture as an example.

[0042] It should be noted that the deep semantic segmentation network model in this application is based on the network architecture of the traditional classic semantic segmentation model; the basic network model architecture can be VGG16 or ResNet, etc.

[0043] like Figure 1As shown in the figure, taking the image data in the flat warehouse as an example, a deep semantic segmentation network model based on Deeplab V2 is constructed, which includes a VGG16 feature extraction module, an ASPP module, a reverse attention model, a cross entropy loss function, and a loss function based on Gumbel softmax, etc.; wherein, the VGG16 network architecture includes five feature extraction blocks, each convolution module contains 2 to 3 convolution layers, each convolution layer in each convolution module is followed by a nonlinear corresponding ReLU layer, and each convolution module is followed by a pooling layer; the convolution layers of the fourth convolution module and the fifth convolution module are hollow convolutions; wherein, the ASPP (Atrous Spatial Pyramid Pooling) module is a pyramid structure with hollow convolutions.

[0044] Specifically, the steps of the semantic segmentation method of this embodiment are as follows:

[0045] Step 1: Obtain image datasets and construct training sets and test sets;

[0046] Step 2: Build a deep semantic segmentation network model, including a basic network model and a reverse attention model;

[0047] Among them, the basic network model is the Deeplab V2 model based on VGG16 or the deeplabv3 model based on VGG16;

[0048] In this embodiment, the Deeplab V2 model of VGG16 is taken as an example. The basic network model includes five feature extraction blocks and an ASPP output module. The five feature extraction blocks include the first convolution module, the first pooling layer, the second convolution module, the second pooling layer, the third convolution module, the third pooling layer, the fourth convolution module, the fourth pooling layer, the fifth convolution module, and the fifth pooling layer in sequence; each convolution module includes 2 to 3 convolution layers, and the convolution layers of the fourth convolution module and the fifth convolution module are hollow convolutions; the first convolution module includes 2 3×3 convolutions layer, with an output dimension of 64; the second convolution module includes 2 3×3 convolution layers, with an output dimension of 128; the third convolution module includes 3 3×3 convolution layers, with an output dimension of 256; the fourth convolution module includes 3 3×3 convolution layers, with an output dimension of 512; the fifth convolution module includes 3 3×3 convolution layers, with an output dimension of 512; the output of the fifth convolution module is connected to the ASPP output module; the ASPP output module is a pyramid structure with a hole convolution, which is used to output the output features of the basic network module.

[0049] The processing process of the reverse attention model is:

[0050] 1) The last layer in the basic network model (i.e. Figure 1 The output feature of the ASPP layer in the above example is reduced in dimension by a 1×1 convolutional layer to obtain the feature F. h , input the attention calculation model to obtain the first attention view M(F0 h ), which reacts to feature F h ,get

[0051] 2) Taking the output feature F0 as the high-level feature, calculate the attention views A of two different scales respectively i (i=1,2), and reacts to the two low-level output features F of the basic network model l i (output features of the i-th layer), the processed features are fused with F0 and the scale-changed features, and the fused features are passed through two 3×3 convolutional layers and one 1×1 convolutional layer to obtain the output result.

[0052] It should be noted that if F l i The number of channels and resolution of F0 are different. We can use upsampling operation to upsample F0 and use 3×3 convolution layer to upsample F0. l i The number of channels is reduced to the same number of channels as F0, and the attention view A based on F0 is calculated. i , which reacts to F l i The fusion process with F0 is: where ⊙ represents the element-wise product, It represents the addition of elements;

[0053] The attention calculation model in this embodiment adopts a combination of channel attention and spatial attention, that is, M(F) = σ(M c (F)+M s (F)), where F∈R H×W×C is the input feature, H is the length of the image, W is the width of the image, C is the number of channels, M c is the channel attention calculation function, c is the channel attention, M s is the spatial attention calculation function, s is the spatial attention, σ is the sigmoid function; M c and M s They are defined as follows:

[0054] M c (F) = BN(MLP(AvgPool(F)))

[0055] =BN(w1(w0AvgPool(F)+b0)+b1)

[0056]

[0057] Where MLP represents a multi-layer perceptron (i.e., fully connected), AvgPool is an average pooling layer, BN is batch normalization, w0 and w1 are network weights, b0 and b1 are offset parameters, and w0∈R C / r×C , b0∈R C / r , w1∈R C×C / r and b1∈R C , r is the channel scaling ratio, C is the number of channels; f0, f1, f2, f3 are convolution operations, 1×1 and 3×3 are the convolution kernel sizes.

[0058] The bottom-level output features in this embodiment are the outputs of the first convolution module and the second convolution module (e.g. Figure 1 As shown), according to the above method, we can get

[0059] 3) F0 is connected and outputs the final features through two 3×3×256, one 1×1×C convolutional layers and an upsampling layer;

[0060] It should be noted that when the output features of the two layers in the lower layer of the basic network model are integrated into the high-level features, convolution operations are performed on the output features of each branch to reduce the number of feature channels, reduce the computational complexity, and reduce the impact of noise in the low-level features.

[0061] Step 3, input the training set into the constructed deep semantic segmentation network model for training to obtain a trained deep semantic segmentation network model;

[0062] It should be noted that during the model training process, the loss functions used include the cross entropy loss function and the Gumbel softmax-based loss function;

[0063] Specifically, the calculation process of the loss function based on Gumbel softmax is:

[0064] 1) For the first output feature of the last layer of the basic network model, the feature with the output dimension of the convolutional layer and the number of semantic segmentation categories is Y N×c , where N is the product of the length and width of the feature matrix, and each sample i(y i =[y i1 ,...,y ic ]) generate c independent samples ∈1,...,∈ c ...;

[0065] 2) The calculated noise is G i =-log(-log(∈i ));

[0066] 3) Add the randomly generated samples and the network model output feature Y to get the Gumbel distribution: v i =[y i1 +G1,...,y ic +G c ];

[0067] 4) The softmax function is used to calculate the probability of the output feature to obtain the final category in an approximate one-hot form:

[0068]

[0069] Among them, τ is the temperature parameter, which controls the degree to which the Gumbel softmax output is close to one-hot. The smaller the temperature coefficient value, the closer the output result is to the one-hot form, and vice versa, the closer it is to uniform distribution; v i and v j is the Gumbel distribution obtained by adding noise to the sample y.

[0070] 5) For σ τ (v i ) performs Gaussian smoothing and calculates its gradient to obtain boundary information Then, the labeled image is converted into one-hot form, Gaussian smoothing is performed and the gradient information B is calculated. The L1 norm between α and B is used as the loss function of the last layer of the base network model.

[0071] The cross entropy loss function of the sample is expressed as:

[0072]

[0073] in, is the true label of sample x in one-hot form, y i is the probability value output by the model after softmax, i is the i-th item in the vector, and the final cross entropy loss is the average of the sample loss values ​​in all batches.

[0074] In this embodiment, the reverse attention model is adopted to make the result obtained by the semantic segmentation method fuse semantic information and boundary information. The boundary loss function based on Gumbel softmax is used to guide model training and accelerate the convergence of model parameters.

[0075] It is worth noting that the reverse attention model proposed in the present invention can act on one or more layers in the lower layer of the model, and this strategy can be used for any basic semantic segmentation model.

[0076] Step 4: Input the test set into the trained deep semantic segmentation network model to obtain the image segmentation results.

[0077] In order to verify the superiority of the method of the present invention, a series of test results based on the inverse attention model (BA for short) are designed on Deeplab V2+VGG16 to compare the results; and the semantic segmentation field evaluation criteria: IoU and F1 are used to evaluate the segmentation results.

[0078] The data of the method of the present invention adopts two database sets respectively: the first image database is the image set inside the bungalow granary; the second image database adopts the VOC2012 database image data set to verify the method of the present invention.

[0079] 1. Test the interior image of the bungalow granary:

[0080] (1) Collect 120 images in the warehouse as the training image set, manually mark the collected images to obtain GroudTruth; use 20 of them as the verification image set;

[0081] The size of each collected image is 1080×1920, and the images are taken under different lighting and preset angles.

[0082] (2) Enhance the labeled training image set to obtain the training image set required for subsequent deep convolutional neural network model training.

[0083] Among them, the method for enhancing the training image set is to enhance the training image set by using a certain step size to intercept the region of interest of a specified size, adjust the image Gamma correction parameters, scale the image, flip the image, rotate it no more than ±10 degrees relative to the original image, and add Gaussian noise.

[0084] In the process of training image enhancement, the original training image and the labeled image are changed at the same time. If the labeled image has an interpolation operation, the nearest neighbor interpolation is selected.

[0085] Specifically, for any training image and its labeled image in the flat warehouse, a region of interest of a specified size is captured with a certain step length starting from the upper left corner of the image, and the region is inverted, Gamma parameter adjusted, rotated no more than ±10 degrees, and Gaussian noise is added. Each operation has a corresponding parameter set, and finally a training image set close to the target number is generated, of which the final training image set has a total of 5,600 images and the verification image set has a total of 120 images.

[0086] In this method, since the grain surface and the grain loading line have a certain semantic contextual relationship, the original training image cannot be rotated at a large angle.

[0087] Table 1 shows the comparative test results of the proposed reverse attention model (BA for short) on Deeplab V2+VGG16 on the image set of the bungalow granary. It can be seen from Table 1 that the present invention can effectively improve the segmentation performance of the original model by adding the reverse attention model to the original model.

[0088] Table 1. Evaluation of training results of the image set inside the bungalow granary

[0089]

[0090] 2. Test based on VOC2012 database:

[0091] Among them, the annotated image set contains 12,081 images and labeled images, which are divided into a training image set and a verification image set, of which the training image set contains 10,582 images and the verification image set contains 1,499 images.

[0092] Table 2 shows the test results of the present invention on the VOC2012 dataset, using Deeplab V2+VGG16. It can be seen that the present invention can effectively improve the segmentation performance of the original model by adding the Gumble softmax attention model to the original model.

[0093] Table 2. Evaluation of VOC2012 image set training results

[0094]

[0095] Therefore, the semantic segmentation method based on the reverse attention model proposed in the present invention further improves the image segmentation performance.

[0096] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.

Claims

1. A semantic segmentation method based on an inverse attention model, characterized in that: The following steps are involved: (1) Obtain image datasets and construct training and test sets; (2) constructing a deep semantic segmentation network model, wherein the deep semantic segmentation network model includes a basic network model and a reverse attention model; The basic network model includes a plurality of convolution modules and an ASPP output module connected in sequence, and the ASPP output module is used for outputting the output features of the basic network model; The features output by the ASPP output module are high-level features, and the features output by each convolution module are low-level features; The processing process of the reverse attention model is: 1) The output features of the basic network model are passed through a convolution layer to obtain a reduced-dimensional output feature, and the reduced-dimensional output feature is input into an attention calculation model to obtain a first attention view, and the reduced-dimensional output feature is dot-multiplied with the first attention view, and then superimposed with the reduced-dimensional output feature to obtain a first output feature; 2) upsampling the first output feature to obtain features of at least two different scales, calculating the attention view for the features of each scale, and performing dot multiplication on the obtained attention views of different scales with the corresponding low-level features of the basic network model, superimposing the results of the dot multiplication with the features of the corresponding scales, obtaining output features of different scales, and fusing the output features of different scales with the first output feature to obtain an output result; (3) inputting the training set into the deep semantic segmentation network model for training to obtain a trained deep semantic segmentation network model; (4) Input the test set into the trained deep semantic segmentation network model to obtain the image segmentation results.

2. The semantic segmentation method based on the reverse attention model according to claim 1, characterized in that: The loss functions used in the deep semantic segmentation network model include a cross entropy loss function and a Gumbel softmax-based loss function.

3. The semantic segmentation method based on the inverse attention model according to claim 1, characterized in that: The attention calculation model adopts a combination of channel attention and spatial attention, that is, M(F)=σ(Mc(F)+Ms(F)), where F∈R H×W×C is the input feature, H is the length of the image, W is the width of the image, C is the number of channels, M c is the channel attention calculation function, c is the channel attention, M S is the spatial attention calculation function, s is the spatial attention, σ is the sigmoid function; M c and M S They are defined as follows: M c (F)=BN(MLP(AvgPool(F))) =BN(w1(w0AvgPool(F)+b0)+b1) <h2 style=";text-align:left;direction:ltr">M<h2 style=";text-align:left;direction:ltr"> s <h2 style=";text-align:left;direction:ltr"> (F)=BN(f3<h2 style=";text-align:left;direction:ltr"> 1×1 <h2 style=";text-align:left;direction:ltr"> (f2<h2 style=";text-align:left;direction:ltr"> 3×3 <h2 style=";text-align:left;direction:ltr"> (f1<h2 style=";text-align:left;direction:ltr"> 3×3 <h2 style=";text-align:left;direction:ltr"> (f0<h2 style=";text-align:left;direction:ltr"> 1×1 <h2 style=";text-align:left;direction:ltr"> (F))))) Among them, MLP represents multi-layer perceptron, that is, fully connected; AvgPool is the average pooling layer, BN is batch normalization, w0 and w1 are network weights, b0 and b1 are offset parameters, w0∈R C / r×C , b0∈R C / r , w1∈R C×C / r and b1∈R C , r is the channel scaling ratio, C is the number of channels; f0, f1, f2, f3 are convolution operations, 1×1 and 3×3 are the convolution kernel sizes.

4. The semantic segmentation method based on the reverse attention model according to claim 2, characterized in that: The loss function calculation process based on Gumbel softmax is as follows: (1) The first output feature passes through the convolutional layer and the output dimension is the feature matrix of the number of semantic segmentation categories, which is Y N×c , the feature matrix Y N×c Each sample y generates c independent samples ϵ1,⋯,ϵ from uniform distribution U(0,1) c , the i-th sample is y i =[y i1 ,⋯,y ic ]; (2) The calculated noise is G i = -log(-log(ϵ i )); (3) Add the randomly generated noise and sample y to obtain the Gumbel distribution: v i =[y i1 +G1,⋯,y ic +G c ]; (4) The softmax function is used to calculate the probability of the output feature to obtain a category that approximates the one-hot form: Among them, τ is the temperature parameter, which controls the degree to which the Gumbel softmax output is close to one-hot. The smaller the temperature coefficient value, the closer the output result is to the one-hot form, and vice versa, the closer it is to uniform distribution; v i For sample y i Add the noise to get the Gumbel distribution, v j For sample y j Gumbel distribution obtained by adding noise; (5) For σ τ (v i ) performs Gaussian smoothing and calculates its gradient to obtain boundary information , and then convert the labeled image into one-hot form, perform Gaussian smoothing and calculate the gradient information B, calculate The L1 norm between α and B is used as the loss function of the last layer of the base network model.

5. The semantic segmentation method based on the reverse attention model according to claim 1, characterized in that: When the basic network model is DeepLabV2 based on VGG16, the basic network model includes five feature extraction blocks and an ASPP module, and the five feature extraction blocks include a first convolution module, a first pooling layer, a second convolution module, a second pooling layer, a third convolution module, a third pooling layer, a fourth convolution module, a fourth pooling layer, a fifth convolution module, and a fifth pooling layer in sequence; each convolution module includes 2 to 3 convolution layers, and the convolution layers of the fourth convolution module and the fifth convolution module are hollow convolutions; the ASPP module is a pyramid structure with hollow convolutions.

6. The semantic segmentation method based on the reverse attention model according to claim 5, characterized in that: The first convolution module includes 2 3×3 convolution layers with an output dimension of 64; the second convolution module includes 2 3×3 convolution layers with an output dimension of 128; the third convolution module includes 3 3×3 convolution layers with an output dimension of 256; the fourth convolution module includes 3 3×3 convolution layers with an output dimension of 512; the fifth convolution module includes 3 3×3 convolution layers with an output dimension of 512; the output of the fifth convolution module is connected to the ASPP module.

7. The semantic segmentation method based on the reverse attention model according to claim 1, characterized in that: The basic network model is a DeepLabV3 model based on VGG16.