Semantic segmentation network construction method, semantic segmentation method and autonomous driving method

By constructing a semantic segmentation network including short-term connection units, pixel-level attention modules and detail guidance modules, the problem of unsatisfactory semantic segmentation accuracy of lightweight network models in autonomous driving is solved, achieving high accuracy, low resource consumption and real-time performance, improving the reliability of autonomous driving decision-making.

CN114241435BActive Publication Date: 2024-09-06SHENZHEN YUNTU ZHIXING TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210047108.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-17
Publication Date
2024-09-06
Estimated Expiration
2042-01-17

AI Technical Summary

Technical Problem

Due to the lack of extraction of high-level feature information of images in existing lightweight network models in autonomous driving, the accuracy of semantic segmentation is not ideal, which affects the accuracy and reliability of decision-making. In addition, high-precision models are computationally expensive and difficult to guarantee real-time performance.

Method used

Short-term connection units based on convolution, batch normalization and activation functions are constructed, stacked to form an encoder, and combined with the pixel-level attention module and the detail guidance module of the Gaussian-Laplacian operator to build a semantic segmentation network to improve feature extraction and Segmentation accuracy while reducing resource consumption.

Benefits of technology

It achieves high reliability, high accuracy and low resource consumption of the semantic segmentation network, meets the real-time requirements of autonomous driving, and improves the accuracy and reliability of decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241435B
    Figure CN114241435B
Patent Text Reader

Abstract

The present invention discloses a method for constructing a semantic segmentation network, including constructing a short-term connection unit; stacking to obtain an encoder; constructing a pixel-level attention module; performing upsampling to construct a decoder; combining the encoder and the decoder to obtain a semantic segmentation network; constructing a detail guidance module for training the semantic segmentation network; and completing the construction of the semantic segmentation network. The present invention also discloses a semantic segmentation method including the semantic segmentation network construction method, and an autonomous driving method including the semantic segmentation method. The semantic segmentation network construction method, semantic segmentation method, and autonomous driving method provided by the present invention, through the innovative design and construction of a semantic segmentation network, not only realize the establishment of a semantic segmentation network and corresponding semantic segmentation, but also the method of the present invention has higher reliability, higher accuracy, and less resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data recognition and image processing, and specifically relates to a semantic segmentation network construction method, a semantic segmentation method and an automatic driving method. Background Art

[0002] With the development of economy and technology and the improvement of people's living standards, data recognition and image processing technologies have been widely used in people's production and life, bringing endless convenience to people's production and life.

[0003] At the same time, with the continuous improvement of hardware computing power, the intelligence of some machines and equipment has been realized, such as smart homes, smart medical devices, and self-driving cars. Autonomous driving is the most representative application technology in recent years. In autonomous driving, various targets and locations on the road need to be identified and positioned in real time, which puts higher requirements on the real-time performance of semantic segmentation. Most of the control methods of autonomous driving require accurate mathematical analytical models. Models with higher accuracy are more complex, have more parameters, and have extremely high computational costs, making it difficult to ensure the real-time performance requirements of autonomous driving.

[0004] With the development of artificial intelligence, big data and the Internet, technical solutions based on artificial intelligence have gradually begun to be applied to autonomous driving. In the process of applying machine learning algorithms based on deep learning to autonomous driving decisions, high-performance GPUs and parallel computing are used as the basis, and neural networks are used to train the massive images captured by the camera to identify and segment various targets on the road, and ultimately provide auxiliary decisions for autonomous driving behavior. This solution has less human intervention in the intermediate process and can effectively improve the performance of the decision-making system. Deep learning performs better than traditional algorithms in the field of autonomous driving because it can learn from raw image data and extract better features through algorithms.

[0005] The purpose of deep learning-based image semantic segmentation is to give each pixel of the input image a category label and generate segmentation masks of different colors according to the pixel category, ultimately presenting the effect of different colored area blocks. Although the current lightweight network model can complete image prediction at a faster speed, due to the lack of extraction of high-level feature information of the image, it will eventually lead to unsatisfactory image segmentation accuracy, which will seriously affect the accuracy and reliability of decision-making. Summary of the invention

[0006] One of the purposes of the present invention is to provide a method for constructing a semantic segmentation network with high reliability, high accuracy and low resource consumption.

[0007] A second object of the present invention is to provide a semantic segmentation method including the semantic segmentation network construction method.

[0008] A third object of the present invention is to provide an autonomous driving method including the semantic segmentation method.

[0009] The semantic segmentation network construction method provided by the present invention comprises the following steps:

[0010] S1. Construct short-term connection units based on convolution, batch normalization and activation functions;

[0011] S2. The encoder is obtained by stacking the short-term connection unit and convolution constructed in step S1;

