Moonsoo Ra†
a,
Younggun Boo†a,
Jae Min Jeongb,
Jargalsaikhan Batts-Etsegb,
Jinha Jeong*ac and
Woong Lee*b
aLightVision Inc., 20 Seongsuil-ro 12-gil, Seongdong-gu, Seoul 04793, Republic of Korea
bSchool of Materials Science and Engineering, Changwon National University, 20 Changwondaehak-ro, Changwon-si, Gyeongsangnam-do 51140, Republic of Korea. E-mail: woonglee@changwon.ac.kr
cTRIZ Center, Hanyang University, 222 Wangsimni-ro, Seongdong-gu, Seoul 04763, Republic of Korea. E-mail: itriz@hanyang.ac.kr
First published on 29th November 2021
Investigations have been made to explore the applicability of an off-the-shelf deep convolutional neural network (DCNN) architecture, residual neural network (ResNet), to the classification of the crystal structure of materials using electron diffraction patterns without prior knowledge of the material systems under consideration. The dataset required for training and validating the ResNet architectures was obtained by the computer simulation of the selected area electron diffraction (SAD) in transmission electron microscopy. Acceleration voltages, zone axes, and camera lengths were used as variables and crystal information format (CIF) files obtained from open crystal data repositories were used as inputs. The cubic crystal system was chosen as a model system and five space groups of 213, 221, 225, 227, and 229 in the cubic system were selected for the test and validation, based on the distinguishability of the SAD patterns. The simulated diffraction patterns were regrouped and labeled from the viewpoint of computer vision, i.e., the way how the neural network recognizes the two-dimensional representation of three-dimensional lattice structure of crystals, for improved training and classification efficiency. Comparison of the various ResNet architectures with varying number of layers demonstrated that the ResNet101 architecture could classify the space groups with the validation accuracy of 92.607%.
The diffraction patterns containing the symmetry information of materials are the results of interaction between the incident beam represented by the wave vector and the samples' crystal structures reconstructed as reciprocal lattices, generating geographic relations between the beam direction, sample orientation, and particular crystallographic planes.3 Additionally, there exist selection rules determining which crystallographic planes should be absent in the diffraction patterns.3 Analysis of the diffraction data and extracting the crystallographic information from them inevitably require in-depth knowledge of crystallography and expertise as well as experiences. Although a high-throughput diffraction measurement method has been developed,4 analyzing diffraction data for materials characterization is still a time-consuming task even for expert crystallographers.
When any work requires high level of expertise including many years of experiences and complicated processes, it can be facilitated with the aid of computers. In the field of crystallography, computer-aided techniques have been in use especially when analyzing XRD or SAD patterns.5–8 However, the process is not fully automated, and the analysis of diffraction data still requires guess work and computer simulations based on experiences and in-depth knowledge. If the material of interest is an unknown type as happens in the development of novel materials or if no prior material information is available, the process becomes more complicated. Recent advances in artificial intelligence (AI), assisted by ever-increasing computing power at lower costs, suggest possibilities of simplifying the analysis by non-experts. Deep learning techniques have been adopted to analyze domain-specific data due to its accurate prediction capabilities. More specifically, useful techniques including dropout9 and residual learning10 allow the construction of fast and accurate deep neural networks which show better performances than human in some areas.11 Concerning the diffraction patterns, recent studies include analysis of both the 1D and the 2D patterns. It has been demonstrated that convolutional neural network, coupled with large amount of powder XRD pattern data, could classify the space group, extinction group, and crystal system with the accuracy levels of 81.14, 83.83, and 94.99%, respectively using about 150000 XRD data with no feature engineering involved.12 In this work, the XRD pattern data in pristine forms were used to train a convolutional neural network (CNN). In another approach, it was possible to develop a supervised machine learning framework, which enabled the analysis of XRD pattern for the case where only sparse dataset are available.13 It has also been demonstrated that CNN and feedforward neural network (FFNN) could classify the XRD patterns with reasonable accuracies (higher than 80%).14 There was an interesting approach, in which 1D diffraction intensity profile dataset was prepared by converting 2D patterns obtained by fast Fourier transformation of the high-resolution (HR) scanning transmission electron microscope (STEM) images.15 This suggests that 2D patterns can be classified once they are converted to 1D profiles.
Attempts have also been made to classify 2D diffraction patterns. Kaufmann et al.16 have suggested two CNN models that can identify the Bravais lattice or the space group of unknown materials from their EBSD patterns with the accuracies of 93.5% and 91.2%, respectively. Ziletti et al.17 have developed a CNN-based method which used indexed diffraction pattern images to classify the lattice symmetry. In this work, they prepared dataset by superposing and color-indexing the 6 images for a material which were obtained by simulating beam diffraction incident on a virtual sample along three crystal axes. Although the images contain regular array of diffraction spots, they were different from SAD patterns (SADPs) since only three principal crystal axes were used as the beam directions (BDs) and that the diffraction patterns were color-indexed and then superposed. Since XRD, EBSD, and SAD are mutually complimentary, AI-assisted classification of SADPs would be worth exploration.
Inspired by the work of Ziletti et al., this study has been carried out for the classification of crystal symmetry in terms of the space group from 2D diffraction patterns that resemble real SADPs obtained by aligning BDs to various zone axes in transmission electron microscopy (TEM). As a starting point, the cubic system was considered. This system contains 36 space groups and covers many materials systems familiar to materials scientists and engineers.2,18 To improve the training and classification efficiency, the diffraction pattern dataset was regrouped and labeled from the viewpoint of computer vision, i.e., the way how the machine ‘sees’ the patterns. Instead of developing a dedicated DCNN architecture, a well-established off-the-shelf image classification architecture, residual neural network (ResNet),10 was adopted. For the space groups 213, 221, 225, 227, and 229, the ResNet101 model showed the prediction accuracies of 92.607%. The overall workflow is schematically illustrated in Fig. 1 together with the classification structure of the ResNet architecture.
Fig. 1 Schematics illustrating (a) the overall sequence of the crystal structure classification proposed in this study and (b) the inner working of the ResNet architecture. |
The dataset should be in a standard format with the same resolution and be available in large quantity (usually dataset consists of tens of thousands of images or more). Since these requirements cannot be met by experimental acquisition of the SADPs and/or by collection of the SADPs published in literature, the dataset resembling the TEM SADPs were generated by a computer simulation in a systemized way in this study. The material information inputs for the diffraction simulation were provided via crystal information format (CIF). The CIF files were obtained from the open database repositories Materials Project19 and AFLOWLIB.20,21 The CIF files in these repositories are experimentally obtained and/or theoretically calculated and many of them are also deposited in Inorganic Crystal Structure Database (ICSD).22 On average, 49.8 CIF files for each space group to be considered were collected and used as inputs for the diffraction simulation.
Normalization of the diffracted beam intensity was necessary since the neural network was designed to recognize relative differences in the intensities of the diffraction spots in the images. Three-dimensional Gaussian wave assumption was used to simulate the blurring of the edges of the diffraction spots in real SADPs, despite the plane-waves assumption of the incident electron beam is used in TEM diffraction theories.2,31 Use of the three-dimensional Gaussian beam was also effective in eliminating the effect of sample shapes and sizes especially when the virtual crystal is small compared with real samples used in experiments. The simulated diffraction patterns were formed as portable graphics format (PNG) images consisting of 256 × 256 pixels. This image size was chosen to minimize the computing resource requirements for image generation while enabling the meaningful recognition and classification of images by the neural network. Examples of the simulated SADPs for Si (space group 227) herein with varying BDs are shown in Fig. 2. These simulated images were comparable to the real SADPs reported in the literature28–30 in that: (i) the simulated SADPs include relative differences in the brightnesses of the diffraction spots; and (ii) individual diffraction spots have Gaussian distribution of the intensity from its center to the edge while the edge itself is blurry like the real ones, indicating that the simulation by the modified Condor was suitable to generate the SADP-like dataset.
Fig. 2 Examples of the simulated SADP-like diffraction images generated for Si (space group 227) with (a) BD = [001], (b) BD = [011], (c) BD = [111], and (d) BD = [103]. These simulated patterns were comparable to the experimentally obtained SADPs reported elsewhere28–30 (the real SADPs are not shown due to the copyright related issues). |
Fig. 3 Examples of (a) & (b) the similar diffraction patterns with the same zone axis obtained for the materials belonging to different space groups while sharing the same crystal system; (c) & (d) similar diffraction patterns with the different zone axes obtained for the materials belonging to different space groups and crystal systems; and (e) & (f) apparently different diffraction patterns with the same zone axis obtained for the materials sharing the same space group. These diffraction patterns were simulated using JEMS23 and CIF files from Materials Project19 repository. |
Concerning the adoption of the DCNN algorithm for crystal structure classifications, the axiom is that what is indistinguishable to humans is also indistinguishable to machines. Therefore, grouping the diffraction pattern data by the space group and the zone axis (or BD aligned to it) and labeling them accordingly is not suitable to train the neural network, not to mention the humans, if it is intended that the data be classified only through the images without any knowledge of crystallography and geometry and any information regarding the material system of interest. What the machine does is to sort and classify the input data only by the ‘appearance’, viz. pixel by pixel information. Therefore, necessity arises as to how the diffraction patterns should be regrouped and labeled to train the DCNN architecture. This regrouping and labeling scheme will be referred to as ‘dataset class labeling’ hereinafter.
The dataset class labeling scheme herein is based on how the diffraction patterns ‘look’ to human as well as to the machine. Noting that the diffraction pattern is the 2D periodic array of the diffraction spots, one may expect that the diffraction patterns can be matched to five 2D lattice systems dealt with in crystallography.32 Accordingly, the diffraction patterns are regrouped to four of these five systems, namely square primitive (square, category A), rectangular primitive (rectangle, category B), hexagonal primitive (rhombus, category C), and oblique primitive (parallelogram, category D). Rectangular centered system was merged to oblique primitive lattice since the former can also be described as the latter.
In the cubic crystal system, the SADPs for the 〈100〉 zone axis are square and those for the 〈111〉 zone axis are hexagonal. On the other hand, those for other zone axes will be rectangular or parallelogrammatic with varying side lengths and angle between the sides depending on the zone axes. When an SADP forms a rectangular primitive lattice, its zone axis can be identified by the relative lengths of two intersecting sides. This length ratio can be represented by the angle between a diagonal and a principal axis as illustrated with an example SADP in Fig. 4a. Hence, this angle can be used to identify whether two (or more) patterns look the same or different. If an SADP forms an oblique primitive lattice, differences in zone axis will be reflected in the relative lengths of two intersecting sides of the primitive cell and the angle between them. The parallelogram can be partitioned into two triangles, and the two angles of a triangle, namely ∠BOA and ∠OAB in Fig. 4b shown with an example SADP, can represent the geometric features of the parallelogram. Once the sequence of these two angles is also included, they can be used to distinguish zone axis of a diffraction pattern including the chirality. While the diffraction spots form specific regular arrays, they can show difference in intensities (brightnesses). Often, some of the diffraction spots are absent depending on the combination of the Miller indices for a plane (h, k, and l), which also possesses some regularity. This feature can also be used to classify the dataset. Now, there are three criteria for the dataset class labeling. First, the arrangement of diffraction spots in the SADPs are used to assign any pattern to four primary groups classified as A, B, C, and D by the primitive lattice shapes as mentioned above. Next, the angle information described above is used to subdivide the primary group into sub-groups. These sub-groups are designated by numbers following the primary group designation characters. Finally, the sub-group is partitioned in accordance with the patterns of the absence and the relative intensities of the diffraction spots. These partitions are denoted as numbers following a hyphen. One example of these regrouping and labeling scheme is illustrated in Fig. 5.
As a result of the application of the above labeling scheme, the number of dataset classes decreased substantially. For the example shown in Fig. 5, there can be 15 dataset classes by crystallography. Compared with this, regrouping by using the 2D-pattern-based dataset labeling scheme reduced them to 9 dataset classes. This decrease helps improving the training efficiency of the neural network, because confusing classes (space groups 225 with BD = [001] and 227 with BD = [001] for example) due to the indistinguishable diffraction patterns are merged into the same new class label (A1-0 in this example case). Now the neural network can compare the input SADPs obtained for several zone axes with the regrouped class labels. Combinations of the regrouped class label will lead to a specific space group by the ensemble of the probability result for each SADP. This procedure is further discussed in 3.2. For the five space groups considered in this study (in fact, the space group 227 may contain 3 effective space groups based on the SADPs considering the brightness of the diffraction spots), the SADPs were generated with respect to 16 zone axes. In terms of crystallography, this leads to 112 dataset classes. However, once the 2D-pattern-based dataset class labeling scheme herein is applied, this was reduced to 60. It is emphasized that this is not only a simple reduction in number but also a dataset restructuring with the dataset labeling scheme as stated in this section for efficient classification to be performed by the ResNet architectures!
To train the ResNet architectures, two paradigms can be considered. One is the training from scratch, in which the neural network starts to update the model weights from randomly initialized weight and uses mostly target dataset (simulated SADPs) during the training process. The other is the fine-tuning, in which the neural network starts to update the model weights from the existing model, called pre-trained model, that was trained to solve different problems.34,35 Typically, pre-trained model is trained on a large-scale dataset containing over 10 million images such as ImageNet.36 The basic idea of fine-tuning is that the ability of a pre-trained model to generate visual representations helps improve the performance of the target application. Since renowned deep learning frameworks (e.g., TensorFlow,37 PyTorch,38 Caffe,39 etc.) provide pre-trained models for the off-the-shelf architectures, it is better to utilize pre-trained models and fine-tune the neural networks instead of training them from scratch.
During the training process, weights of the ResNet architectures were updated through the stochastic gradient descent (SGD) algorithm40 with iterations. A key difference between the SGD and the ordinary gradient descent is that the SGD only considers a random subset of data at one iteration. Therefore, a concept of epoch is utilized to indicate how many times the network sees the entire dataset during the training. For comparisons between the ResNet architectures, identical hyper parameters for SGD are utilized such that: (i) initial learning rate was set as 0.001; (ii) learning rate was decreased by a factor of 0.1 for every 7 epochs; (iii) momentum of the SGD was set as 0.9; and (iv) iteration of the SGD for 25 epochs. All the ResNet architectures were trained to classify 60 regrouped dataset classes and the resulting validation accuracies and the average GPU runtime are summarized in Table 1. Even though the dataset class labeling makes the space group classification task easier, the simplest ResNet architecture (ResNet18) showed the accuracy of only 84.9%. However, as the size of the architecture (or number of parameters) increases by increasing the number of layers, the accuracy of the architecture improved to 92.6% for the ResNet101. Further increasing the number of layers to 152 did not lead to higher accuracy. This result indicates that trained ResNet152 network formed overly complex classification boundaries and some input data were misclassified through the network.
Architecture | Accuracy | # of parameters | Avg. GPU runtime |
---|---|---|---|
ResNet18 | 84.946% | 11.2 M | 0.0821 ms |
ResNet34 | 88.607% | 21.3 M | 0.1395 ms |
ResNet50 | 90.339% | 23.6 M | 0.1711 ms |
ResNet101 | 92.607% | 42.6 M | 0.3123 ms |
ResNet152 | 92.393% | 58.5 M | 0.4468 ms |
The ResNet-based space group classification system developed in this study is designed to utilize the training dataset which was prepared by the way how the neural network (and human) recognizes the diffraction patterns without prior knowledges of materials science. Both the machine and non-expert human recognize the diffraction patterns as regular and periodic arrays of diffraction spots in two-dimensional plane since the diffraction pattern is the 2D representation of 3D reciprocal space with appropriate selection rules. Hence, regrouping the SADPs in accordance with similarities in 2D patterns would be useful to train both the machine and non-expert human by eliminating the necessity to ‘learn’ crystallography in detail.
Since the regrouped dataset classes are smaller than the crystallographic dataset classes, inevitable ambiguity arises when a single SADP corresponding to one zone axis is used to classify the space group through the proposed system. However, the space group classification system herein can ensemble the results from multiple SADPs with varying zone axes to produce a more certain classification result. For example, suppose that an SADP with BD = [001] of Mg belonging to the space group 225 is to be classified. Considering the indistinguishability of the [001] zone SADPs of the materials having cubic symmetries, the ResNet-based classification system herein can only predict that the material of concern—the machine does not have any prior knowledge of the material—belongs to the space groups 221, 225, 227, and 229 with the equal probability of 25%. Among the space groups considered in this study, the space group 213 has different SADPs for the same BD and therefore it is excluded from the candidate. Suppose again that an additional SADP with BD = [103], which is unique to each space group (it differs from space group to space group due to detailed arrangement of lattice atoms in the unit cells), is provided. Now, the ResNet system predicts that the material belongs to the space group 225 with the probability of 62.5% and to the other space groups with 12.5% probability each, by combining the prediction results from two SADPs with BD = [001] and BD = [103]. This classification scheme is graphically shown in Fig. 7. In fact, any non-expert human can do the same with suitable image classification training using the training dataset without the knowledge of crystallography; however, it should be noticed that the training dataset for the 5 space groups considered in this study alone consists of more than 60000 SADPs while there are 36 space groups in the cubic system, not to mention the 230 space groups altogether. In this probability ensemble scheme, the key is that at least one SADP which is unique to a target space group helped the ResNet system properly classify the space group. Therefore, it should be noted that the ResNet architectures trained with more dataset class labels may perform better especially when each space group is matched to a class label that is unique to it.
Fig. 7 Schematic illustrating the space group classification system based on the probabilities and the ensemble of the results. |
At this point, it is worth mentioning that there have been some works which enabled the prediction of crystal structure of a material without using the diffraction data.41 In this approach, all the material systems listed in the Materials Project repository were used as the dataset. Such a scheme will be useful if one tries to find the crystal structure of a material with known chemical formula. On the other hand, if a novel material has been synthesized or if one does not know the exact chemical formula of a material as happens in the case of observing unknown precipitates in alloy systems, diffraction-based classification will be useful. What is more, the ResNet-based system in this study required only 49.8 CIFs for each space group to train and validate it. In other words, in the diffraction-based approaches, it is not necessary to have all the materials data to train the neural network system.
Further limitations of the current work are expected when it comes to the analysis of real experimental SADPs. The SADPs to train the ResNet architectures were generated by simulation under an implicit assumption that the diffraction occurs under ideal conditions. This is obviously not the case in real TEM electron diffractions since the samples may contain defects and the instrumental conditions of the electron microscopes may vary from machine to machine. This being the situation, it is hard to expect that the ResNet architecture herein can handle the experimental SADPs properly. However, as mentioned in the Dataset section, training the ResNet architecture using the real patterns is practically impossible. It is thus suggested that a way to bridge the gap between the real and the simulated diffraction patterns should be adopted. One possible approach would be the use of the image-to-image translation algorithm42,43 which can convert the experimental data into what appears to be the simulated data. Since this approach requires collection of the real SADPs to train the image-to-image translation algorithm, it is left as a future work. Another challenge to the neural-network-based classification of the diffraction patterns is whether the machine can analyze the polycrystalline crystals and/or the materials containing defects such as dislocation and stacking faults that affect the diffraction patterns substantially.44 No work has reported the classification of the SADPs for these cases so far. It would be therefore a great contribution to the materials community if any method to deal with this problem is developed.
Footnote |
† These authors equally contributed as the first authors. |
This journal is © The Royal Society of Chemistry 2021 |