To address the problems of low network accuracy, slow speed, and a large number of model parameters in printed circuit board (PCB) defect detection, an improved detection algorithm of PCB surface defects based on YOLOv5 is proposed, named PCB-YOLO, in this paper. Based on the K-means++ algorithm, more suitable anchors for the dataset are obtained, and a small target detection layer is added to make the PCB-YOLO pay attention to more small target information. Swin transformer is embedded into the backbone network, and a united attention mechanism is constructed to reduce the interference between the background and defects in the image, and the analysis ability of the network is improved. Model volume compression is achieved by introducing depth-wise separable convolution. The EIoU loss function is used to optimize the regression process of the prediction frame and detection frame, which enhances the localization ability of small targets. The experimental results show that PCB-YOLO achieves a satisfactory balance between performance and consumption, reaching 95.97% mAP at 92.5 FPS, which is more accurate and faster than many other algorithms for real-time and high-precision detection of product surface defects.
Surface defects, which often occur during the production of aluminum profiles, can directly affect the quality of aluminum profiles, and should be monitored in real time. This paper proposes an effective, lightweight detection method for aluminum profiles to realize real-time surface defect detection with ensured detection accuracy. Based on the YOLOv5s framework, a lightweight network model is designed by adding the attention mechanism and depth-separable convolution for the detection of aluminum. The lightweight network model improves the limitations of the YOLOv5s framework regarding to its detection accuracy and detection speed. The backbone network GCANet is built based on the Ghost module, in which the Attention mechanism module is embedded in the AC3Ghost module. A compression of the backbone network is achieved, and more channel information is focused on. The model size is further reduced by compressing the Neck network using a deep separable convolution. The experimental results show that, compared to YOLOv5s, the proposed method improves the mAP by 1.76%, reduces the model size by 52.08%, and increases the detection speed by a factor of two. Furthermore, the detection speed can reach 17.4 FPS on Nvidia Jeston Nano’s edge test, which achieves real-time detection. It also provides the possibility of embedding devices for real-time industrial inspection.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.