# NGIoU Loss: Generalized Intersection over Union Loss Based on a New Bounding Box Regression
## 3 NGIoU Loss
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class Name** & **GIOU** & **CIOU** & **NGIOU** \\ \hline pottedplant & 65.18\% & 64.25\% & **67.09\%** \\ chair & 75.05\% & 75.65\% & **75.68\%** \\ boat & 77.21\% & 77.60\% & 77.01\% \\ bottle & 77.36\% & 77.77\% & 77.65\% \\ diningtable & 83.91\% & 83.52\% & **84.91\%** \\ sofa & 84.19\% & 85.27\% & **86.54\%** \\ tvmonitor & 87.46\% & 86.46\% & 86.03\% \\ sheep & 87.84\% & 88.01\% & 87.76\% \\ aeroplane & 93.76\% & 92.42\% & 93.34\% \\ bird & 86.56\% & 86.97\% & **87.05\%** \\ cow & 92.37\% & 93.25\% & 92.18\% \\ person & 91.64\% & 91.39\% & **92.01\%** \\ bicycle & 93.66\% & 93.97\% & **93.98\%** \\ motorbike & 90.86\% & 93.18\% & **93.26\%** \\ horse & 92.45\% & 92.68\% & 93.23\% \\ cat & 89.88\% & 90.04\% & **90.51\%** \\ train & 90.65\% & 90.34\% & **90.89\%** \\ dog & 89.88\% & 90.65\% & **90.66\%** \\ bus & 93.70\% & 92.99\% & **93.90\%** \\ car & 94.23\% & 94.81\% & 95.06\% \\ \hline mAP & 85.06\% & 86.22\% & **86.79\%** \\ \hline training time & 658 min & 613 min & **609 min** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The comparison of performance indicators with different loss functions in the YOLOv5 algorithm. Figure 6: Test results of training weights by using GIoU, CIoU and NGIoU Loss functions in YOLOv4. Figure 7 shows the train loss obtained by using different loss functions on the YOLOv5 model. It is clearly observed that the convergence speed of NGIOU Loss is better than that of the CIoU Loss and GIoU Loss, which proves that NGIoU Loss has better performance. Figure 8 shows object detection results of the predicted boxes trained by using GIoU, CIoU, and NGIoU regression loss functions in the YOLOv5 algorithm. It is observed from the picture that compared with GIoU Loss, NGIou Loss and CIoU Loss are able to predict more objects, even though the overlapping area of the two objects is large. Different from CIoU Loss, the value of the NGIoU prediction box is higher than that of the CIoU prediction box, which proves that the NGIoU Loss has a better performance of prediction. ### SSD Algorithm Based on PASCAL VOC 2007

The SSD algorithm is one of the mainstream one-stage algorithms. Compared with the YOLO algorithm, it is more advantageous in speed. In this paper, 60,000 iterations are performed on the PASCAL VOC 2007 training set and tested on the PASCAL VOC 2007 test set. In order to obtain better training results, this paper carries out transfer learning and uses the pre-trained weights on PASCAL VOC 2007 and 2012 data sets, which are trained by using the Smooth L1 Loss function, GIoU Loss function, and NGIoU Loss function, respectively. The results are shown in the table below. As observed from Table 3, regression loss functions of the IoU series are generally higher than Smooth L1 regression losses in AP, as well as 1% higher in AP75. Compared with GIoU Loss, the NGIoU Loss proposed in this paper improves a bit, which verifies the feasibility of the NGIoU Loss. Figure 8: Object detection results of predicted boxes trained by using GIoU, CIoU, and NGIoU regression loss functions in the YOLOv5 algorithm. Figure 7: The comparison of total loss values trained by using different regression loss functions. Figure 9 shows the single object detection results of ground truth boxes and predicted boxes trained by using Smooth L1, GIoU, and NGIoU regression loss functions in the SSD algorithm. The figure is marked with the IoU values of ground truth boxes and predicted boxes. Compared with the original Smooth L1 regression loss, the replacement of the IoU series of regression loss functions greatly improves regression accuracy, which will be clearly observed from the figure and the values. In Figure 10 of the multi-object detection, the Smooth L1 regression loss function is easy to cause missed and false detection, and the IoU series of loss functions improve this situation.