Lane line semantic segmentation detection method and device, equipment and storage medium
Through data set preprocessing and network design, combined with the information flow of backbone networks and decoders, the problem of occlusion and no visual clues in lane line detection is solved, and the lane line detection performance and efficiency in the field of autonomous driving is improved, and it is suitable for real-time detection. .
Patent Information
- Application Number
- CN202411360256.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-10
AI Technical Summary
The existing lane line detection algorithm is difficult to deal with occlusion and visual clues, and the post-processing is complex and cumbersome, so it is not suitable for the field of autonomous driving with high demand for real-time detection.
Dataset preprocessing, network design and training are adopted, combined with backbone network, neck layer and decoder, through information flow and visual information inference, the performance and efficiency of lane line detection model are improved and the impact of no visual clues is alleviated.
It has achieved the improvement of the performance and efficiency of the lane line detection model in the field of autonomous driving, solved the problems of occlusion and lack of visual clues, and is suitable for real-time detection needs.
Smart Images

Figure CN119296062A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of lane line detection, and in particular to a method, device, equipment and storage medium for lane line semantic segmentation detection. Background Art
[0002] Lane detection is an indispensable part of the development of intelligent driving and intelligent transportation systems. It means identifying lane lines in driving scenes, including geometric parameters such as width and curvature, thus laying the foundation for environmental perception, path planning and vehicle navigation. Therefore, an accurate, robust and efficient lane detection system is extremely important for safe intelligent transportation.
[0003] The segmentation-based solution is one of the mainstream lane detection algorithms, which distinguishes pixels as lane targets and backgrounds, and aggregates pixels belonging to the same lane, which belongs to the category of instance segmentation. Lanes are semantic objects with strong shape priors and weak appearance connectivity. Segmentation-based algorithms have high accuracy, but they cannot associate the spatial connection of pixels and are difficult to handle occlusion and no visual clues. The post-processing is complex and cumbersome, and is not suitable for the field of autonomous driving with high real-time detection requirements. Summary of the invention
[0004] The main purpose of this application is to provide a lane line semantic segmentation detection method, device, equipment and storage medium, aiming to solve the technical problems of improving the performance and efficiency of the lane line detection model and alleviating the impact of the lack of visual cues.
[0005] To achieve the above objectives, the present application proposes a lane line semantic segmentation method, the method comprising:
[0006] Get image data;
[0007] Inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function;
[0008] Lane line detection is performed according to the segmentation map and the probability map to obtain a lane line detection result.
[0009] In one embodiment, the step of inputting the image data into a detection model to obtain a segmentation map and a probability map comprises:
[0010] Inputting the image data into a detection model;
[0011] Extracting features of the image data through the backbone network in the detection model to obtain feature images and preset outputs;
[0012] Slicing and information circulation of the feature image are performed through the neck layer to obtain aggregated features;
[0013] The preset output and the aggregated features are input into a decoder to obtain a segmentation map and a probability map.
[0014] In one embodiment, the step of inputting the preset output and the aggregated features into a decoder to obtain a segmentation map and a probability map comprises:
[0015] Inputting the preset output and the aggregated features into a decoder, and upsampling the aggregated features through the decoder to obtain sampled features;
[0016] Splicing the preset output with the sampling feature to obtain a spliced feature;
[0017] Converting the spliced features to a preset resolution by bilinear upsampling to obtain a preset resolution feature;
[0018] Adding a convolution layer to the preset resolution feature to obtain a lane line segmentation map;
[0019] The existence and probability distribution of lane lines are predicted according to the segmentation map to obtain a probability map of the existence of lane lines.
[0020] In one embodiment, the step of performing lane line detection according to the segmentation map and the probability map to obtain a lane line detection result includes:
[0021] Adjusting the network parameters of the segmentation map and the probability map to obtain a parameter-adjusted segmentation map and a parameter-adjusted probability map;
[0022] Lane line detection is performed according to the parameter adjustment segmentation map and the parameter adjustment probability map to obtain a lane line detection result.
[0023] In one embodiment, the step of adjusting the network parameters of the segmentation map and the probability map to obtain the parameter-adjusted segmentation map and the parameter-adjusted probability map comprises:
[0024] Using a first loss function to calculate the error between the segmentation value of the segmentation map and the instance true value, to obtain the instance prediction loss;
[0025] The second loss function is used to calculate the error between the probability map and whether there is a true value, and the lane line existence prediction loss is obtained;
[0026] Calculating a weighted sum of the instance prediction loss and the lane line existence prediction loss to obtain a weighted loss;
[0027] The gradient of the weighted loss is calculated by back propagation, and the network parameters of the segmentation map and the probability map are updated until the network converges to obtain the parameter-adjusted segmentation map and the parameter-adjusted probability map.
[0028] In one embodiment, the step of performing lane line detection according to the parameter adjustment segmentation map and the parameter adjustment probability map to obtain a lane line detection result includes:
[0029] Perform pixel search on the parameter adjustment segmentation map to obtain search results;
[0030] Performing threshold judgment on the parameter adjustment probability map to obtain a judgment result;
[0031] Fitting the search result, the judgment result and the lane line instance by a preset function to obtain a lane line point;
[0032] The lane line point is used as the lane line detection result.
[0033] In one embodiment, the step of inputting the image data into the detection model to obtain the segmentation map and the probability map includes:
[0034] Get the search dataset;
[0035] Performing a hyper-parameter search on the multi-branch model based on the search data set to obtain hyper-parameter data;
[0036] Training the hyper-parameter data, and embedding the trained hyper-parameter data into the optimizer of the multi-branch model;
[0037] The multi-branch model is subjected to gradient reparameterization processing to obtain a detection model.
[0038] In addition, to achieve the above purpose, the present application also proposes a lane line semantic segmentation detection device, the device comprising:
[0039] A data acquisition module, used for acquiring image data;
[0040] A model design module, used for inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function;
[0041] The lane line detection module is used to perform lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a lane line semantic segmentation detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the lane line semantic segmentation detection method as described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the lane line semantic segmentation detection method described above are implemented.
[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the lane line semantic segmentation detection method as described above.
[0045] One or more technical solutions proposed in this application have at least the following technical effects:
[0046] By adopting dataset preprocessing, network design and training, and visual information reasoning, the problem that segmentation-based algorithms are difficult to handle occlusion and lack of visual cues due to the inability to associate the spatial connection of pixels, and the post-processing is complex and cumbersome, making them unsuitable for the field of autonomous driving with high real-time detection requirements is solved. Compared with the existing technology, the performance and efficiency of the lane line detection model are improved, and the impact of the lack of visual cues is alleviated. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0049] Figure 1 A flowchart of the first embodiment of the lane line semantic segmentation detection method of the present application is provided;
[0050] Figure 2 A schematic diagram of the overall framework of the lane semantic segmentation detection method provided in Example 1 of the present application;
[0051] Figure 3 A brief flowchart of the lane line semantic segmentation detection method provided in Example 1 of the present application;
[0052] Figure 4 A flowchart of the second embodiment of the lane line semantic segmentation detection method of the present application is provided;
[0053] Figure 5 A flowchart of the third embodiment of the lane line semantic segmentation detection method of the present application is provided;
[0054] Figure 6 A flowchart of the fourth embodiment of the lane line semantic segmentation detection method of the present application is provided;
[0055] Figure 7 This is a schematic diagram of the module structure of the lane semantic segmentation detection device according to an embodiment of the present application;
[0056] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the lane line semantic segmentation detection method in the embodiment of the present application.
[0057] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0058] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0059] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0060] The main solution of the embodiment of the present application is: acquiring image data; inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function; performing lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
[0061] In this embodiment, for ease of description, the following description is made using the internal executor of the lane line semantic segmentation detection system as the execution subject.
[0062] The segmentation-based algorithms in the existing technology are unable to associate the spatial connections between pixels and therefore have difficulty handling occlusion and situations without visual clues. In addition, the post-processing is complex and cumbersome, making them unsuitable for the field of autonomous driving where real-time detection requirements are high.
[0063] This application provides a solution that uses data set preprocessing, network design and training, and visual information reasoning to improve the performance and efficiency of the lane detection model and alleviate the impact of the lack of visual cues.
[0064] It can be seen from the above embodiments that the present application adopts data set preprocessing, network design and training, and visual information reasoning to solve the problem that segmentation-based algorithms are difficult to handle occlusion and lack of visual clues due to the inability to associate the spatial connection of pixels, and the post-processing is complicated and cumbersome, and is not suitable for the field of autonomous driving with high real-time detection requirements. The performance and efficiency of the lane line detection model are improved, and the impact of the lack of visual clues is alleviated.
[0065] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes the internal executor of the lane line semantic segmentation detection system as an example to illustrate this embodiment and the following embodiments.
[0066] Based on this, the present application embodiment provides a lane line semantic segmentation detection method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the lane line semantic segmentation detection method of the present application.
[0067] In this embodiment, the lane line semantic segmentation detection method includes steps S10 to S30:
[0068] Step S10, acquiring image data.
[0069] It should be noted that the image data is a pre-processed vehicle-mounted fisheye original image, which is collected by a vehicle-mounted fisheye camera. The vehicle-mounted fisheye camera is a special camera that can provide a wide viewing angle of more than 180 degrees and is usually used in the car's panoramic surround view system.
[0070] Collect the original fisheye image of the vehicle, scale it to 640x384 according to the specified aspect ratio, and perform var-mean normalization to classify the value between 0 and 1. Furthermore, in order to enhance the diversity and richness of the data set, a series of data enhancement processing is required, including random flipping, random rotation, Gaussian blur, brightness, saturation, hue transformation, etc. Finally, convert the input of the image into a tensor and perform channel adjustment to obtain image data so that the image data can be input into the backbone network to participate in forward reasoning.
[0071] Step S20, inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function.
[0072] It should be noted that the lane line segmentation map refers to the use of image processing technology to distinguish the lane lines in the road image from other parts. It is usually used in the environmental perception part of the autonomous driving system. The lane line segmentation map can provide important visual information for the autonomous driving system and help the vehicle to make accurate path planning and decisions. The probability map of the existence of the lane line refers to the probability that each pixel output by the model belongs to the lane line in the lane line detection task. This probability map is the direct output of the lane line segmentation network. It shows the model's confidence that each pixel in the image belongs to the lane line. It can be used for further processing, such as determining the final lane line segmentation result by setting a threshold, or for subsequent fitting and tracking of the lane line. The value of the probability map is the score of whether each lane line exists or not.
[0073] In addition, it should be noted that the Backbone Network is the core part of the large network structure, which is mainly used to extract abstract, high-level features contained in the image, thereby providing rich semantic information and texture information for subsequent lane line detection. The neck layer is a module that can aggregate spatial structural information. It is plug-and-play. The information flow function of the neck layer can aggregate the spatial correlation of the feature map to alleviate the impact of no visual clues. The decoder is a digital circuit. Its main function is to convert the encoded information into the original signal. The decoder has rich semantic information and structural information input, which can effectively distinguish lane lines and backgrounds, and is conducive to clear lane line boundary segmentation.
[0074] Step S30, performing lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
[0075] The loss function is trained on the segmentation map and probability map output after the model design, and lane line detection is performed based on the trained segmentation map and probability map. The values of the segmentation map and probability map output by the detection model are converted into specific lane line entities.
[0076] like Figure 2 As shown, a schematic diagram of the overall framework of a lane line semantic segmentation detection method is provided, including: inputting a fisheye image; a backbone network; a neck layer; the decoder performs dimensionality reduction on the output of the backbone network, upsamples the output of the neck layer, concatenates and fuses the two, then performs upsampling and segmentation, and finally performs existence prediction; the lane line detection performs pixel search on the segmentation result, performs threshold judgment on the existence prediction result, and then performs cubic spline function processing on the two; and outputs the lane line.
[0077] The present embodiment provides a method for semantic segmentation detection of lane lines. By adopting data set preprocessing, network design and training, and visual information reasoning, the present application solves the problem that segmentation-based algorithms are difficult to handle occlusion and lack of visual clues due to the inability to associate the spatial connection of pixels, and the post-processing is complex and cumbersome, making them unsuitable for the field of autonomous driving with high real-time detection requirements. The present application improves the performance and efficiency of the lane line detection model and alleviates the impact of the lack of visual clues.
[0078] For example, to help understand the implementation process of the lane line semantic segmentation detection method described in the first embodiment, please refer to Figure 3 , Figure 3 A brief flowchart of lane line semantic segmentation detection is provided, including: data collection, data processing, model design, loss calculation, back propagation, gradient update, and lane line detection. The model design specifically includes the backbone network, neck layer, and decoder.
[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S20 includes steps S21 to S24:
[0080] Step S21, inputting the image data into a detection model.
[0081] The preprocessed fisheye image is input into the backbone network in the detection model for forward reasoning.
[0082] Step S22, extracting the features of the image data through the backbone network in the detection model to obtain a feature picture and a preset output.
[0083] It should be noted that the feature image is the abstract, high-level feature contained in the image, and the preset output is the low-level, high-resolution output of the backbone network, which contains more spatial geometric information.
[0084] The backbone network uses a gradient reparameterization model and uses the RepOptimizer-VGG optimizer. The backbone network extracts the abstract, high-level features contained in the image and outputs them as feature images, with low-level, high-resolution outputs as preset outputs. At the same time, for inputs of the shape B x 3x H x W, where B is the batch size, 3 is the number of channels of the RGB image, and H and W are the height and width of the image, respectively, the output shape of RepOptimizer-VGG is B x C x(H / 16)x(W / 16), where C is the feature map channel, and the resolution of the feature map is reduced to reduce the complexity of subsequent calculations.
[0085] In addition, it should be noted that RepOptimizer-VGG is a new type of optimizer. It is a direct connection structure with only convolution operators. It has the characteristics of dual high efficiency in training and inference, quantization-friendly, and easy to deploy. It integrates model-specific prior knowledge into the optimization process through the gradient re-parameterization method.
[0086] Step S23, slicing and information circulation of the feature image through the neck layer to obtain aggregated features.
[0087] It should be noted that the aggregated feature is a feature image after the spatial correlation of pixels is enhanced.
[0088] The feature image output by the backbone network is divided into slices in the row and column dimensions, and information is circulated in the four directions of up, down, left, and right, with several iterations in each direction. For example, taking the row dimension as an example, the row features processed by one-dimensional convolution and nonlinear activation are continuously passed to other layers as historical information. In each iteration, the process is carried out in parallel, and the information is connected end to end, so that the feature layer has memory in all directions, enhancing the perception of global information.
[0089] The parallel information flow method has high computational efficiency. The features processed by the neck layer do not change their shape and can be embedded in any convolutional network as a feature enhancement module.
[0090] Step S24: input the preset output and the aggregated features into a decoder to obtain a segmentation map and a probability map.
[0091] It should be noted that the decoder has high semantic information and high spatial structure information input, and can segment continuous lane line targets with clear boundaries.
[0092] Lane lines have obvious boundary features, and accurate boundary segmentation is extremely important for lane departure warning, adaptive cruise control, etc. The aggregated features output by the neck layer can largely alleviate the problem of poor segmentation caused by the lack of visual cues. Deep networks can encode rich semantic information, but they will lose many detailed geometric boundary features, which is not conducive to clear boundary segmentation. Therefore, in addition to receiving the output of the neck layer, the decoder also receives the low-level, high-resolution output of the backbone network, which contains more spatial geometric information.
[0093] In a feasible implementation manner, step S24 includes steps S241 to S245:
[0094] Step S241: input the preset output and the aggregated features into a decoder, and upsample the aggregated features through the decoder to obtain sampled features.
[0095] The preset output and aggregate features are input to the decoder, and the aggregate features output by the neck layer are upsampled by 4 times.
[0096] It should be noted that in deep learning and image processing, upsampling (also known as upsampling) is a commonly used technique to increase the resolution of an image to a higher size. 4x upsampling refers to the process of increasing the resolution of an image by 4 times in each dimension (width and height).
[0097] Step S242, splicing the preset output with the sampling feature to obtain a spliced feature.
[0098] Extract the preset output corresponding to the resolution of the aggregated feature, reduce its channel dimension through 1x1 convolution, and concatenate it with the sampled feature. Use 3x3 convolution for feature fusion, and the fused and spliced features are the concatenated features.
[0099] It should be noted that in deep learning, it is a common practice to use 3x3 convolution kernels for feature fusion. 3x3 convolution kernels are favored for their balance between efficiency and performance. In the process of feature fusion, 3x3 convolution kernels can help the model capture local features and build deeper feature representations by stacking multiple convolution layers. Feature fusion usually involves merging feature maps of different scales or layers to enhance the model's ability to capture information of different scales. 1x1 convolution, also known as pointwise convolution, is a special convolution operation with a convolution kernel size of 1x1. Its main functions include channel dimension adjustment, feature fusion, reducing the number of parameters, increasing nonlinearity, and reducing computational complexity.
[0100] Step S243: convert the splicing features into a preset resolution through bilinear upsampling to obtain preset resolution features.
[0101] It should be noted that bilinear upsampling is an upsampling technique commonly used in deep learning and image processing, especially when it is necessary to enlarge the image or feature map. It works by performing linear interpolation in two directions (horizontally and vertically) to obtain smoother image edges and finer image details. The preset resolution is the resolution of the aggregated features output by the neck layer.
[0102] Step S244, adding a convolution layer to the preset resolution feature to obtain a lane line segmentation map.
[0103] It should be noted that in deep learning and image processing, adding a convolutional layer usually refers to using a convolutional layer in a neural network to extract image features. The convolutional layer is the basic building block in a convolutional neural network (CNN), which can capture local features in an image, such as edges, textures, etc.
[0104] After adding a convolutional layer to the preset resolution features, the segmentation result is obtained, that is, the segmentation map of the lane lines, with a shape of B x Cls x H x W, where B is the batch size, Cls is the predefined maximum number of lane lines and background categories, and H and W are the height and width of the image, respectively. The maximum number of lane lines is statistically derived from the collected vehicle-mounted data set.
[0105] Step S245, predicting the existence and probability distribution of lane lines according to the segmentation graph, and obtaining a probability graph of the existence of lane lines.
[0106] The existence and probability distribution of lane lines are predicted through the segmentation map to obtain a prediction map. The prediction map is processed into the shape of B x(Cls-1) using average pooling and fully connected layers in sequence. Cls-1 represents the number of lane lines to be detected, and a probability map of the existence of lane lines is obtained. The value of the probability map is the score of whether each lane line exists or not.
[0107] It should be noted that Average Pooling is a commonly used pooling operation in deep learning and computer vision. It is used in convolutional neural networks (CNN) to reduce the spatial dimension of feature maps while retaining important feature information. Average pooling achieves downsampling by calculating the average value of local areas on feature maps, which helps to reduce the number of parameters and computational complexity of the model while improving the invariance of features. Fully connected layer (Fully Connected Layer, also known as Dense Layer) is a common layer type in neural networks, mainly used to process one-dimensional data. In image processing, the fully connected layer is usually located at the end of the convolutional neural network (CNN) to convert the two-dimensional feature maps extracted by the previous convolutional layer and pooling layer into the final output, such as the prediction of categories in classification tasks.
[0108] By processing the outputs of the backbone network and the neck layer through the decoder, the ability of the deep learning model to distinguish between the detected target and the background is enhanced, and clear segmentation boundaries are modeled.
[0109] This embodiment provides a lane line semantic segmentation detection method, which inputs the image data into a detection model; extracts the features of the image data through the backbone network in the detection model to obtain a feature image and a preset output; slices and circulates the feature image through the neck layer to obtain aggregated features; inputs the preset output and the aggregated features into a decoder to obtain a segmentation map and a probability map, thereby achieving the segmentation of continuous lane line targets with clear boundaries, alleviating the impact of the lack of visual clues, and facilitating the transplantation and deployment of embedded terminals.
[0110] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 , step S30 includes steps S31-S32:
[0111] Step S31, adjusting the network parameters of the segmentation map and the probability map to obtain an adjusted parameter segmentation map and an adjusted parameter probability map.
[0112] It should be noted that the network parameters of an image usually refer to a series of parameters used to process the image when building a convolutional neural network (CNN), which includes the loss function.
[0113] Adjust the loss functions of the segmentation map and probability map, update their network parameters, and obtain the adjusted parameter segmentation map and adjusted parameter probability map.
[0114] In a feasible implementation manner, step S31 includes steps S311 to S314:
[0115] Step S311, using a first loss function to calculate the error between the segmentation value of the segmentation map and the instance true value to obtain the instance prediction loss.
[0116] It should be noted that the first loss function is the cross-entropy loss function. The cross-entropy loss function (Cross-Entropy Loss), also known as logarithmic loss (Log Loss), is one of the commonly used loss functions in machine learning and deep learning. It measures the difference between two probability distributions. It is usually used to measure the difference between the probability distribution predicted by the model and the probability distribution of the true label. The ground truth refers to the real and accurate label or value for a given data sample, that is, the annotation on the image data.
[0117] The cross entropy loss function is used to calculate the error between the segmentation value of the segmentation map and the instance true value to obtain the instance prediction loss. The formula is as follows:
[0118]
[0119] Among them, LCE is the calculated loss value, ∑ represents the sum of the losses of all categories, y is a one-hot encoded true label vector, the correct category element is 1, and the other elements are 0, p is the probability distribution vector predicted by the model, M is the total number of elements, and the cth element p c is the probability that the model predicts class c.
[0120] Step S312, using a second loss function to calculate the error between the probability map and whether a true value exists, and obtain a lane line existence prediction loss.
[0121] It should be noted that the second loss function is BCEWithLogitsLoss. BCEWithLogitsLoss is a loss function used for binary classification problems in PyTorch. It combines the Sigmoid activation function and the Binary Cross-Entropy (BCE) loss function, and processes the Sigmoid activation internally to avoid the numerical instability that may occur when calculating the logarithm when the probability is close to 0 or 1, making BCEWithLogitsLoss better than using BCELoss alone in terms of numerical stability. Whether there is a true value is the true value for judging whether the lane line exists.
[0122] BCEWithLogitsLoss is used to calculate the error between the value of the probability map and whether there is a true value, and the lane line prediction loss is obtained. The formula is as follows:
[0123]
[0124] Among them, Loss is the calculated loss value, y is the true label 0 or 1, is the predicted probability, and ∑ represents the sum of the losses for all categories.
[0125] Step S313, calculating a weighted sum of the instance prediction loss and the lane line existence prediction loss to obtain a weighted loss.
[0126] It should be noted that the calculation of weighted sum is used to deal with the problem of category imbalance in the data set, or to give different importance to the losses of different tasks in multi-task learning. This method weights the losses of different samples or different tasks so that the model can pay more attention to those samples or tasks that are more important or more difficult to learn during training.
[0127] Step S314, calculating the gradient of the weighted loss through back propagation, updating the network parameters of the segmentation map and the probability map until the network converges, and obtaining the parameter-adjusted segmentation map and the parameter-adjusted probability map.
[0128] It should be noted that backpropagation is the core algorithm for training neural networks in deep learning. It updates the network weights by calculating the gradient of the loss function with respect to the network parameters to minimize the loss function. Network convergence means that when training the neural network, the loss function value of the model no longer decreases significantly, or the performance indicators of the model (such as accuracy) no longer improve significantly, which means that the model has learned everything it can learn from the provided data.
[0129] The gradient is calculated using the derivative of the loss function (partial derivative of the loss with respect to the network parameters), starting from the output layer and going backwards through each layer of the network until the input layer. At each layer, the gradient is used to update the weights and bias terms. The chain rule is usually used to calculate the gradient of the parameters of each layer, and the optimizer is used to continuously update the network parameters, that is, the calculated gradient and the selected optimization algorithm (such as SGD, Adam, etc.) are used to update the weights and biases of the network. The above process is repeated until the stopping condition is met, that is, the network converges, such as reaching the maximum number of iterations or the loss drops below a certain threshold.
[0130] The network parameters of the segmentation map and probability map output by the detection model are adjusted through loss function training to improve the lane line detection performance.
[0131] Step S32: perform lane line detection based on the parameter adjustment segmentation map and the parameter adjustment probability map to obtain a lane line detection result.
[0132] It should be noted that the lane line detection result is specific lane line entity image data.
[0133] In a feasible implementation manner, step S32 includes steps S321 to S324:
[0134] Step S321, perform pixel search on the parameter adjustment segmentation map to obtain search results.
[0135] The position with the highest response value is searched every H / 20 rows on the segmentation map, and the searched position is used as the search result.
[0136] It should be noted that pixel search is the process of analyzing and operating the pixel-level features of an image in the field of image processing and computer vision, including the extraction of statistical features or structural features of each pixel in the image and its surrounding pixels to characterize the properties of the pixel. In image processing, finding the position with the highest response value usually involves feature detection, especially identifying key points or extreme points in the image. These key points or extreme points are often areas with significant features in the image, such as corners, edges or texture centers.
[0137] Step S322: perform threshold judgment on the parameter adjustment probability map to obtain a judgment result.
[0138] A threshold of 0.5 is set to act on the probability map. Positions where the value in the probability map is greater than the threshold are considered to have lane lines, and these positions are used as the judgment results.
[0139] Step S323, fitting the search result, the judgment result and the lane line instance through a preset function to obtain a lane line point.
[0140] It should be noted that the cubic spline function is a mathematical tool used for interpolation in numerical analysis. It approximates a set of data points through a series of cubic polynomial segments. Compared with simple polynomial interpolation, cubic spline interpolation provides a smooth curve between each data point. The cubic spline function is continuous over the entire data set and has continuous first-order and second-order derivatives, which makes the curve smoother and more natural, and can provide sufficient flexibility to describe the curved shape of lane lines on the road.
[0141] Combined with the search results, judgment results and lane line examples, the data points are fitted using cubic spline functions. Each spline function is defined between two adjacent data points to form a smooth curve segment to obtain the lane line points.
[0142] Step S324: taking the lane line point as the lane line detection result.
[0143] The fitted lane line points are used as lane line detection results and output as specific lane line entity image data.
[0144] By performing lane line inference on the model trained with the loss function, the segmentation map and probability map output by the model can be converted into specific lane line entity data.
[0145] This embodiment provides a lane line semantic segmentation detection method, which adjusts the network parameters of the segmentation map and the probability map to obtain a parameter-adjusted segmentation map and a parameter-adjusted probability map; performs lane line detection based on the parameter-adjusted segmentation map and the parameter-adjusted probability map to obtain a lane line detection result, thereby improving the accuracy of the lane line detection model.
[0146] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 6 , before step S20, steps S01 to S04 are included:
[0147] Step S01, obtaining a search data set.
[0148] It should be noted that the search dataset is a dataset used to evaluate the performance of the model under different hyperparameter settings.
[0149] Step S02: performing a hyper-parameter search on the multi-branch model based on the search data set to obtain hyper-parameter data.
[0150] It should be noted that a multi-branch model refers to a network that contains multiple parallel sub-networks or branches. Each branch can focus on different tasks or features. Hyperparameter search is the process of finding the best hyperparameter combination for the model to optimize model performance. Hyperparameter data is the parameter set before model training. It is different from the parameters obtained through training within the model. It only depends on the specific model structure and has nothing to do with the search data set. It is open source and can be directly loaded into the code environment.
[0151] Step S03: train the hyper-parameter data and embed the trained hyper-parameter data into the optimizer of the multi-branch model.
[0152] It should be noted that the optimizer is a key component used to update model parameters in machine learning and deep learning to minimize or maximize the objective function (usually the loss function). The optimizer guides the direction and magnitude of parameter updates by calculating the gradient.
[0153] Step S04, performing gradient reparameterization processing on the multi-branch model to obtain a detection model.
[0154] It should be noted that in deep learning and neural network training, gradient reparameterization of multi-branch models is an optimization technique that can convert the structure of the model between the training and inference stages to improve the performance and efficiency of the model. This technique is usually used to solve the gradient vanishing or exploding problems that multi-branch models may encounter during training, while maintaining the simplicity and efficiency of the model during inference. The key to gradient reparameterization is to convert the complex multi-branch structure in the training stage into a single-branch structure in the inference stage. The advantages of the multi-branch structure, such as better gradient flow and representation capabilities, can be used during training, while the high efficiency of the single-branch structure can be used during inference.
[0155] The multi-branch model is gradient reparameterized and simplified into a simple direct connection structure. All other operators are converted into 3x3 convolutions to help reduce the complexity and computational complexity of the model while maintaining the performance of the network. All residual connections are removed to simplify the network structure and improve the stability of the model, thus obtaining a detection model for lane line semantic segmentation detection.
[0156] In addition, it should be noted that 3x3 convolution refers to the use of a 3x3 convolution kernel to perform a convolution operation on an image or feature map. Residual connection is a technique used in deep learning to solve the gradient vanishing problem and improve network training efficiency. By adding cross-layer connections in the network, the input can directly skip the calculation of certain layers and be added to the output of the subsequent layers, thus forming a shortcut path, which helps the flow of information in the network, retains more original information, and reduces information loss.
[0157] This embodiment provides a lane line semantic segmentation detection method, which obtains a search data set; performs a hyper-parameter search on a multi-branch model based on the search data set to obtain hyper-parameter data; trains the hyper-parameter data and embeds the trained hyper-parameter data into the optimizer of the multi-branch model; performs gradient reparameterization processing on the multi-branch model to obtain a detection model, thereby providing a more efficient model for subsequent lane line detection.
[0158] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the lane line semantic segmentation detection method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0159] This application also provides a lane line semantic segmentation detection device, please refer to Figure 7 , the device comprises:
[0160] The data acquisition module 10 is used to acquire image data.
[0161] The model design module 20 is used to input the image data into the detection model to obtain a segmentation map and a probability map. The detection model includes a backbone network, a neck layer and a decoder. The neck layer has an information flow function.
[0162] The lane line detection module 30 is used to perform lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
[0163] In one embodiment, the model design module 20 is also used to input the image data into the detection model; extract the features of the image data through the backbone network in the detection model to obtain a feature picture and a preset output; slice and circulate the feature picture through the neck layer to obtain aggregated features; input the preset output and the aggregated features into the decoder to obtain a segmentation map and a probability map.
[0164] In one embodiment, the model design module 20 is also used to input the preset output and the aggregated features into a decoder, and upsample the aggregated features through the decoder to obtain sampling features; splice the preset output and the sampling features to obtain spliced features; convert the spliced features into a preset resolution through bilinear upsampling to obtain preset resolution features; add a convolution layer to the preset resolution features to obtain a segmentation map of the lane lines; predict the existence and probability distribution of the lane lines according to the segmentation map to obtain a probability map of the existence of the lane lines.
[0165] In one embodiment, the lane line detection module 30 is also used to adjust the network parameters of the segmentation map and the probability map to obtain an adjusted parameter segmentation map and an adjusted parameter probability map; perform lane line detection based on the adjusted parameter segmentation map and the adjusted parameter probability map to obtain a lane line detection result.
[0166] In one embodiment, the lane line detection module 30 is also used to use a first loss function to calculate the error between the segmentation value of the segmentation map and the instance true value to obtain the instance prediction loss; use a second loss function to calculate the error between the probability map and the true value whether it exists to obtain the lane line existence prediction loss; calculate the weighted sum of the instance prediction loss and the lane line existence prediction loss to obtain the weighted loss; calculate the gradient of the weighted loss through backpropagation, update the network parameters of the segmentation map and the probability map until the network converges, and obtain the parameter adjustment segmentation map and the parameter adjustment probability map.
[0167] In one embodiment, the lane line detection module 30 is also used to perform pixel search on the parameter segmentation map to obtain search results; perform threshold judgment on the parameter probability map to obtain judgment results; fit the search results, the judgment results and the lane line instance through a preset function to obtain lane line points; and use the lane line points as lane line detection results.
[0168] In one embodiment, the model design module 20 is also used to obtain a search data set; perform a hyperparameter search on the multi-branch model based on the search data set to obtain hyperparameter data; train the hyperparameter data and embed the trained hyperparameter data into the optimizer of the multi-branch model; perform gradient reparameterization processing on the multi-branch model to obtain a detection model.
[0169] The lane line semantic segmentation detection device provided by the present application adopts the lane line semantic segmentation detection method in the above embodiment, which can solve the technical problem of how to improve the performance and efficiency of the lane line detection model and alleviate the impact of the lack of visual clues. Compared with the prior art, the lane line semantic segmentation detection device provided by the present application has the same beneficial effects as the lane line semantic segmentation detection method provided by the above embodiment, and the other technical features in the lane line semantic segmentation detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0170] The present application provides a lane line semantic segmentation detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the lane line semantic segmentation detection method in the above-mentioned embodiment one.
[0171] Reference below Figure 8 , which shows a schematic diagram of the structure of a lane line semantic segmentation detection device suitable for implementing the embodiment of the present application. The lane line semantic segmentation detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The lane semantic segmentation detection device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0172] like Figure 8As shown, the lane line semantic segmentation detection device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the lane line semantic segmentation detection device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the lane line semantic segmentation detection device to communicate wirelessly or wired with other devices to exchange data. Although the lane line semantic segmentation detection device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or provided alternatively.
[0173] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0174] The lane line semantic segmentation detection device provided by the present application adopts the lane line semantic segmentation detection method in the above embodiment, which can solve the technical problem of how to improve the performance and efficiency of the lane line detection model and alleviate the impact of the lack of visual clues. Compared with the prior art, the lane line semantic segmentation detection device provided by the present application has the same beneficial effects as the lane line semantic segmentation detection method provided by the above embodiment, and the other technical features in the lane line semantic segmentation detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0175] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0176] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0177] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the lane line semantic segmentation detection method in the above-mentioned embodiment.
[0178] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0179] The above-mentioned computer-readable storage medium may be included in the lane line semantic segmentation detection device; or it may exist independently without being assembled into the lane line semantic segmentation detection device.
[0180] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the lane line semantic segmentation detection device, the lane line semantic segmentation detection device: obtains image data; inputs the image data into the detection model to obtain a segmentation map and a probability map, the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function; performs lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
[0181] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0182] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0183] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0184] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned lane line semantic segmentation detection method, and can solve the technical problem of how to improve the performance and efficiency of the lane line detection model and alleviate the impact of the lack of visual clues. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the lane line semantic segmentation detection method provided in the above-mentioned embodiment, and will not be repeated here.
[0185] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the lane line semantic segmentation detection method as described above.
[0186] The computer program product provided by this application can solve the technical problem of how to improve the performance and efficiency of the lane detection model and alleviate the impact of the lack of visual cues. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the lane semantic segmentation detection method provided by the above embodiment, which will not be repeated here.
[0187] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A lane semantic segmentation detection method, characterized in that: The method comprises: Get image data; Inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function; Lane line detection is performed according to the segmentation map and the probability map to obtain a lane line detection result.
2. The method according to claim 1, characterized in that The step of inputting the image data into the detection model to obtain a segmentation map and a probability map comprises: Inputting the image data into a detection model; Extracting features of the image data through the backbone network in the detection model to obtain feature images and preset outputs; Slicing and information circulation of the feature image are performed through the neck layer to obtain aggregated features; The preset output and the aggregated features are input into a decoder to obtain a segmentation map and a probability map.
3. The method according to claim 2, characterized in that The step of inputting the preset output and the aggregated features into a decoder to obtain a segmentation map and a probability map comprises: Inputting the preset output and the aggregated features into a decoder, and upsampling the aggregated features through the decoder to obtain sampled features; Splicing the preset output with the sampling feature to obtain a spliced feature; Converting the spliced features to a preset resolution by bilinear upsampling to obtain a preset resolution feature; Adding a convolution layer to the preset resolution feature to obtain a lane line segmentation map; The existence and probability distribution of lane lines are predicted according to the segmentation map to obtain a probability map of the existence of lane lines.
4. The method according to claim 1, characterized in that The step of performing lane line detection according to the segmentation map and the probability map to obtain a lane line detection result comprises: Adjusting the network parameters of the segmentation map and the probability map to obtain a parameter-adjusted segmentation map and a parameter-adjusted probability map; Lane line detection is performed according to the parameter adjustment segmentation map and the parameter adjustment probability map to obtain a lane line detection result.
5. The method according to claim 4, characterized in that The step of adjusting the network parameters of the segmentation map and the probability map to obtain the parameter-adjusted segmentation map and the parameter-adjusted probability map comprises: Using a first loss function to calculate the error between the segmentation value of the segmentation map and the instance true value, to obtain the instance prediction loss; The second loss function is used to calculate the error between the probability map and whether there is a true value, and the lane line existence prediction loss is obtained; Calculating a weighted sum of the instance prediction loss and the lane line existence prediction loss to obtain a weighted loss; The gradient of the weighted loss is calculated by back propagation, and the network parameters of the segmentation map and the probability map are updated until the network converges to obtain the parameter-adjusted segmentation map and the parameter-adjusted probability map.
6. The method according to claim 4, characterized in that The step of performing lane line detection according to the parameter adjustment segmentation map and the parameter adjustment probability map to obtain a lane line detection result comprises: Perform pixel search on the parameter adjustment segmentation map to obtain search results; Performing threshold judgment on the parameter adjustment probability map to obtain a judgment result; Fitting the search result, the judgment result and the lane line instance by a preset function to obtain a lane line point; The lane line point is used as the lane line detection result.
7. The method according to claim 1, characterized in that The step of inputting the image data into the detection model to obtain the segmentation map and the probability map includes: Get the search dataset; Performing a hyper-parameter search on the multi-branch model based on the search data set to obtain hyper-parameter data; Training the hyper-parameter data, and embedding the trained hyper-parameter data into the optimizer of the multi-branch model; The multi-branch model is subjected to gradient reparameterization processing to obtain a detection model.
8. A lane line semantic segmentation detection device, characterized in that: The device comprises: A data acquisition module, used for acquiring image data; A model design module, used for inputting the image data into a detection model to obtain a segmentation map and a probability map, wherein the detection model includes a backbone network, a neck layer and a decoder, and the neck layer has an information flow function; The lane line detection module is used to perform lane line detection according to the segmentation map and the probability map to obtain a lane line detection result.
9. A lane line semantic segmentation detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the lane line semantic segmentation detection method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the lane line semantic segmentation detection method according to any one of claims 1 to 7 are implemented.