Global Research Authority
Serving Researchers Since 2012

A Cost-Aware Intelligent PCB Defect Inspection System Using YOLO-Based Object Detection and MLP with Explainable Artificial Intelligence

DOI : 10.5281/zenodo.21193527
Download Full-Text PDF Cite this Publication

Text Only Version

A Cost-Aware Intelligent PCB Defect Inspection System Using YOLO-Based Object Detection and MLP with Explainable Artificial Intelligence

Sanaboina Chandra Sekhar, Assistant Professor, Department of CSE, UCEK(A) JNTU KAKINADA

Balireddi Balaganesh, PG Scholar, Department of CSE, UCEK(A) JNTU KAKINADA

Abstract – Printed Circuit Boards (PCBs) have become important elements in electronic gadgets of the modern world and any error in the manufacturing process of the microelectronic board may have a negative impact on the reliability of the products, its efficiency of operation and costs of maintenance. Traditional inspection schemes that are dependent on manual inspection with support of Automated Optical Inspection (AOI) system have had difficulties in detecting small and complicated defects in a typical industrial production environment. Recent developments in deep learning have allowed automated inspection systems with the capability to detect and localize defects in real time with high accuracy. Nevertheless, the majority of the current PCB inspection systems are focused on defect detection and lack predictive maintenance information and interpretable decision support. The paper describes a Cost-Aware Intelligent PCB Defect Inspection System that combines the YOLO-based object detection, Multilayer Perceptron (MLP)-based prediction, and Explainable Artificial Intelligence (XAI) into a single framework. Six PCB defect types are detected and classified with the help of the YOLO model and extracted defect features are used by the MLP model to predict PCB health score, repair cost, and repair time. Moreover, XAI methods such as Grad- CAM and LIME are also implemented to enhance transparency as they offer visual insights into how predictions and maintenance decisions are made. Experimental analysis performed on a PCB fault dataset shows that the framework proposed has a total classification accuracy of 97.80 percent with a high level of precision, recall, and F1-score of all defect classes. The combination of defect detection with predictive analysis and explainable decision support allows effective quality testing and quality planning. The suggested solution is an effective and scalable method of intelligent PCB inspection in contemporary industrial manufacturing facilities

