# Integrating tagged neutron inspection with explainable AI for threat material identification

Hadi Shahabinejad, Davorin Sudac, Karlo Nad, Isabelle Espagnon, Clotilde Lessore de Sainte Foy, Bertrand Perot, Cedric Carasco, Alix Sardet, Edwin Friedmann, Jean-Philippe Poli, et al.

► To cite this version:

Hadi Shahabinejad, Davorin Sudac, Karlo Nad, Isabelle Espagnon, Clotilde Lessore de Sainte Foy, et al.. Integrating tagged neutron inspection with explainable AI for threat material identification. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 2026, 1081 (170921), pp.1-13. 10.1016/j.nima.2025.170921. cea-05504205

HAL Id: cea-05504205

https://cea.hal.science/cea-05504205v1

Submitted on 10 Feb 2026

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 CC BY 4.0 - Attribution - International License
Integrating Tagged Neutron Inspection with Explainable AI for Threat
Material Identification

Hadi Shahabinejad¹*, Davorin Sudac¹, Karlo Nad¹, Isabelle Espagnon², Clotilde de Sainte Foy³, Bertrand Perot³,
Cedric Carasco³, Alix Sardet³, Edwin Friedmann², Jean Philippe Poli², Jessica Delgado⁴, Felix Pino⁴, Sandra
Moretto⁴, Christine Mer², Guillaume Sannie², Jasmina Obhodas¹

¹Institute Ruder Boskovic, Zagreb, Croatia

²CEA LIST, Paris, France

³CEA, DES, IRESNE, DTN/SMTA, Nuclear Measurement Laboratory, F-13108 Saint-Paul-Lez-Durance, France

⁴Dipartimento di Fisica e Astronomia, Università degli Studi di Padova, Italy

*E-mail: shahabinejad1367@yahoo.com; hadi.shahabinejad@irb.hr

Abstract

Here we present an innovative approach for detecting threat materials within a sealed container by integrating tagged fast neutron activation analysis with Explainable Artificial Intelligence (XAI). Two AI models, a Feed-Forward Neural Network (FFNN) and a Convolutional Neural Network (CNN), were developed to analyze the emitted gamma rays to identify materials like explosives and drugs based on depth profiles of carbon, nitrogen, and oxygen concentrations. XAI was applied to make the models' decision-making process transparent. The method is adaptable to various spectrometric analyses. We demonstrate its effectiveness using data obtained by the Rapidly Relocatable Tagged Neutron Inspection System (RRTNIS), which is a complementary sensor to X-ray radiography for inspecting cargo containers, despite challenges such as variable material placement, background noise, and shielding effects. Our approach successfully locates and categorizes threat materials, both alone and within surrounding materials, at various locations within sealed cargo containers.

**Keywords:** Threat material identification, Neutron activation, Spectrum analysis, Deep learning, eXplainable Artificial Intelligence (XAI), Rapidly Relocatable Tagged Neutron Inspection System (RRTNIS)
## 1. Introduction

Tagged Neutron Inspection System (TNIS) was initially used to detect explosives hidden in luggages in 2004 [1] and proposed for cargo container inspection in 2005 [2]. Using the TNIS, the elemental composition of a suspected item can be determined by coincidence measurements between alpha particles ($\alpha$) and photons ($\gamma$) resulting from 14 MeV neutron ($n$) interactions in the inspected voxel (or slice) of the container (see Figure 1 in the next section) [3]. The target voxel can be identified using neutron time of flight. Alpha particles are usually detected by a position-sensitive Yttrium Aluminum Perovskite (YAP) scintillator in associated alpha particle neutron generators and gamma-rays are detected by commercial scintillation detectors such as NaI(Tl), $LaBr_3(Ce)$ and BGO.

Cargo inspection using fast tagged neutrons was discussed in detail in 2006 and 2007 [4;5] under the EURITRACK (EURopean Illicit TRAfficking Countermeasures Kit) project as a secondary sensor for detailed inspection of suspected container volumes, as determined by an X-ray system. The TNIS configurations for cargo inspection were further elaborated in 2016 [6], and a final setup named RRTNIS (Rapidly Relocatable Tagged Neutron Inspection System) was proposed for cargo inspection in the same year [7] under the C-BORD (effective Container inspection at BORDer control points) project [8]. The details of the RRTNIS detection system in the C-BORD project, including detector types and configurations, data acquisition system, electronics, and its role in anomaly detection, have been presented in [9-12]. The RRTNIS has been further developed under ENTRANCE [13] (EfficieNT Risk-bAsed iNspection of freight Crossing bordErs without disrupting business) project.

To analyze the gamma-ray spectra obtained from TNIS, the library least square method [14] was applied to the spectra recorded by a BGO detector in 2016 [15], aiming to determine the elemental composition of explosives and drugs. Although the library least square method provides good results, the occurrence of negative values for elemental concentrations was reported as its main drawback [15], as also noted in other studies [16;17]. The difficulty in estimating the correct elemental concentrations primarily arises because the gamma-ray spectrum unfolding problem is inherently numerically ill-conditioned [16;17]. To address this issue in the full spectrum analysis of gamma-ray spectra and also to improve the analysis results, the non-negative least square method [18-20] and artificial intelligence techniques such as hybrid fuzzy-genetic algorithms,
particle swarm optimization and artificial neural networks [16; 21-23] have been exploited in
similar applications in recent years.

In this work, the RRTNIS and two Artificial Neural Networks (ANNs) supported by eXplainable
Artificial Intelligence (XAI)—a Feed Forward Neural Network (FFNN) and a deep Convolutional
Neural Network (CNN)—are integrated to identify various threat materials inside a cargo
container. The ANNs are designed to facilitate one-dimensional inspection of elements within
cargo containers, allowing for the precise identification of threat materials. Building on our earlier
work, which focused solely on elemental identification using FFNNs [24], this study advances the
methodology by incorporating material identification, implementing CNN-based models, and
introducing explainable AI techniques to enhance the transparency of the neural network decision-
making process. By leveraging the capabilities of the RRTNIS and the AI, this study aimed to
enhance cargo security measures by providing efficient and accurate detection of threat materials,
particularly focusing on the identification of carbon, oxygen, and nitrogen, which are the primary
components of explosives and drugs.

## 2. Material and methods

In the framework of the project ENTRANCE, the RRTNIS was reassembled at IRESNE Institute
of CEA Cadarache, France to improve the experimental setup [25].

### 2.1. Experimental setup

The general procedure for the 1D inspection of the container used in this work is presented in
Figure 1, and the improved version of the RRTNIS under ENTRANCE project is shown in Figure
2(a) and (b) [25]. As shown in Figures 1 and 2, the RRTNIS configuration includes an associated
alpha particle DT neutron generator, model GENIE TPA17 from SODERN, with an emission rate
of $2 \times 10^7$ n/s, a high voltage of 55 kV, and an ion current of 50 µA (automatic settings for this
emission rate). The alpha detector is a position-sensitive YAP inorganic scintillator (5 cm in
diameter) coupled to a Hamamatsu H8500 photomultiplier tube and integrated into the accelerator
void tube of the generator, which enables the spatial selection of a 35° aperture tagged neutron
cone (see Figure 1). The generator is encased in a polyethylene shield of 30 cm thickness to ensure radiation protection, and the gamma detectors are shielded with lead plates of approximately 5 cm thickness.

<figure><img src="image_2.png" /><figcaption>Figure 1: A brief description of the 1D cargo inspection using ENTRANCE RRTNIS setup and AI. The distance and range of slices shown in the container are determined using neutron time-of-flight. The</figcaption></figure>

92
93
94
maximum number of slices (m) in this work is 59. The obtained coincident gamma-ray spectra corresponding to the slices are analyzed using ANN models, resulting in depth profiles for all elements in the database. The XAI is applied to find out which parts of the gamma spectrum contribute to estimating elemental concentrations (C in this Figure) in output of the ANNs in each slice. The suspicious region is determined using elemental depth profiles, and the material type (TNT in this Figure) is identified through the triangle plot showing the material distributions.

