0% found this document useful (0 votes)
2 views31 pages

Chapter 5

This chapter introduces an optimized extreme gradient boosting algorithm for classifying defects in printed circuit boards (PCBs), addressing the challenges of traditional inspection methods. It outlines a methodology that includes preprocessing, dataset balancing, feature extraction, and classification, utilizing advanced techniques like CLAHE for contrast enhancement and the FPXCPNet model for feature extraction. The proposed OTXGBOOST algorithm enhances defect detection accuracy while reducing computational complexity, making it suitable for resource-constrained environments.

Uploaded by

Geetha Daniel M
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views31 pages

Chapter 5

This chapter introduces an optimized extreme gradient boosting algorithm for classifying defects in printed circuit boards (PCBs), addressing the challenges of traditional inspection methods. It outlines a methodology that includes preprocessing, dataset balancing, feature extraction, and classification, utilizing advanced techniques like CLAHE for contrast enhancement and the FPXCPNet model for feature extraction. The proposed OTXGBOOST algorithm enhances defect detection accuracy while reducing computational complexity, making it suitable for resource-constrained environments.

Uploaded by

Geetha Daniel M
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

127

CHAPTER 5

AN OPTIMIZED EXTREME GRADIENT BOOST WITH


PRE-TRAINED MODEL-BASED FEATURE LEARNING
MECHANISM FOR PRINTED CIRCUIT BOARD
DEFECT CLASSIFICATION

5.1 INTRODUCTION

High-quality PCBs are in high demand due to the constantly growing


market for electronic gadgets. However, PCB surfaces often suffer from defects
such as missing holes, mouse bites, open circuits, shorts, spurs, and spurious
copper. These flaws can lead to electronic device malfunctions and reduced
efficiency, issues that are further exacerbated by the growing complexity of PCB
designs driven by the portable electronics industry. Traditional PCB reliability
testing methods involve manual inspections, destructive testing, and statistical
analysis. While these approaches have been widely used, they often include
expenses, time, and human error. The rapid advancement of DL presents an
opportunity to transform PCB reliability testing by automating inspections,
improving predictive analytics, and enhancing defect detection. However, many
types of PCBs typically contain unique defect types and circuit specifications and
often lack sufficient training datasets for defect detection. Using them to train
models with high-precision classification capabilities remains a challenge. As a
solution to these issues, this chapter presents an optimized extreme gradient
128

boosting algorithm designed to leverage similar principles for defect recognition


on circuit boards of various styles.

5.2 METHODOLOGY

Due to the diverse types, sizes, and appearances of defects on PCBs, as


well as the complex textures and backgrounds in PCB images, accurately
detecting defects remains a significant challenge. Traditional deep learning-based
defect detection models, while powerful, often involve high computational cost
and extensive parameter tuning. To overcome these limitations, a hyperparameter-
tuned XGBoost-based method has been proposed for the detection of PCB defects.
This method is ideal for use in practical, resource-constrained settings, as it
improves detection accuracy while drastically reducing computing complexity
and resource usage. Figure 5.1 illustrates the detailed working methodology.
The framework includes preprocessing, dataset balancing, feature extraction, and
classification. Each step is described in the following subsections. The study
initially performs preprocessing, which provides contrast enhancement via
CLAHE and noise filtering based on AMF from the collected PCB images of the
deep PCB defect dataset. Then, it uses the DA2DASYN hybrid algorithm to
balance the dataset. After that, it extracts the image’s most discriminant
characteristics using the FPXCPNet model. Ultimately, it employs the
OTXGBOOST algorithm to classify the six types of defects, where the CGWOSO
model optimizes the hyperparameters most effectively. Table 5.1 shows the design
and functionality of the proposed pipeline stages.
129

Figure 5.1 Workflow of the proposed OTXGBOOST methodology

Table 5.1 Design and functionality of the proposed pipeline stages


Pipeline stage Model used Algorithm type Network structure Justification
Tile based histogram Enhances local contrast
Preprocessing(Im CLAHE(Contrast
with clip limit & and removes the impulse
age Limited AHE)+AMF Enhancement +
used variable noise while preserving
Enhancement+ (Adaptive Median Spatial filtering
window median edges ,improving feature
noise filtering) Filter)
filter extraction
DA2DASYN(Data Adaptive synthetic Addresses class imbalance
Data Augmentation & sample generation dynamically, enhancing
Data Balancing
Augmentation with Adaptive guided by local data generalization on limited
Synthetic Sampling) density datasets
Multi branch CNN Captures rich multi-scale
FPXCPNET(Feature
Deep CNN with cross path and spatial features with
Feature Pyramid based
feature extractor feature pyramid improved context
Extraction Exeption network)
fusion awareness
OTXGBOOST(O
sprey Tuned Provides high
Gradient boosted
Extreme Gradient classification accuracy
Ensemble Machine decision tree with
Classification and Boost)+ with strong bias variance
Learning classifier regularization and
Model CGWOSO(Chaot control and avoids local
and Meta heuristic population based
optimization ic with Gaussian minima ,optimizes
optimization search with chaotic
weight Centered weights/hyperparameters
maps
Osprey efficiently.
Optimization)
130

