# DeepCF: A Deep Feature Learning-Based Car-Following Model Using Online Ride-Hailing Trajectory Data

Authors: Yizhen Xie; Qichao Ni; Osama Alfarraj; Haoran Gao; Guojiang Shen; Xiangjie Kong; Amr Tolba
Journal: Wireless Communications and Mobile Computing
 (2020)

---

## Abstract

The car-following model describes the microscopic behavior of the vehicle. However, the existing car-following models set the drivers’ reaction time to a fixed value without considering its dynamics. In order to improve the accuracy of car-following model, this paper proposes Deep Feature Learning-based Car-Following Model (DeepCF), a car-following model based on fatigue driving and Generative Adversarial Networks (GAN). The model is composed of the drivers’ reaction time model and the car-following decision algorithm. First, we regard driving fatigue as the starting point to study the influence of driving time and the acceleration of the preceding vehicle on the drivers’ reaction time, and develop a coarse-grained drivers’ reaction time model. Secondly, considering the impact of fatigue driving on car-following decisions, we utilize GAN to generate a driving decision database based on reaction time and use Euclidean distance as a decision search indicator. Finally, we conduct experiments on a real data set, and the results indicate that our DeepCF model is superior to baseline models.


---

## Body

## 1. Introduction

Vehicle following, the most common drivers’ behavior in traffic, exerts more important influence on many factors including traffic flow characteristics, traffic safety, and traffic simulation results. The car-following model serves as a basic algorithm of traffic simulation tools (such as SUMO and VISSIM) and an indispensable control algorithm for automated vehicles [1, 2]. The model is aimed at replicating drivers’ car-following behavior. The kinematics-based car-following model attempts to describe the kinematic mechanism of vehicle-following maneuver [3–12]. Most of the parameters have obvious physical meaning. The output of the model can be easily controlled by adjusting the model parameters, so as long as the appropriate parameters, it can perform better in car safety. As the car-following model based on machine learning attempts to learn the human drivers’ vehicle-following motion from a large number of human drivers’ vehicle-tracking data [13–17], this category of model has a high accuracy in simulating the human drivers’ vehicle following.However, as the existing car-following models have become increasingly accurate in predicting driving decisions, they overlook the dynamic time for the drivers to execute the decision [18]. They set the drivers’ reaction time to a fixed value [19]. This setting will greatly affect the car-following simulation performance. For example, in the car-following case, the front car brakes suddenly, causing the rear drivers to decide to slow down [20]. If this decision is 1.3 seconds late, it is likely to collide with the car ahead. Khodayari et al. use the performance characteristics of the drivers’ stimulus and reaction while driving to calculate the drivers’ reaction time in NGSIM data [21]. And they add the reaction time as known information to the existing car-following model for simulation experiments [22]. Finally, they confirmed that the drivers’ reaction time existing in the car-following model will greatly improve the accuracy of the model simulation. However, they failed to build a model capable of calculating the drivers’ reaction time. In addition, in predicting the driving behavior of the drivers, the existing car-following model does not involve two crucial factors. One is the impact of driving fatigue on driving decisions; the other is that driving fatigue causes the drivers’ sensitivity and judgment to decline [23]. For example, driving for 1 hour continuously, a driver who faces the sudden acceleration of the vehicle ahead may be inclined to follow the same behaviour. However, when driving continuously for 3 h, in the face of the same scenario, the drivers’ decision may be conservative acceleration, that is, the throttle will be much lighter than that before 2 h.In this paper, we propose Deep Feature Learning-based Car-Following Model (The model frame diagram is shown in Figure1). First, we study the influence of driving time and the acceleration of the preceding vehicle on the drivers’ reaction time and establish a coarse-grained drivers’ reaction time model. Secondly, grounded in the impact of driving time on car-following decisions, we generate a driving decision database based on GAN and use Euclidean distance as a decision indicator. Then, the decision search algorithm is proposed. Finally, we conduct contrast experiments on a real trajectory data, and the performance of DeepCF is evaluated.Figure 1
The framework of DeepCF model.The main contributions of this paper are listed as follows:(1)
A car-following decision algorithm based on Generative Adversarial Networks is proposed, and a method for establishing a driving decision database based on Euclidean distance as a decision index is proposed(2)
We design the framework based on the evidence that driving for a longer time will lead to a longer reaction time of the drivers(3)
Analyze the model using China’s online car-hailing trajectory dataThe paper is organized as follows: Section2 introduces the related work of the car-following model. Section 3 designs the car-following model. Section 4 provides experimental results and compares them with traditional regression models. Section 5 summarizes the whole article.