<figure><img src="image_3.png" /><figcaption>**Figure 2: ENTRANCE RRTNIS design and gamma signatures.** (a) Schematic view of the ENTRANCE RRTNIS design, and (b) Experimental setup at CEA Cadarache, France. Gamma-ray energy spectra obtained using RRTNIS for (c) C, O, N, Si and Fe elements, and (d) correlated background in</figcaption></figure>
three different distances from container wall shown in Figure 1. The major full-energy and single-escape (SE) peaks related to the gamma lines of each element are shown in panel (c) [25].

The distance between polyethylene shield and NaI(Tl) detectors is 45 cm. Gamma rays resulting from tagged neutron interactions within the inspected container are detected by twenty 12.7 cm × 12.7 cm × 25.4 cm parallelepiped-shaped NaI(Tl) detectors. In addition, the coincidence time between the alpha (position sensitive alpha detector shown in Figure 1) and neutron induced gamma detections allows determining the neutron time of flight (TOF), and subsequently its distance to interaction by assuming that all interactions occur along the beam axis at a constant neutron velocity of 5.13 cm/ns (14-MeV neutrons). As shown in Figure 1, the distance utilized in this work was calibrated relative to the wall of the inspected container; specifically, zero distance corresponds to the location of the container wall, indicating zero depth within the container. The 1D inspections of the container with various targets were conducted in slices with a depth resolution of 10 cm and a step size of 5 cm in the horizontal direction (Figure 1). These values were chosen based on the intrinsic TOF resolution of the RRTNIS alpha-gamma coincidence acquisition system, which is a bit larger than 3 ns (FWHM) or 18 cm when converted into the “distance of flight” of the 14 MeV neutrons. We chose smaller steps in order not to lose information, but not too small to preserve counting statistics in each channel. The obtained coincident gamma-ray spectra corresponding to the slices are analyzed using ANN models, resulting in depth profiles for all elements in the database. The XAI is applied to find out which parts of the gamma spectrum contribute to estimating elemental concentrations (C in Figure 1) in output of ANNs for each slice. The suspicious region is determined using elemental depth profiles, and the material type (TNT in Figure 1) is identified through the triangle plot showing the material distributions. The details of all parts will be presented in the following sections.

Using the improved version of the RRTNIS setup, an upgraded database of 20 pure element gamma spectra, as well as random and correlated background, was acquired [25]. Figure 2(c) and (d) depicts the gamma spectra of C, N, O, Si and Fe as well as the correlated background measured in three different positions normalized to their maximum counts, respectively. The major full-energy and single-escape (SE) peaks related to the gamma lines of each element are shown in Figure 2(c) [25]. To obtain the gamma-spectra of pure elements, the container was removed, and the measured background was subtracted from the obtained spectra. The database of pure elements includes: C,
O, N, Si, Al, Ca, Cl, Cr, Cu, F, Fe, K, Mg, Mn, Na, Ni, P, Pb, S, Zn. Graphite was utilized to measure the carbon signature, and water was used for oxygen, as fast neutrons do not produce gamma rays on hydrogen. In instances where a pure element was unavailable, compounds such as Teflon (C₂F₄) were employed for fluorine, after subtracting the carbon signature [25]. The energy distribution of the random background remains consistent regardless of the position of the slice in the container inspection process. In contrast, the energy distribution of the correlated background (background whose intensity and energy spectrum vary with measurement position due to geometric effects and material attenuation as shown in Figure 2(d)) depends on the position, specifically the distance from the container wall. Additionally, the material of the container wall contributes to both the random and correlated backgrounds. The correlated background was measured for different positions by conducting empty measurements, wherein no targets (see Figure 1) were placed in front of the neutron beam. To measure correlated background and different targets, inspection of the container in one dimension was done in slices with a depth of 10 cm and a 5 cm shift. As the correlated background contains its part of random background, only correlated background was used for producing spectra to train the ANNs in this work. These normalized gamma signatures were used to generate data for training ANNs discussed in the following sections.

To evaluate the ability of the ANNs in identifying threat materials inside containers using RRTNIS, simulants of dangerous substances with varying C, N, and O weight fractions were created. The components and chemical formulas of the threat materials and their simulants are presented in Table 1. It can be observed that the chemical formulas of the simulants closely resemble those of the actual dangerous substances. In addition to measuring gamma spectra of the simulants presented in Table 1 and applying ANNs to them, gamma spectra of TNT simulant with varying sizes of iron and wood matrices were also measured, and the ANNs were then evaluated in identifying the threat hidden within these matrices.
<table><caption>**Table 1:** Threat simulants used for the RRTNIS tests in DANAIDES irradiation cell of CEA Cadarache.</caption><thead><tr><td>Threat</td><td>Description</td><td>Chemical formula</td><td>Chemical formula of simulant</td><td>Simulant mass composition</td></tr></thead><tbody><tr><td>RDX</td><td>Explosive</td><td>C<sub>3</sub>H<sub>6</sub>N<sub>6</sub>O<sub>6</sub></td><td>Si<sub>3</sub>C<sub>3</sub>H<sub>6</sub>N<sub>6</sub>O<sub>6</sub></td><td>Melamine 0.412<br>Quartz sand 0.588</td></tr><tr><td>TNT</td><td>Explosive</td><td>C<sub>7</sub>H<sub>5</sub>N<sub>3</sub>O<sub>6</sub></td><td>C<sub>7</sub>H<sub>6</sub>N<sub>3</sub>O<sub>6</sub></td><td>Graphite 0.158<br>Oxalic acid dehydrated 0.276<br>Cyanuric acid 0.566</td></tr><tr><td>Cocaine</td><td>Drug</td><td>C<sub>17</sub>H<sub>21</sub>NO<sub>4</sub></td><td>C<sub>17</sub>H<sub>21</sub>NO<sub>4</sub></td><td>Melamine 0.069 – Graphite 0.243 Sucrose 0.41 – Paraffin 0.277</td></tr><tr><td>Heroin</td><td>Drug</td><td>C<sub>21</sub>H<sub>23</sub>NO<sub>5</sub></td><td>C<sub>21</sub>H<sub>23</sub>NO<sub>5</sub></td><td>Melamine 0.057 – Graphite 0.294 Sucrose 0.421 – Paraffin 0.227</td></tr><tr><td>Yperite</td><td>Chemical warfare</td><td>C<sub>4</sub>H<sub>8</sub>Cl<sub>2</sub>S</td><td>C<sub>4</sub>H<sub>8.2-8.4</sub>Cl<sub>2</sub>SNa<sub>2</sub></td><td>Paraffin 0.274<br>Sodium-chloride 0.57<br>Sulfur 0.156</td></tr><tr><td>Tetranitromethane</td><td>Liquid explosive</td><td>C(NO<sub>2</sub>)<sub>4</sub></td><td>Fe<sub>4.9</sub>C<sub>4.3</sub>(NO<sub>2</sub>)<sub>4</sub>H<sub>32/3</sub></td><td>Iron (III) nitrate non-hydrate 0.762<br>Melamine 0.238</td></tr><tr><td>Peroxide methylethylketone</td><td>Liquid explosive</td><td>C<sub>8</sub>H<sub>18</sub>O<sub>6</sub></td><td>C<sub>8</sub>H<sub>12</sub>O<sub>6</sub></td><td>Sucrose 0.914<br>Graphite 0.086</td></tr><tr><td>Nitromethane</td><td>Liquid explosive</td><td>CH<sub>3</sub>NO<sub>2</sub></td><td>Fe<sub>1/3</sub>CH<sub>5/2</sub>NO<sub>2</sub></td><td>Oxalic acid dehydrated 0.398 Melamine 0.266<br>Iron(III) oxide 0.336</td></tr><tr><td>Ethyleneglycol dinitrate</td><td>Liquid explosive</td><td>(CH<sub>2</sub>ONO<sub>2</sub>)<sub>2</sub></td><td>FeCH<sub>5/2</sub>NO<sub>3</sub></td><td>Oxalic acid dehydrated 0.238 Melamine 0.159<br>Iron(III) oxide 0.603</td></tr></tbody></table>

## 2.2. Artificial Neural Network and Deep Learning

