Micro-crack detection of multicrystalline solar cells featuring an improved anisotropic diffusion filter and image segmentation technique

This paper presents an algorithm for the detection of micro-crack defects in the multicrystalline solar cells. This detection goal is very challenging due to the presence of various types of image anomalies like dislocation clusters, grain boundaries, and other artifacts due to the spurious discontinuities in the gray levels. In this work, an algorithm featuring an improved anisotropic diffusion filter and advanced image segmentation technique is proposed. The methods and procedures are assessed using 600 electroluminescence images, comprising 313 intact and 287 defected samples. Results indicate that the methods and procedures can accurately detect micro-crack in solar cells with sensitivity, specificity, and accuracy averaging at 97%, 80%, and 88%, respectively.


Introduction
The increasing demand for solar electrical energy has multiplied the need for photovoltaic (PV) arrays. As the major component of the PV array, the demand for solar cells has also increased. This demand has translated into an increased production of solar cells in recent years. Depending on the materials used in manufacturing, solar cells can be divided into two major types. They are (i) monocrystalline and (ii) multicrystalline silicones. Due to low manufacturing and processing cost of the multicrystalline silicon, this material is generally more preferred in the production of the solar wafer or PV module. There is great potential for the automation in solar cell industry because millions of solar cells are manufactured daily worldwide. According to recent statistics, the growth rate of the solar PV module reached a record high in 2011, generating more than US$93 billion in revenue with multicrystalline cells constituting more than 50% of the world production [1]. Although many operations in the PV industry have been automated, the inspection and grading processes continue to be based on manual or semi-manual efforts.
Finished solar cells are occasionally found to be defective or faulty. The defects fall into two groups: (i) intrinsic and (ii) extrinsic. Grain boundaries are an example of intrinsic defect, while micro-cracks belong to the second category. The former type of defects diminish the short-circuit current of the cell, and this leads to loss in the efficiency. The latter defects form a class of cracks that are entirely invisible to the naked eye. With dimensions smaller than 30 μm [2], this type of defect can only be visualized electronically like using the electroluminescence (EL) technique and high-resolution cameras.
In practice, there are various shapes and sizes of microcracks in a solar cell depending on how they are formed. For example a line-shaped micro-crack is caused by scratches, and it generally occurs during cell fabrication [3]. This type of defect can also be due to wafer sawing or laser cutting, which propagates and causes the detachment or internal breakage of the grainy materials within the solar cells [4]. In contrast, star-shaped micro-crack is formed due to a sharp point impact which induces several line cracks with a tendency to cross each other [5]. There are other types of micro-crack defects, but these two are the most commonly found in solar cell production. Köntges et al. [6] reported that there may be a risk of failure for PV modules containing cells that have micro-cracks or other types of defects. Hence, it is important to have high-quality, defect-free cells in the production of PV modules.
To date, few studies have highlighted the benefit of computer inspection for defect detection in EL images of solar cells. For example, multicrystalline solar cell images have been categorized into three distinct classes based on the features extracted from texture analysis [7]. An evaluation of crack formation in the PV module before and after mechanical load testing using EL images has been presented by Kajari-Schröder et al. [8]. Recently, a defect detection scheme based on Fourier image reconstruction has also been reported [9]. These authors presented a successful detection of a micro-crack which is geometrically simple like straight lines. A micro-crack detection scheme for a solar wafer based on an anisotropic diffusion filter has also been documented [10]. As reported by these authors, this filter is very efficient in preserving important edges in the image while smoothing other less important and connected regions. However, correct implementation of this technique depends crucially on the choice of an edge stopping threshold. In most cases, this value has to be determined interactively, frequently through trail-and-error method. Only under very unusual circumstances can anisotropic diffusion filtering be successful using a single threshold since images are likely to be gray level variations in objects and background due to non-uniform lighting and other factors. Clearly, a more robust approach is needed in order to increase the efficiency of this filtering strategy. In this paper, an enhanced version of the anisotropic diffusion filter featuring an adaptive thresholding via a sigmoid transformation function is presented. Meanwhile, pattern classification is established using support vector machines (SVMs) with supervised learning [11]. The methods and procedures are tested using intact and defected solar cells, and results are compared with other filters and artificial classifiers.

