Defect Detection in Printed Circuit Boards Using Fine-Tuned YOLOv8
摘要
Electronic devices have become predominant in most aspects of our lives. Electrical components are mounted directly on the printed circuit board (PCB) in various industries. It might become harmful or counterproductive when there are failures or defects in the manufacturing process of these PCBs, leading to severe damage to the system. There is a need to ensure production quality. PCB inspections are done manually by human experts, which is time-consuming and prone to human error. Thus, an automated system is needed to increase efficiency, cost, and overall throughput in the manufacturing process. This paper proposes an efficient preprocessing technique and a deep learning defect detection approach where various pre-trained models, such as YOLOv8 and Fast-RCNN, are finetuned on the processed DeepPCB dataset. The dataset contains 1500 pairs of PCB template images and their respective test images, which contain the defects with annotations for each sample. XOR operation is carried out between pairs of images to extract the feature differences, and then the defects are detected and classified by the finetuned YOLOv8 model. Furthermore, a greedy search is implemented for hyperparameter tuning to maximize accuracy. A 98.8% mAP is achieved, calculated at the intersection over union (IoU) with a threshold of 0.5 in detecting six different defects: open, short, spur, spurious copper, pinholes, and mousebites.