Lane line segmentation network model, method, device and medium

By introducing a multi-scale channel attention module and a partial convolution structure into the lane line segmentation network model, the feature extraction and decoding process is optimized, which solves the problem of insufficient lane line segmentation accuracy in the existing technology and achieves more precise detection in complex environments. High-precision lane line recognition.

CN118609076APending Publication Date: 2024-09-06CHONGQING CHANGAN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410742822.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing technology is difficult to accurately identify lane lines in complex road environments, especially when road markings are blurred, lighting conditions are poor, or there is shadow interference. It fails to fully mine the depth information in autonomous driving image data, resulting in lane line segmentation accuracy. insufficient.

Method used

A lane line segmentation network model is proposed, including an encoder, a multi-scale channel attention module and a decoder. Through the partial convolution structure and the multi-scale channel attention module, the channel weight is dynamically adjusted to optimize the feature extraction and decoding process to achieve more accuracy. lane line segmentation.

Benefits of technology

By mining deep features in images, the precision and accuracy of lane line segmentation are improved, information loss is reduced, and it is suitable for autonomous driving applications in complex road environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609076A
    Figure CN118609076A
Patent Text Reader

Abstract

The invention relates to a lane line segmentation network model, method and device and a medium. The network model comprises an encoder, a multi-scale channel attention module, a decoder and an output convolutional layer. Performing feature extraction on the lane line image data through an encoder to obtain encoder features; wherein the encoder comprises a partial convolution structure; performing channel feature refinement on the encoder features through a multi-scale channel attention module to obtain refined features; decoding and size reduction are carried out on the refined features through a decoder, and decoder features are obtained; 3 * 3 convolution operation is carried out on the decoder features through the output convolution layer, and a lane line segmentation result graph with the same size as the lane image data is obtained. According to the lane line segmentation network model, more effective information can be mined through partial structure convolution, the weight of each channel is dynamically adjusted through the multi-scale channel attention module, and more precise lane line segmentation detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving technology, and in particular to a lane line segmentation network model, method, device and medium. Background Art

[0002] With the development of intelligent transportation systems, autonomous driving and assisted driving technologies have received increasing attention. Lane segmentation, as one of the core technologies in autonomous driving and assisted driving, is of great significance for ensuring driving safety and improving road traffic efficiency. However, traditional lane segmentation methods based on image processing technology often have difficulty in accurately identifying lane lines in complex road environments, especially when road markings are blurred, lighting conditions are poor, or there is shadow interference.

[0003] As deep learning technology has made significant progress in the field of computer vision, it has provided new solutions for lane line segmentation. Deep learning models such as convolutional neural networks can learn and extract complex features in images, thereby achieving more accurate lane line recognition. For example, the invention of a lane line segmentation method based on a Transformer deep learning network, with publication number CN116188780A and publication date 2023-05-30, discloses a lane line segmentation method based on a Transformer deep learning network, which uses the self-attention mechanism and the ability of neural networks to establish a mapping relationship between segmentation data and lane line real data. The invention of a visual navigation vehicle environment perception method based on an improved YOLO algorithm, with publication number CN115273005A and publication date 2022-11-01, discloses a visual navigation vehicle environment perception method based on an improved YOLO neural network model, which can realize multiple functions such as lane line segmentation and target detection. The invention of a lightweight real-time lane line segmentation method based on ENet improvement with publication number CN113158810A and publication date 2021-07-23 proposes a lane line segmentation network LRTNet constructed based on ENet to achieve real-time lane line segmentation. However, the above method does not fully mine the depth information in the lane line image data. As we all know, autonomous driving image data contains extremely rich information, such as lane line information, lighting information, pedestrian information, etc. If the model feature extraction method can be improved and the deep features in the image can be mined, higher-precision lane line segmentation results can be obtained for use in autonomous driving technology. Therefore, there is an urgent need for a neural network model that can mine the deep features in autonomous driving image data to obtain higher-precision lane line segmentation results. Summary of the invention

[0004] The purpose of the present invention is to provide a lane line segmentation network model, method, device and medium to solve the problem that the prior art pays more attention to local detail information of data but does not deeply mine image information for lane line detection.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention proposes a lane segmentation network model, wherein the network model includes an encoder, a multi-scale channel attention module, a decoder, and an output convolutional layer;

[0007] Extracting features from lane line image data through the encoder to obtain encoder features; wherein the encoder includes a partial convolution structure;

[0008] Refining the channel features of the encoder features through the multi-scale channel attention module to obtain refined features;

[0009] Decoding and resizing the refined features by the decoder to obtain decoder features;

