Method for guiding semantic segmentation of urban scene by using double-branch boundary hybrid network

By introducing lightweight boundary branching and attention mechanisms into the semantic segmentation model, using thermal images to provide boundary information, the segmentation problem of RGB images under the non-satisfaction of lighting conditions is solved, and the recognition ability of small targets and model inference speed is improved.

CN118968050APending Publication Date: 2024-11-15NANJING TECH UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410946290.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing semantic segmentation model has the RGB image quality that does not meet the lighting conditions, and the inference speed decreases when fusing RGB and thermal images, and the small-objective segmentation effect is poor.

Method used

A dual-branch boundary hybrid network (DBFNet) is designed to build lightweight boundary branches, and thermal images provide boundary information to supplement the detailed information of RGB images. Combining attention mechanism and efficient loss function, the model's ability to identify small targets is improved.

Benefits of technology

While ensuring the model inference speed, it improves the segmentation accuracy and speed of small goals in urban market scenarios, and enhances the model's ability to segment small goals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968050A_ABST
    Figure CN118968050A_ABST
Patent Text Reader

Abstract

The invention discloses a method for guiding semantic segmentation of a city scene by using a double-branch boundary hybrid network. The method comprises the following steps of: 1, constructing an efficient trunk branch network for an RGB (Red, Green and Blue) image to ensure that the ability of extracting complete semantic information is kept under the condition that the network is lighter; step 2, constructing a boundary information extraction branch for the thermal infrared image, and supplementing detail information loss of the RGB image during semantic information extraction through boundary information; step 3, constructing a double-branch hybrid module to fuse information of a trunk branch and a boundary branch, and performing fine adjustment on mixed features through an attention mechanism to ensure high availability of information of the fused features; and 4, designing a more efficient mixed loss function to restrain different branches of the whole network architecture, and fusing the idea of difficult sample mining in the total loss function to more effectively segment a difficult scene which is difficult to realize in the previous work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for guiding the semantic segmentation of urban scenes by using a double-branch boundary hybrid network, and belongs to the field of computer artificial intelligence applications. Background Art

[0002] With the development of deep learning, semantic segmentation has become a basic function of autonomous vehicles. However, most existing semantic segmentation models are based on RGB images that are acquired by cameras to obtain visible light before segmentation. This often causes a series of problems. Under unsatisfactory lighting conditions, the quality of RGB images is easily degraded; for example, the darkness and brightness of light, which is a severe challenge for networks that only use RGB images.

[0003] In this case, since the thermal images produced by thermal imaging cameras can see things under various lighting conditions, we consider using RGB images and thermal images for multimodal fusion to overcome the difficulties faced by traditional semantic segmentation. There are some works that fuse RGB images and thermal images for semantic segmentation, but they all encode and decode RGB images and thermal images separately. Although this overcomes the problem of traditional RGB image semantic segmentation, this approach completely separates RGB images and thermal images into features of two different fields, and also introduces additional computation, resulting in a decrease in the model reasoning speed. For example, in the paper MFNet: Towards real-time semantic segmentation for autonomous vehicles with multi-spectral scenes, the same encoder structure is used to encode RGB images and thermal images respectively during encoding, and the channel dimension is spliced ​​before the upsampling operation during decoding to fuse the two modal information. Although this is an excellent network idea, the introduction of additional computation when encoding thermal images will cause a decrease in reasoning speed, and the method of modal fusion also needs further improvement. This method of encoding, decoding and fusing RGB images and thermal images at the same time does not fully retain the original detail information, and the segmentation effect for small targets is not satisfactory.

[0004] Therefore, this paper proposes an innovative dual-branch boundary hybrid network (DBFNet). We no longer regard RGB images and thermal images as information in two different fields, but regard thermal images as a supplement to RGB images in terms of detail information to improve the final feature information. By introducing a lightweight boundary branch to encode thermal images, we can ensure the model inference speed while supplementing the key image detail information when encoding RGB images in the main branch, thereby having a higher recognition ability for small targets. Summary of the invention

[0005] The main technical problem to be solved by the present invention is the low accuracy and slow segmentation speed of small targets by fusing RGB images and thermal images in urban scene segmentation. By constructing a lightweight boundary branch to interpret the thermal image as the boundary information of the RGB image, the ability to detect small targets is improved while ensuring the model detection speed.

