Solder Joint Inspection Using GMM: A Template-Free AOI Method for PCB Quality Control

Table of Contents

Inspection technology is the foundation of the manufacturing industry, and PCB soldering quality inspection is a critical pillar of the electronics industry’s development. 

Most existing soldering quality inspection systems use precision mechanical drive mechanisms to move industrial cameras and scan the PCBs under test.

They then employ either a reference comparison method or a rule-based inspection method, depending on the inspection category.

Limitations of Traditional Inspection Systems

Such systems rely on standard templates or design rules, requiring the redesign of templates or rules each time a new product is inspected, resulting in extremely high manufacturing costs that small and medium-sized manufacturers find difficult to bear.

Furthermore, when faced with small-batch, high-variety product orders, the time cost associated with each equipment debugging session is also difficult for enterprises to bear.

Consequently, most small and medium-sized electronics enterprises still rely on manual soldering methods, and the primary focus of this study is the inspection of manually soldered joints.

In manual solder joint inspection technology, the detection of cold solder joints, excess solder, and missing solder joints primarily relies on feature comparison and analysis based on characteristics such as area, color, and gradient.

In terms of hardware system design, three light sources—red, green, and blue—are used to illuminate the sample from different angles to capture rich image features.

  • Challenges in Traditional AOI Methods

Traditional AOI inspection primarily relies on threshold-based image segmentation.

However, variations in equipment installation accuracy and environmental factors across different devices cause thresholds to exhibit distinct characteristics, resulting in poor generalization of threshold parameters.

Consequently, specialized personnel must adjust threshold parameters for each piece of equipment, and frequent debugging of the machine vision system is required due to factors such as product iterations, resulting in a significant workload.

This study proposes a solder joint quality inspection method based on a Gaussian mixture model.

By using the Gaussian mixture model to segment the three colors—red, green, and blue—this method replaces traditional threshold-based segmentation for feature extraction.

It offers strong generalization capabilities and eliminates the need for engineers to fine-tune the system for minor variations between individual devices.

System Design

The machine vision platform utilizes three combinable red, green, and blue ring-shaped AOI light sources, with a field of view of 35 mm × 35 mm and a required working distance of 90 mm.

A fixed-focus lens with a focal length of 12 mm is selected.

The lighting configuration is designed such that the red light is directed vertically, the green light is directed at a 45° angle, and the blue light is directed at a 60° angle.

The basic quality of the solder joints is determined by analyzing the reflectance ratios of the different colors.

The machine vision platform is shown in Figure 1.

Figure 1 Machine vision platform
Figure 1 Machine vision platform

Algorithm for Detecting the Position of Circular Solder Joints

Locating solder joints is the foundation of visual inspection.

Given the various color variations in components and PCBs, determining the position of solder joints through algorithms—without a template and without predefined regions of interest (ROI)—is a highly challenging task.

  • Image Preprocessing

Images are preprocessed using methods such as image morphological analysis, grayscale histogram processing, filtering, and Laplacian sharpening to preliminarily identify the solder joint regions.

A comparison of the preprocessing results for circuit board images is shown in Figure 2.

Figure 2 Comparison of circuit board image preprocessing effects
Figure 2 Comparison of circuit board image preprocessing effects
  • Circular Assessment of Initial Screening Results

After completing image preprocessing, a circular assessment must be performed on the areas identified in the initial screening.

The specific process is as follows.

First, the Canny operator extracts the outer contour, then a least-squares algorithm based on geometric distance fits a circle, and finally the residuals from the least-squares fitting are analyzed to determine whether the point is a circular weld spot.

The standard equation for a circle is (x − a)² + (y − b)² = r², where a and b are the coordinates of the center of the circle, and r is the radius.

After obtaining the preliminary fitted circle, the geometric distance Gd is calculated using the following formula:

(1)
(1)

(xi, yi) are the coordinate points of the original contour; by iteratively adjusting these points to minimize Gdis,the fitted circle is obtained, as shown in Figure 3.

Figure 3 Circle Fitting
Figure 3 Circle Fitting
  • Circular Similarity Calculation

Standard deviation is evaluated by comparing the coordinate points of the region’s outline with those of the fitted standard circle, which serves as the basis for the similarity calculation.

The formula is as follows:

(2)
(2)

In the equation: Asd represents a reference point for the similarity threshold that can be set manually; u represents the mean of the vector magnitude.

The solder joint regions selected after circular similarity calculation are shown in Figure 4.

Figure 4. Circular similarity
Figure 4. Circular similarity

