# YOLO-RRL: A Lightweight Algorithm for PCB Surface Defect Detection
## 5 Experimental Results Validation Analysis
### Ablation Experiments

Table 2: Results of ablation experiments with different improvement schemes. The introduction of the RFD downsampling module in scheme A led to a notable enhancement in the accuracy, mAP, and AP for the five defect types. Furthermore, the heterogeneous copper defect exhibited the highest AP across all experiments. However, this approach also resulted in a marginal increase in the number of parameters, a significant surge in GFLOPs, and an expansion in computational complexity, ultimately reducing FPS. The scheme improves the accuracy, and the average accuracy mean but at the cost of inference speed. It is demonstrated that the downsampling process preserves the features better and reduces the loss during feature map compression. The introduction of the RepGFPN network in Scenario B led to a notable enhancement in AP values across the four categories, with a 2.0% increase in accuracy, a 1.2% improvement in mAP, and a substantial acceleration in inference speed. However, this was accompanied by an expansion in the number of parameters and GFLOPs. While the introduction of this network resulted in more powerful feature representation and a significant improvement in model accuracy, it also increased computational complexity. The introduction of the DySample upsampling module in scheme C led to an increase in AP for all five defect types. This was evidenced by a 1.6% and 1.2% increase in accuracy and mAP, respectively, and a significant increase in FPS, while the number of parameters and GFLOPs remained stable. The introduction of this module has the effect of reducing false positives and missed detections without increasing computational resources and optimizes identification accuracy for the majority of categories. It is demonstrated that replacing upsampling with the baseline model results in significantly superior detail recovery in the feature map while also reducing the incidence of false positives and false negatives. The introduction of the LADH module into scheme D resulted in an increase in AP for all four defect types, a small increase in accuracy and mAP, and the best number of parameters, GFLOPs, and FPS for all experiments. The introduction of this module can significantly enhance the inference speed while reducing the computational complexity, rendering it well-suited for real-time application scenarios that are constrained by computational resources. The introduction of RepGFPN and DySample in scheme E has led to an improvement in the AP values of all five defect categories. Furthermore, the AP value for spurious defects has reached its highest level across all experiments. Additionally, the FPS and mAP have been enhanced, while the number of parameters and GFLOPs have been increased. Consequently, the scheme achieves an optimal equilibrium between high accuracy and real-time performance, rendering it well-suited to scenarios that demand both high accuracy and real-time performance. The detection model YOLO-RRL proposed in this paper is derived from the integration of all modules in scheme F. The experimental results demonstrate that the model achieves an mAP of up to 95.2%, indicating that it is capable of effectively reducing false alarms and detecting defects on the surface of the PCB. The number of parameters and GFLOPs were also significantly reduced, and the FPS was improved within an acceptable range. The mAP values for three defect types were the best in the experiment, especially for leakage holes (99.2%) and rat bites (95.6%). Consequently, the scheme achieves the highest mAP and low computational complexity with high inference speed, which represents the optimal configuration in terms of overall performance. This configuration demonstrates the scheme's great potential and wide applicability in practical applications for scenarios requiring high accuracy, low computational resources, and high real-time performance.