In addition, unlike using pre-built features based
on textures, colors, etc., Neural Networks (NNs) are
able to learn how to predict classes of objects or at-
tributes. When a given model must be applied to
more classes, the NN must be re-trained on a bigger
database with such novel data. To tackle this limita-
tion and avoid the collection of new data, we use a
Siamese Neural Network (SNN) (BROMLEY et al.,
1993) which, during inference, takes two inputs, a
sample and a reference. Both images run through a
convolutional backbone which provides a vector rep-
resentation for each image. Then, both representation
vectors are compared with a similarity function that
will determine how similar the sample image is to the
reference one. SNNs can learn the most relevant vi-
sual features to properly quantify the similarity be-
tween the inputs if adequately trained. We cite some
related works in the following.
Researchers have separated visual inspection into
two stages; detection and fine-grained matching (ver-
ification). For instance, Reza et al. focused on ap-
plying hard loss to detect components and identify-
ing subtle changes such as slightly different logos
printed onto Integrated Circuits (ICs) housing (Reza
et al., 2020). The goal was to identify counterfeit
components and prevent PCB malfunction, security
vulnerabilities, among others. They used loss boost-
ing to alleviate the problem of undetected small com-
ponents when using traditional Convolutional Neural
Networks (CNN)-based detectors. Since they con-
sider each PCB a sample, they split all objects (elec-
tronic components) into “easy” and “hard”, according
to their associated difficulty to locate. Researchers
annotated 483 PCB images resulting in approximate
5000 labeled IC samples – we could not access the
dataset because of a broken link. After evaluating dif-
ferent backbones and hyperparameters settings, they
achieved up to 92.31% verification accuracy on a
held-out test set.
Luan et al. (Luan et al., 2021) used
SNNs (BROMLEY et al., 1993) for defect de-
tection. They mention a proprietary database
containing approximately 400 samples for each of
five classes; normal and four synthetic and specific
defect types. Performances of different loss functions
are presented to assess the impact on unbalanced
datasets with much fewer defect samples. No mention
is given as to the cross-validation scheme used and
different performances seem to be more influenced
by two different classification methods (CNN with
two neurons as final classifiers versus Support Vector
Machine (SVM)-based classifier) than by different
choices of loss functions.
Nagy (Nagy and Cz
´
uni, 2021), et al., used SNN
as a strategic option for the identification of anoma-
lies on a wide variety of object types on databases
containing images of traffic signs an metal disk-shape
castings with and without defects. Unfortunately, our
dataset does not have samples with actual defects.
Kalber et al. (K
¨
alber et al., 2021) used U-Net for
segmentation of electronic components on PCB im-
ages published by Tang et al. (Tang et al., 2019). Our
approach is different since we do not perform local-
ization of components which are manually annotated
by the operator when the recipe is constructed. Be-
sides that, our focus in this work is to verify compo-
nents that were not present in the dataset.
Saeedi and Giusti proposed an anomaly detection
system for industrial vision inspection (Saeedi and
Giusti, 2022). To alleviate problems associated with
deffect loss due to downsizing, they propose the use
of patches as input to an Autoencoder (AE).
Our contributions are summarized in the follow-
ing:
1. We collect a comprehensive database composed
of images of PTH electronic components in a
cooperation with a PCB manufacturing company
and by developing a web crawler which collects
more data from the Internet. We manually an-
notate them to select components of interest. A
specific data augmentation approach is also pre-
sented.
2. A visual inspection model using SNN that pro-
vides flexibility to different types of electronic
components validated using a comprehensive set
of validation experiments and hyperparameters
tuning.
3. A hardware to stabilize the PCB and control envi-
ronment illumination and a flexible, customizable
web app are developed and presented.
2 METHODOLOGY
We define five methodological steps to guide our ap-
proach: 1. Dataset acquisiton and cleaning. 2. Image
annotation. 3. Application development. 4. Database
Augmentation. 5. SNN training and validation.
The first step consists in acquiring images from
the Internet using a web crawler, developed by us.
Once the images were already downloaded and the
dataset is well organized, we started the second step,
which consists in annotating the image database that
we collected using the YOLO format, which is simple
to read and parse from the computer perspective. We
annotate the images using an object detection strategy
VISAPP 2023 - 18th International Conference on Computer Vision Theory and Applications
890