Electroluminescence image
Micro-crack detection in the monocrystalline cell is relatively straightforward because this type of cell is characterized by a uniform background. However, this is not the case for the multicrystalline cell, which contains crystal grains as well as dark areas formed from intrinsic structures like dislocation clusters and grain boundaries. Distinguishing micro-crack pixels from the background (i.e., the multicrystalline grains) is a very challenging procedure because the gray scale values of these two areas are not significantly different. The presence of other defects, such as the dark area, darker grains, and broken fingers, complicates the problem. In spite of these difficulties, the identification is still possible because the micro-cracks tend to appear in the form of strong lines with a low intensity and a high gradient. Figure 1a (i) shows an example EL image of a defected solar cell, and its close-up view of the region containing the micro-crack is displayed in Figure 1a (ii). For comparison, the EL image of a good solar cell is presented in Figure 1b (i), and its close-up view is shown in Figure 1b (ii). Meanwhile, the scan-line profile of gray level and gradient of the solar cell defected with a microcrack is shown in Figure 2b,c, respectively. These figures highlight the unique textural characteristics of the microcrack pixels.
All EL images used in this study including those shown in Figure 1 are 8-bit gray scale measuring 1,178 × 1,178 pixels in size. Other examples of defected solar cells containing various types and shapes of micro-cracks are shown in Figure 3. The micro-crack pixels appear in the form of a line or an intersection of lines forming a star-like artifact as depicted in Figure 3a. For comparison, Figure 3b shows examples of good solar cells highlighting the presence of dark regions having arbitrary shapes and sizes. They are formed by an aggregate of dislocation clusters or grainy materials, resembling dark shaped areas when visualized under the EL illumination. As seen from this figure, the presence of many dark areas or regions in both good and defected samples makes a micro-crack inspection an extremely difficult process. However, a close examination of Figure 3a reveals that micro-crack pixels exhibit unique shapes or patterns compared to dark regions even though they have the same gray scale values. Thus, some form of image analysis is needed in order to facilitate accurate detection and efficient classification. In this study, a series of image processing procedures are performed, capitalizing the unique textural properties and multicrystalline grain inhomogeneity of the solar cell. The details are described in the next section.

Image pre-processing
As seen in Figures 1 and 3, the EL images of the solar cell contain various features, such as fingers (horizontal lines) that are periodic in nature and perpendicular to the busbar (thicker vertical lines in Figure 1a (i) and Figure 1b (i)). A close inspection of these figures revealed that the intensity distribution is not uniform both within the cell and among the cells. The presence of the broken fingers and non-uniform background luminescence directly affects the micro-crack analysis, especially if a simple image segmentation technique is used. The solutions to these problems are to remove the periodic interruption of fingers and minimize the effect on background inhomogeneity on image processing. This can be done by filtering in the frequency domain.
Let I O be the original EL image of size m × n, andÎ O u; v ð Þ is its Fourier transform representation. Due to the orthogonal properties, the fingers in the spatial domain appear as a straight vertical line located at the center of a spectrum. This line is dominated by high-frequency components because the contrast between fingers and background is relatively higher compared to other inhomogeneities. Meanwhile, the low-frequency regions contain other important components such as the grain boundaries, dislocation clusters, and micro-cracks. Hence, only the high-frequency components located around the vertical line needs to be removed while retaining the low-frequency components. Therefore, a custom-made filter is constructed to remove these artifacts. The filter function is given below:   Parameters w, d, and σ in Equation 1 are chosen experimentally. The filtering is performed by pixel-to-pixel multiplication betweenÎ O u; v ð Þ andV u; v ð Þ to producê I e u; v ð Þ as shown in Figure 4a. The resulting image is inverse Fourier transform, yielding I e (x, y) in spatial space. To minimize the error resulting from the inconsistency of the gray level between cells, I e (x, y) is normalized to 128. This filtered image is shown in Figure 4c,d,e. It can be seen from these figures that the fingers have been successfully removed and the background inhomogeneity is reduced. Also, the micro-crack pixels are not affected by this filtering operation as evident from Figure 4d (ii). Therefore, this local processing approach preserves the details in the image while attenuating the slow varying components such as the background irregularities.

