An Explainable AI-Based Computer Vision Framework for Printed Circuit Board Defect Detection Using YOLOv4
Keywords:
Printed Circuit Boards, PCB defect detection, YOLOv4, computer vision, explainable artificial intelligence, automated optical inspection, deep learning.Abstract
Printed Circuit Boards (PCBs) are critical components in modern electronic systems, where manufacturing defects can significantly compromise device reliability, safety, and operational performance. Conventional inspection techniques, including manual inspection and traditional Automated Optical Inspection (AOI), are often limited by subjectivity, high operational cost, and reduced scalability. This study proposes a lightweight and explainable Artificial Intelligence (AI)-based computer vision framework for automated PCB defect detection using a YOLOv4 object detection model integrated with multimodal explainable Artificial Intelligence (AI). A publicly available annotated PCB dataset sourced from Roboflow Universe was utilized for model training and evaluation, with data augmentation techniques including rotation, brightness adjustment, cropping, flipping, and noise injection applied to improve model robustness. The trained YOLOv4 model achieved a precision of 91.4%, recall of 87.8%, and mAP@0.5 of 89.2% with an average inference time of approximately 80 ms per image. To improve interpretability and usability, Gemini AI was integrated to generate natural-language explanations, defect summaries, and repair-oriented guidance based on detected anomalies. The complete framework was deployed as a responsive web-based application using Next.js, TailwindCSS, Prisma ORM, and PostgreSQL, supporting both single-image and batch-image inspection workflows. Experimental results demonstrate that the proposed system provides accurate, fast, and interpretable PCB defect inspection while maintaining accessibility for small-scale manufacturing, educational, and research environments. The study highlights the potential of integrating deep learning and explainable AI for scalable and cost-effective intelligent inspection systems in modern electronics manufacturing.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 UNIABUJA Journal of Engineering and Technology (UJET)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.