Nanoscale light element identification using machine learning aided STEM-EDS

Light element identification is necessary in materials research to obtain detailed insight into various material properties. However, reported techniques, such as scanning transmission electron microscopy (STEM)-energy dispersive X-ray spectroscopy (EDS) have inadequate detection limits, which impairs identification. In this study, we achieved light element identification with nanoscale spatial resolution in a multi-component metal alloy through unsupervised machine learning algorithms of singular value decomposition (SVD) and independent component analysis (ICA). Improvement of the signal-to-noise ratio (SNR) in the STEM-EDS spectrum images was achieved by combining SVD and ICA, leading to the identification of a nanoscale N-depleted region that was not observed in as-measured STEM-EDS. Additionally, the formation of the nanoscale N-depleted region was validated using STEM–electron energy loss spectroscopy and multicomponent diffusional transformation simulation. The enhancement of SNR in STEM-EDS spectrum images by machine learning algorithms can provide an efficient, economical chemical analysis method to identify light elements at the nanoscale.

In a multi-component material, light elements determine the physical, chemical, mechanical, and electrical properties of the material; hence, alloying with light elements can be exploited for many applications. For example, the microstructure and phase stability in ferrous alloys are strongly dependent on the addition of a small amount of C and/or N (~ 1 wt%), which in turn dramatically changes their mechanical properties and corrosion resistance [1][2][3][4][5] . In addition, the distribution/concentration of light elements at the nanometer scale substantially affects the phase formation, which determines the performance of the material 6,7 . Therefore, analytical characterization techniques, strengthened by both a robust detection limit and nanometer spatial resolution, are required for researching and manufacturing materials with enhanced properties.
Analytical techniques such as scanning transmission electron microscopy (STEM)-electron energy loss spectroscopy (EELS) and 3D atom-probe tomography (3D-APT) have been widely used to characterize the chemical composition or a phase structure of materials due to their excellent detection limits (0.005-0.1 at% 8-10 and 0.001 at% 11,12 , respectively) and spatial resolutions (0.1 nm 13,14 and 0.2-0.4 nm [15][16][17][18] , respectively). In spite of these strengths, these techniques have some drawbacks. For example, large background EELS signals that stem from multiple scattering appear in the tails of the zero-loss peaks, resulting in a reduction in sensitivity 19 . Consequently, chemical composition results are substantially affected by the thickness of samples when using STEM-EELS. In addition, the wider usage of 3D-APT in nanoscale characterization is limited owing to the necessity of using small analytical volumes (~ 10 × 10 × 100 nm) 20,21 , the difficulty of sample preparation, and the production of local magnification artifacts caused by evaporation field-induced compositional variations 16,22 .
In contrast, STEM-energy dispersive X-ray spectroscopy (EDS) allows a detection limit as small as 0.05 wt% 23 with nanometer spatial resolution (< 2 nm) 24,25 and adequate efficiency of both time and cost for chemical quantification. However, the detection limits of light elements are insufficient, since less characteristic X-ray signals are generated by light elements owing to the lower number of orbiting electrons. This results in a smaller sample signal compared to the noise signal. This lower signal-to-noise ratio (SNR) restricts light element identification by Figure 1 shows SEM images of the microstructures of HNS specimens aged at 900 °C for 10 3 , 10 4 , and 10 5 s. Trigonal Cr 2 N precipitates [61][62][63] were observed in the micrographs as bright white regions at the grain boundaries and within the grain with a lamellar structure. In the specimen aged for 10 3 s (Fig. 1a), a cellular type of Cr 2 N began to form within the grains, and the volume fraction of cellular Cr 2 N increased with the aging time (Fig. 1b,c). The precipitate embryos grow by consuming other embryos or constituent elements around them, resulting in the formation of a region depleted of specific elements around the precipitate. However, the depletion zone of light elements such as N is not easily detected by conventional STEM-EDS technology because the SNR is too low. We attempted to overcome this detection limit by reducing the noise signals using unsupervised machine learning algorithms. First, the elemental distribution around the Cr 2 N precipitate was investigated using STEM-EDS. Then, the noise signals in the spectral images were reduced by combining several unsupervised machine learning algorithms. Finally, by comparing the noise-reduced STEM-EDS, EELS, and simulation results, the depletion zone of light elements was confirmed. Figure 2 shows the high-angle annular dark-field imaging (HAADF)-STEM and EDS mapping images of a typical precipitate in the HNS sample aged at 900 °C for 10 3 s. The precipitates had a cellular morphology and width of 100-150 nm. The EDS maps show that the main components of the precipitate and matrix were Cr and Fe, respectively (see Fig. 2b,c, respectively). There was minimal Fe in the precipitate, while Mn, N, and Mo were all present (Fig. 2d-f). The concentration of Fe atoms in the precipitate was less than 5% of that in the matrix (for details, see Fig. 3a), which suggests that the precipitate does not overlap with the matrix alloy, or is placed on a very thin matrix layer that can be considered negligible. Thus, the characteristic X-ray signals of Mn and Mo within the precipitate, as shown in Fig. 2e,f, respectively, do not result from the matrix alloy but from the precipitate itself. The concentration of Mn atoms within the precipitate was smaller than that within the matrix, while the concentration of Mo atoms was greater. The morphology and width of the precipitates and the respective distribution of each element (including each element's concentration) were similar to that in the samples aged for 10 4 and 10 5 s (see Supplementary Figs. S1 and S2 online).
For more quantitative analysis, the EDS concentrations of each element were profiled along the red lines in Fig. 3a 30 . Within the precipitate, the Cr and N concentrations were approximately 71 and 4 wt%, respectively, regardless of the aging time. However, the Cr and N concentrations around the precipitate, i.e., in the depletion region, were dependent on the aging time. In the sample aged for 10 3 s, a Cr-depleted zone was observed around the precipitate, with a minimum Cr concentration of 13 wt% (adjacent to the precipitate; see the left inset of the composition line profile in Fig. 3a for details), while no such reduction in Cr concentration was observed for the samples aged for 10 4 or 10 5 s (see the left insets in Fig. 3b,c, respectively). This difference is likely to result from the diffusion of Cr atoms from the matrix to the region around the precipitates in the samples aged for 10 4 and 10 5 s. Nevertheless, this does not explain the absence of an N-depleted region in the sample aged for 10 3 s (right inset in Fig. 3a), because the interstitial diffusion of N atoms is faster than that of the other substitutional elements. Considering the low concentration of N in HNS, it is conceivable that the flat concentration profile resulted from difficulties in distinguishing N signals and noise.
To investigate the presence of the N-depleted region around the Cr 2 N precipitate, the noise signals of the SIs were reduced using the SVD and ICA algorithms. The EDS maps were reconstructed using only a few principal components following decomposition using the SVD and ICA [64][65][66] and selected based on a knee-point detecting algorithm 67 (for details, see Supplementary Figs. S3-S5 online). Figure 4 shows the reconstructed EDS maps of the samples aged for 10 3 , 10 4 , and 10 5 s. The Cr, Fe, and Mn elemental maps do not differ much from the original maps. This suggests that the principal components selected based on the knee-point algorithm provide enough information to represent most of the variation of the characteristic X-ray signals, while also reproducing the elemental configuration. However, where the element had a relatively small concentration, such as N and Mo, the SNR of the elemental maps was considerably enhanced by the noise reduction process (for details, see Supplementary Fig. S6 online). The magnitude of characteristic X-ray signals from the majority elements (Cr, Fe, and Mn) is sufficiently higher than that of the noise signals; therefore, reduction of the noise signals has a negligible effect on the original spectral data. The opposite was observed for N and Mo, where the original SNR was much lower.
To confirm whether the remarkable SNR enhancement in the N and Mo spectral data would reveal the presence of the N-depleted region, we re-examined the compositional line profiles of the precipitate and surrounding area. In order to make a fair comparison with the line profiles in Fig. 3, the concentrations of each element were profiled at exactly the same position and width, as shown in The resulting compositional line profiles of all elements except N were equivalent to those from the original spectral images. However, an N-depleted region was clearly revealed in the sample aged for 10 3 s following noise reduction, as shown in the right inset in Fig. 5a. The width of the Cr-and N-depleted regions were almost identical at 70-100 nm, indicating that the diffusions of Cr and N atoms were considerably correlated. Additionally, the minimum Cr concentration in the depletion region was 13 wt% (adjacent to the precipitate), which coincides with the result obtained from the line profile in Fig. 3a, while the minimum N concentration was 0.01 wt% (adjacent to the precipitate). Compared to the Cr and N It is almost impossible to quantify the detection limit in EDS images because of the discontinuity of the characteristic X-ray signals; therefore, we evaluated the degree of enhancement for the detection limit of EDS images by calculating the SNR ( Table 1). The EDS mapping images of abundant elements like Cr, Fe, and Mn  www.nature.com/scientificreports/ were slightly or negligibly enhanced, but those of sparse elements like Mo and N were drastically improved on the SNR (or the detection limit), with improvements of 470% and 44%, respectively. We performed EELS analysis of a Cr 2 N precipitate to validate the EDS results. The EELS elemental maps of Cr and N (Fig. 6a,b, respectively) provide information about the Cr-and N-depleted regions, with these regions being clearly recognized in the line profiles (see Fig. 6c and Supplementary Fig. S11 online). To compare the Cr and N EELS line profiles, the intensity of the N profile was adjusted to that of the Cr profile by multiplication with an appropriate value. Interestingly, the depletion regions of Cr and N coincided precisely, as shown in Fig. 6c. Both regions had a width of approximately 70-100 nm, which is the same as the width of the depletion regions obtained from the EDS results (Fig. 5a). This confirms that the noise reduction achieved by the proposed technique successfully increases the SNR without loss of information from the original signals. In general, the efficiency of EELS analysis in terms of both time and cost is inferior to that of EDS analysis. In addition, to eliminate the effect of sample thickness on the EELS signals, the plural scattering signals must be removed from raw EELS data, with the risk of distorting the spectra. From this perspective, EDS analysis with machine learning algorithms is more effective than EELS for detecting light elements.
To better understand the reason behind the similar widths of the N-and Cr-depleted regions, we explored the diffusional dynamics of each element, i.e., Fe, Cr, Mo, Mn, and N, using numerical simulations to solve the diffusion equation. The simulation results are summarized in Fig. 7. The austenite and Cr 2 N phases are both thermodynamically stable at 900 °C. Hence, the direction in which the interface moves is related to the equilibrium fractions of Cr 2 N and austenite. Figure 7b-f show the concentration profile changes for each element in the whole system at different times. The element concentrations change abruptly at the interface of the two phases. Fe, Cr, and N have relatively large concentration gradients at the submicron scale when the heat treatment is less than 10 3 s. This means that the probability of observing Cr-and N-depleted regions in the sample aged for 10 3 s is higher than that in the samples aged for longer than 10 3 s. Additionally, the simulation results coincided with the EDS and EELS experiments. It is important to note that, over time, the gradient of N is similar to that Table 1. Signal-to-noise ratios (SNRs) calculated for energy dispersive X-ray spectroscopy (EDS) elemental mapping images before and after noise reduction (NR).  www.nature.com/scientificreports/ of Cr (Fig. 7c,f, respectively), which could be attributed to the chemical potential effect caused by the Cr concentration gradient in the matrix. This happens despite the diffusion coefficient of N being approximately five orders of magnitude higher than that of other substitutional elements. These diffusional dynamics induced by the chemical potential effect force the width of the N-depleted region to correspond with the Cr-depleted region. The compositional profile of alloying elements near the precipitate is essential for understanding the evolution of the precipitate. However, it is difficult to measure the profile of light elements such as N. Machine learning algorithms, such as SVD and ICA, can successfully reveal not only Cr deficiency but also N deficiency, which is regarded as the primary reason for degradation of various mechanical and corrosive properties, around the Cr 2 N precipitates that form in HNS. The physico-chemical properties of steel alloys depend on the distribution of precipitates. Therefore, an advanced analysis of the distribution of precipitates is important for the design of high-performance steels. The precise detection and analysis technique suggested in this study can be utilized in a comprehensive interpretation of the evolution kinetics of nanometer-sized precipitates containing light elements, and consequently can result in the design of an optimum thermal treatment process.

Conclusions
The combination of two unsupervised machine learning algorithms, i.e., SVD and ICA, successfully reduces the noise signals in EDS images and therefore increases the SNR of images. The N-depleted region around the Cr 2 N precipitate, which was concealed by noise signals in the original EDS data, was revealed using this technique. This is significant owing to the difficulties of noise separation and removal through normal signal processing methods. The Cr-and N-depleted regions were only observed in samples aged for 10 3 s when using our proposed method. The widths of the Cr-and N-depleted regions were equal, ranging from 70 to 100 nm. This consistency was validated using EELS. Simulations provided further evidence for the diffusional dynamics that explain how N, with lighter and faster diffusion, follows the depletion behavior of Cr. Both the simulation and EELS results support our method as a feasible and useful way of increasing the SNR in spectral images of different natures, including EDS and EELS. The work reported in this study can be viewed as a potential way of identifying light elements, such as N, from EDS experiments, in a more efficient way than that of EELS experiments. Other popular decomposition methods, such as non-negative matrix factorization (NMF), also provide the same results suggested in this work (see Supplementary Fig. S12 online). Thus, it is valuable to explore and compare different multivariate analysis algorithms for identifying light elements, which we will explore in future work.

Methods
Sample preparation. The HNS was a commercial P900NMo alloy (manufactured by VSG, Essen, Germany) with a composition of Fe bal. -17.94Cr-18.60Mn-2.09Mo-0.89N-0.04C (in wt%), which is a modified version of P900 (DIN 1.3816) with higher Mo and N concentrations. Specimens (12 × 10 × 4 mm) were cropped from the hot-rolled plate, encapsulated in an evacuated quartz tube, solution-treated at 1,150 °C for 30 min, and water-quenched. The resulting specimens were isothermally aged at 900 °C for 10 3 , 10 4 , and 10 5 s under Ar, followed by water-quenching. At this aging temperature, Cr 2 N formation is facilitated while the formation of other www.nature.com/scientificreports/ precipitates is retarded (e.g., σ phase) 50,61,68,69 . After isothermal aging, the microstructure for each specimen was analyzed using SEM (JSM-7100F, JEOL, Japan). For this analysis, the aged specimens were mechanically ground with SiC abrasive papers to 2,400 grit, mechanically polished using a diamond suspension with a particle size of 1 μm, and chemically etched in a glyceregia reagent (10 mL nitric acid, 20 mL hydrochloric acid, and 30 mL glycerin) at 25 ± 1 °C for 1-2 min followed by rinsing with water and drying in air.

Electron microscopy analysis.
To investigate the elemental configuration changes and aging time of the depletion region using STEM-EDS, samples with different aging times were prepared using a focused ion beam (FIB; Helios NanoLab 600, FEI, US) lift-off milling technique. The Cr 2 N precipitates were observed using TEM (Talos F200X, FEI, US) at an accelerating voltage of 200 kV (Schottky X-FEG gun) and equipped with a Super-X EDS system comprising four windowless silicon drift detectors (SDDs) in STEM mode with a probe current of ~ 0.7 nA. To guarantee a high enough SNR, the EDS mapping data was collected through a spectrum imaging form for 60 min with a 20 ms/pixel dwell time. This large dwell time also allows the Bremsstrahlung background subtraction based on a simple and widely used two-window method. The windows for each element (Cr, Fe, Mn, N, and Mo) are denoted in Supplementary Fig. S13 (online). After the background removal, we quantified the composition of each element in the HNS samples using this spectrum imaging data based on the conventional Cliff-Lorimer method with k-factors provided by the manufacturer (Bruker). EELS signals were obtained using a Quantum 966 (Gatan, USA) spectrometer attached to a Cs-corrected microscope (Titan 80-300, FEI, Netherlands), with an energy resolution of 0.8 eV for 0.01 eV/channel energy dispersion. The convergence semi-angle for the incident beam was 36 mrad, with an EELS collection semi-angle of ~ 50 mrad.
Noise reduction using machine learning algorithms. To reduce the noise signals in the STEM-EDS images, principal component analysis (PCA) and ICA, which are machine learning algorithms for dimensional reduction, were performed using the HyperSpy package 70 , written in Python. The noise-reduced EDS mapping images were obtained by the following three steps: (1) decomposition of the multivariate X-ray signals using the SVD algorithm; (2) independent component analysis; and (3) reconstruction of de-noised EDS maps. For the PCA, the spectral energy information of each pixel in the spectral images obtained by STEM-EDS was decomposed using the SVD technique. Spectral image with spatial dimensions of 1,024 × 1,024 and an energy dimension of 4,096 was decomposed by computing the SVD as follows: where M is a 1024 2 × 4,096 spectral image matrix, U is a 1024 2 × 1024 2 factor matrix vector, Σ is a diagonal 1024 2 × 4,096 eigenvalue matrix with non-negative values, and V T is the conjugate transpose with a 4,096 × 4,096 loading matrix vector. In terms of matrix factorization, the factor and loading matrix can be expressed as follows: Then, in view of eigenvalue decomposition, U and V, which are eigenvectors of MM T and M T M, respectively, can be calculated by solving the eigenvalue characteristic equations: where λ represents the eigenvalues and x the eigenvectors, which can be transformed to the U and V matrices. Consequently, the principal components were derived with ΣV T . Since the noise signal is subject to the Poisson distribution due to the uncertainty of electrons, the Poissonian noise normalization method was adapted into all of the decomposing processes. Then, the ICA, known as blind source separation [64][65][66] , was performed using the FastICA algorithm 71 embedded in the HyperSpy package to enhance the physical correlation between the principal components. As the factor matrix was derived from the SVD calculations, FastICA was used to find a maximum of the w T U non-Gaussianity, where w is the weight vector. To do this, an initial weight vector was randomly selected, and the vector matrix was recalculated until it converged, as shown in the following equation: where E{x} is the variance of the x matrix and g(x) is the derivative of the non-quadratic function. Finally, the independent components were obtained by multiplying w and U. The independent components with high eigenvalues that represent most variances were used for the reconstruction of the de-noised EDS mapping images. www.nature.com/scientificreports/ This was conducted using a PCA scree plot and a knee-point detecting approach 67 (for details, see the PCA scree plots, signals, and maps of the independent components in Supplementary Figs. S3-S5 online).
To evaluate the SNR of the spectral images, the coefficient reciprocal of the variation calculation method 72 was adopted. Briefly, for each element constituting the Cr 2 N precipitate, appropriate ranges of energy in the spectral images were summed. Then, given images containing intensities of the elemental signals, the SNR was calculated as follows: where µ is the expected value of the intensities of signals in the image, and σ is the standard deviation of the noise. This method has been widely used for SNR quantification in the field of image and signal processing 73-75 . Multicomponent diffusional transformation simulation. Cr 2 N precipitate growth was simulated using multicomponent diffusional transformation (DICTRA module, Version 2018a, Thermo-Calc. Software AB, Sweden) 76 software using thermodynamics (TCFE7.0) and mobility (MobFe2) databases [77][78][79] . This software obtains a numerical solution of the diffusion equation at the local equilibrium in the phase interface. Assuming there is no difference in the chemical potential at the interface between the matrix (austenite) and precipitate (Cr 2 N), the alloying element concentration at the interface can be evaluated from the thermodynamic equilibrium. The rate of phase transformation was controlled by the rate of the incoming or outgoing diffusional flux of elements. The software can simulate the growth process of the Cr 2 N precipitate in austenite assuming diffusioncontrolled growth by solving equations of thermodynamic phase equilibrium, flux balance, and diffusion. The conservation of mass leads to the following flux balance conditions at the moving interface between the austenite matrix and Cr 2 N precipitate: where V is the interface migration rate, C austenite k and C Cr 2 N k are the concentration of species k in austenite and Cr 2 N close to the interface, respectively, and J austenite k and J Cr 2 N k are the diffusion flux in austenite and Cr 2 N, respectively. These can be expressed according to Fick's first law of diffusion 77 : where n is the number of elements, D n kj is the diffusion coefficient of the matrix, and ∇C j is the concentration gradient for element j.
The growth of the Cr 2 N precipitate was simulated using the moving boundary model of the DICTRA software. It was assumed that the austenite and Cr 2 N phases are separated by a planar boundary, and that thermodynamic equilibrium exists locally at the interface. Initial conditions were set where 1 nm of Cr 2 N is bound by a 2 μm layer of austenite. The initial Cr 2 N composition was assumed to be the same as the thermodynamic equilibrium results at 900 °C. The austenite composition was set as Fe bal. -18Cr-18Mn-2Mo-0.9 N (wt%). The concentration was calculated for 20 uniform points within Cr 2 N and 200 uniform points within austenite. The transition of the interface and the concentration profiles at the interface were calculated for the sample aged at 900 °C for 10 4 s.

Data availability
The datasets generated during and/or analysed during the current study are not publicly available due to preparing another study and patent but are available from the corresponding author on reasonable request.