# Automated total micro-IBA using Advanced Image Processing and Machine Learning

D. Solis-Lerma, H. Khodja

► To cite this version:

D. Solis-Lerma, H. Khodja. Automated total micro-IBA using Advanced Image Processing and Machine Learning. Journal of Physics: Conference Series, 2022, 2326, pp.012006. 10.1088/1742-6596/2326/1/012006 . cea-03868881

HAL Id: cea-03868881

https://cea.hal.science/cea-03868881

Submitted on 24 Nov 2022

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Automated total micro-IBA using Advanced Image Processing and Machine Learning

D Solis-Lerma and H Khodja

Université Paris-Saclay, CEA, CNRS, NIMBE, LEEL, 91191, Gif-sur-Yvette, France

E-mail: hicham.khodja@cea.fr

**Abstract.** We have developed a Python code that aims at automatizing the analysis of generic micro-IBA data by associating statistical methods and machine learning algorithms. The code is organized in two parts: hyperspectral image analysis and composition prediction. In the first stage, main phases and local anomalies are detected separately using PCA and DWEST methods, respectively. In the prediction stage, we use the model generated by a trained artificial neural network. The network is fed with simulated particle and x-ray spectra generated from the SIMNRA and Gulys software codes. For particle spectra, we paid particular attention to the cross section selection that goes beyond already implemented SIMNRA functionalities. To limit the impact of the simulation time on the overall code performance, we make use of data augmentation. When using simulated data as input, we found that the trained neural network predicts stoichiometries and thicknesses with an excellent agreement, even for complex targets composed of several elements and layers. Regarding realistic experimental data, we still get reasonable predictions but remain dependant of cross section quality. The code can combine data from RBS, NRA, ERDA and PIXE and should pave the way for fully automatized micro-ion beam analysis.

## 1. Introduction

Ion Beam Analysis (IBA), and particularly micro-IBA, generates huge amounts of data that require careful processing to extract valuable information regarding examined samples, namely elemental concentrations and layer thicknesses. Usual IBA and micro-IBA data processing is performed using dedicated software programs relying on physical processes and models that aim at fitting collected spectra by adjusting compositions and thicknesses until a convergence criterion is reached. Since they are extremely specialized, most programs remain devoted to a particular technique or type of spectrum (charged particles, x-rays, γ-rays) and fail at looking for a coherence between various radiation sources coming from the interaction of the ion beam with samples. This limitation constrains the analyst to find by itself consistency and complementarity between them. This process is unsustainable when large amounts of samples are investigated and/or when microbeam mapping is used since a supplementary step of hyperspectral image analysis is required to group the pixels (and so the data) from the same elemental phases.

Artificial Intelligence (AI) techniques, including statistical analysis and machine learning are increasingly present in our daily life and near generalized in data processing. In IBA field, it is worth to remind pioneering works of Barradas and Vieira [1] and Demeulemeester et al [2] who demonstrated the usefulness of these techniques. With the improvement of computing capacity, progresses were made with more complex samples [3]. However, coupled techniques processing, which constitute one of the

<figure><img src="image_2.png" /></figure>

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
main strength of IBA, remains poorly investigated [4]. In this work, we aimed at developing a fully automated micro-IBA processing based on AI techniques starting from raw acquired data from multiple and simultaneous IBA techniques to elemental compositions and layer thicknesses results.

## 2. Methods

The codes were written within Python environment using Scikit-Learn libraries [5]. Parallelized execution was performed on an Intel Core i9 processor.

### 2.1. Hyperspectral image processing

Hyperspectral data is composed of $m \times n \times p$ spectra, $m$, $n$ being lateral pixel dimensions (image scan size) and $p$ the number of used techniques during the analysis. Each spectrum contains here 1024 channels. For main features, we apply principal component analysis (PCA) on the ($m \times n$) flattened map containing concatenated $p$-spectra arrays. The first PCA component matrix data is clustered using $k$-means regrouping pixels with similar spectrum profiles.

