# A Real-Time Complex Road AI Perception Based on 5G-V2X for Smart City Security

Authors: Cheng Xu; Hongjun Wu; Yinong Zhang; Songyin Dai; Hongzhe Liu; Jin Tian
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

The Internet of Vehicles and information security are key components of a smart city. Real-time road perception is one of the most difficult tasks. Traditional detection methods require manual adjustment of parameters, which is difficult, and is susceptible to interference from object occlusion, light changes, and road wear. Designing a robust road perception algorithm is still challenging. On this basis, we combine artificial intelligence algorithms and the 5G-V2X framework to propose a real-time road perception method. First, an improved model based on Mask R-CNN is implemented to improve the accuracy of detecting lane line features. Then, the linear and polynomial fitting methods of feature points in different fields of view are combined. Finally, the optimal parameter equation of the lane line can be obtained. We tested our method in complex road scenes. Experimental results show that, combined with 5G-V2X, this method ultimately has a faster processing speed and can sense road conditions robustly under various complex actual conditions.


---

## Body

## 1. Introduction

The 5G network has the characteristics of high transmission speed and low transmission delay. It provides a more reliable communication environment for V2X. The 5G-based intelligent traffic management system has stronger management capabilities and robustness, which helps to improve traffic flow. With the help of 5G-V2X, real-time complex road perception becomes possible. Therefore, 5G-V2X is the key to a smart city [1, 2].Lane detection is one of the most important tasks in understanding road scenes and is also the most complicated part. It can use extracted lane-marker information to locate the road and determine the relative position between the vehicle and the road. A lane-detection solution using visual algorithms is a relatively common solution. But there are a wide variety of lane markings. The markings may be blocked due to vehicle crowding, the line may be corroded and worn, and the weather and other factors can bring challenges to lane-detection [3–5].Early cognitive algorithms for urban roads relied on manual design, which required a lot of work. These methods use Hough transform, random sample consistency, and other methods to segment the road area and detect lane lines [6]. The obvious disadvantage of this method is poor generalization. When the driving environment changes significantly, the accuracy may be significantly reduced [7].Convolutional neural networks have achieved great success in computer vision. Methods based on deep learning can directly learn domain knowledge from large datasets, greatly improving the ability to understand complex urban road scenes [8–10]. On this basis, we propose a new method of marker detection based on a traditional detection algorithm and deep learning. First, we extract the overall road area by training the Mask R-CNN [11–15]. The identified road area is used as the constraint area, the lane mark is detected in the area, the obtained discrete lane-line feature-point information is clustered by the least-squares method, and the lane lines are fitted in a different field of view using straight-line and curve-fitting models [16, 17].The main contributions of this paper are the following two aspects: (1) The model combines the convolutional neural network, 5G-V2X, with the traditional algorithm. The model is used to improve the detection speed of extracting feature points. (2) In different fields of view, the straight-line and curve-fitting models are used to fit the straight line to make the fitting result more accurate, and the optimal parameter equation of the lane line can be obtained.This article is organized as follows. Section2 introduces related work. Section 3 describes the improved deep learning method used and the clustering and fitting algorithms for lane lines. Section 4 reports the results of the experiment. Section 5 provides our conclusions.


## 2. Related Work

In recent years, with the availability of parallel computing, the training process of large-scale data has accelerated. The convolutional neural network (CNN) has become a research hotspot and is widely used in computer vision and pattern recognition [18, 19]. The convolutional neural network can automatically learn the hierarchical features of an image, avoiding the blindness of people’s artificial design and selection features, and showing its excellent performance in the task of object detection and instance segmentation.


### 2.1. Semantic Segmentation

A convolutional neural network-based SegNet learns high-order features in a scene to perform road scene segmentation. It classifies other test images by applying a training algorithm to a common image dataset to generate training labels. A new texture descriptor based on color-layer fusion obtains the maximum consistency of the road area [20]. Offline and online information are combined to detect the road area. A combined hierarchical framework for road-scene segmentation can reliably estimate the topological structure of a scene and effectively identify traffic scenes of multilane roads [21]. The state-of-the-art instance segmentation methods Mask scoring R-CNN and Cascade Mask R-CNN are both improved based on Mask R-CNN, which prove the effectiveness of Mask R-CNN [22].


### 2.2. Lane Line Detection

Lane line detection is the most important part of the entire road surface inspection. In recent years, deep learning has enabled great success in computer vision. In the lane-line detection problem, a deep neural network is used to learn the lane-line feature, which improves the accuracy of lane-line feature extraction and is suitable for complex road environments [23]. The University of Sydney used CNN and RNN to detect lane lines, with the CNN providing geometric information on lane-line structures for use by the RNN to detect lane lines. Kyungpook National University combined CNN and RANSAC algorithms to stably detect lane-line information even in complex road scenes [24]. The Baidu map project team proposed a dual-view convolutional neutral network (DVCNN) for lane-line detection. The Korean Robotics and Computer Vision Laboratory proposed a method to extract multiple regions of interest, merging regions that may belong to the same class, and using a principal component analysis network (PCANet) and neural networks to classify candidate regions [25]. The laboratory proposed a vanishing point guided network (VPGNet) [26] to solve the problem of lane-line and pavement-marking recognition and classification under complex weather conditions. The Ford Research and Innovation Center used the DeepLanes Network to extract lane-line features acquired by cameras on both sides of a vehicle.


### 2.3. Clustering and Fitting

The lane-line features extracted by deep learning cannot be directly used, and it is still necessary to cluster and fit the lane-line feature points. The main purpose of fitting is to depict the lane markings on a picture and to display the location in the road image [27]. In lane-line clustering and fitting algorithms, the commonly used road models are linear, linear parabola, least-squares (LS) curve fitting, cubic curve, and Bezier curve fitting [28, 29].