[0010] A 3×3 convolution operation is performed on the decoder features through the output convolution layer to obtain a lane line segmentation result image with the same size as the lane image data.

[0011] Preferably, the encoder includes a 3×3 convolution layer, a partial convolution structure and a 2×2 maximum pooling layer; the encoder is used to pass the lane line image data through the 3×3 convolution layer, the partial convolution structure and the 2×2 maximum pooling layer in sequence to obtain the encoder features.

[0012] Preferably, the partial convolution structure is used for:

[0013] According to the number of channels of the second input feature input into the partial convolution structure, the second input feature is divided into eight first partial features with the same number of channels, and the eight first partial features are numbered from 1 to M in sequence; wherein M is an even positive integer;

[0014] splicing all the first part features with odd numbers into temporary features;

[0015] Performing a convolution operation on the temporary features through a 3×3 convolution layer;

[0016] Divide the temporary feature after the convolution operation into M / 2 second part features with equal number of channels, and sequentially number the i-th second part feature as 2i-1, where 1≤i≤M / 2;

[0017] All the first partial features numbered as even numbers and all the second partial features are sequentially concatenated according to the numerical order of the numbers to obtain the output features of the partial convolution structure; the output features are passed through the 2×2 maximum pooling layer to obtain the encoder features.

[0018] Preferably, the decoder includes a 2×2 upsampling layer and a 3×3 convolution layer; the decoder is used to perform 2-fold interpolation upsampling on the refined features through the 2×2 upsampling layer, and convolve through the 3×3 convolution layer to obtain the decoder features.

[0019] Preferably, the multi-scale channel attention module includes a global average pooling layer, a global maximum pooling layer, a 3×3 one-dimensional convolution layer, a 5×5 one-dimensional convolution layer, a 7×7 one-dimensional convolution layer, a 1×1 two-dimensional convolution layer and a sigmoid activation function; the multi-scale channel attention module is used to:

[0020] Performing global average pooling and global maximum pooling on the encoder features through the global average pooling layer and the global maximum pooling layer;

[0021] The pooled features are respectively subjected to 3×3, 5×5 and 7×7 one-dimensional convolution operations through the 3×3 one-dimensional convolution layer, the 5×5 one-dimensional convolution layer and the 7×7 one-dimensional convolution layer to obtain multi-scale features;

[0022] After the multi-scale features are spliced, a convolution operation is performed through the 1×1 two-dimensional convolution layer, and activation processing is performed through the sigmoid activation function to obtain a channel weight matrix; the channel weight matrix is ​​used to optimize the proportion of each channel of the encoder feature to obtain the refined feature.

[0023] Preferably, the network model includes an N-layer encoder and an N-layer decoder;

[0024] Extracting features from the lane line image data by using a first-layer encoder to obtain first-layer encoder features;

[0025] The encoder features output by the i-th layer encoder are further extracted through the i+1-th layer encoder in turn to obtain the i+1-th layer encoder features, where 1≤i<N;

[0026] Refining the channel features of the Nth layer encoder features output by the Nth layer encoder through the multi-scale channel attention module to obtain refined features;

[0027] Decoding and resizing the refined features through an N-th layer decoder to obtain an N-th layer decoder feature;

[0028] The decoder features output by the j+1th layer decoder are further decoded and resized by the jth layer decoder to obtain the jth layer decoding features, where 1≤j<N;

[0029] A 3×3 convolution operation is performed on the first layer decoder features output by the first layer decoder through the output convolution layer to obtain a lane line segmentation result image with the same size as the lane image data.

[0030] In a second aspect, the present invention further proposes a lane line segmentation method, the method comprising:

[0031] Obtain a number of lane line image data, perform sample annotation to generate label images, and obtain a lane line image dataset;

[0032] Preprocessing the lane line image dataset;

[0033] Training the lane line segmentation network model according to any one of claims 1 to 7 based on the preprocessed lane line image dataset to obtain a trained lane line segmentation network model;

[0034] The lane line image data to be segmented is input into the trained lane line segmentation network model to obtain the lane line segmentation result map.

[0035] Preferably, the pretreatment includes at least one of the following:

[0036] Randomly flipping the lane line image data in the lane line image data set with a preset probability;

[0037] The lane line image data in the lane line image data set is randomly rotated by a preset angle within a preset number of times.

[0038] Preferably, the lane segmentation network model is trained using a weighted cross entropy loss function; the weighted cross entropy loss function is expressed as:

[0039]

[0040] Among them, L wce (i) is the weighted cross entropy loss function, c is the number of label types, w c is the label weight, g(i) is the label value, and p(i,c) is the predicted probability that pixel i belongs to class c.