Small objects that cannot be identified by the PCA process are found using the dual window-based Eigen separation transform (DWEST) method [6], which oppositely to the PCA highlights the particularities of the data. This method consists of comparing for each pixel the spectral differences between pixels in two different spatial windows centred on the considered pixel and affecting it a $\delta$-value that measures the contrast with its local neighbouring. A last clustering step allows identification of the small features.

Spectra from all ADCs from each spatial region are then extracted to be used as inputs for the trained predictor (next section).

The code also compares normalized spectra from the different identified main features and detects Regions of Interest (ROIs) that produces the highest chemical image contrasts.

### 2.2. Stoichiometry and thickness prediction

Stoichiometry and thickness are calculated after training an Artificial Neural Network (ANN). This step is fundamental and requires preparing a learning set generally composed of either experimental data, simulated data, or a mix. Here we made the choice to produce learning sets from simulated data since no universal experimental IBA spectra database is available. Given a set of layers and chemical elements, the code generates targets with regular meshing before producing simulated spectra.

SIMNRA program [7] is used to simulate particle spectra (RBS, NRA, ERDA) and allows convenient code controlling thanks to OLE automation. Moreover, it offers a semi-automatic cross section selection as far as SigmaCalc cross sections are available. However, numerous important interactions are not evaluated by SigmaCalc or have a reduced energy range that does not fit the used experimental configuration. In classical data processing, this can be solved by selecting manually in the software missing cross sections and adjusting energy limits. The code we designed selects automatically the most important supplementary cross sections (from more than 130) and also adjust the energy limits of all required cross sections.

X-ray spectra are produced by using Gulys, an extension of Gupix software [8]. This DOS program, ran here through DOSBox emulator [9], evaluates x-ray lines intensities given the considered elements and the matrix composition. Detector response, including filter absorption, is produced using xraylib library [10] by extracting detector data from detector parameter file. Escape peaks are modelled using ref [11].

Additionally, all simulated spectra undergo an auto convolution to take into account the pile-up process and Poisson noise is added in a final step.

One important feature implemented in the code is data augmentation. Frequently used in AI image processing, it finds also applications in spectroscopy [12]. This technique allows increasing at a minimal calculation cost the learning set size, and thus the quality of prediction. It allows also to take into account the small calibration and charge measurement discrepancies that might occur in real experiments. Starting from simulated spectra, we induce small alterations by applying random variations in
calibration parameters and spectrum intensities. Tests showed that learning sets containing up to 95 % augmented data lead to reliable results.

The ANN implemented in the code is a multilayer perceptron regressor with adaptive hyperparameters. In the first tests, the input layer was initially formed from the concatenation of the *p* spectra, thus having *p* × 1024 nodes. We found however that applying PCA decomposition to the concatenated *p* spectra from the learning set leads to a significant reduction of the input layer size (up to 10-fold), even when retaining the *n* first components required to reconstruct original spectra with a coefficient of determination *R*² such as 1 - *R*² ≤ 1e-7. The ANN hyperparameters are chosen between 6 arrangements (table 1) and 3 regularization terms (0.0001, 0.001 and 0.01) during a parallelized optimization and cross validation step performed on a fraction of the training set.

<table><caption>**Table 1.** ANN geometries</caption><thead><tr><th>Hidden layer topology</th></tr></thead><tbody><tr><td>(n, n)</td></tr><tr><td>(2n, 2n)</td></tr><tr><td>(n, n/2, n)</td></tr><tr><td>(n, n, n)</td></tr><tr><td>(2n, n, 2n)</td></tr><tr><td>(2n, 2n, 2n)</td></tr></tbody></table>

## 3. Results

### 3.1. Image processing

The figure 1 shows results of the image processing from 2 micro-IBA experiments associating particle and x-ray spectra performed on (a) a copper grid mounted on an aluminium background (b) a multiphasic system composed of 3 phases, mineral, metallic and carboneous ones. The code identifies and separates efficiently the different phases. As shown from the anomaly map and confirmed by the extracted PIXE spectrum, the code is also able to isolate a small mineral dust on the copper grid. The overall process takes about 2 min.

<figure><img src="image_3.png" /><figcaption>**Figure 1.** Hyperspectral data processing from (a) a copper grid (b) a multiphasic sample. Anomaly map (a, bottom) highlights a mineral dust. Chemical maps from the multiphasic sample are shown on the right.</figcaption></figure>
## 3.2. Predictions from simulated data