### 2.4. 5G-V2X

The goal of the 5G-V2X communication system is to achieve accurate and efficient road scene perception and accident-free and efficient collaborative autonomous driving [30]. Literature [31–33] proposed a network protocol based on edge computing and a new vehicle network privacy protection protocol to enhance road safety, intelligent transportation, and smart city systems. Literature [34] introduced a real-time communication method based on 5G-V2X, which reduces the energy and time costs of the system and improves the management efficiency of vehicular networks. Literature [35] proposed an intelligent traffic Vehicle Detection Model based on 5G-V2X, which can dynamically coordinate computing and content caching and effectively allocate network resources.


## 2.1. Semantic Segmentation

A convolutional neural network-based SegNet learns high-order features in a scene to perform road scene segmentation. It classifies other test images by applying a training algorithm to a common image dataset to generate training labels. A new texture descriptor based on color-layer fusion obtains the maximum consistency of the road area [20]. Offline and online information are combined to detect the road area. A combined hierarchical framework for road-scene segmentation can reliably estimate the topological structure of a scene and effectively identify traffic scenes of multilane roads [21]. The state-of-the-art instance segmentation methods Mask scoring R-CNN and Cascade Mask R-CNN are both improved based on Mask R-CNN, which prove the effectiveness of Mask R-CNN [22].


## 2.2. Lane Line Detection

Lane line detection is the most important part of the entire road surface inspection. In recent years, deep learning has enabled great success in computer vision. In the lane-line detection problem, a deep neural network is used to learn the lane-line feature, which improves the accuracy of lane-line feature extraction and is suitable for complex road environments [23]. The University of Sydney used CNN and RNN to detect lane lines, with the CNN providing geometric information on lane-line structures for use by the RNN to detect lane lines. Kyungpook National University combined CNN and RANSAC algorithms to stably detect lane-line information even in complex road scenes [24]. The Baidu map project team proposed a dual-view convolutional neutral network (DVCNN) for lane-line detection. The Korean Robotics and Computer Vision Laboratory proposed a method to extract multiple regions of interest, merging regions that may belong to the same class, and using a principal component analysis network (PCANet) and neural networks to classify candidate regions [25]. The laboratory proposed a vanishing point guided network (VPGNet) [26] to solve the problem of lane-line and pavement-marking recognition and classification under complex weather conditions. The Ford Research and Innovation Center used the DeepLanes Network to extract lane-line features acquired by cameras on both sides of a vehicle.


## 2.3. Clustering and Fitting

The lane-line features extracted by deep learning cannot be directly used, and it is still necessary to cluster and fit the lane-line feature points. The main purpose of fitting is to depict the lane markings on a picture and to display the location in the road image [27]. In lane-line clustering and fitting algorithms, the commonly used road models are linear, linear parabola, least-squares (LS) curve fitting, cubic curve, and Bezier curve fitting [28, 29].


## 2.4. 5G-V2X

The goal of the 5G-V2X communication system is to achieve accurate and efficient road scene perception and accident-free and efficient collaborative autonomous driving [30]. Literature [31–33] proposed a network protocol based on edge computing and a new vehicle network privacy protection protocol to enhance road safety, intelligent transportation, and smart city systems. Literature [34] introduced a real-time communication method based on 5G-V2X, which reduces the energy and time costs of the system and improves the management efficiency of vehicular networks. Literature [35] proposed an intelligent traffic Vehicle Detection Model based on 5G-V2X, which can dynamically coordinate computing and content caching and effectively allocate network resources.


## 3. Complex Road Lane Line Detection and Processing

We can divide the detection process of the lane line into three steps. The first is to use deep learning to extract the feature points. The second is to cluster the extracted lane-line feature points, and the third is to obtain cluster points.


### 3.1. Feature-Point Extraction Based on Improved Model

Building deep models is just a means of learning. Unlike traditional shallow learning, which relies on artificial features, deep learning has a deeper model depth, a greater emphasis on feature learning, and a greater amount of data for training. Therefore, it can better describe the internal correlation between the data.As shown in Figure1, Mask R-CNN consists of three parts. The first part is the backbone network, which is used for feature extraction. The second part is the head, which is used to obtain category scores and regression bounding boxes, and the third part is to generate a mask.Figure 1
Difference between Fast/er R-CNN and Mask R-CNN on feature maps.The RPNs in Mask RCNN and Faster R-CNN are the same, but after adding the mask layer, each ROI can be predicted in parallel for each category and “edge,” and in parallel. ROI align of Mask R-CNN is shown in Figure2.Figure 2
ROI align of Mask R-CNN.The loss function of ROI is redefined as(1)L=L^cls+Lbox+Lmask.In the above formula, both work for the positive ROI. For the mask branch of each ROI, the output dimension isKm∗m. K means to encode two-class masks for m∗m images, each with categories. Therefore, one must apply a single-pixel sigmoid for two classifications and define Lmask as the average two-class cross-entropy loss. For an ROI of category K, Lmask is defined at the Kth mask.The definition ofLmask allows the network to generate a mask for each category, and there is no competition between categories. A special classification branch is used to predict the category label, thus decoupling the category and mask predictions. The FCN uses a single-pixel softmax and multinomial cross-entropy loss. In this case, there is competition between the mask and the classes. Mask R-CNN uses per-pixel sigmoid and binary loss without this consequence. Experiments prove that this is the key point to improve instance segmentation.We use ResNet101 as the backbone of Mask R-CNN for feature extraction. ResNet includes multiple computing blocks composed of convolution, bias, and Batch Norm (BN). After the training of the model, there are some redundant steps in the model which are only used for forwarding propagation, and the redundant parameters can be reduced by parameter combination.(2)X′=covX+βb,Y=α·X′−με+σ2+β.Parameter combination is the 5 parameters of the bias layer and BN layerβb, α, β, μ, and σ2; combined into α′ and β′, the 2 parameters can then calculate it by Y=α′X+β.
(3)α′=αε+σ2,β′=αβb−με+σ2+β.


