Similarity measures

The spectra of interest are the Mn2+ L 2,3 XAS or EELS spectra of MnO obtained from both calculations and experiments. The similarity measures can be defined by using various distance metrics. A distance is a metric that represents how far apart objects are. When the distance between vector x and y is written as d(x, y), d is known as the distance function, and the following conditions are satisfied:32

$$d(x,y) \ge 0,$$ (1)

$$x = y \Rightarrow d(x,y) = 0,$$ (2)

$$d(x,y) = d(y,x),$$ (3)

$$d(x,y) + d(y,z) \ge d(x,z).$$ (4)

The similarity s and the distance d are related as s = 1 − d, when d is normalised in the range [0, 1]. In general, distances are normalised by using their value range; in this work, normalisation was achieved by using the maximum distance estimated by the physical constraints. The crystal field parameter 10 Dq is the difference between the energy levels originating from the breaking of degeneracies of electron orbital states. The maximum value of 10 Dq can be extracted from physical properties such as the atomic number and the crystal structure. Including the physical constraints, the value of 10 Dq can be normalised and included as a metric of which the value is not limited by a maximum AND/OR minimum.

This study evaluated the following distance functions: the ED, city block distance (CD), cosine, Jensen–Shannon divergence (JSD), Pearson's correlation coefficient (PCC), dynamic time warping (DTW), and earth mover’s distance (EMD). DTW and EMD require a base measure, and the Manhattan distance was employed in this work.

Let x and y be n-dimensional vectors represented by x = (x 1 , x 2 ,...,x n ). The definitions of the metrics that were used are as follows.

The ED and CD are special cases of the Minkowski distance (p = 2,1):

$$d_{{\mathrm{Minkowski}}}(x,y) = \left( {\mathop {\sum}\limits_{i = 1}^n | x_i - y_i|^p} \right)^{{1}/{p}}.$$ (5)

The cosine metric represents the cosine of the angle of vector x and y in n-dimensional space; it is constant against changes in the length of the vectors because the cosine metric is robust to intensity changes of the whole spectrum:

$$d_{{\mathrm{Cosine}}}(x,y) = \frac{{\mathop {\sum}_{i = 1}^n {x_i} y_i}}{{\mathop {\sum}_{i = 1}^n {x_i^2} \mathop {\sum}_{i = 1}^n {y_i^2} }}.$$ (6)

Pearson’s product–moment correlation coefficient (PCC) is similar to the cosine metric; it is the cosine between the vector x and y, and their means:

$$d_{{\mathrm{PCC}}}(x,y) = \frac{{\mathop {\sum}_{i = 1}^n {(x_i - \bar x)} (y_i - \bar y)}}{{\mathop {\sum}_{i = 1}^n {(x_i - \bar x)^2} \mathop {\sum}_{i = 1}^n {(y_i - \bar y)^2} }}.$$ (7)

JSD is one of the metrics representing the distance between probability distributions, and it is a modification of the Kullback–Leibler divergence (KLD) to satisfy the symmetry rule.32 KLD is a metric of the extent to which one probability distribution diverges from another and is known as the relative entropy:

$$d_{{\mathrm{JSD}}}(x,y) = \frac{1}{2}D_{{\mathrm{KL}}}(x,M) + \frac{1}{2}D_{{\mathrm{KL}}}(y,M),$$ (8)

$$D_{{\mathrm{KL}}}(x,y) = \mathop {\sum}\limits_{i = 1}^n x_i{\mathrm{log}}\frac{{x_i}}{{y_i}},$$ (9)

$$M = \frac{1}{2}(x_i + y_i).$$ (10)

Here we assume that vectors x and y are normalised to be non-negative and that the summation of elements is one.

DTW, which makes it possible to compare the similarity of distributions that do not have the same length, is utilised especially in voice recognition. The DTW of vector or time-series data x and y is calculated according to the following procedure: first, set the window size; stretch the length of x in each window to minimise the distance to y. The summation of these distances is the DTW of x and y.33

EMD is a metric related with the optimisation problem of transportation. The Minkowski distance and KLD are bin-to-bin distances and compare the same bins of histograms for which the similarity values decrease with a slight shift of the histograms. EMD is the cross-bin distance, such that it is robust to the shift of the whole histogram.32,34,35 Both DTW and EMD are not exact distances, because they do not satisfy the triangular inequality;36 instead, they are designed to preserve a specific characteristic.

