# Extreme Learning Machine and Moving Least Square Regression Based Solar Panel Vision Inspection

Authors: Heng Liu; Caihong Zhang; Dongdong Huang
Journal: Journal of Electrical and Computer Engineering
 (2017)

---

## Abstract

In recent years, learning based machine intelligence has aroused a lot of attention across science and engineering. Particularly in the field of automatic industry inspection, the machine learning based vision inspection plays a more and more important role in defect identification and feature extraction. Through learning from image samples, many features of industry objects, such as shapes, positions, and orientations angles, can be obtained and then can be well utilized to determine whether there is defect or not. However, the robustness and the quickness are not easily achieved in such inspection way. In this work, for solar panel vision inspection, we present an extreme learning machine (ELM) and moving least square regression based approach to identify solder joint defect and detect the panel position. Firstly, histogram peaks distribution (HPD) and fractional calculus are applied for image preprocessing. Then an ELM-based defective solder joints identification is discussed in detail. Finally, moving least square regression (MLSR) algorithm is introduced for solar panel position determination. Experimental results and comparisons show that the proposed ELM and MLSR based inspection method is efficient not only in detection accuracy but also in processing speed.


---

## Body

## 1. Introduction

Over the past decade, machine vision has been widely applied in industrial inspection, especially in electric and electronic industrial inspection [1–3]. Superior to manual inspection, the benefit of machine vision detection is that no direct contact is required between the inspector and the target. Therefore, automatic nondestructive inspection can be achieved in machine vision detection system.Since the accuracy of traditional vision inspection depends much on the effect and the stability of image processing technique, the traditional inspection way will lose its’ functionality when facing the changing environment or the altered imaging condition. Therefore, not only processing the images of industry objects but also learning the features (shapes, positions, and orientations) from image samples is required. Actually, with the fast development of computer vision, recently, there have appeared some works [4, 5] for machine learning based vision inspection.In modern photovoltaic electronic industry, for the solder joint of solar PCB is so fine, the vision based solder joint defect identification is challenging and thus needs to be investigated in depth [6, 7]. In addition, during the manufacture of solar panel, there is a strong demand for automatic position determination of the solder panel [8, 9]. In this work, in the face of the two major challenges, we present a set of defect identification and position determination methods.So far, Capson and Eng [10] have used a tiered-color illumination approach for solder joint’s inspection. Matsuyama et al. [11] also design a system for automated solder joint inspection. In addition, Chiu and Perng [12] utilize the reflection area of solder joint to describe the image features, and Tae-Hyeon et al. [13] develop a vision inspection system for the classification of solder joint. Moreover, unlike previous methods, Zhang and Liu in [14] propose utilizing the principle of ELM [15] with least square fitting to achieve vision detection on solder joint and solar panel. In this work, we extend and improve the previous work [14] in three aspects: histogram peaks distribution (HPD) [16] and fractional calculus [17–20] are adopted to improve the effect of image preprocessing and initial edge extraction; instead of least square fitting, MLSR is adopted to enhance the accuracy of edge estimation of the solar panels; more vision inspection experiments and comparisons of more solar PCB images are implemented.Specifically, for solder joint defect identification, we take histogram peaks distribution (HPD) [16] with morphological operation to extract image features and then apply extreme learning machine (ELM) [21–24] to classify the input images. As for solar panel position determination, accurate edges location is prerequisite. To achieve this, we extract the initial edge points by a novel signal processing method, fractional calculus [16, 22–24], and then utilize MLSR algorithm [25, 26] to refine initial edges. Once the final edges of solder panel are acquired, the position parameters, position shift, deflection angle, and edge lengths, are easily determined. The overall proposed scheme of solder joint defect detection and solar panel position determination is illustrated in Figure 1.Figure 1
The proposed scheme of solder joint defect detection and solar panel position determination.The paper is organized as follows. Section2 discusses the related techniques of image preprocessing and feature extraction used for defect identification and position detection. Section 3 describes how to use ELM to recognize solder joint defect in detail. Section 4 presents utilizing MLSR algorithm to achieve solder panel position determination. The abundant experimental results and comparisons are given in Section 5. Section 6 makes a short conclusion and future research prospective.


## 2. Image Preprocessing and Feature Extraction

In this section, we firstly make a detailed discussion on using HPD and morphological operation to preprocess the images of solder joint. And then we introduce fractional differential to extract initial edges of solar panel. Finally, we also elaborate on the specific feature extraction method used for solder joint defect classification.


