# A Robust Detection Method for Multilane Lines in Complex Traffic Scenes

Authors: Xiang Song; Xiaoyu Che; Huilin Jiang; Shun Yan; Ling Li; Chunxiao Ren; Hai Wang
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

The robustness and stability of lane detection is vital for advanced driver assistance vehicle technology and even autonomous driving technology. To meet the challenges of real-time lane detection in complex traffic scenes, a simple but robust multilane detection method is proposed in this paper. The proposed method breaks down the lane detection task into two stages, that is, lane line detection algorithm based on instance segmentation and lane modeling algorithm based on adaptive perspective transform. Firstly, the lane line detection algorithm based on instance segmentation is decomposed into two tasks, and a multitask network based on MobileNet is designed. This algorithm includes two parts: lane line semantic segmentation branch and lane line Id embedding branch. The lane line semantic segmentation branch is mainly used to obtain the segmentation results of lane pixels and reconstruct the lane line binary image. The lane line Id embedding branch mainly determines which pixels belong to the same lane line, thereby classifying different lane lines into different categories and then clustering these different categories. Secondly, the adaptive perspective transformation model is adopted. In this model, the motion information is used to accurately convert the original image into a bird’s-eye view image, and then the least-squares second-order polynomial fitting is performed on the lane line pixels. Finally, experiments on the CULane dataset show that the proposed method achieved similar or better performance compared with several state-of-the-art methods, the F1 score of the proposed method in the normal test set and most challenge test sets is better than other algorithms, which verifies the effectiveness of the proposed method, and then the field experiments results show that the proposed method has good practical application value in various complex traffic scenes.


---

## Body

## 1. Introduction

Vehicle and road safety has been a key issue for the communities and governments [1]. With emerging new technologies and knowledge, advanced driver assistance systems (ADAS) have been proposed to reduce road accidents and improve vehicle safety [2]. In ADAS and even autonomous driving vehicles, the main technical bottleneck is the perception problem, which has two elements: road and lane perception and obstacle detection [3].The robustness and stability of lane detection is vital for advanced driver assistance vehicle technology and even unmanned technology [4]. Firstly, lane detection and tracking aids in localizing the ego-vehicle motion, which is one of the very first and primary steps in most ADAS, such as lane departure warning (LDW) and lane change assistance. Furthermore, lane detection is also able to aid other ADAS modules such as vehicle detection and driver intention perception.At present, a large number of research results have been achieved in the research of lane detection at home and abroad. The lane detection methods nowadays usually contain two main steps: (1) lane feature extraction and (2) lane modeling [3, 5, 6]. Generally, the lane detection methods can be divided into three categories: (1) traditional lane detection methods, (2) image processing method combined with deep learning, and (3) end-to-end lane line detection method.The traditional lane line detection method can be divided into three steps [7, 8]. Firstly, the road image data is preprocessed to remove the noise and to obtain the lane line features; then, the lane line is detected from the preprocessed image by means of feature-based or model-based methods; finally, the detection results are fitted to convert the lane lines represented by image coordinates into world coordinates. Aly [9] proposed a real-time and robust model-based detection method for urban road lane lines. IPM is used to convert the front view into a top view, and then the selective directional Gaussian filter is used to filter to check the lines in the image and deal with other abnormal lines. Finally, the lane line is simulated in the front view by mapping. Bounini et al. [10] proposed a feature-based lane line detection method in virtual simulation environment. In the initialization stage, the method integrates Hough transform, Canny edge detection, and Kalman filter to greatly reduce the region of interest and predict the lane line in the future. Overall, the feature-based method has higher computational efficiency but poor robustness. Compared with the feature-based method, the model-based method is more stable, but it is difficult to implement, and the calculation is huge.The lane line detection method combined with deep learning [11] can extract features from various types of complex environments, which breaks through the limitations of traditional image processing methods. Amayo et al. [12] designed a target classification method based on the extracted lane line geometric elements. Firstly, weakly supervised neural network is used to extract lane line elements under different conditions; then, the global energy optimization method is used to retrieve and cluster the lane geometry, and the corresponding semantic categories are given. Finally, the tracking effect of continuous frame images is optimized to improve the stability of classification effect. Song et al. [13] designed a lane line detection and classification system based on 3D vision. Firstly, the lane line is extracted from the ROI region by the Sobel filter; then, an adaptive lane line model is designed in Hough space to further extract lane lines; finally, the convolution neural network is used to obtain the specific classification results.Due to the rapid development of deep learning [14–16], researchers prefer to use end-to-end methods to solve computer vision problems [17]. As shown in Figure 1, the initial picture is input into the model, and the desired result can be obtained through the end-to-end method. The method of lane line detection based on end-to-end deep learning technology can increase the accuracy of lane line recognition in a complex environment and simplify the steps of two coordinate system transformation, that is, the transformation between pixel coordinate system and world coordinate system, thus increasing the robustness of lane line detection. Li et al. [18] proposed an end-to-end system called line-CNN to realize the lane line detection method, which uses the straight-line anchor to locate the precise position of the lane line. In this paper, the semantic information of the whole lane line at the global level is considered. Van Gansbeke et al. [19] showed a method to realize lane line detection by solving the weighted least-squares problem, which is specifically divided into two parts. One part is to predict the weight of pixels of each lane line by using the depth convolution network, and the other part is to use the differentiable least-squares fitting module to return the parameters of the best fitting curve of lane line features. Generally, the end-to-end method does not need image preprocessing and manual feature extraction, and the experimental results have great advantages in accuracy and robustness.Figure 1
End-to-end lane line detection method.Although many novel end-to-end methods have been proposed to deal with lane detection applications and have achieved very good performance, they are usually implemented in high-performance PC or embedded systems so that those methods can use a complicated algorithm and utilize big storage space. However, automotive companies are very sensitive to hardware cost, so they more prefer lane detection method that can be used in low cost and resource-limited platforms. Meanwhile, the complexity and uncertainty of road conditions has led to the fact that there is still room for improvement of existing local methods. The challenges include shadows cast from trees, other vehicles and buildings, invisible or defect lanes, highlight, strange lane shapes, and bad quality lines.To meet the challenges of real-time lane detection in complex traffic scenes, a simple but robust multilane detection method is proposed for the resource-limited automotive embedded platform in this paper. The proposed method breaks down the lane detection task into two stages, that is, lane line detection algorithm based on instance segmentation and lane modeling algorithm based on adaptive perspective transform model. The main contributions can be listed as follows:(1)
The multilane line detection is considered as an instance segmentation problem in this paper, and a deep learning network is designed to solve the problems of uncertain number of lanes and lane change. The lane detection problem is decomposed into two tasks, that is, lane line semantic segmentation branch and lane line Id embedding branch, and a multitask network based on MobileNet [20] is designed to shorten the forward propagation calculation time without loss of detection accuracy. In MobileNet, a convolution method called depthwise separable convolution is used to replace traditional convolution methods to reduce the network weight parameters. By sharing the first four coding processes between the two tasks, the calculation speed and the accuracy of lane line segmentation are improved. Meanwhile, by fully considering the semantic characteristics of the encoding and decoding process, the strategy of fusing the corresponding encoded information during decoding is adopted to improve the accuracy of lane segmentation.(2)
An adaptive perspective transformation model is designed to overcome the disadvantage that the conventional perspective transformation model is only suitable for smooth roads, and the image will be distorted when the vehicle is driving on the uneven road or the pitch angle of the camera changes due to turbulence. The adaptive perspective transformation model overcomes the deficiency of the transformation matrix with fixed parameters in the traditional model and can realize the accurate conversion from the camera image to the bird’s-eye view under the camera motion state so as to improve the robustness of lane line fitting.The remainder of the paper proceeds as follows. The lane detection method is given in Section2. Section 3 presents the lane line detection algorithm based on instance segmentation. Section 4 is devoted to the adaptive perspective transform model. Section 5 shows the experimental results and analysis. Section 6 gives the conclusion.