5.2.1 Preprocessing

Image preprocessing is an essential step to prepare input images from


a dataset during the initial phase, ensuring that the raw data from the Deep
PCB defect dataset is transformed into a more consistent dataset for further
analysis. This includes two processes, such as contrast enhancement and noise
filtering. The following is a brief description of these phases.

[Link] Contrast enhancement

The primary purpose of contrast enhancement in PCB images is to


improve the visibility and clarity of features, making them easier to distinguish
from the background. This enhancement is crucial for accurately detecting
PCB defects. To enhance the visibility of features in PCB images, this work uses
CLAHE for contrast enhancement. CLAHE was also applied in the previous
chapter and is used here again for the same purpose, following its successful use
in earlier studies. An image is split into tiles or contextual regions using the
CLAHE algorithm. Each contextual region’s histogram is created, and clipping is
done at a predefined value. The histogram bins receive a redistribution of the
clipped amount. The original histogram’s adjusted form is this histogram.
This approach lowers the over-enhancement issue and eliminates the
edge-shadowing effect of AHE. The efficiency of the CLAHE in improving
low-contrast medical images has been proven. The flowchart in Figure 5.2 is the
simplest way to illustrate this concept.
131

Figure 5.2 Flowchart of the proposed CLAHE

[Link] Noise filtering

The purpose of noise filtering in PCB images is to improve image


quality and facilitate subsequent analysis, such as defect detection or component
identification. By removing noise, algorithms can more effectively extract
meaningful features and make more accurate assessments. This study also utilizes
the AMF algorithm, building on the advantages presented in the previous chapter.
The purpose of noise filtering in PCB images is to improve image quality and
support further analysis, such as defect detection. By removing noise, the classifier
can more effectively extract meaningful features and produce accurate results. In
this study, the AMF algorithm is used again, building on its successful application
in the previous chapter. The working process of this algorithm is described as
follows:
An AMF does spatial processing to lower image noise. The filter
compares each pixel in the image to its surrounding pixels. Pixels are considered
noise if one of their values significantly differs from those of most of the nearby
pixels. The filtering method then replaces the noisy pixel with the median value
of the neighboring pixels. This procedure is repeated until every noise pixel in the
image has been eliminated.
132

5.2.2 Dataset Balancing

The trained classifier is biased towards the majority classes and


performs poorly on them, as the Deep PCB defect dataset frequently exhibits data
imbalance issues. This can result in high overall accuracy due to the model's
tendency to predict the majority class; however, it fails to identify the more
interesting and valuable minority class effectively. To address the data imbalance
issue, our study employs the DA2DASYN method. Initially, data augmentation is
used to increase the sample size in minority classes; this ensures that our model
does not see the same image twice, helps avoid overfitting, and aids the model in
generalizing more effectively. Though this increases the presence of the minority
class, class imbalance may still exist. Hence, additional synthetic sample
generation is needed. Therefore, the system further integrates the ADASYN
algorithm along with data augmentation to better balance the dataset. ADASYN
is an enhanced data balancing method that incorporates SMOTE-based
adaptability, where the local density of each minority class sample is assessed,
and more synthetic data is generated for samples with lower density. Numerous
factors, including dataset distribution and model prediction outcomes,
demonstrate the benefits of this approach. The algorithmic working steps of
DA2DASYN are explained below:
Input: A Dataset imbalance containing samples from the majority and
minority classes
Output: Augmented and balanced dataset with synthetic minority class samples
Begin
Step 1: Apply data augmentation techniques to increase data diversity for the
minority class. This includes:
 Rotation: Rotate images by a fixed angle (e.g., 90°, 180°).
 Flipping: Perform horizontal and/or vertical flipping to improve the
model’s generalization without altering defect characteristics.
133

 Cropping: Randomly crop regions of interest from the image to


highlight defect areas.
 Translation: Shift image pixels horizontally or vertically.
 Scaling: Resize images while preserving the aspect ratio.
Step 2: Combine the augmented data with the original training set to form an
expanded dataset.
Step 3: ADASYN finds its KNN for each minority class instance, which can
include both minority and majority class instances.
Step 4: Determine the majority sample ratio between the neighbors to identify
how tough it is to learn that sample.
Step 5: Calculate the percentage of artificial instances to be generated for each
minority class by normalizing these ratios.
Step 6: Determine the number of artificial samples to be produced for each
instance of a minority class based on its local neighborhood.
Neighborhoods with a higher proportion of majority class samples tend
to exhibit a higher level of class imbalance. Therefore, more synthetic
minority samples are generated in these regions to balance the dataset
where it is most needed adaptively.
Step 7: The original minority class sample and its KNN inside its
neighborhood are interpolated to create synthetic minority class
samples.
Step 8: Continue Step 7 until each instance of the minority class has the
necessary number of synthetic samples produced.
Step 9: Combine the synthetic samples with the expanded augmented dataset
to obtain a balanced and enriched dataset for model training.
End
134