### 2.1. Image Preprocessing Based on HPD and Morphological Operation

In machine vision inspection system, image preprocessing, including noise removing, image binarization, and edge detection, is the basic guarantee for following detection. However, due to illumination or view angle changing and noise intervention, such image preprocessing task under complex environment is always challenging. Fortunately, in solar panel vision detection system, the illumination and the view angle are under control. And imaging noise can be suppressed in advance by camera calibration beforehand. Thus the preprocessing effect of solar panel images can be guaranteed.Image thresholding is an effective technique for image binarization. Due to the unevenness of the lighting distribution, threshold finding is not simple and straightforward. How to acquire an appropriate threshold becomes the key issue for image binarization. Here, we take HPD [16] to find an accurate threshold for solder panel image binarization. HPD threshold search can handle several histogram distributions, which are illustrated in Figure 2.Figure 2
HPD threshold search sketch map.
(a)
(b)
(c)
(d)
(e)
(f)Morphological operation can obtain the backbone of the image object which can unify a host of techniques such as noise suppression, shape analysis, skeletonizing, and other related topics [27]. After thresholding, the basic morphology operations, dilation and erosion, are usually used to process binary images. In addition, the other two important morphological operations, closing and opening, are also typically used after thresholding. The closing operation smooths the contours of the image to eliminate narrow and long gaps or remove holes or fill contours. The open operation is used to eliminate tiny image objects or separate objects connected to narrow areas.For solder joint images, we firstly convert image color space fromRGB toYcbcr. Then in Y-intensity subspace, we utilize HPD algorithm to obtain global threshold to binarize the image. Then, we use morphological closing and opening operations to get the final binary image. The processing results are shown in Figure 3.Figure 3
Solder joint image preprocessing: (a) original image; (b) HPD image binarization; (c) final morphological processing result.
(a)
(b)
(c)


### 2.2. Initial Edge Extraction via Fractional Gaussian Differential

There are two different backgrounds in solder panel images. One is red background and the other is gray background. The solar panel image under red background is used to calculate position shift and deflection angle against the reference position, while gray background image can be used to extract the inner standard lines for measuring edge length of solar panel. For preprocessing, we also perform color space conversion and selectcr subspace for red background image, while for gray one we take G subspace fromRGBspace. Then, in these color subspaces, we all use HPD for image binarization.After obtaining the binary image, we extract the initial edge of the solar panel by the new fractional calculus [17, 20]. Fractional calculus has been a powerful image enhancement technique in recent years. By adjusting the fractional order of the Gaussian difference, an accurate and antinoise edge extraction effect can be obtained [16, 17].There are three ways to define fractional calculus, namely, the Grünwald-Letnikov (G-L) definition, the Riemann-Liouville definition, and the Capotu definition. The G-L definition comes from the classic definition of the calculus from integer-order continuous function and generalizes the integer calculus into fractional order. The G-L definition is described as [16] (1)DaGtvfx=limh→0,nh=t-ah-v∑r=0n-vrfx-rh.Thus, fractional partial differential can be defined as (v is fractional differential order)(2)∂vFx,y∂xv=Fx,y+-vFx-1,y+-v-v+12Fx-2,y+-v-v+1-v+26Fx-3,y,∂vFx,y∂yv=Fx,y+-vFx,y-1+-v-v+12Fx,y-2+-v-v+1-v+26Fx,y-3.Based on the above two equations, if combined with Gaussian kernelgx,y=1/2πσ2e-x2+y2/2σ2, the fractional Gaussian filtering function can be naturally deduced as (3)Gxv=gx,y1+-ve2x+1/2σ2+-v-v+12e4x+4/2σ2+-v-v+1-v+26e6x+9/2σ2,Gyv=gx,y1+-ve2y+1/2σ2+-v-v+12e4y+4/2σ2+-v-v+1-v+26e6y+9/2σ2.Then if we set the size of filtering windoww=3, the variance σ=1, and fractional order v=1.4, the fractional Gaussian filtering template [19] can be acquired as Tables 1 and 2.Table 1
G
x fractional Gaussian template.
0.0406
0.0669
0.0406
0.0183
0.0301
0.0183
−0.0595
−0.0980
−0.0595Table 2
G
y fractional Gaussian template.
0.0406
0.0669
0.0406
0.0183
0.0301
0.0183
−0.0595
−0.0980
−0.0595When the Gaussian fractional template is used to extract the initial edge of the solar panel image, the threshold and maximum suppression are also performed as conventional edge detectors do but without performing neighborhood connections. The solar panel image preprocessing results are shown in Figures4 and 5.Figure 4
Red background solder panel image processing: (a) original image; (b) HPD thresholding; (c) initial edge extracted by fractional Gaussian template.
(a)
(b)
(c)Figure 5
Gray background solder panel image processing: (a) original image; (b) HPD thresholding; (c) initial edge extracted by fractional Gaussian template.
(a)
(b)
(c)