Anisotropic diffusion filtering
This subsection presents an implementation of anisotropic diffusion filtering for image enhancement. As can be seen in Figure 4d (ii), the micro-crack pixels are characterized with low gray scale values but high gradients. The convolution of I e (x, y) with a simple edge detector (e.g., Sobel kernel) will yield high and low gradients at the edges and micro-crack pixels, respectively. Consequently, the result is that the produced image contains two lines, corresponding to regions with high and low intensity gradients. This will give rise to the difficulty in the detection leading to many false negatives. We solved this problem by means of the anisotropic diffusion filtering, which produces equal response to any pixels, including the micro-crack areas. In order to achieve this, the diffusion filter is programmed to take into account not only the intensity of the gradient but also the intensity of the gray level of each pixel. The details are explained below.
The anisotropic diffusion filtering can be defined in terms of the diffused image I d (x, y, t) at iteration t [12]. Mathematically, where ∇ is a gradient and c is a diffusion coefficient that is a non-negative function of the magnitude of the gradient of four Laplacian neighbors, i = {1, 2,…, 4}. Letting s = |∇I d |, then the diffusion coefficient in Equation 3 is given as These diffusion coefficients exhibit a low value at high gradient purposely to preserve the corresponding edges. On the other hand, these coefficients produce high value at low gradient indicating a strong smoothing effect on the pixels involved. Thus, the anisotropic diffusion filtering will produce a smoothed image while the important edges are preserved. Parameter K appearing in Equations 4 and 5 is an edge stopping threshold, and it needs to be correctly specified in order to ensure a successful application of this filtering strategy. If K is too small, then the diffusion process will be terminated earlier, resulting in I d (x, y, t) which is approximately equal to I d (x, y, 0). In contrast, fixing K too large will significantly diffuse the image, resulting in image blurring. Therefore, the choice of the parameter K is important for producing a diffused image that retains the important edges while smoothing the other regions of the image.
Micro-crack In this study, a conventional anisotropic diffusion filtering technique is modified to produce the opposite effect. In doing so, the smoothing effect will now take place at the strong edges (high gradient) while the region with low gradient are preserved. This is achieved by inverting the original diffusion coefficient yielding Theoretically, the function in Equation 5 privileges wide regions over smaller ones. Therefore, with modification in Equation 6, this trend is reversed to satisfy the characteristics of the micro-crack. Figure 5 shows a response of Equations 4, 5, and 6 with respect to gradient. As shown in this figure, the modified diffusion coefficient increases with the increasing gradient while the responses of the original coefficients are in the opposite sense.
Most of the approach reported in the literature used trial-and-error experiments in determining K. In contrast, this study used a diffusion coefficient function that eliminates the need to use this parameter. Referring to the micro-crack pixels defined in the previous section, we are interested in every pixel with a high gradient but a low intensity value. For this reason, the gradient threshold does not have to be rigidly fixed. In order to achieve this, parameter, K is replaced with the function that adaptively generates a unique threshold for each pixel using the input image gray values. The proposed diffusion coefficient is as follows: where g is a mapping of the image intensity of I d (x, y, 0) through the sigmoid transfer function given by where b determines the gradient of ramp in the transfer function and ε is a threshold value where the intensity of I d (x, y, 0) is mapped to the center of the gray scale range. Equation 8 is defined as an edge stopping threshold matrix, and it has the same dimension as I e (x, y). Every element in g(x, y) is the edge stopping threshold value for the corresponding pixel in I e (x, y). Equation 7 is plotted for different s and g values, and the result is graphically shown in Figure 6. As seen in Figure 6, the response of the diffusion coefficient varies with the different threshold values. The response is more sensitive when the threshold value is low with respect to the same gradient s. High value of the coefficient yields a high diffusivity for the corresponding pixel in the image which leads to blurring effect. As mentioned earlier, existing techniques only used a single edge stopping threshold value for the whole image. In this study, an adaptive edge stopping threshold function given in Equation 8 is used. This resulted in different threshold values for different pixels depending on their gray scale values through a mapping process.
The proposed anisotropic diffusion method described above was tested using a synthetic image of size 256 × 256 pixels. As shown in Figure 7a, this image simulates a gradient profile comprising 16 discrete steps. Figure 7b shows the horizontal line scan of Figure 7a. The diffused image using the standard diffusion filter is shown in Figure 7c, while Figure 7d shows the result using the proposed algorithm. Clearly, image processing using standard diffusion filter produced a very blurred image, resulting in incomplete or missing edges. In contrast, the proposed technique affects low gray scale edges only, while the high gray scale edges remain relatively intact. Processing the micro-crack using the proposed technique would result in blurred response in the diffused image since this type of defect is characterized by low gray scale and high gradient. Theoretically, subtracting this image from the original undiffused background would enhance the defect by removing some of the background components.
In this study, the proposed anisotropic diffusion filtering is performed in three steps. First, the filtered image, I e (x, y), is smoothed using a 2-D Gaussian filter of size 5 × 5 yielding I d (x, y, 0). Second, the smoothed image is then processed using Equation 8 to produce the edge stopping threshold matrix, g(x, y), which in turn is used to calculate the diffusion coefficient function given by Equation 7. Third, Equation 3 is invoked and the calculation is terminated after a few iterations. In this case, the iteration number is determined heuristically and is usually less than 10 in most cases.
The resulting diffused image has a blurred response due to the low-pass filtering effect of the diffusion process. The smoothing effect varies between pixels, and the extent of this depends on the edge stopping threshold value in g(x, y). For a pixel with a low threshold value, the smoothing is significant and yields a very blurred response. In contrast, this image processing technique produces image which is approximately equal to the original image if the smoothing effect is weak. As previously explained, the resulting image is obtained by subtracting I d (x, y, t) from I d (x, y, 0) to produce the new, enhanced image denoted as I Δ (x, y). Figure 8 illustrates the images produced by these enhancement procedures using Figure 4d (ii) and Figure 4e (ii) as input images. Referring to Figure 8a (iii), the micro-crack line is enhanced and clearly visible after subtraction.