## 2. Overview of the Proposed Multilane Line Detection Method

In this paper, the multilane line detection is considered as an instance segmentation problem. Each lane line is formed into a separate category, and then each lane line is fitted. In order to increase the running speed, improve the detection accuracy, and meet the requirements of real vehicle applications, the lane detection problem is decomposed into two tasks, and a multitask network based on MobileNet is designed for lane line segmentation. The multitask network includes two branches: lane line semantic segmentation branch and lane line Id embedding branch. The lane line semantic segmentation branch is mainly used to obtain the segmentation results of lane pixels and reconstruct the lane line binary image. The lane line Id embedding branch mainly determines which pixels belong to the same lane line, thereby classifying different lane lines into different categories and then clustering these different categories.After completing the lane line instance segmentation, these pixels belonging to the lane line need to be parametric curve fitting. Curve fitting refers to the process of finding an appropriate function that fits a finite set of data points. The commonly used curve fitting models include Bayesian fitting [21], B-spline curve fitting [22], and least-square curve fitting [23]. Generally, in order to improve the accuracy of fitting, the fixed perspective transformation model [9, 24] is commonly used to convert the image into a bird’s-eye view for curve fitting. However, the algorithm is only suitable for smooth roads. When the road is uneven or the vehicle is bumpy, the image will move and be distorted, resulting in large errors in the conversion into a bird’s-eye view. To solve this problem, the adaptive perspective transformation model is designed. In this model, the motion information is used to accurately convert the original image into a bird’s-eye view image, and then the least-squares second-order polynomial fitting algorithm is performed on the lane line pixels. Compared with the traditional fixed perspective transformation, this model has better robustness. The specific process of lane line detection is shown in Figure 2.Figure 2
The flowchart of multilane line detection algorithm.


## 3. Lane Line Detection Algorithm Based on Instance Segmentation

In this paper, MobileNet is designed to train an instance segmentation model for lane line detection. Its advantage is that it can solve the problem of uncertain number of lanes and lane change. The instance segmentation is composed of two branches: (1) lane semantic segmentation, which is used to obtain the lane line binary image; (2) lane line Id allocation, which is used to determine the pixels that belong to the same lane line.To improve the calculation speed and the accuracy of lane line segmentation, the two-branch algorithm, for instance, segmentation, shares the first four coding processes. To ensure the real-time performance of the multilane line detection algorithm, the input image is converted into a512×256 pixel format for network learning. The encoding-decoding structure of the network is shown in Figure 3.Figure 3
The encoding-decoding structure.To meet the cost requirements of in-vehicle computing, MobileNet is adopted as an encoding structure to shorten the forward propagation calculation time without loss of detection accuracy. In the encoding process, the semantic feature information is less, and the lane line position is accurate, while the semantic feature information in the decoding process is richer, and the lane line position information is relatively rough. Therefore, similar to the ENet [25], the corresponding encoded information is fused during the decoding process to improve the accuracy of lane line segmentation.


### 3.1. MobileNet

