Low-illumination image semantic segmentation method based on multi-scale style decoupling network MSD-Net

The multi-scale style decoupling network MSD-Net decomposes low-light images into style and content components, solving the problems of slow low-light image segmentation and low accuracy, achieving fast and accurate segmentation effects, and improving the model's robustness. Stickiness and training efficiency.

CN118710907AInactive Publication Date: 2024-09-27GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410876738.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Low-light image segmentation has the problems of slow segmentation speed and low segmentation accuracy in the existing technology, especially in complex scenes and dynamic lighting conditions. Moreover, the existing methods require a large amount of training data and computing resources, and are time-consuming.

Method used

The multi-scale style decoupling network MSD-Net is used to decompose low-light images into style components, content components and noise components through the image decoupling module IDM, and the random noise selection module and content component feature extraction network are used to improve the training speed and accuracy of the model. Robustness, and ultimately image segmentation via a style-guided segmentation head.

Benefits of technology

It achieves fast and accurate segmentation of low-light images, reduces the problems of slow segmentation speed and low segmentation accuracy caused by insufficient features and noise interference, and improves the robustness and training efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710907A
    Figure CN118710907A
Patent Text Reader

Abstract

The invention discloses a low-illumination image semantic segmentation method based on a multi-scale style decoupling network MSD-Net, and the method can achieve the semantic segmentation of a low-illumination image in a poor-illumination environment under the condition that the training data does not need to be generated through additional manual annotation or simulation. The low-illumination image is decomposed into a style component, a content component and a noise component according to a style migration theory, feature extraction of different scales is performed on the decoupled components under the condition that random noise is added, semantic segmentation of the low-illumination image is realized, and the method comprises the following steps: 1) constructing a model training data set MSD-Train and a test data set MSD-Test, 2) constructing a decoupling module IDM and decomposing a style component, a content component and a noise component from the image, 3) constructing a random noise selection module RNSM and adding extra random interference noise to the noise component of the image and then fusing the noise component with the style component, 4) constructing a content component feature extraction network CCFEN and extracting semantic features of different scales of the content component, and 5) constructing a style component feature extraction module SCFEM and a style-oriented segmentation head SGSegHead, further extracting features from the style component through the SCFEM, and acting the features on the content component to realize semantic segmentation of the low-illumination image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to deep learning, image style transfer, and image semantic segmentation technology, and specifically to a low-light image segmentation method combining multi-scale feature extraction and image style separation. Background Art

[0002] With the rapid development of deep learning technology, image segmentation has been widely used in the field of computer vision. However, in actual application scenarios, due to the limitations of ambient lighting conditions, the acquired images often have low-light problems. Low-light images usually have the characteristics of low brightness, poor contrast, and severe noise interference. These characteristics make the segmentation problem of low-light images more challenging. Traditional image segmentation methods often fail to achieve ideal segmentation results when processing low-light images.

[0003] In response to the problem of low-light image segmentation, researchers have proposed many improved methods. Among them, methods based on deep learning have made significant progress. Deep learning models have strong feature extraction and representation capabilities, and can learn more robust features, thereby improving the accuracy and stability of low-light image segmentation. Although low-light image segmentation methods based on deep learning have achieved certain results, there are still some problems and challenges. For example, existing methods in the field of low-light semantic segmentation often require a large amount of additional training data and computing resources, and the model training process is time-consuming; in addition, the existing methods still have insufficient segmentation performance when dealing with complex scenes and dynamically changing lighting conditions. In order to solve the problem of semantic segmentation of images taken under low light, an effective low-light image semantic segmentation method is urgently needed. Summary of the invention

[0004] The purpose of the present invention is to provide a semantic segmentation method for low-light images based on a multi-scale style decoupling network MSD-Net in view of the deficiencies in the prior art. This method can reduce the problems of slow segmentation speed and low segmentation accuracy caused by insufficient features and noise interference in low-light images, and achieve fast and accurate segmentation of low-light images.

[0005] The present invention comprises the following main steps:

[0006] 1. Based on the public dataset NightCity, we build an enhanced dataset NightCity-plus and a public dataset BDD100K as the datasets MSD-Train and MSD-Test for the model. In NightCity-plus, 2998 images are used for training and 1299 images are used for testing. 345 low-light road images are selected from the BDD100K dataset, including 314 low-light images for training and 31 images for testing.

[0007] 2. Construct an image decoupling module IDM, and decompose the style component, content component and noise component from the low-light image through the pooling module, the row-column attention module RC_attention, the style attention module Style_attention, the dual-branch channel attention module BCAM and the upsampling module. The structure of the image decoupling module IDM is shown in steps (1) to (9), and the loss function is described in step (10), including the following steps:

