## 3 Dataset and Network Training
### Scene and Weather Adaptation Experiments  
After we adjusted the threshold parameters to test a series of different pictures, we found that, when CT and NT were 0.1 and 0.15, the detection results were optimal. To find how adaptable the optimized models were to traffic conditions in multiple scenes and various weather conditions, we made different data sets of over 1000 pictures of different scenes: sunny days, cloudy days, rainy days, and night, respectively. We used the YOLO and YOLO-UA models for testing, and the results are compared in Tables 3 and 4. Apparently, the accuracy rates in Table 4 are higher than those \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Data Sets** & **Number of Actual** & **Number from Statistics** & **Accuracy Rate (\%)** & **Precision (\%)** & **Recall (\%)** \\ \hline Training verification set & 139,098 & 91,721 & 65.94 & 98.10 & 64.95 \\ Training set & 111,351 & 73,531 & 66.04 & 98.03 & 64.93 \\ Verification set & 27,747 & 18,190 & 65.56 & 98.05 & 64.47 \\ Test set & 34,760 & 22,936 & 65.98 & 97.92 & 64.81 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: YOLO general model traffic statistics. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Data Sets** & **Number of Actual** & **Number from Statistics** & **Accuracy Rate (\%)** & **Precision (\%)** & **Recall (\%)** \\ \hline Training verification set & 139,098 & 109,191 & 78.50 & 97.29 & 76.44 \\ Training set & 111,351 & 87,458 & 78.54 & 97.30 & 76.49 \\ Verification set & 27,747 & 21,727 & 78.30 & 97.27 & 76.24 \\ Test set & 34,760 & 27,743 & 78.95 & 96.11 & 76.76 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: YOLO-UA general model traffic statistics. in Table 2. The reason is that, in the training stage of deep neural network, GIOU represents the overlapping relationship between the network prediction frame and the real target frame in the figure, and the position deviation between the prediction frame and the real frame can be well reflected. It is based on the design of GIOU, as the network training time is increased, the location gap between the prediction frame and the real frame is decreased. Although the overlap region is increased, the total loss function of the network is decreased, and the accuracy and performance of the network location can be improved. The average accuracy rate and the average recall rate of the YOLO-UA model were 22% and 21% greater when compared with those of the YOLO model, respectively, even under different detection conditions. These results prove that when the algorithm of the YOLO-UA model is substituted for that of the YOLO model, network performance is greatly improved. These results prove that the YOLO-UA model has good adaptability to different scene and weather conditions, and it can reliably complete the tasks that are required for traffic flow monitoring. However, there are more vehicles on the road during sunny day due to the influences of time and location, and the camera is farther away from them to capture more targets, which leads to the problems of smaller vehicle targets, unclear vehicles, and smaller workshop distance in the images. This problem makes the vehicle difficult to be detected by the model, and more vehicles are missed in the detection process. At night, the road vehicles are sparse, and the vehicle targets are large in the images, for that it is easy to be detected and counted by the model. After testing and observing pictures that were taken in various scenarios and weather conditions, as shown in Figure 5, we found the YOLO model to have serious issues with missed detections and false detections, which affected the statistical results.