Artificial neural networks are computational models inspired by the structure and function of biological neural systems [27]. These networks consist of interconnected nodes, or artificial neurons, which process and transmit information through weighted connections. ANNs, a subset of which includes deep learning, are designed to mimic the parallel processing and learning capabilities observed in the brain, enabling them to perform tasks such as pattern recognition, classification, and prediction. A crucial aspect of neural networks is that they learn from data by adjusting the weights of connections through algorithms during the training process. Over time, several neural networks architectures have been developed and applied for different applications [28-35], notably including Feed Forward Neural Network (FFNN) and Convolutional Neural
Network (CNN), with the term "deep" often attributed to networks with multiple layers. To analyze gamma-ray spectra of RRTNIS using an ANN, after recording gamma-ray spectra from 20 detectors using a data acquisition system and performing energy calibration, the resulting accumulated spectrum is pre-processed by applying energy threshold of 0.6 MeV, compressing the spectrum to have only 246 channels if necessary, and normalizing it to the total gross count of the spectrum. Subsequently, the processed spectrum is fed into the trained ANN model, the outputs of which comprise the count contribution of 20 elements as well as background radiation.

To estimate the effect of statistical uncertainties on the ANN results, a synthetic “small” dataset of 500 spectra was generated for each measured gamma spectrum. This was done as follows: for each energy channel in the measured spectrum, the recorded counts were assumed to follow a Poisson distribution with the mean (λ) equal to the observed counts in that channel. Using these independent Poisson distributions, 500 random samples of counts were generated independently for each channel, thereby creating 500 synthetic spectra that simulate the statistical fluctuations inherent in the measurement. The synthetic dataset was pre-processed and fed into the network, resulting in 500 sets of outputs. For each output, a Gaussian distribution was fitted to the corresponding 500 data points, with its mean and standard deviation considered as the output of the ANN. This approach allowed us to quantify statistical variability, for example in the error bars shown in Figures 3, 4, and 6, and the clouds around the measured points in Figures 5 and 7.

196

### 2.2.1. Data preparation for training ANN

To train the ANN models in this work, 100,000 gamma spectra were generated by mixing the gamma signatures of 20 pure elements (five of which are shown in Figure 2(c)), each with a randomly sampled proportion, and of the correlated background. The generated spectra were divided into 70% training data, 15% testing data, and 15% validation data to train the ANN models described in the following sections. It is worth mentioning that the training data are utilized to optimize the parameters of the ANN models during the training process. Validation data are used to evaluate the generalization ability of the trained models and to prevent overfitting during network training. Additionally, testing data are employed to assess the performance of the trained models on unseen data [27].
### 2.2.2. Feed Forward Neural Network

The Feed Forward Neural Network (FFNN), also commonly known as the multilayer perceptron (MLP), represents one of the foundational architectures in the realm of artificial neural networks.

In FFNNs, information flows strictly in one direction, from input to output layers, without forming any feedback loops. This unidirectional flow enables FFNNs to effectively process and extract features from complex datasets, making them particularly adept at tasks such as regression, classification, and function approximation [22;23]. Moreover, FFNNs typically comprise multiple layers of interconnected neurons, including input, hidden, and output layers, with each layer playing a distinct role in information processing and abstraction. To determine the optimal FFNN structure in this study, various parameters were systematically explored within predefined ranges.

These parameters included the number of hidden layers (1 or 2), the number of neurons in each layer (ranging from 50 to 1500 with an increment of 50), the dropout rate (ranging from 0 to 0.2) and the initial learning rate (ranging from 1e-4 to 1e-3 with an increment of 1e-4). The number of epochs was set 200, and from the 100 randomly tested network structures, the network with the lowest mean square error was identified as the optimal structure. The specifications of this optimal network structure are detailed in Table 2. As neural networks inherently possess a stochastic nature, different outputs can be obtained for a specific network structure through a “multi-start” process for the initialization of the ANN, including randomized initial weights. To mitigate the effects of randomness, the optimal FFNN architecture was trained independently across 10 runs using identical data. In each run, the model was trained with different initializations of weights and biases, ensuring the independence of each run. By averaging the outputs obtained from these 10 independent runs, we aimed to obtain a more stable and representative estimation of the network's performance.

### 2.2.3. Convolutional Neural Network

The Convolutional Neural Network (CNN) stands out as a groundbreaking architecture specifically designed to excel in tasks involving visual imagery, such as image classification, object detection, and image segmentation. With their ability to automatically learn hierarchical
representations of visual data, CNNs have revolutionized various fields, including computer vision, medical image analysis, and autonomous driving. Recently, CNNs have been applied in analyzing gamma-ray spectra specifically for radioisotope identification [31;32]. Unlike traditional neural networks, CNNs leverage convolutional layers to systematically extract and learn spatial hierarchies of features from input spectra. These convolutional layers employ filters, also referred to as kernels, to perform localized operations across the input spectrum, thereby capturing essential patterns and structures. Additionally, CNNs often incorporate pooling layers to down-sample feature maps, reducing computational complexity and enhancing translation invariance. To determine the optimal CNN structure in this study, various parameters were systematically explored within predefined ranges. These parameters included the number of filters in the Conv1D layers, ranging from 4 to 16, with kernel sizes of 3 to 15. Additionally, the MaxPool layers were tested with stride values of 1 and 2, and kernel sizes of 2, 3 and 5. The number of dense layers was varied between 1 and 2, with the number of neurons in each dense layer ranging from 50 to 1500 with increments of 50. Dropout rates were evaluated from 0 to 0.2. The initial learning rate was adjusted from 1e-4 to 1e-3 with an increment of 1e-4. The number of epochs was set to 300, and from the 200 randomly tested network structures, the network with the lowest mean square error was identified as the optimal structure. The specifications of this optimal network structure are detailed in Table 2. To mitigate the effects of randomness, the optimal CNN architecture was trained independently across 10 runs using identical data and the outputs were averaged over 10 runs.

256

257

258

259

260

261

262

263
<table><caption>**Table 2:** Specifications of the optimal FFNN and CNN models used in this work.</caption><thead><tr><th colspan="4">ANN type</th></tr><tr><th colspan="2">FFNN</th><th colspan="2">CNN</th></tr><tr><th>Network parameters</th><th>Size (Type)</th><th>Network parameters</th><th>Size (Type)</th></tr></thead><tbody><tr><td>Number of inputs</td><td>246</td><td>Number of inputs</td><td>246</td></tr><tr><td>Number of hidden layers</td><td>2</td><td>Conv1D</td><td># filters: 8 - kernel: (5×1) -<br>dim: (246,8)</td></tr><tr><td>Number of neurons in the<br>first hidden layer (dropout rate)</td><td>1100 (0.03)</td><td>Conv1D</td><td># filters: 8 - kernel: (3×1) -<br>dim: (244,8)</td></tr><tr><td>Number of neurons in the<br>second hidden layer (dropout rate)</td><td>300 (0)</td><td>MaxPool1D</td><td>Strides: 2 - kernel: (2×1) -<br>dim: (122,8)</td></tr><tr><td>Activation function of hidden layers</td><td>Relu</td><td>Conv1D</td><td># filters: 4 - kernel: (3×1) -<br>dim: (120,4)</td></tr><tr><td>Activation function of output layer</td><td>Softmax</td><td>MaxPool1D</td><td>Strides: 2 - kernel: (2×1) -<br>dim: (60,4)</td></tr><tr><td>Loss function</td><td>Mean square<br>error</td><td>Flatten</td><td>dim:240</td></tr><tr><td>Training algorithm</td><td>Adam</td><td>Number of Dense layers</td><td>2</td></tr><tr><td>Initial learning rate</td><td>0.0005</td><td>Number of neurons in the<br>first dense layer (dropout rate)</td><td>900 (0.05)</td></tr><tr><td>Number of outputs</td><td>21</td><td>Number of neurons in the<br>second dense layer (dropout rate)</td><td>200 (0)</td></tr><tr><td></td><td></td><td>Activation function of dense layers</td><td>Relu</td></tr><tr><td></td><td></td><td>Activation function of output layer</td><td>Softmax</td></tr><tr><td></td><td></td><td>Loss function</td><td>Mean Square Error (MSE)</td></tr><tr><td></td><td></td><td>Training algorithm</td><td>Adam</td></tr><tr><td></td><td></td><td>Initial learning rate</td><td>0.0005</td></tr><tr><td></td><td></td><td>Number of outputs</td><td>21</td></tr></tbody></table>