5.2.3 Feature Extraction

Feature extraction is crucial for learning the features contained in


PCB images, and this process will significantly influence the performance of the
classification task. We have chosen to apply the FPXCPNet approach because the
model will automatically extract features from the PCB image based on each pixel
in the picture. Xception (XCPNet) reimagines convolutional networks by taking
cues from the initial Inception principles and refining them to create an even more
powerful architecture. The XCPNet block introduces depthwise separable
convolution to make it more computationally efficient, reducing the number of
parameters while maintaining strong performance. It features 36 convolutional
layers, incorporating batch normalization, skip connections, and ReLU activation
functions in each layer. Compared to other models, the XCPNet architecture is
frequently used for PCB defect classification due to its high precision and
performance.

However, the current XCPNet feature-based method only utilizes the


local feature maps, such as contours and edges. Feature maps from different layers
describe deeper information about an image. The feature map of the lower layer
contains more structural details about the image, whereas the feature map of the
higher layer focuses more on semantic information. To fully utilize the target’s
global and local information, as well as the attributes that each layer extracts, an
FPN is proposed on the traditional Xception model. This model utilizes the
pyramidal feature hierarchy in XCPNet to fuse features at different levels, thereby
enhancing the model’s capacity to represent features. Thus, the FPN included in
the XCPNet is termed the FPXCPNet model.
135

Figure 5.3 FPXCPNet structure

The entire procedure of FPXCPNet‐ based feature extraction is split


into three main parts: the entry, middle, and exit flow, along with FPN and Global
Average Pooling (GAP), as described in Figure 5.3.

i) Entry flow
The entry flow involves feeding a 3×3 convolution layer with 32 and
64 filters, respectively, with a scaled PCB input image. 2 × 2 strides are utilized.
This facilitates the capturing of low‐ level information, such as contours and
edges, from the input PCB image. The ReLU activation function comes after each
of the convolutions mentioned above. A piecewise linear function called the ReLU
function aids in keeping the neural network complex enough to recognize patterns
while preventing the issue of vanishing gradient, and it is defined as in
Equation (5.1):
136

 
~
relu  max 0, Y (5.1)
~
where, Y refers to the convolutional layer’s output feature maps.
The depthwise-separable convolution comes after it. A standard convolution is
broken down into a depthwise and pointwise convolution. This method preserves
the capacity to detect spatial patterns while lowering the number of parameters
and computing expenses. This operation can be formulated using Equation (5.2)
and (5.3).
~
  ~
Ydwc  relu BN DepthwiseConv Y   (5.2)

~
  ~
 
Ypwc  relu BN DepthwiseConv Ydwc (5.3)
~ ~
where, Ydwc and Ypwc refers to the output of the depthwise and pointwise

convolution, and BN indicates the use of batch normalization, which is employed


to stabilize and accelerate the training of the XCPNet network. Finally, max
pooling yields better results than average pooling, hence it is employed further to
reduce the size of the generated feature maps. To reduce dimensionality, we
employed max pooling to identify the maximum value of a pixel within a
PCB image region covered by the kernel.

ii) Middle flow


The ReLU activation is performed 8 times after depth‐ wise separable
convolution with 728 filters, and a 3×3 kernel is used to capture higher-level
feature maps from the image. It is the middle-level flow of XCPNet processing.

iii) Exit flow


The exit flow comprises a series of separable convolutional layers.
The separable convolutions in the exit flow continue to capture the middle flow’s
output’s high-level features.
137

iv) FPN
The feature maps from these flows are passed through a series of lateral
connections to form the feature pyramid. It shows high-level feature maps at many
scales and collaborates with the XCPNet network to improve and balance defect
detection performance at various scales. It included both top-down and bottom-up
paths. The feedforward computation is identified as the bottom-up pathway.
One pyramid level is designated for every stage. The last layer of each stage will
produce the reference set of feature maps for the top-down pathway’s lateral
connection enrichment. The steps in the top-down pathway were as follows:
 Higher pyramid-level feature maps, which are coarser defined but have
stronger semantics, are used for upsampling the higher-resolution
features. Simple upsampling of the spatial resolution by a factor of 2 is
performed using the nearest neighbor.
 Each lateral connection combines feature maps of the same spatial size
from the top-down and bottom-up pathways.
 Particularly, to reduce the channel dimensions, 1×1 convolutions are
employed in the bottom-up pathway’s feature maps.
 Additionally, the top-down and bottom-up pathway’s feature maps are