As a representative of lightweight convolutional networks, the core idea of MobileNet is to use a convolution method called depthwise separable convolution instead of traditional convolution methods to reduce the network weight parameters. The depthwise separable convolutions divide standard convolution into two steps. The first step is depthwise convolution, that is, channel-by-channel convolution. In depthwise convolution, one convolution kernel is only responsible for one channel, and one channel is “filtered” by only one convolution kernel. The second step is pointwise convolution, which is to “string” the results obtained by the first step. Assuming that, in standard convolution, the size of the input feature map isDF×DF, the number of input channels is M, the number of output channels is N, and the size of the convolution kernel is DK×DK; then the calculation amount of standard convolution is(1)DF×DF×DK×DK×M×N.In MobileNet, the depthwise separable convolution is obtained by the two-part standard convolution solution, and the convolution kernel size isDK×DK and 1×1, respectively. Then, the calculation amount of the depth separable convolution is(2)DK×DK×M×DF×DF+M×N×DF×DF.As an example, Figure4 is a schematic diagram of a standard convolution where the input feature map size is 5×5, the number of input channels is 3, the number of output channels is 4, and the size of the convolution kernel is 1×1. Figure 5 is a schematic diagram of the depthwise separable convolution where the input feature map size is 5×5, the number of input channels is 3, the number of output channels is 4, and the size of the convolution kernel is 3×3 and 1×1, respectively.Figure 4
The standard convolution.Figure 5
Depthwise separable convolution.From (1)and (2), it can be seen that the ratio of the parameter calculation amount of the depthwise separable convolution and the standard convolution under the same input and output feature map size is(3)DK×DK×M×DF×DF+M×N×DF×DFDF×DF×DK×DK×M×N=1N+1DK2.In order to compare the performance of convolutional neural networks using standard convolution and depthwise separable convolution, these two networks were used for training and testing on the ImageNet dataset in [20]. The results show that, in terms of accuracy, using standard convolution is 1.1% higher than using depth separable convolution, but in terms of calculation amount and parameter amount, the former is 8–9 times the latter. From [20], we can conclude that the use of deep separable convolution can greatly reduce the amount of calculation and the number of parameters while basically ensuring the accuracy. Correspondingly, it can reduce the difficulty of network model training, reduce training time, and reduce the performance requirements of hardware devices.


### 3.2. Lane Line Semantic Segmentation Branch

The purpose of lane line semantic segmentation is to obtain the segmentation result of lane pixels and reconstruct the binary image of the lane line, and then determine which pixels belong to the lane line. Due to the extreme imbalance between the lane pixels and the background pixels, the focal loss function [26] is used for model training, and the specific lane line pixel segmentation loss function formula is as follows:(4)Lseg=−1nc×h×w∑c=1nc∑y=1h∑x=1wα1−s^c,x,yγlogs^c,x,yifsc,x,y=1,−1nc×h×w∑c=1nc∑y=1h∑x=1w1−αs^c,x,yγlog1−s^c,x,yifsc,x,y=0,where sc,x,y indicates whether the pixel x,y belongs to category c, that is, sc,x,y=1ifx,y∈c0ifx,y∉c; s^c,x,y represents the probability that pixel x,y is predicted to be category c; nc is the number of segmentation categories, nc=2; h and w are the length and width of the output prediction image, respectively; γ represents the focus parameter. To increase the weight of the pixels that are difficult to classify, the weight of the pixels that are easy to classify becomes smaller so that the network can pay more attention to the pixels that are difficult to learn; in this paper, γ=2. α refers to the weighting parameter of the lane line category. α is mainly used to solve the problem of the uneven number of pixels in each category. The mathematical calculation formula of α is(5)α=1ln1.02+n/m,where n represents the number of lane line pixels; m indicates the total number of pixels.


### 3.3. Lane Line Id Embedding Branch

The lane line Id embedding branch mainly determines which pixels belong to the same lane line. First, the vector value corresponding to each pixel is output by the encoder. Then the pixels are clustered according to the feature that the vector distances of the pixel points of the same lane line are close, and the vector distances of the pixels of different lane lines are relatively far. Finally, the pixels belonging to the same lane line are determined. The clustering loss functionL consists of two parts, L1 and L2. L1 is used to cluster the pixels belonging to the same lane line to the center point according to the embedded pixel point vector value. L2 is used to move pixels that do not belong to a lane line as far away as possible according to the embedded pixel vector value. There are NN−1/2 groups of different lane lines, and the clustering loss function L is(6)L1=1N∑1N1Nc∑1Ncμc−xi−0.62,L2=NN−12∑1NN−1/26−μi−μj2N≥2,i≠j,0N=1,L=L1+L2,where N is the number of lane lines; Nc is the number of pixels of a lane line; μc is the mean vector value embedded in pixels of a certain lane line; xi is the embedding vector of a certain pixel; μi and μj are the mean vectors embedded in the pixels of two different lane lines i and j.In the inference stage, the DBSCAN clustering algorithm [27] is used to cluster each pixel. The DBSCAN method is a clustering algorithm based on high-density connected regions, which can divide regions with sufficiently high density into clusters and can find clusters of any shape in noisy data. The DBN method is used in this paper for clustering until all lane line pixels are assigned to the corresponding lanes. The cluster center is taken as the center of the circle, the radius is 0.28 m, and the minimum number of points in the domain is 180.


## 3.1. MobileNet

As a representative of lightweight convolutional networks, the core idea of MobileNet is to use a convolution method called depthwise separable convolution instead of traditional convolution methods to reduce the network weight parameters. The depthwise separable convolutions divide standard convolution into two steps. The first step is depthwise convolution, that is, channel-by-channel convolution. In depthwise convolution, one convolution kernel is only responsible for one channel, and one channel is “filtered” by only one convolution kernel. The second step is pointwise convolution, which is to “string” the results obtained by the first step. Assuming that, in standard convolution, the size of the input feature map isDF×DF, the number of input channels is M, the number of output channels is N, and the size of the convolution kernel is DK×DK; then the calculation amount of standard convolution is(1)DF×DF×DK×DK×M×N.In MobileNet, the depthwise separable convolution is obtained by the two-part standard convolution solution, and the convolution kernel size isDK×DK and 1×1, respectively. Then, the calculation amount of the depth separable convolution is(2)DK×DK×M×DF×DF+M×N×DF×DF.As an example, Figure4 is a schematic diagram of a standard convolution where the input feature map size is 5×5, the number of input channels is 3, the number of output channels is 4, and the size of the convolution kernel is 1×1. Figure 5 is a schematic diagram of the depthwise separable convolution where the input feature map size is 5×5, the number of input channels is 3, the number of output channels is 4, and the size of the convolution kernel is 3×3 and 1×1, respectively.Figure 4
The standard convolution.Figure 5
Depthwise separable convolution.From (1)and (2), it can be seen that the ratio of the parameter calculation amount of the depthwise separable convolution and the standard convolution under the same input and output feature map size is(3)DK×DK×M×DF×DF+M×N×DF×DFDF×DF×DK×DK×M×N=1N+1DK2.In order to compare the performance of convolutional neural networks using standard convolution and depthwise separable convolution, these two networks were used for training and testing on the ImageNet dataset in [20]. The results show that, in terms of accuracy, using standard convolution is 1.1% higher than using depth separable convolution, but in terms of calculation amount and parameter amount, the former is 8–9 times the latter. From [20], we can conclude that the use of deep separable convolution can greatly reduce the amount of calculation and the number of parameters while basically ensuring the accuracy. Correspondingly, it can reduce the difficulty of network model training, reduce training time, and reduce the performance requirements of hardware devices.