### 2.2.4. Explainable artificial intelligence

As machine learning models like ANNs continue to advance, they often operate as opaque "black boxes," making it hard to understand how they make decisions. To tackle this, the field of explainable artificial intelligence (XAI) has emerged [36;37]. XAI develops ways to clarify how machine learning models work. Applying XAI to the analysis of the gamma-ray spectrum using full information [31;37] helps to find out which parts of the gamma spectrum contribute to estimating a parameter in the output of a machine learning method. This not only makes results more trustworthy but also helps people understand and make decisions faster during real-world tasks. By giving clear explanations, users can better understand and handle alerts, making applications more reliable and effective. The performance of different XAI methods have been
examined in the full spectrum analysis of gamma-ray spectra using ANNs in the field of radioisotope identification [38;39], with the best performance obtained from the SHAP (SHapley Additive exPlanations) method in terms of providing more precise explanations based on gamma signatures for correctly identified and misidentified isotopes. SHAP [40] is based on the concept of Shapley values from cooperative game theory [40]. In the context of machine learning, SHAP values quantify the impact of each feature on the model's output by considering all possible combinations of features and their contributions. This approach ensures that the importance of each feature is evaluated in relation to its interactions with other features, providing a more comprehensive understanding of their influence on the model's predictions.

## 3. Results and discussion

The correlation coefficients between the targets and predicted outputs of FFNN and CNN models were studied for all elements as well as background radiation related to both train and test data. The study demonstrated the efficient training of both FFNN and CNN models. These trained networks were subsequently utilized to analyze gamma spectra obtained during the inspection of containers with various targets in following section. It is worth noting that the trained networks analyze gamma-ray spectra extremely quickly. For all scenarios described below, each ANN model required only a few seconds to process the spectra when run on a 2.6 GHz Intel Core i7 PC.

### 3.1. Container inspection using trained ANN models

The 1D inspection of the container was conducted with a measuring time of 10 minutes and with various targets as outlined in Table 1. The position of the middle of the targets was approximately fixed at 75 cm deep inside the container, and a gamma-ray spectrum was obtained for each slice of the container. The positions of slices were determined using neutron time-of-flight. The distance of each slice from the iron wall of the container, as illustrated in Figure 1, was considered, with the center of each slice used as the reference point. Figure 3(a) and (b) illustrates the depth profiles of C, N, and O count contributions for a 1 kg of TNT simulant as the target in the container (without cargo matrix around), employing FFNN and CNN models for analyzing the obtained gamma-ray spectra. Similar profiles were obtained for 1 kg of each of the other simulants presented in Table
1. The error bars of count contributions at each depth were derived from a synthetic “small” dataset of size 500 constructed for each measured spectrum, as detailed in section 2.2. In addition to C, O, and N, other elements were also inspected for material and threat identification in a container. As an example, the depth profiles of Cl and S count contributions corresponding to measuring Yperite simulant (mustard gas, a warfare chemical) as the target (still without cargo matrix around) are shown in Figure 4, alongside the profiles of C, O, and N elements.

Figure 3(a) and (b) highlights the importance of further investigating the area around 75 cm (65 to 85 cm) within the container to identify material in this region. Initially, we assessed how well the ANN models can reconstruct the gamma-ray spectrum at a distance of 75 cm for TNT explosive as an example case. The reconstructed spectra, obtained using the mean values from both FFNN and CNN models, are compared to the measured spectrum in Figure 3(c). According to Figure 3(c), both ANN models perform fairly well in reconstructing the measured spectrum. Furthermore, Figure 3(d), (e), (f), (g), (h) and (i) overlays the SHAP values corresponding to the C, O, and N elements on the measured spectrum, to visualize the impact of individual energy bins on the predictions made by the FFNN and CNN models. These SHAP values were obtained from both the FFNN and CNN models. Both models primarily focus on the major gamma lines of the elements C (4.44 MeV) and O (6.13 MeV) to predict their count contributions in the TNT gamma spectrum. However, the CNN model demonstrates a more pronounced emphasis on these gamma lines compared to the FFNN model. As the 5.11 MeV gamma line of N element is not observed in the TNT spectrum due to limited counting statistics, the CNN model distinctly emphasizes the 2.31 MeV gamma line to predict the count contribution of N.
<figure><img src="image_4.png" /><figcaption>Figure 3: Depth profiles, reconstructed spectra and XAI results for a 1 kg TNT simulant. Depth profiles obtained using (a) FFNN and (b) CNN models. (c) Comparison of reconstructed spectra, generated using mean values from both FFNN and CNN models, with the measured spectrum at a distance of 75 cm. Overlay of SHAP values on the measured spectrum of TNT at a distance of 75 cm in</figcaption></figure>

326

327

328

329

330
the container for the C, O, and N elements, obtained from FFNN model ((d), (e), and (f)), and CNN model ((g), (h), and (i)). The ANN input spectrum (white line) is plotted against energy (MeV) on the x-axis and normalized counts on the y-axis. SHAP values (color map) represent the impact of each energy bin on the prediction. The color bar indicates the magnitude of the SHAP values.

335

<figure><img src="image_5.png" /><figcaption>Figure 4: Depth profiles of C, O, N, Cl and S count contributions for a 1 kg Yperite simulant obtained using (a) FFNN and (b) CNN models.</figcaption></figure>

336

337

338

339

Finally, the count contributions were converted to weight fractions for C, N, and O for threat identification purposes. To achieve this, calibration lines were obtained separately for each element and for both FFNN and CNN models. For each element, the maximum mean values in the corresponding depth profiles of three simulants, in addition to the (0,0) point, were used to map the count contribution to the weight fraction. The simulants RDX, Cocaine and Peroxide methylethylketone shown in Table 1 were used for C element; RDX, Nitromethane, and Tetranitromethane for N element; and RDX, Cocaine and Tetranitromethane for O element.

340

341

342

343

344

345

346
The obtained calibration lines were then applied to convert the count contributions of C, N, and O elements obtained using ANN models to weight fractions for all simulants presented in Table 1. Figure 3(a) and (b) shows variations in the count contributions in any selected suspicious area. To mitigate these variations, the mean of the three maximum count contributions in the selected region was considered for each element and then converted to weight fractions using the calibration lines, followed by normalization to ensure that the sum of the weight fractions for C, N, and O equals one. The resulting normalized weight fractions were then considered as a point in the CNO barycentric triangle [12, 41]. The CNO barycentric triangle illustrates material compositions based on normalized weight fractions of C, N, and O. Each vertex represents pure C, N, or O, while the interior shows combinations of these elements. Points within the triangle indicate mixtures of C, N, and O, offering a visual representation of material compositions in our plots. To illustrate the uncertainty in the location of the measured point in barycentric triangle, the measured points were calculated for synthetic dataset of size 500 constructed for each measured spectrum (as detailed in section 2.2) using both ANN models. The uncertainties obtained are shown in Figure 5, with grey points forming a “cloud” around the measured points. Additionally, blue points represent some of the illicit drugs, red points represent some explosives, and green points represent some benign materials, illustrating the distribution of materials within the CNO barycentric triangle. The different materials used in the barycentric plot are presented in Supplementary Material 1. Euclidean distance was used to quantify the difference between the measured and theoretical points in the barycentric plot. Instead of relying on a single measured point, distances were calculated between 500 points generated from synthetic spectra and the theoretical point. The average of these distances was reported as the distance between the theoretical and measured points, as presented in Table 3. As evident in Figure 5 and Table 3, both ANN models predict the measured points close to the theoretical points, with the FFNN model showing better performance. The better performance of FFNN is further supported by the depth profiles (TNT results shown in Figure 3(a) and (b)), as the FFNN exhibits smaller standard deviations for each element. This improved performance may be explained based on the XAI results, which show that the FFNN attempts to estimate outputs using the full spectral information, whereas the CNN focuses primarily on the major gamma lines, as illustrated in Figure 3. While the CNN provides more interpretable results, the FFNN achieves better accuracy in output estimation.
<figure><img src="image_6.png" /><figcaption>Figure 5: Comparison of Theoretical points (ground truth) and measured points for different threats. Theoretical point (black triangle) in the barycentric triangle compared to measured points obtained using FFNN (black point) or CNN (black star) models for various simulators measured without matrix. Clouds around measured points depict the uncertainty of the measured point. Blue, red, and green points represent illicit drugs, explosives, and benign materials, respectively. In the plots, abbreviated names such as "Tetranit" and "Peroxide" are used to represent "Tetranitromethane" and "Peroxide methylethylketone", respectively, for brevity and clarity.</figcaption></figure>