As shown in Figure 4, high-brightness electronic components (whose color characteristics are similar to those of solder) can interfere with the detection of solder joint areas.

This is an unavoidable issue with image preprocessing methods; in future work, we may attempt to incorporate the lightweight deep learning network YOLO to pinpoint solder joint areas.

Solder Joint Quality Inspection Based on the Gaussian Mixture Model

A Gaussian Mixture Model (GMM) can be viewed as a model composed of K individual Gaussian models, where these K sub-Gaussian models correspond to the hidden variables (HV) of the mixture model.

Generally, mixture models can be constructed based on any probability distribution; however, the GMM is selected here because the Gaussian distribution possesses excellent mathematical properties and computational efficiency.

Researchers in the field have successfully applied this model to flame detection; relevant studies have proposed a flame detection framework based on flame flickering dynamics, in which the flame color distribution model employs a GMM.

Additionally, this model has been applied to anomaly detection, magnetic resonance (MR) image segmentation, and clustering analysis.

  • Feature Selection and Model Setup

Overall, GMM is feasible for classification and image segmentation of low-dimensional feature vectors (within 15 features).

Considering computational efficiency, the GMM feature dimension selection in general vision systems does not exceed 5.

In this study, we used 4 dimensions as input to the GMM for image segmentation: the red, green, and blue color channels, and solder joint shape features.

  • GMM Model Formulation

GMM classifies each color on the PCB board, using M Gaussian models to characterize the features of each pixel in the image, defined as a linear combination of M Gaussian density functions:

(3)
(3)

Where: πi is the prior probability of the Gaussian distribution; Pi(xi, ui, ci) is the Gaussian density function with mean μi.

  • EM Algorithm for Parameter Estimation

The above parameters are ultimately estimated using the Expectation-Maximization (EM) algorithm.

The EM algorithm is based on maximum likelihood estimation.

The EM algorithm proceeds as follows:

① Input parameters. Input the observed data x = [x(1), x(2), …, x(m)], the joint distribution P(x, z|θ), the conditional distribution P(z|x, θ), and the maximum number of iterations J.

② Execute steps. First, randomly initialize the model parameters θ; second, iteratively solve for the parameters of each distribution model and the probabilities of each model, and calculate the conditional probability expectation of the joint distribution.

(4)
(4)

Maximize L(θ) to obtain:θ =

(5)
(5)

Finally, converge the output, repeatedly compute the expected conditional probability of the joint distribution, and maximize L(θ) until θ converges, then output the model parameters θ.

  • Model Training and Results

To train a GMM model to simulate the distribution in RGB space, this study uses shape and color (RGB) as input dimensions to construct the Gaussian mixture model.

Solder joints are classified by color based on the probability density evaluation of the GMM model, with the results shown in Figure 5.

Figure 5 GMM classification results
Figure 5 GMM classification results

Analysis of Test Results

Tests were conducted using 50 sets of collected electronic circuit board samples, and a statistical analysis of the solder joints on the PCBs was performed.

The results are shown in Table 1.

CategoryCount (Actual / Predicted / Other)Accuracy (%)Precision (%)Recall (%)F1 Score
Qualified1100 / 0 / 0100
Missing Solder100 / 312 / 387893780.85
False Solder25 / 6 / 9480

Table 1: Statistics of Solder Joint Detection Results

For manual solder joint inspection, the focus is on the recall rate metric; however, the low value of this metric is primarily due to component interference causing omissions in solder joint location detection.

If the data on missed detections is excluded, the analysis results are shown in Table 2.

TypeCount (A)Count (B)Count (C)Accuracy (%)Precision (%)Recall (%)F1 Score
Qualified110000100
Missing Solder15312389698940.96
False Solder1069491

Table 2: Detection Analysis After Removing the Impact of Missed Solder Joints

Conclusion

Through a comparison of experimental data, it has been largely confirmed that the hardware system design of this project, combined with GMM, is feasible for AOI solder joint quality inspection in template-free scenarios.

However, due to the absence of a template, the solder joint ROI must be identified through algorithmic recognition.

The algorithm designed in this study is affected by the obstruction of electronic components, resulting in a high rate of missed solder joints, which in turn significantly impacts the detection recall rate.

Future efforts should focus on resolving the issue of solder joint ROI identification.

The latest YOLOv11 deep learning model has demonstrated strong performance in the field of object detection.

Implementing solder joint detection in template-free scenarios through a combination of RGB lighting design, the YOLO model, and the GMM model represents a promising direction for further research.

Scroll to Top