The Driver Time Memory Car-Following Model Simulating in Apollo Platform with GRU and Real Road Traffic Data

Car following is the most common phenomenon in single-lane traffic. (e accuracy of acceleration prediction can be effectively improved by the driver’s memory in car-following behaviour. In addition, the Apollo autonomous driving platform launched by Baidu Inc. provides fast test vehicle following vehicle models. (erefore, this paper proposes a car-following model (CFDT) with driver time memory based on real-world traffic data. (e CFDT model is firstly constructed by embedded gantry control unit storage capacity (GRU assisted) network. Secondly, the NGSIM dataset will be used to obtain the tracking data of small vehicles with similar driving behaviours from the common real road vehicle driving tracks for data preprocessing according to the response time of drivers. (en, the model is calibrated to obtain the driver’s driving memory and the optimal parameters of the model and structure. Finally, the Apollo simulation platform with high-speed automatic driving technology is used for 3D visualization interface verification. Comparative experiments on vehicle tracking characteristics show that the CFDT model is effective and robust, which improves the simulation accuracy. Meanwhile, the model is tested and validated using the Apollo simulation platform to ensure accuracy and utility of the model.


Introduction
Car-following (CF) behaviour is the most basic micro driving behaviour, referring to the interaction between two adjacent vehicles in a vehicle fleet driving on a single-lane road that does not allow passing [1]. e concept of CF originated in the early 1950s. Over the past six decades, CF models have been extensively and systematically studied, and fruitful achievements have been made [2]. Since the 1990s, research in related fields has gradually emerged in China. Researchers from various fields have attempted to interpret the observed microscopic phenomena from different perspectives [3].
ere are currently many types of CF models that can be divided into two categories based on their origins: theorydriven and data-driven CF models [4].
In the development of the theory-driven models, the stimulus-response models are the most classic CF models, of which the General Motors (GM) model [5] is the most important. e GM model has been gradually developed and used since the late 1950s; it is the basis of many of the subsequent stimulus-response models. e GM model clearly reflects the characteristics of CF behaviour; it has a simple form and a clear physical meaning based on its originality. However, this model is prone to change with changes in traffic operational conditions and hence lacks universality.
With the increasing popularity of artificial intelligence, data-driven models have gradually become a focus of research of CF models. In 1988, Rumelhart proposed the backpropagation neural network (BPNN) [6], which is a multilayer feedforward neural network (FNN) that uses the error back-propagation algorithm to adjust weights. It is the most widely used NN model. Chen et al. proposed a deep learning method for learning potentially complex and irregular probability distributions, which can accurately estimate the values of CDF and PDF [7].
With the wide application of NNs in the field of traffic simulation, in 1998, Kehtarnavaz [8] applied the BPNN model to CF behaviour modelling for the first time, using the speed of the following car and the distance between the two cars as the model inputs and the relative speed of the two cars as the model output, thus verifying the validity of the model. Zhang et al. [9] established a closed-loop driving following model based on BP neural network and verified the adaptability of the model to different driving groups through experiments. Support vector regression (SVR) [10] is a machine learning algorithm that converts the original problem into a convex quadratic programming problem and solves it using the optimality theory to obtain the global optimal solution. Wei and Liu [11] proposed a vehicle following model based on support vector regression and studied the asymmetric characteristics of vehicle following behaviour and its influence on the evolution of traffic flow. Parham et al. [12] propose car-following modelling using an efficient support vector regression method and prove that it has appropriate validity after inputting the driver's instantaneous reaction time. However, studies based on such models are in their infancy.
CF behaviour is a continuous behaviour, so a driver can make a corresponding decision based on the memory of the previous time period [13][14][15]. However, a large number of existing models do not fully consider the driver's memory effect and only consider the instantaneous interaction between the following and leading cars. To process the CF time series data to use their historical information, the model must have a memory capability; this is lacking in both the BPNN-and SVR-based models.
Recurrent neural network (RNN) [16] is a class of neural network with memory capability. Yang [17] proposed a carfollowing model based on recurrent neural network (RNN) to effectively describe the state changes of vehicles while driving and road traffic congestion.
When an input sequence is long, the gradient explosion and vanishing problems, also known as the long-term dependency problem, will occur. To solve this problem, various modifications have been made on RNNs; the most effective method is to introduce various gating mechanisms such as the long short-term memory (LSTM) [18,19] and the gated recurrent unit (GRU) [20] networks. Based on the previously described studies, Wang et al. [21] proposed the use of GRU to model CF behaviour and embed the driver's memory effect in the model, which used the speed of the following car, the relative speed of the two cars, and the distance between the two cars observed in the last several time intervals as inputs and the estimated speed of the following car at the next time point as the output. e test results showed that the proposed model has higher simulation accuracy than the existing CF models and provides a new concept for the study of traffic flow theory and simulation. However, the driver's decision-making and reflection time are not considered in the judgment process.
However, influenced by multiple sources of information, a driver's decision-making and judgment process exhibits a complex nonlinear modality during driving, and the driver's psychological decision cannot be described with a simple mathematical expression. Fuzzy theories and artificial neural networks show certain operational advantages in handling complex nonlinear issues and also exhibit a good learning capacity under big data samples. erefore, the fuzzy theory and artificial neural network are often used for simulating driving behaviours under different environments. However, the current schemes utilizing fuzzy theories and artificial neural networks only focus on the velocities and accelerations of the leading car and the following car, as well as the spacing there between, without considering driving environments [22]. In addition, how to obtain real-time traffic information (such as average speed, travel time, traffic flow, and traffic conditions) is also an important issue for unmanned driving. Many scholars have also done a lot of research on real-time traffic information. Chen proposed a cell probe (CP)-based method to analyse cellular network signals with an estimated accuracy of 97.63%, which is easier to obtain than traditional methods [23].
In April 2017, Baidu released its open platform Apollo for autonomous driving; after iterations of multiple versions, the platform has been enabled for localization, sensing, decision, and simulation. Apollo may help its partners in the automotive and autonomous driving industries to quickly develop a set of their own autonomous driving systems in consideration of vehicles and hardware systems. In the Apollo simulation environment, environment information including traffic signs, index lines, and the relationships with surrounding vehicles may be inputted into Dreamview via corresponding interfaces to thereby construct a driving environment. Besides, the Apollo platform is further enabled for validating the car-following model and optimizing the relevant algorithm through a 3D visual interface.
In this study, based on the previously described studies and combined with actual road conditions, we designed a CFDT model based on the data-driven model in combination with the improved RNN. In our model, the speed of the leading vehicle in the previous time interval, the speed of the following vehicle, and the distance between the two vehicles are used as inputs to predict the acceleration of the following vehicle at the next time point. Furthermore, the established model was calibrated using the CF data to determine the optimal parameters and optimal structure of the model, which were then verified through simulation. Finally, the proposed model was compared with the BPNN-and SVR-based models. It was confirmed that, compared with the traditional CF models, the RNN networkbased CF model has high robustness and improved simulation accuracy, providing a methodological basis for studying the car-following behaviour. e remainder of the paper is divided into four sections. Section 2 introduces conventional car-following models and the neural network based car-following model. Section 3 models CF behaviour mainly using the RNN network. Section 4 processes the data and briefly analyses the driver's response time. Section 5 trains the proposed model to obtain the optimal parameters, compares it with the other two existing models, and verifies that the proposed model can achieve better simulation results. Section 6 conducts an empirical study of the three types of CF models based on the data and describes in detail the models' verification experiments. Section 7 uses the Apollo simulation platform to verify the model and ensure the accuracy and practicability of the model. Section 8 introduces the summary and prospects.

Traditional Car-Following Models.
e stimulus-response framework is the most traditional modelling idea of the car-following behaviour, which embodies many essential characteristics of the car-following behaviour, while the GM model is the most important stimulus-response type of the traditional vehicle following model. e GM model assumes that a vehicle does not show passing or lane-changing behaviour when following. e driving dynamics theory is used to derive the basic equation: (1) In equation (1), a n+1 (t + T) is the instantaneous acceleration of a following car at time (t + T); v n+1 (t + T) is the instantaneous speed of a following car at time (t + T); Δv(t) is the relative speed of the two cars at time t; Δx(t) is the distance between the two cars at time t; T is the response time; λ is the sensitivity parameter to be calibrated; and m and l are additional parameters to be calibrated. Numerous studies have been focused on the parameter calibration and extension of the GM model. e GM model clearly reflects the characteristics of CF behaviour; it has a simple form and a clear physical meaning based on its originality. However, this model is prone to change with changes in traffic operational conditions and hence lacks universality.

Basics of NN.
NN is a highly nonlinear model with a neuron as its basic unit. When a neuron receives a set of input signals, it generates an output signal. A typical structure is shown in Figure 1.
e sum of the weighted inputs is described using the net input z; then, we have equation (2), as follows: where f(x) is the activation function. en, the output can be expressed as follows in equation (3): e commonly used activation functions, which are nonlinear, are as follows: Sigmoid function: Tanh function: ReLU function: Leaky ReLU function: In practical application, the appropriate activation function can be selected according to the actual situation.
Historically, various NN structures have been proposed; those most commonly used include the feedforward NN, the feedback NN, and the graph network. In this study, the feedback NN was adopted. e neurons in a feedback NN can receive not only the signals of other neurons but also their own. Compared with those in a feedforward NN, the neurons in a feedback NN have a memory function and have different states at different times. e basic structure of a feedback NN is shown in Figure 2.
In a feedback NN, signals can propagate in one or both directions.
is type of network includes RNN and the Boltzmann machine.

Gated RNN.
To solve the long-term dependence problem of RNNs in the long sequence of training, a gating mechanism is introduced to selectively add new information while selectively forgetting the retained information. Such networks are collectively referred to as gated RNNs; the most popular include the LSTM and GRU networks.

LSTM
Network. An LSTM network adds the new internal states c t and introduces three "gates"-the forgetting gate (f t ), input gate (i t ), and output gate (o t ). e value of a "gate" is within (0, 1); it is used to control the amount of information passed.
Specifically, the forgetting gate f t controls the amount of information to be forgotten by the internal state of the last time point (c t− 1 ); the input gate i t controls the amount of information to be retained by the candidate state c t of the current time point; and the output gate o t controls the Mathematical Problems in Engineering amount of information to be output to the external state h t by the internal state c t of the current time point. Figure 3 shows the internal structure of the LSTM unit, where × represents the multiplication of vector elements and + represents the addition of vector elements; σ(x) is the sigmoid activation function. us, the three gates of f t , i t , and o t can be calculated with equations (8) e methods for status updating are described in equations (11)-(13) for f t , i t , and o t , respectively: In equations (12) and (13), * represents the multiplication of vector elements.
In an LSTM network, the internal state of the unit c t can retain certain key information for a significant amount of time.

GRU Network.
e internal concept of a GRU network is similar to that of an LSTM network, and a GRU network can achieve a comparable effect. However, a GRU network has fewer parameters, lower training difficulty, and higher practicality.
Because the input and forgetting gates in the LSTM unit are complementary, in a GRU unit, they are combined into one gate, i.e., the update gate z t , while the output gate of the LSTM unit is deleted and a reset gate r t is added without introducing a new internal state. Its structure is shown in Figure 4.
Where the update gate controls the amount of information to be retained by the state of the current time point (h t ) from the state of the last time point (h t− 1 ), as well as the amount of new information received from the candidate state (h t ), the reset gate controls the amount of information to be retained from the state of the last time point (h t− 1 ) by the candidate state of the current time point (h t ). e methods for the calculation of the two gates are shown in equations (14) and (15). W * ( * � z, r, h) and U * ( * � z, r, h) stand for the weight matrix from the cell to gate, and b * ( * � z, r, h) denotes the vector of each gate.
e methods for updating the states are shown in equations (16) and (17): In the case where z t � 0 and r t � 1, the GRU network degenerates into a simple RNN.

Approach to the Proposed Model
Herein, we adopted the RNN network to model CF behaviour. e proper choice of model inputs and outputs can improve the simulation accuracy of the model. Based on the GM model, we use the speed of the leading car at time t (v n (t)), the speed of the following car at time t (v n+1 (t)), and the distance between the two cars (Δx(t)) as inputs and the acceleration of the following car at time t + T (a n+1 (t + T)) as the output. en, we have equation (18): where N is the length of the time interval of "memory." Figure 5 is the specific structure diagram of the model proposed in this paper.
To eliminate the influence of dimension on the simulation accuracy and convergence rate of the model, the paper normalizes the vehicle following data (leading vehicle speed, following vehicle speed, and following vehicle acceleration). In different traffic environments, the behaviour of following a car is easily affected by the propagation of the slight disturbance of the speed of the leading car, the habit of acceleration and deceleration, the driver's cognition of the environment, and the driver's cognition of driving behaviour. e distribution of the car-following data cannot judge whether it is close to a Gaussian distribution. erefore, the MinMaxScaler of the simplest method to eliminate the influence of dimensionality and data value range is selected in this paper to preserve the relationship existing in the original data. e formula for MinMaxScaler is as follows: where max and min are the maximum and minimum values of a given zoom range, respectively; i.e., the original data are scaled to the range of [max, min]. Specifically, the original data are scaled to the range of [0, 1]. en, we have the following: e CF data are constructed to the appropriate input and output shapes to comply with the input and output structures of the GRU model. Because the length of the "memory" interval (N) is closely related to the constructed data, it also directly affects the prediction accuracy of the model and so it was tested in detail in this study. en, the dataset was randomly divided into training and test sets. Next, ReLU was selected as the activation function of the output layer to establish the GRU model. Because the number of hidden layers and the number of neurons in each hidden layer can have numerous combinations, it is necessary to separately test each of the models with different structures to obtain the optimal structure of the model.
e mean square error (MSE) (21) was used to construct the loss function and the Adam optimizer [24][25][26], due to its excellent performance in most cases, was adopted.
In the input layer, the time step is set to N, and each step contains three input variables (v n , v n+1 , Δx). Since it is necessary to predict the acceleration of the following vehicle with a continuous time of m, the input value is constructed into a matrix X ∈ R m×N×3 through the normalization of formula (19). Finally, the predicted acceleration of d for a continuous period of time of the following car was constructed into output y ∈ R m×1 through the GRU gate unit of multiple hidden layers. e pseudocode for the construction of the RNN-based CF model is shown in Algorithm 1.

Processing of the Following Vehicle Data.
e Next Generation Simulation (NGSIM) program [27] was initiated by the U.S. Federal Highway Administration (FHWA).
rough the established synchronous digital camera network, detailed vehicle trajectory data were acquired at a time interval of 0.1 seconds from the US-101 Freeway and the southbound direction of Lankershim Boulevard in Los Angeles, California; Interstate I-80 in Emeryville, California; and the eastbound direction of Peachtree Street in Atlanta, Georgia.
In this study, the detailed trajectory data of the eastbound vehicles on Interstate I-80 in Emeryville, California, were used. e data were acquired at 10 frames per second by seven cameras mounted on the 30-story Pacific Park Plaza Building located at Christie Avenue. e study road section is 503 m long and has six lanes. Lane 1 is a high occupancy vehicle (HOV) lane and Lane 6 is a collector-distributor lane, as shown in Figure 6.  Table 1.
In this study, we mainly analysed the CF behaviour of cars and their microscopic characteristics. e CF behaviour is closely related to the road conditions. To ensure the universality of the CF behaviour, we examined the vehicle trajectory data between 4:00 pm and 4:15 pm, which contain 1,028,575 trajectory records. Each record contains 18 fields, as fully described in Table 2.

Data Preprocessing.
First, data of the following vehicles were found and filtered according to the following rules: (1) To avoid the potential difference in CF behaviour between different types of vehicles, we only focused on the CF behaviour of small cars (i.e., v _ Class � 2) (2) Cars from the HOV lane (i.e., Lane _ ID � 1) and the collector-distributor lane (i.e., Lane _ ID � 6) were excluded to ensure that the vehicles under study are associated with similar driving behaviour, i.e., to ensure the consistency of driving behaviour (3) e single-lane data of driving vehicles were adopted to avoid the influence of lane-changing behaviour on CF behaviour (4) Only the data for cars with a following time greater than 45 s (i.e., 450 records) were retained to ensure ... ...

∆x (t)
Current time t Figure 5: Schematic structure of the GRU-based CF model.

GRU-based car-following model
(1) Data normalization using MinMaxScaler. (2) e input is constructed as X ∈ R m×N×3 , e output is constructed as y ∈ R m×1 (3) e constructed data is divided into training set and testing set. (4) Modelling Sequential(), add GRU Layer and Dense Layer (5) Compiler model, loss function � "MSE," optimizer � "Adam" (6) while model convergence do (7) Training model (8)  Mathematical Problems in Engineering 7 the integrity of the CF process and to ensure an adequate number of samples for model training e pseudocode for the data processing is shown in Algorithm 2. Table 3 is a part of vehicle tracking data obtained through data preprocessing, whose lead vehicle ID is 66 and the following vehicle ID is 74.

Driver Reaction Time.
e driver reaction time refers to the time between the driver perceiving a change in the surrounding environment and responding [28,29]; it is also an important parameter in the CF model.
According to the restrictions of the CF, as the driving state of the leading car changes, the following car changes accordingly. However, changes in the driving states of the two are asynchronous.
is is because the driver of the following car must have a reaction process to respond to a change by the leading vehicle. is reaction process includes four parts: perception, judgment, reaction initiation, and reaction execution; the required time is referred to as the reaction time. Assuming that the reaction time is T when the leading car makes a change at time t, the following car can only make the corresponding change at time (t + T). e driver reaction time has been extensively investigated by many researchers. Kim et al. [30] analysed the braking reaction time of young and old drivers. Jin [31] studied the driver reaction time using least squares analysis via SPSS 13.0 and generated a reaction time distribution map (Figure 7). e calculation showed that the weighted average of driver reaction time is 1.077 s.
Lu et al. [32] obtained statistical information on driver reaction time through 63 samples, as shown in Table 4.
Based on the above discussion, we set the reaction time to 1 s in this study. Because the acquisition time interval of the adjacent two records of the CF data is 0.1 s, we excerpted one record for every 1 s (i.e., 10 records); the new dataset was saved for later use.

Evaluation Index.
In this paper, MSE is used as the evaluation index of CFDT model. MSE is a risk function, related to the expected value of the squared error loss or quadratic loss. MSE is arguably the most important criterion used to evaluate the performance of a predictor or an estimator. It measures how close a fitted line is to data points. For every x data point, take the distance vertically from the point to the corresponding y value on the curve fit (the error), and square the value. e lower estimation value of MSE represents the lower error [33,34]. e specific calculation formula of MSE has been shown in equation (21).

Training and Test
In this section, we used Keras, a Python-based deep learning library, to construct and train the CFDT model, and used TensorFlow as a back-end tool. e hardware environment of our experiment is as follows: processor Intel Xeon 2.10 GHz E5-2683 v4, memory 64 GB 2400 MHz, operating system Windows Server 2012 R2 standard, IDE: PyCharm. According to this model training process, the optimal length of a "memory" time interval and the optimal structure   (9) end for (10) if time > 450 then (11) e Data that holds the data is stored in CSV format (12) end if (13) end for ALGORITHM 2: e pseudocode for the CF data processing.  Mathematical Problems in Engineering of the model must be determined so the model has its best performance. e results of previous studies have shown that the optimal length of a "memory" time interval is not related to the structure of the model, and the NGSIM dataset does not need more than three hidden layers for model performance [21]. On this basis, we performed the following experiment.
First, we fixed the structure of the model. To reduce the training time, a simple structure with a single hidden layer and 20 neurons was adopted to separately perform the experiment with different N values. e results are shown in Figure 7. Figure 8 shows that when the length of the "memory" time interval was 10, i.e., when the driver of the following car only considers the historical information within the time period of the last 10T, the model had the best performance.
On this basis, assuming N � 10, we separately trained and tested the models with the nine structures listed in Table 5.
e results showed that, for models with one hidden layer (Structures 1 through 3), the performance value of the model with Structure 3 is the minimum; for models with two hidden layers (Structures 4 through 6), the performance value of the model with Structure 5 is the minimum; and for models with three hidden layers (Structures 7 through 9), the performance value of the model with Structure 8 is the minimum. In terms of model performance, the performance values of the models are ranked in an ascending order: the model with Structure 3< the model with Structure 5< the model with Structure 8.
Next, the CF data, in which the vehicle ID of the leading car is 66 and that of the following car is 74, were trained using the model with Structure 3, the model with Structure 5, and the model with Structure 8. e simulation results were visualized and are shown in Figures 9-11.
In each of the figures, the first subplot shows the actual data, the second subplot shows the simulation data cluster belonging to 100 different training models, and the third subplot shows the simulation data cluster with error bars, i.e., mean ± std.
In summary, for the RNN-based CF model, the model with a "memory" time interval length of N � 10 and three hidden layers that contain 30, 10, and 10 neurons had the highest prediction accuracy and generated satisfactory simulation results for a road section that had continuous acceleration and deceleration behaviours.

Comparison with Other CF Models
To test the simulation accuracy of the RNN-based CF model, two other models, i.e., BPNN and SVR, were selected from the data-driven models to conduct a comparative experiment. Similarly, to ensure the fairness of the comparison, the speed of the leading car at time t (v n (t)), the speed of the following car at time t (v n+1 (t)), and the distance between the two cars at time (Δx(t)) were used as the inputs to the model, and the acceleration of the following car at time (a n+1 (t + T)) was used as the output of the model. MSE continued to be adopted as the criterion for model evaluation. Figure 12 was constructed based on the BPNN. e model can have various structures in terms of the number of hidden layers and the number of neurons in each layer. According to Kolmogorov's theorem [35], a back-propagation neural network with three layers is sufficient to complete any mapping from n dimensions to m dimensions. erefore, we choose the BPNN network with two hidden layers as the structure of the BPNN-based CF model. After multiple tests, the optimal structure, which included two hidden layers containing 20 and 10 neurons, was selected.

BPNN-Based CF Model. First, a model as shown in
e Tan h function was used as the activation function of the neurons. e model was constructed and trained using Keras. Methods such as the holdout method were used to randomly create the training and test sets.     Figure 13. Figure 12 shows that because this dataset had a significant amount of "noise" (i.e., the following car was constantly in an accelerating or decelerating state), the resulting simulation results of the model have a low accuracy (i.e., there is a certain error when compared to the real data). Nevertheless, the results reflect the variation trend in the acceleration of the following car. Moreover, the model has a  relatively simple structure and fast convergence rate. e above experiment demonstrates the validity of the BPNNbased CF model.

SVR-Based CF Model.
we constructed an SVR-based CF model, as shown in Figure 14.
where the Gaussian kernel function was selected as the kernel function for the model.
To simplify the experimental process, we used the svm. SVR in the existing Scikit-learn framework for training and testing and assumed the parameter kernel of svm. SVR was "rbf." As in the case of the BPNN-based model, the dataset was randomly split. We again randomly selected a set of CF data that was associated with leading car 79 and following car 87. In addition, the following car exhibited frequent acceleration and deceleration behaviour. As shown in Figure 15, the simulation results indicate that the prediction error of the SVR-based model is small.

Comparison between Different CF Models.
To compare the above three CF models, we tested each of the models on the same CF dataset (i.e., leading car 1503 and following car 1507). e simulation results are shown in Figure 16.
In this CF dataset, the acceleration and deceleration behaviour of the following car was infrequent, and the following car was driving at a constant speed nearly 40% of the time. As reflected in Figure 16, the polyline of the real data is relatively smooth. erefore, all three models performed well in the simulation. However, in Figure 16, the GRU predicted acceleration is closer to the real acceleration than the BPNN model and the SVR model when the real acceleration of 0 to 5 seconds and 50 to 60 seconds has a significant continuous jump. erefore, the GRU model proposed in this paper is superior to the SVR model and the BPNN model. Figure 17 shows the MSE evaluation values of the above three models. e lower estimation value of MSE represents the lower error. rough the comparison of MSE evaluation index values in the above three model simulation experiments, it is found that the MSE value of BPNN model is the highest, while the model proposed in this paper is the lowest, which is only half of the MSE value of BPNN model. erefore, the comparison of the MSE evaluation index values in the above three model simulation experiments shows that the proposed model is superior to the SVR model and the BPNN model.
To conclude, the above three models can not only reflect the variation trend in the acceleration of the following car but also accurately predict the values. However, for vehicles driving at variable speeds over a long period of time, the proposed model, which includes a memory unit, had better simulation results but, correspondingly, a slower convergence rate than the other two models.

Test Verification on Apollo
Simulation Platform e proposed method for predicting a car-following behaviour is combined with the Apollo platform as follows: Differentiating scene information in an autonomous driving process of a vehicle into static information and dynamic information, and importing the static information and the dynamic information into Dreamview of the Apollo platform to construct a road scene, specifically including obtaining three-dimensional information of a traffic scene and motion information, wherein the three-dimensional information of the traffic scene refers to static information in the corresponding scene information and the motion information of the traffic scene refers to dynamic information in the scene information; preliminarily constructing a topological structure of the scene, wherein the topological information of the scene includes information such as the number of surrounding vehicles, the lanes occupied by surrounding vehicles, and the distance from a road edge; inputting such information into Dreamview via a corresponding interface of Apollo; configuring paths to specific modules based on the     (Table 6) provided by the simulation environment, and performing, by respective modules in the Standard, environment construction with reference to the traffic flow and simulated environment information resulting from understanding of the scene, as shown in Table 6.
During the construction process, the dynamic information and the static information during vehicle driving are obtained through understanding of the scene; the desired distance and reaction time are obtained by capturing the driver's behaviour features, and the process of the car-following model is improved using RNN, computing the safetyand-comfort-based optimal solution of the following-car acceleration range. Meanwhile, the model is tested and validated using the Apollo simulation platform to ensure accuracy and utility of the model. e method for predicting a car-following behaviour under the Apollo platform as disclosed is tested using the Apollo simulation platform. After the Apollo software environment is configured, the output interface of the Apollo platform is docked with the method. After successfully predicting information such as the following-car acceleration using the proposed method, the method is docked with the decision planning module Planning of Apollo; finally, the Apollo software implements testing and validation of the method; during multiple times of simulation process, the parameters are constantly adjusted, and the algorithm is optimized over the Apollo visual platform, specifically: Deploying the environment (e.g., Docker environment), and pulling the container mirror of Apollo; entering the Apollo container, and compiling the simulation environment (e.g., Dreamview simulation environment); running the simulation environment after successful compilation; testing and validating the efficacy of the model using the corresponding simulation environment; the testing and validating interface refers to the simulation environment interface, wherein the interface is shown in Figure 18.
Docking the traffic flow and environment information outputted by Apollo with the input of the model; then, converting the predicted acceleration value obtained using the model into the Planning input simulation platform, wherein the specific docking path is shown in Table 7.
Docking the traffic flow and environment information outputted by Apollo with the input of the model; then, converting the predicted acceleration value obtained through the model into the Planning input simulation platform, wherein the specific docking path is shown in Figure 19.       Figure 20 is part of the following process diagram of the vehicle following behaviour visualization on the Apollo platform using the model proposed in this paper. In the figure, the cube with green border is the leading car and its current speed is shown directly above it. e blue car is the following car and its current speed is shown at the top right of the figure. In Figure 20(a), the speed of the leading car is 5 m/s (equivalent to 18 km/s), and the speed of the following car is 20 km/s. In Figure 20(b), the speed of the leading car is 5 m/s (equivalent to 18 km/s), and the speed of the following car is 21 km/s. In Figure 20(c), the speed of the leading car is 5 m/s (equivalent to 18 km/s), and the speed of the following car is 21 km/s. In Figure 20(d), the speed of the leading car is 5 m/s (equivalent to 18 km/s), and the speed of the following car is 23 km/s. In the comparison of Figures 20(a)-20(d), it is found that the speed of the following car has been fluctuating from the speed of the leading car so that the speed of the following car is not longer than that of the leading car. Moreover, a relatively long distance is maintained between the following car and the leading car, which provides sufficient braking distance for the following car to ensure the driving safety of the following car.
rough the visual simulation of the model proposed in this paper on the Apollo simulation platform, it was found that there would be no collision between the following car and the guiding car during the long time of following. erefore, by using Apollo simulation platform to test the model visually, it is found that the model proposed in this paper is valid and practical.

Conclusions
In this study, we used high-precision vehicle trajectory data from Interstate I-80 in the NGSIM dataset to obtain the CF data through data preprocessing. Based on the characteristics of the CF behaviour, we verified the correctness of the data through experiments and chose the reaction time of T �1 s to further filter the CF data. We modelled the CF behaviour based on the RNN network, using the speed of the leading car, the speed of the following car, and the distance between the two cars, all at time t, as inputs and the acceleration of the following car at time (t + T) as output. Finally, we performed in-depth examination and experiments on the length of the "memory" time interval and the network structure of the constructed model and obtained the parameters that enabled the model to have its best performance. Further, we compared the simulation results of the constructed model with those of the BPNN-and SVR-based models and demonstrated that the constructed model with a memory unit added had higher simulation accuracy. Both the BPNN-and SVR-based CF models were unstable; i.e., when the following vehicle had frequent acceleration and deceleration behaviour, their simulation results were poor. In comparison, the RNN-based CF model was able to make more accurate predictions because it considered the relevant information of the last several time intervals. At the same time, Apollo simulation platform was used to test and verify the model, ensuring the accuracy and practicability of the model. e RNN-based CF model established in this study was only used to study the CF behaviour between small cars. In reality, the CF behaviours between different types of vehicles are different. In a follow-up study, we will construct models that consider various types of vehicle so that the existing model can be further improved according to the actual conditions such as asymmetric driving behaviour and multiple leading vehicles.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.