To assess the primary classification performance of the ANNs, the K-Nearest Neighbors (KNN) algorithm was applied with k=5. KNN is a classification method that assigns a class label based on the majority class among the k nearest data points in a feature space. In this analysis, Euclidean distance was used as the similarity metric to measure proximity between points in the barycentric plot. Rather than relying on a single measured point, class probabilities were computed for 500 points generated from synthetic spectra to reflect statistical variation. The average of these probabilities was reported as the final classification outcome for each class, as shown in Table 3.
In general, both FFNN and CNN determine the classes effectively, except for Cocaine, where FFNN identifies it as a drug with 47.28% probability, while CNN classifies it as a drug with only 9.64% probability.

<table><caption>Table 3: Average class probabilities and Euclidean distances between theoretical and measured points for each material using KNN (k=5) on 500 synthetic spectra obtained using both FFNN and CNN models.</caption><thead><tr><th rowspan="2">Material</th><th colspan="4">FFNN</th><th colspan="4">CNN</th></tr><tr><th>Explosive (%)</th><th>Benign (%)</th><th>Drug (%)</th><th>Distance</th><th>Explosive (%)</th><th>Benign (%)</th><th>Drug (%)</th><th>Distance</th></tr></thead><tbody><tr><td>RDX</td><td>100</td><td>0</td><td>0</td><td>0.072</td><td>99.92</td><td>0.08</td><td>0</td><td>0.070</td></tr><tr><td>TNT</td><td>80.04</td><td>19.96</td><td>0</td><td>0.059</td><td>80.52</td><td>19.48</td><td>0</td><td>0.084</td></tr><tr><td>Cocaine</td><td>18.92</td><td>33.80</td><td>47.28</td><td>0.057</td><td>19.88</td><td>70.48</td><td>9.64</td><td>0.142</td></tr><tr><td>Heroin</td><td>19.64</td><td>51.64</td><td>28.72</td><td>0.082</td><td>16.20</td><td>50.40</td><td>33.40</td><td>0.088</td></tr><tr><td>Tetranit</td><td>94.20</td><td>5.80</td><td>0</td><td>0.054</td><td>97.80</td><td>2.20</td><td>0</td><td>0.061</td></tr><tr><td>Peroxide</td><td>19.12</td><td>80.88</td><td>0</td><td>0.044</td><td>21.64</td><td>78.36</td><td>0</td><td>0.068</td></tr><tr><td>Nitrom</td><td>100</td><td>0</td><td>0</td><td>0.042</td><td>100</td><td>0</td><td>0</td><td>0.049</td></tr><tr><td>Ethylen</td><td>99.92</td><td>0.08</td><td>0</td><td>0.081</td><td>99.84</td><td>0.16</td><td>0</td><td>0.107</td></tr></tbody></table>

To evaluate the performance of the ANN models in the presence of a matrix, 10 kg of TNT was hidden within the container behind 40 and 80 cm wood bales, with a density of 0.2 g.cm⁻³ (mimicking an organic cargo). In another series of experiments, the same TNT target was hidden behind 40 and 105 cm iron boxes filled with bundles of iron wire, with an apparent density of 0.2 g.cm⁻³. Figure 6 displays the depth profiles of C, N and O count contributions obtained using both FFNN and CNN models for 10 kg of TNT hidden in wood and iron matrices. According to the Figure 6, the distances of 70-90 cm and 115-135 cm were considered as the suspicious areas for the TNT hidden at depths of 40 cm and 80 cm in the wood matrix, respectively. Furthermore, the distances of 85-105 cm and 160-180 cm were considered as the suspicious areas for the TNT hidden 40 cm and 105 cm deep inside the iron matrix, respectively. The resulting measured points, along with their uncertainty obtained using ANN models in the CNO barycentric triangle for TNT hidden behind wood and iron matrices have been shown in Figure 7. The Euclidean distances between 500 points generated from synthetic spectra and the theoretical TNT point were calculated for all matrices using both FFNN and CNN. The average of these distances for each matrix is shown in Table 4. Additionally, the KNN classification results with k=5, obtained using the same method described earlier, are also presented in Table 4.
<figure><img src="image_7.png" /><figcaption>**Figure 6:** Depth profiles for 10 kg of TNT hidden in wood and Iron matrices. Depth profiles of C, O, and N count contributions obtained using FFNN ((a) and (c)) and CNN ((b) and (d)) models for 10 kg of TNT hidden in the wood matrix at a depth of 40 and 80 cm. Depth profiles of C, O, and N count contributions obtained using FFNN ((e) and (g)) and CNN ((f) and (h)) models for 10 kg of TNT hidden in the iron matrix at a depth of 40 and 105 cm.</figcaption></figure>

416

417

418

419

420

421

422
<figure><img src="image_8.png" /><figcaption>**Figure 7:** Comparison of theoretical point (ground truth) and measured points for 10 kg of TNT hidden in wood and iron matrices. Measured points obtained using ANN models in the barycentric triangle for TNT hidden in the wood matrix at a depth of 40 cm ((a - FFNN) and (b - CNN)), and 80 cm ((c - FFNN) and (d - CNN)). Measured points were also obtained using ANN models in the barycentric triangle for TNT hidden in the iron matrix at a depth of 40 cm ((e - FFNN) and (f - CNN)), and 105 cm ((g - FFNN) and (h - CNN)). The black triangle represents the theoretical point for TNT simulant. The cloud around measured point depict the uncertainty of measured point.</figcaption></figure>

<table><caption>**Table 4:** Average Euclidean distances between synthetic and theoretical TNT points, and KNN (k=5) classification results for TNT targets hidden behind wood and iron matrices. Distances and class probabilities were obtained using 500 synthetic spectra per matrix with both FFNN and CNN models.</caption><thead><tr><th rowspan="2">Matrix</th><th colspan="4">FFNN</th><th colspan="4">CNN</th></tr><tr><th>Explosive (%)</th><th>Benign (%)</th><th>Drug (%)</th><th>Distance</th><th>Explosive (%)</th><th>Benign (%)</th><th>Drug (%)</th><th>Distance</th></tr></thead><tbody><tr><td>40 cm wood</td><td>33.96</td><td>66.04</td><td>0</td><td>0.115</td><td>14.52</td><td>85.48</td><td>0</td><td>0.151</td></tr><tr><td>80 cm wood</td><td>80.00</td><td>20.00</td><td>0</td><td>0.035</td><td>77.60</td><td>22.40</td><td>0</td><td>0.081</td></tr><tr><td>40 cm iron</td><td>80.00</td><td>20.00</td><td>0</td><td>0.045</td><td>80.00</td><td>20.00</td><td>0</td><td>0.035</td></tr><tr><td>105 cm iron</td><td>57.24</td><td>42.72</td><td>0.04</td><td>0.141</td><td>80.20</td><td>19.80</td><td>0</td><td>0.086</td></tr></tbody></table>
As evident in Figure 6, the depth profiles of C and O are obscured by the large background profiles of the wood matrix, particularly for TNT hidden in the wood matrix at a depth of 40 cm. This effect is noticeable in Figure 7 (a) and (b), where the weight fraction of N is underestimated. Additionally, Table 4 shows an increased Euclidean distance between measured and theoretical points for the 40 cm wood matrix compared to the 1 kg TNT results without matrices presented in Table 3. Furthermore, the classification results are worse in this case. An interesting observation is that the results improve for TNT hidden in the wood matrix at a depth of 80 cm, as seen in Figure 7(c) and (d), and Table 4. This improvement is due to the increased distance from the gamma-ray detectors, which significantly suppresses the background noise from the wood matrix. The suppression occurs through coincidence between the signals from the gamma detectors and the alpha detector, as evident in Figure 6(c) and (d) for the C and O depth profiles. Although the CNN shows better performance for TNT hidden in the iron matrix at a depth of 105 cm, as shown in Table 4, the uncertainties in the depth profiles and measured points are evident in Figures 6(g) and (h), and 7(g) and (h).