## 2. Related Work

In this section, we first introduce the existing car-following model based on kinematics and the car-following model using machine learning algorithms. Then, we illustrate that the fatigue state will affect the drivers’ reaction time.


### 2.1. Car-Following Model

Car-following models can be divided into kinematics-based models and models with machine learning algorithms. In the kinematics-based car-following models, Chandler et al. [3] first proposed the General Motors (GM) model. This model puts forward the relative speed of the front and rear vehicles to calculate the acceleration of the rear vehicle [4, 5]. The Gipps model takes the safety distance into account [6]. The optimal speed model obtains the expected rear vehicle speed based on the distance between the front and rear car heads [7, 8]. The action point model divides car following into different stages and sets space or speed thresholds separately [11, 12]. The car-following models based on machine learning algorithms are data-driven models. Wewerinke [13] uses neural networks to model the car-following behavior and achieves high performance. Khodayari et al. [14] propose an improved neural network car-following model with response time as input and verified it using NGSIM data [21]. The results show that the error is significantly less than other neural network models. Wei et al. [16] established a car-following model based on least squares support vector machine (LS-SVR) and used the microscopic traffic simulation system dataset [17] to verify the model. The experimental results show that LS-SVR car-following model is more accurate than the Gipps car-following model [6] and neural network car-following model.


### 2.2. Drivers’ Reaction Time

In driving tasks, the drivers’ brain nerve activity caused by exogenous stimuli is correlated with the drivers’ reaction time [24], and there are many factors that can significantly affect the drivers’ reaction time. Weng [23] divide the drivers’ reaction behavior into three stages of perception, determination, and action. And this paper verified that the drivers’ sensitivity and judgment ability would weaken on a long road under fatigue state, and it would take longer time to make driving decisions. Visual distraction can further cause drivers to lose their attention on the road and affect their reaction time [25, 26]. Ru et al. [27] confirm that the subjective conditions that interfere with the drivers’ response include driving experience, mental and physical conditions, and adaptability. Petermeijer et al. [28] explore the interaction between nondriving task types and take-over request methods. The test experiment of 101 volunteers confirm that nondriving tasks will increase the response time of the corresponding take-over request, and the initial response time of tactile and auditory take-over requests is lower than that of visual. In a traffic accident scenario, the drivers’ reaction is related to the speed of obstacles before the accident [29], and the drivers’ reaction time is linearly related to the collision time [30]. Xue et al. [31] analyze the simulation data of 47 volunteers in simulated car-following scenarios and found that in the case of high traffic flow density, the response time of drivers is usually shorter than that of low to medium traffic density [32, 33], while the response time of male and nonprofessional drivers tends to be slightly longer [34].


## 2.1. Car-Following Model

Car-following models can be divided into kinematics-based models and models with machine learning algorithms. In the kinematics-based car-following models, Chandler et al. [3] first proposed the General Motors (GM) model. This model puts forward the relative speed of the front and rear vehicles to calculate the acceleration of the rear vehicle [4, 5]. The Gipps model takes the safety distance into account [6]. The optimal speed model obtains the expected rear vehicle speed based on the distance between the front and rear car heads [7, 8]. The action point model divides car following into different stages and sets space or speed thresholds separately [11, 12]. The car-following models based on machine learning algorithms are data-driven models. Wewerinke [13] uses neural networks to model the car-following behavior and achieves high performance. Khodayari et al. [14] propose an improved neural network car-following model with response time as input and verified it using NGSIM data [21]. The results show that the error is significantly less than other neural network models. Wei et al. [16] established a car-following model based on least squares support vector machine (LS-SVR) and used the microscopic traffic simulation system dataset [17] to verify the model. The experimental results show that LS-SVR car-following model is more accurate than the Gipps car-following model [6] and neural network car-following model.


## 2.2. Drivers’ Reaction Time