[0041] In a third aspect, the present invention further provides a lane line segmentation device, the device comprising:

[0042] A data acquisition module is used to acquire a number of lane line image data, perform sample annotation to generate label images, and obtain a lane line image data set;

[0043] A data processing module, used for preprocessing the lane line image data set;

[0044] A model training module, used to train the lane line segmentation network model according to any one of claims 1 to 7 based on the preprocessed lane line image data set to obtain a trained lane line segmentation network model;

[0045] The model application module is used to input the lane line image data to be segmented into the trained lane line segmentation network model to obtain the lane line segmentation result map.

[0046] In a fourth aspect, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the lane line segmentation method described in any embodiment of the present invention.

[0047] The present invention discloses a lane line segmentation network model, method, device and medium. On the one hand, from the perspective of optimizing the model, a lane line segmentation network model based on Unet is constructed. The network model realizes secondary feature extraction through a partial convolution structure in the encoder, and can establish a more accurate mapping relationship between lane line image data and lane line labels, thereby mining more effective information and realizing more precise lane line segmentation detection; on the other hand, the lane line segmentation network model constructed by the present invention also dynamically adjusts the weight of each channel through a multi-scale channel attention module, reduces the information loss in the encoding and decoding process, and makes the lane line recognition of the present invention more accurate.

[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a framework diagram of a lane segmentation network model shown according to an embodiment of the present invention.

[0050] Figure 2 It is a structural diagram of a partial convolution structure according to an embodiment of the present invention.

[0051] Figure 3 The figure is a flow chart of a lane segmentation method according to an embodiment of the present invention.

[0052] Figure 4 It is a schematic structural diagram of a lane line segmentation device according to an embodiment of the present invention.

[0053] Figure 5 It is a schematic diagram of the structure of a computing device hardware according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred technical solutions. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred technical solutions are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0055] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0056] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0057] like Figure 1 As shown, Figure 1 is a framework diagram of a lane line segmentation network model according to an embodiment of the present invention, wherein the lane line segmentation network model includes an encoder, a multi-scale channel attention module, a decoder, and an output convolutional layer;

[0058] The encoder is used to extract features of the lane line image data to obtain encoder features; wherein the encoder includes a partial convolution structure;

[0059] The encoder features are refined through the multi-scale channel attention module to obtain refined features;

[0060] The refined features are decoded and resized by the decoder to obtain decoder features;

[0061] A 3×3 convolution operation is performed on the decoder features through the output convolution layer to obtain a lane line segmentation result map with the same size as the lane image data.

[0062] Specifically, the lane line segmentation network model proposed in the present invention can use UNet as the basic structure. In order to solve the problem that the existing technology pays more attention to the local details of the data but does not deeply mine the image information for lane line detection, the lane line segmentation network model proposed in the present invention constructs a partial convolution structure to mine features on the basis of the UNet network, and uses a multi-scale channel attention module to refine the features, thereby improving the accuracy of lane line segmentation.

[0063] Specifically, the encoder used in the lane line segmentation network model of the present invention may include a 3×3 convolutional layer, a partial convolutional structure and a 2×2 maximum pooling layer; and the encoder can be specifically used to pass the lane line image data input to the encoder through a 3×3 convolutional layer, a partial convolutional structure and a 2×2 maximum pooling layer in sequence, thereby obtaining corresponding encoder features.

[0064] Specifically, the partial convolution structure used in the present invention can be used for:

[0065] According to the number of channels of the input features of the input partial convolution structure, the input features are divided into M first partial features with equal number of channels, and are numbered from 1 to M in sequence; wherein M is an even positive integer;

[0066] All the first part features with odd numbers are spliced ​​into temporary features;

[0067] Convolution operation is performed on the temporary features through a 3×3 convolution layer;

[0068] The temporary features after the convolution operation are divided into M / 2 second-part features with equal number of channels, and the i-th second-part features are numbered 2i-1 in sequence, where 1≤i≤M / 2;

[0069] All the first part features with even numbers and all the second part features are concatenated in sequence according to the numerical order to obtain the output features of the partial convolution structure; the output features can obtain the encoder features after passing through a 2×2 maximum pooling layer.

[0070] Specifically, in some embodiments, when the number of the first part of the features divided by the partial convolution structure is M=8, the structure of the partial convolution structure used in the present invention is as follows: Figure 2 As shown, this partial convolution structure can be used for:

[0071] According to the number of channels of the second input feature of the input partial convolution structure, the second input feature is divided into eight first partial features with equal number of channels, and numbered from 1 to 8 in sequence; wherein the number of channels, height, and width of the second input feature are assumed to be C, H, and W, respectively;