[0008] (1) Each time, two low-light images are selected from the MSD-Train dataset for input, denoted as image A and image B. Whenever a low-light image is received, the original image is first converted into a standard vector format, and the standardized image is input into a 7*7 convolution with a padding of p=3 for preliminary feature extraction. Then, it is input into a downsampling layer consisting of two convolutions of size 3*3, p=3, and a stride of 2. The image width and height are gradually reduced through the downsampling layer, while the number of channels is increased to capture higher-level features of the low-light image and obtain the preliminary feature feats of the image.

[0009] (2) The preliminary features feats extracted in (1) are subjected to a parallel operation, which includes three branches. Branch 1: input into the pooling layer, pool the feats through the average pooling layer, and then input into a 1*1 convolution and ReLU activation function to obtain the feature map feats1.

[0010] (3) Branch 2: Input low-level image features feats into the RC_attention module, steps (4) to (5):

[0011] (4) Input the feats extracted in step (1) into the RC_attention module to extract the query, key, and value feature maps.

[0012] (5) The Q, K, and V feature maps extracted in step (4) are compressed on the rows and columns of the feature matrix respectively, and feature extraction is performed to obtain feats2.

[0013] (6) Branch three: Input the low-level image features feats into the style attention module Style_attention, extract the style features, and obtain the feature map feats3.

[0014] (7) Feats1, feats2, and feats3 obtained from step (2) to step (6) are concatenated in the channel dimension through Concat to obtain the concatenated feature Confeat, and the concatenated feature Confeat is passed through a dual-branch spatial attention module BCAM.

[0015] (8) The feature map after the fusion of spatial and channel attention in step (7) is passed through a convolution of size 3*3 and padding p of 3 to perform channel dimension reduction. During model training, in order to help alleviate the gradient vanishing problem, two residual modules are designed through long-range skip connections so that the network can be better trained.

[0016] (9) Finally, the style component style, content component context and noise component noise are obtained by using different loss functions through the style component upsampling layer, content component upsampling layer and noise component upsampling layer. Image A finally obtains style component styleA, content component contextA and noise component noiseA, and image B finally obtains style component styleB, content component contextB and noise component noiseB.

[0017] (10) In the IDM module, a smooth loss function loss_smooth is established to measure the smoothness between the style component style and the content component context extracted from the low-light image.

[0018] 3. Construct a random noise selection module RNSM to add random interference noise to the noise component, including the following steps:

[0019] (1) The noise component noise obtained by the decoupling module is input into the random noise selection module RNSM. First, according to the noise component, the noise selection module generates random interference noise rnoise, and the noise and rnoise of image B are fused through a Concat layer to obtain the synthetic noise Snoise. The synthetic noise Snoise is adjusted to the same size as the content component of image A, and the synthetic noise Snoise is added to the style representation of image B through the disturbance function to obtain a new style component NS B Finally, the content component contextA of image A and the new style component NS of image B are generated BMultiply pixel by pixel to get a synthetic image, generate a new perturbation image im_CASB, and the style component S_CASB corresponding to im_CASB is decoupled again by the image decoupling module IDM, the content component is C_CASB, and the noise component is N_CASB.

[0020] (2) Repeat step (1) and apply the style component of image A fused with the noise component to the content component of image B to generate the perturbed image im_CBSA, and the corresponding perturbation is again decoupled by the image decoupling module IDM to obtain the style component S_CBSA, the content component C_CBSA, and the noise component N_CBSA.

[0021] 4. Construct a content component feature extraction network CCFEN to extract semantic features of content components, including the following steps:

[0022] (1) The content component feature extraction network includes four stages. In the first stage, the content component feature map of the image is first input into the embedding layer (Path Embading), and the output is then input into the linear layer. The output is then input into the convolutional feedforward neural network (ConvFFN), where ConvFFN includes a batch normalization layer (Norm), a linear layer, a 1*1 convolution, and a jump connection is used to improve the learning ability of the model. Finally, the first stage outputs a feature image with a 4x downsampling rate. In the second stage, the feature image with a 4x downsampling rate is passed through a deformable attention module (DTM) and ConvFFN to obtain a feature image with a 8x downsampling rate. In the third stage, the feature image with a 8x downsampling rate is input into the deformable attention module (DTM), batch normalization and IFAformer modules. The jump connection method is also used to increase the learning ability of the model. The output is then input into a 1*1 convolution and a ConvFFN to obtain a feature image with a 16x downsampling rate. The fourth stage is the same as the third stage, and finally a feature image with a 32x downsampling rate is obtained.

[0023] (2) The frequency feature extraction module IFAformer has a dual-branch structure, which is divided into a high-frequency attention branch and a low-frequency attention branch. The high-frequency attention branch captures fine-grained high-frequency features with local window self-attention, where the window size is 2*2, and a simple non-overlapping window partitioning method is used to calculate the self-attention matrix of Q, K, and V within the window. The low-frequency attention branch uses the high-frequency feature map, first average pooling each window to obtain the low-frequency information in the input image, and then projects the average pooled feature map to the key K and value V. Q in the low-frequency attention branch still comes from the original feature map. Finally, the output feature maps of the high-frequency branch and the low-frequency branch are fused.

