A lightweight lane line segmentation and recognition method and system

Through the ULNet lightweight lane line segmentation model, GhostConv and multi-directional point-by-point product attention modules are used to solve the real-time and accuracy problems of existing lane detection algorithms in high-speed driving and complex scenes, and realize the implementation on mobile devices. Efficient lane line detection.

CN118470679BActive Publication Date: 2024-09-24SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202410916914.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-24
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Existing lane detection algorithms are difficult to meet real-time and accuracy requirements in high-speed driving and complex driving scenarios, and consume large amounts of computing resources, making it difficult to deploy on mobile devices.

Method used

A ULNet lightweight lane line segmentation model is proposed, which uses GhostConv convolution and multi-directional point-by-point product attention modules, combined with encoders and decoders, to reduce the amount of model parameters and calculations and improve detection through data enhancement and feature fusion. Speed ​​and robustness.

Benefits of technology

It achieves efficient lane line detection on mobile devices, significantly reduces computing resource consumption, meets real-time and accuracy requirements, and is suitable for complex road detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470679B
    Figure CN118470679B
Patent Text Reader

Abstract

The present invention relates to a method and system based on lightweight lane line segmentation recognition, belonging to the field of artificial intelligence unmanned driving technology. It includes: data preprocessing: preprocessing and image enhancement operations are performed on the lane line data set TuSimple image to obtain a training set, a verification set and a test set; constructing a ULNet lightweight lane line segmentation model, training the image, and obtaining trained parameters; inputting the preprocessed image into the trained lane line detection model for lane detection to obtain a lane line detection result; training the lane line segmentation model to detect the image lane line, and outputting the lane line segmentation result. The present invention can effectively identify the lane line information, and ensure that it can be lightweight deployed on a lane line detection mobile device, the model has a low amount of calculation, and achieves a low parameterization effect, and the model occupies very little storage space after training, and can be effectively deployed on a mobile car.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence unmanned driving technology, and in particular to a lightweight lane line segmentation and recognition method and system. Background Art

[0002] Lanes are traffic signs that divide roads in the traffic system and ensure safe and efficient driving of cars. Lane detection is a technology that automatically detects road markings to ensure that vehicles are in designated lanes. It plays an important role in the field of autonomous driving. Therefore, accurate lane detection allows the car to make multiple decisions and judgments about its position and status, thereby ensuring safe driving.

[0003] However, since the vehicle is driving at high speed and the driving scene changes rapidly, the perception system has a high detection frequency, which puts high demands on the real-time detection, which invisibly increases the difficulty of detection. And because lane detection is run on mobile devices, it still needs to be able to meet the accuracy, real-time and robustness requirements of actual applications. In addition, when deployed on real vehicles, there is still a waste of computing resources and increased computing time.

[0004] At present, the relevant technologies to solve the above problems are lane detection algorithms based on key points, such as PINet and FOLOLane algorithms, which have the disadvantage of slow speed. GANet uses FPN + Transformer architecture as the backbone to detect the distance between each key point and the starting point of the lane line; based on these distances, the key points are located near the starting point and then clustered. The transformer architecture used in this method also leads to a large number of parameters in the model. Lane detection methods based on semantic segmentation, such as spatial convolutional neural network SCNN, significantly improve the performance of deep segmentation methods by transferring information between adjacent pixels, but due to the dense pixel-level information transfer, its computational cost is very high. In addition, ErfNet and PointLaneNet models, which assign a binary label to each pixel in the image to determine whether it belongs to the same lane. CurveLanes-NAS handles the curvature of the far lane line better through neural networks, but the NAS method leads to huge computational overhead and cannot meet the deployment requirements of mobile devices. These methods usually require a lot of computing resources and are difficult to deploy on resource-constrained devices. Summary of the invention

[0005] In view of the problems existing in the prior art, the present invention provides a method based on lightweight lane line segmentation and recognition. The present invention proposes a ULNet lightweight lane line segmentation model, which improves the single-frame processing speed of the lane line detection process without significantly reducing the detection model evaluation standard, and significantly reduces the number of parameters and calculations of the lane line segmentation model. The lane line segmentation model is suitable for a variety of lane detection devices with limited mobile terminal resources, and the experimental results meet the real-time requirements.

[0006] The present invention constructs a lightweight deep convolutional neural network that can understand lane scenes by training a large number of scene images, thereby achieving end-to-end processing. It has fast speed, high robustness, and lightweight, and can adapt to complex and changeable road detection situations.

[0007] Terminology explanation:

[0008] 1. Encoder module and decoder module (Encoder-Decoder): In semantic segmentation, the encoder is usually a convolutional neural network (CNN) that extracts hierarchical features from the input image. These features are gradually abstracted and compressed during the encoding process to capture the contextual information and spatial structure in the image. The decoder is responsible for mapping these features back to the size of the original image and generating category predictions for each pixel. The decoder may include upsampling operations (such as transposed convolution or bilinear interpolation), as well as jump connections to fuse feature information at different levels to improve segmentation accuracy.

[0009] 2. Linear interpolation is a simple and effective method for estimating or predicting a value between two given data points. This method assumes that the functional relationship between the two data points is linear, that is, the function graph can be approximated as a straight line. Linear interpolation is a commonly used technique in image processing, mainly used for image scaling, rotation, filtering and other operations to maintain the continuity and smoothness of the image.

[0010] 3. Feature Map: It is a core concept in deep learning, computer vision and convolutional neural networks. A feature map is usually a collection of information extracted from an input image or a previous feature map through a convolutional layer or a pooling layer. It generally includes three attributes: channel, width, and height, which are represented by the number of channels, width, and height.

[0011] 4. Deep Supervision is a technique used in deep neural networks. Its core idea is to add auxiliary classifiers as network branches in some intermediate hidden layers of the network to supervise the backbone network. The purpose of this technique is to solve the problems of gradient disappearance and slow convergence speed that may occur in the training process of deep neural networks.

[0012] 5. Data augmentation is a common technique in machine learning and deep learning, which aims to expand the data set by performing a series of transformations on the original data to improve the generalization ability and performance of the model. This technique reduces the model's dependence on training data by increasing the sample size and diversity, thereby reducing the risk of overfitting.

[0013] 6. Channel Concat splicing: In deep learning, it refers to the operation of splicing two or more tensors in the channel dimension. In order to increase the performance of the model, channel concat splicing is also commonly used in scenarios such as multimodal data fusion and multi-scale feature fusion, making full use of information from different sources or different scales to improve the performance of the model.

[0014] 7. Channel Add stacking: Add two or more tensors of the same shape (i.e., with the same batch, channel, height, and width) element by element. It is a common feature map stacking method in network structure design. It retains more information through cross-layer connections to help the network learn and optimize better. By adding the input feature map and the output feature map of the residual block, it can effectively prevent the network from overfitting during training and improve the performance of the model.