### 3.2. Driving Area Division

In this paper, the samples are labeled according to the Mask R-CNN labeling rules. The labeled sample images are sent to Mask R-CNN for training.Mask R-CNN is ideal for detecting and segmenting lane marking, and the architecture of Mask R-CNN is shown in Figure3. However, the lane-marking feature obtained through deep learning cannot be directly used. Although the lane-line feature is learned through depth, the extracted lane-line feature only has the coordinate information of the lane line. In the lane lines formed by the dotted lines, we still must identify which lane lines each of these dotted lane-line segments belong to, and this information is not available for discrete coordinate points. Also, the real driving scene is multilane, and we must classify each lane line. Therefore, we propose a clustering method for feature points of lane lines, which can eliminate the interference between multiple lane lines and obtain their information. This provides more accurate and comprehensive input for subsequent lane-line fitting. First, it divides the pavement area, assuming that during data acquisition, the intelligent camera will have a collection period of 10 milliseconds and a top speed of 200 kilometers per hour. By calculation, we know that there are about 10 meters in one cycle. In principle, the camera can get a clear image of the 100-meter mark in front of the vehicle, and lane lines that are too far away are difficult to recognize.Figure 3
The architecture of Mask R-CNN. From left to right are the input, backbone, RPN, ROI align, and three branches of output.The original image we acquired through the camera is shown in Figure4. We will use the upper edge of the overall road information identified by the neural network as area C. Above this area is the sky image, which contains no lane-marking line information. Area A is a near-field area that is the main part of our field of vision, where the lanes can be approximated as straight lines. Area B is the midfield area, and there may be a curve with a small curvature. Area C is the far-field of view where the lane image reflects the curvature of the lane. After dividing the overall road information in this way, when designing the algorithm, we need only pay attention to the near and middle fields of view of the image of the front of the vehicle in the divided road area.Figure 4
Driving area division process. After segmenting the overall road information, a large number of redundant areas are removed. The area where there may be lane lines is reduced to the near field of view of the image in the segmented road area.


### 3.3. Clustering Feature Points

LetFx,y represent the extracted feature-point coordinates. The feature segment Bxs,ys,xe,ye,k,b,n represents the lane-line marker segment information, composed of a series of lane-line coordinates, where xs,ys and xe,ye represent the starting and ending coordinates of a lane line, k and b are the line parameters of the cluster feature coordinate, and n represents the number of coordinates of the current lane-line segment.The feature coordinates’ information points already included in the lane-line segment extracted by deep learning may represent the current lane-line characteristic line segment. Then, we use the least-squares line combined with the feature points to cluster the feature lines and judge the continuity of the horizontal position of the line segments according to the feature points. The clustering equations are(4)x=Bk×y+Bb,(5)Bk=∑nx×∑ny−∑mx×y∑ny2−∑ny2,(6)Bb=∑nx×y×∑ny−∑ny2×∑nx∑ny2−∑ny2.The horizontal constraint is using the following equation.(7)Fx−Bk×Fy−Bb<d,where d is the maximum deviation distance of the feature points. Under the perspective effect of the image, d decreases with distance. The feature-point clustering effect under this constraint is shown in Figure 5.Figure 5
Distance similarity.


### 3.4. Fitting Model Design

To get the optimality parameter equation of the lane line which can be obtained, we comb the linear and polynomial fitting methods of feature points in different fields of view.


#### 3.4.1. Straight Line Fitting Model

To ensure that the regression line mainly includes normal data points of which the error is close to zero, the noise points with maximum error on both sides of the regression line are removed. Considering the advantages and disadvantages of HT and LS, we propose a line-detection method that combines the two algorithms. First, HT is used to determine the approximate region of the line, and then, the improved least-squares method is used to determine the line parameters based on the specific point of each region after clustering. The algorithm flow is shown in Figure6.
(1)
Under the parameters, a probability-based Hough transform operation is performed on the lane-line feature to obtain a straight line(2)
For each line obtained by HT detection, in all feature point setsS, feature points whose distance line is not greater than d are found, to form a set E(3)
The regression line parametersK and B of set E are determined and the standard deviation by the least-squares method(4)
Any feature pointxi,yi in set E, all feature points satisfying kxi+b>yi form a subset Epos, all feature points satisfying kxi+b<yi form a subset Eneg(5)
In setEpos and Eneg, find the point with the greatest error:(8)Pp=argmaxPp∈EposⅆPpPn=argmaxPn∈EnegⅆPn,where dp represents the distance from point P to the regression line.
(6)
PointsPp and Pn are removed; then, set Epos and E are updated. Repeat step 3 until the error e less than εFigure 6
Straight line fitting process.


#### 3.4.2. Complex Road Curve Fitting Model