### 2.3. Solder Joint Image Feature Extraction

Once solder joint image is binarized, the image features for defect identification can be extracted. It should be noted that the extracted image features are capable of reflecting the quality of the solder joint; that is, the image features extracted from the good solder point image and the defective one should be different. According to the principle of machine vision inspection [27], since the area and gravity of the image can indicate whether the shape in the image is uniform or not and the anisotropy and the moment of inertia can reflect the symmetry and overall distribution of the image, through (4)–(8), we calculate the area, the gravity xg,yg, the anisotropy alpha, and the moment of inertia lx,ly of the binary image as the extracted image features.For area, this feature can count all nonzero pixels by(4)area=∑ipi==1.Gravity can reflect the uniformity quality of solder joint.(5)xg=∑i,j∈SiIi,j∑i,j∈SIi,j=∑vi,j=1∈Sisumvi,j==1,yg=∑i,j∈SjIi,j∑i,j∈SIi,j=∑vi,j=1∈Sjsumvi,j==1.And anisotropy reflects the symmetry quality of solder joint. Before calculating the anisotropy, we should get thep+q center moment in image region S:(6)up,q=∑i,j∈Si-xgpj-ygqIi,j∑i,j∈SIi,j.Then the anisotropy can be acquired by(7)alpha=2u20+u02+4u112+u20-u0222u20+u02+4u112-u20-u022.Moreover, the moment of inertia can be utilized to describe the whole imaging distribution of solder joint:(8)lx=∑i,j∈Si2Ii,jxg2,ly=∑i,j∈Sj2Ii,jyg2.These six image featuresarea,xg,yg,alpha,lx,ly are representative and can describe the quality of solder joint at different views. Some examples of solder joint features extraction are shown in Figure 6.Figure 6
Features extraction examples. Both “∗” and “o” indicate the gravity coordinate (xg,yg).


## 2.1. Image Preprocessing Based on HPD and Morphological Operation

In machine vision inspection system, image preprocessing, including noise removing, image binarization, and edge detection, is the basic guarantee for following detection. However, due to illumination or view angle changing and noise intervention, such image preprocessing task under complex environment is always challenging. Fortunately, in solar panel vision detection system, the illumination and the view angle are under control. And imaging noise can be suppressed in advance by camera calibration beforehand. Thus the preprocessing effect of solar panel images can be guaranteed.Image thresholding is an effective technique for image binarization. Due to the unevenness of the lighting distribution, threshold finding is not simple and straightforward. How to acquire an appropriate threshold becomes the key issue for image binarization. Here, we take HPD [16] to find an accurate threshold for solder panel image binarization. HPD threshold search can handle several histogram distributions, which are illustrated in Figure 2.Figure 2
HPD threshold search sketch map.
(a)
(b)
(c)
(d)
(e)
(f)Morphological operation can obtain the backbone of the image object which can unify a host of techniques such as noise suppression, shape analysis, skeletonizing, and other related topics [27]. After thresholding, the basic morphology operations, dilation and erosion, are usually used to process binary images. In addition, the other two important morphological operations, closing and opening, are also typically used after thresholding. The closing operation smooths the contours of the image to eliminate narrow and long gaps or remove holes or fill contours. The open operation is used to eliminate tiny image objects or separate objects connected to narrow areas.For solder joint images, we firstly convert image color space fromRGB toYcbcr. Then in Y-intensity subspace, we utilize HPD algorithm to obtain global threshold to binarize the image. Then, we use morphological closing and opening operations to get the final binary image. The processing results are shown in Figure 3.Figure 3
Solder joint image preprocessing: (a) original image; (b) HPD image binarization; (c) final morphological processing result.
(a)
(b)
(c)