[0015] 8. Normalization: It is mainly used to scale the pixel values ​​of an image to a specific range for use in subsequent computer vision or machine learning tasks. The main purpose of normalization is to remove differences in image brightness, contrast, etc., making image data easier to process and analyze.

[0016] 9. Running frames per second (FPS): High FPS means that the system can process and analyze data faster, which is critical for autonomous driving systems with high real-time requirements.

[0017] 10. Model parameters (Params): The number of parameters of a model directly affects the performance of the model.

[0018] 11. Floating-point operations (FLOPs): Indicates the number of floating-point operations, which is a measure of the amount of computation required by an algorithm or model. In the field of autonomous driving, FLOPs is used to evaluate the amount of computation required for a deep learning model to perform a task, so FLOPs can be used as an important indicator of system computing performance.

[0019] 12. GhostConv convolution: It is an innovative design for convolutional neural networks (CNNs), especially suitable for embedded devices, which usually have limited memory and computing resources. The main idea is to generate more feature maps through a small amount of calculation without significantly increasing the computational cost.

[0020] 13. Ablation experiment: A technique used to understand and evaluate neural network models. Its main purpose is to gradually remove certain components or functions of the neural network to study their impact on model performance. In this way, we can gain a deeper understanding of how the model works, explore the robustness of the model, and identify key components and features in the network.

[0021] 14. TuSimple Image: TuSimple Image is the most commonly used dataset for lane detection. It consists of 6408 road images collected on US highways. Its image resolution is 1280 × 720. The dataset consists of 3268 training sets, 358 validation sets, and 2782 test sets.

[0022] 15. Python: It is a high-level programming language. Its advantages are easy to learn, easy to read, easy to maintain and cross-platform. Deep learning frameworks such as TensorFlow and PyTorch are based on Python. Python is the core language in the field of AI.

[0023] 16. JSON annotated dataset: usually used to store and organize structured data. In a JSON annotated dataset, data is presented in the form of key-value pairs, where the key is a string and the value can be a string, a number, an object (i.e. a collection of nested key-value pairs), or an array.

[0024] 17. GhostConv convolution: It is an innovative convolutional neural network (CNN) module that aims to generate more feature maps through low-cost operations, thereby improving the computational efficiency of the network. GhostConv extracts rich feature information through conventional convolution operations and uses cheaper linear transformation operations to generate redundant feature information to reduce the computing resources required for the model.

[0025] 18. DiscriminativeLoss loss function: By combining L_var and L_dist, it takes into account both the pixel distribution inside the lane line and the distance relationship between different lane lines, which can more comprehensively evaluate the performance of the model. DiscriminativeLoss loss function components:

[0026] 19. Variance loss (L_var): measures the difference between pixels within the same lane line. L_var is the distance between all pixels on the same lane line and the mean of the lane line. The smaller the distance, the better.

[0027] 20. Distance loss (L_dist): Measures the distance between different lanes. L_dist is the average distance between different lane lines, the larger the distance, the better.

[0028] 21. Split: In deep learning, a tensor is divided into multiple small blocks according to the specified dimension.

[0029] 22. BatchNorm2d is a layer used to perform normalization operations in PyTorch deep learning systems. Batch normalization is a widely used technique to solve the gradient ambiguity and gradient mutation problems in deep learning neural networks, while improving the convergence speed and stability of the network.

[0030] 23. Asymmetric Bottleneck: This module is designed for real-time semantic segmentation tasks and aims to achieve a balance between accuracy and inference speed. It can capture rich feature information with fewer parameters and improve the efficiency of parameter utilization.

[0031] The technical solution of the present invention is:

[0032] A lightweight lane line segmentation and recognition method, comprising:

[0033] Data preprocessing: Preprocess and enhance the images of the lane line dataset TuSimple to obtain the training set, validation set, and test set;

[0034] Build a ULNet lightweight lane segmentation model, train the image through the lane segmentation model, and obtain the trained parameters;

[0035] The preprocessed image is input into the trained lane line detection model for lane detection to obtain the lane line detection result; the lane line segmentation model is trained to detect the lane lines of the image and output the lane line segmentation result.

[0036] According to the preferred embodiment of the present invention, in the data preprocessing, the obtained Tusimple image dataset uses Python to batch operate the original JSON annotated dataset into original images and two label images, one is a binary semantic segmentation map label, and the other is an instance segmentation label map; including:

[0037] Convert the JSON annotation files in the lane line dataset TuSimple into image data for training lane line segmentation models or lane line detection models;

[0038] Set the binary semantic segmentation mask image S = {S1, S2, ..., Si, ..., SN}, where Si is the semantic segmentation label of the i-th lane line image, i∈{1, 2, ..., N}; N refers to the number of lane line images in the training set;

[0039] Set the instance segmentation mask map I = {I1, I2, ..., Ii, ..., IN}, Ii is the instance segmentation mask map of the i-th lane line image, i∈{1, 2, ..., N};

[0040] Original image P = {P1, P2, ..., Pi, ..., PN}, Pi is the i-th original lane line image, i∈{1, 2, ..., N};

[0041] The original images P of the multiple lane line Tusimple image datasets are normalized using the mean and standard deviation through the data enhancement method to obtain the normalized images;

[0042] Further transform the original image P; including:

[0043] First, find the minimum and maximum values ​​of the normalized image through np.min(img_normalized) and np.max(img_normalized);

[0044] Then, a linear transformation is performed so that the pixel value range of the image is mapped to [0, 255];

[0045] Finally, we get the image, original mask, and instance segmentation label. We flip the image horizontally and vertically and randomly rotate it, and scale the image from the original (1280, 720) to (512, 256) as the final input image for the lane segmentation model.

[0046] Preferably, according to the present invention, the lane segmentation model includes an encoder module and a decoder module (Encoder-Decoder);

[0047] The input data of the lane segmentation model is the preprocessed and resized image. At the same time, the absolute position code is introduced, and the absolute position code is concatenated with the three-dimensional image tensor as the final input of the lane segmentation model.

[0048] The encoder module consists of six stages. The first three stages of the lane segmentation model use GhostConv convolution, and the GeLU activation function is used in the GhostConv convolution operation; the last three stages use the multi-directional point-by-point product attention module GMPPA to extract information at different levels. The feature map is split and the point multiplication of the split feature map in three different directions is performed to extract features.

[0049] A lightweight method is used to construct an MHLM module that fuses multiple masks of different scales and high- and low-dimensional features. The encoder module and the decoder module are connected through the MHLM module to realize the interaction between features at different scales and achieve the fusion effect of high-level feature maps and low-level feature maps.

