# RML-YOLO: An Insulator Defect Detection Method for UAV Aerial Images
## 3 Results
### Evaluation Metrics  
Object detection algorithms often use the competitive evaluation metrics of PASCAL VOC and MS COCO [39]. Both VOC and COCO evaluation metrics use Mean Average Precision (mAP) to measure the detection performance of the model. The calculation of \(mAP\) involves the calculation of related indicators such as Precision and Recall. The following will introduce these evaluation metrics and parameters. Unlike classification tasks, in object detection tasks, it is necessary not only to predict the category of the target, but also to accurately locate the position of the target. The commonly used evaluation parameter is the intersection to union ratio (IoU), which calculates  
Figure 8: Training results: (**a**) training loss results and (**b**) training accuracy results. Figure 7: UID information. the ratio of the intersection and union between the predicted box and the true box to measure the degree of overlap between the predicted result and the true result. The calculation formula is shown in Equation (10). Among them, \(Box_{gt}\) represents the real bounding box, \(Box_{pred}\) represents the predicted bounding box by the model, and the higher the IoU threshold, the closer the predicted result is to the real result. When \(IoU\) reaches 1, it represents that the predicted result completely overlaps with the actual result. \[IoU=\frac{Box_{pred}\cap Box_{gt}}{Box_{pred}\cup Box_{gt}} \tag{10}\]  
For the prediction of targets, it can be divided into four categories, as shown in Figure 9. Precision refers to the proportion of true-positive cases predicted to be correct among all predictions, used to measure the probability of positive cases being correctly predicted in the prediction results. The calculation formula is shown in Equation (11). \[Precision=\frac{TP}{TP+FP} \tag{11}\]  
Recall refers to the proportion of predicted true-positive cases to the total number of actual positive samples, used to reflect missed detections. The calculation formula is shown in Equation (12). \[Recall=\frac{TP}{TP+FN} \tag{12}\]  
Through the formulas of Precision and Recall, it can be found that there is a certain degree of mutual exclusivity between Precision and Recall. When the IoU threshold is set high, the actual insulator may be predicted as the background, resulting in an increase in missed detections, an increase in FN, and a decrease in Recall. Similarly, when the IoU threshold is set low, false detections will increase, while missed detections will decrease, FP will increase, and therefore Precision will decrease. Therefore, evaluating network performance solely based on one evaluation metric is not comprehensive. Therefore, a PR curve is generally drawn to comprehensively evaluate detection performance. The horizontal axis of the PR curve represents the recall rate, the vertical axis represents the accuracy rate, and the area below the curve represents the AP value. The calculation formula for AP is shown Equation (13). \[AP=\int_{0}^{1}P\Big{(}R\Big{)}dR \tag{13}\]  
In the VOC evaluation index, AP is the evaluation of a single category, while mAP represents the average AP of all categories in the dataset. The higher the mAP value, the better the detection performance of the model. The calculation method for mAP is shown in Equation (14). \[mAP=\frac{1}{N}\sum_{i=1}^{N}AP_{i} \tag{14}\]  
Figure 9: Confusion matrix. Compared with VOC evaluation metrics, COCO evaluation metrics adopt stricter standards and incorporate considerations for the average precision of targets at different scales. There are six commonly used COCO evaluation metrics: \(AP\), \(AP50\), \(AP75\), \(AP_{S}\), \(AP_{M}\), and \(AP_{L}\). AP50 and AP75 denote the evaluation results under different IoU thresholds, which correspond to \(mAP\) at \(IoU=0.5\) and \(IoU=0.75\) in the PASCAL VOC evaluation metrics.