Robust retrieval of material chemical states in X-ray microspectroscopy

X-ray microspectroscopic techniques are essential for studying morphological and chemical changes in materials, providing high-resolution structural and spectroscopic information. However, its practical data analysis for reliably retrieving the chemical states remains a major obstacle to accelerating the fundamental understanding of materials in many research fields. In this work, we propose a novel data formulation model for X-ray microspectroscopy and develop a dedicated unmixing framework to solve this problem, which is robust to noise and spectral variability. Moreover, this framework is not limited to the analysis of two-state material chemistry, making it an effective alternative to conventional and widely-used methods. In addition, an alternative directional multiplier method with provable convergence is applied to obtain the solution efficiently. Our framework can accurately identify and characterize chemical states in complex and heterogeneous samples, even under challenging conditions such as low signal-to-noise ratios and overlapping spectral features. Extensive experimental results on simulated and real datasets demonstrate its effectiveness and reliability.


I. INTRODUCTION
X -RAY absorption spectroscopy (XAS) is a scientific technique that utilizes X-rays to investigate the electronic and structural properties of materials.However, the spatial resolution of XAS is typically limited to the micron or submicron scale, which poses a challenge when studying materials with complex or heterogeneous structures.In recent years, spectroscopic full-field transmission X-ray microscopy (TXM) has emerged as a novel tool for nanoscale chemical imaging, with great potential in various multidisciplinary fields [1,2].By imaging at energy points across the absorption edge of the element of interest, TXM offers both high spatial resolution and chemical-specific information.Sub-50-nm resolution Xray absorption near-edge structure (XANES) spectroscopy is routinely achieved with TXM-XANES, mainly operating in the hard X-ray regime (5 to 12 keV) [3][4][5].Its application areas include materials science, physics, chemistry, and biology.For instance, it can be used for chemical mapping in battery studies [6,7] and mesoscale degradation [8].
In TXM-XANES, the intensity change of each pixel is scrutinized to generate XANES spectra that are matched against reference compounds.Some common techniques, including the edge-50 or linear combination fitting (LCF) [1], are used to fit the spectra, then a two-dimensional colormap is constructed to display the chemical phase combination of each pixel.The XANES edge-50 point (energy at 0.5 spectrum position), which measures the absorption spectra of materials within the energy range of 5 keV to 12 keV, is a specific type of XANES spectrometer.The utilization of the edge-50 XANES technique has been progressively examined for characterizing the chemical composition and structure of environmental material [9].On the other hand, [10] proposed using LCF to determine the phase composition of a chemical sample from normalized XANES spectra.The XANES image at each pixel represents a spectrum at a particular location, which can be fitted with reference spectra to produce spatially resolved chemical state information.This technique significantly simplifies the processing and analysis of XANES spectra using LCF.These traditional methods have been extensively used in the literature [11][12][13].
Although traditional methods are widely applicable, these rely on the high quality of XANES imaging.In this case, a relatively slow acquisition process, with the recording of hundreds or thousands of energy points, is needed to achieve sufficient energy resolution.Fast TXM-XANES imaging is crucial for reliably solving morphological chemical phase transitions, as in 3D battery material research.To increase the speed of TXM-XANES imaging, energy points are reduced, or X-ray exposure time is minimized, which is more favorable for radiation-sensitive samples, similar to low-dose medical Xray imaging applications.However, excessively short exposure times can result in measurements with strong noise [14].Furthermore, during the process of acquiring XANES data, there are many variations in the X-ray exposure conditions, and inherent material properties, which contribute to the variability of XANES spectra [15].In the face of strong noise and spectral variability, the edge-50 and LCT methods fail to obtain a reasonable interpretation of elemental and chemical information.Despite efforts to optimize microscope hardware, the physical limitations of the TXM imaging system remain difficult to overcome.To address this obstacle, computational algorithm development is inevitable for improving downstream analysis through fitting results.
Spectral unmixing methods [16] have numerous applications in image science, including remote sensing [17][18][19], optical microscopy [20], and X-ray imaging [21][22][23].The unmixing technique aims to decompose a spectrum of mixed pixels into arXiv:2308.04207v1[cs.CV] 8 Aug 2023 a set of distinct spectral signatures, known as endmembers, along with their corresponding fractional abundances [24,25].By utilizing spectral unmixing in X-ray microspectroscopy, the chemical states of materials can be directly obtained bypassing the fitting process.Various regularizations have been developed in spectral unmixing methods to utilize the prior information on the abundance map against noise.In addition, in the face of spectral variability, many model formulations have been proposed in the unmixing problems [26][27][28][29][30].The principle underlying the LCF method is essentially spectral unmixing [16], whereby the mixture is analyzed by determining the contribution of the reference spectra.However, it is sensitive to noise and limited in handling problems with spectral variability.
The XANES unmixing task involving spectral variability can be formulated as an optimization model with some proper priors.We employ two regularization techniques to achieve this: the total-variation (TV) regularizer and the Plug-and-Play (PnP) prior.The TV regularizer is applied to the reconstructed image to incorporate spatial and spectral information through pixel connections in the unmixing process [31,32].On the other hand, the PnP technique utilizes state-of-the-art denoisers to tackle linear inverse problems in various hyperspectral image processing tasks [33][34][35][36][37].The main contributions of this paper are summarized as follows: • We present a novel and robust framework for X-ray XANES imaging, which incorporates various realistic factors that affect the spectra, such as noise and spectral variability.
• The convergence of our proposed framework with TV regularization is theoretically analyzed, demonstrating its effectiveness and applicability.• Our proposed framework is evaluated extensively using both quantitative and qualitative methods on synthetic and real datasets.The results indicate that our proposed methods surpass the state-of-the-art.Especially our framework with a PnP prior achieves the best performance.The rest of the paper is organized as follows.Section II briefly describes two related works.In Section III, we propose a novel data formulation model for the material chemical states retrieval in X-ray microspectroscopy and the corresponding algorithms to solve it.The convergence analysis is shown in Section IV.Section V presents the experimental results and some subsequent discussions.Finally, Section VI provides a summary and future perspectives.