## 3.2. Lane Line Semantic Segmentation Branch

The purpose of lane line semantic segmentation is to obtain the segmentation result of lane pixels and reconstruct the binary image of the lane line, and then determine which pixels belong to the lane line. Due to the extreme imbalance between the lane pixels and the background pixels, the focal loss function [26] is used for model training, and the specific lane line pixel segmentation loss function formula is as follows:(4)Lseg=−1nc×h×w∑c=1nc∑y=1h∑x=1wα1−s^c,x,yγlogs^c,x,yifsc,x,y=1,−1nc×h×w∑c=1nc∑y=1h∑x=1w1−αs^c,x,yγlog1−s^c,x,yifsc,x,y=0,where sc,x,y indicates whether the pixel x,y belongs to category c, that is, sc,x,y=1ifx,y∈c0ifx,y∉c; s^c,x,y represents the probability that pixel x,y is predicted to be category c; nc is the number of segmentation categories, nc=2; h and w are the length and width of the output prediction image, respectively; γ represents the focus parameter. To increase the weight of the pixels that are difficult to classify, the weight of the pixels that are easy to classify becomes smaller so that the network can pay more attention to the pixels that are difficult to learn; in this paper, γ=2. α refers to the weighting parameter of the lane line category. α is mainly used to solve the problem of the uneven number of pixels in each category. The mathematical calculation formula of α is(5)α=1ln1.02+n/m,where n represents the number of lane line pixels; m indicates the total number of pixels.


## 3.3. Lane Line Id Embedding Branch

The lane line Id embedding branch mainly determines which pixels belong to the same lane line. First, the vector value corresponding to each pixel is output by the encoder. Then the pixels are clustered according to the feature that the vector distances of the pixel points of the same lane line are close, and the vector distances of the pixels of different lane lines are relatively far. Finally, the pixels belonging to the same lane line are determined. The clustering loss functionL consists of two parts, L1 and L2. L1 is used to cluster the pixels belonging to the same lane line to the center point according to the embedded pixel point vector value. L2 is used to move pixels that do not belong to a lane line as far away as possible according to the embedded pixel vector value. There are NN−1/2 groups of different lane lines, and the clustering loss function L is(6)L1=1N∑1N1Nc∑1Ncμc−xi−0.62,L2=NN−12∑1NN−1/26−μi−μj2N≥2,i≠j,0N=1,L=L1+L2,where N is the number of lane lines; Nc is the number of pixels of a lane line; μc is the mean vector value embedded in pixels of a certain lane line; xi is the embedding vector of a certain pixel; μi and μj are the mean vectors embedded in the pixels of two different lane lines i and j.In the inference stage, the DBSCAN clustering algorithm [27] is used to cluster each pixel. The DBSCAN method is a clustering algorithm based on high-density connected regions, which can divide regions with sufficiently high density into clusters and can find clusters of any shape in noisy data. The DBN method is used in this paper for clustering until all lane line pixels are assigned to the corresponding lanes. The cluster center is taken as the center of the circle, the radius is 0.28 m, and the minimum number of points in the domain is 180.


## 4. Adaptive Perspective Transform Model