To optimize the ANN and evaluate global performances of the code, we started prediction calculations using simulated data not used during the learning and test processes. We present in figure 2 results from two different configurations where learning sets contains spectra from 10 000 targets. The first system is a multilayer sample probed with protons (CrO$_2$/Fe$_2$O$_3$/NiO layers with 6000, 9000 and 3000 $10^{15}$ at.cm$^{-2}$ respective thicknesses on a Si substrate). For this sample gathering data from both RBS and PIXE is mandatory since none of these techniques ran solely is able to give a full interpretation of the sample. The second system is a mineral sample containing 2.5 at. % of hydrogen probed with grazing $\alpha$-particles resulting in RBS, PIXE and ERDA spectra.

In both cases, we observe the excellent agreements between unknown samples spectra and simulated spectra from the predictions, confirming the ANN performance in various analytical configurations.

<figure><img src="image_4.png" /><figcaption>**Figure 2.** Unknown and predicted spectra of (a) metal oxides multilayer on silicon substrate and (b) hydrated silicate</figcaption></figure>

Efficiency of data augmentation process is demonstrated in figure 3. Here we consider the TiC$_{0.5}$O$_{0.5}$ compound covered by a thin Au layer, probed with deuterons and collecting NRA and PIXE data. With dense meshing (6114 generated targets, figure 3.a), simulation and learning computing times are 50 min and 4 min, respectively. Reducing drastically mesh density (126 generated targets) prediction turns wrong as shown in figure 3.b. By using 14-fold data augmentation on this low density meshing (figure 3.c), we recover the excellent agreement between unknown and predicted spectra while simulation and learning computing times fell respectively to 1 min and 30'.

<figure><img src="image_5.png" /><figcaption>**Figure 3.** Unknown and predicted NRA and PIXE spectra of TiC$_{0.5}$O$_{0.5}$ compound with (a) high density meshing (b) low density meshing (c) low density meshing + data augmentation</figcaption></figure>
### 3.3. Predictions from experimental data

A set of various compounds was probed using protons at 2.5 MeV with RBS and PIXE. In order to improve the process efficiency and to evaluate also the discrimination capacity of the ANN, we prepared a single learning set containing all the chemical elements of the examined compounds here, namely Ga, N, P, Fe and S. We also made use of data augmentation, limiting the simulations to 858 targets and increasing the size by 10-fold. We can observe from the figure 4 that predicted targets spectra are in good agreement with experimental data. Composition predictions are close to nominal ones when applying data augmentation and the ANN performs much better with learning set enriched with data augmentation compared to learning set limited to effectively simulated targets as reported in table 2.

<figure><img src="image_6.png" /><figcaption>**Figure 4.** Experimental and predicted RBS and PIXE spectra for (a) FeS₂, (b) GaN (c) GaP from an ANN trained with Ga, N, P, Fe and S</figcaption></figure>

<table><caption>**Table 2.** Nominal and predicted compositions from the ANN.</caption><thead><tr><th>Sample</th><th>Nominal composition</th><th>Predicted composition with data augmentation</th><th>Predicted composition without data augmentation</th></tr></thead><tbody><tr><td>(a)</td><td>FeS<sub>2</sub></td><td>Fe<sub>1.29</sub>S<sub>2</sub>Ga<sub>0.16</sub>N<sub>0.70</sub>P<sub>0</sub></td><td>Fe<sub>1.14</sub>S<sub>2</sub>Ga<sub>0.16</sub>N<sub>0.70</sub>P<sub>0</sub></td></tr><tr><td>(b)</td><td>GaN</td><td>GaN<sub>0.82</sub>P<sub>0</sub>Fe<sub>0.09</sub></td><td>GaN<sub>0.32</sub>P<sub>28</sub>Fe<sub>0.09</sub></td></tr><tr><td>(c)</td><td>GaP</td><td>GaP<sub>0.58</sub>N<sub>0.03</sub>Fe<sub>0.13</sub></td><td>GaP<sub>1.9</sub>N<sub>10</sub>Fe<sub>0.12</sub>S<sub>0</sub></td></tr></tbody></table>

