International Journal of Electronics and Computer Applications

Volume: 2 Issue: 2

  • Open Access
  • Original Article

AI-Based Fault Detection in PCB Layout Using Patch-Level CNN Classification and Grad-CAM Visualization

Deepali Misal1*, Ganesh Ingale1, Yash Chaudhari1, Aditya Deokar1, Siddharth Awate1

1Electronics and Telecommunication, Keystone School of Engineering, SPPU, Pune, Maharashtra, India.

* Corresponding author
Email: [email protected]

Year: 2025, Page: 70-73, Doi: https://doi.org/10.70968/ijeaca.v2i2.ML116

Received: July 28, 2025 Accepted: Nov. 23, 2025 Published: Dec. 12, 2025

Abstract

Automated quality inspection of Printed Circuit Boards (PCBs) is a critical requirement in modern electronics manufacturing. Traditional manual inspection methods are slow, inconsistent, and error-prone, while industrial Automated Optical Inspection (AOI) machines are prohibitively expensive for small and medium enterprises. This paper presents an AI-based PCB fault detection system using a custom Convolutional Neural Network (CNN) trained on the DeepPCB benchmark dataset from Peking University. The proposed approach introduces XML annotation-guided patch extraction that crops 128×128 pixel regions centered on annotated defect locations, enabling the classifier to focus exclusively on defect morphology rather than irrelevant background regions. The system classifies seven categories: missing hole, mouse bite, open circuit, short circuit, spur, spurious copper, and no-defect. Data augmentation expanded the training set from 2,953 to 25,472 samples. The model achieves 9697% validation accuracy on 680 unseen samples, outperforming comparable CNN-based methods in the literature. Grad-CAM (Gradient-weighted Class Activation Mapping) provides visual explainability by highlighting defect locations with heatmap overlays. The complete system is deployed as a Flask web application with a Neon PostgreSQL cloud database for persistent inspection logging. Experimental results demonstrate the feasibility of replacing expensive hardware AOI systems with an affordable, software-based AI inspection solution.

 

Keywords: AI-Based Fault Detection in PCB Layout Using Patch-Level CNN Classification and Grad-CAM Visualization

References

1. Grand View Research. <I>Printed Circuit Board Market Size Report</I> 2023Printed Circuit Board Design Techniques for EMC Compliance. Available from: https://www.grandviewresearch.com/industryanalysis/printed-circuit-board-market

2. . Adibhatla VA, Chih HC, Hsu CC, Cheng J, Abbod MF, Shieh JS. Defect Detection in Printed Circuit Boards Using You-Only-Look-Once Convolutional Neural NetworksElectronics. 2020; 9 (9). Available from: https://doi.org/10.3390/electronics9091547

3. Bhatt S, Kumari A. PCB defect detection using image processing techniques. <I>International Journal of Computer Applications</I>. vol. 168, no. 11, pp. 1–5, 2017.

4. Ding R, Dai L, Li G, Liu H. TDD‐net: a tiny defect detection network for printed circuit boardsCAAI Transactions on Intelligence Technology. 2019; 4 (2). Available from: https://doi.org/10.1049/trit.2019.0019

5. Huang W, <I>et al</I>. PCB defect detection using transfer learning with VGG-16. <I>Proc. IEEE ICIEA</I>, 2020, pp. 1–6.

6. Zhang X, <I>et al</I>. Automatic defect detection of PCBs based on YOLO. <I>Applied Science</I>, vol. 12, no. 14, p. 7221, 2022.

7. Selvaraju RR, Cogswell M, Das A, Vedantam R, Parikh D, Batra D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization2017 IEEE International Conference on Computer Vision (ICCV). 2017; Available from: https://doi.org/10.1109/iccv.2017.74

8. Tang S, He F, Huang X, Yang J. Online PCB Defect Detector On A New PCB Defect DatasetarXiv:1902.06197. 2019; Available from: https://doi.org/10.48550/arXiv.1902.06197

Cite this article

Misal D, Ingale G, Chaudhari Y, Deokar A, Awate S. AIBased Fault Detection in PCB Layout Using Patch-Level CNN Classification and Grad-CAM Visualization. 2025; 2(2):70-73. https://doi.org/10.70968/ijeaca.v2i2.ML116

Views
5
Downloads
1
Citations