## 2.2. Initial Edge Extraction via Fractional Gaussian Differential

There are two different backgrounds in solder panel images. One is red background and the other is gray background. The solar panel image under red background is used to calculate position shift and deflection angle against the reference position, while gray background image can be used to extract the inner standard lines for measuring edge length of solar panel. For preprocessing, we also perform color space conversion and selectcr subspace for red background image, while for gray one we take G subspace fromRGBspace. Then, in these color subspaces, we all use HPD for image binarization.After obtaining the binary image, we extract the initial edge of the solar panel by the new fractional calculus [17, 20]. Fractional calculus has been a powerful image enhancement technique in recent years. By adjusting the fractional order of the Gaussian difference, an accurate and antinoise edge extraction effect can be obtained [16, 17].There are three ways to define fractional calculus, namely, the Grünwald-Letnikov (G-L) definition, the Riemann-Liouville definition, and the Capotu definition. The G-L definition comes from the classic definition of the calculus from integer-order continuous function and generalizes the integer calculus into fractional order. The G-L definition is described as [16] (1)DaGtvfx=limh→0,nh=t-ah-v∑r=0n-vrfx-rh.Thus, fractional partial differential can be defined as (v is fractional differential order)(2)∂vFx,y∂xv=Fx,y+-vFx-1,y+-v-v+12Fx-2,y+-v-v+1-v+26Fx-3,y,∂vFx,y∂yv=Fx,y+-vFx,y-1+-v-v+12Fx,y-2+-v-v+1-v+26Fx,y-3.Based on the above two equations, if combined with Gaussian kernelgx,y=1/2πσ2e-x2+y2/2σ2, the fractional Gaussian filtering function can be naturally deduced as (3)Gxv=gx,y1+-ve2x+1/2σ2+-v-v+12e4x+4/2σ2+-v-v+1-v+26e6x+9/2σ2,Gyv=gx,y1+-ve2y+1/2σ2+-v-v+12e4y+4/2σ2+-v-v+1-v+26e6y+9/2σ2.Then if we set the size of filtering windoww=3, the variance σ=1, and fractional order v=1.4, the fractional Gaussian filtering template [19] can be acquired as Tables 1 and 2.Table 1
G
x fractional Gaussian template.
0.0406
0.0669
0.0406
0.0183
0.0301
0.0183
−0.0595
−0.0980
−0.0595Table 2
G
y fractional Gaussian template.
0.0406
0.0669
0.0406
0.0183
0.0301
0.0183
−0.0595
−0.0980
−0.0595When the Gaussian fractional template is used to extract the initial edge of the solar panel image, the threshold and maximum suppression are also performed as conventional edge detectors do but without performing neighborhood connections. The solar panel image preprocessing results are shown in Figures4 and 5.Figure 4
Red background solder panel image processing: (a) original image; (b) HPD thresholding; (c) initial edge extracted by fractional Gaussian template.
(a)
(b)
(c)Figure 5
Gray background solder panel image processing: (a) original image; (b) HPD thresholding; (c) initial edge extracted by fractional Gaussian template.
(a)
(b)
(c)


## 2.3. Solder Joint Image Feature Extraction

Once solder joint image is binarized, the image features for defect identification can be extracted. It should be noted that the extracted image features are capable of reflecting the quality of the solder joint; that is, the image features extracted from the good solder point image and the defective one should be different. According to the principle of machine vision inspection [27], since the area and gravity of the image can indicate whether the shape in the image is uniform or not and the anisotropy and the moment of inertia can reflect the symmetry and overall distribution of the image, through (4)–(8), we calculate the area, the gravity xg,yg, the anisotropy alpha, and the moment of inertia lx,ly of the binary image as the extracted image features.For area, this feature can count all nonzero pixels by(4)area=∑ipi==1.Gravity can reflect the uniformity quality of solder joint.(5)xg=∑i,j∈SiIi,j∑i,j∈SIi,j=∑vi,j=1∈Sisumvi,j==1,yg=∑i,j∈SjIi,j∑i,j∈SIi,j=∑vi,j=1∈Sjsumvi,j==1.And anisotropy reflects the symmetry quality of solder joint. Before calculating the anisotropy, we should get thep+q center moment in image region S:(6)up,q=∑i,j∈Si-xgpj-ygqIi,j∑i,j∈SIi,j.Then the anisotropy can be acquired by(7)alpha=2u20+u02+4u112+u20-u0222u20+u02+4u112-u20-u022.Moreover, the moment of inertia can be utilized to describe the whole imaging distribution of solder joint:(8)lx=∑i,j∈Si2Ii,jxg2,ly=∑i,j∈Sj2Ii,jyg2.These six image featuresarea,xg,yg,alpha,lx,ly are representative and can describe the quality of solder joint at different views. Some examples of solder joint features extraction are shown in Figure 6.Figure 6
Features extraction examples. Both “∗” and “o” indicate the gravity coordinate (xg,yg).