[0012] S3. Build pixel-level attention module;

[0013] S4. Upsample the output of the encoder and the output of the pixel-level attention module to construct a decoder;

[0014] S5. Combining the encoder obtained in step S2 and the decoder obtained in step S4, a semantic segmentation network is constructed;

[0015] S6. Construct a detail-guided module based on Gaussian-Laplacian operator for training the semantic segmentation network;

[0016] S7. Complete the construction of the semantic segmentation network.

[0017] The short-term connection unit is constructed based on convolution, batch normalization and activation function described in step S1, which specifically includes the following steps:

[0018] The following steps are used to construct a type A short-term connection unit:

[0019] The A-type short-term connection unit includes an A-type cascade structure, an A-type branch structure, and a channel random mixing operation layer; the A-type cascade structure is used for feature extraction; the A-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the A-type branch structure is connected in parallel with the A-type cascade structure; after the result of the A-type branch structure is summed with the result of the A-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the A-type short-term connection unit;

[0020] The A-type cascade structure includes four Conx structure layers and one connection layer, and the four Conx structure layers and one connection layer are connected in series in sequence; at the same time, the second output end of the first Conx structure layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels;

[0021] The A-type branch structure includes three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels;

[0022] The following steps are used to construct a type B short-term connection unit:

[0023] The B-type short-term connection unit includes a B-type cascade structure, a B-type branch structure and a channel random mixing operation layer; the B-type cascade structure is used for feature extraction; the B-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the channel random mixing operation layer is used to enhance information interaction between channels; the B-type branch structure is connected in parallel with the B-type cascade structure; after the result of the B-type branch structure is summed with the result of the B-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the B-type short-term connection unit;

[0024] The Class B cascade structure includes four Conx structure layers, a connection layer and an average pooling layer, and the four Conx structure layers and the connection layer are connected in series in sequence; the second output end of the first Conx structure layer is connected to the average pooling layer; at the same time, the output end of the average pooling layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 2; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels;

[0025] The type B branch structure includes an average pooling layer and three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels.

[0026] The activation function is the Relu function.

[0027] The short-term connection unit constructed in step S1 and the convolution are stacked to obtain an encoder, which specifically includes the following steps:

[0028] The encoder includes five layers; the five layers are connected in series;

[0029] The first layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 32, and the output resolution is 384*768;

[0030] The second layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 64, and the output resolution is 192*384;

[0031] The third layer is the first short-term connection unit stacking layer, which includes five short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fifth short-term connection units are type A short-term connection units; the convolution step size of the third layer is 2, the number of output channels is 256, and the resolution is 96*192;

[0032] The fourth layer is the second short-term connection unit stacking layer, which includes six short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to sixth short-term connection units are type A short-term connection units; the convolution step size of the fourth layer is 2, the number of output channels is 512, and the resolution is 48*96;

[0033] The fifth layer is the third short-term connection unit stacking layer, which includes four short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fourth short-term connection units are type A short-term connection units; the convolution step size of the fifth layer is 2, the number of output channels is 1024, and the resolution is 24*48.

[0034] The step S3 of constructing the pixel-level attention module specifically includes the following steps:

[0035] The pixel attention module is used to focus on the target pixel and enhance the weight of the target pixel, thereby enriching the high-level feature map;

[0036] The output X of the pixel-level attention module is calculated using the following formula: proc :

[0037] X proc =F r (X wmap ×F r (X pre ))

[0038] Where F r () is the reshape operation; X wamp is the first intermediate feature map, X pre is the second intermediate feature map, X wmap =δ(F r (X pre ×E r (X pre ))), X In is the input feature map with c channels and size h*w; In ′ is the input feature map X In The feature map after the outside of the scale is filled with all 1s; It is a standard convolution operation, the size of the convolution kernel is 3*3, the step size is 1, d is the hole rate; δ is the sigmoid activation function; BN() is a batch normalization operation.

[0039] The output result of the encoder and the output result of the pixel-level attention module are upsampled in step S4 to construct a decoder, which specifically includes the following steps:

[0040] The output of the fifth layer of the encoder is processed by the pixel-level attention module to obtain the fifth layer processed output value; the fifth layer processed output value is upsampled by 2 times as the fourth layer of the decoder;

[0041] The output of the fourth layer of the encoder is processed by the pixel-level attention module to obtain the fourth layer processing output value; the fourth layer processing output value is added to the fourth layer output value of the decoder, and then upsampled by 2 to serve as the third layer of the decoder;

[0042] The output value of the third layer of the decoder is added to the output value of the third layer of the encoder, and then upsampled by 2 times to serve as the second layer of the decoder;

[0043] The output value of the second layer of the decoder is added to the output value of the second layer of the encoder, and then upsampled by 4 times to serve as the output value of the decoder.