Post-processing
This section presents a post-processing involved in the segmentation of the I Δ (x, y). It consists of two thresholding stages: (i) binary image reconstruction using double thresholding and (ii) the intensity tracing and thresholding. All threshold values are calculated using an adaptive thresholding technique [13]. The general expression of adaptive thresholding is given by where μ and σ are the mean and the standard deviation of the gray level intensity of the input image, respectively, and α is a scaling factor. In the first stage, we adopted a similar approach based on double thresholding technique described in Nashat et al. [14]. This method requires I Δ (x, y) to be segmented twice, first using a high threshold value τ S and second using a low threshold value τ T . Equation 9 is used to compute τ S and τ T using scaling factors α S and α T , respectively. This segmentation technique produces two binary images referred herein as the seed image B S and the target image B T . In this case B S consists of mainly incomplete but noise-free edges, whereas B T contains complete edges and noise. The next step in the segmentation involves reconstructing the final binary image B F from B S and B T followed by dilation and closing. In this case, B F contains {S 1 , S 2 ,…, S N } where S represents the shape in the form of binary connected components and N is the number of shapes following the first stage thresholding step. The resulting binary images are presented in Figure 9 using Figure 8a (iii) and Figure 8b (iii) as input images.
Next, the intensity tracing and thresholding are performed on B F using I e (x, y) as the reference image. The purpose of this procedure is to further reduce the noise or the unwanted shapes, such as scratches, dislocation clusters, or grain boundaries. The gray values of these artifacts are relatively higher compared to those of the micro-crack pixels. This procedure helps to improve the feature extraction because it significantly reduces the number of shapes.
For each binary shape S in B F , the value of the gray intensity composed of pixels at the same location and   bounded by the same contour S is traced and extracted from the normalized image after pre-processing. The mean value of the gray intensity for each extracted pixels group is computed. Any shape that has a mean value which is less than the specific threshold is retained in B F . Otherwise, it is treated as noise and hence eliminated. Again, the adaptive thresholding given in Equation 9 is used with α tr fixed experimentally while μ and σ are obtained from I e (x, y). These procedures generate a new set of shapes S 1 ; S 2 ; …; S N F f gwhose number is less than the ones contained in the original set (i.e., N F ≤ N). An example of the intensity tracing and thresholding is shown in Figure 10 using Figure 9a (iii) as an input image. In this example, the number of shapes is reduced from 3 to 1.