[0050] In the decoder module, the first three stages use the multi-directional point-by-point product attention GMPPA module to extract information at different levels, and the last three stages pass through a bilateral upsampling decoding module BI_Trans. The bilateral upsampling decoding module BI_Trans includes two branches. The fine-grained branch recovers the fine-grained features of the image, and the coarse-grained branch performs linear interpolation on the image to recover the coarse-grained features of the lane segmentation model; both branches output half the original number of channels and twice the upsampling, and finally output the feature map through splicing. Specifies that the output of the first stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 5, the output tensor of the second stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 4, the output tensor of the third stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 3, the output tensor of the fourth stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 2, and the output tensor of the fifth stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 1.

[0051] Preferably, according to the present invention, the MHLM module is used to fuse high-dimensional features and low-dimensional features, and Mask maps generated at different decoding stages; comprising:

[0052] Through convolution and linear interpolation, high-dimensional features are transformed into the same (H, W) as low-dimensional features, where H and W refer to the height (Height) and width (Width) of the feature tensor respectively;

[0053] The high-dimensional features and low-dimensional features are split in the channel direction and divided into two groups of size (C / 2, H, W);

[0054] The high-dimensional features, low-dimensional features and Mask maps generated at different decoding stages are spliced ​​respectively to obtain two sets of high- and low-dimensional feature maps and fusion features of Masks at different stages.

[0055] Then, we use dilated convolution with a kernel size of 3 and dilation rates of 3 and 5 to extract feature information at different scales, and then concatenate the obtained feature maps in the channel dimension.

[0056] GhostConv convolution is used to realize the interaction between features at different scales; the mathematical expression of this information extraction process is as follows:

[0057] ;

[0058] ;

[0059] ;

[0060] ;

[0061] ;

[0062] in, and Represents the different parts after high- and low-dimensional features are segmented; Represents the high-dimensional features of the module input, Represents the low-dimensional features of the module input, Concat represents the splicing operation on the channel, ArousConv represents the hole convolution of the feature map, LN represents the normalization of the feature map; Conv2d represents the convolution operation, BI represents the linear interpolation, and Represents two masks.

[0063] Preferably, according to the present invention, a multi-directional point-by-point product attention module GMPPA is constructed to perform dot products of height-width, channel-width, and channel-height directions on the features and multiple different segmented modules to obtain feature information in different directions; including:

[0064] The input feature tensor F is split on the channel into four groups, denoted as F1, F2, F3, and F4; (B, C, H, and W) are used to record the dimensions of the split features respectively;

[0065] Set three initialized learnable tensors p, and adjust the size of the tensors to the same size as the three groups of features in the segmentation by performing the nearest neighbor interpolation method on p;

[0066] GhostConv convolution is performed on the three initialized learnable tensors p respectively, and the adjusted features are further subjected to dot products in height-width, channel-width, and channel-height directions with the three different split modules including F1, F2, and F3 respectively, so as to extract information in different directions of the features and obtain three feature information of the same shape and size (C / 4, H, W);

[0067] The last set of feature information, F4, is directly subjected to GhostConv convolution operation to obtain a dimension of (C / 4, H, W);

[0068] The four sets of feature tensors are concatenated along the channel dimension using the Concat operation. The final feature size is (C, H, W). The concatenated features are regularized, and the channels are fused using GhostConv to obtain the final element-by-element dot product feature.

[0069] Preferably, in the fine-grained branch, the information loss of the linear interpolation process is fine-tuned. When the features are input, the feature map is first upsampled using a transposed convolution with a convolution kernel size of 3 and a step size of 2, and then a batch normalization operation is performed on the four-dimensional input (B, C, H, W) using BatchNorm2d, while reducing the number of channels of the feature map to 1 / 2 of the original, and then linear activation is performed through the ReLU activation function; two AsymmetricBottlenecks are superimposed after the upsampling operation to achieve a fine-grained effect;

[0070] In the coarse-grained branch, the input features are quickly upsampled; first, the number of channels of the feature map is reduced to 1 / 2 of the original number of channels through convolution with a convolution kernel size of 1, and then a BN operation is performed. Finally, the bilinear interpolation method is directly used to upsample the feature map, and linear activation is performed through the ReLU activation function.

[0071] According to the preferred embodiment of the present invention, the lane line embedding branch uses the DiscriminativeLoss loss function to distinguish different lane lines. The DiscriminativeLoss loss function is used to distinguish different lane lines. The DiscriminativeLoss loss function includes the variance loss L var and distance loss L dist :

[0072] ;

[0073] ;

[0074] ;

[0075] Among them, C is the category of the lane line, is the number of pixels belonging to the same lane line, is a pixel vector, is the mean vector of the lane line, and are two different category indices, where . and The categories are and The center vector of is a preset threshold, indicating the minimum distance you want to maintain between the centers of different categories; [x]+ is a function that returns x when x is greater than or equal to 0, otherwise it returns 0;

[0076] The binary semantic segmentation loss function uses a combination of FocalTverskyLoss and Dice loss function. This binary semantic segmentation loss function is suitable for the prediction of masks in the deep supervision stage and the prediction stage of the final model. The formula of the binary semantic segmentation loss function is as follows:

[0077] ;

[0078] ;

[0079] Among them, λ i are the weights at different stages, which are 1, 0.5, 0.4, 0.3, 0.2 and 0.1 respectively, and y is the true label of the image. is the predicted result; FocalTversky() is the combination of Tversky loss and Focal loss; Dice() loss is also the Dice similarity coefficient loss, which is effective for the situation where the foreground and background categories are unbalanced;

[0080] The hybrid loss function Loss used in lane segmentation model training is as shown below:

[0081] ;

[0082] Preferably, according to the present invention, in the lane line segmentation model training, the network parameters of the lane line segmentation model are initialized, the initial learning rate is 0.001, CosineAnnealingLR is used as the scheduler, the maximum number of iterations is 50, the minimum learning rate is 1e-5, a total of 300 epochs are trained, the batch size is 64, and finally the trained lane line segmentation model is saved.

[0083] A lightweight lane line segmentation and recognition system, comprising:

[0084] The data preprocessing module is configured to: perform preprocessing and image enhancement operations on the lane line dataset TuSimple to obtain a training set, a validation set, and a test set;

[0085] The lane segmentation model building module is configured to: build a ULNet lightweight lane segmentation model, train the image through the lane segmentation model, and obtain the trained parameters;

[0086] The lane line detection and segmentation module is configured as follows: inputting the preprocessed image into the trained lane line detection model to perform lane detection and obtain the lane line detection result; training the lane line segmentation model to detect the lane line of the image and outputting the lane line segmentation result.

[0087] The beneficial effects of the present invention are:

[0088] 1. The present invention constructs a lane segmentation model and realizes lightweight semantic segmentation and recognition.

