## Materials and Methods
### Queue Length Estimation Algorithm Design
#### 2.2.3 Deep Learning to Compute the Queue Length Based on Traffic Image  
Standard traffic surveillance cameras setup at the intersection can get an image of the vehicles waiting behind the stop lines. Much research has been done to get rich information, including vehicle classification, vehicle characters, and vehicle numbers [25]. Counting the number of vehicles in the image is computationally expensive and hardware expensive. However, some simple works can be done to get basic information about the queue length. In this paper, we construct a DNN to classify the vehicles in the image. The detection area is fixed and depends on the camera's capability. It is also set as the area of connected vehicles using cooperative estimation by V2X. First, a series of image frames can be acquired by a traffic camera and sent to the signal light controller. A DNN is constructed to abstract the feathers of the image including the boundary of vehicles background. It does not need to get a high-resolution image to count the number of vehicles and the color or the plate number [27]. Through deep learning proposed in our paper, the vehicles in the images can be analyzed. The structure of DNN is similar to the one described in [49]. The input and output of DNN is designed according to our work. A promising work has been done to detect and classify a vehicle by DNN [28]. The passenger vehicle including sedan, SUV, MPV, can be detected accurately, as well as the other vehicle including a van and bus. Intuitive and abstract features can be used to describe the vehicles despite the fact that length, shape, and color are different. The Alexnet model [50] is utilized to model DNN architecture, which is similar to the work in [49]. The DNN has five convolutional layers and three full connected layers. A 3D filter is linked to the prior layer's outputs in the kernels of every convolutional layer. The image got by traffic cameras is resized to \(256\times 256\) and becomes the input to DNN. To alleviate the compute complexity and ensure it works in real time, the second last fully connected layer is used to extract the features of a vehicle according to the test results in [49]. Figure 4 shows the structure and function of DNN (Alexnet model) used in our work. There are 4096 neurons in Fc6 and Fc7 layers and the feature vector of 4096 dimension is used to represent the traffic image. The features including the vehicle's lane location and vehicle's type can be described in the deep vector. Benefiting from the government's management policy, a connected vehicle can be distinguished by the plate, which is also a deep feature. Then, the penetration rate can  
Figure 4: Structure and function of deep neuron network (DNN) (Alexnet model). be calculated in the intersection controller in every phase. There are 10 neurons in the Fc8 layer. The low-level features including shapes, color, and length to the road bound are contained in the first few convolutional layers. The high-level features are utilized to describe the specific character of vehicle type, lane location, and congestion extent, which is contained in higher convolutional layers. Figure 4 shows that there are many layers in DNN, and the traffic image processing takes a lot of the computer processor unit time. The DNN training work can be done offline based on the ImageNet Large Scale Visual Recognition challenge (ILSVRC) 2012 and images from ITS dataset. The real time online work of DNN takes several seconds to process the traffic image at intersections. The traffic flow has continuous spatial and temporal characters and will not change very fast. Therefore, DNN is used to revise the estimation value of a connected vehicle based on V2X in our work. After training and fine tuning, the DNN is used to process the image from a traffic camera. It sets that DNN gets information from the images and classifies vehicles into several groups.