[0044] The upsampling is bilinear interpolation upsampling.

[0045] The step S6 of constructing a detail guidance module based on the Gaussian-Laplace operator specifically includes the following steps:

[0046] The manually marked image is input into Gaussian-Laplacian convolution for processing to obtain a detail marked image;

[0047] The detail loss between the detail labeled image and the predicted image is calculated, and the obtained detail loss is used to train the semantic segmentation network.

[0048] The manually marked image is input into the Gaussian-Laplacian convolution for processing, which specifically includes the following steps:

[0049] The manually labeled image is input into three Gaussian-Laplacian convolutions for processing; the convolution step size of the first Gaussian-Laplacian convolution is 2, the convolution step size of the second Gaussian-Laplacian convolution is 4, and the convolution step size of the third Gaussian-Laplacian convolution is 8; finally, the output results of the three Gaussian-Laplacian convolutions are processed through a convolution layer to obtain the final detail labeled image; the convolution kernel of the convolution layer is 1*1, and the step size is 1.

[0050] The calculation of the detail loss between the detail marked image and the predicted image is specifically to calculate the detail loss L using the following formula: detail (p d , g d ):

[0051] L detail (p d , g d )=L dice (p d , gd )+L ce (p d , g d )

[0052] Where p d is the predicted value of the third layer of the encoder in the semantic segmentation network; g d The true value of the detail labeled image; L ce (p d , g d ) is the cross entropy loss function value between the predicted value and the true value; L dice (p d , g d ) is the DICE function value between the predicted value and the true value.

[0053] The DICE function value is specifically calculated by the following formula: dice (p d , g d ):

[0054]

[0055] In the formula is the predicted value p of the third layer of the encoder in the semantic segmentation network d The i-th pixel of The true value g of the detail labeled image d The i-th pixel of ; H is the height of the third-layer feature matrix of the encoder; W is the width of the third-layer feature matrix of the encoder; ε is a set constant, preferably 1.

[0056] The present invention also discloses a semantic segmentation method including the above-mentioned semantic segmentation network construction method, comprising the following steps:

[0057] A. Obtain the original image dataset and manually label it to obtain the training dataset;

[0058] B. Use the above semantic segmentation network construction method to build a preliminary semantic segmentation network;

[0059] C. Using the training data set obtained in step A, train the preliminary semantic segmentation network obtained in step B to obtain the final semantic segmentation network;

[0060] D. Use the semantic segmentation network obtained in step C to perform semantic segmentation on the actual image and complete the final semantic segmentation.

[0061] The present invention also discloses an automatic driving method, which adopts the above-mentioned semantic segmentation method to perform real-time semantic segmentation, thereby completing automatic driving.

[0062] The semantic segmentation network construction method, semantic segmentation method and autonomous driving method provided by the present invention, through the innovative design and construction of the semantic segmentation network, not only realize the establishment of the semantic segmentation network and the corresponding semantic segmentation, but also the method of the present invention has higher reliability, higher accuracy and less resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 The figure is a flow chart of the network construction method of the present invention.

[0064] Figure 2 It is a schematic diagram of the structure of the short-term connection unit in the network construction method of the present invention.

[0065] Figure 3 Schematic diagram of the structure of the pixel-level attention module in the network construction method of the present invention.

[0066] Figure 4 It is a structural schematic diagram of the semantic segmentation network in the network construction method of the present invention.

[0067] Figure 5 It is a structural schematic diagram of a semantic segmentation network with a detail guidance module in the network construction method of the present invention.

[0068] Figure 6 Schematic diagram of the method flow of the semantic segmentation method of the present invention.

[0069] Figure 7 It is a schematic diagram of the change of loss value and average intersection-to-combination ratio in an embodiment of the present invention.

[0070] Figure 8 It is a visual schematic diagram of a detail guidance module in an embodiment of the present invention.

[0071] Fig. 9 Schematic diagram of CRnet series and Resnet-101 segmentation pictures in an embodiment of the present invention. DETAILED DESCRIPTION

[0072] like Figure 1 The method flow chart of the network construction method of the present invention is shown as follows: The semantic segmentation network construction method provided by the present invention comprises the following steps:

[0073] S1. Based on convolution, batch normalization and activation function, a short-term connection unit (STCU) is constructed; specifically, the steps are as follows:

[0074] The following steps are used to construct a type A short-term connection unit:

[0075] The A-type short-term connection unit includes an A-type cascade structure, an A-type branch structure, and a channel random mixing operation layer; the A-type cascade structure is used for feature extraction; the A-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the A-type branch structure is connected in parallel with the A-type cascade structure; after the result of the A-type branch structure is summed with the result of the A-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the A-type short-term connection unit;