[0072] The first part of features numbered 1, 3, 5 and 7 are spliced ​​into the first temporary feature Xtmp ∈R C / 2*H*W ;

[0073] The first temporary feature X is processed through a 3×3 convolutional layer tmp Perform convolution operation to obtain the second temporary feature X tmp ′;

[0074] Set the second temporary feature X tmp ' is divided into four second-part features with equal number of channels, and numbered 1, 3, 5, and 7 in sequence; wherein the size of the second-part features is the same as the size of the first-part features;

[0075] The first part features numbered 2, 4, 6, and 8 and the second part features numbered 1, 3, 5, and 7 are concatenated in sequence according to the numerical order to obtain the second output features corresponding to the second input features; the second output features are passed through a 2×2 maximum pooling layer to obtain the encoder features.

[0076] Specifically, in other embodiments, the number M of the first part of the features divided by the partial convolution structure may also be set to other values ​​as required, and the present invention is not limited to this.

[0077] The partial convolution structure used in the present invention can mine more effective information, thereby achieving more precise lane line segmentation detection.

[0078] Specifically, the decoder used in the lane line segmentation network model of the present invention may include a 2×2 upsampling layer and a 3×3 convolutional layer; the decoder can be specifically used to perform 2-fold interpolation upsampling of the refined features input to the decoder through the 2×2 upsampling layer, and convolve through the 3×3 convolutional layer to obtain the corresponding decoder features.

[0079] Specifically, the multi-scale channel attention module used in the present invention can be improved from the Efficient Channel Attention Network (ECA). ECA is an attention module that first undergoes global average pooling to transform the feature block from a C×H×W matrix into a C×1×1 vector, and then performs a one-dimensional convolution and sigmoid process on the vector with a convolution kernel size of k to obtain the weight of each channel in the feature block, and finally multiplies the weight by the original input feature map element by element to obtain the output result. Specifically, the mathematical expression of ECA when k=7 can be summarized as the following formula:

[0080]

[0081] Among them, Input and Output are the input and output of ECA respectively, GAP represents global average pooling, Represents a one-dimensional convolution operation with a convolution kernel of i×i.

[0082] The multi-scale channel attention module proposed in this invention adds the multi-scale fusion idea of ​​features on the basis of the original ECA, and its mathematical expression can be expressed as the following formula:

[0083]

[0084] in, represents element-by-element multiplication, σ represents the Sigmoid activation function, and the semicolon between T1 and T2 represents the concatenation operation. It represents a one-dimensional convolution with a convolution kernel of i×i. represents a two-dimensional convolution operation with a convolution kernel of j×j. The number of channels in the feature map changes from m to n. GAP and GMP represent global average pooling and global maximum pooling, respectively. k (k∈{1,2,3,4,5,6}) is the intermediate feature, Input and Output are the input and output of the multi-scale channel attention module respectively, and the number of channels is C.

[0085] Specifically, the multi-scale channel attention module used in the lane segmentation network model of the present invention may include a global average pooling layer, a global maximum pooling layer, a 3×3 one-dimensional convolution layer, a 5×5 one-dimensional convolution layer, a 7×7 one-dimensional convolution layer, a 1×1 two-dimensional convolution layer and a sigmoid activation function; and the multi-scale channel attention module can be used for:

[0086] Perform global average pooling and global maximum pooling on the encoder features through the global average pooling layer and the global maximum pooling layer;

[0087] The pooled features are respectively passed through a 3×3 one-dimensional convolutional layer, a 5×5 one-dimensional convolutional layer, and a 7×7 one-dimensional convolutional layer to perform 3×3, 5×5, and 7×7 one-dimensional convolution operations to obtain multi-scale features;

[0088] After the multi-scale features are spliced, they are convolved through a 1×1 two-dimensional convolutional layer and activated through a sigmoid activation function to obtain a channel weight matrix; the channel weight matrix is ​​used to optimize the proportion of each channel of the encoder feature to obtain refined features.

[0089] Specifically, the present invention can mine more feature information and optimize the weight of each channel through a multi-scale channel attention module.

[0090] Specifically, the lane line segmentation network model proposed in the present invention may include the same number of multi-layer encoders and decoders. Specifically, it can be set that the lane line segmentation network model includes N layers of encoders and N layers of decoders; and the network model can specifically

[0091] Perform feature extraction on the lane line image data through the first-layer encoder to obtain first-layer encoder features;

[0092] The encoder features output by the i-th layer encoder are further extracted through the i+1-th layer encoder in turn to obtain the i+1-th layer encoder features, where 1≤i<N;

