# Automobile Fine-Grained Detection Algorithm Based on Multi-Improved YOLOv3 in Smart Streetlights
## 4 Experiment and Results
### Experimental Results
#### 4.2.3 Improved Experimental Results Based on IoU Loss  
In this section, we will verify the effects of replacing the original L2 loss with IoU loss in the position regression loss. The improved algorithm in this section involves the following experimental conditions: the anchor for clustering of the vehicle detection scenario described in this paper, multi-scale training, using label smoothing, and using mixup for the first 10 epochs of training. The situation of the loss function is as follows: using the IoU loss as position loss, using the L2 norm loss function as confidence loss, and using cross entropy as class loss.  
According to Table 5 and Figure 11, when the position regression loss function is modified as the IoU loss function, the model performance is significantly improved. Except for trucks, its precision in predicting the other classes is higher than that of Faster-RCNN with high precision. The YOLOv3 algorithm has two main shortages: firstly, this algorithm is not very accurate in regression of object position; secondly, it has a low recall rate. For the problem of inaccurate regression of object position, the IoU loss in this section is irrelevant to scale, which can reduce the influence of different scales and improve the model's performance.  
In Figure 12, we compare the omission ratio and average omission ratio for each class of object. It can be seen that, after employing the IoU loss function, the omission ratio is lower than that of the original algorithm and the other algorithm in comparison. The output end of the YOLOv3 algorithm will predict 10,647 bounding boxes; some of these 10,647 bounding boxes will be filtered through the confidence threshold value, and the rest of the bounding boxes will continue to participate in the operation of the NMS algorithm. In the NMS algorithm, there is a threshold value of IoU. If the IoU of the selected bounding box and surrounding bonding boxes is higher than the threshold value, the surrounding bounding boxes will be deleted. From this perspective, if the model has predicted the correct target, but the location of predicted target is not very accurate, then this predicted target might be deleted in the NMS process due to inaccurate location, which will reduce the model's precision.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Type** & **Suv** & **Sedan** & **Taxi** & **Van** & **Truck-Box** & **Bus** & **MiniVan** & **Truck-Util** & **Pickup** \\ \hline Suv & 98.35 & 1.57 & 0 & 0 & 0 & 0 & 0.8 & 0 & 0 \\ Sedan & 0.23 & 99.7 & 0.2 & 0.2 & 0.3 & 0 & & 0 & 0 \\ Taxi & 0.5 & 0.21 & 99.68 & 0 & 0 & 00 & 0.5 & 0 & 00 \\ Van & 0.43 & 1.18 & 0 & 97.33 & 0 & 0 & 1.7 & 0 & 0 \\ Truck-Box & 0 & 0.53 & 0 & 0 & 98.41 & 0 & 0 & 1.6 & 0 \\ Bus & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ MiniVan & 3.58 & 0.7 & 0 & 0.62 & 0 & 0 & 95.9 & 0 & 0 \\ Truck-Util & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ Pickup & 0 & 0 & 0 & 1.85 & 0 & 0 & 0 & 1.85 & 96.3 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Improved YOLO confusion matrix in this section (unit %).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Type** & **Faster-RCNN (\%)** & **Original YOLO (\%)** & **Improved YOLO with IoU (\%)** \\ \hline Suv & 75.10 & 71.80 & 90.29 \\ Sedan & 74.78 & 88.55 & 90.32 \\ Taxi & 85.83 & 89.55 & 90.32 \\ Van & 85.50 & 82.15 & 92.92 \\ Truck-Box & 89.95 & 76.94 & 95.23 \\ Bus & 90.01 & 82.94 & 95.90 \\ MiniVan & 77.27 & 74.48 & 89.84 \\ Truck-Util & 95.53 & 40.82 & 94.89 \\ Pickup & 90.89 & 35.54 & 93.73 \\ mAP & 84.99 & 71.42 & 92.60 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of Faster-RCNN, original YOLO and improved YOLO algorithm with IoU loss function in terms of precision.  
According to the above result, it can be seen that, after using the IoU loss, the precision is improved, the omission rate is reduced, and the model performance is further improved.