INDEX TERMS: Printed Circuit Board, YOLO, Multilayer Perceptron, Explainable Artificial Intelligence, Defect Detection, Repair Cost Prediction, Predictive Maintenance.

  1. INTRODUCTION

    The cornerstone of all electronic products is Printed Circuit Boards (PCBs), which are essential in ensuring reliability and functionality of electronic systems. Faults added in PCB processing may have severe impact on the performance of a product, hike maintenance fee, and lower reliability in performances. As a result, correct inspection of defects has become a critical necessity in electronics producing companies to sustain quality standards to reduce production failures [1].

    Conventional PCB inspection technologies are mainly based on Manual visual inspection and Automated Optical Inspection (AOI) equipment. Despite their extensive use in industries, the techniques are, in most cases, unreliable when it comes to the detection of small and complex defects in different illumination levels and production limitations [2]. Manual inspection is also labour-intensive, time-consuming and extremely operator-dependent, whereas conventional AOI systems are based on manually created rules that are not flexible to a variety of defect pattern [3]. The above restrictions have inspired scholars to study Artificial Intelligence (AI) and Machine Learning methods to conduct automated PCB defect inspection [4].

    The most recent development of deep learning technologies has completely reshaped the concept of PCB inspection, allowing one to extract features automatically and detect defects on the image data through the use of intelligent features and techniques. CNNs have been proven to be better than conventional machine learning methods in terms of their performance in defect classification and localization [5]. YOLO (You Only Look Once) is one of the most profitable neural networks that have been developed as a deep learning method because it enables localization and classification in the same network architecture [6]. The online nature of the YOLO results in it being especially applicable in dealing with industrial PCB inspection challenges because processing pace and precision are equally significant in such scenarios [7].

    Some scholars have suggested improved YOLO-based networks to enhance the ability of PCB defects detectors. PCB-

    YOLOX added the capabilities of class-incremental learning on defect recognition but with high localization precision [8]. YOLO-DFA had two-feature attention schemes that enhanced the detection of small and appearance related PCB faults [9]. Equally, ABF-YOLO jointly implemented both axis attention and bidirectional feature fusion schemes to enhance feature representation and enhance the classification accuracy [10]. Models based on transformers like PCB-DETR have subsequently improved widespread feature extraction and local insight on intricate PCB defect patterns [11]. Other papers have examined lightweight architectures, multiscale feature fusion, and attention-guided learning mechanisms to enhance defect detection performance whilst minimizing the computational complexity [12], [13].

    Despite significant advancements in PCB flaw detection, the majority of current solutions are concentrated on the detection of defect localization and classification. However, the decision-making in industrial maintenance needs more information besides defect detection, PCB health diagnosis, cost of repair prediction, and time prediction of repair [14]. The current defect detection models seldom offer these kinds of predictive information and thus are not helpful in real life manufacturing contexts [15]. Consequently, maintenance engineers have to carry out further analysis, before making repair decisions, which makes operations more complex and responsive [16].

    Lack of interpretability is another significant issue related to the deep learning-based PCB inspection systems. Even though the current deep learning models can be characterized by impressive levels of prediction accuracy, their decision-making procedures are usually not easy to comprehend and justify [17]. The lack of transparency, which is a black-box property, impairs user confidence and restricts use in industries where understanding and explainable decision support is crucial [18]. Explainable Artificial Intelligence (XAI) methods including Grad-CAM, LIME and SHAP have become effective methods of visualizing model behaviour and enhancing transparency in prediction results [19]. Nevertheless, the majority of the current explainable PCB inspection systems are dedicated only to classification tasks and lack built-in capabilities of predictive maintenance analysis and repair-cost estimation [20].

    Driven by these constraints, this paper suggests a Cost- Aware Intelligent PCB Defect Inspection System incorporating the YOLO-based defect detection model, Multilayer Perceptron (MLP)-based prediction model, and Explainable Artificial Intelligence (XAI) into a single industrial inspection system. The YOLO model is used to use the MLP model and real-time flaw detection and localization uses engineered defect features to predict PCB health score, costs to repair, and time to repair. Moreover, XAI methods offer visual descriptions that can be

    understood and enhance maintenance decisions. The proposed system provides a powerful and scalable tool to the intelligent PCB inspection in contemporary manufacturing premises by incorporating defect detection, predictive analysis, and explainable decision support in one framework.

    The main contributions of this work are summarized as follows:

    • Creation of a YOLO-based real-time PCB defect detection and localization framework.

    • Architecture of an MLP-based prediction model to assess PCB health and to estimate repair-costs.

    • Devotion of Explainable Artificial Intelligence methods to enhance transparency and user confidence.

    • Creation of an industrial inspection pipeline that is cost conscious, and integrates both detection and prediction with explainability.

    • Experimental confirmation showing excellent detection limit and predictive performance in industrial PCB inspection applications.

  2. LITERATURE REVIEW

    PCB defect detection systems have been enhanced significantly lately with the latest developments in Artificial Intelligence (AI) and Deep Learning. Conventional inspection methods, which require manual inspection and Automated Optical Inspection (AOI) systems, can usually be problematic in identifying small defects and keeping them consistent in diverse industrial environments. As a result, various smart defect detection systems are suggested by the researchers to enhance the performance of inspection, its reliability, and similarity.

    The object detection frameworks based on YOLO have become one of the most effective methods of PCB defect inspection because of their capacity to quickly identify and pinpoint the flaws and classify them. PCB-YOLOX added features of class-incremental learning which allows the model to learn the newly introduced defect categories, and retain high level of localization performance on defects already learned [1]. The YOLO-DFA added two-feature attention mechanisms to enhance small and visually similar defect PCB detection through better feature representation and localization accuracy [2]. Equally, ABF-YOLO combined axial attention and methodic feature mixture to enhance feature extraction abilities and classification results on a variety of PCB defects [3].

    Transformer-based architectures have been of interest to PCB inspection research, as well. PCB-DETR joint transformer attention models featured Efficient-Net based

    feature extraction with the aim of enhancing global contextual awareness and defect localization behavior [4]. Transformer- YOLO also outperformed transformer-guided feature-learning by adding more features to the model because transformer- guided feature-learning shows enhanced detection accuracy in adverse industrial settings [5]. A number of frameworks that have been optimized with transformers have shown high ability to record long-range relationships and complex defect features than traditional CNN-based frameworks [6], [7].

    Various lightweight and attention-based systems have been developed to enhance the computation and industrial implementation efficiency. SGT-YOLO also used the optimized attention modules and other lightweight feature extraction strategies to obtain competitive detection performance with less computational complexity [8]. SOF- YOLO enhanced the localization precision with Dynamic Head modules, superior loss functions at the same time preserving the real-time processing performance [9]. YOLO-HMC also improved the learning of multiscale features by using Hor-Net architecture and attention-guided feature fusion methods [10]. Similarly, YOLO-WWBi used weighted fusions of feature and enhanced localization loss functions to enhance detection capacity of defects [11].

    Recent works have been devoted to the enhancement of tiny-defects detection and representation of features. Multi- granularity relation enhancements, as presented by MGRE-Net were aimed at enhancing contextualization and performance of localization in intricate industrial backgrounds [12]. PIDDN used a template-based Siamese architecture to realize a high detection accuracy using pair-image learning for tiny PCB flaws [13]. CIFP-Net concentrated on identifying PCB flaws with limited training samples through the addition of contextual information aggregation modules and foreground prototype guidance modules to enhance performance [14]. Further studies have examined uncertainty-sensitive learning and multilevel feature-fusion strategies to enhance robustness to low-contrast and noisy images [15], [16].

    Advanced neural architectures to improve performance of PCB inspection have also been explored. YOLOv5-MDS adopted the Mamba architecture to enhance the ability to extract features and infer images better than traditional YOLO architectures [17]. Adaptive YOLO models with feature-gated attention systems have shown a better robustness and generalization ability on various inspection conditions [18]. A few lightweight and efficient detection architectures have also been suggested such that precision and intricacy are not both overwhelmed to be deployed in industries [19], [20].

    Besides defect detection, explainability and interpretability have emerged as significant avenues for industrial AI research. PCB examination systems that use grad-

    cam have been able to indicate the location of critical defects and enhance the confidence of users in the prediction accuracy [21]. LIME and SHAP are explainable AI methods that have additionally improved transparency through the ability to give explanations of classification and prediction outcomes [22]. Extensive survey studies have indicated that despite the high detection rates (more than 95 percent) of most deep-learning- based systems in PCB inspection, many issues pertaining to explainability, industrial deployment, predictive maintenance, and decision-support integration are still unaddressed [23].

    Despite the impressive results of the current researches in relation to PCB defects detection accuracy and localization performance, the vast majority of methods are still concentrated on defects detection and classification. The industrial value of PCB health assessment, repair-cost, repair-time, and explainable maintenance recommendations are seldom discussed in a single framework. Thus the proposed work will combine YOLO-based faults detection, MLP-based quality and repair-cost forecasting, and Explainable Artificial Intelligence (XAI) to offer an all-encompassing, understandable, and cost- conscious PCB inspection system.

  3. DATASET DESCRIPTION

    The quality and diversity of the training dataset is a major factor influencing the effectiveness of any PCB defect detection system based on deep learning. The DeepPCB dataset will be used in this work to train, validate, and test the proposed Cost-Aware Intelligent PCB Defect Inspection System. The dataset is extensively applied in PCB inspection studies, and it features high-quality annotated images with various types of defects typically seen in industrial manufacturing settings.

    The DeepPCB dataset is composed of template and tested PCB images and the defect annotations. They are annotations that are accurate in defect locations and class labels needed to facilitate supervised learning and object detection approaches. The data includes six dominant PCB defect types, i.e., Missing Hole, Mouse Bite, Open Circuit, Short Circuit, Spur, and Spurious Copper. These flaws are typical manufacturing errors that can have a substantial impact on PCB performance and integrity.

    Before the model training, the dataset is sorted into directories with structure which include training, validation, and test samples. Every image comes with respective annotation files providing information about defect locations and classes. The data is also subjected to image preprocessing algorithms including resizing, normalization and augmentation to enhance better generalization and resilency of the model to different inspection conditions.

    As it is revealed in Table I, the structural features of every category of defects are different and can influence PCB functioning and its stability. Missing Hole and Open Circuit defects can effectively break the electric connection directly, but Short Circuit defects can lead to the unwanted flow of current between conductive paths. Likewise, Spur and Spurious Copper, defects may lead to issues with signal integrity, and Mouse Bite may lessen the integrity of circuit designs and the long-term viability.

    The data is divided into training, validation, and testing sets prior to model training. To improve the model’s generalization and resilience to different inspection settings, additional preprocessing techniques such picture scaling, image normalization, and image augmentation are employed. The variety of defects patterns that DeepPCB dataset can offer allows the proposed framework to obtain benefits in terms of learning discriminative defect features and enhances the framework’s effectiveness in terms of fault localization and classification precision, PCB health assessment, and predicting the repair cost.

    Table I. PCB Defect Categories & Description

    Defect Category

    Description

    Missing Hole

    The PCB does not have a required hole for the electronic component.

    Mouse Bite

    Damage along conductive traces that is small enough not to be seen- small edge damage along conductive traces that cannot be seen.

    Open Circuit

    A complete halt in the conductive path that cuts off the circuit.

    Short Circuit

    An unintended connection between conductive tracks.

    Spur

    A projection from a conducting surface that is to be avoided.

    Spurious Copper

    Excessive copper area in unwanted areas.

  4. PROPOSED METHODOLOGY

    In order to address the shortcomings of manual inspection, rule-based Automated Optical Inspection (AOI) and detection-only deep learning models, this paper introduces an intelligent, cost-conscious, and explainable PCB defect inspection system. The pipeline implements the system in sequential steps where PCB images undergo pre-processing, defect-detecting via a YOLO-based defect detector, encoded as engineered defect features, prediction model based on MLP and predicting the health and repair-cost of PCB, and the Explanable AI interprets the results with an interpretable explanation and repair suggestions. The stages are applied as independent modules to maintain modularity, scalability, and traceability of defect related information throughout the pipeline. The proposed system’s overall operation is shown in Figure 1. A bounding-box location, a class name, and a confidence score are provided for each of the six major PCB faults that it identifies:

    missing holes, mouse bites, open circuits, short circuits, spurs, and spurious copper.

    To enhance transparency and trust between users, the framework also adds an Explainable Artificial Intelligence (XAI) component. The XAI component produces visual explanations and interpretable insights on the results of defect detection and the prediction outputs. These descriptions allow the maintenance engineers to realize how the characteristics of different defects affect the PCB health evaluation and repair- cost determination. Consequently, the suggested framework does not only offer proper defect detection, but also actionable and explainable maintenance suggestions that can be implemented in the industry.

    Fig. 1. Proposed Cost-Aware Intelligent PCB Defect Inspection System Workflow.

    1. Image Preprocessing

      The PCB images obtained are resized to a constant input size, normalized, and quality restored with noise removal and brightness/contrast operations to ensure a similar appearance of the dataset. Data augmentation techniques, such as rotation, horizontal and vertical flipping, scaling and zooming are used to enhance resilience to changes in PCB orientation, illumination, and image quality. The preprocessing step assists in diminishing the effect of environmental Moreover, image augmentation has the effect of augmenting diversity in the dataset, creating numerous variations of the original samples used in training. This avoids model overfitting, and enhances the performance of generalization when checking images of PCBs that have never been seen before. The resulting pre-processed images are then converted to a structure format that can be used in object detection using YOLO and then it is given to the defect detection module. Figure shows the general

      variations, and allows the model to learn representations of defects that are more generalized.

      Besides image improvement, normalization is also done to bring about standardization of pixel intensity distribution

      among all samples. The result of this process is the increase of stability in training, and faster convergence of the model because this way, the input data is in a similar scale. The noise cutting methods are also used to reduce the unnecessary.

      Fig 2. Preprocessing Workflow PCB Image Preprocessing

      image artifacts, which can disrupt defect localization. Fig 2. processes enhance the saliency of defect regions of interest and add to the discriminating nature of PCB defect patterns.

      preprocessing process that is followed within the proposed system as shown Fig. 2.

    2. YOLO-Based Defect Detection.

      Upon preprocessing, PCB images are sent to the YOLO (You Only Look Once) object detector model in order to be automatically localized and classified. YOLO is a one- stage object detector model that engages in both feature

      extraction, object localization and classification in a single forward pass. The architecture is very practical in event of industrial PCB manufacturing as it greatly cuts down on the complexity in computation, and real-time inspection can be performed on it.

      The three main components of the YOLO architecturea convolutional backbone, a feature aggregation neck, and a detection headare depicted in Figure 3. The supplied PCB picture’s hierarchical image features, including both high-level semantic and low-level visual information, are produced by the backbone network. The retrieved features are then sent into the neck network, which combines multi-scale data and improves fault identification across various scales using the Feature Pyramid Network (FPN) and Path Aggregation Network (PAN) architectures. Finally, the detecting head generates the bounding-box coordinate for identifying flaws in scenarios of various sizes. Lastly, for every identified defect location, the detection head generates bounding-box coordinates, object-ness probabilities, and defect-class probabilities. Six types of PCB defectsMissing Hole, Mouse Bite, Open Circuit, Short Circuit, Spur, and Spurious Copperare recognized by the trained YOLO model.

      To indicate how reliable the forecast is, the model provides the bounding-box coordinates, class labels, and confidence ratings for each discovered flaw. These outputs give commendable information on where a defect has been found and what it is, which is vital at subsequent analysis phases.

      The capability of the YOLO to produce high detection accuracy and fast inference speed is one of the strongest pros of this algorithm. In contrast to traditional image-processing methods that need manual feature-extraction methods, YOLO can automatically discover the feature characteristics relevant to defects using only training data. This feature allows the precise localization of the defective PCBs and minimizes the human intervention.

      The defect information that is detected is then sent to the feature extraction and predicion modules to determine the PCB health and estimate repair-cost. The results of localizing sample defects produced by the YOLO model are demonstrated in Figure. 4. This unified methodology allows real-time inspection, without requiring a hand-written feature engineering at the detection phase.

      Fig. 3. The YOLO Architecture is utilized to detect defects on a PCB.

      Fig. 4. The process to detect defects in PCB using YOLO is shown in the following diagram, and the output for sample

      images is display.

    3. Feature Extraction and Engineering

      The detections made by the YOLO model are then transformed into a well-formed collection of defect level features necessary for downstream prediction. As illustrated in Figure, for every defect detected, the system calculates the defect area, the number of defects, the confidence score average and a score of severity that indicates the overall impact the defect has on the condition of the PCB. Fig. 5. The feature engineering step is formalized as below:

      Defect _ Area = Width × Height (1)

      Severity _ Score = (Defect _ Area × Defect _ Count) / Confidence _ Score (2)

      Health _ Score = 100 Severity _ Score (3) Repair _ Cost = Severity _ Score × Repair _ Factor (4) where (1)

      Fig. 5. Defect Feature Engineering Process

      It performs the following functions: (1) Computes the spatial extent of the defect region detected, (2) quantifies the overall severity of the PCB defects in relation to the confidence level of detection, (3) estimates the PCB condition on a 0-100 scale including the defect severity, and (4) estimates the approximate repair cost based on the PCB condition. A structured feature vector [Defect Area, Defect Count, Confidence Score, Severity Score, Health Score, Repair Cost] is produced which is fed as input into the MLP-based prediction stage.

      the spatial area of the identified defect area, (2) a metric of how severe the defects are based on the confidence level in the defect, (3) a condition judgment that rates the PCB defect severity on a 0-100 scale, and (4) an estimate of

      the approximate cost of repair based on the PCB defect severity. The output of the feature vector structure is the structured feature vector [Defect _ Area, Defect _ Count, Confidence _ Score, Severity _ Score, Health _ Score, Repair _ Cost] that is the input for the prediction stage, which is implemented by an MLP.

    4. MLP-Based PCB Health and Repair Cost Prediction

      The engineered defect features along with the outputs to be learned PCB health score and estimated repair cost are learned by Multilayer Perceptron (MLP) model as shown in Figure. 6. It consists of an input layer that accepts engineered feature vectors, nonlinear transformations in hidden layers that are implemented using ReLU activation, and linear/soft-max activation output layer that returns the predicted health score and repair cost. The forward prediction process is given by:

      y = f (WX + b) (5)

      where X is the input feature vector, W is the weight matrix, b is the bias vector, f is the activation function, and y is the predicted output. The prediction confidence is computed as:

      Confidence _ Score = max (p, p, , p) (6)

      where p 1, p 2, etc., p n are the probabilities of the output classes and the maximum value is used as the last confidence that is used in relation to the prediction. Through historical patterns of defect-repair the MLP model identifies

      nonlinearities between defect type, severity, and repair requirements that can-not be modeled by a simple rule-based heuristic to allow more accurate cost sensitive decision-making.

      The forward propagation process can be summarized by equation (5) as the input features are processed through the neural network by converting them with the help of learned values of weights and bias to produce prediction values. The confidence level of the prediction is given by equation (6) which choosing the maximum probability among all possible output classes.

      .

      Fig. 6. MLP-Based PCB Health and Repair Cost Prediction Model

    5. explainable AI Integration

      In order to provide the transparency of PCB health and repair-cost estimates, the suggested system incorporates the Explainable Artificial Intelligence (XAI) methods, such as Grad-CAM and LIME, as well as the rule-based explanation generation. The XAI module as illustrated in Fig. 7 can help you pinpoint the defect area which most affected a given prediction, which features were the most dominant (e.g., defect area, confidence score, severity score), and the subsequent human- readable explanation of why a defect was classified as it was and how it should be fixed. The explanation is supported by a step-by-step repair recommendation which enhances technician

      confidence in the industry, facilitating auditability, and allowing more informed industrial decision making, as opposed to opaque, detection only pipelines.

    6. Performance Evaluation Metrics

      The efficiency of the suggested system is assessed based on the classic classification measures – accuracy, precision, recall, and F1-score – calculated when accounting the six PCB defects:

      Accuracy = (TP + TN) / (TP + TN + FP + FN) (7)

      Precision = TP / (TP + FP) (8)

      Recall = TP / (TP + FN) (9)

      F1-Score = 2 × (Precision × Recall) / (Precision + Recall)(10)

      In this paper, we propose a model for the prediction of the health and repair cost of PCs based on multiple linear programming technique.

      where TP, TN, FP and FN are the true positives, true negatives, false positives and false negatives, respectively. In this use, precision is extremely significant because false positive defect flags cause uncalled for repair actions and recall is significant because a missed defect (false negative) may cause the board to be put into production.

      Equation (7) is a measure that considers the overall correctness of the classification model, both for defect and non-defect samples. Equation (8) is used to determine the percentage of detected defects that are truly defective, and gives the reliability

      of positive predictions. To evaluate the ability of the model to detect all possible defects in the real PCB images, Equation (9) is used. Combining the two metrics precision and recall into one metric provides a balanced assessment of model performance as in equation (10).

      Precision is also critical in PCB inspection, as the issue of false- positive detection can lead to unnecessary repair action and maintenance expenses. Likewise, recall is very crucial as the defect parts can be passed through without being detected which can impact product quality and reliability. So, above evaluated criterion’s all together gives the information about the effectiveness, robustness and the industrial applicability of the proposed PCB defect inspection system.

    7. Final Output Generation

    Fig. 7. Explainable AI (XAI) Framework for PCB Inspection.

    explanation of the top-contributing features. Table 2 is a

    To each image of a PCB that has been inspected, the system produces a combined output that contains the types and confidence scores of the identified defects, the predicted

    PCB health score, the predicted repair cost and repair time, the advice that can be given on a repair, and the XAI-derived

    summary of one of the representative outputs of the proposed system. This formatted, explainable output is intended to provide direct support to technician work orders and industrial maintenance planning, as opposed to the additional step of manual interpretation of the result as done with traditional detection-only systems.

    Table 2. The proposed system will generate the following output for the PCB inspection:

    Category

    Parameter

    Value

    PCB Scenario

    Description

    Board with multiple defects (Open Circuit, Short, Spur, Mouse Bite, Spurious Copper, Missing Hole)

    Defect Detection

    Detected Defects

    Short

    Prediction

    PCB Health Score

    55 / 100

    Cost Analysis

    Estimated Repair Cost

    $4.50

    Repair Analysis

    Estimated Repair Time

    6 Minutes

    Confidence

    Prediction Confidence

    0.99

    Defect Features

    Defect Count / Severity Score

    3 / 45

    Repair Recommendation

    Suggested Action

    Scrape excess copper

    XAI Explanation

    Important Feature

    Defect Area and Confidence Score

    Final Decision

    PCB Status

    Repair Recommended

  5. RESULTS AND ANALYSIS

    1. Experimental Setup

      The proposed system has been realized in python programming using the Ultralytics YOLO framework to detect defects and a machine learning approach (MLP) from scikit- learn was implemented to predict health and cost. The image process was carried out using OpenCV and NumPy, while explainability was achieved through the application of Grad- CAM/LIME. The dataset of PCB defects described in Section III was first divided into training, validation, and test sets and the trained YOLO model was then trained until convergence, and the MLP model was trained with the engineered defect features extracted from the defect detection outputs. The results in this section are based on the held-out test set.

    2. YOLO Defect Detection Results

      The trained YOLO model was able to locate and categorize PCB defects with high confidence for all six categories. Figure. 8 demonstrates typical predictions on example images, where the true label, predicted label and prediction confidence are shown for each image sample with most predictions achieving high confidence values (close to 100%), and a few at the margin showing lower confidence, which are mostly cases of two very similar classes, such as Spur and Spurious Copper. The results demonstrate that the proposed YOLO-based detector can accurately locate the defects in real- time, which is suitable for industrial PCB inspection

      Fig. 8. Sample YOLO Defect Detection Predictions on Test images.

    3. Classification Performance and Confusion Matrix.

      Figure. 9 shows the confusion matrix achieved on the test set, and Table 3 lists the precision, recall, and F1-score on each of the defect classes. The Missing Hole, Open Circuit and Short was classified perfectly (or almost perfectly) and there was slight misclassification between.

      Spur and Spurious Copper – two visually similar defects – and a few cases of Mouse Bite were confused with Spur and Spurious Copper. Generally, the system had a test accuracy of 97.80 with weighted-average precision, recall, and F1-score of 0.98, which validates the reliable and consistent classification of all defects.

      Fig. 9. PCB Defects Classification Confusion Matrix (Test Accuracy: 97.80%)

      Table 3. Classification Performance of the Proposed PCB Defect Detection System (Requested Tests Accuracy: 97.80)

      Defect Class

      Precision

      Recall

      F1-Score

      Support

      Missing Hole

      1.00

      1.00

      1.00

      100

      Mouse Bite

      0.91

      0.98

      0.95

      148

      Open Circuit

      1.00

      1.00

      1.00

      98

      Short

      1.00

      1.00

      1.00

      101

      Spur

      0.99

      0.93

      0.96

      99

      Spurious Copper

      0.99

      0.95

      0.97

      123

      Macro Average

      0.98

      0.97

      0.97

      669

      Weighted Average

      0.98

      0.98

      0.98

      669

    4. Training and Validation Performance

      Figure. 10 depicts the accuracy and loss curves of the training process and validation. Both training and validation accuracy approach the same value and both

      training and validation loss approach the same values and no significant difference is seen between the two curves. This behaviour shows that the YOLO model not only learned the discriminative defect features quite well but at the same time generalized reasonably well and was not overfitted to unseen PCB images.

      Fig. 10. Validity and Loss Curve Training and Validation Accuracy and Loss Curve

    5. PCB Health Score and Repair Cost Prediction Analysis

      The MLP-based prediction module was tested by comparing PCB health score and repair-cost predictions across boards having different defect profiles. PCB boards which had critical defects like the Missing Hole and Open Circuit had consistently lower health scores and higher estimates of repair cost than boards with other minor defects like Spur or Spurious Copper, which validates the model as capturing the relative severity of various defect types. The system also produces repair-time estimates and recommended repairs actions with

      each prediction, as summarized in Table 2, thereby providing individual industrial decision-makers with all necessary information to take risky decisions instead of having to conduct a separate manual cost analysis. Figure. 11 shows a typical health-score and repair-cost prediction output created by the system, showing the number of defects found, the predicted PCB health score, and the estimated repair cost and repair duration of an inspected board as well as its defect map, enabling industrial users to instantly evaluate the state of PCBs without manually examining raw detection data.

      Fig. 11. PCB Health Score and Repair Cost Prediction Dashboard interface

      The PCBs Health Score and Repair Cost Prediction Dashboard interface will be created. A PCBs Health Score and Repair Cost Prediction Dashboard interface will be developed.

    6. Explainable AI Visualization and Verification

      To enhance the transparency of decision making, proposed system features X-ray verification and defect visualization, where a defect-free golden template PCB is compared side by side with the inspected test board using X- ray, as illustrated in Figure. 12. This is a comparison that can be used to visually verify that a flagged area is indeed different from a reference design prior to taking any repair action. In

      addition, Figure. The technician work order interface is shown in 13, and includes a list of each detected defect and its confidence level.

      Converted into an actionable maintenance checklist for shop floor techs – score, recommended repair action, estimated repair time, estimated cost.

      Fig. 12. Output of X-Ray Verification and Defect Visualization.

      Fig. 13. Technician Work Order and Repair Recommendation Interface.

    7. Real-Time Dashboard and Batch Production Analytics.

      The proposed system was implemented with the help of an interactive inspection dashboard, as demonstrated in Figure. 11, which enables the user to post PCB images, st detection confidence levels and see detected defects, PCB health score, estimated repair cost and time and real-time production statistics. The dashboard also incorporates the XAI module, displaying the localization of defects, technician work

      orders, and rule-based repair descriptions to the quantitative predictions, enabling users to trust and confirm the recommendations of the system instead of viewing them as a black box. In addition to single-board inspection, the system can also be used to batch PCB inspect, where a folder of PCB images runs in a serial manner and compiled into an analytics report at a production level scale. As shown in Figure. The batch summary view, 14, summarizes the number of boards scanned,

      the total yield rate, the average health score, the total estimated financial impact, and a per-board breakout of pass, fail and scrap status with the associated defect types and estimated

      losses, which expands the proposed system beyond single- board defect detection to production-line quality monitoring and cost analytics.

      Fig. 14. PCB Inspection and Production Interface Batch.

    8. Comparative Discussion

    The proposed framework targets a similar classification accuracy (97.80%) as the detection-only frameworks reported in the literature – some of which report mAP values in the 95-99% range exclusively when localizing PCB defects [1], [5], [10], [13] – but it also offers PCB health assessment, repair-cost estimation, and explainable decision support, which are mostly lacking in the literature. This makes the proposed framework a more comprehensive, practically implementable, industrially-actionable inspection solution, instead of a detection-accuracy-only improvement, that goes to the point of filling the gap found in Section II.

  6. CONCLUSION AND FUTURE SCOPE