[0089] 2. The present invention forms a complete lane line detection and recognition process, which combines the coordinate information of the lane line and the high- and low-dimensional feature information modules. The proposed multi-directional point-by-point product attention mechanism can effectively extract feature information. The dual-branch upsampling module proposed in the three stages after decoding can balance the accuracy and parameter quantity of the model.

[0090] 3. The present invention can effectively identify lane line information and ensure that it can be lightweight and deployed on a lane line detection mobile device. The model has a low computational complexity and achieves a low parameterization effect. After training, the model occupies very little storage space and can be effectively deployed on a mobile car. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] To briefly introduce, it is obvious that the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0092] Figure 1 A flowchart of a lightweight lane line segmentation and recognition method according to the present invention;

[0093] Figure 2 Schematic diagram of the ULNet lightweight lane segmentation model architecture of the present invention;

[0094] Figure 3 Schematic diagram of the architecture of the MHLM module of the present invention;

[0095] Figure 4 Schematic diagram of the architecture of the multi-axis element-by-element product attention module GMPPA of the present invention;

[0096] Figure 5 Schematic diagram of the architecture of the bilateral upsampling decoding module BI_Trans of the present invention;

[0097] Figure 6 A detailed structural diagram of the Asymmetric Bottleneck of the present invention;

[0098] Figure 7 Visualization of lane lines detected by the model; DETAILED DESCRIPTION

[0099] The present invention will be further defined below in conjunction with the accompanying drawings and embodiments, but is not limited thereto.

[0100] Example 1

[0101] A lightweight lane segmentation and recognition method, such as Figure 1 As shown, including:

[0102] Data preprocessing: Preprocess and enhance the images of the lane line dataset TuSimple to obtain the training set, validation set, and test set;

[0103] A ULNet lightweight lane segmentation model is constructed, and images are trained through the lane segmentation model to obtain trained parameters. The constructed lane segmentation model has the characteristics of high precision, low parameters and low computational complexity, and can efficiently enhance lane detection, thereby improving the performance of the lane segmentation model.

[0104] The preprocessed image is input into the trained lane line detection model for lane detection to obtain the lane line detection result; the lane line segmentation model is trained to detect the lane lines of the image and output the lane line segmentation result.

[0105] Example 2

[0106] The difference between the lightweight lane line segmentation and recognition method described in Example 1 is that:

[0107] In data preprocessing, the obtained Tusimple image dataset uses Python to batch operate the original JSON annotated dataset into original images and two label images, one is the binary semantic segmentation map label and the other is the instance segmentation label map; including:

[0108] Convert the JSON annotation file in the lane line dataset TuSimple into image data for training lane line segmentation model or lane line detection model; specifically include:

[0109] 1) Read the JSON file Use Python's json library to read the JSON file and parse the coordinate points of the lane lines.

[0110] 2) Generate a binary semantic segmentation label map and create a blank image of the same size as the original image. Traverse the coordinate points of each lane line in the JSON file and use linear interpolation to draw the lane line on the blank image. Set the lane line area to 255 for lane lines and 0 for background.

[0111] 3) Generate an instance segmentation label map, treating different lane lines as different instances. Create a blank image of the same size as the original image. Iterate over each lane line in the JSON file, assign a unique code to each lane line, and draw the lane line on the corresponding channel.

[0112] Set the binary semantic segmentation mask image S = {S1, S2, ..., Si, ..., SN}, where Si is the semantic segmentation label of the i-th lane line image, i∈{1, 2, ..., N}; N refers to the number of lane line images in the training set;

[0113] Set the instance segmentation mask map I = {I1, I2, ..., Ii, ..., IN}, Ii is the instance segmentation mask map of the i-th lane line image, i∈{1, 2, ..., N};

[0114] Original image P = {P1, P2, ..., Pi, ..., PN}, Pi is the i-th original lane line image, i∈{1, 2, ..., N};

[0115] The original images P of the multiple lane line Tusimple image datasets are normalized by using the mean and standard deviation through the data enhancement method to obtain the normalized images; the normalization formula is as follows:

[0116] ;

[0117] img is a batch of images in the image dataset, mean and std refer to the mean and standard deviation of these images or pixel values ​​respectively.

[0118] Further transform the original image P; including:

[0119] First, find the minimum and maximum values ​​of the normalized image through np.min(img_normalized) and np.max(img_normalized);

[0120] Then, a linear transformation is performed so that the pixel value range of the image is mapped to [0, 255]; it is used to convert the normalized image back to the original pixel value range for subsequent processing or visualization;

[0121] Finally, we get the image, original mask, and instance segmentation label. We flip the image horizontally and vertically and randomly rotate it with a probability of 0.5, and scale the image from the original (1280,720) to (512,256) as the final input image for the lane segmentation model. The original dataset is divided into 3268 training sets, 358 validation sets, and 2782 test sets. The original mask refers to the binary semantic segmentation label map, and the instance segmentation label refers to the instance segmentation label map.

[0122] like Figure 2 As shown, the lane segmentation model includes an encoder module and a decoder module (Encoder-Decoder);

[0123] The input data of the lane segmentation model is the preprocessed and resized image. At the same time, the absolute position code (X, Y) is introduced. The absolute position code is concatenated with the three-dimensional image tensor as the final input of the lane segmentation model.

[0124] A 3D image tensor usually consists of three dimensions: height, width, and color channels. 3D image tensors are widely used in convolutional neural networks (CNNs) to process data with multiple channels such as color images or video frames.

[0125] Introduce absolute coordinate information: by creating a channel containing X and Y coordinates and adding the channel to the channel dimension of the input tensor; specifically: Create X and Y coordinate channels: First, create a grid of X and Y coordinates, normalize these coordinates to the range [-1, 1], where 0 represents the center, 1 and -1 represent the boundaries respectively; secondly, repeat the coordinate channel according to the batch size and spatial dimension of the input tensor, and ensure that the coordinate channel matches the spatial dimension of the input tensor through transposition operation, and finally, merge the tensors and merge the input tensor and coordinates on the channel dimension (dim=1); each position of each input image or feature map contains a corresponding X and Y coordinate. The input size of the lane segmentation model is (5,256,512), and each channel dimension also contains the coordinate information of the lane line, which enables the lane segmentation model to better perceive the lane line.

[0126] The encoder module consists of six stages. The first three stages of the lane segmentation model use GhostConv convolution. The size of the convolution kernel is set to 3×3. The GeLU activation function is used in the GhostConv convolution operation. The GeLU activation function is a smooth nonlinear function with a shape similar to a Gaussian distribution. It can effectively avoid the problem of gradient disappearance, and the smooth curve can allow more feature information to enter the network, improving the accuracy and generalization of the network. The use of the GeLU activation function can provide a gradient signal, which is conducive to the gradient descent algorithm to find the minimum error more accurately. The last three stages use the multi-directional point-by-point product attention module GMPPA to extract information at different levels. The feature map is segmented and the segmented feature map is multiplied in three different directions to extract features.