[0076] The A-type cascade structure includes four Conx structure layers and one connection layer, and the four Conx structure layers and one connection layer are connected in series in sequence; at the same time, the second output end of the first Conx structure layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels;

[0077] The A-type branch structure includes three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels;

[0078] The following steps are used to construct a type B short-term connection unit:

[0079] The B-type short-term connection unit includes a B-type cascade structure, a B-type branch structure and a channel random mixing operation layer; the B-type cascade structure is used for feature extraction; the B-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the channel random mixing operation layer is used to enhance information interaction between channels; the B-type branch structure is connected in parallel with the B-type cascade structure; after the result of the B-type branch structure is summed with the result of the B-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the B-type short-term connection unit;

[0080] The Class B cascade structure includes four Conx structure layers, a connection layer and an average pooling layer, and the four Conx structure layers and the connection layer are connected in series in sequence; the second output end of the first Conx structure layer is connected to the average pooling layer; at the same time, the output end of the average pooling layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 2; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels;

[0081] The B-type branch structure includes an average pooling layer and three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels;

[0082] In specific implementation, the activation function is the Relu function; the structure of the short-term connection unit of type A is as follows Figure 2 As shown in (a), the structure of the short-term connection unit of type B is as follows Figure 2 As shown in (b); the short-term connection unit encodes the multi-scale information of the input feature map and expands the receptive field. The expansion of the receptive field is conducive to the induction of high-level information;

[0083] S2. In order to build a lightweight, real-time semantic segmentation network model while ensuring segmentation accuracy, sufficient multi-scale information is obtained in a shallow network and more global features are extracted. The encoder is obtained by stacking the short-term connection unit and convolution constructed in step S1, which can more effectively extract the multi-scale information and global context information of the feature map; specifically, the following steps are included:

[0084] The encoder includes five layers; the five layers are connected in series;

[0085] The first layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 32, and the output resolution is 384*768;

[0086] The second layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 64, and the output resolution is 192*384;

[0087] The first and second layers of the network are used to achieve fast downsampling to reduce the resolution. Small resolution can effectively reduce the number of network parameters.

[0088] The third layer is the first short-term connection unit stacking layer, which includes five short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fifth short-term connection units are type A short-term connection units; the convolution step size of the third layer is 2, the number of output channels is 256, and the resolution is 96*192;

[0089] The fourth layer is the second short-term connection unit stacking layer, which includes six short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to sixth short-term connection units are type A short-term connection units; the convolution step size of the fourth layer is 2, the number of output channels is 512, and the resolution is 48*96;

[0090] The fifth layer is a third short-term connection unit stacking layer, including four short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fourth short-term connection units are type A short-term connection units; the convolution step size of the fifth layer is 2, the number of output channels is 1024, and the resolution is 24*48;

[0091] S3. Construct a pixel-level attention module; specifically, the following steps are included:

[0092] The pixel attention module is used to focus on the target pixel and enhance the weight of the target pixel, thereby enriching the high-level feature map;

[0093] The output X of the pixel-level attention module is calculated using the following formula: proc :

[0094] X proc =F r (X wmap ×F r (X pre ))

[0095] Where F r () is the reshape operation; X wamp is the first intermediate feature map, X pre is the second intermediate feature map, X wmap =δ(F r (X pre ×F r (X pre ))), XIn is the input feature map with c channels and size h*w; In ′ is the input feature map X In The feature map after the outside of the scale is filled with all 1s; It is a standard convolution operation, the size of the convolution kernel is 3*3, the step size is 1, d is the hole rate; δ is the sigmoid activation function; BN() is a batch normalization operation;

[0096] The structure of the pixel-level attention module is as follows Figure 3 As shown;

[0097] S4. Upsample the output of the encoder and the output of the pixel-level attention module to construct a decoder; specifically, the steps include:

[0098] The output of the fifth layer of the encoder is processed by the pixel-level attention module to obtain the fifth layer processed output value; the fifth layer processed output value is upsampled by 2 times as the fourth layer of the decoder;

[0099] The output of the fourth layer of the encoder is processed by the pixel-level attention module to obtain the fourth layer processing output value; the fourth layer processing output value is added to the fourth layer output value of the decoder, and then upsampled by 2 to serve as the third layer of the decoder;

[0100] The output value of the third layer of the decoder is added to the output value of the third layer of the encoder, and then upsampled by 2 times to serve as the second layer of the decoder;

[0101] The output value of the second layer of the decoder is added to the output value of the second layer of the encoder, and then upsampled by 4 times as the output value of the decoder;

[0102] The upsampling is bilinear interpolation upsampling;