For intelligent vehicles with simple functions and low-speed requirements, the lane-line position information obtained by the linear model can basically meet the requirements of lane-line detection, but it cannot adapt to the real-time road environment of different shapes. The commonly used parabolic curve-fitting model cannot adapt at the junction of straight lines and curves. We propose the following third-order polynomial fitting model as follows.(9)fx=l0+l1x+l22x2+l36x3.Figure7 shows an example of a lane model with two lanes and one exit. The model consists of n segments, each with m points. We use the third-order polynomials fx to fit each lane line with the points of the line segment. During the fitting process, each segment is an independent cubic spline model, where L0, L1, L2, and L3 constitute the parameter information of the function. L0 represents the lane boundary offsets, L1 is used to drive the heading or yaw angle, L2 is used to derive the curvature, and L3 is used to derive the rate of change of the curvature. The left and right lane models are modeled separately, which also makes it possible to model nonparallel lane boundaries.Figure 7
Curve fitting diagram.


### 3.5. Complex Road Multilane Line Constraint

#### 3.5.1. Straight Line Merging Algorithm

A straight line is obtained after the Hough transform, and most of it is valuable lane line information. Some noise still must be eliminated. In principle, a lane line can only be matched by a straight line in the near or middle field. Therefore, we want to merge the straight lines in the near and middle fields of view. This paper introduces the similarity measure for evaluation. As shown in Figure5, we cluster lines of similar distance and direction into one class and then use least squares to fit the lane-line feature points on all the lines.
(10)k1−k2<Tk,xB′−xC′<Td1,(11)dis=x3−x2sinθ1−y3−y2cosθ1+x3−x2sinθ2−y3−y2cosθ2,dir=θ1−θ+θ2−θ.P1x1,y1 and P2x2,y2 are the two end points of the line L1, and the inclination angle is θ1. P3x3,y3 and P4x4,y4 are the two end points of the line L2, the inclination angle is θ2. The inclination angle of the straight line made up by points P2 and P3 is θ.


#### 3.5.2. Different Area Merging Algorithm

After getting the candidate marker lines in the different fields, we also need to merge the near midfield lines. For segmented lanes, each zone model needs to be connected first, and then, the lane model is built. The connection method is divided into a straight-line model and a curve model. The linear connection compares the slope of the line; the curve compares the curvature of the curve at the same point and determines the connection according to the distance between the segments to be merged. The specific method is as follows.As showed in Figure8(a), in the straight-line connection mode, A and B are the two end points of the straight line L1 and C and D are the two end points of the straight line L2. B0 and C0 are the coordinates of the vertical axis to the intersection of the two straight lines on the dividing line. K1 and K2 indicate the slopes of straight lines L1 and L2, respectively. If the condition of equation (9) is satisfied, then A and D are connected to form a combined line segment. Tk is the slope difference threshold for merging. Td1 is the intercept difference threshold of merging. It can be set according to the actual situation.Figure 8
Near- and medium-field merging.
(a)(b)As shown in Figure8(b), in the connection mode at the curve, if B of curve S1 is above C of S2, we extend the two end points S1 and S2 to B0 and C0 of the divider. If formula (9) is satisfied, we use point B of S1 and points C and D of S2 to determine the new curved line segment after the merge. Td2 is the threshold at the time of the merge. However, when the connection is actually used, the selection of the threshold has a great impact; there are fluctuations in different sections of the test, and it is not easy to set manually.
(12)xB′−xC′<Td2.Actually, from the lane-line model design, we have made an ideal assumption that the lane lines in the mid- and near-field regions are approximately linear. This greatly reduces the lack of connection at the corners.


## 3.1. Feature-Point Extraction Based on Improved Model

Building deep models is just a means of learning. Unlike traditional shallow learning, which relies on artificial features, deep learning has a deeper model depth, a greater emphasis on feature learning, and a greater amount of data for training. Therefore, it can better describe the internal correlation between the data.As shown in Figure1, Mask R-CNN consists of three parts. The first part is the backbone network, which is used for feature extraction. The second part is the head, which is used to obtain category scores and regression bounding boxes, and the third part is to generate a mask.Figure 1
Difference between Fast/er R-CNN and Mask R-CNN on feature maps.The RPNs in Mask RCNN and Faster R-CNN are the same, but after adding the mask layer, each ROI can be predicted in parallel for each category and “edge,” and in parallel. ROI align of Mask R-CNN is shown in Figure2.Figure 2
ROI align of Mask R-CNN.The loss function of ROI is redefined as(1)L=L^cls+Lbox+Lmask.In the above formula, both work for the positive ROI. For the mask branch of each ROI, the output dimension isKm∗m. K means to encode two-class masks for m∗m images, each with categories. Therefore, one must apply a single-pixel sigmoid for two classifications and define Lmask as the average two-class cross-entropy loss. For an ROI of category K, Lmask is defined at the Kth mask.The definition ofLmask allows the network to generate a mask for each category, and there is no competition between categories. A special classification branch is used to predict the category label, thus decoupling the category and mask predictions. The FCN uses a single-pixel softmax and multinomial cross-entropy loss. In this case, there is competition between the mask and the classes. Mask R-CNN uses per-pixel sigmoid and binary loss without this consequence. Experiments prove that this is the key point to improve instance segmentation.We use ResNet101 as the backbone of Mask R-CNN for feature extraction. ResNet includes multiple computing blocks composed of convolution, bias, and Batch Norm (BN). After the training of the model, there are some redundant steps in the model which are only used for forwarding propagation, and the redundant parameters can be reduced by parameter combination.(2)X′=covX+βb,Y=α·X′−με+σ2+β.Parameter combination is the 5 parameters of the bias layer and BN layerβb, α, β, μ, and σ2; combined into α′ and β′, the 2 parameters can then calculate it by Y=α′X+β.
(3)α′=αε+σ2,β′=αβb−με+σ2+β.


## 3.2. Driving Area Division