This paper introduced a cost-conscious, intelligent PCB fault inspection system which involves YOLO-based PCB object detection, MLP-based PCB fault prediction, and Explainable Artificial Intelligence in one pipeline. The system proposed is very accurate in detecting six PCB defect categories

– Missing Hole, Mouse Bite, Open Circuit, Short, Spur, and Spurious Copper – and the engineered defect features allow accurate prediction of PCB health-score and repair-cost, and the XAI features can provide transparent, readable by humans, explanations and work orders to technicians. The performance of the experimental evaluation was high, with a total test accuracy of 97.80 percent and high precision, recall, and F1- score in all categories of defects that proved the effectiveness of the combination of detection, prediction, and explainability

into a single and cost-conscious workflow of industrial inspection.

Regardless of these findings, the present assessment was performed on a PCB image dataset in controlled conditions which might not fully reflect the lighting range, image noise and implicit defect patterns in actual industrial production lines and the system currently features six defect types and chiefly offline analysis. Further research is directed toward increasing the dataset with real-world industry samples, adding further and multilayer-PCB defect classes, experimenting with transformer-based and hybrid prediction models, and simplifying the system to deploy it in real-time on edge and industrial IoT systems. Subsequent improvements can involve automated repair-recommendation, predictive maintenance analytics, cloud-based industrial monitoring, and further Explainable AI integration to enhance the applicability of the system with the aim of offering intelligent, automated PCB quality assurance.