## 3. ELM-Based Solder Joint Defect Detection Method

ELM is always treated as a single-hidden layer feedforward neural network (SLFN) [21, 22]. For N labeled samples xi,ti, where xi=[xi1,xi2,…,xin]T∈Rn and  ti=[ti1,ti2,…,tim]T∈Rm, suppose there are N~ hidden neurons with activation function g(x); the standard SLFN can approximate these N samples with zero error, meaning that there exist βi, wi, and bi such that (9)∑i=1N~βigwi∗xj+bi=tj,j=1,…,N,where wi=wi1,wi2,…,winT is the weight vector connecting the ith hidden neuron and the input neurons, βi=[βi1,βi2,…,βim]T is the weight vector connecting the ith hidden neuron and the output neurons, and bi is the threshold of ith hidden neuron.Then if we use matrix form, (9) can be written in short as (10)Hβ=T,where(11)H=gw1∗x1+b1⋯gwN~∗x1+bN~⋮⋯⋮gw1∗xN+b1⋯gwN~∗xN+bN~N×N~,(12)β=β1T⋮βN~TN~×m,T=t1T⋮tNTN×m.H is called the hidden layer output matrix of neural network. In ELM, the input weights and the biases are randomly assigned, and then the output weight β can be approximated by(13)β^=H+T,where H+ is the Moore-Penrose generalized inverse (pseudoinverse) [21] of the hidden layer output matrix H.From mathematical analysis, it is easy to see that ELM can be trained efficiently, and its prediction is fast and robust. In practice, when we apply ELM for solder joint defect detection, we firstly extract the mentioned featuresarea,xg,yg,alpha,lx,ly from solder joint images and input them to ELM. And the output prediction value is -1 or 1. Here, the output “−1” indicates that the solder joint is defective, whereas the output “1” means that it is good one. Some defect identification examples are illustrated in Figure 8.


## 4. MLSR Based Edge Estimation Algorithm

Accurate and robust edge estimation plays a key role in determining the position of the solar panel. Since the initial edges extracted by fractional Gaussian differential are small line segments with noised fluctuations, they should be properly corrected and estimated to be a clear and accurate edge line. Based on moving least square regression (MLSR) [25, 26], we improve the least square fitting used in previous work [14] for more accurate and robust solder panel edge estimation.If we treat the edge as a position functionfx, then the accurate edge estimation becomes the position regression optimization problem when given initial line segments. Through the base function expansion, the edge regression function can be expressed as (14)fx=∑m=1Mαmpmx=pTxαx,where fxi is position regression value for certain position x. px=p1(x),p2x,…,pMxT is the k-order complete monomial basis function, αx=α1x,α2x,…,αMxT is the coefficient of the basis function, and M is the number of basis functions. From the point of view of moving least square, the coefficient matrix αx should be determined by minimizing the weighted least square error measure Jx at x. Jx can be defined as (15)Jx=∑i=1Nwx-xipTxiαxi-fxi2,where xi is the discrete point to be fitted within the influence domain of x. And wx-xi is weight function which defines the influence domain of x and attributes a weight to each discrete point depending on its position relative to x. The weight function is positive and the value should be increased with the decrease of the distance x-xi between x and xi.With the original extracted edge, we can fit an initial edge line by randomly choosing two pixels. Then, based on the distance to the initial edge of the rest pixels, we can determine whether we use them to update the edge line or discard them. The detailed MLSR algorithm is given as follows.Step 1.
Assume that the two initial edge pixels are(rx1,ry1) and (rx2,ry2). Denote the initial fitted line as y0(x); if x2=x1, then y0(x)=x1; else y0(x)=y2-y1/x2-x1x+b0, where b0=y1-x1(y2-y1)/x2-x1.Step 2.
Compute the distanced between a rest edge pixel and the fitted edge line y0(x). If d≤θ (θ is the distance threshold), then the pixel can be regarded as a true edge pixel that can be used to update y0(x). Save such pixel position xi,yi in a matrix: E:,i=xiyi,  i=1,2,…,n, where i is the number of true edge pixels.Step 3.
Repeat Step  2 until all candidate edge pixels are processed; then we acquire the turn estimated edge pixels’ position matrixE.Step 4.
According to the matrixE, use MLSR algorithm to update the initial edge line and acquire this turn edge line denoted as y(x).Step 5.
If the iteration turn number reaches the setting, then exit and output the final refined edge liney(x); else let y0x=yx and go to Step  2 to continue.Once the accurate edge line of solar panel is acquired, we can calculate the position parameters position shift and deflection angle against reference position.