After obtaining the clustered pixel point set of each lane line based on the lane line instance segmentation, the pixel points should be fitted. According to the imaging principle of the camera, the lane line will gradually converge into a point at a long distance, so the accuracy of the lane line fitting directly on the original image will be greatly reduced. In the commonly used improvement method, the picture is converted into a bird’s-eye view through a perspective transformation model to make the lane lines parallel so that the fitting accuracy is improved. However, in the conventional perspective transformation model, the transformation matrix with fixed parameters is adopted, which is only suitable for smooth road conditions. If the vehicle is driving on an uneven road or the pitch angle of the camera changes due to turbulence, the image will be distorted, which will affect the generated bird’s-eye view. Therefore, an adaptive perspective transformation model that can realize the accurate conversion of the camera image to the bird’s-eye view under the camera motion state is adopted.As shown in Figure6, the origin of the world coordinate system is defined as the point where the car’s center of mass is perpendicular to the ground, and the vertical distance between the camera installation position and the origin of the world coordinate system is h. According to the relationship between the world coordinate system O−X^Y^Z^, the camera coordinate system O2−c^r^, and the image pixel coordinate system O1−u^v^, the position of the pixel in the camera coordinate system can be expressed as(7)cu=Ku−n2,rv=Km2−v,where K is the conversion scale factor between the camera coordinate system and the image pixel coordinate system; m is the width of the image; n is the length of the image.Figure 6
Relationship between world coordinate system, camera coordinate system, and image pixel coordinate system.In order to better explain the parameters of the adaptive perspective transformation model, the lateral view structure of the adaptive perspective transformation model is established, as shown in Figure7. The x-axis in the world coordinate system can be written as a function of pixel points v, θ0, and θb:(8)Xv,b=hcotθ0+θb+θv,(9)θv=arctanrvfr,(10)fr=rvcotθv.Figure 7
The lateral view structure of the adaptive perspective transformation model.Whenv=m，θv is α. Substituting formula (7) into formula (10), fr can be obtained:(11)fr=K2−m2cotα.Substituting formulas (9) and (11) into (8),(12)Xv,b=htanθ0+θbm−2v/2−mtanα−1tanθ0+θb+m−2v/2−mtanα,where θ0 is the tilt angle of the camera; θb is the change value of the pitch angle when the camera bumps; θv is the angle value between the ground pixel and the camera; α is the half of the vertical field of view of the camera; fr is the vertical focal length of the camera.As shown in Figure8, the vertical view structure of the adaptive perspective transformation model is established, and the Yu,v,b axis in the world coordinate system can be expressed as(13)Yu,v,bXv,b=−cufh.Figure 8
The vertical view structure of the adaptive perspective transformation model.Whenu=n, θu is β. fh can be obtained from formula (13):(14)fh=cu=ntanβ=Kn2tanβ.Substituting formulas (12) and (14) into (13),(15)Yu,v,b=h1−2untanβtanθ0+θbm−2v/2−mtanα−1tanθ0+θb+m−2v/2−mtanα,where β is half of the horizontal field of view angle of the camera; fh is the horizontal focal length of the camera.Assumingz = 0, according to the relationship established among the world coordinate system, camera coordinate system, and pixel coordinate system, the coordinate changes of pixel coordinate u,v on the x-axis and y-axis in the world coordinate system are updated when the vehicle motion turbulence causes the change of camera pitch angle θb. Therefore, the influence of image motion distortion on aerial view image is reduced, and the adaptive perspective transformation model is more robust to camera motion.In the transformed aerial view, the pixels of the lane line are fitted by the second-order polynomial of the least-square algorithm, and the fitted curve is regressed to the original image so that the quadratic polynomial of the lane line in a real road scene is obtained.


## 5. Experimental Results and Analysis

The CULane dataset [13] was used to train and validate the proposed multilane line detection model, and then field experiments were conducted to verify the performance of the proposed model.


### 5.1. Experimental Environment Configuration

The algorithm design, training, and testing are based on the deep learning framework PyTorch. The experimental configuration used in this experiment is shown in Table1.Table 1
Experimental environment configuration parameters.
Hardware environmentGPUGeForce GTX 2080Ti dual card processorSoftware environmentMemory32GHard disk2TOperating systemUbuntu18.04Deep learning frameworkPyTorch 1.2.0Programming languagePython 3.6.2CUDA10.1CUDNN7.6


### 5.2. CULane Dataset

Although the multilane detection network based on deep learning has been able to extract lane line pixels effectively in simple traffic scenes with good weather conditions, it is still challenging for lane line detection in complex scenes. Therefore, it is very important for supervised learning that the lane dataset covers a wide range of traffic scenes and has high annotation quality.The challenging CULane dataset is used to train and validate the model, as shown in Figure9. CULane is a large scale challenging dataset for academic research on traffic lane detection. Only the two lane lines on the left and right of the current lane line are concerned by CULane, which are paid most attention to in real applications. Therefore, there are only four real lane lines labeled. The dataset is divided into 88880 for the training set, 9675 for the validation set, and 34680 for the test set. Table 2 shows the various scene information of the CULane dataset.Figure 9
CULane dataset.Table 2
The various scene information of the CULane dataset.
SceneScene descriptionImage proportion (%)NormalThe driving vision is good, and the lane markings are clearly visible27.7CrowdA large number of vehicles are moving slowly on the road, and the lane line is blocked by vehicles23.4NightVisibility is low at night, lane lines are blurred, and different lights interfere with each other20.3No lineNo lane markings, usually narrow roads, and many vehicles parked on the side of the road11.7ShadowUnder the sky bridge or viaduct, the light is dark, the shade of the trees or the shadow of the building2.7Strong lightVarious strong lights cause roadside reflections, and the lane lines on the road are not clear1.4CurveCurved lane line ahead1.2CrossroadInterference of zebra crossing markings at intersections, no lane markings in the middle of the intersection9.0ArrowThere are interference marks between lane lines such as going straight, turning, and turning around2.6It can be seen from Table1 that a total of 9 types of traffic scenes are included in CULane. Among them, the number of images in normal traffic scenes with clear lane lines accounted for 27.7% of the total dataset, while the number of images in complex road scenes with unclear lane lines or interference with lane lines due to various reasons accounted for 72.3% of the dataset. It shows that complex road scenes are more concerned in CULane, and it is also consistent with the proportion of various traffic scenes encountered in the actual driving process. Therefore, this dataset is more suitable for verifying the ability of the proposed method to detect lane lines in complex road scenes.


### 5.3. Model Training Process

#### 5.3.1. Data Processing Method

In order to ensure the real-time performance of the multilane line detection algorithm, the CULane input image is converted into an 800∗288 pixel format for network learning. The input data is normalized so that the value of the pixel is limited to the interval [0,1], which improves the computational efficiency of the model fitting process. The data augmentation strategies are used, including brightness conversion, horizontal flip, and overall image translation of 0∼2 pixels; an example is shown in Figure 10.Figure 10
Data augmentation.


#### 5.3.2. Model Training Parameters Setting

Taking into account the performance of the hardware platform used in this study, the training parameters are shown in Table3. In Table 3, batch size represents the number of training groups input for each iteration of training; epoch represents the training period of the whole training set; the learning rate decays exponentially to prevent gradient dispersion. In addition, in order to accelerate the convergence of the network, the MobileNet pretraining model is used to initialize the weight parameters of the unmodified part of the feature extraction network. The mainstream Glorot uniform distribution method is used for the initialization of other parameters.Table 3
Model training parameters.
ParameterDataThe size of the input image800∗288Epoch100Batch size16OptimizerAdamInitial learning rate1e-4