II. RELATED WORK
This section will present a concise overview of two conventional methods to address this problem.Furthermore, the form of the edge-50 and LCF serves as the baseline for our proposed approach.

A. Edge-50
The edge-50 point, representing the energy at the 0.5 spectrum position, is a crucial parameter in studying chemical state changes during battery cycling.It is often used to determine the phase map in a TXM-XANES system [38,39].
After preprocessing and the post-edge and pre-edge region normalization [1] of XANES images, a XANES spectrum is constructed for each pixel by plotting normalized absorption versus energy.We can then obtain the ratio of chemical materials for each pixel by comparing the energies at the 0.5 spectrum position from the referenced spectra.

B. Linear combination fitting (LCF)
Besides the edge-50, LCF is another technique used to extract information about the electronic structure of elements in a complex sample from XANES spectra [10].By using a leastsquares approach, this technique decomposes the spectrum into a linear combination of reference spectra from known compounds.In fact, LCF is the classical linear mixing model (LMM) in the hyperspectral imaging unmixing field [16,26].
Here the observed XANES image is represented by Y = [y 1 , y 2 , . . ., y N ] ∈ R T ×N , where each column vector is obtained by lexicographically ordering the TXM image with size N = M × K, and T is the number of energy points.The LCF model generates the noisy measurements Y from the chemical phase map X = [x 1 , x 2 , . . ., x n ] ∈ R L×N , pixelwisely.
where A ∈ R T ×L is the dictionary, representing the reference materials spectra in the XANES images, L is the number of materials, and r k is assumed to follow Gaussian distribution.
In other words, (1) can be rewritten in a matrix form: by considering all the pixels.Since the weight of a linear combination or chemical phase map is non-negative and sumto-one, the estimation of the chemical phase map can be obtained by solving the following optimization problem: The chemical phase map X in a model (3) can be obtained using a non-negative constrained least squares algorithm, such as [40].
Although traditional methods can quickly determine the composition of unknown samples, these methods are not robust under strong noise settings.