[0024] (3) The content components contextA, contextB, C_CASB, and C_CBSA decomposed from image A and image B are respectively input into CCFEN for further feature extraction of the content components to obtain their content component features: Feat_A, Feat_B, Feat_CASB, and Feats_CBSA.

[0025] 5. Construct a style-guided segmentation head SGSegHead and a style component feature extraction module SCFEM. The style component feature extraction module extracts features of the style component and inputs them into the style-guided segmentation head for image segmentation, including the following steps:

[0026] (1) Construct a style component feature extraction module SCFEM, input the extracted style components styleA and styleB into the style component feature extraction module, and extract style features FStyleA and FStyleB.

[0027] (2) Constructing the style-guided segmentation head SGSegHead, in which Feat_CASB or Feats_CBSA is first passed through a pyramid pooling module to obtain the content feature feats_context A or feats_context B The style feature FStyleA or FStyleB is adjusted to the content component feature feats_context through a Reshape module A and feats_context B The same size, and then through a 3*3 convolution, the input style features are converted into higher-dimensional feature representations. The higher-dimensional feature representation passes through a spatial pyramid pooling module to extract style features of 1*1, 3*3, 5*5, and 7*7 pooling scales, and finally a 3*3 convolution module is used to obtain the segmentation style feature seg_feats_style A or seg_feats_style B . Then the segmentation style feature is passed through a 1*1 convolution layer to generate the logical style feature logits_style A or logits_style B . Add the logical style features and content features, and input the result into the style mask layer to get the style mask Mask_style A or Mask_style BThe style mask layer consists of a 3*3 convolution, a 1*1 convolution and a sigmoid activation function. Finally, the content feature plus the product of the segmentation style feature and the style mask are input into the 1*1 convolution segmentor to obtain the final segmentation result Segmentation A or Segmentation B .

[0028] This technical solution solves the problems of poor semantic segmentation effect caused by factors such as dark imaging, serious loss of details, blurred content, insufficient training data, etc. in low-light semantic segmentation. By extracting features from low-light images, self-attention is used to further extract regional features, detail features, and global features on the generated multi-scale feature map. The regional features, detail features, and global features are fused and decomposed to decouple the low-light image into content components, style components, and noise components. The content component is fused with the style component with added noise and decomposed again to improve the training speed and robustness of the model, so that the model can decompose the style component with noise, thereby obtaining the content component without noise and style influence. The obtained content component is subjected to feature extraction at different scales to obtain high-frequency and low-frequency features of the content component. The features extracted from the content component are used for low-light image segmentation through a style-guided segmentation head. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 :MSD-Net network structure diagram

[0030] Figure 2 :Image decoupling module IDM structure diagram

[0031] Figure 3 : Row-column attention module RC_attention structure diagram

[0032] Figure 4 : Style attention module Style_attention structure diagram

[0033] Figure 5 :Dual-branch channel attention module BCAM structure diagram

[0034] Figure 6 : Random noise selection module RNSM structure diagram

[0035] Figure 7 :Content component feature extraction network CCFEN structure diagram

[0036] Figure 8 :IFAformer structure diagram of frequency feature extraction module

[0037] Fig. 9:Structure diagram of style component feature extraction module SCFEM

[0038] Fig.10 : Style-guided segmentation head SGSegHead structure diagram DETAILED DESCRIPTION

[0039] Step 1: Create training and test datasets

[0040] 1. Based on the public dataset NightCity, we build the enhanced dataset NightCity-plus and the public dataset BDD100K as the datasets MSD-Tarin and MSD-Test of the model. The process is as follows:

[0041] 1-1 In NightCity, there are 2998 images of urban streets, buildings, vehicles and pedestrians with a resolution of 1024x512. The missing labels and wrongly labeled areas are supplemented, and 268 unreasonable annotations are modified in the training set and test set. 2998 images are used for training and 1299 images are used for testing.

[0042] 1-2 345 low-light road images were selected from the BDD100K dataset, including 314 low-light images for training and 31 images for testing.

[0043] 1-3 uses the training images in 1-1 and 1-2 as MSD-Tarin, and the test images in 1-1 and 1-2 as MSD-Test.

[0044] Table 1 Source of the dataset

[0045]

[0046] Step 2: Construct an image decoupling module to generate style component, content component and noise component