### 5.4. Training Result Analysis

To verify the performance of the proposed multilane line detection algorithm based on deep learning,F1 is used to judge whether a lane marking is successfully detected. The lane markings are viewed as lines with widths equal to 30 pixels, and the intersection over union (IoU) between the ground truth and the prediction is calculated. Predictions whose IoUs are larger than 0.5 are viewed as a correctly predicted lane line.(16)precision=TPTP+FP,recall=TPTP+FN,F1=2×precision×recallprecision+recall,where TP (true positives) is the number of lanes lines correctly predicted; FP (false positives) is the number of wrongly predicted lane lines; FN (false negatives) is the number of missed ground-truth lane lines.Based on the evaluation index ofF1, the effectiveness of the proposed algorithm and other multilane detection algorithms is analyzed. The experimental results are shown in Table 4.Table 4
Comparative experimental results of each improved part
MethodScene (%)NormalCrowdNightNo lineShadowHlightCurveArrowSCNN [28]90.669.666.143.466.958.564.484.1GCJ [29]89.776.568.735.165.567.463.282.2SAD [30]90.770.066.343.567.059.965.784.4Our91.272.869.745.168.864.466.385.2From Table4, it can be seen that the F1 score of the proposed method in the normal test set and most challenge test sets is better than other algorithms, which verifies the effectiveness of the proposed method.


### 5.5. Examples of Multilane Line Detection Results

Figure11 shows the multilane line detection results of the CULane dataset, and the curves of different colors represent the detected different lane lines. As can be seen from Figure 11, the proposed method can accurately detect multilane lines in various scenarios.Figure 11
Examples of multilane line detection results.


### 5.6. Real Vehicle Experimental Verification

To verify the positioning performance of the proposed strategy, experiments were conducted on the intelligent driving vehicle platform. The platform is refitted by Chery pure electric vehicle [31], as shown in Figure 12.Figure 12
The intelligent driving vehicle platform.


#### 5.6.1. Camera Parameters

The HD industrial camera with a USB driver interface is selected as the visual acquisition device. The specific parameters are shown in Table5.Table 5
Main parameter table of Camera.
ParameterDataImage formatRGBPixel size2μm∗2 μmFrame rate30 frame/sResolution1280∗720The HD industrial camera can maintain a good shooting effect without distortion under strong light, weak light, or no light, and the image acquisition requirements under various driving conditions can be met.


#### 5.6.2. Industrial Computer

Advantech MIC-7700 industrial computer is selected as the data computing platform, as shown in Figure13. MIC-7700 is a compact and fan-free computing platform designed based on the industrial market. It can work in an environment of 0∼50 degrees, can reduce the external vibration and impact on the inside of the chassis, and can be used all day in bad weather.Figure 13
MIC-7700 industrial computer.


#### 5.6.3. Software Platform

The real vehicle data acquisition and experiment in this paper are carried out in ROS (robot operating system). Ubuntu 16.04 is used as the installation and deployment operating system of ROS. The version of ROS is kinetic.To achieve multitask road multitarget detection and the integration of the drivable area segmentation model on the ROS platform, as shown in Figure14, the topic structure diagram of multitask target detection and segmentation node and network connection mode is established.Figure 14
Node and topic structure diagram of ROS.Firstly, node/lane_node is created, which subscribes to the image Topic/usb_cam/image_raw of real-time road conditions driven by the HD camera installed on the vehicle in real time, and converts the image format into the format recognized by the OpenCV tool library by calling the cv_bridge module in the ROS library. Then the image data is reasoned according to the multitask road target detection and segmentation model, and finally, the results are published in real time as topic/lane_image. ROS graphical tool RViz can display the multitask road multitarget detection and drivable area segmentation prediction results by subscribing to the topic.


#### 5.6.4. Real Vehicle Test of Multilane Line Detection Algorithm

Figure15 shows the multilane line detection effect of the algorithm proposed in this paper for the data collected by the onboard vision system of the intelligent driving vehicle platform. It can be seen that the proposed method can achieve better detection results in various complex scenarios. The reason is that the lane line detection problem is transformed into an instance segmentation problem, which can solve any number of lane line detection and lane change problems. Even if the lane line is blocked by vehicles or shadows or the detected lane line is a dashed line, the position of the lane line can be accurately predicted.Figure 15
Lane line detection results in different scenarios. (a) Sunny day. (b) Overcast. (c) Rainy day. (d) Night.
(a)(b)(c)(d)


## 5.1. Experimental Environment Configuration

The algorithm design, training, and testing are based on the deep learning framework PyTorch. The experimental configuration used in this experiment is shown in Table1.Table 1
Experimental environment configuration parameters.
Hardware environmentGPUGeForce GTX 2080Ti dual card processorSoftware environmentMemory32GHard disk2TOperating systemUbuntu18.04Deep learning frameworkPyTorch 1.2.0Programming languagePython 3.6.2CUDA10.1CUDNN7.6


## 5.2. CULane Dataset