III. PROPOSED ROBUST UNMIXING FRAMEWORK
This section presents two models for effectively unmixing XANES images from model-based and learning-based perspectives, respectively.Both of them are solved by ADMMbased algorithm.

A. Model formulation
The spectral variability induced by the various conditions can be effectively modeled by approximating the dictionary matrix of each pixel with the scaled version of the reference spectra.We propose an extended LCF model by considering the variability in each pixel, i.e., (1) can be changed to where s k is a scalar in the k-the pixel.Similar to (2), we get the matrix form of (4) as where diag(s) represents a diagonal matrix with its diagonal values s = [s 1 , s 2 , . . .s N ] T and s i ≥ 0, ∀i ∈ 1, . . ., N .Fig. 1 gives the macro diagram of spectral unmixing for the XANES imaging.With (5), we get an optimization problem: Note that (3) is equivalent to (6) if we skip the sum-to-one constraint.However, combining X and s into a nonnegative least squares problem would lose some prior information on X itself, especially when X and s are independent.In the following, we will utilize the prior information and propose a robust optimization framework under a low exposure time measurement.

B. Model-based approach: TV regularization
TV regularization is a widely-used technique in image processing to promote sparsity in the gradient of the image [41,42].Here the chemical phase map can be regarded as a group of images and have a piece-wise spatial correlation.Hence, we first adapt TV regularization into ( 6) and the proposed model can be expressed as follows: where λ is the regularization parameter, x j is the j-th row in the chemical map X, and the L 1 norm for vectors is denoted by ∥ • ∥ 1 .We define a discrete gradient operator, where ∇ x , ∇ y are the finite forward difference operator with a periodic boundary condition in the horizontal and vertical directions, respectively.Here I Ω is the indicator function for the nonnegative value, i.e., In addition, Ω 1 = {X|X ≥ 0 and 1 T X = 1} and Ω 2 = {s|s ≥ 0}.After splitting the variables, the problem in (7) with auxiliary variables can be expressed as follows: Denote U = [u 1 , u 2 , . . ., u L ], the corresponding augmented Lagrangian is: where We apply ADMM as the following scheme, , for j = 1, . . ., L, We then elaborate on how to solve the six subproblems in (11), by taking the derivative of L 1 with respect to X, we obtain a closed-form solution, where ∆ = −∇ T ∇ represents the Laplacian operator.To solve for (12), we use the conjugate gradient (CG) descent iterations.The s-subproblem in (11) has a closed-form solution.
(13) The M-subproblem in (11) also has a closed-form solution, i.e., (14) To obtain the U-subproblem, we take the derivative of L 1 with respect to u j .
where shrink(x, λ) = sign(x) max(|x| − λ, 0).Here we impose the sum-to-one constraint by normalizing X in each iteration, then the subproblem of W and t are only for the non-negativity-constrained projection operator.Algorithm 1 summarizes the whole process for solving model (10).

C. Learning-based approach: PnP Priors
Designing a powerful regularizer can be challenging, as complex regularizers often complicate optimization problems, making the entire process more difficult.Rather than using a handcrafted regularizer, we aim to leverage prior knowledge about the spectral characteristics of materials in the scene to achieve better regularized unmixing results.Our proposed method can be seamlessly integrated into existing optimization frameworks, making it a practical and efficient tool for Algorithm 1 The Framework for XANES Image Unmixing with TV Regularization and PnP Priors.
Input: A XANES image Y, Dictionary A. Output: Phase map X, Scaling factor s.
By introducing the auxiliary variables, the optimization problem of ( 16) can be written in the equivalent form: and the augmented Lagrangian is as follows: where C, D, E, g are dual variables and λ, ρ are positive parameters.The method for solving model ( 18) is similar to that of model (10).Specifically, by taking the derivative of L 2 with respect to X, the X-subproblem has a closed-form solution.
The u j -subporblem is to solve a proximal proximal operator as follows: which can be viewed as an image-denoising problem.The goal is to eliminate additive Gaussian noise with a standard deviation of σ = λ/ρ.We employ established and effective denoising operators in the PnP framework iterations, such as the conventional BM3D [43] or DnCNN [44], which utilizes deep learning.After acquiring the necessary denoising operators, we update the primal and dual variables in the ADMM process, following Algorithm 1.
Remark 1. Dictionary selection: The proposed algorithm can quickly and accurately extract the spectral signal from the XANES imaging data.However, the reference spectra are a critical component for achieving optimal performance.When the reference spectra are unknown, we use the conventional spectra extraction method, which is the vertex component analysis (VCA) [45] as a baseline for dictionary identification.In the real data analysis in Section V-D, we demonstrate that using VCA with denoising results in more accurate reference spectra extraction, particularly in strong-noise environments.

