# YOLO-RRL: A Lightweight Algorithm for PCB Surface Defect Detection
## 5 Experimental Results Validation Analysis
### Analysis of Model Training before and after Improvement  
Figure 9 illustrates the alterations in pivotal metrics throughout the training process for both the YOLOv8 and YOLO-RRL models. The four sub-figures depict the fluctuations in precision, recall, mAP_0.5, and mAP_0.5:0.95 about the training period (epoch). A comparison of the precision rates reveals that the precision rate increases rapidly within the first 20 epochs. Throughout the training process, the precision rate of YOLO-RRL is consistently higher than that of YOLOv8, indicating that the model has been improved to have a lower  
false alarm rate. Observation of the recall rate reveals that the recall rate is rapidly improved within the first 50 epochs. Furthermore, the recall rate of YOLO-RRL is consistently higher than that of YOLOv8 throughout the training process. This indicates that the improved model is better able to detect all positive samples and has a lower underreporting rate. The mAP_0.5 curve indicates that mAP_0.5 is rapidly improved within the first 50 epochs of the two models. Furthermore, YOLO-RRL is consistently higher than YOLOv8 throughout the training process, suggesting that the improved model has a superior detection performance under the loose matching condition. From mAP_0.5.0.95, it can be observed that the rapid improvement within the first 100 epochs and YOLO-RRL consistently exhibits a higher performance than YOLOv8 throughout the training process, indicating that the improved model has a superior overall detection performance under different matching conditions. In conclusion, the advantages of YOLO-RRL in each index demonstrate that the newly introduced module or improved method has effectively enhanced the overall performance of the model, suggesting that YOLO-RRL has greater accuracy and reliability in detecting PCB defects.  
Figure 10 illustrates the variation in loss during training and validation for both the YOLOv8 and YOLO-RRL models. The six subfigures illustrate the variation in different types of losses (box loss, DFL loss, cls loss) on the training and validation sets, respectively. The changes in box loss, DFL loss, and cls loss during training and validation demonstrate that YOLO-RRL has a lower loss than YOLOv8 in both localization and prediction distributions. This further validates the effectiveness of the improved model. YOLO-RRL has a lower box loss and DFL loss than YOLOv8 in both training and validation sets, indicating that it is more accurate in locating and predicting distributions. The classification loss performance of the two models is comparable, suggesting that the model improvement has a relatively minor impact on the classification task performance.  
Figure 9: Changes in key metrics during training in YOLOv8 and YOLO-RRL.  
A comprehensive analysis of the two sets of charts reveals that the enhanced model outperforms the original model in all key indicators, with a clear loss optimization effect. In summary, the YOLO-RRL model has been enhanced structurally and optimized, resulting in a notable improvement in both detection accuracy and positioning accuracy while maintaining classification performance. The model has greater practical value in practical applications and is better suited to the needs of high-precision and high-reliability detection.