Regular Vehicle Spatial Distribution Estimation Based on Machine Learning

the original


Introduction
ITSs have developed rapidly in recent years because of their great potential for improving trafc fow characteristics, such as solving existing trafc congestion problems, low safety, and low resource utilization. As an essential part of the deployment of ITS, CVs are known as vehicles that can share information (such as position, velocity, and acceleration) with other CVs by using the vehicle to everything (V2X) technology. Terefore, a safer, more efcient, and energy-saving road network is created. However, the penetration of CVs will not be entirely popularized in the short term. At this stage, CVs and RVs will coexist on the roads, and a mixed trafc fow will be emerging [1]. At the same time, many researchers have conducted in-depth research on the characteristics of the mixed trafc fow, such as the queue safety evaluation [2], capacity analysis [3], and vehicle to road cooperative control optimization [4].
Tese studies explain the critical role of CVs in the overall improvement of trafc fow characteristics. However, due to the existence of RVs, the application performance of CVs is inevitably limited. Terefore, estimating the distribution of RVs and CVs is indispensable for deploying ITS (e.g., analyzing road networks and achieving trafc optimization control). Traditional trafc fow state estimation methods widely use fxed sensors [5], such as loop detectors, cameras, and other equipment, to monitor the road trafc fow and vehicle state information. However, these methods have limitations, such as fxed monitoring positions and high installation and maintenance costs. Unlike fxed sensors, CVs can interact with roads, vehicles, and cloud platforms. With the advantages of high fexibility and low cost, it has become a reality for CVs to collect data as mobile sensors for trafc fow analysis [6]. Reference [7] analyzed the characteristics of a mixed trafc fow with the maximum platoon size of CAVs. Te conclusion shows that the trafc beneft does not increase all the time when the vehicle platoon reaches a certain level. References [8,9] pointed out that there are three spatial distributions of CVs and RVs in the queue. In the frst case, CVs are concentrated; the road trafc efciency is the highest, and the safety is the best. In the second case, CVs and RVs are uniformly distributed on the road, the road trafc efciency is the lowest, and the safety is the worst. CVs and RVs are randomly distributed in the third case, and the trafc fow characteristics are between the previous two cases. Reference [10] proposed a method for estimating the trafc state and market penetration of CVs on highways. CVs and roadside units are used as mobile and fxed sensors to form a hybrid sensor. A fltering approach is used to estimate the trafc state under the mixed trafc fow. Reference [11] used the Markov chain to prove that the orderly arrangement of CVs signifcantly increased the road capacity. At the same time, relative entropy was introduced to quantitatively describe the orderliness of the mixed trafc fow, and the root cause of the improvement of road trafc capacity by CVs was clarifed. Reference [12] pointed out that the emergence of RVs inhibits the formation of CV queues, which is not conducive to realizing cooperative driving. Te discrete hidden Markov method is used to estimate the number of RVs in adjacent CVs. However, the discretization process of this method is prone to problems such as quantization error and signal distortion, which weakens the resolution of the model, so the recognition accuracy needs to be improved.
Overall, there are two areas for improvement in the existing methods for estimating the state of mixed trafc fows. First, they rely on fxed sensors to detect the road fow and vehicle status, and it is difcult to identify the specifc distribution of CVs and RVs. Second, some of the methods start from studying trafc fow mechanism characteristics, and the theoretical techniques and implementation are relatively complicated, and the accuracy needs to be improved.
Aiming to address the problem of the regular vehicle spatial distribution estimation without introducing complex statistical derivation processes or adding other monitoring equipment, this paper proposes a method to estimate the spatial distribution of RVs by using the interaction information of adjacent CVs. Based on the concept of data driven, by analyzing the internal mechanism of the spatial distribution of RVs and the information interaction of CVs, a GMM-HMM model is established by taking the relative position and the time headway of adjacent CVs as the input and the spatial distribution of RVs as the output. Teoretical derivation and numerical simulation verify the efectiveness of this method.