In driving tasks, the drivers’ brain nerve activity caused by exogenous stimuli is correlated with the drivers’ reaction time [24], and there are many factors that can significantly affect the drivers’ reaction time. Weng [23] divide the drivers’ reaction behavior into three stages of perception, determination, and action. And this paper verified that the drivers’ sensitivity and judgment ability would weaken on a long road under fatigue state, and it would take longer time to make driving decisions. Visual distraction can further cause drivers to lose their attention on the road and affect their reaction time [25, 26]. Ru et al. [27] confirm that the subjective conditions that interfere with the drivers’ response include driving experience, mental and physical conditions, and adaptability. Petermeijer et al. [28] explore the interaction between nondriving task types and take-over request methods. The test experiment of 101 volunteers confirm that nondriving tasks will increase the response time of the corresponding take-over request, and the initial response time of tactile and auditory take-over requests is lower than that of visual. In a traffic accident scenario, the drivers’ reaction is related to the speed of obstacles before the accident [29], and the drivers’ reaction time is linearly related to the collision time [30]. Xue et al. [31] analyze the simulation data of 47 volunteers in simulated car-following scenarios and found that in the case of high traffic flow density, the response time of drivers is usually shorter than that of low to medium traffic density [32, 33], while the response time of male and nonprofessional drivers tends to be slightly longer [34].


## 3. Methodology

This section introduces the DeepCF model in detail, including driver reaction time model and car-following decision algorithm based on GAN.


### 3.1. Drivers’ Reaction Time Model Based on Fatigue Driving Phase Combination Model

It is intuitively obvious that the drivers’ reaction time of fatigue driving is longer than that of normal driving. And in the assumption of this paper, the car-following decision is closely related to the drivers’ reaction time. We need to reveal the relationship between the drivers’ reaction time and driving time to build drivers’ reaction time model. The reaction time model can quantitatively represent the relationship between driving time and reaction time. They investigate 294 drivers and test their reaction time [35]. The final statistical results showed a strong correlation between duration of driving and reaction time. On the basis of their experimental results, we use the cubic function to fit the relationship between duration of driving and the slowest reaction time. Our experiments show that cubic polynomials are the best choice to fit this relation. Due to the lack of original experimental data, the accuracy of the fitted function remains to be verified. The formulas are shown in Equation (1) and function visualization is shown in Figure 2.Figure 2
Drivers’ reaction time function. Reaction time is positively correlated with driving duration.According to the results of our experiment, in Equation (1), α3 is -0.067, α2 is 0.9769, α1 is 15.27 and, α0 is 434.4. These parameters can fit the duration of time and drivers’ reaction time well. And there is no overfitting in this model.
(1)τx=α3x3+α2x2+α1x+α0.


### 3.2. Car-following Decision Algorithm Model Based on Generative Adversarial Network

