Comparative Evaluation of Yolov5 Variants for Automated Pcb Surface Defect Detection
Abstract
Detection of surface defects on printed circuit boards (PCBs) is important for maintaining high production standards and preventing malfunction of modern electronics. Traditional inspection methods often fail to adapt to the changes in visual conditions. Deep learning architecture such as You Only Look Once version 5 (YOLOv5) come in to provide faster and reliable object detection. In this study, we have analysed the ability of the YOLOv5n, YOLOv5s and YOLOv5m models to classify and map PCB surface faults. The model was evaluated on the PKU-Market-PCB data set. The models were trained to identify six type of defects such as open circuits, short circuits, spurs, spurious copper, missing holes and mouse bites. The results show that all three models significantly outperform legacy baseline methods. The YOLOv5m model is better than the other model. It obtained a mAP@0.5 of 0.993, a precision of 0.986, a recall of 0.965 and an F1-score of 0.975. The YOLOv5s was just a bit behind with 0. 976 (mAP@0.5), whereas the smaller YOLOv5n version still achieved a very solid 0. 953.The results ultimately confirm a simple trend. Larger network size directly improves the model's capacity to categorise and spot defects, so YOLOv5m is the most capable model in this setup.