Modeling of Regular Vehicle Spatial Distribution Estimation
2.1. Mechanistic Analysis. CVs and RVs are most likely to be driven by humans at this stage. CVs can use V2X to share vehicle driving status information within a certain communication range. At the same time, it reduces the reaction delay time of the driver's decision making during driving so that the vehicle can drive on the road with minor headway and spacing. For the mixed trafc fow composed of CVs and RVs, the spatial distribution of RVs and the information of CVs are spatially and temporally correlated, as shown in Figure 1. In Figure 1, within a certain communication range, CVs interact with each other for driving information, such as position x n (t), x n−1 (t), velocity v n (t), v n−1 (t), and acceleration a n (t), a n−1 (t)) at diferent times. Tis time-varying information is closely related to the spatial distribution of RVs (the number of RVs in the green dotted box in Figure 1) and can be collected for further processing. Te relative position ∆x n (t), relative velocity ∆v n (t), relative acceleration ∆a n (t), and time headway T h (t) of adjacent CVs are defned as follows: ∆a n (t) � a n−1 (t) − a n (t), where x n−1 (t), v n−1 (t), and a n−1 (t) denote the position, velocity, and acceleration of the leading connected vehicle, respectively; x n (t), v n (t), and a n (t) denote the position, velocity, and acceleration of the following connected vehicle, respectively. Using diferent combinations of the abovementioned four features as the observed features (the dimensionality is determined by the number of selected features), it is estimated that the regular vehicle spatial distribution can be implemented by using machine learning methods.

Model Construction.
Before introducing the model of our paper, we present some key assumptions to facilitate the modeling process.
(1) We consider only the longitudinal behavior of all kinds of vehicles. Tat is, the behavior of vehicle changing the lane is not considered.
(2) Te network information is reliable, and the transmission delay is ignored. All drivers fully obey the advanced driving assistance suggestions. (3) All kinds of vehicles are driven by humans, regardless of the existence of automatic drive.

Methodology.
Te extracted features of the information of CVs are continuous and generally present a Gaussian distribution. To estimate the hidden regular vehicle spatial distribution from the visible observed features, this paper uses the GMM-HMM [13] as the identifcation method.
In this paper, the spatial distribution of RVs between adjacent CVs is regarded as the hidden state to be identifed. More specifcally, there are 0 RV, 1 RV, and at least 2 RVs between adjacent CVs represented by hidden states q 3 , respectively. Te feature information of adjacent CVs (different combinations of relative position, relative velocity, relative acceleration, and time headway) is used as the observed features. Te transition of the hidden state at diferent moments is described by the state transition probability, and the mapping relationship between the observed features and the hidden state is described by the output probability, as shown in Figure 2.
GMM-HMM is composed of the initial probability vector π, the state transition matrix A, and the output probability matrix B, which is represented by a triple symbol λ � (π, A, B). When the hidden state sequence I � (i 1 , i 2 , . . . , i T ) and the observation feature sequence O � (o 1 , o 2 , . . . , o T ) of the model are given, the initial probability vector π � (π 1 , π 2 , . . . , π N ) with N components, which satisfes the following equation: Te state transition matrix A � [a ij ] N×N , which describes the probability of transferring from the hidden state q i at time t to the hidden state q j at time t + 1, satisfes the following equation: Te output probability matrix B � [b j (k)] N×k refers to the mapping relationship between the hidden state value q i and the observed feature v k at any time which satisfes the following equation: Since the observed feature v k is continuous, the multidimensional mixed Gaussian distribution describes the joint probability distribution between the hidden state value q i and the observed feature v k . Equation (7) can be rewritten as follows: where c jm is the weight coefcient of the m − th Gaussian distribution in the GMM when it is in the hidden state q j ; M is the number of Gaussian components; D denotes the dimensionality of the observed random variable o t ; and u jm ∈ R D×1 and Σ jm ∈ R D×D are the mean vector and the covariance matrix of Gaussian distribution N(o t | u jm , Σ jm ), respectively.

Model Training and Testing
Process. Te number of hidden states N and Gaussian components M in the GMM-HMM is regarded as hyperparameters. Te remaining model parameters need to be trained by EM (expectation-maximum) algorithm through massive historical data. Te model training and testing process is shown in Figure 3. Te EM algorithm is used to estimate the model parameters, including initial state probability distribution π j , state transition probability a ij , mixed Gaussian distribution weight coefcient c jm , mean vector u jm , and covariance matrix Σ jm . After the abovementioned training process, the model parameters λ � (π, A, B) are obtained. Given the observation feature sequence O � (o 1 , o 2 , . . . , o T ), the Viterbi algorithm can be used to determine the hidden state sequence I � (i 1 , i 2 , . . . , i T ).

