Automatic Image Analysis of Stackingfault

3C silicon carbide is a semiconductor with remarkable properties, making it ideal for the development of long lasting devices, working in harsh environments and under high particle flows. The most significant obstacle to its wider diffusion is the presence of extended, bidimensional and linear defects in its crystal lattice. The purpose of this research is to automatically recognize defects from a TEM image by algorithm that calculates distances and angles.


Introduction
Such defects can be classified as Dislocations (D) and Stacking Faults (SF) delimited by their Partial Dislocation (PD). Eliminating the defects in crystal is one of the biggest challenges that could allow the material to be used in microelectronic industries [1][2][3][4][5]. The transmission electron microscope (TEM) image allows to an expert researcher, to obtain visual information about the structure of the defect [6]. Nevertheless the process takes a long time for each single image, often without providing any quantitative information.
In order to analyze this kind of high resolution images, there are different approaches in literature. The segmentation techniques aims to simplify and change the representation of the image in such a way it becomes more meaningful and easier to analyze [7,8] and it is generally used to identify objects and borders (lines, curves). More precisely, image segmentation is the process of assigning a label to each pixel of an image, so that the pixels with the same label share certain characteristics [9]. Thus, the result of image segmentation is a set of segments (or points) that collectively cover the entire image, or a set of outlines extracted from the image.
The identification of the defect zone can be difficult by naked eye and only an expert researcher can highlight the presence of the defect. Thus, an algorithm, based on a segmentation technique, has been created in order to discriminate defective regions according to the properties of the individual points.

Method
The first problem consists to identify the position of the silicon atoms of the crystal lattice, by digital images dm4, a format used by Digital Micrograph, a program used in transmission electron microscopy. This procedure required the use of a new algorithm, because there is no-dedicated function in MATLAB. The dm4 image is transformed into a matrix of 1024x1024 elements. Subsequently, the matrix is converted into a light density matrix by the 8-neighbour technique that attributed to the pixels of the image a new numeric value for each element of the new matrix [10]. Then, the procedure is applied several times by suppressing the neighbouring pixels with lower density. Afterward, the algorithm generates a binary matrix with null elements except those where presumably the atoms of the crystal lattice are present.
The second problem to be solved is to identify if there are areas of the matrix where the density of atoms is not uniform as in the case of a perfect crystal (PC). Submatrices are created that are compared with each other: those that differ from each other are highlighted and indicate regions where defects are present.
Consequentially, the atoms are divided into two or more sets: those of PC and those, if present, of defect zones or SFs.
In addition, for each atom the program allows to calculate the distance with the neighboring atoms and the angle of the direction formed by the joining the two neighboring atoms and the horizontal line. Figure 1a shows the theoretical distances in a PC, while Figure 1b shows the experimentally measured distances from TEM image, automatically calculated by the algorithm. Distances to neighboring atoms were calculated for each point-atom. The algorithm is a robust method for detecting the neighboring atoms of any atom within an image, for evaluating the distances and angles formed with it. Theoretical distances and angular distributions for a PC and for first level stacking faults (SF1) were identified.

Figure 1 a) Theoretical distance(Å) from every atom with his neighbors. b) Experimental distance (Å) from every atom with his neighbors
A typical result of the distributions of interatomic distances and angular directions of the first congruent neighbors is shown in Fig. 2a and Fig. 2b. In Fig. 2a the distances distributions for PC and SF1 are overlapped in the same image and it's possible to see the difference from Gaussians which does not fit with PC and SF1; in the same way in Fig.2b for angular distributions. These values could be used for the identification of local stress by comparing the experimental values with the theoretical.

284
Silicon Carbide and Related Materials 2021 Table 1 compares the theoretical values with the experimental values obtained automatically by the algorithm for PC. In particular, in the distances, we have only one experimental value which corresponds to the first two theoretical values. This effect is due to the insufficient measurement sensitivity of the image which corresponds to 0.2 angstroms. This value prevents the two values from being resolved from the atom distances distribution. Instead, the experimental angular distribution is congruent with all theoretical values. Table 1 Materials Science Forum Vol. 1062 Table 2 Table 2 compares the theoretical values with the experimental values obtained automatically by the algorithm for a SF1. Also, in this case, there is only one value for the atomic distances, with a larger error since the Gaussian distribution of the distances has a greater width at half height than in the previous case.

Figure 2 a) Overlapping distance distributions for different parts of the same image between the first neighbors b) Overlapping angular distributions for different parts of the same image between the first neighbors
As regards the angular distributions, the difference in the angles measured may depend on the stress suffered by the lattice which changes the spatial position of the atoms in the defect zone. In this regard, more statistics will have to be acquired.

Conclusions
Crystals are rarely perfect in the regularity of their lattices. Defects of structure also arise from larger scale stacking faults, where the rows of atoms get out of alignment. Image processing and classification algorithms may be categorized according to the space in which they operate. The purpose of our unsupervised algorithm is to be able to detect defects from the crystal with the segmentation technique; the process allows to divide an image into a certain number of homogeneous regions (sets of pixels). Each region is homogenous in terms of some attributes (gray level, texture, color), while adjacent regions must be different in terms of others [10]. The method of nearest neighbors , called k-nearest neighbors algorithm (k-NN), classification is carried out in a set of pre-classified examples in order to find, for each pixel, the nearest neighbors (usually the Euclidean distance is used). The algorithm is able to discriminate the points atoms, then to identify the first 8-neighbours in the PC and SF1. The analysis of the first neighbors appears to be in good agreement with the theoretical values.

286
Silicon Carbide and Related Materials 2021