[0093] The channel features of the N-th layer encoder output by the N-th layer encoder are refined through the multi-scale channel attention module to obtain refined features;

[0094] The refined features are decoded and resized by the N-th layer decoder to obtain the N-th layer decoder features;

[0095] The decoder features output by the j+1th layer decoder are further decoded and resized by the jth layer decoder to obtain the jth layer decoding features, where 1≤j<N;

[0096] A 3×3 convolution operation is performed on the first-layer decoder features output by the first-layer decoder through the output convolution layer to obtain a lane line segmentation result map with the same size as the lane image data.

[0097] Specifically, Figure 1 As shown, in some embodiments, the lane line segmentation network model proposed in the present invention may include a three-layer encoder and a three-layer decoder. Specifically, the execution of the lane line segmentation network model may include the following steps:

[0098] Step S101: Lane line image data X∈R C**W (Where C, H, and W represent the number of channels, height, and width of the image data, respectively. Figure 1 Taking 3*256*256 as an example), 3×3 convolution and partial convolution are performed in sequence, and then 2×2 maximum pooling is performed to obtain the first layer encoder features.

[0099] Step S102, repeating the operation similar to step S101 twice to achieve feature extraction. Specifically, Perform 3×3 convolution and partial convolution in sequence, and then perform maximum pooling of the same scale as step S101 to obtain the i+1th layer encoder feature In the above process, i is equal to 1 and 2 respectively. Since the encoder performs 3 M×M maximum poolings, The height and width should be Right now The height and width are The number of channels should be an integer power of 2 and the size should be moderate. The number of channels is 2 j+3 .

[0100] Step S103: Input to the multi-scale channel attention module for channel refinement to obtain refined features This step can dynamically adjust the weight of each channel and efficiently mine deep features.

[0101] Step S104: refine the features Decoding is performed by upsampling by 2 times interpolation followed by 3×3 convolution to obtain the decoder features of the third layer.

[0102] Step S105, repeat the operation similar to step S104, Decoding is performed by upsampling by 2 times interpolation followed by 3×3 convolution to obtain the decoder features of the i-1th layer In the above process, i is equal to 3 and 2 respectively.

[0103] Step S106: The first layer decoder features Perform conventional 3×3 convolution to obtain the lane line segmentation result map

[0104] The present invention firstly generates encoder features of each layer by improving the encoder through the partial convolution structure. The height and width of the obtained encoder features are continuously reduced. Then, the encoder features of the highest layer are refined by using the attention mechanism. The features are then decoded and resized step by step by the decoder. Finally, a lane line segmentation result image with the same height and width as the input is generated.

[0105] Specifically, in some embodiments, according to actual needs, the number of encoder and decoder layers of the lane line segmentation network model can also be set to other values, and the present invention is not limited to this.

[0106] To sum up, the lane line segmentation network model proposed in the present invention, on the one hand, from the perspective of optimization model, constructs a lane line segmentation network model based on Unet. The network model realizes secondary feature extraction through the partial convolution structure in the encoder, and can establish a more accurate mapping relationship between lane line image data and lane line labels, thereby mining more effective information and realizing more precise lane line segmentation detection; on the other hand, the lane line segmentation network model constructed by the present invention also dynamically adjusts the weight of each channel through the multi-scale channel attention module, reduces the information loss in the encoding and decoding process, and makes the lane line recognition of the present invention more accurate.

[0107] Specifically, the lane line segmentation network model proposed in the present invention can be applied to lane line segmentation detection tasks in many scenarios. For example, after acquiring data through a vehicle-mounted camera, using an appropriate amount of data to annotate labels and train the model, the model can output a lane line segmentation result map to provide support for actual needs such as autonomous driving or assisted driving technology.

[0108] In addition, the present invention also provides a lane line segmentation method using the lane line segmentation network model described in the above embodiment.

[0109] like Figure 3 As shown, Figure 3 FIG. 1 is a flow chart of a lane line segmentation method according to an embodiment of the present invention, comprising the following steps:

[0110] Step S301, obtaining a number of lane line image data, and performing sample annotation to generate label images, thereby obtaining a lane line image dataset;

[0111] Step S302, preprocessing the lane line image data set;

[0112] Step S303, training the lane line segmentation network model of any embodiment of the present invention based on the preprocessed lane line image data set to obtain a trained lane line segmentation network model;

[0113] Step S304: input the lane line image data to be segmented into the trained lane line segmentation network model to obtain a lane line segmentation result map.

[0114] Specifically, in step S301, the lane line image data set may be prepared first. Specifically, a vehicle-mounted camera may be used to perform timed shooting during driving, or the collected driving video data may be extracted at intervals to obtain lane line image data for producing the lane line image data set. Specifically, an open source annotation tool may be used to perform sample annotation on the acquired lane image line data and generate a label image, thereby completing the production of the lane line image data set.