IV. CONVERGENCE ANALYSIS
In this section, we demonstrate the convergence of Algorithm 1 with TV regularization.Under some assumptions, we prove an optimal solution to the problem (10) can be found by iterating the scheme (11).Although this result is not entirely satisfactory, it provides some theoretical guarantees for the reliability of Algorithm 1 with TV regularization. Assuming as the fixed point, then the Karush-Kuhn-Tucker (KKT) condition of ( 9) can be summarized as follows: Theorem 1.Let X k be generated by Algorithm 1, if the successive differences of the multipliers C k+1 − C k , D k+1 − D k , E k+1 − E k and g k+1 − g k all converges to 0 as k tends to ∞, and if {s k } is bounded, then there exists a subsequence X kj whose accumulation point satisfies the KKT condition of (9).
Proof.Since lim k→∞ C k+1 − C k = 0 and lim k→∞ D k+1 − D k = 0, and the multiplier updates are given by (11), it can be conclude that lim Here W k is bounded owing to the constraint Ω 1 .Incorporating lim k→∞ E k+1 − E k = 0, we get the boundedness of X k .Hence there exists a bounded subsequence such that lim j→∞ E kj = lim j→∞ X kj = X ⋆ .It can be inferred that both M k , U k , and t are bounded from the same analysis.Therefore, the following system of equations holds: The optimality condition associated with X-subproblem can be written as: Using ( 23), we have: Similarly, by the optimality conditions associated with s and M-subproblems, we obtain The proof of the final relationship on the stationary condition in (21) can be found in [46], the specific proof of the relationship is omitted here.Lastly, from optimality condition in the W-subproblem in (11) we get Thus, we have Remark 2. Note that (7) is a non-convex optimization problem with respect to both X and s, and our algorithm (11) is a four-block ADMM.The corresponding convergence analysis is very challenging.We refer to some existing work [46][47][48] and establish the convergence under the assumption of the successive differences of the multipliers, which is empirically verified in Section V.

V. EXPERIMENTS AND RESULTS
In this section, we will evaluate the performance of the proposed methods quantitatively and visually on both synthetic and actual datasets.Regarding the comparison with different priors, our methods were divided into two groups: the modelbased method (RUM TV ) and learning-based methods (RUM PnP1 denotes as PnP with DnCNN [44], RUM PnP2 denotes as PnP with BM3D [43]).These proposed methods will be assessed in comparison to the traditional methods, namely edge-50 and LCF.Data Description.The dataset presented in Fig. 2 comprises three X-ray projection images (Particles, Polymer and Round) and three reconstructed slices (Wedge, Electrode and Brine), which were utilized to create a simulation of 2D and 3D TXM-XANES imaging scenarios.To generate simulated movie data, as shown in Fig. 3, the reference spectra of different Ni valence states were randomly assigned to pixels in the images for various phase maps.The sample is assumed to contain various valence states of Ni elements, and the proportion of Ni elements satisfies the sum-to-one constraint.We use number (1, 2, 3, . . ., L) to describe the state.

