Glass image segmentation method based on polarization clues
By combining multi-wavelength polarization information, the glass segmentation network (PGSNet) solves the problem that existing technology is difficult to segment glass in complex scenes, achieves glass segmentation under different scenes and lighting conditions, and significantly improves the glass recognition of computer vision systems. Accuracy and efficiency.
Patent Information
- Application Number
- CN202210105325.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-28
AI Technical Summary
Existing image segmentation technology is difficult to effectively capture the characteristics of glass, especially in complex scenes, causing computer vision systems to encounter difficulties in understanding and segmenting glass, affecting the execution of tasks such as autonomous driving.
A glass segmentation network (PGSNet) that combines multi-wavelength polarization information is used. The network includes an early dynamic attention (EDA) module, a Conformer backbone network, a dynamic multi-modal feature integration (DMFI) module and a global context-guided decoding (GCGD) module. Weighted polarization information and RGB images are dynamically fused to extract global and local features to determine the position and boundaries of the glass.
It realizes glass segmentation under different scenes and lighting conditions, improves segmentation accuracy and efficiency, and significantly improves the computer vision system's ability to recognize glass, especially in complex scenes.
Smart Images

Figure CN114549548B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of scene segmentation in computer vision, realizes the segmentation of image content, and particularly relates to a method for segmenting glass images in a real environment. Background Art
[0002] Image segmentation is a technology that classifies each pixel in an image, thereby dividing the image into some areas with specific properties and proposing objects of interest. Its application areas include but are not limited to autonomous driving, image beautification, 3D reconstruction, etc.
[0003] As a common object in scenes, glass poses a great challenge to existing image segmentation technologies. Due to the transparent characteristics of glass materials and the lack of fixed RGB texture features, existing image segmentation algorithms find it difficult to capture the effective features of glass in scenes. Compared with other opaque materials, the appearance of glass depends on various local and global conditions, including reflections on the surfaces of objects in the environment, refractions on the surfaces of transparent objects, and the shape and color of the objects themselves, making it difficult to model their appearance features. At the same time, glass is widely used in complex indoor and outdoor environments, which poses great difficulties and obstacles to the scene understanding tasks of current computer vision systems, further affecting the execution of tasks such as robot navigation and autonomous driving.
[0004] The relevant technologies involved in the present invention include transparent object segmentation and polarization theory, etc.
[0005] Transparent object segmentation mainly determines the size, shape and position of transparent or semi-transparent objects in environmental images through contextual information or boundary detection, thereby helping drones and self-driving cars understand the surrounding scenes. However, existing transparent object segmentation methods are only applicable to glass segmentation in conventional scenes, because these methods cannot extract enough effective features through the reflection or refraction of glass in RGB images. When the scene in which the glass is located is more complex, confusing or deceptive, the effectiveness of existing transparent object segmentation methods is significantly reduced.
[0006] Polarization refers to the vibration of a beam of light waves at the same angle. Light beams emitted by coherent light sources will be polarized when they pass through a polarization filter or are reflected from a non-metallic surface. The degree of linear polarization DoLP and the angle of linear polarization AoLP are commonly used to describe linearly polarized light. The specific values of the two are related to the surface material of the object. Therefore, the polarization clues of glass can effectively improve the ability of the segmentation network to process glass in the scene. However, as the scene and lighting conditions change, the three wavelength bands of R, G, and B can provide different polarization clues, so it is necessary to comprehensively consider the information provided by polarized light at different wavelength bands. Glass segmentation networks that combine polarization information require special design.
[0007] Based on the investigation and analysis of existing scene segmentation technologies, the present invention discovered the obvious effect of polarization information on improving the ability to segment glass, proposed a segmentation method combining glass polarization clues, and formed a polarization glass segmentation network (PGSNet) that can effectively segment glass in scenes. The input of PGSNet is an RGB image containing glass and the corresponding AoLP and DoLP images in three different wavelength bands of R, G, and B. The output is a glass mask image. The value of the glass area in the mask image is 1, and the value of the non-glass area is 0. Experiments have shown that this method combined with multi-wavelength polarization clues can effectively segment different types of glass in different scenes and improve the accuracy of scene understanding. Summary of the invention
[0008] The purpose of the present invention is to innovatively use multi-wavelength polarization information for the RGB image of the scene to realize the glass segmentation method PGSNet. PGSNet successively includes an Early Dynamic Attention (EDA) module, a Conformer backbone network, a Dynamic Multimodal Feature Integration (DMFI) module and a Global Context Guided Decoder (GCGD) module, wherein the EDA module calculates the weights of AoLP and DoLP in three different wavelength bands respectively; the feature extractor extracts global and local features; the DMFI module dynamically enhances local context clues and integrates polarization features of three different wavelength bands; the GCGD module uses global guidance to focus the decoder on the glass area, and gradually determines the position and boundary of the glass in combination with polarization features of different levels. The method described in the present invention is suitable for segmenting glass of different positions, shapes and sizes under different light intensities.
[0009] The technical method of the present invention is as described above, which is a glass segmentation method based on polarization clues, and specifically comprises the following steps:
[0010] Step 1: Build a new polarized glass segmentation dataset RGBP-Glass
[0011] A glass segmentation dataset RGBP-Glass with polarization imaging is constructed. The dataset is shot using a FLIR Blackfly BFS-U3-51S5PC-C color polarization camera. Color polarization information in four different directions is collected at the same time, and polarization imaging in three different color wavelength bands of R, G, and B is obtained through processing. The dataset contains 4511 RGB color images of glass, corresponding AoLP and DoLP images in three different wavelength bands of R, G, and B, and manually annotated glass mask images. The scenes involved in the dataset include different types and shapes of glass shot in different places, different viewing angles, and different lighting conditions. The dataset is randomly divided into training and test sets.
[0012] Step 2: Build the glass segmentation network PGSNet
[0013] The glass segmentation network PGSNet consists of an early dynamic attention (EDA) module, a Conformer backbone network, a dynamic multimodal feature integration (DMFI) module, and a global context-guided decoding (GCGD) module;
[0014] The input of the EDA module is the R, G, B three-channel AoLP and DoLP polarization images. The module is implemented based on the ResNet-18 network, using a full convolution layer and a SoftMax operator to estimate the weight of polarization imaging in each wavelength band; formally, the EDA module is expressed as:
[0015] w r ,w g ,w b =σ( <G(p r ),G(p g ),G(p b )>),
[0016] P=[w r p r, w g p g ,w b p b ],
[0017] Among them, p {r,g,b} is the measured value of AoLP or DoLP of R, G, B channels, G is the weight estimation network, <·,·,·> represents a vector, and σ is the SoftMax function; the EDA module uses the estimation network and the SoftMax function to calculate the weight w of each channel {r,g,b}, and perform the connection operation on the channel dimension through [·,·,·];
[0018] The RGB image and the weighted polarization information output by the EDA module are fed into the Conformer backbone network, which is used to extract robust global and local features.
[0019] The DMFI module achieves robust fusion of features from three input domains by utilizing global and local information. The DMFI module mainly consists of two parts: the Dynamic Fusion (DF) block and the Multi-Scale Dependency Perception (MSDP) block.
[0020] The DF block first generates the corresponding spatial attention map based on the three token embedding sequences obtained. These token embedding sequences come from the three input modalities RGB, AoLP, and DoLP processed by the Conformer backbone network. Then the DF block weights and fuses the convolutional features extracted from the Conformer backbone network with the spatial attention map. This process is expressed as:
[0021]
[0022]
[0023] Where I, φ, and ρ represent RGB, AoLP, and DoLP inputs, respectively; Ω is a function that first reduces the dimension of each token embedding to one through a fully connected layer, and then reshapes the generated embedding into a 2D graph; M is the attention map calculated by the SoftMax function for each input; C and T in the formula represent the convolution features and token embeddings generated by the convolution branch and transformer branch in the Conformer backbone network, respectively, and the superscripts represent the index of the internal block of the Conformer. is element-wise multiplication;
[0024] The MSDP block is used to reduce the impact of changes in the shape and position of the target glass on the segmentation. It uses a multi-scale self-attention mechanism to enhance the dynamic fusion feature F DF The global dependency of the glass objects located in ; by changing the perception scale, the MSDP block effectively detects the correlation between regions of different scales; its form is defined as:
[0025]
[0026]
[0027]
[0028] in, Represents a k×k convolutional layer, a batch normalization (BN) and ReLU activation function; Represents an adaptive average pooling with a target size of n×n, with specific values including 5, 7, 9, and 11; represents a bilinear upsampling, α is a learnable parameter; represents the self-attention operation, which is defined as K and are three learnable linear embedding functions, expressed as three fully connected layers;
[0029] The DMFI module applies an additional 3×3 convolution on the output features of the MSDP block to obtain the final output of the entire module, which is expressed as
[0030] The GCGD module retains global context clues in the decoding stage to avoid over-segmentation of the network algorithm, including the Global Context Generation (GCG) module and the Attention Enhancement (AE) module; the GCG module generates global guidance clues across three input domains, and the AE module uses these global guidance clues to enhance the underlying features;
[0031] The GCG module is used to judge the tag embedding provided by the Conformer backbone network Whether it has inherent global perception features; first, these tag embeddings are utilized by calculating a set of cross-correlation features. The process is expressed as:
[0032]
[0033] Among them, xy belongs to the set {Iφ,Iρ,φI,φρ,ρI,ρφ}, represents the sigmoid function, and d represents the length of a token embedding; these interrelated features are then combined through a linear projection Γ, which is implemented by a fully connected layer:
[0034] T=Γ([F Iφ ,F Iρ ,F φI ,F φρ ,F ρI ,F ρφ ]).
[0035] The AE module uses the combined features of the GCG module to enhance the input features by calculating and combining the spatial enhancement map E and the channel feature e; four AE blocks are deployed in the GCGD module, and the decoder features first pass through the fourth AE block. The features output between AE blocks are processed and transmitted through a basic decoder BD. The mathematical definition of the jth AE block is as follows:
[0036] e j =R(F j )*R(T g ),
[0037] F j′ =F j *e j +F j ,
[0038] E j =P c (F j′ )*P T (t s ,T g ),
[0039] F j″ =F j′ *E j +F j′ ,
[0040]
[0041] Among them, the first 4th AE block meets F j =F 4 =F DMFI , the other three Here Generated by the previous AE block; R(x) is defined as Channel feature generator of P c (x) is a spatial graph generator based on convolutional features, defined as P T (x,y) is a spatial graph generator based on tag embedding, defined as T g and t s represents the n glass marker and 1 division marker in T;
[0042] Step 3: Training process
[0043] During training, the AoLP and DoLP images containing glass in the training set are first fed into the EDA module. After the polarization information is weighted, they are fed into the Conformer backbone network together with the original RGB image to extract global and local information of different scales. The DMFI module is then used to fuse the features of the three input domains. Finally, the GCGD module is used to determine the glass boundary to avoid over-segmentation.
[0044] The training process is supervised by the corresponding manually annotated glass mask images. The GCGD module is referred to as the decoder, and the rest of the modules are collectively referred to as the encoder. The training of the Conformer backbone network is supervised in the encoder, and the loss is calculated as follows:
[0045]
[0046] in and They are the sum of binary cross entropy (BCE) loss and IoU loss, which are used to calculate the loss functions of the convolution branch and transformer branch in Conformer respectively;
[0047] For the decoder, the features generated by the supervised GCG module and the three deep AE modules are used to calculate the loss:
[0048]
[0049] The sum of BCE loss and IoU loss is also used as the loss function of 3 AE modules and 1 GCG module;
[0050] Finally, take the encoder loss L E , decoder loss L D Based on the sum of the BCE loss and IoU loss on the output mask, the edge loss (edgeloss) that can make the segmentation boundary more accurate is added as the final loss function, which is defined as:
[0051] L=L E +L D +l bce +l iou +ωl edge ,
[0052] Based on experience, the value of ω is set to 10.
[0053] Beneficial results of the present invention:
[0054] (1) Innovation of methods
[0055] This paper is the first deep learning-based method to use multi-wavelength polarization cues to achieve real glass segmentation in images. This method innovatively integrates the RGB information and weighted polarization information of glass images, and uses global context information to avoid over-segmentation when determining glass. This paper designs PGSNet to solve the glass segmentation problem in computer vision tasks.
[0056] (2) Results and efficiency of glass segmentation
[0057] The present invention uses both RGB and polarization cues in glass segmentation for the first time, which solves the problem of glass segmentation difficulties in complex scenes, helps computer vision systems distinguish glass in images, and eliminates interference from glass. The method of the present invention dynamically fuses the RGB and polarization information of the scene, integrates global and local contextual cues to accurately segment glass, and proves the accuracy of PGSNet glass segmentation results through comparative experiments. In the comparative experiments, PGSNet outperforms the other four commonly used indicators (IoU, The present invention also conducted further tests and found that the glass segmentation method of PGSNet has unique advantages for large glass in real scenes, which proves its value in practical applications.
[0058] (3) Wider applicability
[0059] The present invention is applicable to glass segmentation in various scenarios. PGSNet has obvious performance advantages in the following types of scenarios: a) glass partially blocks objects and the optical textures reflected by the glass and the objects are similar; b) glass is embedded in a metal frame; c) glass is hidden in RGB images in a dark environment. The above proves the effectiveness and practicality of PGSNet in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is the network structure of PGSNet of the present invention.
[0061] Figure 2 The results of the embodiments of the present invention and the results of comparative experiments are shown in (a) PGSNet output results, and (b) comparative test results. DETAILED DESCRIPTION
[0062] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0063] The glass segmentation dataset RGBP-Glass with polarization cues used in this example contains a total of 4511 RGB images of different types of glass in different scenes, and their corresponding AoLP and DoLP images in three different wavelength bands of R, G, and B, as well as manually annotated glass mask images. The dataset is randomly divided into a training set (3207 groups of images) and a test set (1304 groups of images). The images in the dataset RGBP-Glass will be uniformly scaled to 416×416 size during training, and the output results of image segmentation will be resized to the original size of the input image. The EDA module is initialized by the pre-trained ResNet-18 network, the Conformer network is initialized using the pre-training results on ImageNet, and other parameters are randomly initialized.
[0064] In PGSNet, the AoLP and DoLP images are respectively passed through the EDA module to obtain weighted results in three different wavelength bands, and then sent to the Conformer backbone network together with the RGB image. After extracting global and local features of different scales, they are sent to the DMFI module, which robustly fuses the features of the three input domains. Finally, the GCGD module uses global context clues to determine the glass position and optimize the glass boundary. The predicted output result of this module is used as the final glass segmentation result. The implementation of PGSNet is based on PyTorch and uses a stochastic gradient descent optimizer with a momentum value of 0.9 and a weight decay of 5×10 -4 , the learning rate is set to 0.001 and the batch size is 18.
[0065] Figure 1 This is the network structure of PGSNet. PGSNet consists of the EDA module for processing multi-color polarization cues AoLP and DoLP, the Conformer backbone network for extracting global and local features, the DMFI module, and the GCGD module. PGSNet takes a group of RGB images and their corresponding polarization images as input. The Conformer backbone network extracts feature information, the DMFI module integrates input features, and the GCGD module determines the glass position and generates a glass mask image as the final glass segmentation result.
[0066] Figure 2 It is a display of the results of the embodiments of the present invention and the results of comparative experiments. Figure 2 (a) is a display of the network output results of the present invention, and the rightmost column is a manually annotated mask image used for comparison; Figure 2(b) is a comparison result of other state-of-the-art methods in the field to verify the effectiveness of PGSNet. We retrained other deep neural networks for segmentation in the field (GDNet, GSD, P Mask R-CNN, Trans2Seg, and TransLab) and trained them on the same RGBP-Glass training set using publicly available code and tested them on the same RGBP-Glass test set.
Claims
1. A glass image segmentation method based on polarization cues, characterized in that: Using multi-wavelength polarization information to achieve glass segmentation includes the following steps: Step 1: Build a new polarized glass segmentation dataset RGBP-Glass A glass segmentation dataset with polarization imaging is constructed. The dataset is shot with a color polarization camera, and color polarization information in four different directions is collected at the same time. Polarization imaging in three different color wavelength bands of R, G, and B is obtained by processing. The dataset contains RGB color images of glass, corresponding AoLP and DoLP polarization images in three different wavelength bands of R, G, and B, and manually annotated glass mask images. The scenes involved in the dataset include different types and shapes of glass shot in different places, different viewing angles, and different lighting conditions. The dataset is randomly divided into training and test sets. Step 2: Build the glass segmentation network PGSNet The glass segmentation network PGSNet is mainly composed of an early dynamic attention module, a Conformer backbone network, a dynamic multimodal feature integration module, and a global context-guided decoding module; The input of the early dynamic attention module is the R, G, B three-channel AoLP and DoLP polarization images. The module is implemented based on the ResNet-18 network, using a full convolutional layer and a SoftMax operator to estimate the weight of polarization imaging in each wavelength band; formally, the early dynamic attention module is expressed as: w r ,w g ,w b =σ(<G(p r ),G(p g ),G(p b )>), P=[w r p r ,w g p g ,w b p b ], Among them, p {r,g,b} is the measured value of AoLP or DoLP of R, G, B channels, G is the weight estimation network, <·,·,·> represents the vector, and σ is the SoftMax function; the early dynamic attention module uses the estimation network and the SoftMax function to calculate the weight w of each channel {r,g,b} , and perform the connection operation on the channel dimension through [·,·,·]; The RGB image and the weighted polarization information output by the EDA module are fed into the Conformer backbone network, which is used to extract robust global and local features. The dynamic multimodal feature integration module achieves robust fusion of features from three input domains by utilizing global and local information. The dynamic multimodal feature integration module mainly consists of two parts: dynamic fusion block and multi-scale dependency perception block. The dynamic fusion block first generates the corresponding spatial attention map based on the three obtained marker embedding sequences, which come from the three input modalities RGB, AoLP, and DoLP processed by the Conformer backbone network; then the dynamic fusion block weights and fuses the convolutional features extracted from the Conformer backbone network with the spatial attention map. This process is expressed as: Where I, φ, and ρ represent RGB, AoLP, and DoLP inputs, respectively; Ω is a function that first reduces the dimension of each token embedding to one through a fully connected layer, and then reshapes the generated embedding into a 2D graph; M is the attention map calculated by the SoftMax function for each input; C and T in the formula represent the convolution features and token embeddings generated by the convolution branch and transformer branch in the Conformer backbone network, respectively, and the superscripts represent the index of the internal block of the Conformer. is element-wise multiplication; The multi-scale dependency perception block is used to reduce the impact of changes in the shape and position of the target glass on the segmentation. It uses a multi-scale self-attention mechanism to enhance the dynamic fusion feature F DF The global dependency of the glass objects located in ; by changing the perception scale, the multi-scale dependency perception block effectively detects the correlation between regions of different scales; its form is defined as: in, represents a k×k convolutional layer, a batch normalization and ReLU activation function; Represents an adaptive average pooling with a target size of n×n, with specific values including 5, 7, 9, and 11; represents a bilinear upsampling, α is a learnable parameter; represents the self-attention operation, which is defined as K and are three learnable linear embedding functions, expressed as three fully connected layers; The dynamic multimodal feature integration module applies an additional 3×3 convolution on the output features of the multi-scale dependency perception block to obtain the final output of the entire module, which is expressed as The global context guided decoding module retains global context clues in the decoding stage, including the global context generation module and the attention enhancement module. The global context generation module generates global guidance clues across three input domains, and the attention enhancement module uses these global guidance clues to enhance the underlying features; The global context generation module is used to judge the tag embedding provided by the Conformer backbone network Whether it has inherent global perception features; first, these tag embeddings are utilized by calculating a set of cross-correlation features. The process is expressed as: Among them, xy belongs to the set {Iφ,Iρ,φI,φρ,ρI,ρφ}, represents the sigmoid function, and d represents the length of a token embedding; these interrelated features are then combined through a linear projection Γ, which is implemented by a fully connected layer: T=Γ([F Iφ ,F Iρ ,F φI ,F φp ,F ρI ,F ρφ ]). The attention enhancement module uses the combined features of the global context generation module to enhance the input features by calculating and combining the spatial enhancement map E and the channel feature e; in the global context guided decoding module, four attention enhancement modules are deployed, and the decoder features first pass through the fourth attention enhancement module. The features output between the attention enhancement modules are processed and transmitted through a basic decoder BD; the mathematical definition of the jth attention enhancement module is as follows: e j =R(F j )*R(T g ), F j′ =F j *e j +F j , E j =P c (F j′ )*P T (t s ,T g ), F j″ =F j′ *E j +F j′ , Among them, the first fourth attention enhancement module F j =F 4 =F DMFI , the other three attention enhancement modules satisfy Here Generated by the previous attention enhancement module; R(x) is the channel feature generator, defined as P c (x) is a spatial graph generator based on convolutional features, defined as P T (x, y) is a spatial graph generator based on tag embedding, defined as T g and t s represents the n glass marker and 1 division marker in T; Step 3: Training process During training, the AoLP and DoLP polarized images containing glass in the training set are first fed into the early dynamic attention module, and the polarization information is weighted and fed into the Conformer backbone network together with the original RGB image to extract global and local information of different scales. Then, the dynamic multimodal feature integration module is used to fuse the features of the three input domains, and finally the global context is used to guide the decoding module to determine the glass boundary to avoid over-segmentation. The training process is supervised by the corresponding manually annotated glass mask images. The global context-guided decoding module is referred to as the decoder, and the rest is collectively referred to as the encoder. The training of the Conformer backbone network is supervised in the encoder, and its loss is calculated as follows: in, and They are the sum of the binary cross entropy loss and the IoU loss, which are used to calculate the loss functions of the convolution branch and the transformer branch in Conformer respectively; For the decoder, the features generated by the global context generation module and the three deep attention enhancement modules are supervised, and the method for calculating the loss is defined as: The sum of BCE loss and IoU loss is also used as the loss function of 3 attention enhancement modules and 1 global context generation module; Finally, take the encoder loss L E , decoder loss L D On the basis of the sum of the BCE loss and IoU loss on the output mask, a boundary loss that can make the segmentation boundary more accurate is added as the final loss function, which is defined as: L=L E +L D +l bce +l iou +ωl edge , Based on experience, the value of ω is set to 10.
Citation Information
Patent Citations
Image Semantic Segmentation Method Based on Deep Full Convolutional Network and Conditional Random Field
AU2020103901A4
Video conspicuous target detection method based on dynamic attention center
CN106503683A
Semantic segmentation method of attention mechanism based on deep learning
CN112287940A
