An ideal printed circuit board (PCB) defect inspection system can detect defects and classify PCB defect types. Existing defect inspection technologies can identify defects but fail to classify all PCB defect types. This research thus proposes an algorithmic scheme that can detect and categorize all 14-known PCB defect types. In the proposed algorithmic scheme, fuzzy c-means clustering is used for image segmentation via image subtraction prior to defect detection. Arithmetic and logic operations, the circle hough transform (CHT), morphological reconstruction (MR), and connected component labeling (CCL) are used in defect classification. The algorithmic scheme achieves 100% defect detection and 99.05% defect classification accuracies. The novelty of this research lies in the concurrent use of CHT, MR, and CCL algorithms to accurately detect and classify all 14-known PCB defect types and determine the defect characteristics such as the location, area, and nature of defects. This information is helpful in electronic parts manufacturing for finding the root causes of PCB defects and appropriately adjusting the manufacturing process. Moreover, the algorithmic scheme can be integrated into machine vision to streamline the manufacturing process, improve the PCB quality, and lower the production cost.
In electronic component manufacturing, a system for defect inspection of printed circuit boards (PCB) prevents defective PCBs from advancing to the subsequent stage. Because of higher efficiency, accuracy, and productivity compared to human inspectors, PCB defect inspection technologies based on automatic image-processing techniques have been increasingly deployed.
There are three PCB defect inspection approaches: referential, non-referential, and hybrid [
In PCB fabrication, there are 14-known PCB defect types: Breakout, Pin hole, Open circuit, Under etch, Mouse bite, Missing conductor, Spur, Short circuit, Wrong size hole, Conductor too close, Spurious copper, Excessive short, Missing hole, and Over etch [
In [
An image segmentation algorithm based on mathematical and morphological tools is proposed to divide individual PCB images into four segments: hole, pad, thick line, and thin line. The algorithm is usually employed as a pre-processing step for classification tasks [
Accordingly, this study proposes an algorithmic scheme to detect and classify all 14-known PCB defect types with at least 90% accuracy. In the proposed defect inspection system, a fuzzy c-means clustering algorithm is used in image segmentation. Image subtraction is utilized for defect detection, and the circle Hough transform (CHT), morphological reconstruction (MR), and connected component labelling (CCL) algorithms are employed in defect classification.
In this research, the PCB detection and classification system uses the referential approach based on 14-known PCB defect types. The proposed system consists of four steps: pre-processing, image segmentation (Section 2.1), defect detection, and defect classification (Section 2.2).
No. | Code | Defect type | Drilling | Etching | Missing | Excess |
---|---|---|---|---|---|---|
1 | D01 | Breakout | ✓ | - | - | - |
2 | D02 | Pin hole | - | ✓ | ✓ | - |
3 | D03 | Open circuit | - | ✓ | ✓ | - |
4 | D04 | Under etch | - | ✓ | - | ✓ |
5 | D05 | Mouse bite | - | ✓ | ✓ | - |
6 | D06 | Missing conductor | - | ✓ | ✓ | - |
7 | D07 | Spur | - | ✓ | - | ✓ |
8 | D08 | Short circuit | - | ✓ | - | ✓ |
9 | D09 | Wrong size hole | ✓ | - | - | - |
10 | D10 | Conductor too close | - | ✓ | ✓ | ✓ |
11 | D11 | Spurious copper | - | ✓ | - | ✓ |
12 | D12 | Excessive short | - | ✓ | - | ✓ |
13 | D13 | Missing hole | ✓ | - | - | - |
14 | D14 | Over etch | - | ✓ | ✓ | - |
The RGB color images are converted into grayscale images by individual pixels following
Furthermore, the affine transform algorithm is used to scale, rotate, and transform the median-filtered images. The affine transform algorithm is mathematically expressed in
Next, in image segmentation, the fuzzy c-means clustering algorithm is utilized to separate circuit parts, including holes, pads, and traces from the background. The algorithm uses the nearest distance between any given pixel and its cluster centroid using the Euclidean distance as described in
In addition, the fuzzy c-means clustering algorithm divides each median-filtered image (i.e., input image) into 32 rectangular-shaped segmental images. The segmental images are subsequently designated into clusters according to standard features and characteristics. The constituent images (or segmental images) belonging to various clusters then undergo defect detection and classification.
In this study, 500 input images contain various degrees of 14-known PCB defects. In segmentation, each input image is divided into 32 segmental images using fuzzy c-means clustering, generating 16,000 segmental images. The segmental images are individually assigned to clusters according to common characteristics, resulting in 100 clusters. For verification purposes, this study utilizes 10,000 segmental images for testing the defect detection and classification algorithm.
The PCB defect types with a positive subtraction value include Breakout, Pin hole, Open circuit, Mouse bite, Missing conductor, and Over etch. In contrast, those with a negative subtraction value contain Under etch, Spur, Short circuit, Wrong size hole, Spurious copper, Excessive short, and Missing hole. The Conductor too close has either a positive or negative subtraction value, thereby presenting classification challenges.
CHT, MR, and CCL algorithms are utilized along with image subtraction to enhance defect detection. Specifically, the CHT algorithm detects and classifies circular patterns by transforming a set of feature points in the image space into a set of accumulated votes in parameter space. The votes at each feature point are accumulated in an accumulator array for all parameter combinations. The highest number of votes in the array elements indicates the presence of a circular pattern. A circle is described in
The MR algorithm sequentially classifies segmental images by features (i.e., holes, pads, and traces) and then transforms the connected background pixels into foreground pixels until the object boundaries are reached. The MR algorithm for flood-filling is expressed in
The CCL algorithm scans segmental images, groups pixels into components by pixel connectivity, and assigns labels to individual pixels until the boundaries are reached [
The inputs of the algorithmic scheme are
Step 1: Find excess copper in hole pads using
Step 2: Apply the CCL algorithm to validate, and CHT classifies the defect as either a Wrong size hole (D09) or a Missing hole (D13).
Step 3: Find missing copper in hole pads using
Step 4: Apply the CCL algorithm to validate, and CHT classifies the defect as Breakout (D01).
Step 5: Find Pin hole defect (D02) from
Step 6: Or else, the defect is an Excessive short (D12).
Step 7: Apply the CCL algorithm to determine the number and size of groups.
Step 8: Add negative pixels to the defect-containing segmental image and re-apply the CCL algorithm to determine the number and size of groups.
Step 9: Comparing Steps 7 and 8. If the number and size of groups decrease, the defect is a Short circuit defect (D08). Otherwise, the defect is a Spurious copper defect (D11).
Step 10: Add positive pixels to the defect-containing segmental image and re-apply the CCL algorithm to determine the number and size of groups.
Step 11: Comparing Steps 7 and 10. If the number of groups increases and the group size is smaller than the square of the trace width, the defect is an Open circuit defect (D03). If the number of groups increases and the size of the group is larger than the square of the trace width, it is a Missing conductor defect (D06).
Step 12: If the number of groups remains unchanged, proceed to steps 13–17.
Step 13: If the defect has negative pixels and is asymmetric, it is a Spur defect (D07).
Step 14: If the defect has positive pixels and is asymmetric, it is a Mouse bite defect (D05).
Step 15: If the defect has either negative or positive pixels and is symmetric, it is a Conductor too close defect (D10).
Step 16: If the defect has negative pixels and is symmetric, it is an Under etch defect (D04).
Step 17: If the defect has positive pixels and is symmetric, it is an Over etch defect (D14).
Step 18: If the defect does not fall into any of the 14 categories, it is another defect (D00).
Step 19: About Steps 1–18, all 14-known PCB defect types are detected and classified.
As previously stated, 500 input images contain various degrees of 14-known PCB defects. The input images are segmented using the fuzzy c-means clustering algorithm. In the segmentation, each input image is divided into 32 segmental images, resulting in 16,000 segmental images. The segmental images are individually assigned to one of 100 clusters according to their common characteristics. In the meanwhile, this study uses 10,000 segmental images to test the algorithmic scheme for defect detection and classification.
This study utilizes fuzzy c-means clustering in image segmentation. Before that, simulations are carried out to determine the optimal algorithmic scheme among four alternative image segmentation algorithms, i.e., global thresholding, adaptive thresholding, k-means clustering, and fuzzy c-means clustering. Besides, the performance metrics include intersection over union (IoU), accuracy, precision, recall, and elapse time. The IoU, accuracy, precision, and recall are calculated by
where
In
The image subtraction algorithm is utilized to detect defects on PCB by comparing the segmental images of input images against the reference image (i.e., defect-free segmental image). A negative or positive subtraction value indicates a defective PCB, whereas a zero-subtraction value signifies a non-defective PCB.
The PCB defect types with a positive subtraction value include Breakout, Pin hole, Open circuit, Mouse bite, Missing conductor, and Over etch. In contrast, those with a negative subtraction value include Under etch, Spur, Short circuit, Wrong size hole, Spurious copper, Excessive short, and Missing hole. The Conductor too close defect has either a positive or negative subtraction value.
Scheme | Standard deviation | ||||
---|---|---|---|---|---|
IoU | Accuracy | Precision | Recall | Elapsed time (s) | |
GT | 1.236 | 1.201 | 0.416 | 5.309 | 2.235 |
AT | 1.115 | 0.936 | 0.318 | 4.536 | 3.546 |
KM | 1.302 | 1.103 | 0.028 | 3.256 | 2.673 |
FCM | 1.374 | 1.332 | 0.084 | 2.362 | 4.164 |
CHT, MR, and CCL algorithms are utilized to classify PCB defects according to the 14-known PCB defect types (D01-D14). As discussed above, the defect classification is proposed sequentially and terminated when all 14-known defects are algorithmically classified. The experimental results show that the algorithmic scheme can achieve about 99.05% defect classification accuracy.
This research validates the proposed algorithmic scheme by comparing against previously developed methods that including the well-known conventional operations [
As the proposed method resides at the nexus of the CHT, MR and CCL algorithms, the features of these algorithms allow the performance of the proposed algorithmic scheme to detect defects more comprehensively and more accurately than other methods, as shown in
Defect type | [ |
[ |
[ |
[ |
[ |
[ |
[ |
Our method |
---|---|---|---|---|---|---|---|---|
Breakout | - | - | - | - | - | - | 75% | 100% |
Pin hole | ✓ | ✓ | - | ✓ | - | - | 75% | 96.5% |
Open circuit | ✓ | ✓ | ✓ | ✓ | 97.34% | 97.74% | 75% | 99.1% |
Under etch | ✓ | ✓ | ✓ | - | - | - | 80% | 98.4% |
Mouse bite | - | ✓ | - | ✓ | 87.34% | 97.94% | 70% | 97.6% |
Missing conductor | - | - | ✓ | - | - | - | 75% | 99.1% |
Spur | - | - | - | ✓ | 83.34% | 93.65% | 70% | 98.4% |
Short circuit | ✓ | ✓ | - | ✓ | 96.67% | 99.48% | 75% | 100% |
Wrong size hole | - | - | ✓ | - | - | - | 80% | 100% |
Conductor too close | - | - | - | - | - | - | 75% | 100% |
Spurious copper | - | - | - | - | 88.67% | 98.52% | 75% | 100% |
Excessive short | - | - | - | - | - | - | 80% | 100% |
Missing hole | ✓ | ✓ | ✓ | - | - | 98.96% | 75% | 100% |
Over etch | - | - | ✓ | - | - | - | 75% | 97.6% |
This study proposes the PCB defect inspection system using a referential approach. The novelty of this work lies in the concurrent use of arithmetic and logical operations, as well as CHT, MR, and CCL algorithms. This algorithm effectively classifies all 14-known PCB defect types, unlike conventional techniques that can only classify a few kinds of defects or cannot achieve high efficiency. The experimental results reveal that the proposed algorithmic scheme can achieve 100% defect detection efficiency and 99.05% defect classification accuracy, demonstrating that our proposed algorithmic scheme has superior performance to other existing PCB defect classification methods. Given the impressive detection and classification performance, the algorithmic scheme can be integrated into machine vision to streamline the production, improve PCB quality, and lower the production cost as human inspectors will no longer be required for defect classification.
The PCB architecture continues to develop and acquires more complicated structures. The currently designed algorithm may also be required to catch up with the growth of PCB developments. Hence, future work will be focused on detecting and classifying defects occurring during PCB production that exhibits more complex structures and processes.
The authors would like to express sincere gratitude to the Signal Processing Research Laboratory, the Faculty of Engineering, Rajamangala University of Technology Thanyaburi, for insight and expertise. Appreciation also goes to Dr. Kan Kanjana of KB Systems (Thailand) Co., Ltd., for valuable comments and suggestions. We also thank TopEdit (