[0103] By combining this small upsampling and feature fusion method, high-level feature maps can guide segmentation without introducing too many parameters through attention weighting, and low-level features also retain a lot of details; low-level feature maps can well retain spatial detail information, which can be guided to learn and retain, which not only speeds up the learning of low-level feature maps, but also improves the accuracy of prediction;

[0104] S5. Combine the encoder obtained in step S2 and the decoder obtained in step S4 to construct a semantic segmentation network; the structure of the semantic segmentation network is as follows: Figure 4 As shown;

[0105] S6. Construct a detail guidance module based on Gaussian-Laplacian operator for training the semantic segmentation network; specifically, the steps include:

[0106] The manually marked image is input into the Gaussian-Laplacian convolution for processing to obtain a detail marked image; the specific steps include:

[0107] The manually marked image is input into three Gaussian-Laplacian convolutions for processing; the convolution step size of the first Gaussian-Laplacian convolution is 2, the convolution step size of the second Gaussian-Laplacian convolution is 4, and the convolution step size of the third Gaussian-Laplacian convolution is 8; finally, the output results of the three Gaussian-Laplacian convolutions are processed through a convolution layer to obtain the final detail marked image; the convolution kernel of the convolution layer is 1*1, and the step size is 1;

[0108] Calculate the detail loss between the detail marked image and the predicted image, and use the obtained detail loss to train the semantic segmentation network; specifically, the detail loss L is calculated using the following formula: detail (p d ,g d ):

[0109] L detil (p d ,g d )=L dice (p d ,g d )+L ce (p d ,g d )

[0110] Where p d is the predicted value of the third layer of the encoder in the semantic segmentation network; g d The true value of the detail labeled image; L ce (p d ,g d ) is the cross entropy loss function value between the predicted value and the true value; L dice (p d , g d ) is the DICE function value between the predicted value and the true value; the DICE function value L is calculated using the following formula dice (p d , g d ):

[0111]

[0112] In the formula is the predicted value p of the third layer of the encoder in the semantic segmentation network d The i-th pixel of The true value g of the detail labeled image dThe i-th pixel of ; H is the height of the third-layer feature matrix of the encoder; W is the width of the third-layer feature matrix of the encoder; ε is a set constant, preferably 1;

[0113] The structural diagram of the semantic segmentation network with detail guidance module is as follows Figure 5 As shown;

[0114] S7. Complete the construction of the semantic segmentation network.

[0115] like Figure 6 The method flow chart of the semantic segmentation method of the present invention is shown as follows: The semantic segmentation method provided by the present invention, which includes the above-mentioned semantic segmentation network construction method, comprises the following steps:

[0116] A. Obtain the original image dataset and manually label it to obtain the training dataset;

[0117] B. Use the above semantic segmentation network construction method to build a preliminary semantic segmentation network;

[0118] C. Using the training data set obtained in step A, train the preliminary semantic segmentation network obtained in step B to obtain the final semantic segmentation network;

[0119] D. Use the semantic segmentation network obtained in step C to perform semantic segmentation on the actual image and complete the final semantic segmentation.

[0120] The final semantic segmentation network does not include the detail guidance module; the detail guidance module is only used in the network training process.

[0121] The following is an explanation of the segmentation effect and performance of the semantic segmentation model provided by the present invention in combination with the embodiments:

[0122] First, the STCU unit proposed in this invention adopts a cascaded method to fuse the bottleneck structure to extract features, and obtains the context information of the object by obtaining feature maps of different receptive fields. Table 1 shows the number sequence of STCUs of Layer3, 4, and 5 units, and the number of network layers is 24, 36, 48, and 60 respectively. The corresponding number sequence of Layer3, 4, and 5 is {2, 2, 2}, {3, 4, 2}, {4, 5, 3}, and {5, 6, 4}.

[0123] Table 1 Impact of the number of network layers on network performance

[0124]

[0125] The STCU sequence used in experimental method 1 is {2, 2, 2}, and the number of network layers is small, resulting in rough feature extraction and low accuracy, mIou is 74.8%, and the number of parameters is 54.65M. Subsequent methods 2 and 3 increase the number of STCU units on the basis of method 1, and the accuracy rate increases by 0.2% and 0.65%, respectively, and the number of parameters increases by 6.44M and 22.88M, respectively. The increase in the number of parameters leads to a decrease of 19.2 frames and 28.2 frames in Fps. In Table 1, as the number of network layers increases, the number of parameters also increases, and the average intersection-over-union ratio (mIou) is 77.8%, an increase of 3%, and the number of frames processed per second is 44.1 frames, a decrease of 34.4 frames. If the number of STCU is increased in method 4, the Fps will drop below 40Fps. Considering the real-time performance, the present invention finally adopts the STCU sequence of method 4.