The SHAP values were calculated for N element for both FFNN and CNN models at distances of 80 cm and 125 cm, which are at the middle of suspicious regions shown in Figure 6, for TNT behind 40 cm and 80 cm of wood matrix, respectively. The overlay of SHAP values on the measured spectra of TNT is shown in Figure 8.

It is obvious in parts (a) and (c) of Figure 8 that the measured gamma-ray spectrum is mainly influenced by intense gamma lines of C and O for TNT behind 40 cm of wood. The effect is less pronounced for TNT behind 80 cm of wood, resulting in better visibility of the gamma lines of N and consequently facilitating the estimation of N using its major gamma lines (2.31 and 5.11 MeV) by both models.
<figure><img src="image_9.png" /><figcaption>**Figure 8:** XAI results for TNT hidden within the wood matrix. Overlay of SHAP values on the measured spectrum of TNT at a distance of 80 cm within the container for the element N, when the TNT is hidden within the wood matrix at depth of 40 cm, obtained from a FFNN model ((a)), and a CNN model ((c)). Results obtained at a distance of 125 cm, with TNT hidden within a wood matrix at depth of 80 cm, are shown for the FFNN model in (b), and the CNN model in (d). The measured spectrum (white line) is plotted against energy (MeV) on the x-axis and normalized counts on the y-axis. SHAP values (color map) represent the impact of each energy bin on the prediction. The color bar indicates the magnitude of the SHAP values.</figcaption></figure>

The depth profiles, particularly for N, are significantly affected by the poor counting statistics when TNT is behind 105 cm of iron, as shown in Figure 6 (g) and (h). This effect is evident in Figure 7 (g) and (h), showing large uncertainties and fluctuations of the measured points.

Due to this critical situation, SHAP values were calculated for the C element for both FFNN and CNN models at distances of 95 cm and 170 cm, which are at the middle of the suspicious regions shown in Figure 6, for TNT behind 40 cm and 105 cm of iron matrix, respectively. The overlay of SHAP values on the measured spectra of TNT for the C element is shown in Figure 9 (a) to (d). Additionally, the overlay of SHAP values for the Fe element is depicted in Figure 9 (e) and (f) for TNT behind 105 cm of iron matrix for both models.

It is evident in parts (a) and (c) of Figure 9 that both models still mainly utilize the 4.44 MeV gamma line of the measured gamma-ray spectrum to predict C for TNT behind 40 cm of iron, albeit with a lower contrast compared to Figure 3(d) and (g). The effect is much more pronounced
for TNT behind 105 cm of iron, where no specific region is used for predicting C, but rather the entire spectrum. In fact, there is no specific peak in the measured spectrum corresponding to C, N and O elements, and the measured spectrum is similar to the gamma signature of pure Fe shown in Figure 2(c). Since iron is the most abundant material inside the container in this case, both ANN models effectively predict the count contribution of Fe using its major gamma line, as shown in Figure 9(e) and (f). Even in this situation where the gamma-rays originating from different elements are heavily obscured by the iron matrix, both ANN models could still fairly determine the position of the threat (Figure 6(g) and (h)) and the category of the unknown material as explosive (Figure 7(g) and (h)).

489

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

490

<caption>Figure 9: XAI results for TNT hidden within the iron matrix. Overlay of SHAP values on the measured spectrum of TNT at a distance of 95 cm within the container for the N element, when the TNT is hidden in iron matrix at depth of 40 cm, obtained from a FFNN model ((a)), and a CNN model ((c)). Results obtained at a distance of 170 cm, with TNT hidden within iron matrix at depth of 105 cm, are</caption>

480

481

482

483

484

485

486

487

488

492

493

494
shown for the FFNN model in (b), and the CNN model in (d). The Overlay of SHAP values for element Fe are also shown for the FFNN model in (e), and the CNN model in (f), with TNT hidden within iron matrix at depths of 105 cm. The measured spectrum (white line) is plotted against energy (MeV) on the x-axis and normalized counts on the y-axis. SHAP values (color map) represent the impact of each energy bin on the prediction. The color bar indicates the magnitude of the SHAP values.

As can be seen from the depth profiles presented in Figures 3, 4 and 6, both the FFNN and CNN models identify the suspicious areas at the same positions (i.e. depths) within the container. This consistency enhances the reliability of container inspection, as it indicates that two different ANN models pinpoint the same locations.

Indeed, the consistency observed in the identification of suspicious areas by both FFNN and CNN models was further supported by the results of XAI techniques. Specifically, the SHAP values overlaid on the measured spectrum provide insights into the contribution of individual energy bins to the models' predictions. Figures 3, 8, and 9 illustrate how both models primarily focus on major gamma lines of C, O, and N elements to predict their count contributions accurately. Additionally, the CNN model demonstrates a more pronounced emphasis on these gamma lines compared to the FFNN model, highlighting differences in their predictive strategies. This analysis underscores the reliability and interpretability of the models' predictions, enhancing trust in their performance in identifying suspicious areas within cargo containers.

Furthermore, the results from Figure 5, which depicts the performance of the models in positioning the measured points in the CNO barycentric triangle for simulants without matrices, and Figure 7 which present the results for TNT simulant hidden within wood and iron matrices, indicate effective performance in identifying material category within the CNO barycentric triangle. Generally, a slightly better performance in terms of proximity to the theoretical points (except for TNT in presence of 105 cm iron matrix) was observed for the FFNN model. However, both models displayed robust predictive capabilities, allowing for the accurate identification of suspicious regions within cargo containers.

## 4. Conclusion

In this study, we conducted a comprehensive evaluation of eXplainable Artificial Intelligence (XAI) to enhance the identification of suspicious areas within cargo containers, integrating tagged
fast neutron activation analysis with Feed Forward Neural Network (FFNN) and Convolutional
Neural Network (CNN) models. Employing innovative approach outlined in our investigation, our
aim was to enhance container screening effectiveness for global trade security. Through the
analysis of depth profiles depicting the count contributions of elements, we observed consistent
identification of suspicious regions within the container by both FFNN and CNN models,
affirming the reliability of their predictions. Furthermore, utilization of XAI provided valuable
insight into the predictive strategies and decision-making processes of the ANN models, enhancing
their interpretability and overall reliability.

We further extended our investigation by visualizing material compositions using the CNO
barycentric triangle. This provided valuable insights into the identification of material categories
for analyzed targets, both with and without matrices present in the container. Our method
demonstrated effective performance in identifying various threat materials, with 1D inspection
conducted in 10 cm deep slices and a 5 cm horizontal shift, and a measuring time of 10 minutes.
The results demonstrated effective performance in identifying threat materials within the
respective categories using both ANN models. However, it is noteworthy that the CNN model
exhibits a more pronounced emphasis on the major gamma lines of elements compared to the
FFNN model, ensuring highly reliable results and potentially serving as a complementary support
for FFNN results.

For future work, a promising direction is advancing deep learning methods for spectrum analysis
in general, particularly considering the insights gained from XAI results. Improving the
performance of deep learning models through exploration of different network architectures could
be a fruitful area for research. Additionally, deep studying the likelihood probability of the
measured points relative to the closest reference materials (such as explosives, illicit drugs, and
549 benign substances) in the triangle plots could provide valuable insights. Investigating the step-by-step non-negative least square method currently utilized for gamma-ray spectra analysis in 550 RRTNIS presents another avenue for exploration.
551

552 **References:**

[1] Pesente, S. et al. Detection of hidden explosives by using tagged neutron beams with sub-nanosecond time resolution, Nuclear Instruments and Methods in Physics Research A. 531, 657-667 (2004). 553 554

[2] Viesti, G. et al. Detection of hidden explosives by using tagged neutron beams: Status and perspectives, 555 Nuclear Instruments and Methods in Physics Research B. 241, 748-752 (2005).

[3] Sardet A. et al. Performances of C-BORD's Tagged Neutron Inspection System for Explosives and 557 Illicit Drugs Detection in Cargo Containers, 68, 346-353 (2021).