[0006] The design idea of ​​this method is to build a dual-branch network. The main branch network is responsible for using RGB images to obtain rich semantic features for the final segmentation while retaining certain detail information. The boundary branch is responsible for using thermal images to extract boundary information to supplement the semantic features of the main branch.

[0007] The overall model architecture of DBFNet is Figure 1 Given in.

[0008] This segmentation method includes the following specific steps:

[0009] Step 1: construct a trunk-branch network with fewer parameters and faster inference speed for RGB images to extract complete semantic information;

[0010] 1.1) The input of the main branch is RGB color image, which we use to extract semantic information for the final segmentation, so we perform more complex data enhancement measures to improve the generalization ability of the model.

[0011] 1.2) Considering the real-time performance of the designed neural network, we have a lighter requirement for the design of the backbone network, so we designed a densely connected network with backtracking capability as our backbone branch network. The design pattern of the backbone network refers to the Resnet architecture, but we do not perform a separate residual connection for each layer, but a dense connection (the current result is saved after each convolution layer, and finally spliced ​​to the output of the current layer according to the channel dimension), and use appropriate depth-separable convolutions in the backbone branches to replace ordinary convolution layers.

[0012] 1.3) We introduced a backtracking mechanism at the end of the main branch network, with the purpose of using deeper features to guide the features to be fused with the boundary branch. We designed an attention fine-tuning module specifically for this backtracking process, which uses deeper semantic information to adjust the semantic features of the current layer, ensuring that different degrees of attention are applied to each pixel position, and adjusting the size of attention pixel by pixel, thus ensuring the high availability of the semantic features to be fused with the boundary branch.

[0013] Step 2: In order to make the thermal image a semantic supplement to the RGB image in terms of details, we construct a boundary information extraction branch for the thermal image and ensure that this branch is lightweight;

[0014] 2.1) Since the purpose of building the boundary branch network is to extract rich boundary information to supplement the semantic information of the main branch, we only perform relatively simple data enhancement methods such as Gaussian blur on the thermal infrared image input by the boundary branch network.

[0015] 2.2) Since the boundary branch retains complete boundary information, if this part of the boundary information is used reasonably, the model's ability to segment small targets can be enhanced. This is because small targets usually have a low number of pixels and are therefore easily ignored in the image. By introducing attention to boundary information, the model can better distinguish the boundary between small targets and the background, thereby performing more accurate segmentation.

[0016] 2.3) Based on the characteristics of boundary information (which belongs to detail information and usually only exists in the shallow network of the model), the boundary branch we designed has only three convolutional layers and corresponding normalization layers and nonlinear activation layers. In addition, we use an inverted pyramid structure for the design of the convolutional layer, that is, the first layer has the highest number of dimensions, and the subsequent layers decrease layer by layer. The purpose of this is to first extract a sufficient number of detail features, and then gradually compress the features, remove some of the detail features we don’t need, and retain the boundary detail features with strong usability.

[0017] Step 3: Design a unique module for dual-branch feature fusion and fine-tune the mixed features through the attention mechanism to ensure high information availability of the fused features;

[0018] 3.1) The data distribution of boundary information and semantic information is usually different. Therefore, after concatenating the main branch features and boundary branch features according to the channel dimension, we use the BatchNoraml layer to normalize the input features. This process can help the data distribution of different features to be closer, which helps the model to better learn the relationship between features.

[0019] 3.2) Use the attention mechanism to apply different attention weights to each pixel position for the fused features, which can help the model learn the features that are more important in the fusion process;

[0020] Step 4: Since the loss function plays a vital role in the optimization process of the model, we design a more efficient hybrid loss function to constrain different branches of the overall network architecture:

[0021] 4.1) In the designed overall network, the trunk branch is the branch that contributes the most to the model, so a more powerful loss function needs to be set to adjust the training of this branch. Considering the class imbalance problem, we first applied the Dice loss function to the main branch, and then considering the problem of difficult sample mining, we introduced the OHEM loss function. The calculation process of Dice and OHEM is as follows;

[0022]

[0023]

[0024] where y pred Represents the predicted value, y true represents the true value label, and Dice loss can be understood as a statistic that measures the similarity between two sample sets. The parameter λ in OHEM is a hyperparameter, x is the index of the pixel, and the entire loss represents that when our predicted value for the positive sample is less than λ, the prediction loss of the pixel point is added to the overall loss, which can achieve the mining of difficult samples.