[0047] Due to the problem of uneven lighting in low-light images, large changes in image brightness and contrast, insufficient light will produce more noise, and there are also problems such as the small amount of data in low-light datasets, which increase the difficulty of image segmentation. Therefore, based on the theory of image style transfer, this paper first constructs an image decoupling module to decompose low-light images into style components, content components, and noise components for subsequent semantic segmentation tasks.

[0048] 2 Such as Figure 2 , Figure 3 , Figure 4 , Figure 5 As shown, an image decoupling module IDM is constructed to decompose the style component, content component and noise component from the image. The process is as follows:

[0049] 2-1 Take the image in the MSD-Tarin dataset in step 1 as input and put it into the image decoupling module IDM. The style component, content component and noise component are decomposed from the low-light image through the pooling module, row-column attention module RC_attention, style attention module Style_attention, dual-branch channel attention module BCAM and upsampling module. For the description of the structure of the image decoupling module IDM, see steps 2-2 to 2-8:

[0050] 2-2 As Figure 2 As shown in the figure, two low-light images are selected from the MSD-Train dataset for input each time, denoted as image A and image B respectively. Each time a low-light image is received, the original image is first converted into a standard vector format, and the standardized image is input into a convolution of size 7*7 and p p 3 for preliminary feature extraction, and then input into a downsampling layer consisting of two convolutions of size 3*3, p p 3, and stride 2. The image width and height are gradually reduced through the downsampling layer, and the number of channels is increased to capture higher-level features of the low-light image, and the preliminary feature feats of the image are obtained, with a size of (8*128*64*128).

[0051] 2-3 First, the feats extracted in 2-2 are input into the pooling layer, the feats are pooled through the average pooling layer, and then input into a 1*1 convolution and ReLU activation function to obtain the feature map feats1. The size of the feature map feats1 is (8*128*64*128).

[0052] 2-4 Then input the feats into the row-column attention module RC_attention, the steps are as follows:

[0053] 2-4-1 As Figure 3 As shown, the feats extracted in 2-2 are input into the RC_attention module to extract global features. In RC_attention, three 1*1 convolutions (to_q, to_k, to_v) are used to extract query, key, and value from the input feature feats respectively.

[0054] 2-4-2 In the top branch of RC_attention, Q, K, and V are first concatenated, and the obtained feature map passes through a 3*3 depth-wise separable convolution (Dwconv) and a batch normalization layer. Then the output is passed through a ReLu activation function, a 3*3 depth-wise separable convolution (Dwconv) and a batch normalization layer to enhance local details, and finally the deep feature map of Q, K, and V is obtained.

[0055] 2-4-3 Compress the rows and columns of the feature matrix of the Q, K, and V feature maps extracted in 2-4-1 respectively. In column compression, the input Q is averaged in the last dimension (i.e., column direction) to obtain the aggregate representation of each row. These row representations are encoded by the position encoding SAP module to obtain Qrow. Similarly, the input K is averaged in the column direction, then encoded by the position encoding SAP module, and reconstructed into the same shape as Qrow by the Reshape and Mean modules to obtain Krow. The input V is averaged in the column direction and transposed to obtain Vrow. Qrow and Krow are matrix multiplied and multiplied by the scaling factor scale to obtain the row attention weight Attn_row. The attention weight Attn_row is matrix multiplied with the value Vrow to obtain the weighted row representation XX_row. Similar to row attention, the average value is calculated in the row direction, and the column attention weight is calculated to complete the column attention and obtain the weighted column representation XX_column. The original value features are added to the row and column features obtained through the attention mechanism, and then a 3*3 convolution is used to restore the feature map to 128 dimensions. The h_sigmoid activation function is used as the gating mechanism to combine the enhanced features with the original query, key, and value extracted features through the gating mechanism to obtain feats2, which is (8*32*64*128).

[0056] 2-5 reference Figure 2 , input the low-level image features feats into the style attention module Style_attention to extract style features. Figure 4 As shown in the figure, Style_attention includes two branches. First, the input feature feats is downsampled through a 3*3 convolution and a 1*1 convolution module, and then the input data is converted to the embedding dimension through the Reshape function. In branch one, the converted features are passed through Swin Block, and the style features of the image are extracted using the core window attention mechanism in Swin Block, where the window size is 7*7. The other branch extracts channel features through a global average pooling layer, a fully connected layer, a ReLu activation function, a fully connected layer, and a Sigmoid activation function. The outputs of the two branches are concatenated and upsampled through a 3*3 convolution to obtain the feature map feats3, which is (8*16*64*128).