Data Preparation and Processing.
Te basic dataset used in this paper comes from NGSIM (next generation simulation) [14]. From this dataset, 50 vehicle trajectories with recorded position, speed, and acceleration information were randomly extracted from the I-80 section. Due to some noise and errors in the raw data, the vehicle position, velocity, and acceleration are preprocessed using a moving average flter. Te original data and fltered data are shown in Figure 4.
To obtain the characteristic data of the combination of CVs and RVs required for the study using the theory proposed in Reference [15], the car-following models of CVs and RVs are considered IDM [16] with diferent response delay times. Te acceleration of the following vehicle n at time t + τ satisfes the following equations: where a n and v n denote the acceleration and velocity of the vehicle n, respectively; s * (·) is the desired minimum gap; ∆v n � v n−1 − v n and ∆x n � x n−1 − x n denote the speed difference and position diference between the leading vehicle n − 1 and the following vehicle n, respectively; a and b denote the maximum acceleration and expected deceleration of the vehicle n, respectively; v f is the desired velocity; and s 0 and T denote the jam gap and safe time headway, respectively. Te abovementioned 50 vehicles are the leading vehicles, and the sampling time is set to 0.1 s. When the market penetration rate (MPR) of CVs is 0.3, 0.5, and 0.7, the feature datasets (the corresponding sample sizes are 36400 groups, 72800 groups, and 109200 groups, respectively) of 500 mixed CVs and RVs are generated, respectively. In the mixed trafc fow, the spatial distribution of CVs and RVs is random. It should be noted that only if both the following and the leading vehicle are CVs, the following vehicle can apply the car-following model of the CVs. Otherwise, the RV carfollowing model is used. Te diference between the two is in the driver's reaction delay time, and the CV has a lower time delay than the RV. Te parameters are given in Table 1.  Te database of the observed features required for model training and testing is obtained by recording the information of CVs at each simulation step and then processing the information using equations (1)-(4).

Experiment Setting.
Te model parameters need to be initialized before using the GMM-HMM. Among hyperparameters, the number of Gaussian components M � 2 and the number of hidden states N � 3. Te initial probability vector π is uniformly distributed. Te mean vector and the covariance matrix in the state transition matrix A and the output probability matrix B are generated by the initialization of the k-means algorithm. Te number of iterations is set to 50, and the convergence threshold is set to 1 × 10 −4 . Te classifcation model evaluation method proposed in reference [17] was used to evaluate the model performance. Accuracy (ACC), macroaverage precision (MAP), macroaverage recall (MAR), class balance accuracy (CBA), and the F1 score (F1), which integrates accuracy and recall, were used as indicators to evaluate the model performance. At the same time, to make the evaluation results of the model convincing and efectively avoid overftting and underftting, k-cross validation is adopted to use all the data for training and testing.
In experiment 1, to determine the efect of diferent observed features on the recognition ability of the GMM-HMM, fve groups of observed features are used as the model's input to obtain the state estimation results of the GMM-HMM. Te fve diferent observed features are as follows: (1) Relative position+relative velocity (∆x n + ∆v n ) (2) Relative position+time headway (∆x n + T h ) (3) Relative position+relative acceleration (∆x n + ∆a n ) (4) Relative position+relative velocity+relative acceleration (∆x n + ∆v n + ∆a n ) (5) Relative position+relative velocity+relative accel-eration+time headway (∆x n + ∆v n + ∆a n + T h ) In experiment 2, to verify the adaptability of the model under diferent MPR environments, the mixed trafc fow dataset generated at a certain MPR is taken as the training set. Te data generated from the remaining MPR are used as the test set (e.g., the features data obtained at an MPR of 0.5 for the CVs are used as the training set, and the feature data at MPRs of 0.3 and 0.7 are used as the test set) to verify the generalization ability of the model.
In experiment 3, GMM-HMM is briefy compared with other machine learning methods, such as the support vector machine (SVM) and artifcial neural network (ANN) for RV spatial distribution estimation. Te same dataset is used for training and testing to make the experimental results relatively fair. Te parameters of both SVM and ANN are selected by constantly adjusting the grid search method.

Determine the Optimal Observed Features.
In this paper, diferent combinations of relative position ∆x n , relative velocity ∆v n , relative acceleration ∆a n , and time headway T h of adjacent CVs are extracted as observed features. In order to estimate the spatial distribution of RVs, it is necessary to combine the four features in the process of establishing the GMM-HMM. Te distributions of ∆x n , ∆v n , ∆a n , and T h under diferent hidden states are shown in Figure 5.
It can be directly seen from Figure 5 that the spatial distribution of RVs between adjacent CVs (the hidden state) can be refected by the information of CVs. Tere are differences in the probability distribution of information under diferent hidden states. Te characteristic information of network connection varies greatly in diferent hidden states. Tis point is shown in the fgure as "thin" and "fat" degrees are diferent. Te fundamental reason is that the mean value and the standard deviation of the network characteristic information are diferent. Statistical methods are used to describe the distribution of information, as shown in Table 2.