Although the multilane detection network based on deep learning has been able to extract lane line pixels effectively in simple traffic scenes with good weather conditions, it is still challenging for lane line detection in complex scenes. Therefore, it is very important for supervised learning that the lane dataset covers a wide range of traffic scenes and has high annotation quality.The challenging CULane dataset is used to train and validate the model, as shown in Figure9. CULane is a large scale challenging dataset for academic research on traffic lane detection. Only the two lane lines on the left and right of the current lane line are concerned by CULane, which are paid most attention to in real applications. Therefore, there are only four real lane lines labeled. The dataset is divided into 88880 for the training set, 9675 for the validation set, and 34680 for the test set. Table 2 shows the various scene information of the CULane dataset.Figure 9
CULane dataset.Table 2
The various scene information of the CULane dataset.
SceneScene descriptionImage proportion (%)NormalThe driving vision is good, and the lane markings are clearly visible27.7CrowdA large number of vehicles are moving slowly on the road, and the lane line is blocked by vehicles23.4NightVisibility is low at night, lane lines are blurred, and different lights interfere with each other20.3No lineNo lane markings, usually narrow roads, and many vehicles parked on the side of the road11.7ShadowUnder the sky bridge or viaduct, the light is dark, the shade of the trees or the shadow of the building2.7Strong lightVarious strong lights cause roadside reflections, and the lane lines on the road are not clear1.4CurveCurved lane line ahead1.2CrossroadInterference of zebra crossing markings at intersections, no lane markings in the middle of the intersection9.0ArrowThere are interference marks between lane lines such as going straight, turning, and turning around2.6It can be seen from Table1 that a total of 9 types of traffic scenes are included in CULane. Among them, the number of images in normal traffic scenes with clear lane lines accounted for 27.7% of the total dataset, while the number of images in complex road scenes with unclear lane lines or interference with lane lines due to various reasons accounted for 72.3% of the dataset. It shows that complex road scenes are more concerned in CULane, and it is also consistent with the proportion of various traffic scenes encountered in the actual driving process. Therefore, this dataset is more suitable for verifying the ability of the proposed method to detect lane lines in complex road scenes.


## 5.3. Model Training Process

### 5.3.1. Data Processing Method

In order to ensure the real-time performance of the multilane line detection algorithm, the CULane input image is converted into an 800∗288 pixel format for network learning. The input data is normalized so that the value of the pixel is limited to the interval [0,1], which improves the computational efficiency of the model fitting process. The data augmentation strategies are used, including brightness conversion, horizontal flip, and overall image translation of 0∼2 pixels; an example is shown in Figure 10.Figure 10
Data augmentation.


### 5.3.2. Model Training Parameters Setting

Taking into account the performance of the hardware platform used in this study, the training parameters are shown in Table3. In Table 3, batch size represents the number of training groups input for each iteration of training; epoch represents the training period of the whole training set; the learning rate decays exponentially to prevent gradient dispersion. In addition, in order to accelerate the convergence of the network, the MobileNet pretraining model is used to initialize the weight parameters of the unmodified part of the feature extraction network. The mainstream Glorot uniform distribution method is used for the initialization of other parameters.Table 3
Model training parameters.
ParameterDataThe size of the input image800∗288Epoch100Batch size16OptimizerAdamInitial learning rate1e-4


## 5.3.1. Data Processing Method

In order to ensure the real-time performance of the multilane line detection algorithm, the CULane input image is converted into an 800∗288 pixel format for network learning. The input data is normalized so that the value of the pixel is limited to the interval [0,1], which improves the computational efficiency of the model fitting process. The data augmentation strategies are used, including brightness conversion, horizontal flip, and overall image translation of 0∼2 pixels; an example is shown in Figure 10.Figure 10
Data augmentation.


## 5.3.2. Model Training Parameters Setting

Taking into account the performance of the hardware platform used in this study, the training parameters are shown in Table3. In Table 3, batch size represents the number of training groups input for each iteration of training; epoch represents the training period of the whole training set; the learning rate decays exponentially to prevent gradient dispersion. In addition, in order to accelerate the convergence of the network, the MobileNet pretraining model is used to initialize the weight parameters of the unmodified part of the feature extraction network. The mainstream Glorot uniform distribution method is used for the initialization of other parameters.Table 3
Model training parameters.
ParameterDataThe size of the input image800∗288Epoch100Batch size16OptimizerAdamInitial learning rate1e-4


## 5.4. Training Result Analysis

To verify the performance of the proposed multilane line detection algorithm based on deep learning,F1 is used to judge whether a lane marking is successfully detected. The lane markings are viewed as lines with widths equal to 30 pixels, and the intersection over union (IoU) between the ground truth and the prediction is calculated. Predictions whose IoUs are larger than 0.5 are viewed as a correctly predicted lane line.(16)precision=TPTP+FP,recall=TPTP+FN,F1=2×precision×recallprecision+recall,where TP (true positives) is the number of lanes lines correctly predicted; FP (false positives) is the number of wrongly predicted lane lines; FN (false negatives) is the number of missed ground-truth lane lines.Based on the evaluation index ofF1, the effectiveness of the proposed algorithm and other multilane detection algorithms is analyzed. The experimental results are shown in Table 4.Table 4
Comparative experimental results of each improved part
MethodScene (%)NormalCrowdNightNo lineShadowHlightCurveArrowSCNN [28]90.669.666.143.466.958.564.484.1GCJ [29]89.776.568.735.165.567.463.282.2SAD [30]90.770.066.343.567.059.965.784.4Our91.272.869.745.168.864.466.385.2From Table4, it can be seen that the F1 score of the proposed method in the normal test set and most challenge test sets is better than other algorithms, which verifies the effectiveness of the proposed method.


## 5.5. Examples of Multilane Line Detection Results

Figure11 shows the multilane line detection results of the CULane dataset, and the curves of different colors represent the detected different lane lines. As can be seen from Figure 11, the proposed method can accurately detect multilane lines in various scenarios.Figure 11
Examples of multilane line detection results.


## 5.6. Real Vehicle Experimental Verification

To verify the positioning performance of the proposed strategy, experiments were conducted on the intelligent driving vehicle platform. The platform is refitted by Chery pure electric vehicle [31], as shown in Figure 12.Figure 12
The intelligent driving vehicle platform.


### 5.6.1. Camera Parameters