combined using element-wise addition.

v) GAP
Finally, the resultant feature maps from the FPN is passed to the
GAP layer. It offers several advantages over fully connected layers,
including reducing overfitting and computational cost and providing a more
natural connection between feature maps and categories. Specifically,
GAP converts the entire feature map from the FPN layer into a single vector,
improving the model’s capacity to classify PCB defects accurately and to
generalize to new data.
138

5.2.4 Classification

Finally, the six kinds of PCB defects are classified based on the
extracted features using the OTXGBOOST algorithm. An XGBOOST-based
method was implemented in this study because it is a flexible, highly efficient,
portable, and supervised learning algorithm for PCB defect classification.
XGBOOST algorithms are developed under the framework of gradient
boosting. The foundation of XGBOOST is the boosting principle, which
combines additive training methods with weak learner forecasts to create a strong
learner. Additionally, the XGBOOST algorithm relies heavily on regularization to
prevent overfitting issues in both linear and tree-based models. Figure 5.4
shows the architecture of the XGBOOST algorithm, which simplifies the
goal functions by combining the prediction and regularization terms while
maintaining the quickest processing speed. Although XGBOOST has excellent
results in all aspects, there are still some problems, one of which is that it has many
parameters, and tuning these hyperparameters manually can be very complicated,
as selecting hyperparameters significantly affects the performance of the model
because they do not take into account past evaluations when selecting the next
hyperparameters to evaluate. As a result, many times, they spend a significant
amount of time evaluating the wrong set of hyperparameters. To overcome these
deficiencies, this study develops the CGWOSO algorithm to fine-tune the
hyperparameters optimally, which can explore a wide range of parameter
combinations. This makes them more efficient in finding optimal hyperparameters
of the XGBOOST model.
139

Figure 5.4 Basic XGBOOST structure

The defects classification, such as missing holes, mouse bite, open circuit,
short, spur, and spurious copper defect, function at the step e is presented as in
Equation (5.4):
e
CDhe    CDi IFRh   CDhe 1  CDe IFRh  (5.4)
i 1

where, CDhe  and CDhe1 refers to the predictions at the steps e and e  1 , CDe IFRh 

represents the learner at step e , and IFRh signifies the input extracted features,
respectively. Next, to address overfitting while maintaining computational
efficiency, XGBoost employs an analytical formula to evaluate the quality of the
model's fit. This allows the algorithm to balance model complexity and accuracy
by optimizing its objective function, ensuring that the classifier performs well on
both training and unseen PCB defect data, which is shown in Equation (5.5):

 
l e
OJF e    lf ZˆPˆh , ZOh    CDi  (5.5)
i 1 i 1
140

where, lf refers to a loss function between the observed value ZOh and predicted

value ZˆPˆh , l denotes how many observations were used, and  represents the
regularization term and is defined as in Equation (5.6):

 CD    min NAj 


1
P  S
2
(5.6)
2

where,  S indicates to the vector of scores in the features, P denotes the

regularization parameter,  min refers to the minimum loss, and NA j represents the

number of features in a decision tree.

[Link] Hyperparameter tuning

We employed the highly effective hyper-parameter optimization


technique known as the CGWOSO optimization to optimize the XGBOOST
hyperparameters. Osprey Optimization (OSO) algorithm, also known as water
hawk, is a bio-inspired metaheuristic algorithm. It is modeled after the behavior
of ospreys to tackle challenging tasks and is inspired by the hunting method of
real ospreys. The OSO algorithm formulates the behavior of carrying fish as the
exploitation phase and quantitatively models the behavior of hunting fish as the
exploration phase. This framework enables OSO to rapidly converge on
competing algorithms, strike a balance between exploration and exploitation, and
identify the optimal solution to optimization issues. However, it has a weak global
comprehensive search ability, poor population diversity, and a propensity for local
optimality.

The system introduces the CGWOSO algorithm to solve the issues,


which combines the linear differential Decreasing Inertia Weights (LDIW)
strategy, Piecewise Chaotic Mapping (PCM), and Gaussian difference variation
into the original OSO algorithm. Incorporating these strategies can improve
optimization performance and more effectively identify the idea hyperparameter
141

values, boost population variety, and prevent the algorithm from being localized.
The proposed CGWOSO algorithm’s working process is described as follows:
Random initialization is used by the OSO algorithm to initialize the
population, resulting in an uneven distribution of initialization and a decrease in
initialized population diversity. This restriction has an impact on the algorithm’s
capacity for exploration, particularly when hyperparameter tuning is underway.
The benefits of randomness, ergodicity, and regularity in chaotic mapping can
increase the diversity of population initialization, improve the capacity to search
globally, and increase the efficacy of algorithmic solutions. Thus, piecewise
chaotic mapping is presented in this study to initialize the population of ospreys.
In order to balance the trade-off between the algorithm’s global search capability
and local exploitation performance, piecewise chaotic mapping, a type of chaotic
mapping, can produce sequences with a high degree of randomness and long-term
unpredictability. This enhances the search range of viable solutions. It is
formulated using Equation (5.7):
OS g ˆ , 0  OS g  ˆ
 g
