Changes

Jump to: navigation, search
Test Bed
==Introduction==
This Technical Note (TN for short) belongs to the series introduced [[ML-TN-003 — AI at the edge: visual inspection of assembled PCBs for defect detection — Part 1|here]]. Specifically, it illustrates the first issue to be considered to implement a device capable to spot mounting defects on an assembled PCB, which is to detect and recognize the electronic components populating the board. In ML terminology, we are dealing again with a classification problem.
From an engineering perspective, one of the main goals of this work is still the evaluation of the Xilinx's DPU performances on inference tasks in terms of latency and throughput as Xilinx devices are in principle good candidates for implementing an automatic visual inspection machine as described in the [[ML-TN-003 — AI at the edge: visual inspection of assembled PCBs for defect detection — Part 1|opening article]] of this series. It is worth remembering that the characterization of Xilinx DPU used for solving a classification task is covered in [[ML-TN-001_-_AI_at_the_edge:_comparison_of_different_embedded_platforms_-_Part_3|this TN]] as well. Nevertheless, coping with another classification task also allowed to evaluate how different deep CNN models perform on the same problem.
|3.3
|}
For more details about Xilinx's hardware configuration and, the usage of the Vitis-AI software platform , please refer to [[ML-TN-001 - AI at the edge: comparison of different embedded platforms - Part 3|this article]].
==FICS-PCB dataset overview==
Over the years, computer vision and ML disciplines have considerably advanced the field of Automated Visual Inspection for Printed Circuit Board (PCB-AVI) assurance. It is already well-known that , to develop a robust model for any ML-based application , a dataset is required, possibly as large as possible, with many examples for a better generalization. Although a few large datasets for PCB-AVI are publicly available, they lack variances that simulate real-world scenarios, such as illumination and scale variations, which are necessary for developing robust PCB-AVI approaches. Therefore, to represent such non-ideal conditions, the FICS-PCB dataset was proposed for evaluating and improving methods for PCB-AVI. This dataset consists of PCB images featuring multiple types of components and various image conditions to facilitate performance evaluation in challenging scenarios that are likely to be encountered in practice.
The dataset consists of 9,912 images of 31 PCB samples and contains a total amount of 77,347 labeled components distributed in six classes: ''IC'', ''capacitor'', ''diode'', ''inductor'', ''resistor'' , and, ''transistor''. These components were collected using two image sensor types, a digital microscope and a Digital Single-Lens Reflex (DSLR) camera. To ensure that the dataset also includes samples that represent variations in illumination, the authors collected images using three different intensities from the built-in ring light of the microscope i.e. 20, 40, and 60, where 60 represents the brightest illumination. In addition, variations in scale were included using three difference magnifications i.e. 1×, 1.5×, and 2×.
[[File:FICS-PCB samples.png|center|thumb|500x500px|FICS-PCB dataset, examples of six types of components]]
This dataset is highly unbalanced, having a lot of samples only for two classes i.e. ''capacitor'' and ''resistor''. In this situation, it is not a good idea to use this dataset as it is, simply because the models will be trained on image batches mainly composed of the most common components, hence learning only a restricted number of features. This has as a consequence that the models will probably be very good at classifying ''capacitor'' and ''resistor'' classes and pretty bad at classifying the remaining ones. Therefore, the missing data must should be increased with oversampling.
Before proceeding further, please note that the number of DSLR subset examples is by far lower than the number of the Microscope subset samples. As the two subsets were acquired using two different kinds of instruments, their characteristics — the resolution, for example — differ significantly. In order to have homogeneous images w.r.t. the characteristics, it is preferable to keep only one of them, specifically the most numerous.
[[File:Samples per class in Microscope and DSLR subsets.png|center|thumb|500x500px|FICS-PCB dataset, component count per class in DSLR and Microscope subsets]]
The dataset was created by random sampling 150000 component images from Microscope subset of the FICS-PCB dataset, providing a total of 25000 images per class. The 72% of the images were used for training, the 24% was used as a validation subset during training and the remaining 4% was used as a test set, providing exactly 108000 training images, 32000 validation images , and 6000 test images, equally distributed among the six classes of the dataset. Each image was preprocessed and padded with a constant value in order to adapt its scale to the input tensor size of the models. During this process the aspect ratio of the image was not modified. To increase variety among the examples , random contrast, brightness, saturation , and rotation were applyed applied too. Classes as ''diodeDiode'', ''inductor'', ''IC'' , and, ''transistor'' classes were oversampled.[[File:Dataset processing and augmentation.png|center|thumb|500x500px|FICS-PCB dataset, an : An example of image augmentation as compensation for lack of data in IC, diode, inductor, and transistor classes]]
==Training configuration and hyperparameters setup==
4,650
edits

Navigation menu