[0057] 2-6 Reference Figure 2, concatenate the feats1, feats2, and feats3 obtained in 2-3, 2-4, and 2-5 in the channel dimension through Concat to obtain Confeat, whose size is (176*64*128), and input the concatenated features into the dual-branch spatial attention module BCAM. Figure 5 As shown in the figure, in the BCAM module, the input Confeat is input into the spatial branch and the channel branch respectively. In the spatial branch, the input is channel compressed by maximum pooling and average pooling respectively to obtain two feature maps of size 1*64*128, and then two pooling feature maps are fused and learned through an MLP layer and matrix addition is performed to obtain two spatial feature maps of size 1*64*128, which are recorded as space_feat1 and space_feat2. At the same time, in the channel branch, the input is spatially compressed by maximum pooling Maxpool and average pooling Avgpool respectively to obtain two feature maps of size 176*1*1, and then two pooling feature maps are fused and learned through an MLP layer and matrix addition is performed to obtain two channel attention feature maps of size 176*1*1, which are recorded as channel_feat1 and channel_feat2. Add space_feat1 and space_feat2, and add channel_feat1 and channel_feat2 to obtain space_feat and channel_feat respectively. The obtained space_feat and channel_feat are concatenated through Concat to obtain a feature map merge_feat of size 1*8368. Then, merge_feat, which integrates the channel branch and the spatial branch, is decomposed into feature maps of the same size as the channel branch and the spatial branch through an MLP layer, and then matrix multiplied with the original feature map through a jump connection after a Sigmoid activation function. Finally, the inputs of the channel branch and the spatial branch are added to obtain the output feature map of the BCAM module, which is (176*64*128).

[0058] 2-7 Reference Figure 2 , the feature map after 2-6 fusion of spatial and channel attention is passed through a 3*3 convolution to perform channel dimension reduction. During model training, in order to help alleviate the gradient vanishing problem, two residual blocks ResidualBlock are designed through long-range jump connections so that the network can be better trained. The residual block ResidualBlock consists of a 3*3 convolution, a ReLu activation function, a batch normalization layer, a 3*3 convolution, a ReLu activation function, and a batch normalization layer.

[0059] 2-8 Finally, they pass through the style component upsampling layer, content component upsampling layer, and noise component upsampling layer respectively. Each upsampling layer consists of a 3*3 convolution, a ReLu activation function, a batch normalization layer, an upsampling function Upsample, a 3*3 convolution, a ReLu activation function, a batch normalization layer, and an upsampling function Upsample. Each upsampling layer magnifies the width and height of the feature map by 2 times and reduces the number of channels by half. The content component then passes through a 7*7 convolution and uses different loss functions to finally obtain the style component style, content component context, and noise component noise. Image A finally obtains the style component styleA, content component contextA, and noise component noiseA, and image B finally obtains the style component styleB, content component contextB, and noise component noiseB.

[0060] 2-9 Between the style component style and the content component context extracted by the IDM module, a smooth loss function loss_smooth is established to measure the smoothness between the style and content features. The smooth loss function loss_smooth is shown in formula (1):

[0061]

[0062] Among them, Sx n , Sy n , Cx n , Cy n is the gradient of the style component S and content component C of the nth feature map in the x direction and y direction, N is the total number of feature maps, the style component gradient is calculated as shown in formula (2), and the content component gradient is calculated as shown in formula (3):

[0063]

[0064] The exponential function is used and To weight the gradient, loss_weight is used to adjust the coefficient of the weight of the entire loss function and is a learnable parameter. The smooth loss function loss_smoothA of image A and the smooth loss function loss_smoothB of image B are obtained, and finally the final smooth loss is obtained, as shown in formula (4):

[0065] loss_smooth_all=loss_smoothA+loss_smoothB (4)

[0066] Step 3: Construct a random noise selection module to add random interference noise to the noise component

[0067] 3. Figure 6 As shown in the figure, a random noise selection module RNSM is constructed to add random interference noise to the noise component. By adding random noise, the IDM module can decompose the features of low-light images with strong interference noise and enhance the robustness of the model. The process is as follows:

[0068] 3-1 Input the noise component noise obtained in 2-6 into the random noise selection module RNSM. According to the noise component, the noise selection module Noise select uses three modes: direct, random, and maximum value to form random interference noise rnoise. Through a Concat module, noise and rnoise are concatenated to obtain synthetic noise Snoise. The synthetic noise Snoise is adjusted to the same size as the content component of image A through a 1*1 convolution, a 3*3 convolution, and a 1*1 convolution. The synthetic noise Snoise is added to the style representation of image B through the disturb function to obtain a new style component NS. B Finally, the image A content component contextA and the newly generated style component NS B Multiply pixel by pixel to generate a new disturbance image disturbance_img. The specific synthesis steps are shown in formulas (5), (6), and (7):

[0069] Snoise B =Concat(noise B , rnotse B )Snoise A =Concat(noise A , rnoise A ) (5)

[0070] NS B =D(Style B , Snoise B ) NS A =D(Style A , Snoise A ) (6)

[0071]

[0072] Where D is the disturbance function, which combines the style component and the synthetic noise component. It is a pixel-by-pixel multiplication operation.