In this paper, the samples are labeled according to the Mask R-CNN labeling rules. The labeled sample images are sent to Mask R-CNN for training.Mask R-CNN is ideal for detecting and segmenting lane marking, and the architecture of Mask R-CNN is shown in Figure3. However, the lane-marking feature obtained through deep learning cannot be directly used. Although the lane-line feature is learned through depth, the extracted lane-line feature only has the coordinate information of the lane line. In the lane lines formed by the dotted lines, we still must identify which lane lines each of these dotted lane-line segments belong to, and this information is not available for discrete coordinate points. Also, the real driving scene is multilane, and we must classify each lane line. Therefore, we propose a clustering method for feature points of lane lines, which can eliminate the interference between multiple lane lines and obtain their information. This provides more accurate and comprehensive input for subsequent lane-line fitting. First, it divides the pavement area, assuming that during data acquisition, the intelligent camera will have a collection period of 10 milliseconds and a top speed of 200 kilometers per hour. By calculation, we know that there are about 10 meters in one cycle. In principle, the camera can get a clear image of the 100-meter mark in front of the vehicle, and lane lines that are too far away are difficult to recognize.Figure 3
The architecture of Mask R-CNN. From left to right are the input, backbone, RPN, ROI align, and three branches of output.The original image we acquired through the camera is shown in Figure4. We will use the upper edge of the overall road information identified by the neural network as area C. Above this area is the sky image, which contains no lane-marking line information. Area A is a near-field area that is the main part of our field of vision, where the lanes can be approximated as straight lines. Area B is the midfield area, and there may be a curve with a small curvature. Area C is the far-field of view where the lane image reflects the curvature of the lane. After dividing the overall road information in this way, when designing the algorithm, we need only pay attention to the near and middle fields of view of the image of the front of the vehicle in the divided road area.Figure 4
Driving area division process. After segmenting the overall road information, a large number of redundant areas are removed. The area where there may be lane lines is reduced to the near field of view of the image in the segmented road area.


## 3.3. Clustering Feature Points

LetFx,y represent the extracted feature-point coordinates. The feature segment Bxs,ys,xe,ye,k,b,n represents the lane-line marker segment information, composed of a series of lane-line coordinates, where xs,ys and xe,ye represent the starting and ending coordinates of a lane line, k and b are the line parameters of the cluster feature coordinate, and n represents the number of coordinates of the current lane-line segment.The feature coordinates’ information points already included in the lane-line segment extracted by deep learning may represent the current lane-line characteristic line segment. Then, we use the least-squares line combined with the feature points to cluster the feature lines and judge the continuity of the horizontal position of the line segments according to the feature points. The clustering equations are(4)x=Bk×y+Bb,(5)Bk=∑nx×∑ny−∑mx×y∑ny2−∑ny2,(6)Bb=∑nx×y×∑ny−∑ny2×∑nx∑ny2−∑ny2.The horizontal constraint is using the following equation.(7)Fx−Bk×Fy−Bb<d,where d is the maximum deviation distance of the feature points. Under the perspective effect of the image, d decreases with distance. The feature-point clustering effect under this constraint is shown in Figure 5.Figure 5
Distance similarity.


## 3.4. Fitting Model Design

To get the optimality parameter equation of the lane line which can be obtained, we comb the linear and polynomial fitting methods of feature points in different fields of view.


### 3.4.1. Straight Line Fitting Model

To ensure that the regression line mainly includes normal data points of which the error is close to zero, the noise points with maximum error on both sides of the regression line are removed. Considering the advantages and disadvantages of HT and LS, we propose a line-detection method that combines the two algorithms. First, HT is used to determine the approximate region of the line, and then, the improved least-squares method is used to determine the line parameters based on the specific point of each region after clustering. The algorithm flow is shown in Figure6.
(1)
Under the parameters, a probability-based Hough transform operation is performed on the lane-line feature to obtain a straight line(2)
For each line obtained by HT detection, in all feature point setsS, feature points whose distance line is not greater than d are found, to form a set E(3)
The regression line parametersK and B of set E are determined and the standard deviation by the least-squares method(4)
Any feature pointxi,yi in set E, all feature points satisfying kxi+b>yi form a subset Epos, all feature points satisfying kxi+b<yi form a subset Eneg(5)
In setEpos and Eneg, find the point with the greatest error:(8)Pp=argmaxPp∈EposⅆPpPn=argmaxPn∈EnegⅆPn,where dp represents the distance from point P to the regression line.
(6)
PointsPp and Pn are removed; then, set Epos and E are updated. Repeat step 3 until the error e less than εFigure 6
Straight line fitting process.


### 3.4.2. Complex Road Curve Fitting Model

For intelligent vehicles with simple functions and low-speed requirements, the lane-line position information obtained by the linear model can basically meet the requirements of lane-line detection, but it cannot adapt to the real-time road environment of different shapes. The commonly used parabolic curve-fitting model cannot adapt at the junction of straight lines and curves. We propose the following third-order polynomial fitting model as follows.(9)fx=l0+l1x+l22x2+l36x3.Figure7 shows an example of a lane model with two lanes and one exit. The model consists of n segments, each with m points. We use the third-order polynomials fx to fit each lane line with the points of the line segment. During the fitting process, each segment is an independent cubic spline model, where L0, L1, L2, and L3 constitute the parameter information of the function. L0 represents the lane boundary offsets, L1 is used to drive the heading or yaw angle, L2 is used to derive the curvature, and L3 is used to derive the rate of change of the curvature. The left and right lane models are modeled separately, which also makes it possible to model nonparallel lane boundaries.Figure 7
Curve fitting diagram.


## 3.4.1. Straight Line Fitting Model