[0126] The upsampling structure proposed in the present invention can effectively solve the problem of information loss during upsampling. When upsampling Layer3, three different methods are designed to restore the image. Method 1: Use 8 times upsampling to restore the feature map of Layer3 to the input feature map size. Method 2: Upsample the feature map of Layer3 by 4 times, then fuse it with the feature map of Layer2, and then restore it to the input image size. Method 3: Upsample the feature map of Layer3 by 4 times, fuse it with the feature map of Layer2, then upsample it by 2 times, fuse it with the feature map of Layer1, and then restore it to the input image size. The visualization results of the changes in upsampling loss values ​​and the average intersection-over-union ratio using these three different methods are shown in the figure. Figure 7 shown.

[0127] Within the first 2000 iterations, the loss values ​​of the three methods decrease in a similar manner, so the number of iterations of the loss line graph starts after 2000. Figure 7 (a) is a line chart of the loss value changes of method 1 and method 2. It can be seen that method 1 has a high upsampling multiple, resulting in more information loss and a higher initial loss value. As the training progresses, the loss values ​​of method 1 and method 2 decrease and finally reach a plateau. The loss plateau value of method 2 is 3.27, while the loss plateau value of method 1 is 3.41. Figure 7 (c) The changes in the average intersection-over-union ratio of method 1 and method 2. The upsampling method of method 2 is better than that of method 1. Figure 7(b) is a line graph showing the change in loss values ​​for Method 2 and Method 3. The initial loss value for Method 2 is smaller, and the overall loss value for Method 2 is smaller than that for Method 3. In the upsampling of Method 3, the last upsampling merges the feature map in Layer 1, and the feature map in Layer 1 is obtained through one convolution. Since the number of convolutions is too small, the feature map information is relatively low-level. After fusion, the feature map information after fusion is redundant, which is not conducive to pixel classification. Therefore Figure 7 In (c), the average intersection of method 3 is higher than that of method 2.

[0128] In order to demonstrate the role of the detail guidance module, the heat map of Layer3 without detail guidance and the heat map after detail guidance are visualized, as shown in Figure 2. Figure 8 As shown, Figure 8 (a) is the original picture, Figure 8 (b) is the heat map of layer 3 without detail guidance. The closer the pixel is to red, the higher the contribution value of the pixel to a certain category. Figure 8 In (b), it can be observed that the regions are not obvious at the boundaries and corners. Figure 7 In (c), the regions are mostly concentrated at the boundaries and corners. Compared with the features without detail-guided modules, the features with detail-guided modules can encode more spatial details.

[0129] Table 2 is a performance comparison table of the method of the present invention and Resnet-50 and Resnet-101.

[0130] Table 2 Network performance comparison diagram

[0131]

[0132] Resnet-101 is the backbone network of the network. It has 166.68M parameters, which is 3.04 times the number of parameters of CRnet-222. It has a computational complexity of 408.28G, which is 7.55 times the computational complexity of CRnet-222. However, its average intersection-over-union ratio (mIou) is not as high as that of CRnet-222. CRnet-222 has a great advantage in processing frames per second and can meet the requirements of real-time segmentation. Considering the memory limitation, the number of STCU units was subsequently increased on the CRnet backbone network, and the feature extraction capability was strengthened. The network has increased in parameters and computational complexity. The average intersection-over-union ratio finally reached 77.8% on the Cityscapes validation set, and the number of frames processed per second was 41.1 frames.

[0133] Fig. 9The visualization effect diagram of CRnet series and Resnet-101 and the colors corresponding to 20 categories (including background). In Resnet-101, the segmentation of edges, corners and other parts is incoherent and contains misclassification. After adding the detail guidance module to CRnet, the information of boundaries, corners and other parts is added to the input data during model training, and the parameters of boundaries and corners will be learned into the model autonomously. In the figure, the segmentation of edges, corners and other parts is significantly improved, such as: the human body contour is clearer and more detailed in the CRnet segmentation diagram. The basic feature extraction unit STCU of the CRnet series contains multi-scale information, and the misclassification will be reduced, such as: the truck is relatively complete in the CRnet series segmentation. The upsampling method designed by the present invention retains low-level features, reduces the loss value during training without causing data redundancy, and the added detail guidance module retains information such as boundaries and corners. When segmenting and visualizing, on some small objects, such as traffic signs and traffic lights, the intersection of these classes of the CRNet series is higher than that of Resnet-101.

[0134] Table 3 is a comparison table of CRnet and other advanced networks.

[0135] Table 3 Comparison of CRnet and other semantic segmentation algorithms

[0136]