[0127] In the encoder module, the input size is (5,256,512), and the input tensor is subjected to three stages of GhostConv convolution operations for feature extraction. GhostConv convolution is suitable for resource-constrained scenarios such as embedded devices, and can significantly reduce the number of parameters and the amount of calculation. The size of the convolution kernel is set to 3×3, and the GeLU activation function is used. The first stage of the GhostConv convolution operation changes the feature size of (5,256,512) to (8,128,256). The second stage of the GhostConv convolution operation can change the feature size of (8,128,256) to (16,64,128). The third stage of the GhostConv convolution operation can change the feature size of (16,64,128) to (24,32,64). After three stages of convolution operations, the original input features (5,256,512) can be transformed into (24,32,64), which can effectively extract features.

[0128] In the fourth stage, the feature map of size (24, 32, 64) is input to the GMPPA module. The GMPPA module splits the features and multiple different cuts on the channel into four groups, and uses (B, C, H, W) to record the dimensions of the split features. Then, the cut modules are dot-producted with three initialized learnable tensors in the height-width, channel-width, and channel-height directions to obtain feature information in different directions; the four groups of feature information are further connected along the channel dimension using the Concat operation, and the spliced ​​features are regularized. GhostConv is used to fuse the channels to obtain the final element-by-element dot product feature (32, 16, 32). The fifth and sixth stages repeat the fourth stage to extract features. The tensor output sizes of the fifth and sixth stages are (48, 8, 16) and (64, 8, 16), respectively.

[0129] A lightweight method is used to construct an MHLM module that fuses multiple masks of different scales and high- and low-dimensional features. The encoder module and the decoder module are connected through the MHLM module to realize the interaction between features at different scales and achieve the fusion effect of high-level feature maps and low-level feature maps.

[0130] In the decoder module, the first three stages use the multi-directional point-by-point product attention GMPPA module to extract information at different levels, and the last three stages pass through a bilateral upsampling decoding module BI_Trans. The bilateral upsampling decoding module BI_Trans includes two branches. The fine-grained branch restores the fine-grained features of the image, focusing on the detailed information of the features; the coarse-grained branch performs linear interpolation on the image to restore the coarse-grained features of the lane segmentation model; both branches output half of the original number of channels and twice the upsampling, and finally output the feature map through splicing. Specifies that the output of the first stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 5, the output tensor of the second stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 4, the output tensor of the third stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 3, the output tensor of the fourth stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 2, and the output tensor of the fifth stage of the decoder is to be convolved with Conv2d and kernel size 1 with mask 1.

[0131] MHLM modules such as Figure 3 As shown, the MHLM module is used to fuse high-dimensional features and low-dimensional features, and Mask maps generated at different decoding stages; including:

[0132] Through convolution and linear interpolation, high-dimensional features are transformed into the same (H, W) as low-dimensional features, where H and W refer to the height (Height) and width (Width) of the feature tensor respectively;

[0133] The high-dimensional features and low-dimensional features are split in the channel direction and divided into two groups of size (C / 2, H, W);

[0134] The high-dimensional features, low-dimensional features and Mask maps generated at different decoding stages are spliced ​​respectively to obtain two sets of high- and low-dimensional feature maps and fusion features of Masks at different stages.

[0135] The Mask generated at different decoding stages refers to the convolution operation performed on the feature tensor with Conv2d and convolution kernel size 1 at the output stage of each GMPPA module and BI_Trans module in the decoder stage.

[0136] Among them, when the feature tensor output from the first stage of the encoding stage and the feature tensor of the fifth stage of the decoding stage perform the MHLM operation, the input of the mask is two mask 1s. When the feature tensor output from the second stage of the encoding stage and the feature tensor of the fourth stage of the decoding stage perform the MHLM operation, the input of the mask is mask 2 and mask 3. When the feature tensor output from the third stage of the encoding stage and the feature tensor of the third stage of the decoding stage perform the MHLM operation, the input of the mask is mask 3 and mask 4. When the feature tensor output from the fourth stage of the encoding stage and the feature tensor of the second stage of the decoding stage perform the MHLM operation, the input of the mask is mask 4 and mask 5. When the feature tensor output from the fifth stage of the encoding stage and the feature tensor of the first stage of the decoding stage perform the MHLM operation, the input of the mask is two mask 5s.

[0137] During the concatenation operation, the high-dimensional features are divided into high-low dimensional tensor 1 and high-low dimensional tensor 2 through convolution, bilinear interpolation and Split. The low-dimensional features are recorded as low-dimensional tensor 1 and low-dimensional tensor 2 after Split. The high-low dimensional tensor 1, the corresponding two masks and the low-dimensional tensor 1 are concatenated. The high-low dimensional tensor 2, the corresponding two masks and the low-dimensional tensor 2 are concatenated. Two sets of feature maps are obtained.

[0138] Then, we use dilated convolution with a kernel size of 3 and dilation rates of 3 and 5 to extract feature information at different scales, and then concatenate the obtained feature maps in the channel dimension.

[0139] GhostConv convolution is used to realize the interaction between features at different scales; the mathematical expression of this information extraction process is as follows:

[0140] ;

[0141] ;

[0142] ;

[0143] ;

[0144] ;

[0145] in, and Represents the different parts after high- and low-dimensional features are segmented; Represents the high-dimensional features of the module input, Represents the low-dimensional features of the module input, Concat represents the splicing operation on the channel, ArousConv represents the hole convolution of the feature map, LN represents the normalization of the feature map; Conv2d represents the convolution operation, BI represents the linear interpolation, and Represents two masks.

[0146] A multi-directional dot product attention module GMPPA is constructed to perform dot products of the features with multiple differently split modules in three directions: height-width, channel-width, and channel-height, to obtain feature information in different directions; and the number of parameters is reduced to achieve the effect of proposing features. Figure 4 This is a detailed structural diagram of the multi-directional point-by-point product attention module GMPPA of the present invention; including:

[0147] The input feature tensor F is split on the channel and divided into four groups, denoted as F1, F2, F3, and F4; (B, C, H, W) are used to record the dimensions of the split features respectively; the feature tensor F is generated by the GhostConv convolution of the feature image in the first three stages of the encoder.

[0148] Three initialized learnable tensors p are set, and the size of the tensors is adjusted to the same size as the three groups of features of the segmentation by performing the nearest neighbor interpolation method on p; the specific sizes are preset as (1, C / 4, 8, 16), (1, 1, C / 4, 8) and (1, 1, C / 4, 16) in the present invention;