[0073] 3-2 Reference Figure 1, repeat the steps in 3-1, and obtain the perturbed image im_CASB generated by applying the style component of image B fused with the noise component to the content component of image A, the style component S_CASB corresponding to im_CASB after decoupling by the image decoupling module IDM in step 2, the content component is C_CASB, and the noise component is N_CASB, and the perturbed image im_CBSA is generated by applying the style component of image A fused with the noise component to the content component of image B, and the style component S_CBSA, the content component C_CBSA, and the noise component N_CBSA corresponding to it after decoupling by the image decoupling module IDM in step 2.

[0074] 3-3 The style components S_CASB, S_CBSA, StyleA, and StyleB obtained by decoupling 2-8) and 3-2) are used to construct the style loss, as shown in formula (8) and formula (9):

[0075]

[0076]

[0077] Where H and W are the width and height of the feature map, C is the number of channels, G is the ij l is the Gram matrix of the L-th layer feature map of the style component S_CBSA or S_CASB, with dimensions C*(H*W), A ij l is the Gram matrix of the Lth layer feature map of StyleA or StyleB, with dimension C*(H*W), El 是 Energy function of style loss.

[0078] Finally, the weighted style loss is obtained, as shown in formula (10) and formula (11):

[0079]

[0080] L styte_all =L styteA +L styteB (11)

[0081] Where N is the number of feature maps, L styleA is the style loss of image A, L styleB is the style loss of image B, L style_all is the style loss of MSD-Net.

[0082] Step 4: Construct a content component feature extraction network to extract content component features

[0083] 4. Construct the content component feature extraction network CCFEN to extract the semantic features of the content components. The process is as follows:

[0084] 4-1 As Figure 7 As shown in the figure, the content component feature extraction network includes four stages. In the first stage, the content component feature map of the image is first input into the embedding layer (Path Embading), and the obtained output is then input into the linear layer. After that, the obtained output is input into the convolutional feedforward neural network (ConvFFN), where ConvFFN includes a batch normalization layer (Norm), a linear layer, a 1*1 convolution, and a jump connection is used to improve the learning ability of the model. Finally, the first stage outputs a feature image with a 4-fold downsampling rate. In the second stage, the feature image with a 4-fold downsampling rate is passed through a deformable attention module (DTM) and ConvFFN to obtain a feature image with a 8-fold downsampling rate. In the third stage, the feature image with a 8-fold downsampling rate is input into the deformable attention module (DTM), batch normalization and IFAformer modules. The jump connection method is also used to increase the learning ability of the model. The obtained output is then input into a 1*1 convolution and a ConvFFN to obtain a feature image with a 16-fold downsampling rate. The fourth stage is the same as the third stage, and finally a feature image with a 32-fold downsampling rate is obtained.

[0085] 4-2 As Figure 8 As shown in the figure, the frequency feature extraction module IFAformer is a dual-branch structure, which is divided into a high-frequency attention branch and a low-frequency attention branch. The high-frequency attention branch captures fine-grained high-frequency features with local window self-attention, where the window size is 2*2, and a simple non-overlapping window partitioning method is used to calculate the self-attention matrix of Q, K, and V in the window. The low-frequency attention branch uses the high-frequency feature map, first average pooling each window to obtain the low-frequency information in the input image, and then projects the average pooled feature map to the key K and value V. Q in the low-frequency attention branch still comes from the original feature map. By using standard scaled dot product attention in the high-frequency attention branch and the low-frequency attention branch, the dot product of Q, K, and V is calculated, and finally the output feature maps of the high-frequency branch and the low-frequency branch are spliced ​​through Concat, and then passed through a ReLU, a 1*1 convolution, and a batch normalization, and the outputs are added.

[0086] 4-3 Reference Figure 1 , the content components contextA, contextB, C_CASB, and C_CBSA decomposed from images A and B by 2-8 and 3-2 are respectively input into CCFEN for further feature extraction of the content components to obtain their content component features: Feat_A, Feat_B, Feat_CASB, and Feats_CBSA.

[0087] Step 5: Construct style component feature extraction module and style-guided segmentation head

[0088] 5 Reference Figure 1 , construct the style-guided segmentation head SGSegHead and the style component feature extraction module SCFEM, extract the features of the style components of image A and image B, and input them into the style-guided segmentation head for image segmentation. The process is:

[0089] 5-1 As Fig. 9 As shown, the style component feature extraction module SCFEM is constructed. SCFEM has four layers. The first layer is a standard 3*3 convolution layer and a ReLU activation function. The second layer is a 3*3 depth-separable convolution and a ReLU activation function. Jump connections are used to increase the expressiveness of the model. The third layer is also a 3*3 depth-separable convolution. The fourth layer is a standard 1*1 convolution layer and a ReLU activation function. The style components styleA and styleB extracted from 2-8 are input into the style component feature extraction module to extract style features FStyleA and FStyleB.