To ensure that the regression line mainly includes normal data points of which the error is close to zero, the noise points with maximum error on both sides of the regression line are removed. Considering the advantages and disadvantages of HT and LS, we propose a line-detection method that combines the two algorithms. First, HT is used to determine the approximate region of the line, and then, the improved least-squares method is used to determine the line parameters based on the specific point of each region after clustering. The algorithm flow is shown in Figure6.
(1)
Under the parameters, a probability-based Hough transform operation is performed on the lane-line feature to obtain a straight line(2)
For each line obtained by HT detection, in all feature point setsS, feature points whose distance line is not greater than d are found, to form a set E(3)
The regression line parametersK and B of set E are determined and the standard deviation by the least-squares method(4)
Any feature pointxi,yi in set E, all feature points satisfying kxi+b>yi form a subset Epos, all feature points satisfying kxi+b<yi form a subset Eneg(5)
In setEpos and Eneg, find the point with the greatest error:(8)Pp=argmaxPp∈EposⅆPpPn=argmaxPn∈EnegⅆPn,where dp represents the distance from point P to the regression line.
(6)
PointsPp and Pn are removed; then, set Epos and E are updated. Repeat step 3 until the error e less than εFigure 6
Straight line fitting process.


## 3.4.2. Complex Road Curve Fitting Model

For intelligent vehicles with simple functions and low-speed requirements, the lane-line position information obtained by the linear model can basically meet the requirements of lane-line detection, but it cannot adapt to the real-time road environment of different shapes. The commonly used parabolic curve-fitting model cannot adapt at the junction of straight lines and curves. We propose the following third-order polynomial fitting model as follows.(9)fx=l0+l1x+l22x2+l36x3.Figure7 shows an example of a lane model with two lanes and one exit. The model consists of n segments, each with m points. We use the third-order polynomials fx to fit each lane line with the points of the line segment. During the fitting process, each segment is an independent cubic spline model, where L0, L1, L2, and L3 constitute the parameter information of the function. L0 represents the lane boundary offsets, L1 is used to drive the heading or yaw angle, L2 is used to derive the curvature, and L3 is used to derive the rate of change of the curvature. The left and right lane models are modeled separately, which also makes it possible to model nonparallel lane boundaries.Figure 7
Curve fitting diagram.


## 3.5. Complex Road Multilane Line Constraint

### 3.5.1. Straight Line Merging Algorithm

A straight line is obtained after the Hough transform, and most of it is valuable lane line information. Some noise still must be eliminated. In principle, a lane line can only be matched by a straight line in the near or middle field. Therefore, we want to merge the straight lines in the near and middle fields of view. This paper introduces the similarity measure for evaluation. As shown in Figure5, we cluster lines of similar distance and direction into one class and then use least squares to fit the lane-line feature points on all the lines.
(10)k1−k2<Tk,xB′−xC′<Td1,(11)dis=x3−x2sinθ1−y3−y2cosθ1+x3−x2sinθ2−y3−y2cosθ2,dir=θ1−θ+θ2−θ.P1x1,y1 and P2x2,y2 are the two end points of the line L1, and the inclination angle is θ1. P3x3,y3 and P4x4,y4 are the two end points of the line L2, the inclination angle is θ2. The inclination angle of the straight line made up by points P2 and P3 is θ.


### 3.5.2. Different Area Merging Algorithm

After getting the candidate marker lines in the different fields, we also need to merge the near midfield lines. For segmented lanes, each zone model needs to be connected first, and then, the lane model is built. The connection method is divided into a straight-line model and a curve model. The linear connection compares the slope of the line; the curve compares the curvature of the curve at the same point and determines the connection according to the distance between the segments to be merged. The specific method is as follows.As showed in Figure8(a), in the straight-line connection mode, A and B are the two end points of the straight line L1 and C and D are the two end points of the straight line L2. B0 and C0 are the coordinates of the vertical axis to the intersection of the two straight lines on the dividing line. K1 and K2 indicate the slopes of straight lines L1 and L2, respectively. If the condition of equation (9) is satisfied, then A and D are connected to form a combined line segment. Tk is the slope difference threshold for merging. Td1 is the intercept difference threshold of merging. It can be set according to the actual situation.Figure 8
Near- and medium-field merging.
(a)(b)As shown in Figure8(b), in the connection mode at the curve, if B of curve S1 is above C of S2, we extend the two end points S1 and S2 to B0 and C0 of the divider. If formula (9) is satisfied, we use point B of S1 and points C and D of S2 to determine the new curved line segment after the merge. Td2 is the threshold at the time of the merge. However, when the connection is actually used, the selection of the threshold has a great impact; there are fluctuations in different sections of the test, and it is not easy to set manually.
(12)xB′−xC′<Td2.Actually, from the lane-line model design, we have made an ideal assumption that the lane lines in the mid- and near-field regions are approximately linear. This greatly reduces the lack of connection at the corners.


## 3.5.1. Straight Line Merging Algorithm

A straight line is obtained after the Hough transform, and most of it is valuable lane line information. Some noise still must be eliminated. In principle, a lane line can only be matched by a straight line in the near or middle field. Therefore, we want to merge the straight lines in the near and middle fields of view. This paper introduces the similarity measure for evaluation. As shown in Figure5, we cluster lines of similar distance and direction into one class and then use least squares to fit the lane-line feature points on all the lines.
(10)k1−k2<Tk,xB′−xC′<Td1,(11)dis=x3−x2sinθ1−y3−y2cosθ1+x3−x2sinθ2−y3−y2cosθ2,dir=θ1−θ+θ2−θ.P1x1,y1 and P2x2,y2 are the two end points of the line L1, and the inclination angle is θ1. P3x3,y3 and P4x4,y4 are the two end points of the line L2, the inclination angle is θ2. The inclination angle of the straight line made up by points P2 and P3 is θ.