[0115] Specifically, before using the lane line image dataset for model training, the lane line image data in the lane line image dataset may be preprocessed to achieve data enhancement and prevent the model from overfitting.

[0116] Specifically, in step S302, the preprocessing of the lane line image dataset may include at least one of the following:

[0117] Randomly flip the lane line image data in the lane line image dataset with a preset probability;

[0118] The lane line image data in the lane line image data set are randomly rotated by a preset angle within a preset number of times.

[0119] Specifically, in some embodiments, the above-mentioned preset probability may be 50%, that is, the preprocessing may include randomly flipping the lane line image data in the lane line image data set with a probability of 50%; specifically, in other embodiments, the above-mentioned preset probability may also be other values, which may be set according to actual needs, and the present invention is not limited to this.

[0120] Specifically, in some embodiments, the preset number of times may be 2 times, and the preset angle may be 90°, that is, the preprocessing may include randomly performing 0 to 2 90° rotations on the lane line image data set in the lane line image data set; specifically, in other embodiments, the preset number of times and the preset angle may be other values, which may be set according to actual needs, and the present invention does not impose any restrictions on this; further, in each random rotation, the same preset angle may be used for rotation processing, or a different preset angle may be used for rotation processing for each random rotation, which may be set according to actual needs, and the present invention does not impose any restrictions on this.

[0121] Specifically, in some embodiments, the lane line image data may be randomly flipped first and then randomly rotated, or the order of the two operations may be swapped to achieve data enhancement, prevent model overfitting, and improve model generalization ability.

[0122] Specifically, in other embodiments, the lane line image data set may also be preprocessed in a manner, which may be specifically configured according to actual needs, and the present invention is not limited thereto.

[0123] Specifically, in step S303, the lane segmentation network model can be trained using a weighted cross entropy loss function; the weighted cross entropy loss function is expressed as:

[0124]

[0125] Among them, L wce (i) is the weighted cross entropy loss function, c is the number of label types, w c is the label weight, g(i) is the label value, and p(i,c) is the predicted probability that pixel i belongs to class c. The weighted cross entropy loss function can solve the problem of class imbalance during model training, thereby achieving better model training results and obtaining a more accurate lane segmentation network model.

[0126] Specifically, in other embodiments, other loss functions may also be used to train the lane segmentation network model, which may be specifically set according to actual needs, and the present invention is not limited to this.

[0127] Specifically, in step S303, before training the lane line segmentation network model, the network model parameters and training parameters may be set in advance.

[0128] Specifically, the parameter setting of the network model mainly involves setting the number of channels for generating features of each layer of encoder and decoder in the lane line segmentation network model. Specifically, in some embodiments, if the lane line segmentation network model used is as follows Figure 1 The lane segmentation network model shown includes a three-layer encoder and a three-layer decoder, and the number of channels of the three-layer encoder features generated by the three-layer encoder can be set to 16, 32 and 64 respectively, while the number of channels of the three-layer decoder features generated by the three-layer decoder can be set to 6, 16 and 32 respectively. Specifically, in other embodiments, lane segmentation network models with other hierarchical structures can also be used, and the number of feature channels generated by each layer of encoders and decoders in the lane segmentation network model can also be set to other values, which can be set according to actual needs, and the present invention is not limited to this.

[0129] Specifically, the setting of training parameters may mainly include the setting of the number of iterations epoch, the initial learning rate, and the optimizer. Specifically, in some embodiments, the number of iterations epoch in the training process of the lane segmentation network model may be set to 150 times, the initial learning rate lr=0.01, and the Adam optimizer may be used for gradient calculation, and its parameter betas=(0.9, 0.999) may be set. Specifically, in other embodiments, other values ​​of the number of iterations epoch, the initial learning rate, and the optimizer may be used to train the lane segmentation network model, which may be set according to actual needs, and the present invention is not limited thereto.

[0130] Specifically, when the lane line segmentation network model is trained in step S303, the lane line image data set may be divided into a training set, a validation set, and a test set. Specifically, the training, validation, and testing process of the lane line segmentation network model may include:

[0131] Step S3031, input the training set into the lane line segmentation network model in batches, calculate the loss between the lane line segmentation result map output by the lane line segmentation network model and the true label, use the Adam optimization algorithm to iteratively update the network parameters until all training sets participate in the training; then input the validation set into the current training model, select and calculate the appropriate evaluation index, and save the current training model;

[0132] Step S3032: Repeat step S3031 based on the last training model until all epochs are trained;