g 1 OS  ˆ 0.5  ˆ , ˆ  OS g  0.5
OS  (5.7)
1  ˆ  OS 0.5  ˆ , 0.5  OS g  1  ˆ
g

1  OS g ˆ , 1  ˆ  OS g  1

Among them, ̂ indicates the control parameter, and the values of ̂ is


in the range of (0, 1), and OS g refers to the initial position at the current iteration
g , respectively. Next, the fitness function evaluates how well a specific set of
hyperparameters performs, guiding the algorithm towards optimal values.
The main goal of fitness  fy  calculation is to minimize the fitness function,
meaning the algorithm seeks to find hyperparameters that yield the best model
performance. Minimum classification error is set as the fitness function, and it is
computed using Equation (5.8):
142

fy  min classifica tion error rate 


I mis
100 (5.8)
I tns

where, I mis and I tns represents the wrongly classified instance count and the total
instance count, respectively. After that, the osprey enters the exploration phase,
where the whole hyperparameter search space is explored by ospreys imitating
attacking fish. At this stage, the initial candidate hyperparameter configurations,
represented as fish positions, are determined using Equation (5.9), allowing the
algorithm to sample diverse regions in search of promising tuning solutions
broadly.

FBm  OSk | k 1, 2,........, N  fyk  fym  OSbest  (5.9)

where, FBm shows the fish’s chosen location for the m th osprey, OSbest means the

best individual position, N represents the number of osprey populations, fy m and

fy k denotes the fitness values corresponding to m th and k th osprey, respectively.
Equation (5.10) mathematically models the osprey’s attempt to attack fish after
determining their positions.

OSmP1,n  OSm, n  m1 . 1  PH m, n  KI m, n  OSm, n , m  1,2,..., N , n  1,2,..., D

(5.10)
where, OSmP1,n indicates the m th osprey’s new position in the exploration stage’s

n th dimension, PH m, n denotes the location of the fish, which is chosen from the list

of recognized fishes, KI m, n represents a random integer within {1, 2}, and also,

m1 and  1 represents weight coefficients and coefficients for the Gaussian

distribution function that produce a random number function with a variance of


1 and a mean of 0, respectively. The diversity of possible hyperparameter
configurations is increased by individually perturbing each element using
differential Gaussian distribution function coefficients, which ensures the
algorithm’s speed of convergence while preventing it from entering a local
143

optimum. If the new hyperparameter position’s fitness value is higher, it will then
take the place of the old one, as defined in Equation (5.11).

OSmP1 , if fy mP1  fy m
OSm   (5.11)
OSm , otherwise

where, fy mP1 indicates the fitness of the newly generated solution. Next,
in the exploitation phase, a new random position is calculated as a position
suitable for fish feeding using Equation (5.12). This position represents a
refined hyperparameter configuration. Suppose the value of the fitness
function remains constant or improves at this new position. According to
Equation (5.13), it will take the place of the associated osprey’s prior
hyperparameter setting.

LPn  m2 .  2  UPn  LPn 


OSmP,2n    OSm, n  , g  1,2,....., MX g (5.12)
g

OS P 2 , if fy mP 2  fy m
OSm   m (5.13)
OSm , otherwise
where, indicates the new position of the m th osprey in the n th dimension in the
exploitation stage, the search space’s lower and higher limits are denoted by LPn and

UPn , g and MX g refers to the current and maximum iteration number, m2 and  2

represents a weight coefficients and Gaussian distribution function, fy mP 2 represents

the newly created position’s suitability, and  refers to the LDIW strategy,
respectively. In the original OSO algorithm, the producer relies too heavily on its
position update method during early iterations, which limits its ability to explore the
hyperparameter space effectively and leads to slow convergence. In later iterations,
the search often becomes trapped near suboptimal hyperparameter configurations,
restricting further improvement. The algorithm’s late convergence speed among
candidate hyperparameter sets is increased by using the LDIW producer update
144

equation, which strikes a compromise between local and global exploration


capabilities. The weight coefficients are expressed using Equation (5.14):

  MXg
   max   max   min . (5.14)
g

Among them,  takes the value 0.9 and 


max min
takes the value 0.4.
Finally, if the termination condition is satisfied, the algorithm terminates. Otherwise,
repeat the process for the next iteration until you attain the best hyperparameters.
Figure 5.5 shows the pseudocode of the proposed CGWOSO algorithm.

Figure 5.5 Pseudocode of the proposed CGWOSO


145

5.3 PERFORMANCE EVALUATION

The suggested OTXGBOOST model’s experimental setup was created