A. Experimental Settings and Evaluation Metrics
Evaluation Metrics.Each synthetic dataset frame is further corrupted with additive Gaussian noise with varying noise levels, with the standard deviation σ ∈ [1,7].For the performance assessment of the algorithms, we utilize two commonly used criteria to measure the accuracy of the phase map: the peak signal-to-noise ratio (PSNR) and the structural similarity index (SSIM).PSNR is defined as follows: where MAX is the maximum pixel value of the estimated image X, and RMSE is the root mean square error between X and the ground truth X.The RMSE is defined as: where n 1 and n 2 are the number of rows and columns in the image X.We use the estimated phase map X and the ground truth X to calculate PSNR.SSIM is a metric that quantifies the similarity between two images.The SSIM formula is expressed as follows: where µ X and µ X represent the means of X and X, respectively.σ X and σ X denote the standard deviations of X and X, respectively.σ XX is the covariance of X and X, while c 1 and c 2 are small constants added to prevent division by zero errors and stabilize the formula.
Parameter Settings.The maximum iteration of the RUM algorithm is set as 100 for all scenarios.To achieve the best RMSE results for simulated data, λ and ρ are fine-tuned for various methods.Fig. 4 illustrates the effect of parameters ρ and λ on the performance of RUMTV using Particle data with σ = 3.We observe that λ regulates the influence of the regularization term and significantly affects the unmixing results, whereas ρ is a penalty parameter in the augmented Lagrangian function and only affects the convergence speed.

B. Analysis of the proposed algorithm
Convergence.In Section IV, we have proved the convergence analysis on Algorithm 1 with the TV regularization under some assumptions.Here we conduct experiments to empirically verify the assumption and demonstrate the convergence outcomes of three proposed methods with both TV and PnP priors.For each iteration, we plot the relative errors (RE) defined as F to verify the assumption in Theorem 1.In addition, we also plot the RMSE in (28) with respect to the iteration.Fig. 5 shows that the value of RE goes to zero during the iteration, which is consistent with the assumption in Theorem 1.Three methods achieve stable RMSE values after 100 outer iterations on both datasets.Hence we set the maximum iteration number as 100 in the following experiment to reduce the computation time.Running Time.In order to find a balance between performance improvement and computational efficiency, we conducted experiments to evaluate the running times of various datasets on the CPU.It is worth noting that all of these experiments were conducted on a computer equipped with an Intel i7-6348 2.6 GHz CPU and 16 GB of RAM.Table I shows the average computation time for the Particle and Brine datasets.The edge-50 method requires the least amount of time because it does not require any iterative computation.RUM TV is much smaller than the other priors.In particular, when the data size is larger, the running time of RUM with DnCNN is much smaller than BM3D.Our observations indicate that the running time of the proposed framework depends mainly on the complexity of the different priors.
Selection of the PnP prior.The proposed PnP framework offers great flexibility, allowing us to incorporate various stateof-the-art image-denoising approaches.This study examines two notable denoisers: DnCNN [44] and BM3D [43].The results in Table II demonstrate that both methods significantly enhance the PSNRs and SSIMs across different datasets.However, when observing Fig. 6, it becomes evident that RUM with BM3D achieves superior outcomes.Therefore, we employ BM3D as our chosen denoising approach for the following experiments, referred to as RUM PnP .

C. Results of synthetic datasets
Different Noise Levels.Table III displays the performance of both traditional methods and our proposed unmixing methods incorporating TV and PnP priors with two reference spectra.The optimal results are highlighted in bold font.Overall, our two methods all outperform the traditional techniques for all the datasets.They exhibit remarkable robustness to a wide range of noise levels, particularly when the noise is substantial, as the chemical map is still reconstructed effectively.RUM PnP performs best under all noise conditions.In Fig. 7, we compare the chemical phase maps of Round data obtained from various approaches under two kinds of noise levels.Except for edge-50, we observe that the estimated phase maps are consistent with the ground truth.However, under strong noise, our proposed methods yield less noisy phase maps closer to the

