# Estimation of Lane-Level Traffic Flow Using a Deep Learning Technique
## 3 Methods
### Traffic Flow Calculation Model  
Here are some fundamental quantities for traffic flow [20]: density \(\rho\) is defined as the number of vehicles per unit length. The speed and positions of the \(n\)-th vehicle are denoted as \(v_{n}\) and \(r_{n}\), respectively. Flow rate \(f\) is the number of vehicles passing a fixed position per unit time (for example, 1 h). Time mean speed is the average vehicle speeds in the fixed position over time, and space mean speed is the average vehicle speeds over a hot zone in a fixed time. Bulk velocity is defined as the ratio of flow rate to density, i.e., \(u=\frac{f}{\rho}\).  
The traffic flow can be described microscopically and macroscopically, as proposed by [PERSON] [20]. The microscopic description of traffic flow was used to characterize each vehicles' behavior, was applied in many car-following models (e.g., the intelligent driving model), and was used to facilitate a self-driving car's decision of keeping in the same lane or switching to other lanes, to avoid backing up.  
For the microscopic description, there are individual trajectories: the vehicle position equation:\(p_{a}(t)=(p_{aX}(t),p_{aY}(t)),a=1,2,\ldots,n\), the vehicle velocity equation: \(v_{1}(t)\), \(v_{2}(t)\),..., \(v_{n}(t)\), and the acceleration equation: \(a_{a}(t)=\overset{\bullet}{v}_{a}(t)=\frac{dv_{a}(t)}{dt}\)[20].  
For microscopic traffic models, two models are required: the \"follow the leader\" model: accelerate/decelerate towards the velocity of the vehicle ahead of the self-driving car itself. If the position and velocity of the vehicle ahead is p\({}_{2}\) and v\({}_{2}\), then according to the \"follow the leader\" model [20] the acceleration is expressed as:  
\[a_{F}=\frac{v_{2}-v}{p_{2}-p}. \tag{1}\]  
The \"optimal velocity\" model: accelerate/decelerate towards an optimal velocity that depends on your distance to the vehicle ahead. Then, the acceleration according to this model should be:  
\[a_{Q}=V(p_{2}-p)-v. \tag{2}\]  
Figure 3: Flow chart of the whole process.  
By combining both models, the acceleration of the self-driving car can be obtained in the following equation:  
\[a=\alpha a_{F}+\beta a_{O}=\alpha\frac{v_{2}-v}{p_{2}-p}+\beta(V(p_{2}-p)-v). \tag{3}\]  
On the other hand, the macroscopic description of traffic flow is usually lane aggregated; however, multi-lane models can also be formulated. The macroscopic description of traffic flow is also good for estimation and prediction, and for the mathematical analysis of emergent features. It can examine larger portions of highway, judge whether the traffic in each section is convenient or heavy, and assist navigation and determine the path planning for a car.  
Macroscopic descriptions are based on field quantities, including the vehicle density \(\rho(p,t)\), velocity field \(u(p,t)\), and flow-rate field \(f(p,t)=\rho(p,t)u(p,t)\), where \(p\) is the position on the road and \(t\) is time [20].  
To set up macroscopic traffic models, the following equations are needed: the number of vehicles in the section interval \(c\) to \(d\) can be obtained from vehicle density \(\rho(p,t)\) as follows:  
\[m(t)=\int_{c}^{d}\rho(p,t)dp. \tag{4}\]  
Traffic flow rate (flux):  
\[f(p,t)=\rho(p,t)u(p,t). \tag{5}\]  
Change in the number of vehicles equals inflow \(f(c)\) minus outflow \(f(d)\) dynamically as follows:  
\[\frac{d}{dt}m(t)=\int_{c}^{d}\rho_{t}dp=f(c)-f(d)=-\int_{c}^{d}f_{p}dp. \tag{6}\]  
This equation holds for any choice of \(c\) and \(d\):  
\[\rho_{t}+\left(\rho u\right)_{p}=0. \tag{7}\]  
The microscopic view of traffic flow was studied in this study, and the macroscopic view of traffic flow will be studied in the future. Both descriptions have their own significance and usage.