Dimensionality reduction and visualisation

Before estimation of materials parameter (10 Dq) from the spectra, it is important to determine the element and valence of the material. Elements can be differentiated from one another using the photon energy of the location for the peaks in absorption spectra

In many cases, the intrinsic dimension of high-dimensional data is low, and the data is distributed in low dimension manifolds.37,38 Based on that idea, we attempted to reduce the dimension of the spectrum by manifold learning and visualise it. Multi-dimensional scaling (MDS) is one of the simplest dimensionality reduction algorithm and is possible to represent high-dimensional data in a low-dimensional space by approximating the distance in the original space.39

In general, there are several intrinsic dimension estimation methods to estimate the optimal number of dimensions,40,41,42 although we do not put emphasis on it in this work. The spectra of Mn, with various valences, and experimentally obtained spectrum of MnO were calculated and represented in two dimensions by MDS. The results are shown in Fig. 2. The numbers in the figure represent the value of the crystal field parameter (eV) multiplied by 10. The valence of Mn was set as 2, 3, and 4+ with the symmetry as Oh. The ED was used as the distance metric for the sake of simplicity. As can be seen from Fig. 2, spectra with different valences are distinctly separated in the data space, and the distance between the spectra and the value of 10Dq correspond.

Fig. 2 Dimensionality reduction and visualisation results for Mn2,3,4+ X-ray absorption spectroscopy (XAS) spectra with multi-dimensional scaling (MDS). The numbers in this figure correspond to the value of the crystal field parameter (eV) multiplied by 10. The inset indicates the experimentally obtained XAS spectrum for MnO.16 The red dots corresponds to the experimentally obtained MnO XAS spectrum Full size image

The automated data analysis for XAS/EELS spectra using dimensionality reduction is validated with the experimentally obtained Mn XAS spectrum of MnO that corresponds to Mn2+ and 10 Dq = 0.9 eV.16 The MnO XAS spectra and correspondent dimensionality reduction results (red dot) are plotted in the figure. These spectral data approximated those of Mn2+ and 10 Dq = 0.9 eV closely. This suggests that the estimation of the physical quantity (i.e. the charge, 10 Dq) could be realised by evaluating the distance between the spectra.

Comparison of the similarity measure

We adopt the simplest measure as the similarity measure of the XAS and EELS spectra, although several methods exist according to which to define the similarity measure. We define the similarity of spectra as the similarity between the target spectra and the standard spectrum, in this case, the simulated spectrum with a 10 Dq value of zero. The spectra of interest are the Mn2+ L 2,3 XAS or EELS spectra of MnO. We compare the behaviour of each of the similarity measures as a function of the materials parameter 10 Dq. Figure 3 shows the similarity of MnO 2p XAS as a function of 10 Dq. The similarities are calculated between the simulated spectra by varying the value of 10 Dq and the standard spectrum simulated with a 10 Dq value of zero. All of the measures except DTW were found to show a one-to-one relationship between the similarity and the materials parameter. As seen in Fig. 3, PCC, cosine, and JSD were insensitive to 10 Dq at <1.0 eV. If the estimated 10 Dq value is in the insensitive range, coupling another measure could be expected to produce a good result.

Fig. 3 Similarity as a function of the crystal field parameter 10 Dq. The similarity of spectra is defined as the similarity between the target spectra and the reference spectrum, in this case, the simulated spectrum with a 1 0Dq value of zero Full size image

Estimation of the materials parameter

We built a regression model to estimate the value of the materials parameter 10 Dq from the similarity of the spectra. The trend, according to which the similarity changes, is not trivial against the change in the materials parameter, and we build a regression model from the similarity measure vs. the materials parameter data. A proper regression model is built for each similarity measure with the polynomial function where the degree of the polynomial function is estimated from the Akaike information criterion (AIC).43 The performance of the regression model is sufficient for the estimation of 10 Dq from the similarity.

The performance of the regression model for experimental data was validated by the experimentally obtained 2p XAS spectrum of MnO.16 The spectrum of Mn2+ reconstructed from the estimated value of 10 Dq of 0.9 eV with PCC similarity and the experimentally obtained MnO XAS spectrum are shown in Fig. 4. The figure shows that the spectrum predicted from the similarity measure of PCC corresponds well to the experimentally obtained spectrum. According to the literature,16 the value of 10 Dq estimated by human visual inspection is 0.9 eV, which corresponds well with the estimation from the regression model for PCC.