## 5. Experimental Results and Comparisons

### 5.1. Solder Joint Defect Detection

In our experiments, 30 PCB solder joint images are captured and each of them has 22 solder joints, which means that totally there are 660 solder joints. Some solder joint examples are shown in Figure7. For ELM solder defect identification, we take 500 solder joints as the training samples and the remaining 160 ones are regarded as the testing samples.Figure 7
Some solder joint samples.Figure 8
Some defect detection examples. Red “∗” shows good solder joint and blue “o” indicates the defect one.Then we extract the six image features[area,xg,yg,alpha,lx,ly] for each solder joint image and utilize ELM to determine whether the solder joint is defective or not. Some defect detection examples are shown in Figure 8.Generally speaking, the good solder joint can be treated as a tiny circle that means the anisotropyalpha=1. However, in practice, the value of alpha for good solder joint is sometimes with small fluctuation around 1. In our experiments, if alpha∈1,1.25 and area∈200,500, then the extracted region is identified as a good solder joint; otherwise it will be a defective solder joint or not a solder joint.Given the training setΔ=[X,T], where X=[x1,x2,…,xN], xi=area,xg,yg,alpha,lx,lyT∈Rn and T=[t1,t2,…,tm],  ti∈{-1,1}. The specific procedure of the ELM solder joint defect identification is given as follows.Step 1.
Choose the activation function asg(x)=exp⁡-(x-(-1+2δ))2/0.3, where δ∈-1,1, and set the hidden neuron number as N~.Step 2.
Assign the input weightswi and biases bi,  i=1,…,N~, randomly.Step 3.
Utilize the solder joint training images to train the network; that is, calculate the hidden layer output matrixH by (11).Step 4.
Estimate the output weightβ:β^=H+T by (13).Step 5.
After training, calculate the outputT by (10), and then identify whether the input solder joint is defective or not.For comparison, we also used our previous method [14] and SVM classifier to do solder joint defect detection. In our experiments, we conducted eight tests. The detection performance and the comparison results are shown in Table 3, and the consumption time is also shown in Table 3. As can be seen from the table, our method’s average recognition rate is 98.6%; recognition speed is not up to 5 seconds (in Matlab 2014). Experimental results and comparison show that the proposed ELM-based defect detection scheme is effective in both recognition rate and processing speed.Table 3
Solder joint defect detect performance.
Times
SVMRecognition rate (%)
[14]Recognition rate (%)
The workRecognition rate (%)
SVMTime cost (s)
[14]Time cost (s)
The workTime cost (s)
1
96.3
99.0
98.5
4.42
4.05
4.32
2
97.1
98.3
97.7
4.53
4.11
4.54
3
97.3
98.1
97.3
4.60
4.10
4.58
4
98.1
99.8
99.6
4.47
4.10
4.50
5
97.3
98.5
97.8
4.40
4.00
4.36
6
97.4
98.4
97.8
5.02
4.43
4.98
7
96.6
97.2
97.2
4.72
4.20
4.80
8
98.0
99.4
99.0
4.90
4.30
4.72
Average
97.3
98.6
98.1
4.63
4.16
4.60


### 5.2. Solar Panel Position Determination and Edge Estimation