D. Results of real dataset
We apply the proposed RUM TV and RUM PnP methods to unmix actual real TXM-XANES data.The data comprises an image of numerous NCM particles on a charged cathode, as shown on the left in Fig. 10.The exposure time for a single frame was 0.5 seconds, and the data was captured at 117 energy points from 8180 eV to 8562 eV.
The NCM particle data exhibits an extremely low signalto-noise ratio, making it challenging to discern the reference spectra of Ni elements in the range of 8180 eV to 8562 eV under practical conditions.Consequently, we can only determine that it contains Ni at different internal states, similar to the blind unmixing.To address this issue, we employ the denoising algorithm [14] followed by VCA [45] to improve the signal-to-noise ratio and dictionary extraction.We focus on two Ni states where the reference spectra of these states extracted from the range of 8180 eV to 8562 eV are illustrated on the right in Fig. 10.These techniques allowed us to overcome the low signal-to-noise ratio and extract valuable information from the NCM particle data.
As shown in Fig. 11, the proposed RUM algorithms clearly distribute chemical elements in the NCM particle structure.Note that RUM TV has some theoretical guarantee on the convergence while the RUM PnP show better unmixing results in the synthetic experiments.On the other hand, due to the high noise levels in each projection image of NCM particles, the chemical map obtained using edge-50 and LCF fail to provide any meaningful information.Our methods simultaneously unmix and denoise the chemical imaging data, avoiding the accumulated error if we split these two processes.Additionally, the chemical phase map of NCM particles indicates an uneven reaction of the battery electrode, with some particles exhibiting a higher Ni valence state and others showing a lower Ni valence state.The utilization of the RUM unmixing method opens up avenues for enhanced understanding of spatiotemporally electrochemical reactions, enabling more profound insights and facilitating the optimization of composite electrode designs.

VI. CONCLUSION
This paper introduced a robust spectra unmixing framework to extract the chemical phase map signal for the widely-used X-ray imaging technique.Our proposed framework considered variance in spectra and maximized the use of spatialspectral priors in X-ray microspectroscopy.It outperforms traditional methods when dealing with strong noise and spectral variability.Additionally, the framework exhibits favorable convergence properties for TV regularization, while the PnP prior performs better.Our future study includes the theoretical analysis of the proposed framework with the PnP prior.

Fig. 1 .
Fig.1.Framework of the proposed model for material chemical states retrieval in the form of unmixing for X-ray microscpectroscopy.The normalized XANES spectra from each pixel are unmixing to create a chemical phase map X, which also takes into account the scaling factor on the image.

Fig. 4 .
Fig. 4. The study analyzed the relationship between RMSE and regularization parameters using Particle data (σ = 3) and evaluated the performance of the RUMTV method.

2 Fig. 5 .
Fig. 5.The RE and RMSE curves of our proposed methods were analyzed using the Particle (left) data and the Brine data (right) under the noise level σ = 3.

Fig. 6 .
Fig. 6.A visual comparison of the chemical phase map for the different PnP priors on the Particle data (top) and the Brine data (bottom) when σ = 3.

Fig. 7 .
Fig. 7.A visual comparison of the chemical phase map for various methods on the Round data under different noise levels (σ = 3 on the top and σ = 7 on the bottom).Note that the other chemical map is the reverse since L = 2.

TABLE I
Comparison of the computational time (units: seconds).Particle and Brine data have the image size of 379 × 520 × 969 and 761 × 742 × 969, respectively.

TABLE II Comparison
of PSNR (dB) and SSIM for two datasets using different PnP priors (σ = 3).

TABLE III Comparison
of PSNR (dB) and SSIM for simulated datasets using different approaches and noise levels.Number of reference spectra.To evaluate the capability of unmixing multiple spectra for XANES data, we generated two datasets at reference spectra (L = 3, 4, 5) when σ = 3.Here different reference spectra represent different valence states of Ni.The results of PSNRs and SSIMs are presented in TableIV, demonstrating our proposed framework's robustness and superiority.Additionally, Fig.8displays the phase maps of