[0137] Table 3 includes image cascade network (ICnet), deep feature aggregation network (DFAnet), bilateral segmentation network (Bisenet), fast real-time semantic segmentation network (Fasterseg), and Bisenet's lightweight upgraded network - short-term dense cascade network (STDCnet). "No" means that the network model does not use any popular backbone network. The mIou of CRnet proposed in the present invention is 77.8%, which is 7.1% higher than ICnet in the cityscapes test set, and CRnet is 25.9 frames higher in the number of frames processed per second. At the same time, compared with the current popular real-time networks, CRnet's mIou is 5.4% higher than DFAnet-A and its Fps is 9 frames lower; compared with Bisenet-V2-L, it exceeds the model in both mIou and Fps; compared with DF2-Seg2, it is 1.4% higher in mIou and 13 frames higher in Fps; compared with the network Fasterseg, it is 5.2% higher in mIou, but its Fps is not as fast as the model. Compared with the latest real-time segmentation STDC2-Seg75, it is 0.8% higher on the Cityscapes validation set, and the speed difference is only 7.8 frames. "*" means that the pre-trained model is not used during training. CRnet is 1.2% higher than the STDC2-Seg75 network in mIou. When designing CRnet, considering that the real-time performance of CRnet meets the requirements, the accuracy should be as high as possible, and a balance should be achieved between speed and accuracy.

Claims

1. A semantic segmentation network construction method, applied to the field of data recognition and image processing in autonomous driving, characterized in that The steps include: S1. Based on convolution, batch normalization and activation function, a short-term connection unit is constructed; specifically, the steps include: The following steps are used to construct a type A short-term connection unit: The A-type short-term connection unit includes an A-type cascade structure, an A-type branch structure, and a channel random mixing operation layer; the A-type cascade structure is used for feature extraction; the A-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the A-type branch structure is connected in parallel with the A-type cascade structure; after the result of the A-type branch structure is summed with the result of the A-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the A-type short-term connection unit; The A-type cascade structure includes four Conx structure layers and one connection layer, and the four Conx structure layers and one connection layer are connected in series in sequence; at the same time, the second output end of the first Conx structure layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels; The A-type branch structure includes three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels; The following steps are used to construct a type B short-term connection unit: The B-type short-term connection unit includes a B-type cascade structure, a B-type branch structure and a channel random mixing operation layer; the B-type cascade structure is used for feature extraction; the B-type branch structure is used to obtain global context information of each feature extraction block to prevent network degradation; the channel random mixing operation layer is used to enhance information interaction between channels; the B-type branch structure is connected in parallel with the B-type cascade structure; after the result of the B-type branch structure is summed with the result of the B-type cascade structure, a channel random mixing operation is performed through the channel random mixing operation layer to obtain the output of the B-type short-term connection unit; The Class B cascade structure includes four Conx structure layers, a connection layer and an average pooling layer, and the four Conx structure layers and the connection layer are connected in series in sequence; the second output end of the first Conx structure layer is connected to the average pooling layer; at the same time, the output end of the average pooling layer, the second output end of the second Conx structure layer, the second output end of the third Conx structure layer and the second output end of the fourth Conx structure layer are all connected to the connection layer at the same time; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 2, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 2; the convolution kernel of the third Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; the convolution kernel of the fourth Conx structure layer is 3*3, the number of convolution kernels is N / 8, and the convolution step is 1; N is the number of output channels; The B-type branch structure includes an average pooling layer and three Conx structure layers, which are connected in series in sequence; each Conx structure layer includes convolution, batch normalization and activation function; the convolution kernel of the first Conx structure layer is 1*1, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the second Conx structure layer is 3*3, the number of convolution kernels is N / 4, and the convolution step is 1; the convolution kernel of the third Conx structure layer is 1*1, the number of convolution kernels is N, and the convolution step is 1; N is the number of output channels; S2. The short-term connection unit constructed in step S1 and the convolution are stacked to obtain an encoder; specifically, the following steps are included: The encoder includes five layers; the five layers are connected in series; The first layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 32, and the output resolution is 384*768; The second layer is the convolution layer, the convolution kernel is 3*3, the convolution step is 2, the number of output channels is 64, and the output resolution is 192*384; The third layer is the first short-term connection unit stacking layer, which includes five short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fifth short-term connection units are type A short-term connection units; the convolution step size of the third layer is 2, the number of output channels is 256, and the resolution is 96*192; The fourth layer is the second short-term connection unit stacking layer, which includes six short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to sixth short-term connection units are type A short-term connection units; the convolution step size of the fourth layer is 2, the number of output channels is 512, and the resolution is 48*96; The fifth layer is a third short-term connection unit stacking layer, including four short-term connection units in series; the first short-term connection unit is a type B short-term connection unit, and the second to fourth short-term connection units are type A short-term connection units; the convolution step size of the fifth layer is 2, the number of output channels is 1024, and the resolution is 24*48; S3. Construct a pixel-level attention module; specifically, the following steps are included: The pixel attention module is used to focus on the target pixel and enhance the weight of the target pixel, thereby enriching the high-level feature map; The output X of the pixel-level attention module is calculated using the following formula: proc : X proc =F r (X wmap ×F r (X pre )) Where F r ( ) is the reshape operation; X wamp is the first intermediate feature map, X pre is the second intermediate feature map, X wmap =δ(F r (X pre ×E r (X pre ))), X In is the input feature map with c channels and size h*w; ln ′ is the input feature map X In The feature map after the outside of the scale is filled with all 1s; It is a standard convolution operation, the size of the convolution kernel is 3*3, the step size is 1, d is the hole rate; δ is the sigmoid activation function; BN() is a batch normalization operation; S4. Upsample the output of the encoder and the output of the pixel-level attention module to construct a decoder; specifically, the steps include: The output of the fifth layer of the encoder is processed by the pixel-level attention module to obtain the fifth layer processed output value; the fifth layer processed output value is upsampled by 2 times as the fourth layer of the decoder; The output of the fourth layer of the encoder is processed by the pixel-level attention module to obtain the fourth layer processed output value; The output value of the fourth layer is added to the output value of the fourth layer of the decoder, and then upsampled by 2 times to serve as the third layer of the decoder; The output value of the third layer of the decoder is added to the output value of the third layer of the encoder, and then upsampled by 2 times to serve as the second layer of the decoder; The output value of the second layer of the decoder is added to the output value of the second layer of the encoder, and then upsampled by 4 times as the output value of the decoder; S5. Combining the encoder obtained in step S2 and the decoder obtained in step S4, a semantic segmentation network is constructed; S6. Construct a detail-guided module based on Gaussian-Laplacian operator for training the semantic segmentation network; S7. Complete the construction of the semantic segmentation network.

