# Research on Urban Traffic Incident Detection Based on Vehicle Cameras
## 4 Experiment and Result Analysis
### Structure and Analysis  
So as to appraise the capability of the neural network, randomly split the dataset into an 8:2 ratio; the former part is used as training data, and the latter part is used as test data. The test data are separate to the training data and do not participate in the training procedure, so the results of training can be detected objectively. In our experiments, the number of training iterations is set to 200, the initial learning rate is set to 0.01, and four images are fed to the network at a time using the Adam (adaptive moment estimation) optimizer with an input image size of 512 \(\times\) 512. Compare our improved model with the original model. The performance of our method and baseline model (YOLOv5s) on our produced traffic incident dataset is shown in the table below. The results show that our model has been shown to perform better than the original model, and the final model improves the mAP value by about 3.3% over YOLOv5s on this dataset. Compared with YOLOv3, the mAP value is increased by about 8.2%. The Figure 9 shows the test set scores displayed according to mAP values. \begin{table}
\begin{tabular}{c c} \hline \hline
**Testing Environment** & **Configuration Parameter** \\ \hline OS & Ubuntu18.04 \\ CPU & i7-7700 \\ GPU & GTX1060 \\ RAM & 8 GB DDR4 \\ GPU acceleration env & CUDA 11.6 \\ Comp. Vision lib & OpenCV 4.5.1 \\ Framework & PyTorch 1.9.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Local computing resources and CNN environments. As can be seen from Table 2, our model has the highest F1 score as well as mAP score, which means that our model has the highest detection accuracy among the models participating in the comparison; in addition, although the number of parameters of the improved model has increased, it still retains a fast detection speed, which is the fastest among the models participating in the comparison. We selected images from actual complex scenes in daylight conditions and a night environment to test our improved model, YOLOv5s model, and YOLOv3 model, respectively. The testing results are shown in Figures 10 and 11. It can be found in Figure 10 that all three models perform well under daylight conditions, and our improved model completes detection without any missed or false detections, while YOLOv5s has one false detection and YOLOv3 has three false detections. In Figure 11, it can be found that our improved model detects all traffic accidents and pedestrians; YOLOv5s model is less effective in detecting small targets, and more pedestrians in the corners are not detected; YOLOv3 has some false detection cases, and incorrectly identifies signs as people. In Figure 12, we tried to detect fires on the roadside with our model, and it can be seen from the figure that our model can detect and precisely locate all of them; YOLOv5s \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Detection Model** & **F1-Score** & **mAP** & **Detection Time (ms)** & **Parameters** \\ \hline YOLOv3 & 0.75 & 0.760 & 32.6 & 61,545,274 \\ YOLOV5s & 0.76 & 0.809 & 24.2 & 7,042,336 \\ Ours & 0.84 & 0.842 & 19.6 & 7,064,698 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of mAP, F1 score, detection speed and parameter quantity of different models. Figure 11: The detection effect of complex environment at night. Where (**a**) shows the original figure; (**b**) shows our proposed improved YOLOv5s network detection effect; (**c**) shows YOLOv5s detection effect; (**d**) shows YOLOv3 detection effect. Figure 10: The effect of complex environment detection under daylight. Where (**a**) shows the original figure; (**b**) shows our proposed improved YOLOv5s network detection effect; (**c**) shows YOLOv5s detection effect; (**d**) shows YOLOv3 detection effect. does not detect the person on the right side of the picture, and YOLOv3 detects the frame positioning too broadly. The real-time detection of traffic incidents based on the mobile edge requires not only a high accuracy of the model but also a model that is lightweight enough to be deployed on the edge.