## 3.5.2. Different Area Merging Algorithm

After getting the candidate marker lines in the different fields, we also need to merge the near midfield lines. For segmented lanes, each zone model needs to be connected first, and then, the lane model is built. The connection method is divided into a straight-line model and a curve model. The linear connection compares the slope of the line; the curve compares the curvature of the curve at the same point and determines the connection according to the distance between the segments to be merged. The specific method is as follows.As showed in Figure8(a), in the straight-line connection mode, A and B are the two end points of the straight line L1 and C and D are the two end points of the straight line L2. B0 and C0 are the coordinates of the vertical axis to the intersection of the two straight lines on the dividing line. K1 and K2 indicate the slopes of straight lines L1 and L2, respectively. If the condition of equation (9) is satisfied, then A and D are connected to form a combined line segment. Tk is the slope difference threshold for merging. Td1 is the intercept difference threshold of merging. It can be set according to the actual situation.Figure 8
Near- and medium-field merging.
(a)(b)As shown in Figure8(b), in the connection mode at the curve, if B of curve S1 is above C of S2, we extend the two end points S1 and S2 to B0 and C0 of the divider. If formula (9) is satisfied, we use point B of S1 and points C and D of S2 to determine the new curved line segment after the merge. Td2 is the threshold at the time of the merge. However, when the connection is actually used, the selection of the threshold has a great impact; there are fluctuations in different sections of the test, and it is not easy to set manually.
(12)xB′−xC′<Td2.Actually, from the lane-line model design, we have made an ideal assumption that the lane lines in the mid- and near-field regions are approximately linear. This greatly reduces the lack of connection at the corners.


## 4. Experiment and Analysis

### 4.1. Datasets and Validation

Our experiment was designed mainly to detect the real road information in real time, so the training and test datasets consisted of real road information. In this paper, we used the TuSimple lane dataset and TSD-MAX traffic scene dataset to verify the effectiveness of our method.It labeled the lanes of the test dataset and checked the accuracy of the IPM picture. We defined the criteria for the lane line as follows: where the input discrete point is regarded as the positive checkpoint in the true value area, TP is the total length of the positive lane-mark; FN is the total length of the missed check, and it equals the total marked true value minus TP; FP is the total length of a false check, and its value is equal to all extracted lane-mark points minus TP. For Mask R-CNN detection accuracy intersection over union (IoU), the following formula (13) is also applicable.
(13)SIoU=TPTP+FP+FN.


### 4.2. Complex Road Lane Line Detection Results

In the driving process of an intelligent vehicle, due to the complexity and diversity of the driving environment, false and missed detections often occur. Our proposed deep learning-based lane-marker extraction algorithm can well shield the influence of these uncertain factors on the lane-marker extraction results, so as to adapt to the complex and varied real road environment. Figure9 shows the results of training using our improved model. As is shown in Figure 9, our model clearly identifies all the information.Figure 9
Mask R-CNN detection results in different scenarios.Table1 shows the comparison of our improved method and some semantic segmentation methods on the TuSimple lane dataset. As shown in Table 1, our method is more accurate than most of the state-of-the-art methods on the TuSimple lane test dataset. SCNN has certain requirements on the location distribution of lane lines, and it is suitable for the TuSimple lane dataset which have a fixed overall linear number and less scene changes. At the same time, Table 1 shows the processing speed comparison of the model. Our method takes only 150 ms to process a picture, which is better than other methods.Table 1
Lane detection results on TuSimple dataset.
MethodIoURuntime (s)FCN [36]0.760.20VPGNet [26]0.890.41LaneNet [37]0.910.62SCNN [38]0.940.21Ours0.950.15


### 4.3. Complex Road Lane Line Fitting Results

After extracting the feature points, we also need to fit the lane-line feature points. To verify the robustness of the lane-line fitting algorithm, we performed current-lane detection and multilane-line detection on multiple datasets. As shown in Table2, the average accuracy was 97.61%. Our method is more accurate than other fitting algorithms. In the meantime, combining linear and polynomial fitting methods of feature points in different fields of view has higher precision than other algorithms. Therefore, the robustness of the proposed algorithm was verified by the detection accuracy.Table 2
Result of accuracy under different fitting methods.
DatasetLSSplineBezierOursTSD-0000093.993.494.898.6TSD-0000192.492.793.996.6TSD-0000292.592.693.497.1TSD-0000392.692.593.797.8TSD-0000492.393.194.696.8TSD-0000593.492.393.298.1TSD-0000692.993.794.297.4TSD-0000792.792.594.997.2TSD-0000892.793.694.098.5TSD-0000992.491.393.496.4TSD-0001094.193.895.299.2Table3 shows the detection accuracy in different environments. S is the total number of frames, MPR is the missed positive rate, FPR is the false positive rate, and TPR is the true positive rate. The calculation formulas of FPR and TPR are (14) and (15), respectively.
(14)FPR=FPFP+FN,(15)TPR=TPTP+TN.Table 3
Lane line detection accuracy under different scenes in TSD-MAX dataset.
FactorSMPR (%)FPR (%)TPR (%)Shadow9,9250.51.797.8Damaged11,3431.40.598.1Underexposed6,2431.81.796.5Overexposed15,3431.70.897.5Fog9,5613.11.095.9Rain13,2900.60.998.5Snow stain8,4241.33.595.2Night7,8981.20.698.2Figures10–14 show the results of fitting the lane lines in different scenes. The first column is the result of the line fitting, the second is the result of the curve fitting, and the third is the final fitting of the line and the curve result. Other complicated situations are shown in Figure 15. As can be seen from the figure, our fitting algorithm fits the real lane line better, and it is also very good at the corner.Figure 10
Straight line scenes.Figure 11
Multilane scenes.Figure 12
Block scenes.Figure 13
Dusk scenes.Figure 14
Curve scenes.Figure 15
Other complicated scenes.