to evaluate its performance. We used an Intel Core i5 processor, Windows 10
operating system, and 8 GB of RAM for our tests. The Google Collab Pro,
Python 3.8, PyTorch tool, NVIDIA GTX 1070 GPU, and OpenCV 3.4.2 have all
been utilized in the creation of our models. Table 5.2 lists the hyperparameters
used in our investigation.

Table 5.2 Hyperparameter settings of OTXGBOOST


SI. No. Hyperparameters Values
1 Optimizer Adam
2 Activation ReLU
3 Maximum depth 8
4 Subsample ratio 0.85
5 Learning rate 0.07
6 Gamma 0.1
7 Epochs 50

It utilized the public dataset to evaluate the system's effectiveness,


which is accessible through the Kaggle Deep PCB defect repository. Table 5.3
presents the overall classification results. The first column displays the input
sample images. The second column shows the data augmentation techniques
applied to these images, including rotation, flipping, cropping, translation, and
scaling. Subsequently, the FPXCPNet and OTXGBOOST models are applied to
the augmented dataset, which produces accurate classification results, which are
presented in the third column.
Table 5.3 Classified results of OTXGBOOST model
Input sample Augmented image Classified results

Missing holes

Spurious copper

146
147

5.3.1 Performance Analysis of the Proposed OTXGBOOST Model

This section examines the effectiveness of the proposed OTXGBOOST


method in comparison to traditional models, including XGBoost, MobileNetv3,
VGG16, and RNN models. These models are chosen as baseline models due to
their proven effectiveness in PCB classification tasks, and they help to assure the
suggested method’s superiority in handling complex PCB defect characteristics.
This study uses several evaluation metrics, such as accuracy, f1-score, precision,
and recall, to determine how effective the proposed methodology. These important
evaluation metrics provide detailed information on how the proposed method
should be regarded.

Figure 5.6 Accuracy Vs. Epoch analysis of the proposed OTXGBOOST


model

Figure 5.7 Loss Vs. Epoch analysis of the proposed OTXGBOOST model
148

The training and validation accuracy and loss are used to assess how
well the proposed system fits the unseen data. Figures 5.6 and 5.7 illustrate this
concept visually. At the initial epoch, the training and validation accuracy are
0.842 and 0.819, respectively, while the corresponding training and validation loss
values are 0.672 and 0.789. As the number of epochs increases from 0 to 50, the
training and validation accuracies improve significantly to 0.995 and 0.999,
respectively, and the training and validation losses decrease to 0.009 and 0.015,
respectively. The minimal gap between the training and validation performance
demonstrates that the proposed model effectively avoids overfitting and maintains
strong generalization by utilizing the hybrid data balancing approach, specifically
the DA2DASYN approach. Furthermore, the CGWOSO algorithm is employed to
identify the optimal number of training epochs, ensuring maximum validation
accuracy, minimum loss, and high generalization capability without compromising
the speed.

Proposed XGBoost MobileNetv3 VGG16 RNN


100
98
ACCURACY (%)

96
94
92
90
88
86
84
Missing Open Short Spur Spurious Mouse bite
holes circuit copper
DEFECTS

Figure 5.8 Accuracy analysis of the proposed OTXGBOOST and baseline


models

Figure 5.8 reveals the outcomes of the proposed and baseline models
in terms of the accuracy metric across different defect types. As an illustration,
the proposed model achieves 99.96%, 99.94%, 99.92%, 99.88%, 99.83%, and
149

99.81% accuracy for missing holes, open circuit, short, spur, spurious copper, and
mouse bite defects, which is better when compared to the traditional methods.
These findings highlight the strong capability of the proposed framework to
manage the intricate and non-linear characteristics in PCB defect data. Achieving
such high accuracy indicates not only enhanced detection accuracy but also a
considerable reduction in both false positives and false negatives, which is
essential for ensuring consistent quality control and minimizing errors during the
PCB production inspection process.

Table 5.4 Precision performance assessment of the proposed


OTXGBOOST and baseline models
Defects Proposed XGBoost MobileNetv3 VGG16 RNN
(%) (%) (%) (%) (%)
Missing holes 99.99 97.81 96.51 94.61 91.11
Open circuit 99.98 97.69 96.39 94.54 91.07
Short 99.96 97.66 96.35 94.52 90.95
Spur 99.95 97.64 96.31 94.47 90.84
Spurious copper 99.94 97.55 96.27 94.49 90.83
Mouse bite 99.94 97.55 96.27 94.49 90.96
Average 99.96 97.65 96.35 94.52 90.96

Table 5.5 Recall performance assessment of the proposed OTXGBOOST