[0090] 5-2 As Fig.10 As shown in the figure, a style-guided segmentation head SGSegHead is constructed. In the style-guided segmentation head SGSegHead, Feat_CASB or Feats_CBSA is first passed through a pyramid pooling module to obtain the content feature feats_context A or feats_context B . The style feature FStyleA or FStyleB of 5-1 is adjusted to the content component feature feats_context through a Reshape module A and feats_context B The same size, and then through a 3*3 convolution, the input style features are converted into higher-dimensional feature representations. The higher-dimensional feature representation passes through a spatial pyramid pooling module to extract style features of 1*1, 3*3, 5*5, and 7*7 pooling scales, and finally a 3*3 convolution module is used to obtain the segmentation style feature seg_feats_style A or seg_feats_style B . Then the segmentation style feature is passed through a 1*1 convolution layer to generate the logical style feature logits_style A and logits_style B . Add the logical style features and content features, and input the result into the style mask layer to get the style mask Mask_styleA or Mask_style B The style mask layer consists of a 3*3 convolution, a 1*1 convolution and a sigmoid activation function. Finally, the content feature plus the product of the segmentation style feature and the style mask are input into the 1*1 convolution segmentor to obtain the final segmentation result Segmentation A or Segmentation B .

[0091] The above steps are shown in formulas (12), (13), (14), and (15):

[0092]

[0093] where f mask is the mask layer, where f all_seg is a segmentation convolutional layer, is matrix addition, is matrix multiplication. And construct the loss between the final segmentation result and the true label (GT), as shown in formula (16) and formula (17):

[0094] Loss segA =CrossEntropy(Segmentation A ,GT A ) (16)

[0095] Loss segB =CrossEntropy(Segmentation B , GT B ) (17)

[0096] The CrossEntropy(·) function is the cross entropy loss function, GT A and GT B are the true labels of image A and image B.

Claims

1. A method for semantic segmentation of low-light images based on a multi-scale style decoupling network MSD-Net, which features the following method steps:

1. By building the enhanced dataset NightCity-plus based on the public dataset NightCity and the public dataset BDD100K as the datasets MSD-Train and MSD-Test of the model.

2. Construct the image decoupling module IDM, through the pooling module and the row and column attention module RC_attention, style attention module Style_attention, dual-branch channel attention module BCAM and upsampling module decompose style component, content component and noise component from low-light image. The structure of image decoupling module IDM is shown in steps (1) to (7). Step (8) constructs a smooth loss function, which includes the following steps: (1) Each time, two low-light images are selected from the MSD-Train dataset for input, denoted as image A and image B. Whenever a low-light image is received, the original image is first converted into a standard vector format, and then the standardized image is input into a 7*7 convolution with a padding of p=3 for preliminary feature extraction. Then, it is input into a downsampling layer consisting of two convolutions of size 3*3, p=3, and a stride of 2. The image width and height are gradually reduced through the downsampling layer, while the number of channels is increased to capture higher-level features of the low-light image and obtain the preliminary feature feats of the image. (2) The preliminary feature feats extracted in (1) are subjected to a parallel operation. The parallel operation includes three branches, among which branch 1: inputs into the pooling layer, pools the feats through the average pooling layer, and then inputs into a 1*1 convolution and ReLU activation function to obtain the feature map feats1. (3) Branch 2: Input the low-level image features feats into the row-column attention module to obtain feats2. (4) Branch three: Input the low-level image features feats into the style attention module Style_attention to obtain the feature map feats3. (5) Feats1, feats2, and feats3 obtained from step (2) to step (4) are concatenated in the channel dimension through Concat to obtain the concatenated feature Confeat, and the concatenated feature Confeat is passed through a dual-branch spatial attention module BCAM. (6) The feature map after (5) fusion of spatial and channel attention is passed through a convolution with a size of 3*3, a padding p of 3, and a step size S of 1 to perform channel dimension reduction. During model training, in order to help alleviate the gradient vanishing problem, two residual modules are designed through long-range skip connections so that the network can be better trained. (7) Finally, the style component style, content component context and noise component noise are obtained by using different loss functions through the style component upsampling layer, content component upsampling layer and noise component upsampling layer. Image A finally obtains style component styleA, content component contextA and noise component noiseA, and image B finally obtains style component styleB, content component contextB and noise component noiseB. (8) In the IDM module, a smooth loss function loss_smooth is established to measure the smoothness between the style component style and the content component context extracted from the low-light image.