Before determining the position of the solar panel, we should estimate its edge lines accurately under red and gray backgrounds. For red background solar panel image, we only need to acquire four external edge lines. Suppose that there are four vertexes,rx1,ry1, rx2,ry2, rx3,ry3, and rx4,ry4; the initial edge lines can then be fitted by the four vertexes. After using MLSR algorithm, the final edge lines estimation result is shown in Figure 9. The corresponding line parameters, slope and bias, are shown in Table 4. And the result of least square fitting (LSF) method in [14] is compared in Table 4. From the table, we can see that the position estimated by MLSR is more accurate than that of LSF. And we can also find that the estimated edge lines in solder image are not actually parallel, which may be caused by imaging distortion according to the machine vision principles [27].Table 4
Comparisons of position parameters for acquired edges.
Edges
Slop
Bias
Angle difference
MLSR
LSF [14]
MLSR
LSF [14]
MLSR
LSF [14]
Top
−0.1017
−0.1471
1.1775
1.6235
3.2397
3.3435
Bottom
−0.1199
−0.1265
8.3395
8.3327
Left
9.9545
9.7217
−4.5644
−4.7879
5.2545
5.3326
Right
7.6886
7.3248
−56.9778
−58.174Figure 9
Edge estimation result under red background.For gray background solar panel image, it will need eight vertexes to determine two inner standard lines in the middle part and the four edge lines. Suppose that there are eight vertexes,wx1,wy1, wx2,wy2, wx3,wy3, wx4,wy4, wx5,wy5, wx6,wy6, wx7,wy7, and wx8,wy8; after using MLSR algorithm, the final refined edges are shown in Figure 10. Lengths of estimated edge lines are calculated and shown in Table 5. Then we can take the difference between the actual detected edge length and the given length to determine whether the solar panel is qualified or not. Similarly, LSF results are also compared in Table 5. From the table, we can see that the mean square error (MSE) of MLSR estimated lines is less than 0.5 mm. This indicates that the performance of MLSR edge estimation is superior to previous one.Table 5
Length comparisons of estimated edges.
Length
The numbers of image pixels
Realistic lengths (mm)
MSE (mm)
The proposed MLSR
LSF [14]
The proposed MLSR
LSF [14]
The proposed MLSR
LSF [14]
Average top line
652.6
655.2
156.38
158.23
0.439
0.575
Average bottom line
650.1
650.5
155.78
155.39
Top two lines’ distance
164.8
166.3
39.49
41.43
N/A
Bottom two lines’ distance
161.5
160.2
38.70
39.84Figure 10
Edge estimation result under gray background.All experiments and comparisons under different background show that the proposed MLSR algorithm is efficient in solar panel position determination and edge lines estimation.


## 5.1. Solder Joint Defect Detection

In our experiments, 30 PCB solder joint images are captured and each of them has 22 solder joints, which means that totally there are 660 solder joints. Some solder joint examples are shown in Figure7. For ELM solder defect identification, we take 500 solder joints as the training samples and the remaining 160 ones are regarded as the testing samples.Figure 7
Some solder joint samples.Figure 8
Some defect detection examples. Red “∗” shows good solder joint and blue “o” indicates the defect one.Then we extract the six image features[area,xg,yg,alpha,lx,ly] for each solder joint image and utilize ELM to determine whether the solder joint is defective or not. Some defect detection examples are shown in Figure 8.Generally speaking, the good solder joint can be treated as a tiny circle that means the anisotropyalpha=1. However, in practice, the value of alpha for good solder joint is sometimes with small fluctuation around 1. In our experiments, if alpha∈1,1.25 and area∈200,500, then the extracted region is identified as a good solder joint; otherwise it will be a defective solder joint or not a solder joint.Given the training setΔ=[X,T], where X=[x1,x2,…,xN], xi=area,xg,yg,alpha,lx,lyT∈Rn and T=[t1,t2,…,tm],  ti∈{-1,1}. The specific procedure of the ELM solder joint defect identification is given as follows.Step 1.
Choose the activation function asg(x)=exp⁡-(x-(-1+2δ))2/0.3, where δ∈-1,1, and set the hidden neuron number as N~.Step 2.
Assign the input weightswi and biases bi,  i=1,…,N~, randomly.Step 3.
Utilize the solder joint training images to train the network; that is, calculate the hidden layer output matrixH by (11).Step 4.
Estimate the output weightβ:β^=H+T by (13).Step 5.
After training, calculate the outputT by (10), and then identify whether the input solder joint is defective or not.For comparison, we also used our previous method [14] and SVM classifier to do solder joint defect detection. In our experiments, we conducted eight tests. The detection performance and the comparison results are shown in Table 3, and the consumption time is also shown in Table 3. As can be seen from the table, our method’s average recognition rate is 98.6%; recognition speed is not up to 5 seconds (in Matlab 2014). Experimental results and comparison show that the proposed ELM-based defect detection scheme is effective in both recognition rate and processing speed.Table 3
Solder joint defect detect performance.
Times
SVMRecognition rate (%)
[14]Recognition rate (%)
The workRecognition rate (%)
SVMTime cost (s)
[14]Time cost (s)
The workTime cost (s)
1
96.3
99.0
98.5
4.42
4.05
4.32
2
97.1
98.3
97.7
4.53
4.11
4.54
3
97.3
98.1
97.3
4.60
4.10
4.58
4
98.1
99.8
99.6
4.47
4.10
4.50
5
97.3
98.5
97.8
4.40
4.00
4.36
6
97.4
98.4
97.8
5.02
4.43
4.98
7
96.6
97.2
97.2
4.72
4.20
4.80
8
98.0
99.4
99.0
4.90
4.30
4.72
Average
97.3
98.6
98.1
4.63
4.16
4.60