### 4.4. Competition Results

Figure16 shows the response time comparison between our method and the traditional method. The results show that our method has a faster response speed. This shows that 5G-V2X has greatly improved the perception of complex roads and has met the real-time requirements.Figure 16
Comparison of response time.


## 4.1. Datasets and Validation

Our experiment was designed mainly to detect the real road information in real time, so the training and test datasets consisted of real road information. In this paper, we used the TuSimple lane dataset and TSD-MAX traffic scene dataset to verify the effectiveness of our method.It labeled the lanes of the test dataset and checked the accuracy of the IPM picture. We defined the criteria for the lane line as follows: where the input discrete point is regarded as the positive checkpoint in the true value area, TP is the total length of the positive lane-mark; FN is the total length of the missed check, and it equals the total marked true value minus TP; FP is the total length of a false check, and its value is equal to all extracted lane-mark points minus TP. For Mask R-CNN detection accuracy intersection over union (IoU), the following formula (13) is also applicable.
(13)SIoU=TPTP+FP+FN.


## 4.2. Complex Road Lane Line Detection Results

In the driving process of an intelligent vehicle, due to the complexity and diversity of the driving environment, false and missed detections often occur. Our proposed deep learning-based lane-marker extraction algorithm can well shield the influence of these uncertain factors on the lane-marker extraction results, so as to adapt to the complex and varied real road environment. Figure9 shows the results of training using our improved model. As is shown in Figure 9, our model clearly identifies all the information.Figure 9
Mask R-CNN detection results in different scenarios.Table1 shows the comparison of our improved method and some semantic segmentation methods on the TuSimple lane dataset. As shown in Table 1, our method is more accurate than most of the state-of-the-art methods on the TuSimple lane test dataset. SCNN has certain requirements on the location distribution of lane lines, and it is suitable for the TuSimple lane dataset which have a fixed overall linear number and less scene changes. At the same time, Table 1 shows the processing speed comparison of the model. Our method takes only 150 ms to process a picture, which is better than other methods.Table 1
Lane detection results on TuSimple dataset.
MethodIoURuntime (s)FCN [36]0.760.20VPGNet [26]0.890.41LaneNet [37]0.910.62SCNN [38]0.940.21Ours0.950.15


## 4.3. Complex Road Lane Line Fitting Results

After extracting the feature points, we also need to fit the lane-line feature points. To verify the robustness of the lane-line fitting algorithm, we performed current-lane detection and multilane-line detection on multiple datasets. As shown in Table2, the average accuracy was 97.61%. Our method is more accurate than other fitting algorithms. In the meantime, combining linear and polynomial fitting methods of feature points in different fields of view has higher precision than other algorithms. Therefore, the robustness of the proposed algorithm was verified by the detection accuracy.Table 2
Result of accuracy under different fitting methods.
DatasetLSSplineBezierOursTSD-0000093.993.494.898.6TSD-0000192.492.793.996.6TSD-0000292.592.693.497.1TSD-0000392.692.593.797.8TSD-0000492.393.194.696.8TSD-0000593.492.393.298.1TSD-0000692.993.794.297.4TSD-0000792.792.594.997.2TSD-0000892.793.694.098.5TSD-0000992.491.393.496.4TSD-0001094.193.895.299.2Table3 shows the detection accuracy in different environments. S is the total number of frames, MPR is the missed positive rate, FPR is the false positive rate, and TPR is the true positive rate. The calculation formulas of FPR and TPR are (14) and (15), respectively.
(14)FPR=FPFP+FN,(15)TPR=TPTP+TN.Table 3
Lane line detection accuracy under different scenes in TSD-MAX dataset.
FactorSMPR (%)FPR (%)TPR (%)Shadow9,9250.51.797.8Damaged11,3431.40.598.1Underexposed6,2431.81.796.5Overexposed15,3431.70.897.5Fog9,5613.11.095.9Rain13,2900.60.998.5Snow stain8,4241.33.595.2Night7,8981.20.698.2Figures10–14 show the results of fitting the lane lines in different scenes. The first column is the result of the line fitting, the second is the result of the curve fitting, and the third is the final fitting of the line and the curve result. Other complicated situations are shown in Figure 15. As can be seen from the figure, our fitting algorithm fits the real lane line better, and it is also very good at the corner.Figure 10
Straight line scenes.Figure 11
Multilane scenes.Figure 12
Block scenes.Figure 13
Dusk scenes.Figure 14
Curve scenes.Figure 15
Other complicated scenes.


## 4.4. Competition Results

Figure16 shows the response time comparison between our method and the traditional method. The results show that our method has a faster response speed. This shows that 5G-V2X has greatly improved the perception of complex roads and has met the real-time requirements.Figure 16
Comparison of response time.


## 5. Conclusions

In this article, we propose a real-time road perception method based on deep learning and 5G-V2X. Compared with the traditional method, this method has higher road perception ability and faster response time. Using linear fitting and polynomial fitting methods of feature points in different fields of view, the lane markings can be extracted robustly under various complex practical conditions, and the optimal parameter equations of the lane lines can be obtained. The experimental results show that the method adopted in this paper can better adapt to various types of road scenes. The algorithm has good detection effect in different scenarios, fast processing speed, good fitting effect, wide application scenarios, and strong robustness. In future work, we will focus on the optimization of the fitting algorithm to further improve the real-time performance in a dense traffic scenario of the proposed method.



---

*Source: 4405242-2022-01-10.xml*