Reasonable performances can also be achieved with only 256 simulated targets to which we add 14-fold data augmentation, as shown in figure 5. For this example, data was collected on CaSiO₃ and TiO₂ targets using deuteron beam at 1.9 MeV with a 50 µm Mylar absorber in front of the particle detector to stop backscattered particles. Here also a single learning set was used for both targets. Because of this experimental setup, information about Ca and Ti can be extracted solely from the PIXE spectra, evidencing that the ANN takes effectively into account the whole input layer data. Predicted compositions (Ca<sub>0.82</sub>Si<sub>0.76</sub>O₃ and Ti<sub>1.06</sub>O₂) are found close to nominal ones. It should be pointed here that the NRA region [175:300] remains unfitted because the low energy limits of the available <sup>28</sup>Si(d,p<sub>3-4</sub>)<sup>29</sup>Si cross sections are close to the deuteron beam energy and that the carbon metallisation layer (channel 185) was not included in the simulations.
<figure><img src="image_7.png" /><figcaption>**Figure 5.** Experimental and predicted NRA and PIXE spectra for (a) CaSiO₃, (b) TiO₂</figcaption></figure>

Data extracted from figure 1b was also processed, the results are summarized in figure 6. The experiment was performed with deuterons at 1.5 MeV and PIXE and NRA data were collected. The learning set was prepared with targets organized in 2 layers and 8 different chemical elements (C, O, Al, Mg, Si, K, Ca, Fe) producing 4752 targets augmented 4-fold. Reasonable agreement is found, although predictions might be even better with the use of enlarged energy window cross sections.

<figure><img src="image_8.png" /><figcaption>**Figure 6.** Unknown and predicted NRA and PIXE spectra for the 3 identified regions from Fig1b. Neural network hyperparameters are indicated for each phase.</figcaption></figure>

**4. Conclusions**

We have developed a Python code that can process the raw micro-IBA data to automatically get compositions and layer arrangements from potentially any sample and for any analytical conditions. The code is able to isolate the different phases and extract the associated spectra, which are used as input for
a trained adaptive ANN. This last can be efficiently trained using data augmentation technique and
results show that predicted compositions are in good agreement with experimental data for various
samples and IBA setups.

## Acknowledgments

This work was funded by the CEA (project PTC 19SN05). Authors acknowledge J. Gauthier and I. Espagnon for fruitful discussions. Sample discussed in figures 1b and 6 is courtesy of A. Bouhifd.

## References

[1] Barradas N P and Vieira 2000 *Phys. Rev. E* **62** 5818–29

[2] Demeulemeester J, Smeets D, Barradas N P, Vieira A, Comrie C M, Temst K and Vantomme A 2010 *Nucl. Instrum. Meth. B* **268** 1676–81

[3] Guimarães R da S, Silva T F, Rodrigues C L, Tabacniks M H, Bach S, Burwitz V V, Hiret P and Mayer M 2021 *Nucl. Instrum. Meth. B* **268** 1676–81 493 28–34

[4] Pinho H F R, Vieira A, Nené N R and Barradas N P 2005 *Nucl. Instrum. Meth. B* **228** 383–7

[5] Pedregosa F et al. 2011 *J. Mach. Learn. Res.* **12** 2825–30

[6] Kwon H, Der S Z and Nasrabadi N M 2003 *Opt. Eng.* **42** 3342–51

[7] Mayer M 2014 *Nucl. Instrum. Meth. B* **332** 176–80

[8] Maxwell J A, Teesdale W J and Campbell J L 1995 *Nucl. Instrum. Meth. B* **95** 407–21

[9] https://www.dosbox.com/

[10] Schoonjans T, Brunetti A, Golosio B, Sanchez del Rio M, Solé V A, Ferrero C and Vincze L 2011 *Spectrochim. Acta B: At. Spect.* **66** 776–84

[11] Taylor S M, Andrushenko S M, O'Meara J M and Campbell J L 2010 *X-Ray Spectrom.* **39** 191–201

[12] Chatzidakis M and Botton G A 2019 *Sci. Rep.* **9** 2126