REFERENCES

  1. Q. Ge, R. Wu, Y. Wu, and H. Liu, A Class-Incremental Learning Method for PCB Defect Detection, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3544321.

  2. Z. Yan, R. Hao, B. Huang, L. Zhu, and H. Pan, A Domain Incremental Learning Framework for PCB Continuous Defect Detection, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3550210.

  3. H. Wu and Y. Lin, A High-Performance and Enhanced Generalization Small Target Defect Detection Method for PCB Boards Based on YOLO- EMAC, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3602542.

  4. K. Li, X. Zhong, and Y. Han, A High-Performance Small Target Defect Detection Method for PCB Boards Based on a Novel YOLO-DFA Algorithm, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3551584.

  5. X. He and M. Xie, ABF-YOLO: A Fine-Grained PCB Defect Detection Framework Integrating Axial Attention and Bidirectional Feature Fusion, IEEE Trans. Consum. Electron., vol. 71, no. 3, pp. 85628570, 2025, doi: 10.1109/TCE.2025.3597022.

  6. H. D. Nguyen, D. Cheng, X. Wang, Y. Shi, and B. Wen, Data-Efficient Deep Learning for Printed Circuit Board Defect Detection Using X-Ray Images, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3529089.

  7. S. K. Ong, C. K. Tan, V. M. Baskaran, B. K. Puah, and K. H. Liew, Enhancing Industrial PCB and PCBA Defect Detection: An Efficient and Accurate SEConv-YOLO Approach, IEEE Access, vol. 13, pp. 148917 148935, 2025, doi: 10.1109/ACCESS.2025.3601151.

  8. M. Mohsin, S. Rovetta, F. Masulli, and A. Cabri, Heatmap Visualization for Deep Learning Analysis of Waste Printed Circuit Boards, in 2025 IEEE 2nd Int. Conf. Electron., Commun. Intell. Sci. (ECIS), 2025, doi: 10.1109/ECIS65594.2025.11086768.

  9. F. Guo, Z. Chen, B. Chen, M. Jing, and L. Zuo, Multi-Granularity Relation Enhancement Network for Tiny Defect Detection on Printed Circuit Board, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3597003.

  10. J. S. Aleman and A. M. Reyes-Duke, Performance Analysis of Robo- flow 3.0 and YOLO-NAS in PCB Defect Detection Compared to YOLOv9 and RT-DETR Using Augmented Image Dataset, in 2025 10th Int. Conf. Control Robot. Eng. (ICCRE), 2025, pp. 229234, doi: 10.1109/ICCRE65455.2025.11093496.

  11. Q. Jiang, X. Wu, J. Zhou, and J. Cheng, PIDDN: Pair-Image-Based Defect Detection Network With Template for PCB Inspection, IEEE Trans. Compon. Packag. Manuf. Technol., vol. 15, no. 4, pp. 830841, 2025, doi: 10.1109/TCPMT.2025.3543396.

  12. C. Mo, Z. Hu, J. Wang, and X. Xiao, SGT-YOLO: A Lightweight Method for PCB Defect Detection, IEEE Trans. Instrum. Meas., vol. 74, 2025, doi: 10.1109/TIM.2025.3563011.

  13. P. Selvam, R. Rajasekar, C. Gunasundari, S. J. Priya, M. Murugappan, and M. E. H. Chowdhury, YOLO-DefXpert: An Advanced Defect Detection on PCB Surfaces Using Improved YOLOv11 Algorithm, IEEE Access, vol. 13, pp. 143085143101, 2025, doi: 10.1109/ACCESS.2025.3595048.

  14. Y. Zhao and Z. Jiang, YOLO-WWBi: An Optimized YOLO11 Algorithm for PCB Defect Detection, IEEE Access, vol. 13, pp. 74288 74297, 2025, doi: 10.1109/ACCESS.2025.3564734.

  15. M. Yuan, Y. Zhou, X. Ren, H. Zhi, J. Zhang, and H. Chen, YOLO-HMC: An Improved Method for PCB Surface Defect Detection, IEEE Trans. Instrum. Meas., vol. 73, pp. 111, 2024, doi: 10.1109/TIM.2024.3351241.

  16. Q. Li, L. Wu, H. Xiao, and C. Huang, PCB-DETR: A Detection Network of PCB Surface Defect with Spatial Attention Offset Module, IEEE Access, vol. 12, pp. 158436158445, 2024, doi: 10.1109/ACCESS.2024.3486176.

  17. X. Yu, L. Han-Xiong, and H. Yang, PCB Defect Detection Model Based on Intrinsic Feature Decomposition and Multilevel Fusion Against Image Uncertainty, IEEE Sens. J., vol. 24, no. 12, pp. 1949719505, Jun. 2024, doi: 10.109/JSEN.2024.3394492.

  18. X. Chen, Y. Wu, X. He, and W. Ming, A Comprehensive Review of Deep Learning-Based PCB Defect Detection, IEEE Access, vol. 11, pp. 139017139038, 2023, doi: 10.1109/ACCESS.2023.3339561.

  19. J. Yang, Z. Liu, W. Du, and S. Zhang, A PCB Defect Detector Based on Coordinate Feature Refinement, IEEE Trans. Instrum. Meas., vol. 72, 2023, doi: 10.1109/TIM.2023.3322483.

  20. W. Chen, Z. Huang, Q. Mu, and Y. Sun, PCB Defect Detection Method Based on Transformer-YOLO, IEEE Access, vol. 10, pp. 129480 129489, 2022, doi: 10.1109/ACCESS.2022.3228206.

  21. C. Liu, H. Yuan, M. Ferlauto, J. Lv, Y. Liu, and H. Xu, A Noncontact PCB Multi-fault Diagnosis Algorithm Based on Scalar Magnetic Field

    Fusion Feature and Transformer Architecture, IEEE Trans. Instrum. Meas., vol. 74, pp. 113, 2025.

  22. W. Zhang, Y. Lu, T. Chen, and J. Li, A Random Forest Algorithm for PCB SMD Defect Detection, IEEE Trans. Compon. Packag. Manuf. Technol., vol. 15, no. 5, pp. 11351142, May 2025.

  23. J. Luo and J. Chen, CIFPNet: Contextual Information Aggregation and Foreground Prototype Guidance Network for Few-Shot PCB Defect Detection, IEEE Trans. Instrum. Meas., vol. 74, pp. 112, 2025.