2. The method for constructing a semantic segmentation network according to claim 1, characterized in that The step S6 of constructing a detail guidance module based on the Gaussian-Laplace operator specifically includes the following steps: The manually marked image is input into Gaussian-Laplacian convolution for processing to obtain a detail marked image; The detail loss between the detail labeled image and the predicted image is calculated, and the obtained detail loss is used to train the semantic segmentation network.

3. The method for constructing a semantic segmentation network according to claim 2, characterized in that The manually marked image is input into the Gaussian-Laplacian convolution for processing, which specifically includes the following steps: The manually labeled image is input into three Gaussian-Laplacian convolutions for processing; the convolution step size of the first Gaussian-Laplacian convolution is 2, the convolution step size of the second Gaussian-Laplacian convolution is 4, and the convolution step size of the third Gaussian-Laplacian convolution is 8; finally, the output results of the three Gaussian-Laplacian convolutions are processed through a convolution layer to obtain the final detail labeled image; the convolution kernel of the convolution layer is 1*1, and the step size is 1.

4. The method for constructing a semantic segmentation network according to claim 3, characterized in that The calculation of the detail loss between the detail marked image and the predicted image is specifically to calculate the detail loss L using the following formula: detail (p d , g d ): L detail (p d ,g d )=L dice (p d ,g d )+L ce (p d ,g d ) Where p d is the predicted value of the third layer of the encoder in the semantic segmentation network; g d The true value of the detail labeled image; L ce (p d , g d ) is the cross entropy loss function value between the predicted value and the true value; L dice (p d , g d ) is the DICE function value between the predicted value and the true value; specifically, the DICE function value L is calculated using the following formula dice (p d , g d ): In the formula is the predicted value p of the third layer of the encoder in the semantic segmentation network d The i-th pixel of The true value g of the detail labeled image d The i-th pixel of ; H is the height of the third-layer feature matrix of the encoder; W is the width of the third-layer feature matrix of the encoder; ε is a set constant.

5. A semantic segmentation method comprising the semantic segmentation network construction method according to any one of claims 1 to 4, characterized in that The steps include: A. Obtain the original image dataset and manually label it to obtain the training dataset; B. constructing a preliminary semantic segmentation network using the semantic segmentation network construction method according to any one of claims 1 to 4; C. Using the training data set obtained in step A, train the preliminary semantic segmentation network obtained in step B to obtain the final semantic segmentation network; D. Use the semantic segmentation network obtained in step C to perform semantic segmentation on the actual image and complete the final semantic segmentation.

6. An automatic driving method, characterized in that Includes the semantic segmentation method described in claim 5.

Citation Information

Patent Citations

  • Real-time image semantic segmentation network based on attention guidance mechanism

    CN113066089A

  • City street semantic segmentation method and automatic driving method

    CN113255574A

  • System and method for boundary aware semantic segmentation

    US20210089807A1