Shape analysis
The image processing procedures described in the above paragraph have successfully enhanced micro-cracks as well as other objects while suppressing most of the noise pixels. As seen from previous section, the resulted binary image contains several binary connected components that represent crack and other artifacts. Figure 11 displays some of the objects detected by the algorithm. From this figure, the pixels that represent micro-crack can be distinguished from other artifacts because the former is characterized by some unique shapes and sizes. Therefore, shape analysis is used in order to distinguish between micro-cracks and other objects. This analysis produced features from shape descriptors which are later used in machine learning and classification.
In performing shape analysis, the region-based descriptor known as angular radial transform (ART) [15,16] is investigated. The standard number of orders of ART is used to represent all binary shapes. The transform has 36 coefficients, and they are used as shape descriptors. Figure 12 shows examples of the ART spectrum for the micro-crack and arbitrary shapes. As seen in Figure 12, a normalized ART spectrum for the micro-crack shape has more distinct fluctuation compared to the arbitrary shape. This translated into an increased average distance between the two spectrums and will result to a better discrimination of the shapes.
The features extracted are used to train the artificial classifier. In this study, support vector machines (SVMs) are used in machine learning and artificial intelligence. It is a supervised learning algorithm originally developed for two-class classification problems [11]. Therefore, this classifier is suitable for this type of application. Micro-crack shape features are assigned as positive class, while arbitrary shape features are assigned as negative class. Preliminary experiment suggested that the number of micro-crack shapes is far less than that of arbitrary shapes. Due to the unbalanced number of shapes between classes, the SVM classification may result in a bias toward the class having the most number of samples. This problem is addressed by utilizing a soft margin or penalty parameter which was set to different values for each class [17]. This approach is similar to the implementation of a fuzzy membership associated with the penalty parameter [18]. In this case, the optimal values of the penalty parameter for the positive and the negative classes are chosen experimentally. Also in this study, the SVM is trained using a kernel based on the Gaussian radial basis function (RBF). In summary, the methods and procedures implemented for micro-crack detection of solar cells are summarized in a block diagram shown in Figure 13.

Result and discussion
In this section, the experimental results from the methods and procedures described in the above sections are presented. This includes the image segmentation and classification. All experiments are performed on a desktop computer equipped with a dual core 2.80 GHz processor, 2 GB of RAM, and an installed MATLAB software package. The results obtained in this section are based on 600 samples of which 313 are good samples and the remaining are defected or cracked cells.