3. Construct a random noise selection module RNSM to add random interference noise to the noise component to increase the robustness of the model, including the following steps: (1) The noise component noise obtained by the decoupling module is input into the random noise selection module RNSM. First, according to the noise component, the noise selection module generates random interference noise rnoise, and the noise component noise and rnoise of image B are fused through a Concat layer to obtain the synthetic noise Snoise. The synthetic noise Snoise is adjusted to the same size as the content component of image A, and the synthetic noise Snoise is added to the style representation of image B through the disturbance function to obtain a new style component NS B Finally, the content component contextA of image A and the new style component NS of image B are generated B Multiply pixel by pixel to generate a new perturbed image im_CASB. The style component S_CASB corresponding to im_CASB is decoupled again by the image decoupling module IDM, the content component is C_CASB, and the noise component is N_CASB. (2) Repeat step (1) and apply the style component of image A fused with the noise component to the content component of image B to generate the perturbed image im_CBSA. Correspondingly, the perturbed image is decoupled again by the image decoupling module IDM to obtain the style component S_CBSA, the content component C_CBSA, and the noise component N_CBSA.

4. Construct a content component feature extraction network CCFEN to extract semantic features of content components, including the following steps: (1) The content component feature extraction network includes four stages. In the first stage, the content component feature map of the image is first input into the embedding layer (Path Embading), and the output is then input into the linear layer. The output is then input into the convolutional feedforward neural network (ConvFFN), where ConvFFN includes a batch normalization layer (Norm), a linear layer, a 1*1 convolution, and a jump connection is used to improve the learning ability of the model. Finally, the first stage outputs a feature image with a 4x downsampling rate. In the second stage, the feature image with a 4x downsampling rate is passed through a deformable attention module (DTM) and ConvFFN to obtain a feature image with a 8x downsampling rate. In the third stage, the feature image with a 8x downsampling rate is input into the deformable attention module (DTM), batch normalization and IFAformer modules. The jump connection method is also used to increase the learning ability of the model. The output is then input into a 1*1 convolution and a ConvFFN to obtain a feature image with a 16x downsampling rate. The fourth stage is the same as the third stage, and finally a feature image with a 32x downsampling rate is obtained. (2) The frequency feature extraction module IFAformer has a dual-branch structure, which is divided into a high-frequency attention branch and a low-frequency attention branch. The high-frequency attention branch captures fine-grained high-frequency features with local window self-attention, where the window size is 2*2, and a simple non-overlapping window partitioning method is used to calculate the self-attention matrix of Q, K, and V within the window. The low-frequency attention branch uses the high-frequency feature map, first average pooling each window to obtain the low-frequency information in the input image, and then projects the average pooled feature map to the key K and value V. Q in the low-frequency attention branch still comes from the original feature map. Finally, the output feature maps of the high-frequency branch and the low-frequency branch are fused. (3) The content components contextA, contextB, C_CASB, and C_CBSA decomposed from image A and image B are respectively input into CCFEN for further feature extraction of the content components to obtain their content component features: Feat_A, Feat_B, Feat_CASB, and Feats_CBSA.

5. Construct a style-guided segmentation head SGSegHead and a style component feature extraction module SCFEM. The style component feature extraction module extracts features of the style component and inputs them into the style-guided segmentation head for image segmentation, including the following steps: (1) Construct a style component feature extraction module SCFEM, input the extracted style components styleA and styleB into the style component feature extraction module, and extract style features FStyleA and FStyleB. (2) Constructing the style-guided segmentation head SGSegHead, in which Feat_CASB or Feats_CBSA is first passed through a pyramid pooling module to obtain the content feature feats_context A or feats_context B The style feature FStyleA or FStyleB is adjusted to the content component feature feats_context through a Reshape module A and feats_context B The same size, and then through a 3*3 convolution, the input style features are converted into higher-dimensional feature representations. The higher-dimensional feature representation passes through a spatial pyramid pooling module to extract style features of 1*1, 3*3, 5*5, and 7*7 pooling scales, and finally a 3*3 convolution module is used to obtain the segmentation style feature seg_feats_style A or seg_feats_style B . Then the segmentation style feature is passed through a 1*1 convolution layer to generate the logical style feature logits_style A or logits_style B . Add the logical style features and content features, and input the result into the style mask layer to get the style mask Mask_style A or Mask_style B The style mask layer consists of a 3*3 convolution, a 1*1 convolution and a sigmoid activation function. Finally, the content feature plus the product of the segmentation style feature and the style mask are input into the 1*1 convolution segmentor to obtain the final segmentation result Segmentation A or Segmentation B .

Citation Information

Cited By

  • Full-scale lung image segmentation algorithm based on hybrid connection

    CN118747804A

  • Image-text video generation method and system based on cross-modal semantic mapping

    CN120730138A

  • Emergency monitoring image semantic coding method, system and device based on illumination feature decoupling and medium

    CN121239797A

  • Emergency monitoring image semantic coding method, system and device based on illumination feature decoupling and medium

    CN121239797B