and baseline models
Defects Proposed XGBoost MobileNetv3 VGG16 RNN
(%) (%) (%) (%) (%)
Missing holes 99.81 97.61 96.21 94.51 90.95
Open circuit 99.78 97.49 96.16 94.39 90.85
Short 99.74 97.41 96.04 94.36 90.75
Spur 99.69 97.37 95.99 94.31 90.72
Spurious copper 99.68 97.32 95.86 94.28 90.61
Mouse bite 99.74 97.26 95.98 94.31 90.62
Average 99.74 97.41 96.04 94.36 90.75
150

Table 5.4 and 5.5 depict the representation of the proposed and existing
models’ outcomes in terms of precision and recall metrics. In this case, the existing
RNN model produces the lowest performance compared to both the existing and
proposed methods. Although RNNs are effective in modelling sequential data,
they face critical limitations when applied to PCB defect classification.
These include the vanishing gradient problem and the inability to effectively
capture spatial information, resulting in lower average scores of 90.96% precision
and 90.75% recall. Similarly, models such as MobileNetV3, VGG16, and
standalone XGBoost also struggle to handle complex features inherent in
PCB images. Moreover, they involve high computational costs due to the need for
manual fine-tuning of hyperparameters. In contrast, our proposed method utilizes
the CGWOSO algorithm to automatically optimize configuration parameters,
resulting in improved model efficiency and outstanding outcomes. As a result, our
approach achieves higher precision and recall values of 99.96% and 99.74%,
respectively.

Figure 5.9 F1-score analysis of the proposed OTXGBOOST and baseline


techniques

Figure 5.9 compares the prediction F1-score of the proposed model


with baseline models. In this case, the proposed model achieves an average
151

F1-score rate of 99.92%, which is 2.35%, 3.77%, 5.45%, and 9.01% better than
the existing XGBoost, MobileNetv3, VGG16, and RNN models. The improved
accuracy and dependability of the suggested model for defect prediction can be
attributed to several crucial methodological decisions that collectively maximize
the model’s efficiency. The integration of CGWOSO-based hyperparameter
tuning, feature extraction, and dataset balancing has been vital in attaining better
outcomes than existing methods.

Table 5.6 Training time analysis of the proposed OTXGBOOST and existing
techniques
Techniques Training time (min)
Proposed 15.2
XGBoost 14.7
MobileNetv3 19.7
VGG16 22.3
RNN 24.6

Table 5.6 presents a comparison of training times between the proposed


OTXGBoost model and other baseline classifiers. The proposed model takes a
training time of 15.2 minutes, which is slightly higher than standard XGBoost due
to the integration of optimal hyperparameter tuning and FPXCPNet-based feature
extraction. Still, it remains faster than deep learning-based models like
MobileNetv3, VGG16, and RNN, which involve heavier architectures and longer
convergence times. This shows that our model maintains training efficiency while
incorporating optimization strategies, making it computationally efficient.

5.3.2 Testing Results

To analyze the proposed model’s ability to handle unseen data, the


testing performance is given in Table 5.7. The proposed method yields a test
accuracy of 99.54%, precision of 99.62%, recall of 99.41%, and f1-score of
152

99.57%, respectively. These results confirm that the model outperform existing
techniques even when evaluated on unseen data due to the addition of
DA2DASYN-based dataset balancing and CGWOSO-based hyperparameter
tuning improves generalization ability and avoids overfitting issues on unseen
complex defect samples.

Table 5.7 Testing results of proposed and existing methods


Test Test
Test recall Test f1-score
Techniques accuracy precision
(%) (%)
(%) (%)
Proposed 99.54 99.62 99.41 99.57
XGBoost 97.12 97.23 97.04 97.15
MobileNetv3 95.98 96.05 95.89 96.01
VGG16 94.13 94.26 94.07 94.16
RNN 90.41 90.56 90.34 90.45

5.3.3 Ablation Study

Table 5.8 displays the ablation experiment of the proposed ROGRU,


where individual components are removed to assess their contribution to final
performance in terms of accuracy, precision, recall, and f1-score metrics.
Each component was trained from scratch using the same dataset split,
preprocessing pipeline, number of epochs, and hyperparameters as the full model.
In this case, our full pipeline achieves better accuracy of 99.89%, precision of
99.96%, recall of 99.74%, and f1-score of 99.92%, showing that the combination
of preprocessing, DA2DASYN, FPXCPNet, and the CGWOSO methods worked
together effectively. Removing DA2DASYN, reduces the performance clearly as
the model struggles to handle the minority class. When using a standard feature
extractor like CNN instead of FPXCPNet, the model fails to capture multi-scale
features. In addition, removing the tuning step CGWOSO, also reduced the
performance, demonstrating the significance of optimized hyperparameters in
153

enhancing the classifier stability. Overall, the outcomes demonstrate that each
module plays a major role in improving the performance of the proposed
framework, and the whole combination attains a higher accuracy. Figure 5.10 and
5.11 show the accuracy results of different variants on the proposed system and
the accuracy drop of the model when removing each component.

Table 5.8 Ablation experiment of the proposed framework with other