[0025] 4.2) The boundary branch is responsible for extracting shallow boundary information. We obtain boundary labels by using the Laplacian operator based on semantic labels. Then we can use the binary cross entropy loss function to calculate the boundary prediction result and the loss of the actual boundary, and finally optimize the boundary branch. We define the boundary loss as follows:

[0026]

[0027] Among them, y pred Represents the predicted value of the boundary, y true Represents the true value label of the boundary, and x represents the index value of the pixel.

[0028] 4.3) Since we have different design purposes for different branches of the entire network, they also contribute to different degrees to the optimization process of the entire model. The boundary branch exists to supplement the missing details in the main branch, and the difficult sample mining is also a supplement to the main branch to focus on the difficult targets. Therefore, the proportion of the overall loss of the two is lower than the semantic loss of the trunk branch. Therefore, the total loss function is designed as follows:

[0029] loss=0.6Dice+0.2OHEM+0.2boundloss

[0030] Specifically, the detailed steps of step 1 include:

[0031] Step 1.1: Perform stronger data enhancement on the RGB image input by the main branch, including Gaussian blur, random adjustment of contrast and brightness, color transformation, and random flipping and translation (under this enhancement method, the corresponding labels and thermal images must also be transformed accordingly);

[0032] Step 1.2: Abandon the Resnet network with dilated convolution and the U-shaped structure network of Encoder-Decoder used in the traditional network, and design a densely connected network with backtracking capability as our trunk branch network. We use a densely connected method (the structural diagram is shown in Figure 2 As shown in the figure, it retains low-level features (texture, lines, etc.) while taking into account the model reasoning speed (using appropriate depth-separable convolution to replace the ordinary convolution layer);

[0033] Step 1.3, backtracking capability is also an indispensable and important part of the trunk branch. Its design purpose is to use deeper semantic features to guide the features to be finally fused with the boundary branch. We use the attention fine-tuning module to guide this process, ensuring that each pixel position is given different degrees of attention, and adjusting the semantic information pixel by pixel through the size of attention.

[0034] Specifically, the detailed steps of step 2 include:

[0035] Step 2.1: Perform relatively few enhancements on the thermal image input by the boundary branch, including Gaussian blur, random flipping and translation (this enhancement should be synchronized with the enhancement of the corresponding RGB image);

[0036] Step 2.2: Small objects usually have a low number of pixels, so they are not very prominent in the image and are easily ignored or misclassified. By introducing attention to boundary information, the model can better distinguish the boundary between small objects and the background, thereby performing more accurate segmentation. By retaining the complete boundary information through the boundary branch and fusing it with the semantic information, the complete boundary information can be fully retained in the final semantic feature.

[0037] Step 2.3, the overall architecture of the boundary branch is designed to be only three convolutional layers and the corresponding normalization layer and nonlinear activation layer. For the convolutional layer, we design the first layer to have the highest number of dimensions, and the subsequent layers decrease layer by layer. The purpose of this is to first extract a sufficient number of detail features, and then gradually compress the features, remove some of the detail features we don’t need, and retain the boundary detail features with strong usability.

[0038] Specifically, the detailed steps of step three include:

[0039] Step 3.1: First, concatenate the main branch features and the boundary branch features according to the channel dimension, and then use the BatchNoraml layer to help the data distribution of the two features closer, so that the model can better learn the relationship between the features;

[0040] Step 3.2: Use the attention mechanism to apply different attention weights to each pixel position for the fused features, which can help the model learn the features that are more important in the fusion process. Finally, add the fused features adjusted according to the attention weights to the original fused features to ensure the high availability of the fused feature information.

[0041] Specifically, the detailed steps of step 4 include:

[0042] Step 4.1. Considering the problem of class imbalance, we first applied the Dice loss function to the main branch. Then we considered the problem of difficult samples. That is, the segmentation effect of small objects was poor in our experiment. We introduced the idea of ​​difficult sample mining to design a loss function. Their calculation methods are as follows:

[0043]

[0044]

[0045] where y pred Represents the predicted value, y true represents the true value label, and Dice loss can be understood as a statistic that measures the similarity between two sample sets. The parameter λ in OHEM is a hyperparameter, and x is the index of the pixel. The meaning of the entire loss function is that only when our predicted value is less than λ, the prediction loss of the pixel point is added to the overall loss. We do not pay attention to those pixels that are easy to segment. By controlling this hyperparameter λ, we can adjust the loss's ability to mine difficult samples.

[0046] Step 4.2: Using the Laplacian operator, we can get the required boundary labels based on the semantic labels, and then use the ordinary binary cross entropy loss function to optimize the boundary branch. The boundary loss is defined as follows:

[0047]

[0048] Among them, y pred Represents the predicted value of the boundary, y true Represents the true value label of the boundary, and x represents the index value of the pixel.

[0049] Step 4.3: The role of the boundary branch is to supplement the semantic features extracted by the main branch. At the same time, the loss of difficult sample mining is also a supplement to the difficult target added on the basis of the main branch. We design the proportion of different parts in the total loss according to their design purposes. The overall loss function is as follows:

[0050] loss=0.6Dice+0.2OHEM+0.2boundloss

[0051] Compared with the prior art, the present invention adopts the above technical solution and has the following advantages:

[0052] 1. The boundary branch is introduced to interpret the thermal image as a supplement to the boundary information of the RGB image. Compared with the traditional two-branch model, it reduces the number of model parameters, improves the network reasoning speed, and also improves the segmentation ability of the model. Figure 3 The advantages of our designed network in inference accuracy and speed are given.

[0053] 2. Since the main branch of the model is designed independently, the ability of the main branch to extract semantic information is improved through dense connections with backtracking capabilities, and by introducing partial depth-wise separable convolutions instead of ordinary convolutions, only a small amount of computation is introduced in exchange for the powerful expressiveness of the main branch. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is the overall network architecture diagram selected by the present invention.

[0055] Figure 2 It is a schematic diagram of dense connection implementation of the present invention.

[0056] Figure 3 This is an analysis of the superiority of the network architecture proposed in the present invention compared with other architectures. DETAILED DESCRIPTION

[0057] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:

[0058] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.

[0059] Under the above conditions, a method using a dual-branch boundary hybrid network to guide the semantic segmentation of urban scenes is proposed. This method improves the segmentation accuracy of the model while ensuring the inference speed by introducing thermal images into the boundary branch and interpreting them as a supplement to the boundary information in the semantic features.

[0060] In this example, the flow chart of this method is as follows Figure 1 As shown, the specific steps are as follows:

[0061] Step 1: construct a trunk-branch network with fewer parameters and faster inference speed for RGB images to extract complete semantic information;

[0062] Step 1.1: Perform powerful data enhancement methods such as Gaussian blur, random adjustment of contrast and brightness, color transformation, and random flipping and translation on the RGB image input by the main branch (under this enhancement method, the corresponding labels and thermal images must also be transformed accordingly);

[0063] Step 1.2: Abandon the Resnet network with dilated convolution and the U-shaped structure network of Encoder-Decoder used in the traditional network, and design a densely connected network with backtracking capability as our trunk branch network. We use dense connections to retain low-level features (texture, lines, etc.) while taking into account the model reasoning speed (using appropriate depth-separable convolution to replace the ordinary convolution layer);

[0064] Step 1.3: In the last stage of the main branch, we continue to extract deep semantic information. The design purpose is to use deeper semantic features to guide the features to be fused with the boundary branch. In addition, the attention fine-tuning module is used to guide this process, ensuring that each pixel position is given different degrees of attention, and the pixel-by-pixel semantic information is adjusted by the size of the attention.

[0065] Step 2: In order to make the thermal image a semantic supplement to the RGB image in terms of details, we construct a boundary information extraction branch for the thermal image and ensure that this branch is lightweight;

[0066] Step 2.1: Perform relatively few enhancements on the thermal image input by the boundary branch, including Gaussian blur, random flipping and translation (this enhancement should be synchronized with the enhancement of the corresponding RGB image);

[0067] Step 2.2: Considering the segmentation effect of tiny targets, we introduce attention to boundary information to better distinguish the boundary between tiny targets and background, thereby performing segmentation more accurately.

[0068] Step 2.3, the overall architecture of the boundary branch is designed to be only three convolutional layers and the corresponding normalization layer and nonlinear activation layer. For the convolutional layer, we design the first layer to have the highest dimension, and the subsequent layers decrease layer by layer. The purpose of this is to first extract a sufficient number of detail features, and then gradually compress the features, remove some of the detail features we don’t need, and retain the boundary detail features with strong usability.

[0069] Step 3: Design a unique module for dual-branch feature fusion and fine-tune the mixed features through the attention mechanism to ensure high information availability of the fused features;

[0070] Step 3.1: First, concatenate the main branch features and the boundary branch features according to the channel dimension, and then use the normalization layer BatchNoraml to adjust the data distribution. This can help the model better learn the relationship between features;

[0071] Step 3.2: Assign different attention weights to each pixel position of the fused features, and then add the features adjusted according to the attention weights to the original fused features to ensure high availability of the fused feature information;

[0072] Step 4: In order to better optimize the model, we designed a more efficient hybrid loss function and integrated the idea of ​​difficult sample mining into the total loss function to more effectively segment difficult scenarios that were difficult to achieve in previous work:

[0073] Step 4.1: We comprehensively consider the problem of class imbalance and the problem of difficult samples, and design a hybrid structure containing two sub-loss functions for the main branch; the calculation method of the sub-loss is as follows:

[0074]

[0075]

[0076] where y pred Represents the predicted value, y true Represents the true value label, and Dice loss can be understood as a statistic that measures the similarity between two sample sets. OHEM adds difficult-to-segment samples to the loss through the hyperparameter λ. By controlling this hyperparameter λ, we can adjust the loss's ability to mine difficult samples.

[0077] Step 4.2: Using the Laplacian operator, we can get the required boundary labels based on the semantic labels, and then use the ordinary binary cross entropy loss function to optimize the boundary branch. The boundary loss is defined as follows:

[0078]

[0079] Among them, y pred Represents the predicted value of the boundary, y true Represents the true value label of the boundary, and x represents the index value of the pixel.

[0080] Step 4.3, based on the design intentions of different parts of the network, we construct the total loss function as follows:

[0081] loss=0.6Dice+0.2OHEM+0.2boundloss.

Claims

1. A method for guiding the semantic segmentation of urban scenes using a dual-branch boundary hybrid network, which uses deep learning technology to achieve accurate recognition and segmentation of urban scenes. We call the entire constructed deep neural network DBFNet, which has faster reasoning speed and more accurate scene segmentation capabilities, and is characterized by: comprising the following steps: Step 1: Construct an efficient trunk-branch network for RGB images to ensure that it is lighter (fewer parameters and faster inference speed) while maintaining the ability to extract complete semantic information; 1.1) Since the purpose of building the trunk-branch network is to extract rich semantic information, the trunk-branch network inputs RGB color images. We perform more complex data enhancement measures to improve the generalization ability of the model, including random adjustment of contrast and brightness, color transformation, Gaussian noise, and random flipping and translation (under this enhancement method, the corresponding thermal infrared image must also undergo corresponding transformations), etc. 1.2) Considering the requirement of lightweight neural network, we excluded ResNet with dilated convolution which is not friendly to the underlying implementation. t network; in addition, although the U-shaped structure of Encoder-Decoder ensures the accuracy of the model, it introduces additional calculations, so we do not choose it for the design of the backbone network. We designed a densely connected network with backtracking capability as our main branch network. The general design pattern refers to the Resnet architecture. We do not perform a separate residual connection for each layer, but a dense connection (the current result is saved after each convolution layer, and finally spliced ​​to the output of the current layer according to the channel dimension). Dense connection can ensure that low-level features (texture, lines, etc.) are fully transmitted. At the same time, in order to take into account the model inference speed, we use appropriate depth-separable convolution in the main branch to replace the ordinary convolution layer. 1.3) The backtracking ability of the backbone network is to use deeper features to guide the features that will be finally fused with the boundary branches. A general understanding is that the farther the features propagate, the more abstract information and more complete semantic information they retain, but more detailed information will be lost. Therefore, when the backbone branch is about to merge with the detail branch, we will not stop the calculation, but will calculate an additional deeper layer, and then use this deeper information to feed back the features of the current layer. In this way, only a little bit of calculation is added to obtain a feature map with more complete semantic information. We also designed an attention fine-tuning module for this feedback process, which uses deeper semantic information to adjust the semantic features of the current layer, ensuring that each pixel position is given different degrees of attention, and adjusting the size of attention pixel by pixel, thus ensuring the high availability of the semantic features to be fused with the boundary branch. Step 2: construct a boundary information extraction branch for the thermal infrared image, and use the boundary information to supplement the detail information loss of the RGB image when extracting semantic information; 2.1) Since the purpose of building the boundary branch network is to extract rich boundary information to supplement the semantic information of the main branch, we perform relatively simple data enhancement on the thermal infrared image input by the boundary branch network, including Gaussian noise and random flipping and translation (this enhancement method should be synchronized with the enhancement of the corresponding RGB image), etc. 2.2) The boundary branch retains complete boundary information and fuses it with semantic information to ensure that the final predicted features have strong semantic information while also paying attention to subtle boundary features. This can enhance the model's ability to segment tiny targets (tiny targets usually have a lower number of pixels, so they may not be very significant in the image and can be easily ignored or misclassified. By introducing attention to boundary information, the model can better distinguish the boundary between tiny targets and the background, thereby performing more accurate segmentation). 2.3) Since boundary information belongs to detail information, it is retained in a shallow network, so the boundary branch we designed has only three convolutional layers and corresponding normalization layers and nonlinear activation layers. We use an inverted pyramid structure for the design of the convolutional layer, that is, the first layer has the highest number of dimensions, and the subsequent layers decrease layer by layer. The purpose of this is to first extract a sufficient number of detail features, and then gradually compress the features, remove some of the detail features we don’t need, and retain the boundary detail features with strong usability. Experiments have shown that our design mode has better segmentation accuracy for the overall model than the positive pyramid structure. Step 3: Build a dual-branch hybrid module to fuse the information of the main branch and the boundary branch, and fine-tune the hybrid features through the attention mechanism to ensure the high availability of the fused feature information; 3.1) We concatenate the main branch features and the boundary branch features according to the channel dimension, and then use the BatchNoraml layer to normalize the input features. This process can help the data distribution of different features to be closer, which helps the model to better learn the relationship between features; 3.2) The attention mechanism is used to apply different attention weights to each pixel position for the fused features, which can help the model learn the features that are more important in the fusion process. Finally, the fused features adjusted according to the attention weights are added to the original fused features to ensure the high availability of the fused features; Step 4: Design a more efficient hybrid loss function to constrain different branches of the overall network architecture, and integrate the idea of ​​difficult sample mining into the total loss function to more effectively segment difficult scenarios that were difficult to achieve in previous work: 4.1) The main branch extracts semantic information for the final segmentation. In the reasoning process of the entire model, this branch undoubtedly contributes the most to the whole. Therefore, a more reasonable loss function needs to be set to adjust the training of this branch. Considering the problem of class imbalance, we first applied the Dice loss function to the main branch. Its calculation method is shown in Dice below; then considering the problem of difficult samples, that is, the segmentation effect of small targets is poor, we introduced the idea of ​​difficult sample mining to design a loss function, and its calculation method is shown in OHEM below; where y pred Represents the predicted value, y true represents the true value label, and Dice loss can be understood as a statistic that measures the similarity between two sample sets. The parameter λ in OHEM is a hyperparameter, and x is the index of the pixel. The entire loss represents that only when our predicted value is less than λ, the prediction loss of the pixel point is added to the overall loss, which can realize the mining of difficult samples. 4.2) The boundary branch is responsible for extracting shallow boundary information to make up for the lack of boundary detail information in the semantic information. First, the Laplacian operator is used to obtain the boundary label according to the semantic label. Then, the binary cross entropy loss function is used to obtain the prediction result of the boundary branch and the loss value of the actual boundary label, and finally the boundary branch is optimized. We define the boundary loss as follows: in, where y pred Represents the predicted value of the boundary, y true Represents the true value label of the boundary, and x represents the index value of the pixel. 4.3) Since our goal is to let the boundary branch supplement the missing details in the main branch, we design the main branch of the total loss to contribute more to model optimization, and the boundary branch only plays a supplementary role. At the same time, the loss of difficult sample mining is also a supplement to the main branch to focus on difficult targets, so the proportion of the overall loss is relatively small. Therefore, the total loss function is designed as follows: loss=0.6Dice+0.2OHEM+0.2boundloss.

Citation Information

Cited By

  • Bus bar welding detection method and system, electronic equipment and medium

    CN120746968A