[0133] Step S3033, observe the performance of the training model obtained in each epoch on the validation set, and select the training model obtained in the best epoch for testing;

[0134] Step S3034, input the test set into the optimal training model in step S3033, and calculate the evaluation index.

[0135] Finally, through the above steps, a lane segmentation network model for lane segmentation tasks can be trained.

[0136] In step S304, in actual application, the lane line image data to be segmented can be input into the above-mentioned trained lane line segmentation network model to obtain the lane line segmentation result map.

[0137] Corresponding to the above-mentioned lane line segmentation method embodiment, the present invention also provides a lane line segmentation device.

[0138] like Figure 4 As shown, Figure 4 : is a schematic diagram of a lane segmentation device according to an embodiment of the present invention, comprising the following modules:

[0139] The data acquisition module 410 is used to acquire a number of lane line image data, and perform sample annotation to generate a label image to obtain a lane line image data set;

[0140] A data processing module 420 is used to pre-process the lane line image data set;

[0141] A model training module 430 is used to train the lane line segmentation network model described in any embodiment of the present invention based on the lane line image data set to obtain a trained lane line segmentation network model;

[0142] The model application module 440 is used to input the lane line image data to be segmented into the trained lane line segmentation network model to obtain the lane line segmentation result map.

[0143] Specifically, in the data processing module 420, the preprocessing of the lane line image dataset may include at least one of the following:

[0144] Randomly flip the lane line image data in the lane line image dataset with a preset probability;

[0145] The lane line image data in the lane line image data set are randomly rotated by a preset angle within a preset number of times.

[0146] Specifically, in some embodiments, in the model training module 430, the lane segmentation network model may be trained using a weighted cross entropy loss function; the weighted cross entropy loss function is expressed as:

[0147]

[0148] Among them, L wce (i) is the weighted cross entropy loss function, c is the number of label types, w c is the label weight, g(i) is the label value, and p(i,c) is the predicted probability that pixel i belongs to class c.

[0149] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0150] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Those of ordinary skill in the art can understand and implement it without paying creative labor.

[0151] The present invention also provides a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the above embodiments when executing the program.

[0152] Figure 5 A more specific hardware structure diagram of a computing device provided by the present invention is shown, and the device may include: a processor 501, a memory 502, an input / output interface 503, a communication interface 504, and a bus 505. The processor 501, the memory 502, the input / output interface 503, and the communication interface 504 are connected to each other through the bus 505 in the device.

[0153] The processor 501 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solution provided by the present invention. The processor 501 can also include a graphics card, which can be a Nvidia titan X graphics card or a 1050Ti graphics card, etc.

[0154] The memory 502 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 502 can store an operating system and other application programs. When the technical solution provided by the present invention is implemented by software or firmware, the relevant program code is stored in the memory 502 and called and executed by the processor 501.

[0155] The input / output interface 503 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0156] The communication interface 504 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0157] The bus 505 includes a path for transmitting information between various components of the device (eg, the processor 501 , the memory 502 , the input / output interface 503 , and the communication interface 504 ).

[0158] It should be noted that, although the above device only shows the processor 501, the memory 502, the input / output interface 503, the communication interface 504 and the bus 505, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the solution of the present invention, and does not necessarily include all the components shown in the figure.

[0159] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0160] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0161] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0162] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0163] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the functions of each module may be implemented in the same or more software and / or hardware when implementing the scheme of the present invention. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0164] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A lane segmentation network model, characterized in that: The network model includes an encoder, a multi-scale channel attention module, a decoder and an output convolutional layer; Extracting features from lane line image data through the encoder to obtain encoder features; wherein the encoder includes a partial convolution structure; Refining the channel features of the encoder features through the multi-scale channel attention module to obtain refined features; Decoding and resizing the refined features by the decoder to obtain decoder features; A 3×3 convolution operation is performed on the decoder features through the output convolution layer to obtain a lane line segmentation result image with the same size as the lane image data.

2. The network model according to claim 1, characterized in that: The encoder includes a 3×3 convolution layer, a partial convolution structure and a 2×2 maximum pooling layer; the encoder is used to pass the lane line image data through the 3×3 convolution layer, the partial convolution structure and the 2×2 maximum pooling layer in sequence to obtain the encoder features.

