To address the challenges of low detection accuracy, missed detections, and high false detection rates for small targets in PCB defect detection tasks, this study proposes an enhanced YOLOv8 methodology incorporating feature focusing and multi-scale fusion techniques. Initially, a lightweight GTADH module is integrated into the detection head of YOLOv8, employing a shared convolution and task alignment mechanism to minimize model parameters while enhancing classification and localization accuracy. Subsequently, an adaptive feature-focusing module is introduced into the feature fusion network to bolster the detection capabilities for small targets via multi-scale feature fusion. Finally, the reverse residual moving block (iRMB) and attention mechanisms are combined within the backbone network to facilitate efficient extraction and fusion of feature information, preserving finer details of small targets. Experimental results demonstrate that the Improved YOLO algorithm achieves a 1.3% increase in detection accuracy and a 7.3% enhancement in mAP50:90 evaluation standards compared to the original YOLOv8s algorithm on the PCB defect dataset, while also reducing model size by 60%, thus showcasing its effectiveness in small target detection tasks.