[4] Perret, G., Perot, B., Artaud, J-L., and Mariani, A. EURITRACK tagged neutron inspection system 559 design, Journal of Physics: Conference Series 41, 375-383 (2006).

[5] Perot, B. et al. Development of the EURITRACK tagged neutron inspection system, Nuclear 561 Instruments and Methods in Physics Research B. 261, 295-298 (2007).

[6] Valkovic, V., Sudac, D., Nad, K., and Obhodas J. Container Inspection Utilizing 14 MeV Neutrons, 563 IEEE Transactions on Nuclear Science, 63 (3), 1536-1543 (2016).

[7] Sardet, A. et al. Design of the rapidly relocatable tagged neutron inspection system of the C-BORD 565 project, in Proc. IEEE Nucl. Sci. Symp., Med. Imag. Conf. Room-Temp. Semiconductor Detect. Workshop 566 (NSS/MIC/RTSD), Strasbourg, France, Oct., 1-5 (2016).

[8] C-BORD project, Effective Container Inspection at BORDer Control Points, https://www.cbord-h2020.eu. 568 569

[9] Fontana, C.L. et al. Detection System of the First Rapidly Relocatable Tagged Neutron Inspection 570 System (RRTNIS), Developed in the Framework of the European H2020 C-BORD Project, Physics 571 Procedia, 90, 279-284 (2017).

[10] Pino, F. et al. Advances on the development of the detection system of C-BORD's rapidly relocatable 573 tagged neutron inspection, International Journal of Modern Physics: Conference Series, 48, 1860125 574 (2018).

[11] Pin, F. et al. Detection module of the C-BORD Rapidly Relocatable Tagged Neutron Inspection 576 System (RRTNIS), Nuclear Inst. and Methods in Physics Research, A. 986, 164743 (2021).

[12] Pino, F. et al. Non-intrusive inspection of cargo containers using the C-BORD Rapidly Relocatable 578 Tagged Neutron Inspection System, JINST. 17, T12005 (2022).

[13] ENTRANCE project, "Efficient risk-based inspection of freight crossing borders without disrupting 580 business", https://www.entrance-h2020.eu. 581
[14] Gardner, R.P., Sood, A., Wang, Y.Y., Liu, L., Guo, P., Gehrke, R.J. Single peak versus library least-squares analysis methods for the PGNAA analysis of vitrified waste, Applied Radiation and Isotope, 48, 1331-1335 (1997).

[15] Obhodas, J., Sudac, D., and Valkovic, V. Development of the Quality Assurance/Quality Control Procedures for a Neutron Interrogation System, IEEE Transactions on Nuclear Science. 63 (3), 1544–1550 (2016).

[16] Shahabinejad, H., and Vosoughi, N. Analysis of complex gamma-ray spectra using particle swarm optimization, Nucl. Instrum. Methods Phys. Res. A. 911, 123-130 (2018).

[17] Meric, I., Johansen, G.A., Holstad, M.B., Wang, J., Gardner, R.P. Produced water characterization by prompt gamma-ray neutron activation analysis, Meas. Sci. Technol., 22, 125701 (2011).

[18] Caciolli, A., Baldoncini, M., Bezzon, G.P., Broggini, C., Buso, G.P., Callegari, I., Colonna, T., Fiorentini, G., Guastaldi, E., Mantovani, F., Massa, G., Menegazzo, R., Mou, L., Rossi Alvarez, C., Shyti, M., Zanon, A., Xhixha, G. A new FSA approach for in situ γ ray spectroscopy. Sci. Total Environ. 414, 639-645 (2012).

[19] Baldoncini, M., Albéri, M., Bottardi, C., Chiarelli, E., Raptis, K.G.C., Strati, V., Mantovani, F. Investigating the potentialities of Monte Carlo simulation for assessing soil water content via proximal gamma-ray spectroscopy, J. Environ. Radioact. 192, 105-116 (2018).

[20] Shahabinejad H., and Vosoughi N. SGSD: A novel Sequential Gamma-ray Spectrum Deconvolution algorithm. Annals of Nuclear Energy. 132, 369-380 (2019).

[21] Alamaniotis M., and Jevremovic T. Hybrid fuzzy-genetic approach integrating peak identification and spectrum fitting for complex gamma-ray spectra analysis. IEEE Transactions on Nuclear Science. 62, 1262-1277 (2015).

[22] Kamuda M., Stinnett J., Sullivan C. Automated isotope identification algorithm using artificial neural networks. IEEE Transactions on Nuclear Science. 64, 1858-1864 (2017).

[23] Shahabinejad H., Vosoughi N., Saheli F., “Processing scintillation gamma-ray spectra by artificial neural network”, Journal of Radioanalytical and Nuclear Chemistry, 325, 471-483 (2020).

[24] Shahabinejad H., et al. Elemental identification of sealed cargo based on fast neutron activation analysis and artificial neural network, J Radioanal Nucl Chem, 334, 1157–1166 (2025).

[25] Sainte Foy C.D. et al. Optimization of the ENTRANCE Rapidly Relocatable Tagged Neutron Inspection System, IEEE Nuclear Science Symposium and Medical Imaging Conference (NSS/MIC), Italy, 1-7 (2022).

[26] Simakov, S.P., Pavlik, A., Vonach, H., Hlavac S. Status of experimental and evaluated discrete γ-ray production at En=14.5 MeV, International nuclear data committee, IAEA (1998).

[27] Fausett, L.V. Fundamentals of neural networks: architectures, algorithms, and applications, vol 3. Prentice-Hall Englewood Cliffs (1994).

[28] Haykin, S. Neural networks: a comprehensive foundation. Prentice Hall PTR (1994).
[29] Ryu, J., Park, C., Park, J., Cho, N., Park, J., and Cho, G. Development of Neural Network Model With Explainable AI for Measuring Uranium Enrichment, IEEE TRANSACTIONS ON NUCLEAR SCIENCE, 68, 2670-2681 (2021).

[30] Hossny, K., Hossny, A.H., Magdi, S. Detecting shielded explosives by coupling prompt gamma neutron activation analysis and deep neural networks. Sci Rep. 10, 13467 (2020).

[31] Kamuda, M., Zhao, J., Huff, K. A comparison of machine learning methods for automated gamma-ray spectroscopy. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment. 954, 161385 (2020).

[32] Gomez-Fernandez, M., Wong, W.K., Tokuhiro, A., Welter, K., Alhawsawi, A.M., Yang, H., et al. Isotope identification using deep learning: An explanation. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment. 988, 164925 (2021).

[33] Carasco, C., Pérot, B., Sardet, A. Measuring hydrogen with fast neutrons: Application to organic materials identification in cargo containers, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 951, 163030 (2020).

[34] Gong, K., He, D.-D., Chen, S.-Y., Jing, S.-W., Zheng, Y.-L. BP neural network analysis for identification of explosive in package by tagged neutron method, Nuclear Instruments and Methods in Physics Research, Section A: Accelerators, Spectrometers, Detectors and Associated Equipment. 101721, 165810 (2021).

[35] Gong, K., Xiao, S.-J., Jing, S.-W., Zheng, Y.-L. Back propagation neural network analysis for the detection of explosives based on tagged neutron, Journal of Radioanalytical and Nuclear Chemistry. 326, 329-336 (2020).

[36] Adadi, A., Berrada, M. Peeking Inside the Black-Box: A Survey on Explainable Artificial Intelligence (XAI). IEEE Access. 6, 52138-52160 (2018).

[37] Barredo Arrieta, A., Diaz-Rodriguez, N., Del Ser, J., Bennetot, A., Tabik, S., Barbado A. Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI. Information Fusion. 58, 82-115 (2020).

[38] Bandstra, M.S., Curtis J.C., Ghawaly, J.M. Jr, Jones, A.C., Joshi, T.H.Y. Explaining machine-learning models for gamma-ray detection and identification. PLoS ONE 18(6), e0286829 (2023).

[39] Jeon, B., Kim, J., Moon, M. Explanation of Deep Learning-Based Radioisotope Identifier for Plastic Scintillation Detector, Nuclear Technology, 209, 1, 1-14, (2023).

[40] LUNDBERG S.M. and LEE S.-I. A Unified Approach to Interpreting Model Predictions, Proc. 31st Int. Conf. Advances in Neural Information Processing Systems, Long Beach, California, December 4-9, 4768 (2017).