We need to design the drivers’ car-following decision algorithm. First, we need to establish a decision library. We will use GAN (Generative Adversarial Network) to generate the decision library rules. GAN, an unsupervised deep learning model, is composed of two parts: generator and discriminator. The generator generates data close to the characteristics of the training set as much as possible, and the discriminator should attempt to determine the authenticity of the generator. It can find out the internal statistical law of the given observation data and can generate brand new data similar to the observation data based on the obtained probability distribution model. The target formula is shown in Equation (2).
(2)minGmaxDVG,D=Ex~PdataxlogDx+Ez~Pzzlog1−DGz,where G is the differentiable function of the generator, D is the differentiable function of the discriminator, Pdata is a real sample, x is the sample taken from Pdata, and Dx means to distinguish x; we hope that the result of this discrimination is closer to 1, as possible the bigger the loss function logDx. Pz is the sample generated by G, z is the sample taken from PG, and DGzmeans to distinguish Gz; we hope that the smaller the result, as possible the bigger the loss function log1−DGz. The structure of the training set is shown in Table 1.Table 1
Training set data structure for GAN.
Attribute nameSpeed difference between front and rear carsRear vehicle speedFront and rear distanceAcceleration of rear car after reaction timeUnitKm/hKm/hmm/s2The network is divided into two parts: generator and discriminator. The generator is composed of input layer, hidden layer, activation layer, and output layer. The dimension of the input and output layers is1∗4. The hidden layer contains 2∗2∗11 neural network units. The activation layer is composed of the Maxout activation function and sets the k value to 2. Maxout has a strong fitting ability; it can fit any convex function. Maxout has the advantages of ReLU, such as no linear saturation, but also does not have the disadvantage that the ReLU unit is fragile and may die.Let the distribution generated by the generator (G) bePGx;θ, where θ is the parameter of the distribution. And let xi be derived from the true distribution in the generator to calculate the likelihood PGxi;θ as shown in Formula (3).
(3)L=∏m1PGxi;θ.Then, you need to find aθ∗ to maximize the likelihood, as shown in Formula (4).
(4)θ∗=argminθKLPdatax∣PGx;θ.The discriminator (D) is composed of an input layer, a hidden layer, an activation layer, and an output layer. The activation function is the sigmoid function. The discriminator’s data consists of two parts, the first part is the real data setPdata, and the second part is the fake data PG generated by the generator. If x comes from Pdata, Dx should be as close to 1 as possible. If x comes from PG, Dx should be as close to 0 as possible. The pseudocode of GAN algorithm is shown in Algorithm 1. The structure diagram of Algorithm 1 is shown in Figure 3.Algorithm 1. Minibatch stochastic gradient descent training algorithm for generating adversarial networks.
Input:Training set data distributionPdatax; random noise distribution Pgz; Total training times epochs; the number of iterations of the discriminator k; the learning rate of the discriminator s1; the learning rate of the generator s2; the amount of training data per batch n.Output:The network parameters of the discriminatorθd; network parameters of the generator θg.Begin1. Initializeθd,2. For epochs do3. For k do4. Sample n sampleszjj=1n from the random noise distribution Pgz5. Sample n samplesxjj=1n from the real data distribution Pdatax6. Updateθd by boosting the stochastic gradient:7.∇θd1/n∑j=1nlogDxj+log1−DGzj8. End for9. Sample n sampleszjj=1n from the random noise distribution Pgz10. Update∇θg with gradient by decreasing:11.∇θd1/n∑j=1nlogDxj+log1−DGzj12.EndFigure 3
Structure diagram of Algorithm1.The decision index is used to evaluate the similarity of the input features and the data of the decision database, that is, to calculate the similarity of the two feature vectors. There are many ways to calculate vector similarity, such as Pearson correlation coefficient, cosine similarity, and Manhattan distance. The decision index is mainly used to calculate the distance between two feature vectors, so this paper uses Euclidean distance. The index formula is shown in Formula (5). The purpose of the retrieval algorithm of this machine is to search the decision database for the decision plan (the fourth feature of Table 1) that is closest to the current driving state (the first three features of Table 1) to reach the goal of driving decision-making.
(5)sx,y=∑j=13xj−yj2,where y represents a feature vector in the decision library, x represents the input feature vector, and the first three features of x and y correspond to the first three features of the data structure shown in Table 1.Due to the relatively large amount of rule data in the decision database, traversing the entire decision database to find the most similar vectors may affect the algorithm performance, so the retrieval of the decision database should be optimized. The statistics show that, aside from extreme cases, the value range ofy1 is approximately [-5,10], the value range of y2 is approximately [0,70], and the value range of y3 is [1,80]. Then, there are about 80,000 combinations of these three feature vectors. The following defines the retrieval algorithm s¯su:Algorithm 2. Decision database retrieval algorithm s_su.
Input:Decision libraryD; Searched feature vector xOutput:The fourth feature of the most similar variabley4Begin1. StandardizedD and xSet the threshold2. Brush the database according to the feature vector x3. Pick out the vector setV within the threshold4. for i inV5. use the decision index algorithm to calculate the distance between x and i,c1=sx,i6. Sort the vector inV according to c17. Output the fourth feature of the closest vectorEnd


### 3.3. Deep Feature Learning-Based Car-Following Model

The driver reaction time model and the car-following decision algorithm have been obtained above, then we propose Deep Feature Learning-based Car-Following Model (DeepCF) here. Equations (6) and (7) describe the model details.
(6)τn=τx,(7)axt+τ=SsuD,x,where x is the feature vector.


## 3.1. Drivers’ Reaction Time Model Based on Fatigue Driving Phase Combination Model

It is intuitively obvious that the drivers’ reaction time of fatigue driving is longer than that of normal driving. And in the assumption of this paper, the car-following decision is closely related to the drivers’ reaction time. We need to reveal the relationship between the drivers’ reaction time and driving time to build drivers’ reaction time model. The reaction time model can quantitatively represent the relationship between driving time and reaction time. They investigate 294 drivers and test their reaction time [35]. The final statistical results showed a strong correlation between duration of driving and reaction time. On the basis of their experimental results, we use the cubic function to fit the relationship between duration of driving and the slowest reaction time. Our experiments show that cubic polynomials are the best choice to fit this relation. Due to the lack of original experimental data, the accuracy of the fitted function remains to be verified. The formulas are shown in Equation (1) and function visualization is shown in Figure 2.Figure 2
Drivers’ reaction time function. Reaction time is positively correlated with driving duration.According to the results of our experiment, in Equation (1), α3 is -0.067, α2 is 0.9769, α1 is 15.27 and, α0 is 434.4. These parameters can fit the duration of time and drivers’ reaction time well. And there is no overfitting in this model.
(1)τx=α3x3+α2x2+α1x+α0.