Journal of Electrical and Computer Engineering
In this section, fve diferent observed features were selected to train and test the model. Te fve evaluation indices (the evaluation indices take values ranging from 0 to 1, with values closer to 1 indicating better model performance) derived from the confusion matrix are used to further analyze the model's performance. Te results are shown in Figure 6. Figure 6 shows the efect of selecting diferent observed features on the model performance. It can be observed that the relative position ∆x n and time headway T h of adjacent CVs are selected as the input of the model, which can make GMM-HMM have the best efect on the spatial distribution estimation of RVs. More specifcally, the combination of the relative position ∆x n and time headway T h as the observed features can efectively refect the spatial distribution of RVs. In the cross-validation experiment, the accuracy reached 0.972 in the best case, 0.891 in the worst  case, and the average accuracy was about 0.937. Considering the combination of relative position ∆x n , relative velocity ∆v n , relative acceleration ∆a n , and time headway T h as the observed features, the accuracy of the former is slightly lower than that of the former. Te accuracy of recognition using the remaining three observed features is much lower than that of the previous two. Similarly, from the perspective of recall, precision, class balance accuracy, and the F1 score, the combination of relative position ∆x n and time headway T h is selected as the observed features, which makes the model performance better than the other four.
Te model's performance using diferent observed features is shown in Table 3. Te results show that the combination of the relative position ∆x n and time headway T h is selected as the observed features of the GMM-HMM, which can efectively realize the spatial distribution estimation of RVs.

Generalization Capability Validation.
To verify the adaptability of the proposed method in diferent environments, the observed features dataset extracted under a certain MPR is used for training, and the test dataset is from     Table 4.
Te results show that the overall accuracy of the proposed method in diferent MPR environments is above 0.918. It shows that the model also has good adaptability in diferent MPR environments.

Comparison with Other Methods.
After using GMM-HMM to obtain the regular vehicle spatial distribution estimation results, the same dataset is also used to train and test SVM and ANN in the comparison experiment. Te estimation results are shown in Figure 7. Figure 7 shows the signifcant advantages of using GMM-HMM for regular vehicle spatial distribution estimation. Figure 7(a) shows the true labels of the 3 hidden states. It can be seen that the estimated values of GMM-HMM in Figure 7(b) are very close to the true labels. Te regular vehicle spatial distribution estimation results using SVM and ANN are shown in Figures 7(c) and 7(d), respectively. However, these two methods' estimated values difer from the real labels. Te results of evaluating the spatial distribution of RVs using diferent methods are shown in Table 5.
Te experimental results show that GMM-HMM has the highest accuracy in estimating the spatial distribution of CVs, with a value of about 0.937. When using SVM and ANN, the accuracy is 0.934 and 0.879, respectively. As for the stability of the model, the class balance accuracy and F1

Conclusion
In this paper, GMM-HMM is used as the identifcation method to solve the problem of regular vehicle spatial distribution estimation in the mixed trafc fow.   Te spatial distribution of traditional vehicles is regarded as a hidden state, and the diferent combinations of the relative position ∆x n , relative velocity ∆v n , relative acceleration ∆a n , and time headway T h of adjacent CVs are used as observed features. From the perspective of sample distribution, the relative position ∆x n and time headway T h in diferent hidden states are quite diferent. It shows that using these two kinds of information can better establish the relationship between the hidden state and the observed features, and this view is verifed in the experiments. Te experimental results show that using the combination of the relative position ∆x n and time headway T h as the observed features, the average accuracy is 0.937, the class balance accuracy is 0.865, and the F1 score is 0.924, which is higher than the other four observed features. To verify the model's generalization ability, this paper uses data in diferent MPR environments for training and testing. Te experimental results show that the overall recognition accuracy is above 0.918, and the model can adapt to diferent MPR environments. In addition, GMM-HMM is briefy compared with SVM and ANN, and the experimental results show the effectiveness of the proposed method.

Data Availability
Te datasets used to support the fnding of this study are publicly available and can be downloaded from the following website: https://ops.fhwa.dot.gov/trafcanalysi.stools/ ngsim.html.

Conflicts of Interest
Te authors declare that they have no conficts of interest.