[41] Carasco, C. et al. Data Acquisition and Analysis of the UNCOSS Underwater Explosive Neutron Sensor, 2nd International Conference on Advancements in Nuclear Instrumentation, Measurement Methods and their Applications, IEEE, (2011).
655 Acknowledgments

656 This research was funded by the Horizon Europe Framework Programme under the ENTRANCE
657 (Grant Agreement No. 883424) and UnderSec (Grant Agreement No. 101121288) projects. The
658 authors gratefully acknowledge the active involvement and support of the Croatian Ministry of
659 Interior, the Croatian Ministry of Finance – Customs Administration, and the Port of Rijeka d.d.

660

661 Author contributions

662 Hadi Shahabinejad analyzed data, developed and wrote the analysis codes and drafted the
663 manuscript; Davorin Sudac, Karlo Nad, Jasmina Obhođaš, Isabelle Espagnon, Clotilde de Sainte
664 Foy, Bertrand Perot, Cedric Carasco, Alix Sardet, Jessica Delgado, Felix Pino, Sandra Moretto,
665 contributed to hardware and software optimization and acquisition of experimental data; Edwin
666 Friedmann, Jean Philippe Poli, Isabelle Espagnon, Clotilde de Sainte Foy, Bertrand Perot, Cedric
667 Carasco, Alix Sardet, Jessica Delgado, Felix Pino, Sandra Moretto analyzed data; Christine Mer
668 and Guillaume Sannie secured funds, planned experiments, and contributed to the acquisition of
669 the experimental data; Hadi Shahabinejad and Jasmina Obhodas conceived the idea of developing
670 AI for experimental data; All authors discussed the results and commented on the manuscript.

671

672 Data availability

673 The datasets used and/or analyzed during the current study are available from the corresponding
674 author on reasonable request.

675

676 Competing interests

677 The authors declare no competing interests.

678

679 Figure captions:

680 **Figure 1: A brief description of the 1D cargo inspection using ENTRANCE RRTNIS setup and AI.**
681 The distance and range of slices shown in the container are determined using neutron time-of-flight. The
682 maximum number of slices (m) in this work is 59. The obtained coincident gamma-ray spectra
683 corresponding to the slices are analyzed using ANN models, resulting in depth profiles for all elements in
684 the database. The XAI is applied to find out which parts of the gamma spectrum contribute to estimating
685 elemental concentrations (C in this Figure) in output of the ANNs in each slice. The suspicious region is
686 determined using elemental depth profiles, and the material type (TNT in this Figure) is identified through
687 the triangle plot showing the material distributions.

688 **Figure 2: ENTRANCE RRTNIS design and gamma signatures.** (a) Schematic view of the ENTRANCE
689 RRTNIS design, and (b) Experimental setup at CEA Cadarache, France. Gamma-ray energy spectra
690 obtained using RRTNIS for (c) C, O, N, Si and Fe elements, and (d) correlated background in three different
691 distances from container wall shown in Figure 1. The major full-energy and single-escape (SE) peaks
692 related to the gamma lines of each element are shown in panel (c) [26].

693 **Figure 3: Depth profiles, reconstructed spectra and XAI results for a 1 kg TNT simulant.** Depth
694 profiles obtained using (a) FFNN and (b) CNN models. (c) Comparison of reconstructed spectra, generated
695 using mean values from both FFNN and CNN models, with the measured spectrum at a distance of 75 cm.
696 Overlay of SHAP values on the measured spectrum of TNT at a distance of 75 cm in the container for the
697 C, O, and N elements, obtained from FFNN model ((d), (e), and (f)), and CNN model ((g), (h), and (i)).
698 The ANN input spectrum (white line) is plotted against energy (MeV) on the x-axis and normalized counts
699 on the y-axis. SHAP values (color map) represent the impact of each energy bin on the prediction. The
700 color bar indicates the magnitude of the SHAP values.

701 **Figure 4: Depth profiles of C, O, N, Cl and S count contributions for a 1 kg Yperite simulant obtained**
702 using (a) FFNN and (b) CNN models.

703 **Figure 5: Comparison of Theoretical points (ground truth) and measured points for different threats.**
704 Theoretical point (black triangle) in the barycentric triangle compared to measured points obtained using
705 FFNN (black point) or CNN (black star) models for various simulants measured without matrix. Clouds
706 around measured points depict the uncertainty of the measured point. Blue, red, and green points represent
707 illicit drugs, explosives, and benign materials, respectively. In the plots, abbreviated names such as
708 "Tetranit" and "Peroxide" are used to represent "Tetranitromethane" and "Peroxide methylethylketone",
709 respectively, for brevity and clarity.

710 **Figure 6: Depth profiles for 10 kg of TNT hidden in wood and Iron matrices.** Depth profiles of C, O,
711 and N count contributions obtained using FFNN ((a) and (c)) and CNN ((b) and (d)) models for 10 kg of
712 TNT hidden in the wood matrix at a depth of 40 and 80 cm. Depth profiles of C, O, and N count
713 contributions obtained using FFNN ((e) and (g)) and CNN ((f) and (h)) models for 10 kg of TNT hidden in
714 the iron matrix at a depth of 40 and 105 cm.

715 **Figure 7: Comparison of theoretical point (ground truth) and measured points for 10 kg of TNT**
716 **hidden in wood and iron matrices.** Measured points obtained using ANN models in the barycentric
717 triangle for TNT hidden in the wood matrix at a depth of 40 cm ((a - FFNN) and (b - CNN)), and 80 cm ((c
718 - FFNN) and (d - CNN)). Measured points were also obtained using ANN models in the barycentric triangle
719 for TNT hidden in the iron matrix at a depth of 40 cm ((e - FFNN) and (f - CNN)), and 105 cm ((g - FFNN)
720 and (h - CNN)). The black triangle represents the theoretical point for TNT simulant. The cloud around
721 measured point depict the uncertainty of measured point.

722 **Figure 8: XAI results for TNT hidden within the wood matrix.** Overlay of SHAP values on the measured
723 spectrum of TNT at a distance of 80 cm within the container for the element N, when the TNT is hidden
724 within the wood matrix at depth of 40 cm, obtained from a FFNN model ((a)), and a CNN model ((c)).
725 Results obtained at a distance of 125 cm, with TNT hidden within a wood matrix at depth of 80 cm, are
726 shown for the FFNN model in (b), and the CNN model in (d). The measured spectrum (white line) is plotted
727 against energy (MeV) on the x-axis and normalized counts on the y-axis. SHAP values (color map)
728 represent the impact of each energy bin on the prediction. The color bar indicates the magnitude of the
729 SHAP values.

730 **Figure 9: XAI results for TNT hidden within the iron matrix.** Overlay of SHAP values on the measured
731 spectrum of TNT at a distance of 95 cm within the container for the N element, when the TNT is hidden in
732 iron matrix at depth of 40 cm, obtained from a FFNN model ((a)), and a CNN model ((c)). Results obtained
733 at a distance of 170 cm, with TNT hidden within iron matrix at depth of 105 cm, are shown for the FFNN
734 model in (b), and the CNN model in (d). The Overlay of SHAP values for element Fe are also shown for
735 the FFNN model in (e), and the CNN model in (f), with TNT hidden within iron matrix at depths of 105
736 cm. The measured spectrum (white line) is plotted against energy (MeV) on the x-axis and normalized
737 counts on the y-axis. SHAP values (color map) represent the impact of each energy bin on the prediction.
738 The color bar indicates the magnitude of the SHAP values.

739
740 Table captions:
741 Table 1: Threat simulants used for the RRTNIS tests in DANAIDES irradiation cell of CEA Cadarache.

742 Table 2: Specifications of the optimal FFNN and CNN models used in this work.

743 Table 3: Average class probabilities and Euclidean distances between theoretical and measured points for
each material using KNN (k=5) on 500 synthetic spectra obtained using both FFNN and CNN models.
744

745 Table 4: Average Euclidean distances between synthetic and theoretical TNT points, and KNN (k=5)
746 classification results for TNT targets hidden behind wood and iron matrices. Distances and class
747 probabilities were obtained using 500 synthetic spectra per matrix with both FFNN and CNN models.

748