## 2 The Composition and Principle of Traffic Flow Detection System  
The traffic flow detection system consists of a video image acquisition module, an image pre-processing module, a vehicle detection and identification module, and a vehicle flows statistics module. The main modules of the detection system are shown in Figure 1. The core of the system is the vehicle detection and recognition module, which locates and recognizes the vehicles in the video images. In order to combine target position and recognition into one, which needs to take requirements of the speed detection and recognition accuracy into consideration, the YOLOv3 algorithm is used for the vehicles' detection and recognition. The YOLOv3 algorithm is an improvement on YOLOv1 and YOLOv2 because it has the advantages of high detection accuracy, accurate positioning, and fast speed. Especially when the multi-scale prediction methods are introduced, it can achieve the detection of small targets and has good robustness to environmental scenes, therefore, it has become a current research hotspot. The network structure of the YOLOv3 algorithm is shown in Figure 2. The residual network is mainly used to upgrade the feature extraction network, and the basic backbone network is updated from Darknet-19 to Darknet-53 to extract features and obtain deeper feature information. Figure 1: Detection System Process. The Darknet-53 network in YOLOv3 uses a large number of \(1\times 1\) and \(3\times 3\) convolutional layers in order to connect local feature interactions and its function is equivalent to the global connection of the full feature layer and the addition of shortcut connections. This operation enables us to obtain more meaningful semantic information from up-sampled features and finer-grained information from earlier feature mappings. This feature extraction network has 53 convolutional layers, which is called Darknet-53, and its structure is shown at the top in Figure 2. In Darknet-53, \(1\times 1\) and \(3\times 3\) alternating convolution kernels are used, and after each layer of convolution, the BN layer is used for normalization. The Leaky Relu function is used as the activation function, the pooling layer is discarded, and the step size of the convolution kernel is enlarged to reduce the size of the feature map. As the network structure is deeper, its ability to extract features is also enhanced. The function of the sampling layer (upsample) is to generate the small-size images by interpolation of small-size feature maps and other methods. When short connections are set up between some layers to connect low-level features with high-level ones, the fine-grained information of high-level abstract features is enhanced, and they can be used for class prediction and bounding box regression. The YOLOv3 network prediction process is listed below:  
1. First, the images of size \(416\times 416\) are input into the Darknet-53 network. After performing many convolutions, a feature map of size \(13\times 13\) is obtained, and then 7 times by \(1\times 1\) and \(3\times 3\) convolution kernels are processed to realize the first class and regression bounding box prediction. 2. The feature map with size \(13\times 13\) is processed 5 times by \(1\times 1\) and \(3\times 3\) convolution kernels, and then the convolution operation is performed by using \(1\times 1\) convolution kernel, followed by 2  
Figure 2: YOLOv3 network structure diagram. times the upsampling layer, and stitching to the size on the \(26\times 26\) feature map. The new feature map of size \(26\times 26\) is then processed 7 times using \(1\times 1\) and \(3\times 3\) convolution kernels to achieve the second category and regression bounding box prediction. 3. A new feature map has a size of \(26\times 26\). Firstly, we use \(1\times 1\) and \(3\times 3\) convolution kernels to process 5 times, perform a double upsampling operation, and stitch it onto the feature map of size \(52\times 52\).