Image processing
Examples of the segmentation results for defected and good cells are shown in Figure 14. It can be seen from Figure 14a (i-iv) and the corresponding segmented images in Figure 14a (v-viii) that the integrity of the binary connected components (shapes) that represent the micro-crack pixels is well preserved. Referring to these figures, the micro-crack shapes can be easily distinguished from the arbitrary shapes visually. For comparison, the segmentation results of good or intact cells are shown in Figure 14b (v-viii).
For the thoroughness of analysis, the proposed segmentation technique is compared with standard methods such as Otsu's thresholding, the Canny hysteresis, the Sobel edge detector, and the Laplacian of Gaussian (LoG) filter. In addition, a recent method based on Fourier image reconstruction (FIR) [9] is also implemented. Figure 15 shows the close-up view of the results of these different segmentation techniques using images in Figure 14a (i-iv) as input images. In this case, the ground truth images are plotted manually by an expert human inspector. It can be seen from Figure 15b that the segmentation using Otsu's global thresholding technique is able to detect micro-crack as well as other pixels. Meanwhile, both the Sobel detector and Canny hysteresis thresholding resulted in incomplete or disjointed micro-crack pixels. On the other hand, the LoG is only effective in detecting a limited number of micro-crack pixels, particularly the large ones as evident from Figure 15e. In contrast, the FIR method is accurate when detecting well-defined micro-crack pixels especially the ones appearing like straight lines. This method failed to completely detect star-shaped micro-crack pixels as evident from Figure 15f. In contrast, the results from the proposed segmentation technique are shown in Figure 15g. Clearly, the proposed method is able to detect all shapes and sizes of micro-crack pixels in the image. Close examination of this figures revealed that some unwanted pixels also appeared in the segmented images. They are mostly due to the presence of dark regions in the solar cell. Since their appearance are distinctly different from micro-crack pixels, the use of the ART shape descriptor helped reduce the error resulting from misdetection. In order to quantitatively evaluate the accuracy of the proposed segmentation technique, the merit based on the F-measure is used [19]. Mathematically, where cpt and crt are the completeness and correctness indices given by the following equations: where ℓ GT is the number of micro-crack pixels in the corresponding ground truth image, ℓ r is the number of pixels in the segmented image which matches the ground truth micro-crack pixels, and ℓ N is the total number of extracted pixels in the segmented image. Examples of ground truth images corresponding to defected cells in Figure 15a (i-iv) are shown in Figure 15h    micro-crack pixels in the defected solar cells. Clearly, from Equation 11, cpt is equal to 1 if ℓ r = ℓ GT , indicating the perfect match between the number of micro-crack pixels detected by the algorithm and the ground truth image. In contrast, cpt is equal to 0 if there is no match. Meanwhile, the crt index measures the correctness of the segmented image produced. Similarly, this index is equal to 1 if the segmented image matches the ground truth. Practically, ℓ r ≤ ℓ N since micro-crack as well as noise pixels are also detected. Hence crt also ranges from 0 to 1. Calculating cpt and crt enables the F-measure to be computed using Equation 10. In this case, the higher the F-measure, the better the image segmentation. The cpt and crt indices calculated from defected cell images in Figure 15 are tabulated in Table 1. These indices are also calculated for the remaining 110 defected cells which are not shown in this paper. The average values are listed in the last column of Table 1. Referring to this table, the completeness of Otsu's method is the highest compared to other algorithms. But this is not the case for correctness as the crt index for this algorithm is the second lowest. Consequently, Otsu's method reconstructs many micro-crack pixels as well as noise as evident visually in the examples in Figure 15. As expected, the Sobel edge detection and Canny hysteresis methods produce only average results for both completeness and correctness. The same trend is observed for the FIR method. In contrast, the LoG filter produces the lowest cpt and crt scores, suggesting that this method does not correctly or completely detect micro-crack pixels. Meanwhile, the proposed segmentation technique yields the highest crt and the second highest cpt scores. This result suggests that this method has the ability to completely and correctly characterize micro-crack with small amount of noise.
Meanwhile, the results of F-measure are shown graphically in Figure 16. It can be seen from this figure that the F-measure score produced by the proposed segmentation algorithm is consistently higher compared to other techniques. Overall, the proposed algorithm results in F-measure averaging at 0.0821 compared to 0.0216 FIR, 0.0028 LoG, 0.0258 Canny, 0.02288 Sobel, and 0.0153 Otsu. This again proves that the proposed method is more efficient in detecting micro-cracks in solar cells.
In the anisotropic diffusion filtering technique proposed in this study, there are few parameters that need to be tuned. These parameters are b and ε for the sigmoid mapping function and t which is the number of iterations for anisotropic diffusion. Meanwhile, ε corresponds to the average intensity of the input image μ I e . This simplified the computation of the mapping function as the target micro-crack pixels have the intensity below this average value. Meanwhile, parameter b represents the gradient of the sigmoid mapping function. Higher value of this parameter resulted in steeper gradient for the mapping function. Figure 17 demonstrates the effect of changes in the value of b on I Δ (x, y) using Figure 15a as input images. Clearly from this figure, the best result is obtained for b = 1. Hence, this value was used to process all images reported in this paper.
Another important parameter in the anisotropic diffusion filtering is the number of iterations t in which the image needs to be diffused. This parameter must be properly chosen to ensure successful enhancement of the microcrack pixels at a minimal computational cost. The higher the number of the iteration, the longer the computational time. Figure 18 shows the normalized values of cpt, crt, and F-measure for the different numbers of iteration. These indices are averaged from 114 defected cells. As can be seen from Figure 18, the highest value of F-measure occurred at t = 1. However, the cpt index corresponding to first iteration is significantly low, indicating the image that it produces is incomplete. Hence, the image needs Table 1 Completeness and correctness measures of the segmentation results

