# YOLO-RRL: A Lightweight Algorithm for PCB Surface Defect Detection
## 3 Structure of Key Improvement Components  
### RFD Module  
The conventional approach to downsampling detection neural networks typically involves the utilization of maximal pooling, average pooling, and stepwise convolution, which collectively facilitate a reduction in the dimensionality of the feature map. In addition to this, there are several other improved downsampling methods, including Local Importance-based Pooling (LIP), Antialiased Convolutional Neural Networks (Antialiased CNNs), SoftPool, and so on. These techniques facilitate the network's ability to more effectively capture essential information, mitigate the risk of overfitting, and so forth. Nevertheless, these techniques frequently encounter issues with information loss, localization, and fixation of feature selection when dealing with smaller targets, which can have a detrimental impact on the performance of the model in various respects.  
Figure 1: A diagrammatic representation of the YOLO-RRL network structure.  
This paper introduces the Robust Feature Downsampling (RFD) module [23], which improves the performance of the model in small target detection. The RFD module incorporates three different downsampling techniques: convolutional downsampling, slicing downsampling, and maximum pooling downsampling. The RFD module overcomes the limitations of the traditional convolutional downsampling by fusing multiple feature maps extracted using different downsampling techniques to create a more robust feature representation. The two variants of the RFD module are the Shallow RFD (SRFD) and the Deep RFD (DRFD), which are designed to handle different stages of the feature extraction process. The general architecture of the RFD module is illustrated in Figure 2. In this illustration, the SRFD module is employed to replace the initial downsampling layer of the original backbone network, while the DRFD module is used to replace the subsequent downsampling layers.  
In both SRFD and DRFD structures, the steps of copying the initial feature representation into three copies (X, C, and M) and then downsampling them through three different downsampling techniques, namely convolutional downsampling, slice downsampling, and maximum pooling downsampling, are included. These are ultimately fused to generate consistent and robust feature representations. The SRFD module focuses on processing the shallow feature maps and contains the feature enhancement layer and slice downsampling. The feature enhancement layer employs convolutional operations to extract more detailed information from the input image, thereby improving the representation of the initial feature map. The initial feature map is sliced using a slice downsampling technique to preserve information from the original data. This process serves to maintain the integrity of shallow features and to reduce information loss.  
The DRFD module is designed to process deeper feature maps using a range of downsampling methods, including convolutional downsampling, maximum pooling downsampling, and slicing downsampling. This approach is intended to generate more robust representations of deeper features, enhancing the overall performance of the model. The combination of each method ensures the completeness and detail of the feature maps, thereby preserving the texture and detail information of the feature maps and improving the model performance. Furthermore, the RFD method overcomes the limitations of the convolutional downsampling layer by merging multiple feature maps, thus prominently capturing complex details to produce a more robust feature representation. As illustrated in Figure 3, the detailed structure of SRFD and DRFD is depicted, where GConv, DWConvD, CutD, and MaxD are designated as grouped convolution, depth-separable convolutional downsampling, sliced downsampling, and maximally pooled downsampling.  
Figure 2: Generic RFD structure after replacement with SRFD and DRFD modules.