## 5.2. Solar Panel Position Determination and Edge Estimation

Before determining the position of the solar panel, we should estimate its edge lines accurately under red and gray backgrounds. For red background solar panel image, we only need to acquire four external edge lines. Suppose that there are four vertexes,rx1,ry1, rx2,ry2, rx3,ry3, and rx4,ry4; the initial edge lines can then be fitted by the four vertexes. After using MLSR algorithm, the final edge lines estimation result is shown in Figure 9. The corresponding line parameters, slope and bias, are shown in Table 4. And the result of least square fitting (LSF) method in [14] is compared in Table 4. From the table, we can see that the position estimated by MLSR is more accurate than that of LSF. And we can also find that the estimated edge lines in solder image are not actually parallel, which may be caused by imaging distortion according to the machine vision principles [27].Table 4
Comparisons of position parameters for acquired edges.
Edges
Slop
Bias
Angle difference
MLSR
LSF [14]
MLSR
LSF [14]
MLSR
LSF [14]
Top
−0.1017
−0.1471
1.1775
1.6235
3.2397
3.3435
Bottom
−0.1199
−0.1265
8.3395
8.3327
Left
9.9545
9.7217
−4.5644
−4.7879
5.2545
5.3326
Right
7.6886
7.3248
−56.9778
−58.174Figure 9
Edge estimation result under red background.For gray background solar panel image, it will need eight vertexes to determine two inner standard lines in the middle part and the four edge lines. Suppose that there are eight vertexes,wx1,wy1, wx2,wy2, wx3,wy3, wx4,wy4, wx5,wy5, wx6,wy6, wx7,wy7, and wx8,wy8; after using MLSR algorithm, the final refined edges are shown in Figure 10. Lengths of estimated edge lines are calculated and shown in Table 5. Then we can take the difference between the actual detected edge length and the given length to determine whether the solar panel is qualified or not. Similarly, LSF results are also compared in Table 5. From the table, we can see that the mean square error (MSE) of MLSR estimated lines is less than 0.5 mm. This indicates that the performance of MLSR edge estimation is superior to previous one.Table 5
Length comparisons of estimated edges.
Length
The numbers of image pixels
Realistic lengths (mm)
MSE (mm)
The proposed MLSR
LSF [14]
The proposed MLSR
LSF [14]
The proposed MLSR
LSF [14]
Average top line
652.6
655.2
156.38
158.23
0.439
0.575
Average bottom line
650.1
650.5
155.78
155.39
Top two lines’ distance
164.8
166.3
39.49
41.43
N/A
Bottom two lines’ distance
161.5
160.2
38.70
39.84Figure 10
Edge estimation result under gray background.All experiments and comparisons under different background show that the proposed MLSR algorithm is efficient in solar panel position determination and edge lines estimation.


## 6. Conclusions

In this work, machine learning based methods for solder joint defect detection and solar panel position determination are explored in detail. After image preprocessing, six representative image features are extracted and ELM classification is used for defect identification. The experiments and comparisons show that the proposed feature extraction and ELM classification method are effective. Moreover, MLSR algorithm is proposed to estimate the edge lines of solar panel and then to determine the panels’ position. The practical experiments show that the edge lines in different background can be robustly estimated. And then the position parameters can be accurately determined.In the future, our further study will focus on using deep learning features for solder joint defect detection and developing more robust regression algorithm to overcome the influence of image distortion.



---

*Source: 7406568-2017-05-16.xml*