[0149] Before performing element-by-element dot product, GhostConv convolution is performed on the three initialized learnable tensors p to reduce the number of parameters. The adjusted features are further dot-producted with three different split modules, including F1, F2, and F3, in the height-width, channel-width, and channel-height directions to extract information in different directions of the features and obtain three feature information of the same shape and size (C / 4, H, W); the adjusted features refer to the p1, p2, and p3 tensors obtained by setting three initialized learnable tensors (1, C / 4, 8, 16), (1, 1, C / 4, 8), and (1, 1, C / 4, 16) respectively after nearest neighbor interpolation and GhostConv convolution.

[0150] The last set of feature information, F4, is directly subjected to GhostConv convolution operation to obtain a dimension of (C / 4, H, W);

[0151] The four sets of feature tensors are concatenated along the channel dimension using the Concat operation. The final feature size is (C, H, W). The concatenated features are regularized, and the channels are fused using GhostConv to obtain the final element-by-element dot product feature.

[0152] Figure 5The detailed structure diagram of the bilateral upsampling decoding module BI_Trans of the present invention: In the fine-grained branch, the information loss of the linear interpolation process is fine-tuned. When the input features are firstly upsampled using a transposed convolution with a convolution kernel size of 3 and a step size of 2, and then batch normalization is performed on the four-dimensional input (B, C, H, W) using BatchNorm2d, while reducing the number of channels of the feature map to 1 / 2 of the original, and then linear activation is performed through the ReLU activation function; after the upsampling operation, two Asymmetric Bottlenecks are superimposed to achieve a fine-grained effect; Asymmetric Bottleneck can maintain a high segmentation accuracy while reducing the number of parameters and floating-point calculations. This method can both maintain the shape of the feature map and effectively extract information.

[0153] In the coarse-grained branch, the input features are quickly upsampled; it includes a branch with fast running speed and simple model structure. First, the number of channels of the feature map is reduced to 1 / 2 of the original number of channels through convolution with a convolution kernel size of 1, and then the BN operation is performed. Finally, the bilinear interpolation method is directly used to upsample the feature map, and linear activation is performed through the ReLU activation function.

[0154] Figure 6 This is a detailed structural diagram of the Asymmetric Bottleneck of the present invention: The Asymmetric Bottleneck includes two branches, one of which is a main branch, which directly performs a pooling operation on the feature vector, and the other is a sub-branch, which includes two identical convolution modules 1×1, a conv layer and a regularizer layer, wherein the convolution module 1×1 includes: a convolution layer (nn.Conv2d), a convolution operation with a convolution kernel size of 1, a step size of 1, a batch normalization layer (nn.BatchNorm2d) and an activation function PReLU, and a conv module includes: a 3×1 convolution layer and a 1×3 convolution layer, both of which have a step size of 1 and a padding size of 1.

[0155] The lane line embedding branch uses the DiscriminativeLoss loss function to distinguish different lane lines, and uses the DiscriminativeLoss loss function to distinguish different lane lines for subsequent clustering operations. The DiscriminativeLoss loss function includes the variance lossL var and distance lossL dist: The lane line embedding branch refers to one of the two branches in the final output of the ULNet model. This lane line embedding branch assigns an N-dimensional vector to each pixel to achieve lane pixel classification and distinction, where N is a hyperparameter representing the dimension of the embedding space.

[0156] ;

[0157] ;

[0158] ;

[0159] Among them, C is the category of the lane line, is the number of pixels belonging to the same lane line, is a pixel vector, is the mean vector of the lane line, and are two different category indices, where . and The categories are and The center vector of is a preset threshold value, indicating the minimum distance you want to maintain between the centers of different categories; [x]+ is a function that returns x when x is greater than or equal to 0, otherwise it returns 0 (this is often called the non-negative part of the ReLU activation function);

[0160] The binary semantic segmentation loss function uses a combination of FocalTverskyLoss and Dice loss function, which not only focuses on difficult samples in the training process, but also optimizes the segmentation effect evaluation index. The binary semantic segmentation loss function is suitable for the prediction of masks in the deep supervision stage and the prediction stage of the final model. The formula of the binary semantic segmentation loss function is as follows:

[0161] ;

[0162] ;

[0163] Among them, λ i are the weights at different stages, which are 1, 0.5, 0.4, 0.3, 0.2 and 0.1 respectively, and y is the true label of the image. is the predicted result; FocalTversky() is a combination of Tversky loss and Focal loss; Dice() loss is also Dice similarity coefficient loss, which is effective for the situation where the foreground and background categories are unbalanced; FocalTverskyLoss and Dice are used to combine the loss functions. Further, Focal TverskyLoss combines the advantages of Focal Loss and Tversky exponentiation. Focal Loss is a loss function for classification tasks. It adjusts the weights of difficult samples so that the model pays more attention to difficult samples during training. Focal Tversky is a loss function for classification tasks. It adjusts the weights of difficult samples so that the model pays more attention to difficult samples during training, while the Tversky index is an indicator for evaluating the segmentation effect. It takes into account the accuracy and recall of the segmentation results. The Focal Tversky loss function combines the two, not only paying attention to difficult samples in the training process, but also optimizing the segmentation effect evaluation index.

[0164] The hybrid loss function Loss used in lane segmentation model training is as shown below:

[0165] ;

[0166] During the lane segmentation model training, the network parameters of the lane segmentation model were initialized, the initial learning rate was 0.001, CosineAnnealingLR was used as the scheduler, the maximum number of iterations was 50, the minimum learning rate was 1e-5, a total of 300 epochs were trained, the batch size was 64, and finally the trained lane segmentation model was saved.

[0167] Input the preprocessed image into the trained lane detection model to perform lane detection and obtain the lane detection result; train the lane segmentation model to detect the lane lines of the image and output the lane segmentation result; including:

[0168] First, the data needs to be prepared: collect an image dataset containing lane lines, and then preprocess and enhance the dataset to improve the accuracy of lane line detection.

[0169] Secondly, a lane line detection model ULNet model is constructed: lane line detection is performed based on the lane line construction model of the present invention.

[0170] Next, the model is trained using the labeled data set: for deep learning models, this usually includes steps such as forward propagation, back propagation, and parameter update. In this process, hyperparameters such as learning rate, batch size, and number of iterations need to be adjusted to obtain the best training results.

[0171] Use the saved model for lane line detection: Input image Input the image to be detected into the trained model. Lane line detection obtains the lane line segmentation result through the segmentation network.

[0172] Finally, output the results and visualize them: Output the lane line information obtained by segmentation in the form of a mask. Overlay the results on the original image to intuitively view the location and shape of the lane line.

[0173] The output of the model can be visualized as Figure 7 . In order to verify the effectiveness and rationality of the algorithm proposed in the present invention, under the same experimental environment and conditions, the present invention conducts ablation experiments on lane detection and segmentation. In order to verify the effectiveness of the method, an ablation experiment was performed on the TuSimpe dataset. The baseline used in this embodiment refers to UNet. The ablation method is to replace the feature extraction module, high- and low-dimensional feature fusion module, and decoding module of UNet. In the segmentation stage, mIOU is used to evaluate the segmentation effect of the model, and the frames per second (FPS) and model parameters (Params) of the model are also evaluated during runtime. Floating-point operations (FLOPs) represent the number of floating-point operations, which is a measure of the computational complexity of the algorithm or model. The experimental results are shown in Table 1:

[0174] Table 1 Experimental results table;

[0175]

[0176] Replace the first three feature extraction modules of the baseline with GhostConv. The number of parameters and calculations is greatly reduced. The number of parameters of the model is reduced by about 4MB, while the FLOPs value is significantly reduced and the FPS is increased. Replace the skip connection operation in UNet with MHLM, which further improves the model's ability to fuse high- and low-dimensional features. The replacement of MHLM leads to a significant reduction in the number of parameters and the model becomes more lightweight. In addition, after replacing only the last three stages of the encoding module with GMPPA, the model also has better segmentation effects. mIoU has been improved by nearly 2%. Next, replace the Upsampling of the last three stages in the decoding module to balance the accuracy and parameter amount of the model. The number of parameters of the final model is reduced to 0.26MB and FLOPs is reduced to 0.56G. The segmentation evaluation index mIoU is improved by 2.3%. The results show that the model can effectively improve the performance of the model.

[0177] Example 3

[0178] A lightweight lane line segmentation and recognition system, comprising:

[0179] The data preprocessing module is configured to: perform preprocessing and image enhancement operations on the lane line dataset TuSimple to obtain a training set, a validation set, and a test set;

[0180] The lane segmentation model building module is configured to: build a ULNet lightweight lane segmentation model, train the image through the lane segmentation model, and obtain the trained parameters;

[0181] The lane line detection and segmentation module is configured as follows: inputting the preprocessed image into the trained lane line detection model to perform lane detection and obtain the lane line detection result; training the lane line segmentation model to detect the lane line of the image and outputting the lane line segmentation result.

Claims

1. A lightweight lane line segmentation and recognition method, characterized in that: include: Data preprocessing: Preprocess and enhance the images of the lane line dataset TuSimple to obtain the training set, validation set, and test set; Build a ULNet lightweight lane segmentation model, train the image through the lane segmentation model, and obtain the trained parameters; The preprocessed image is input into the trained lane detection model to perform lane detection and obtain the lane detection result; Train the lane line segmentation model to detect lane lines in the image and output the lane line segmentation results; The lane segmentation model includes an encoder module and a decoder module; The input data of the lane segmentation model is the preprocessed and resized image. At the same time, the absolute position code is introduced, and the absolute position code is concatenated with the three-dimensional image tensor as the final input of the lane segmentation model. The encoder module consists of six stages. The first three stages of the lane segmentation model use GhostConv convolution, and the GeLU activation function is used in the GhostConv convolution operation; the last three stages use the multi-directional point-by-point product attention module GMPPA to extract information at different levels. The feature map is split and the point multiplication of the split feature map in three different directions is performed to extract features. A lightweight method is used to construct an MHLM module that fuses multiple masks of different scales and high- and low-dimensional features. The encoder module and the decoder module are connected through the MHLM module to realize the interaction between features at different scales and achieve the fusion effect of high-level feature maps and low-level feature maps. In the decoder module, the first three stages use the multi-directional point-by-point product attention GMPPA module to extract information at different levels, and the last three stages use a bilateral upsampling decoding module BI_Trans. The bilateral upsampling decoding module BI_Trans includes two branches, where the fine-grained branch recovers the fine-grained features of the image, and the coarse-grained branch performs linear interpolation on the image to recover the coarse-grained features of the lane segmentation model; both branches output half and twice the original number of channels, and finally output the feature map by splicing; The MHLM module is used to fuse high-dimensional features and low-dimensional features, and Mask maps generated at different decoding stages; including: Through convolution and linear interpolation, high-dimensional features are transformed into the same (H, W) as low-dimensional features, where H and W refer to the height and width of the feature tensor respectively; The high-dimensional features and low-dimensional features are split in the channel direction and divided into two groups; The high-dimensional features, low-dimensional features and Mask maps generated at different decoding stages are spliced ​​respectively to obtain two sets of high- and low-dimensional feature maps and fusion features of Masks at different stages; Then, through the dilated convolution, feature information at different scales is extracted, and the obtained feature maps are spliced ​​in the channel dimension; GhostConv convolution is used to realize the interaction between features at different scales; the mathematical expression of this information extraction process is as follows: in, and Represents the different parts after high- and low-dimensional features are segmented; Represents the high-dimensional features of the module input, Represents the low-dimensional features of the module input, Concat represents the splicing operation on the channel, ArousConv represents the hole convolution of the feature map, LN represents the normalization of the feature map; Conv2d represents the convolution operation, BI represents the linear interpolation, and Represents two masks.

2. The lightweight lane line segmentation and recognition method according to claim 1 is characterized in that: In data preprocessing, the obtained Tusimple image dataset uses Python to batch operate the original JSON annotated dataset into original images and two label images, one is the binary semantic segmentation map label and the other is the instance segmentation label map; including: Convert the JSON annotation files in the lane line dataset TuSimple into image data for training lane line segmentation models or lane line detection models; Set the binary semantic segmentation mask image S = {S1, S2, ..., Si, ..., SN}, where Si is the semantic segmentation label of the i-th lane line image, i∈{1, 2, ..., N}; N refers to the number of lane line images in the training set; Set instance segmentation mask map I = {I1,I2,...,Ii,...,IN}, Ii is the instance segmentation mask map of the i-th lane line image, i∈{1,2,...,N}; Original image P = {P1, P2, ..., Pi, ..., PN}, Pi is the i-th original lane line image, i∈{1, 2, ..., N}; The original images P of the multiple lane line Tusimple image datasets are normalized using the mean and standard deviation through a data augmentation method to obtain a normalized image.

3. The lightweight lane line segmentation and recognition method according to claim 2 is characterized in that: Further transform the original image P; including: First, find the minimum and maximum values ​​of the normalized image; Then, a linear transformation is performed so that the pixel value range of the image is mapped to [0, 255]; Finally, we get the image, original mask, and instance segmentation label. We flip the image horizontally and vertically and randomly rotate it, and scale the image from the original (1280, 720) to (512, 256) as the final input image for the lane segmentation model.