Measure
Method Figure 15a (i) Figure 15a (ii) Figure 15a (iii) Figure 15a (   to be iterated further in order to improve the cpt index. Close examination of Figure 18 revealed that the second highest F-measure occurs at the fourth iteration. Even though the cpt decreases slightly at this iteration, the image is more complete and less noisy compared to the first iteration. A further increase in the number of iteration would result in the decrease of the F-measure as well as the cpt and crt indices. Therefore, the diffusion process of all images shown in this paper is terminated after the fourth iteration (t = 4). The performance of the proposed algorithm is also compared with the existing adaptive anisotropic diffusion techniques. Respectively, the images in Figure 19a,b are the results of improved diffusion filters [20,21], while Figure 19c is the image produced by the proposed algorithm. Clearly from this figure, the existing adaptive diffusion  Figure 19 Image subtraction results comparing the proposed and existing adaptive anisotropic diffusion filters. (a) Filter proposed in [20] with K 0 = 2, (b) filter proposed in [21] with K 0 = 80, and (c) filter proposed in this study. All diffused images used in the subtraction are obtained after t = 4.
filters contain many spurious responses and noisy pixels. Visually, the defect, particularly in Figure 19b, appears to be completely buried in noise, causing the difficulty in extracting features from this image. In contrast, the image produced by the proposed algorithm is less noisy, and the defect can clearly be seen as evident from Figure 19c. Therefore, these results suggest that the existing adaptive anisotropic diffusion filters are not effective in processing micro-crack defects in solar cell images. Moreover, the algorithms can be very time-consuming since the diffusion coefficients are computed locally compared to the global technique employed in the proposed method.

Shape classification
Shape analysis is performed in order to primarily distinguish between micro-crack and other arbitrary pixels. This is due to the fact that the micro-crack pixels form shapes which are visually distinct like line or star patterns. On the other hand, shapes formed by the spurious intensity variation or gray level discontinuities produce arbitrarily patterns which are also detected by the proposed image processing algorithm. In doing so, the ART shape descriptor discussed earlier in Section 2.4 is implemented. The algorithm is evaluated using 114 defected and 126 intact cells. Altogether, 5,598 shapes have been detected of which 218 belong to the micro-crack category and the remaining are arbitrary patterns. The ART is applied to these shapes, and the results are visualized in principal component plots in Figure 20a. In this case, only the first two dominant components, i.e., first and second components, are used in the visualization. For comparison purpose, the scattered plots of shape features produced by the well-known methods like (i) the Fourier descriptor (FD) [22], (ii) the generic Fourier descriptor (GFD) [23], and (iii) the projection-based Radon composite features (RCF) [24] are also included in this figure. A close examination of Figure 20 shows that the overlap between micro-crack and other arbitrary shapes is more prominent in Figure 20b,c,d than in Figure 20a. All micro-crack shapes in Figure 20b,c,d occupy the regions that are enclosed within other arbitrary shapes. Clearly, there is no unique demarcation between these two groups in the PCA space. Hence, any attempt to use FD, GFD, or RCF as features in the classification scheme would result in many samples being misclassified. In contrast, the overlap between the groups is less prominent for ART features, as shown in Figure 20a. It can be seen that the other arbitrary shapes are skewed to the right, whereas the micro-crack shapes are skewed to the left. Therefore, it is hypothesized that the features extracted using ART are more separable compared to those extracted using FD, GFD, and RCF. This hypothesis is validated quantitatively using the separability measure. This measure reflects the discriminative capability in the features of each class; the higher the separability, the higher the discrimination between the groups. Figure 21 shows a comparison of the separability measure between ART, FD, GFD, and RCF. In this case, the separability measure for ART is the highest, registering a value of 12 compared to less than 9 for FD, GFD, and RCF. This result confirms that the features obtained using ART have more discriminative power compared to features obtained using FD, GFD, and RCF.
In this study, altogether 600 randomly selected solar cells have been evaluated from which 240 cells belong to the training set and the remaining 360 cells constitute the test set. Table 2 tabulates the distribution of cells in the training and testing sets. During testing, the classifier produced a positive output when the cell is defected with micro-crack and a negative output when it is intact.
For the training set, there are 5,598 shapes, of which 218 belong to micro-crack shapes and the remaining 5,380 are arbitrary patterns. These features are used to train the SVM. For the sake of completeness, the classifications are repeated using a linear discriminant analysis (LDA), quadratic discriminant analysis (QDA), and knearest neighbor algorithm (k-NN), from which the results are compared with SVM. Furthermore, the performance of each algorithm is quantitatively evaluated in terms of three measurable metrics: (i) sensitivity, (ii) specificity, and (iii) accuracy. These metrics are based on a simple measure of the true positive TP, the true negative TN, the false positive FP, and the false negative FN. Mathematically, they are defined as follows: Additionally, the geometric mean is also used in the evaluation. The value of the geometric mean will be high when both the sensitivity and the specificity are high, and the difference between them is small [25]. The use of a geometric mean is an important measure when evaluating the classifier performance, especially for the unbalanced class sizes. The geometric mean is calculated as follows: The results using the testing set are shown in Table 3. In this table, the SVM is trained with the following parameters: σ RBF = 27, C + = 390, and C − = 19. Clearly, from Table 3, the SVM classifier outperformed LDA, QDA, and k-NN in term of sensitivity, accuracy, and G-Mean assessment metrics. Overall, less than 3% of defected cells are misclassified, and more than 80% of good cells are correctly classified. However, the k-NN classifier performed best in the classification of good cells with 88% specificity. Nevertheless, the SVM produces the highest G-Mean, indicating that the error in misclassification of this algorithm is consistently low. Therefore, SVM is overall the best classifier for this type of application.
For completeness, SVM experiments were repeated using FD, GFD, and RCF shape descriptors, and the results   are also given in Table 3. Clearly, ART outperformed other shape descriptors in all assessment metrics. This again demonstrated that ART gives the best discriminating ability when dealing with this type of shape classification problem compared to other shape descriptors. In addition, the average processing time for each EL image is approximately 4.1 s which is comparable to the semi-manual inspection by a human expert. Meanwhile, the smallest micro-crack detected by the proposed algorithm is 47 pixels in size which physically corresponds to 6.22 mm in length.

Conclusions
The early detection of micro-cracks in solar cells is important in the production of PV modules. In this study, an image processing scheme composed of segmentation procedures based on anisotropic diffusion and shape classification is presented. The results show that the segmentation procedures can detect and identify micro-crack pixels efficiently in the presence of various forms of noise. The anisotropic diffusion filtering with gray level-based diffusion coefficient proposed in this study produced excellent enhancement and improved segmentation. The advantage of this filtering technique is its ability to enhance the pixels with low gray scale and high gradient such as the microcrack defects in solar cell. Trained with SVM using 240 samples, this artificial classifier produced a correct classification rate of consistently higher than 88% with average sensitivity and specificity of 97.7% and 80.2%, respectively. These results are very promising as it demonstrates a first attempt of integrated image processing and machine learning platform toward its eventual application of micro-crack inspection of solar cells.