Abstract
Defects on printed circuit board can result in electrical issues, reduced performance, and, in extreme cases, pose risks to both personnel and equipment. As a result, detecting PCB defects is essential for improving product safety and safeguarding individuals. Traditional manual inspection techniques are often lack of accuracy and . To overcome the challenges, we present an improved algorithm for detecting PCB component defects, utilizing YOLOv8n. In this research, we enhanced the backbone structure of YOLOv8n by incorporating SPD-Conv, and we introduced a P2 detection head to better detect small objects at various feature levels, minimizing the loss of detailed information. Moreover, the WIoU loss function was integrated to offer a more accurate measure of localization errors, thereby improving detection precision. Additionally, by utilizing the results from component localization and recognition, we applied the Inception-ResNet V1 model for feature extraction, generating feature vectors for component images. We then employed Euclidean distance to assess similarity, successfully identifying four common types of component defects. Experimental results validate that our proposed algorithm efficiently and accurately localizes and recognizes components on circuit boards, effectively identifying a range of component defects.