4. The lightweight lane line segmentation and recognition method according to claim 1 is characterized in that: Construct a multi-directional point-by-point product attention module GMPPA, perform dot products of height-width, channel-width, and channel-height with multiple different split modules to obtain feature information in different directions; including: The input feature tensor F is split on the channel into four groups, denoted as F1, F2, F3, and F4; (B, C, H, and W) are used to record the dimensions of the split features respectively; Set three initialized learnable tensors p, and adjust the size of the tensor p to the same size as the three groups of features in the segmentation by performing the nearest neighbor interpolation method on the tensor p; GhostConv convolution is performed on the three initialized learnable tensors p respectively, and the adjusted features are further subjected to dot products in height-width, channel-width, and channel-height directions with the three different split modules including F1, F2, and F3 respectively, so as to extract information in different directions of the features and obtain three feature information of the same shape and size (C / 4, H, W); The last set of feature information, F4, is directly subjected to GhostConv convolution operation to obtain a dimension of (C / 4, H, W); The four sets of feature tensors are concatenated along the channel dimension using the Concat operation. The final feature size is (C, H, W). The concatenated features are regularized, and the channels are fused using GhostConv to obtain the final element-by-element dot product feature.

5. The lightweight lane line segmentation and recognition method according to claim 1 is characterized in that: In the fine-grained branch, the information loss of the linear interpolation process is fine-tuned. When the input features are firstly upsampled using a transposed convolution with a kernel size of 3 and a step size of 2, and then batch normalization is performed on the four-dimensional input (B, C, H, W) using BatchNorm2d, while reducing the number of channels of the feature map to 1 / 2 of the original, and then linear activation is performed through the ReLU activation function; after the upsampling operation, two Asymmetric Bottleneck are superimposed to achieve a fine-grained effect; In the coarse-grained branch, the input features are quickly upsampled; first, the number of channels of the feature map is reduced to 1 / 2 of the original number of channels through convolution with a convolution kernel size of 1, and then a BN operation is performed. Finally, the bilinear interpolation method is directly used to upsample the feature map, and linear activation is performed through the ReLU activation function.

6. The lightweight lane line segmentation and recognition method according to claim 1 is characterized in that: The lane line embedding branch uses the DiscriminativeLoss loss function to distinguish different lane lines. The DiscriminativeLoss loss function includes the variance loss L var and distance loss L dist : Among them, C is the category of the lane line, N c is the number of pixels belonging to the same lane line, x i is the pixel vector, μ c is the mean vector of the lane line, C A and C B are two different category indices, where C A ≠C B ; and Category C A and C B The center vector of d is a preset threshold, indicating the minimum distance between centers of different categories; [x]+ is a function that returns x when x is greater than or equal to 0, otherwise it returns 0; The binary semantic segmentation loss function uses a combination of FocalTverskyLoss and Dice loss function. This binary semantic segmentation loss function is suitable for the prediction of masks in the deep supervision stage and the prediction stage of the final model. The formula of the binary semantic segmentation loss function is as follows: Among them, λi is the weight of different stages, which are 1, 0.5, 0.4, 0.3, 0.2 and 0.1 respectively, y is the true label of the image, is the predicted result; FocalTversky() is the combination of Tversky loss and Focal loss; Dice() loss is also the Dice similarity coefficient loss, which is effective for the situation where the foreground and background categories are unbalanced; The hybrid loss function Loss used in lane segmentation model training is as shown below:

7. A lightweight lane line segmentation and recognition method according to any one of claims 1 to 6, characterized in that: During the lane segmentation model training, the network parameters of the lane segmentation model were initialized, the initial learning rate was 0.001, CosineAnnealingLR was used as the scheduler, the maximum number of iterations was 50, the minimum learning rate was 1e-5, a total of 300 epochs were trained, the batch size was 64, and finally the trained lane segmentation model was saved.

8. A lightweight lane line segmentation and recognition system, characterized in that: include: The data preprocessing module is configured to: perform preprocessing and image enhancement operations on the lane line dataset TuSimple to obtain a training set, a validation set, and a test set; The lane segmentation model building module is configured to: build a ULNet lightweight lane segmentation model, train the image through the lane segmentation model, and obtain the trained parameters; The lane detection and segmentation module is configured to: input the preprocessed image into the trained lane detection model to perform lane detection and obtain a lane detection result; Train the lane line segmentation model to detect lane lines in the image and output the lane line segmentation results; The lane segmentation model includes an encoder module and a decoder module; The input data of the lane segmentation model is the preprocessed and resized image. At the same time, the absolute position code is introduced, and the absolute position code is concatenated with the three-dimensional image tensor as the final input of the lane segmentation model. The encoder module consists of six stages. The first three stages of the lane segmentation model use GhostConv convolution, and the GeLU activation function is used in the GhostConv convolution operation; the last three stages use the multi-directional point-by-point product attention module GMPPA to extract information at different levels. The feature map is split and the point multiplication of the split feature map in three different directions is performed to extract features. A lightweight method is used to construct an MHLM module that fuses multiple masks of different scales and high- and low-dimensional features. The encoder module and the decoder module are connected through the MHLM module to realize the interaction between features at different scales and achieve the fusion effect of high-level feature maps and low-level feature maps. In the decoder module, the first three stages use the multi-directional point-by-point product attention GMPPA module to extract information at different levels, and the last three stages use a bilateral upsampling decoding module BI_Trans. The bilateral upsampling decoding module BI_Trans includes two branches, where the fine-grained branch recovers the fine-grained features of the image, and the coarse-grained branch performs linear interpolation on the image to recover the coarse-grained features of the lane segmentation model; both branches output half and twice the original number of channels, and finally output the feature map by splicing; The MHLM module is used to fuse high-dimensional features and low-dimensional features, and Mask maps generated at different decoding stages; including: Through convolution and linear interpolation, high-dimensional features are transformed into the same (H, W) as low-dimensional features, where H and W refer to the height and width of the feature tensor respectively; The high-dimensional features and low-dimensional features are split in the channel direction and divided into two groups; The high-dimensional features, low-dimensional features and Mask maps generated at different decoding stages are spliced ​​respectively to obtain two sets of high- and low-dimensional feature maps and fusion features of Masks at different stages; Then, through the dilated convolution, feature information at different scales is extracted, and the obtained feature maps are spliced ​​in the channel dimension; GhostConv convolution is used to realize the interaction between features at different scales; the mathematical expression of this information extraction process is as follows: in, and Represents the different parts after high- and low-dimensional features are segmented; Represents the high-dimensional features of the module input, Represents the low-dimensional features of the module input, Concat represents the splicing operation on the channel, ArousConv represents the hole convolution of the feature map, LN represents the normalization of the feature map; Conv2d represents the convolution operation, BI represents the linear interpolation, and Represents two masks.

Citation Information

Patent Citations

  • Instance segmentation method based on detection enhancement and multi-stage bounding box feature refinement

    CN115797629A

  • Video abstract generation method based on multi-feature differential attention network

    CN116049487A

  • Semantic segmentation network-based road adhesion coefficient prediction method

    CN116630702A

  • Real-time semantic segmentation method based on feature multiplexing and two-stage self-attention

    CN117409204A

  • Efficient lightweight method and device for dental calculus segmentation

    CN117522880A