3. The network model according to claim 2, characterized in that: The partial convolution structure is used to: According to the number of channels of the input features input into the partial convolution structure, the input features are divided into M first partial features with equal number of channels, and are numbered from 1 to M in sequence; wherein M is an even positive integer; splicing all the first part features with odd numbers into temporary features; Performing a convolution operation on the temporary features through a 3×3 convolution layer; Divide the temporary feature after the convolution operation into M / 2 second part features with equal number of channels, and sequentially number the i-th second part feature as 2i-1, where 1≤i≤M / 2; All the first partial features numbered as even numbers and all the second partial features are sequentially concatenated according to the numerical order of the numbers to obtain the output features of the partial convolution structure; the output features are passed through the 2×2 maximum pooling layer to obtain the encoder features.

4. The network model according to claim 1, characterized in that: The decoder includes a 2×2 upsampling layer and a 3×3 convolution layer; the decoder is used to perform 2-fold interpolation upsampling on the refined features through the 2×2 upsampling layer, and convolve through the 3×3 convolution layer to obtain the decoder features.

5. The network model according to claim 1, characterized in that: The multi-scale channel attention module includes a global average pooling layer, a global maximum pooling layer, a 3×3 one-dimensional convolution layer, a 5×5 one-dimensional convolution layer, a 7×7 one-dimensional convolution layer, a 1×1 two-dimensional convolution layer and a sigmoid activation function; the multi-scale channel attention module is used to: Performing global average pooling and global maximum pooling on the encoder features through the global average pooling layer and the global maximum pooling layer; The pooled features are respectively subjected to 3×3, 5×5 and 7×7 one-dimensional convolution operations through the 3×3 one-dimensional convolution layer, the 5×5 one-dimensional convolution layer and the 7×7 one-dimensional convolution layer to obtain multi-scale features; After the multi-scale features are spliced, a convolution operation is performed through the 1×1 two-dimensional convolution layer, and activation processing is performed through the sigmoid activation function to obtain a channel weight matrix; the channel weight matrix is ​​used to optimize the proportion of each channel of the encoder feature to obtain the refined feature.

6. The network model according to claim 1, characterized in that: The network model includes an N-layer encoder and an N-layer decoder; Extracting features from the lane line image data by using a first-layer encoder to obtain first-layer encoder features; The encoder features output by the i-th layer encoder are further extracted through the i+1-th layer encoder in turn to obtain the i+1-th layer encoder features, where 1≤i<N; Refining the channel features of the Nth layer encoder features output by the Nth layer encoder through the multi-scale channel attention module to obtain refined features; Decoding and resizing the refined features through an N-th layer decoder to obtain an N-th layer decoder feature; The decoder features output by the j+1th layer decoder are further decoded and resized by the jth layer decoder to obtain the jth layer decoding features, where 1≤j<N; A 3×3 convolution operation is performed on the first layer decoder features output by the first layer decoder through the output convolution layer to obtain a lane line segmentation result image with the same size as the lane image data.

7. A lane line segmentation method, characterized in that: The method comprises: Obtain a number of lane line image data, perform sample annotation to generate label images, and obtain a lane line image dataset; Preprocessing the lane line image dataset; Training the lane line segmentation network model according to any one of claims 1 to 7 based on the preprocessed lane line image dataset to obtain a trained lane line segmentation network model; The lane line image data to be segmented is input into the trained lane line segmentation network model to obtain the lane line segmentation result map.

8. The method according to claim 7, characterized in that The pretreatment includes at least one of the following: Randomly flipping the lane line image data in the lane line image data set with a preset probability; The lane line image data in the lane line image data set is randomly rotated by a preset angle within a preset number of times.

9. The method according to claim 7, characterized in that: The lane segmentation network model is trained using a weighted cross entropy loss function; the weighted cross entropy loss function is expressed as: Among them, L wce (i) is the weighted cross entropy loss function, c is the number of label types, w c is the label weight, g(i) is the label value, and p(i,c) is the predicted probability that pixel i belongs to class c.

10. A lane segmentation device, characterized in that: The device comprises: A data acquisition module is used to acquire a number of lane line image data, and perform sample annotation to generate label images to obtain a lane line image data set; A data processing module, used for preprocessing the lane line image data set; A model training module, used to train the lane line segmentation network model according to any one of claims 1 to 7 based on the preprocessed lane line image data set to obtain a trained lane line segmentation network model; The model application module is used to input the lane line image data to be segmented into the trained lane line segmentation network model to obtain the lane line segmentation result map.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the lane line segmentation method described in any one of claims 8-9 is implemented.

Citation Information

Patent Citations

  • Automatic recognition method, device and equipment for guideboard corner points and storage medium

    CN114241445A

  • Lane line detection method and device based on improved U-Net network

    CN114821510A

  • Road target detection method and system based on improved YOLOv8

    CN117037119A

  • Vehicle re-identification method based on multi-scale attention mechanism

    CN117079226A

  • Rainy day lane line detection method and system

    CN117456491A