The HD industrial camera with a USB driver interface is selected as the visual acquisition device. The specific parameters are shown in Table5.Table 5
Main parameter table of Camera.
ParameterDataImage formatRGBPixel size2μm∗2 μmFrame rate30 frame/sResolution1280∗720The HD industrial camera can maintain a good shooting effect without distortion under strong light, weak light, or no light, and the image acquisition requirements under various driving conditions can be met.


### 5.6.2. Industrial Computer

Advantech MIC-7700 industrial computer is selected as the data computing platform, as shown in Figure13. MIC-7700 is a compact and fan-free computing platform designed based on the industrial market. It can work in an environment of 0∼50 degrees, can reduce the external vibration and impact on the inside of the chassis, and can be used all day in bad weather.Figure 13
MIC-7700 industrial computer.


### 5.6.3. Software Platform

The real vehicle data acquisition and experiment in this paper are carried out in ROS (robot operating system). Ubuntu 16.04 is used as the installation and deployment operating system of ROS. The version of ROS is kinetic.To achieve multitask road multitarget detection and the integration of the drivable area segmentation model on the ROS platform, as shown in Figure14, the topic structure diagram of multitask target detection and segmentation node and network connection mode is established.Figure 14
Node and topic structure diagram of ROS.Firstly, node/lane_node is created, which subscribes to the image Topic/usb_cam/image_raw of real-time road conditions driven by the HD camera installed on the vehicle in real time, and converts the image format into the format recognized by the OpenCV tool library by calling the cv_bridge module in the ROS library. Then the image data is reasoned according to the multitask road target detection and segmentation model, and finally, the results are published in real time as topic/lane_image. ROS graphical tool RViz can display the multitask road multitarget detection and drivable area segmentation prediction results by subscribing to the topic.


### 5.6.4. Real Vehicle Test of Multilane Line Detection Algorithm

Figure15 shows the multilane line detection effect of the algorithm proposed in this paper for the data collected by the onboard vision system of the intelligent driving vehicle platform. It can be seen that the proposed method can achieve better detection results in various complex scenarios. The reason is that the lane line detection problem is transformed into an instance segmentation problem, which can solve any number of lane line detection and lane change problems. Even if the lane line is blocked by vehicles or shadows or the detected lane line is a dashed line, the position of the lane line can be accurately predicted.Figure 15
Lane line detection results in different scenarios. (a) Sunny day. (b) Overcast. (c) Rainy day. (d) Night.
(a)(b)(c)(d)


## 5.6.1. Camera Parameters

The HD industrial camera with a USB driver interface is selected as the visual acquisition device. The specific parameters are shown in Table5.Table 5
Main parameter table of Camera.
ParameterDataImage formatRGBPixel size2μm∗2 μmFrame rate30 frame/sResolution1280∗720The HD industrial camera can maintain a good shooting effect without distortion under strong light, weak light, or no light, and the image acquisition requirements under various driving conditions can be met.


## 5.6.2. Industrial Computer

Advantech MIC-7700 industrial computer is selected as the data computing platform, as shown in Figure13. MIC-7700 is a compact and fan-free computing platform designed based on the industrial market. It can work in an environment of 0∼50 degrees, can reduce the external vibration and impact on the inside of the chassis, and can be used all day in bad weather.Figure 13
MIC-7700 industrial computer.


## 5.6.3. Software Platform

The real vehicle data acquisition and experiment in this paper are carried out in ROS (robot operating system). Ubuntu 16.04 is used as the installation and deployment operating system of ROS. The version of ROS is kinetic.To achieve multitask road multitarget detection and the integration of the drivable area segmentation model on the ROS platform, as shown in Figure14, the topic structure diagram of multitask target detection and segmentation node and network connection mode is established.Figure 14
Node and topic structure diagram of ROS.Firstly, node/lane_node is created, which subscribes to the image Topic/usb_cam/image_raw of real-time road conditions driven by the HD camera installed on the vehicle in real time, and converts the image format into the format recognized by the OpenCV tool library by calling the cv_bridge module in the ROS library. Then the image data is reasoned according to the multitask road target detection and segmentation model, and finally, the results are published in real time as topic/lane_image. ROS graphical tool RViz can display the multitask road multitarget detection and drivable area segmentation prediction results by subscribing to the topic.


## 5.6.4. Real Vehicle Test of Multilane Line Detection Algorithm

Figure15 shows the multilane line detection effect of the algorithm proposed in this paper for the data collected by the onboard vision system of the intelligent driving vehicle platform. It can be seen that the proposed method can achieve better detection results in various complex scenarios. The reason is that the lane line detection problem is transformed into an instance segmentation problem, which can solve any number of lane line detection and lane change problems. Even if the lane line is blocked by vehicles or shadows or the detected lane line is a dashed line, the position of the lane line can be accurately predicted.Figure 15
Lane line detection results in different scenarios. (a) Sunny day. (b) Overcast. (c) Rainy day. (d) Night.
(a)(b)(c)(d)


## 6. Conclusion and Discussion

Aiming at the difficulty of lane line detection in complex urban traffic scenes, a new method of lane line detection based on instance segmentation and adaptive perspective transformation is proposed in this paper. A branch multitask lane line instance segmentation network is designed for lane line instance segmentation, including the lane line semantic segmentation part and the lane line Id embedding part, which can solve the problems of multilane and lane change detection while satisfying real-time performance. The CULane dataset is used for training. At the same time, in order to deal with the change of camera inclination angle caused by vehicle turbulence, the example segmentation results are adaptively perspective transformed to obtain the lane line pixel set from the perspective of aerial view so as to realize the fitting of lane line pixels. The CULane test results show that the lane line detection effectF1 in normal scenes is 91.2%. Integrating the model into the ROS platform realizes the real-time detection of multilane lines in various complex traffic scenes, which has good practical application value. We also conclude that the proposed strategies can be easily embedded into other advanced driver assistance approaches with slight modifications.



---

*Source: 7919875-2022-03-08.xml*