## 3.2. Car-following Decision Algorithm Model Based on Generative Adversarial Network

We need to design the drivers’ car-following decision algorithm. First, we need to establish a decision library. We will use GAN (Generative Adversarial Network) to generate the decision library rules. GAN, an unsupervised deep learning model, is composed of two parts: generator and discriminator. The generator generates data close to the characteristics of the training set as much as possible, and the discriminator should attempt to determine the authenticity of the generator. It can find out the internal statistical law of the given observation data and can generate brand new data similar to the observation data based on the obtained probability distribution model. The target formula is shown in Equation (2).
(2)minGmaxDVG,D=Ex~PdataxlogDx+Ez~Pzzlog1−DGz,where G is the differentiable function of the generator, D is the differentiable function of the discriminator, Pdata is a real sample, x is the sample taken from Pdata, and Dx means to distinguish x; we hope that the result of this discrimination is closer to 1, as possible the bigger the loss function logDx. Pz is the sample generated by G, z is the sample taken from PG, and DGzmeans to distinguish Gz; we hope that the smaller the result, as possible the bigger the loss function log1−DGz. The structure of the training set is shown in Table 1.Table 1
Training set data structure for GAN.
Attribute nameSpeed difference between front and rear carsRear vehicle speedFront and rear distanceAcceleration of rear car after reaction timeUnitKm/hKm/hmm/s2The network is divided into two parts: generator and discriminator. The generator is composed of input layer, hidden layer, activation layer, and output layer. The dimension of the input and output layers is1∗4. The hidden layer contains 2∗2∗11 neural network units. The activation layer is composed of the Maxout activation function and sets the k value to 2. Maxout has a strong fitting ability; it can fit any convex function. Maxout has the advantages of ReLU, such as no linear saturation, but also does not have the disadvantage that the ReLU unit is fragile and may die.Let the distribution generated by the generator (G) bePGx;θ, where θ is the parameter of the distribution. And let xi be derived from the true distribution in the generator to calculate the likelihood PGxi;θ as shown in Formula (3).
(3)L=∏m1PGxi;θ.Then, you need to find aθ∗ to maximize the likelihood, as shown in Formula (4).
(4)θ∗=argminθKLPdatax∣PGx;θ.The discriminator (D) is composed of an input layer, a hidden layer, an activation layer, and an output layer. The activation function is the sigmoid function. The discriminator’s data consists of two parts, the first part is the real data setPdata, and the second part is the fake data PG generated by the generator. If x comes from Pdata, Dx should be as close to 1 as possible. If x comes from PG, Dx should be as close to 0 as possible. The pseudocode of GAN algorithm is shown in Algorithm 1. The structure diagram of Algorithm 1 is shown in Figure 3.Algorithm 1. Minibatch stochastic gradient descent training algorithm for generating adversarial networks.
Input:Training set data distributionPdatax; random noise distribution Pgz; Total training times epochs; the number of iterations of the discriminator k; the learning rate of the discriminator s1; the learning rate of the generator s2; the amount of training data per batch n.Output:The network parameters of the discriminatorθd; network parameters of the generator θg.Begin1. Initializeθd,2. For epochs do3. For k do4. Sample n sampleszjj=1n from the random noise distribution Pgz5. Sample n samplesxjj=1n from the real data distribution Pdatax6. Updateθd by boosting the stochastic gradient:7.∇θd1/n∑j=1nlogDxj+log1−DGzj8. End for9. Sample n sampleszjj=1n from the random noise distribution Pgz10. Update∇θg with gradient by decreasing:11.∇θd1/n∑j=1nlogDxj+log1−DGzj12.EndFigure 3
Structure diagram of Algorithm1.The decision index is used to evaluate the similarity of the input features and the data of the decision database, that is, to calculate the similarity of the two feature vectors. There are many ways to calculate vector similarity, such as Pearson correlation coefficient, cosine similarity, and Manhattan distance. The decision index is mainly used to calculate the distance between two feature vectors, so this paper uses Euclidean distance. The index formula is shown in Formula (5). The purpose of the retrieval algorithm of this machine is to search the decision database for the decision plan (the fourth feature of Table 1) that is closest to the current driving state (the first three features of Table 1) to reach the goal of driving decision-making.
(5)sx,y=∑j=13xj−yj2,where y represents a feature vector in the decision library, x represents the input feature vector, and the first three features of x and y correspond to the first three features of the data structure shown in Table 1.Due to the relatively large amount of rule data in the decision database, traversing the entire decision database to find the most similar vectors may affect the algorithm performance, so the retrieval of the decision database should be optimized. The statistics show that, aside from extreme cases, the value range ofy1 is approximately [-5,10], the value range of y2 is approximately [0,70], and the value range of y3 is [1,80]. Then, there are about 80,000 combinations of these three feature vectors. The following defines the retrieval algorithm s¯su:Algorithm 2. Decision database retrieval algorithm s_su.
Input:Decision libraryD; Searched feature vector xOutput:The fourth feature of the most similar variabley4Begin1. StandardizedD and xSet the threshold2. Brush the database according to the feature vector x3. Pick out the vector setV within the threshold4. for i inV5. use the decision index algorithm to calculate the distance between x and i,c1=sx,i6. Sort the vector inV according to c17. Output the fourth feature of the closest vectorEnd