variants
F1- Accuracy
Accuracy Precision Recall
Variant score Drop
(%) (%) (%)
(%) (%)
Full proposed model 99.89 99.96 99.74 99.92 0
Without CGWOSO
97.56 97.63 97.48 97.59 2.33
(OTXGBoost only)
Without DA2DASYN 96.65 96.74 96.54 96.68 3.24
FPXCPNet +
95.58 95.63 95.41 95.61 4.31
Standard XGBoost
XceptionNet only +
95.12 92.23 95.04 95.15 4.77
OTXGBoost
CNN features +
93.82 93.95 93.74 93.85 6.07
OTXGBoost
Without CLAHE +
94.32 94.43 94.25 94.35 5.57
AMF
154

Figure 5.10 Accuracy comparison of ablation components

Figure 5.11 Impact of component removal on accuracy

5.3.4 Comparative Assessment

Table 5.8 compares the efficiency of our model with existing methods
reported in the literature section (Chapter 2).
155

Table 5.9 Comparative analysis of the proposed OTXGBOOST and state-of-


the-art methods
Author name & Techniques Outcomes
Year used
Proposed OTXGBOOST Accuracy= 99.89%
Chang et al. (2024) FLANN Accuracy = 98.9%
Althubiti VGG16 Accuracy = 97.01%,
et al. (2023) precision = 98%, and recall = 97%
Chen et al. (2024) ECA-Net mAP = 98.67% and recall = 97.26%
Kieu et al. (2024) U-NET Accuracy = 97%
Wu et al. (2024) EEMNet Accuracy = 99.01%
Alghassab (2024) VGG16 Accuracy = 92.67%, Precision =
94.11%, and Recall = 89.23%,
Hu et al. (2024) AttResNet Accuracy = 98.45%
Shen et al. (2024) YOLOv5 mAP = 97.3%, precision = 98.2%,
and recall = 98.8%

Based on the results shown in the table, the suggested model achieves
an outstanding accuracy of 99.89%, which is higher than that of our model.
The superiority of our model over individual configurations can be attributed to
several key factors. First, the feature extraction network, FPXCPNet, can generate
a feature map that captures more feature information across different scales, which
is conducive to improving the accuracy of our model. In contrast, existing models
such as FLANN, VGG16, ECA-Net, U-Net, EEMNet, and AttResNet cannot
extract deep and abstract patterns from PCB images, resulting in reduced
classification performance. Next, the application of advanced hyperparameter
tuning plays a critical role. By utilizing an optimization strategy instead of relying
on manual tuning, the model achieves more effective learning configurations
compared to those used in conventional models. Moreover, the integration of
various data augmentation techniques and the ADASYN method has shown a
156

significant improvement in classification accuracy. While augmentation increases


the model’s ability to generalize across diverse image types, ADASYN effectively
addresses the class imbalance issue, enhancing prediction reliability. In contrast,
the existing FLANN, VGG16, ECA-Net, U-Net, EEMNet, and AttResNet models
suffer from imbalanced data, resulting in misclassifications and reduced accuracy.
Additionally, preprocessing with CLAHE and AMF enhances image clarity and
contrast, enabling more accurate defect detection. Overall, these combined
enhancements enable the proposed model to achieve high performance without
increasing computational complexity. The experimental findings demonstrate that
a well-balanced combination of advanced modules can maximize accuracy while
maintaining efficiency, making the system well-suited for a practical PCB defect
detection application.

5.4 SUMMARY

This chapter introduces a PCB defect classification system that


combines an improved XceptionNet for effective feature extraction with a
hyperparameter-tuned XGBoost classifier to ensure accurate defect identification.
The publicly available Deep PCB defect dataset from Kaggle is used to evaluate
the effectiveness of the proposed system. The performance of the proposed
OTXGBOOST model is compared with conventional models, including
XGBoost, MobileNetV3, VGG16, and RNN. Evaluation is conducted using
standard performance metrics, including accuracy, precision, recall, and F1-score.
The results demonstrate that the proposed method achieves a superior accuracy of
99.89%, outperforming conventional approaches. This improvement is attributed
to the optimal hyperparameter tuning enabled by the CGWOSO algorithm and the
enhanced feature learning capabilities of the FPXCPNet model, which
significantly boost defect detection performance, particularly for small targets.
Furthermore, although the original dataset contains only a limited number of
defect samples, the data augmentation with ADASYN-based dataset balancing
157

helps to address this issue effectively. ADASYN generates additional synthetic


samples for minority class samples and data augmentation methods artificially
expanding the size and diversity of a training dataset by creating modified versions
of the data samples. As a result, our both DL and ML models can still achieve
outstanding performance even when the original dataset is small. By leveraging
these sophisticated algorithms and automated systems, industries can move
toward a future where quality assurance becomes more efficient, effective, and
aligned with the demands of modern manufacturing environments.

You might also like