Fig. 4 Comparison of the experimentally obtained MnO X-ray absorption spectroscopy (XAS) spectrum, and the Mn2+ XAS spectrum calculated with the estimated value of 10 Dq (0.9 eV) from the regression model for Pearson's correlation coefficient (PCC) Full size image

We compare the performance of the similarity measures on the estimation of the 10 Dq value. The DTW measure was not used since the similarity was not determined uniquely from 10 Dq. All the similarity measures could estimate the value of 10 Dq at ~1.0 eV. Especially, PCC and cosine could correctly estimate the value of 10 Dq as 0.9 eV. The calculation time for the estimation is several milliseconds on a general laptop computer and we were able to estimate the materials parameters from more than 10,000 spectra taken by scanning transmission X-ray microscopy in a reasonably short time.

Therefore, it was demonstrated that the crystal field parameter 10 Dq can be estimated automatically and promptly by using the appropriate measures.

It should be noted that the appropriate similarity measure could be automatically optimised by distance metric learning, which has been studied recently, and may also contribute to improve the insensitivity.44,45,46 We are currently in the process of the automated determination of appropriate similarity measures for a variety of measurement data from other materials characterisation techniques.

Robustness against noise

In high-throughput measurements, the influence of noise is the most significant factor owing to the short measurement time. Thus, similarity that is robust against noise is indispensable for these measurements.

We hence examined whether the similarity measures are robust against noise. We modelled the noise in the XAS or EELS spectroscopy as Gaussian noise. The noise with the varied valance in the Gaussian distribution was added to the calculated 2p XAS of Mn2+. The similarity with and without Gaussian noise is shown in Fig. 5.

Fig. 5 Result of robustness against the addition of noise. The noise in the X-ray absorption spectroscopy (XAS) or electron energy-loss spectra (EELS) spectroscopy is modelled as Gaussian noise. The signal-to-noise (S/N) ratio is defined as the ratio between the peak height of the true spectrum and the standard deviation of the noise. a Similarity of the spectra with Gaussian noise. Pearson's correlation coefficient (PCC) showed excellent robustness against the addition of noise. b Simulated Mn2+ XAS spectra with Gaussian noise Full size image

The signal-to-noise (S/N) ratio in Fig. 5 is defined as the ratio between the peak height of the true spectrum and the standard deviation of the noise. Obviously, PCC showed excellent robustness against the addition of noise. The results of ED and CD showed the same behaviour.

Using PCC, the similarity of the noisy spectrum with an S/N ratio of 30 was calculated at almost 1.0, whereas it was calculated at below 0.9 with the other measures. Particularly, the result with both ED and CD shows poor robustness against noise, despite the fact that these are commonly used measures. This result suggests that the measurement time can be significantly reduced if an appropriate similarity metric such as PCC is selected.

Robustness against peak broadening

In practical spectroscopy measurements, the energy resolution of the spectroscopy system is one of the most important specifications of the measurement system. The ability to estimate the material parameters with equipment with poor energy resolution may lead to a significant reduction in the cost of an experiment. In this work we established an appropriate similarity measure that is robust against deteriorated energy resolution. We calculated the convolution of XAS spectra and the Gaussian function with varied width. The similarity of the spectra as a function of the width of the Gaussian broadening is shown in Fig. 6. The standard deviation of the Gaussian function, σ was varied in the range from 0.02 to 0.21 eV, and compared to the spectrum with σ = 0.02 eV, which represents the energy resolution of the measurement system. A good measure requires robustness to peak broadening such that it can be applied to a low-resolution measurement. As shown in the Fig. 6, PCC, JSD, and cosine are more robust, whereas ED, CD, and DTW have poor robustness to broadening.

Fig. 6 Results of robustness against peak broadening. Similarities are plotted as a function of peak broadening (σ). The standard deviation of the Gaussian function, σ, was varied in the range from 0.02 to 0.21 eV, and compared to the spectrum with σ = 0.02 eV, which represents the energy resolution of the measurement system. It is shown that Pearson's correlation coefficient (PCC), Jensen–Shannon divergence (JSD), and cosine are more robust, whereas Euclidean distance (ED), city block distance (CD), and dynamic time warping (DTW) have poor robustness to broadening Full size image

This result suggests the importance of choosing an appropriate measure that enables the estimation of a materials parameter even from measurement systems with poor energy resolution.