## 3.3. Deep Feature Learning-Based Car-Following Model

The driver reaction time model and the car-following decision algorithm have been obtained above, then we propose Deep Feature Learning-based Car-Following Model (DeepCF) here. Equations (6) and (7) describe the model details.
(6)τn=τx,(7)axt+τ=SsuD,x,where x is the feature vector.


## 4. Experiments

This chapter mainly introduces the experimental part, first introduces the comparative experiment, then defines the modulus evaluation index, and finally, analyzes the experimental results.


### 4.1. Experiment Data

The data set used in this article is the trajectory data of Didi drivers in Xi’an on October 26 and 27, 2016, provided by Didi Travel (please visit:https://outreach.didichuxing.com/research/opendata/).The data set tracks approximately 18,000 vehicles, including the vehicle number, location, and time. The trajectory tracking time interval is 1 s. We screened the vehicles driving continuously for more than 3 h between 4:00-22:00, and finally extracted 5748 following scenes. The car-following duration is 9 s. We further add attributes such as speed, acceleration, driving duration, and distance to each piece of data. We divided the data set into two groups, the first group is the following vehicles in the scene where the driving time of the rear vehicle is less than two hours, and the second group is the vehicle that exceeds two hours. Besides that, we select 100 follow-up scenes in each group as the test set. Data attribute list refers to Table2.Table 2
Data attributes.
FieldType of dataExampleRemarksDriver IDStringglox.jrrlltBMvCh8nxqktdr2dtopmlHData encryption processingOrder IDStringjkkt8kxniovIFuns9qrrlvst@iqnpkwzData encryption processingTimestampString1501584540Unix timestamp, in secondsLongitudeString104.04392GCJ-02 coordinate systemLatitudeString30.6863GCJ-02 coordinate system


### 4.2. Comparative Experiment

T. Cover and P. Hart proposed k-nearest neighbor in 1967. The working principle is there is a sample data set, and each data in the sample set has a label, that is, we know the correspondence between each data in the sample set and its classification. After inputting new data without labels, we compare each feature of the new data with the features corresponding to several types of data in the sample, and then, the algorithm extracts the classification label of the most similar data (nearest neighbor) of the sample. It uses the following Formula (8) to calculate the distance D. x and y are the two features that need to be calculated.
(8)D=x1−x22+y1−y22.Random forest is a model composed of many decision trees. In the training process, each tree in the random forest will learn from randomly sampled data points. The idea is to train each tree on different samples. Although for a specific training data set, the variance of each tree may be high, but in general, the variance of the entire forest will be very low without increasing the offset. In the test, predictions are made by averaging the predictions of each decision tree. This process of training a single learner on different self-sampled data subsets and averaging predictions is called bagging. The cart tree is used in the random forest algorithm in Sklearn.The Gini index reflects the probability that two samples are randomly selected from the data set, and their category labels are inconsistent. Therefore, the smaller the Gini index, the higher the purity of the data set. The Gini index (Formula (9)) can be used to measure any uneven distribution. It is a number between 0 and 1.0 that is completely equal, and 1 is completely unequal.
(9)GiniD∣A=∑K=1KCkD1−CkD,where k represents the category.The CART classification tree uses the size of the Gini coefficient to measure the division points of features. In the regression model, we adopt the common sum variance measurement method. For any partition feature A, the corresponding arbitrary partition points is divided into data sets D1 and D2 on both sides, and the mean square error of each set of D1 and D2 is minimized. The feature and feature value division point corresponding to the minimum sum of mean square error of D1 and D2. The expression is Formula (10):
(10)yi−c1mina,sminc1∑xi∈D1yi−c12+minc2∑xi∈D2yi−c22.Among them,c1 is the sample output average of the D1 data set, and c2 is the sample output average of the D2 data set.


### 4.3. Model Evaluation

In this paper, mean absolute error (MAE), mean squared error (MSE), and root mean squared error (RMSE) are used for measurement and evaluation [36]. The indicator formulas are shown in Equations (11), (12), and (13).
(11)MAE=1N∑i=1Nxi−x^i,(12)MSE=1N∑i=1Nxi−x∧i2,(13)RMSE=1N∑i=1Nxi−x∧i2,where N is the total number of samples, xi represents real data value of car i, and x^i means the predicted value of the model.


## 4.1. Experiment Data

The data set used in this article is the trajectory data of Didi drivers in Xi’an on October 26 and 27, 2016, provided by Didi Travel (please visit:https://outreach.didichuxing.com/research/opendata/).The data set tracks approximately 18,000 vehicles, including the vehicle number, location, and time. The trajectory tracking time interval is 1 s. We screened the vehicles driving continuously for more than 3 h between 4:00-22:00, and finally extracted 5748 following scenes. The car-following duration is 9 s. We further add attributes such as speed, acceleration, driving duration, and distance to each piece of data. We divided the data set into two groups, the first group is the following vehicles in the scene where the driving time of the rear vehicle is less than two hours, and the second group is the vehicle that exceeds two hours. Besides that, we select 100 follow-up scenes in each group as the test set. Data attribute list refers to Table2.Table 2
Data attributes.
FieldType of dataExampleRemarksDriver IDStringglox.jrrlltBMvCh8nxqktdr2dtopmlHData encryption processingOrder IDStringjkkt8kxniovIFuns9qrrlvst@iqnpkwzData encryption processingTimestampString1501584540Unix timestamp, in secondsLongitudeString104.04392GCJ-02 coordinate systemLatitudeString30.6863GCJ-02 coordinate system


## 4.2. Comparative Experiment

T. Cover and P. Hart proposed k-nearest neighbor in 1967. The working principle is there is a sample data set, and each data in the sample set has a label, that is, we know the correspondence between each data in the sample set and its classification. After inputting new data without labels, we compare each feature of the new data with the features corresponding to several types of data in the sample, and then, the algorithm extracts the classification label of the most similar data (nearest neighbor) of the sample. It uses the following Formula (8) to calculate the distance D. x and y are the two features that need to be calculated.
(8)D=x1−x22+y1−y22.Random forest is a model composed of many decision trees. In the training process, each tree in the random forest will learn from randomly sampled data points. The idea is to train each tree on different samples. Although for a specific training data set, the variance of each tree may be high, but in general, the variance of the entire forest will be very low without increasing the offset. In the test, predictions are made by averaging the predictions of each decision tree. This process of training a single learner on different self-sampled data subsets and averaging predictions is called bagging. The cart tree is used in the random forest algorithm in Sklearn.The Gini index reflects the probability that two samples are randomly selected from the data set, and their category labels are inconsistent. Therefore, the smaller the Gini index, the higher the purity of the data set. The Gini index (Formula (9)) can be used to measure any uneven distribution. It is a number between 0 and 1.0 that is completely equal, and 1 is completely unequal.
(9)GiniD∣A=∑K=1KCkD1−CkD,where k represents the category.The CART classification tree uses the size of the Gini coefficient to measure the division points of features. In the regression model, we adopt the common sum variance measurement method. For any partition feature A, the corresponding arbitrary partition points is divided into data sets D1 and D2 on both sides, and the mean square error of each set of D1 and D2 is minimized. The feature and feature value division point corresponding to the minimum sum of mean square error of D1 and D2. The expression is Formula (10):
(10)yi−c1mina,sminc1∑xi∈D1yi−c12+minc2∑xi∈D2yi−c22.Among them,c1 is the sample output average of the D1 data set, and c2 is the sample output average of the D2 data set.


## 4.3. Model Evaluation

In this paper, mean absolute error (MAE), mean squared error (MSE), and root mean squared error (RMSE) are used for measurement and evaluation [36]. The indicator formulas are shown in Equations (11), (12), and (13).
(11)MAE=1N∑i=1Nxi−x^i,(12)MSE=1N∑i=1Nxi−x∧i2,(13)RMSE=1N∑i=1Nxi−x∧i2,where N is the total number of samples, xi represents real data value of car i, and x^i means the predicted value of the model.


## 5. Results and Discussion

This paper proposes a car-following model based on driving fatigue and generative confrontation network, namely, dynamic car-following model (DeepCF). We use 474 real car-following scenes for experiments, and the experiments combine the DeepCF model proposed in this article with the regression model regression tree (RT), polynomial kernel function (PKF), radial basis kernel function (RBKF), boost tree (BT), extreme forest (EF), linear kernel (LK), k-nearest neighbor (KNN), and random forest (RF) for comparison. We use MAE, MSE, and RMSE as evaluation indicators. We use 474 real car-following scenes as the test set.First, we use all real 8000 car-following scenes as a decision library. Besides, we adopt the decision database retrieval algorithms¯su; the acceleration of the following vehicle after the reaction time is matched according to the speed of the following vehicle, the distance between the front and rear vehicles, and the speed difference between the front and rear vehicles in the test set. And we calculate the evaluation index of the comparison between the real car-following scene and the matching result (for the convenience of subsequent experiments, we will name the experiment CF here). Then, we use the above regression model to obtain the acceleration of the following vehicle after the reaction time. It also calculates the evaluation index comparing the real car-following scene with the regression result. Finally, we compare the evaluation index of the matching result with the evaluation index of the regression result. The results are shown in Figures 4, 5, and 6.Figure 4
Comparison of CF and regression model with MAE as an evaluation index.Figure 5
Comparison of CF and regression model with MSE as an evaluation index.Figure 6
Comparison of CF and regression model with RMSE as an evaluation index.According to Figures3, 4, and 5, we can find that when using a limited number of real car-following scenes as the decision-making database, using the decision-making database retrieval algorithms, the matching results are better than RT, EF, KNN, and other regression models. However, compared with RBKF, LK, and other regression models, there is still a certain gap.We use 8000 real car-following scenes as raw data to use the GAN to generate 80,000 car-following scenes, and combine the real and generated car-following scenes as a decision library. Using the decision database retrieval algorithms¯su, the acceleration of the following vehicle after the reaction time is matched according to the speed of the following vehicle, the distance between the front and rear vehicles, and the speed difference between the front and rear vehicles in the test set. And we calculate the evaluation index of the comparison between the real car-following scene and the matching result (our model DeepCF). We compare the evaluation indicators obtained after the DeepCF model experiment with the above CF model Figure 7.Figure 7
DeepCF compared with CF.We find that after using the GAN to expand the decision-making database, the matching results are significantly better than before data generation. This proves the necessity of using GAN to generate car-following scenes.We compare the evaluation indicators obtained after the DeepCF model experiment with the regression model, and the results are shown in Figures8, 9, and 10.Figure 8
Comparison of DeepCF and regression model with MAE as an evaluation index.Figure 9
Comparison of DeepCF and regression model with MSE as an evaluation index.Figure 10
Comparison of DeepCF and regression model with RMSE as an evaluation index.In the premise of using the confrontation generation network to generate 80,000 car-following scenes with 8000 real car-following scenes as raw data, combining the real and generated car-following scenes as a decision-making database and adopting the decision-making database retrieval algorithms, the matching data performs better than most data in the regression model. Thus, the effectiveness of our DeepCF model is proved.


## 6. Conclusions

In view of the fact that existing car-following models fail to consider the impact of driving fatigue on driver reaction time and decision-making, this paper proposes a car-following model (DeepCF) based on driving fatigue and generating a confrontation network. A car-following decision algorithm based on a generative confrontation network is proposed, and we build a driving decision database with GAN. Besides a comparative experiment, we further conduct a comparative evaluation of the model. The results demonstrate that our car-following model (DeepCF) is closer to the real scene than the regression model.



---

*Source: 8816681-2020-12-07.xml*