logo

Transfer learning empowers material Z classification with muon tomography

NUCLEAR PHYSICS AND INTERDISCIPLINARY RESEARCH

Transfer learning empowers material Z classification with muon tomography

Hao-Chen Wang
Zhao Zhang
Pei Yu
Yu-Xin Bao
Jia-Jia Zhai
Yu Xu
Li Deng
Sa Xiao
Xue-Heng Zhang
Yu-Hong Yu
Wei-Bo He
Liang-Wen Chen
Yu Zhang
Lei Yang
Zhi-Yu Sun
Nuclear Science and TechniquesVol.37, No.5Article number 77Published in print May 2026Available online 09 Feb 2026
11900

Cosmic-ray muon sources exhibit distinct scattering angle distributions when interacting with materials of different atomic numbers (Z values), facilitating the identification of various Z-class materials, particularly radioactive high-Z nuclear elements. Most traditional identification methods are based on complex statistical iterative reconstruction or simple trajectory approximation. Supervised machine learning methods offer some improvement but rely heavily on prior knowledge of the target materials, significantly limiting their practical applicability in detecting concealed materials. To the best of our knowledge, this is the first study to introduce transfer learning into muon tomography. We propose two lightweight neural network models for fine-tuning and adversarial transfer learning, utilizing muon scattering data of bare materials to predict the Z-class of materials coated by typical shieldings (e.g., aluminum or polyethylene), simulating practical scenarios such as cargo inspection and arms control. By introducing a novel inverse cumulative distribution-based sampling method, more accurate scattering angle distributions could be obtained from the data, leading to an improvement of nearly 4% in prediction accuracy compared with the traditional random sampling-based training. When applied to coated materials with limited labeled or even unlabeled muon tomography data, the proposed method achieved an overall prediction accuracy exceeding 96%, with high-Z materials reaching nearly 99%. The simulation results indicate that transfer learning improves the prediction accuracy by approximately 10% compared to direct prediction without transfer. This study demonstrates the effectiveness of transfer learning in overcoming the physical challenges associated with limited labeled/unlabeled data and highlights the promising potential of transfer learning in the field of muon tomography.

Transfer learningMuon scatteringZ-class identificationNeural network
1

Introduction

Muons were discovered in cosmic rays by Anderson and Neddermeyer in 1937. These muons are generated when primary cosmic rays collide with atomic nuclei in the upper atmosphere, initiating nuclear electromagnetic cascades. Most cosmic-ray muons originate from the decay of charged pions and kaons generated by these interactions. Below 1 GeV, the cosmic-ray muon energy spectrum is nearly flat, but it steepens in the energy range of 10–100 GeV, closely following the primary cosmic-ray spectrum. Above 100 GeV, the spectrum becomes even steeper because high-energy pions are more likely to interact with the atmosphere before decaying into muons [1]. At sea level, they are the most abundant charged particles, with an intensity of approximately 1 cm-2 min-1 [2, 3]. Similar to other charged particles, muons interact with atomic matter, leading to energy loss and multiple scattering. However, their interactions with matter are purely electroweak, resulting in significantly lower energy loss compared to most other particles, which grants them exceptional penetration capabilities. Consequently, over the past few decades, muon tomography has played an important role in detection and imaging [4-7].

In 1970, muon transmission was first developed to discover new chambers inside a pyramid by Alvarez et al. [8]. Since then, muon techniques have been widely applied in many fields, such as nuclear safeguards [9], volcano studies [10], and underground tunneling [11]. Cheng et al. applied muon radiography to investigate the internal density distribution of the Laoheishan volcanic cone [12]. In 2003, the Los Alamos National Laboratory (LANL) first introduced the application of muon scattering tomography to the field of security detection and material identification [13-15], underscoring its immense potential in detecting special nuclear materials, such as illicit uranium, concealed within cargo and containers. Leveraging the distinctive physical properties of muons, this technology has become an effective method for detecting large-scale and high-density objects. As a grouping of materials based on their atomic number, typically divided into low-Z, mid-Z, and high-Z categories, Z classification reflects both physical characteristics (e.g., scattering behavior) and practical needs in inspection and nuclear verification tasks [16]. Z-class identification of materials based on muon scattering is a crucial task for security screening and industrial applications. Xiao et al. presented a modified multigroup model to improve the image resolution of high-Z materials [17]. A method for imaging materials using the ratio of secondary particles produced by muons was proposed by Ji et al. [18]. A novel imaging reconstruction method with a large voxel and angle capping was proposed to reduce the time and storage consumption [19] at the Institute of Modern Physics, CAS. Most traditional identification methods rely on the complicated reconstruction of the muon event and track fitting process, which significantly increases the design and calculation costs of the algorithm.

Compared with traditional physics-based reconstruction methods, deep learning models can automatically extract and learn complex features from data. This end-to-end learning paradigm significantly improves computational accuracy and efficiency [20, 21]. Deep learning techniques have demonstrated outstanding performance in compressed sensing technique, which is well-suited for image reconstruction and array processing [22-24]. Meanwhile, in the field of physics, deep learning has demonstrated great potential, especially in the nuclear physics and particle physics areas [25-27]. Common deep learning methods rely on supervised learning, which is based on labeled training samples. Gao et al. proposed a convolutional neural network model for feature extraction to classify and recognize materials based on muon scattering [28]. Our previous work also explored a feasible solution for muon-based material identification using supervised deep learning [29, 30]. However, in practical identification scenarios, obtaining labeled scattering angle data for coated materials is a major challenge. The scarcity of labeled data limits the practical application of supervised learning in the prediction of coated materials.

As a critical deep learning strategy, transfer learning enables knowledge acquired from one domain (the source domain) to be transferred to another related domain (the target domain), effectively mitigating the problem of limited labeled data in the target domain [31-33]. This inspired the proposal of a lightweight neural network model based on transfer learning for Z-class identification of coated materials using muon scattering data. In this study, we defined the Z-class identification of bare materials as the source domain task and that of coated materials as the target domain task. This formulation is inspired by realistic application scenarios, such as cargo inspection [34], nuclear safeguard verification, and arms control [35, 36], where the internal composition is unknown or only partially known. By introducing a novel data preprocessing and sampling method, the model transfers the feature-label mapping learned from the bare material scattering angles to the Z-class prediction of the coated materials. We designed two coated material scenarios, where Al and PE served as coating materials (Fig. 1). Two transfer learning paradigms, fine-tuning [37] and Domain-Adversarial Neural Network (DANN) [38] to achieve Z category classification for nine coated materials, including three materials from each of the high, mid, and low-Z categories.

Fig. 1
(Color online) Flow diagram of material Z classification with transfer learning. The bare material is defined as the source domain, while the coated material is defined as the target domain
pic

To evaluate the effectiveness of our proposed approach, we conducted a series of simulations on the Z-class classification task with muon scattering angle data using the Geant4 Monte Carlo simulation [39]. The results demonstrate that this approach effectively transfers scattering angle features from bare materials, enabling the accurate classification of coated materials. Our method not only reduces the reliance on large-scale labeled data for coated materials but also maintains excellent Z-class classification accuracy in a few minutes, particularly achieving superior accuracy in the more application-critical high-Z class identification. The contributions of this study are as follows:

Proposing a novel sampling method combining inverse cumulative distribution function (CDF), integration, and interpolation improves the feature expression ability of muon scattering angle samples, optimizing the training effect of neural network.

Development of a fine-tune-based transfer learning model for fast Z-class prediction in the case of scarcity of coated material labels, a DANN transfer learning model based on an adversarial idea for stable Z-class prediction when the coated material labels are completely unknown.

The comprehensive result analysis and physical correlation interpretation. Demonstration of the potential application scenarios of each method, which provides a diversified scheme for the application and expansion of transfer learning in the field of muon techniques, such as cargo inspection and nuclear safeguards.

To the best of our knowledge, this is the first study to apply transfer learning strategies to muon tomography. This study provides an alternative machine learning scheme to the traditional identification method. This demonstrates the great potential of transfer learning in mitigating the high-cost reconstruction and data scarcity challenges in muon-based applications with similar scenarios.

2

Muon scattering simulation and sampling method

2.1
Simulation setups

The scattering angle data were provided by a Geant4 simulation incorporating the Cosmic-Ray Shower (CRY) Library [40], which generates muons with the energy and angular distribution of cosmic muons at sea level. The dimension of the object is 10 cm × 10 cm × 10 cm; it may be coated on all six sides with a 1 cm thick layer, resulting in an overall size of 12 cm × 12 cm × 12 cm for the coated object. Four position-sensitive detectors of size 30 cm × 30 cm are placed above and below the object to measure the trajectories of the incident and emergent muons for subsequent angle calculations. A spacing of 20 cm is placed between the second and third detectors to place the tested materials at the center of this gap. The distance between detectors 1 and 2 and detectors 3 and 4 was the same (35 mm). It is worth noting that the detector used in the simulation is an ideal detector, and detector characteristics such as detector noise are not considered. This setup is shown in Fig. 2.

Fig. 2
(Color online) Schematic of the Geant4 simulation setup
pic

First, we set up a muon source with an energy of 1 GeV and conducted scattering angle simulations for nine bare materials (Mg, Al, Ti, Fe, Cu, Zn, W, Pb, and U) to verify the reliability of the simulated data. Figure 3 presents the probability distribution statistics of the simulated scattering angle data using the kernel density estimation (KDE), categorized by both Z classes and different materials. The results indicated significant differences in the scattering angle distributions among different Z-class materials and among materials within the same Z-class. In the formal experiment, we performed simulations based on the energy and angular distributions of cosmic-ray muons at the sea level. For each material in different scenarios (bare, Al-coated, or PE-coated), 500,000 muon scattering angle data were simulated. The scattering angle in our simulation is the included angle between the incoming and outgoing muon tracks in 3D space using the following formula:pic (1)

Fig. 3
(Color online) Scattering angle distribution of 1 GeV muon with materials: Mg, Al, Ti, Fe, Cu, Zn, W, Pb, U. a categorized by Z-classes. b categorized by each materials
pic
2.2
Inverse CDF sampling

As shown in Fig. 3, the primary distinguishing feature of muon scattering through different materials lies in the variations of their scattering angle distributions. Additionally, high-quality training samples contribute to the training of more effective neural networks [41, 42]. When employing a neural network as a mapping function between scattering angle data and material properties, it is desirable for the model to learn features that facilitate differentiation between various materials based on their respective scattering characteristics. To effectively capture the distribution characteristics of the simulation data, a sampling method called the inverse cumulative distribution function was introduced. First, we uniformly selected a set of quantile points within the range of the overall scattering angle distribution for a given material. Non-parametric methods are used to estimate the probability density function (PDF) of the overall data at these quantile points. The corresponding CDF values were then computed based on these PDF values. Finally, we obtained the training samples through inverse CDF sampling. The complete sampling process is shown in Fig. 4, and the process pseudocode is referred to Appendix 1. Compared with the traditional random sampling (RS) method, the samples generated using this method shared the same probability distribution as the overall simulation data.

Fig. 4
(Color online) Schematic of inverse CDF sampling. From left to right: estimated discrete PDF values using KDE or HE; Interpolated cumulative distribution function (CDF), and sampling data from the same distribution via inverse CDF sampling. Axes represent radians (x-axis) and corresponding densities or cumulative probabilities (y-axis)
pic

We employed two non-parametric estimation methods: KDE [43] and histogram estimation (HE), to compute the probability density values for selected quantile points within the overall data. The fundamental idea of the KDE is to use a smooth kernel function to perform weighted averaging of the total data points, thereby obtaining an estimate of the probability density. In other words, the weighted contribution of data points at a given quantile point is calculated. Selecting specific quantile points rather than drawing the entire data ensures computational efficiency and accurate distribution estimation, mitigating the impact of fine-grained details that could disrupt the smoothness of the overall probability distribution function. For a selected quantile point Xq, the kernel density estimation of the PDF is given by:pic (2)where is the kernel function, h is the bandwidth parameter controlling the smoothness of the estimation, and Xi is the true data value in the overall dataset. We employed a Gaussian function as the kernel function, along with the Silverman method for automatic bandwidth adjustment.

In contrast, the HE method is more straightforward and intuitive. It uniformly divides the overall data range into b bins and counts the number of data points that fall within each bin:pic (3)where h is the bin width, n is the total number of samples. The expression represents an indicator function that indicates whether the data point Xi falls within the bin Bj. If so, the function takes the value of 1; otherwise, it takes the value of 0. The KDE method provides a smoother estimation of the PDF values, enabling the subsequent acquisition of higher-quality samples. However, for sparse data or in the presence of extreme values, the KDE may lose some accuracy. In contrast, the HE method is more stable, but improper bin selection can lead to overfitting or underfitting of the data distribution. Given the peak and long-tailed distribution characteristics of the simulation data, both methods were incorporated into the sampling process.

To convert discrete PDF values into continuous CDF values, the compound trapezoidal rule (Eq. 4) and cubic spline interpolation (Eq. 5) are employed during the converting process. The integral interval is divided into multiple sub-intervals, and the trapezoidal rule is applied within each sub-interval to improve the integration accuracy.pic (4)where f(Xq) is obtained from Eq. (2) or Eq. (3), depending on which method of calculating PDF is taken. A smooth and continuous CDF is obtained using cubic spline interpolation between discrete CDF values, and the parameters aj, bj, and cj are determined by zero-, one-, and two-order boundary conditions for different pairs of CDF values:pic (5)Based on the CDF values obtained from the above calculations and conversions, Ns rounds of sampling were conducted for the simulation data of various materials under different experimental scenarios. In each iteration, n random numbers un that satisfy the uniform distribution U~(0, 1) are generated, and the inverse CDF method is utilized to obtain n scattering angle data points :pic (6)To prevent overfitting and a loss of robustness owing to the high similarity between samples, a similarity check mechanism was incorporated. By calculating the Euclidean distance between the samples generated in each iteration, those with excessive similarity are filtered out, ultimately resulting in Ns diverse samples that align with the overall simulation data distribution. The parameters related to the sampling process are listed in Tabel 1. The sampled scattering angle data were stored as features, while the corresponding material Z-class served as the label (0, 1, and 2 corresponding to low-, mid-, and high-Z), forming samples with feature-label pairs.

Table 1
Parameter setting of sampling process
Parameter Value Description
tot_mat 9 Total number of materials
sim_data 500,000 Simulated muon scattering data for each material
smp_num (Ns) 1,000 The number of samples generated for a material
scat_num (n) 500 The number of muon scattering data contained in each sample
qtl_point 1,000 The number of quantile points where KDE calculating PDF values
bin_num 1,000 The number of bins where histogram counting PDF values
bw Silverman Bandwidth adjustment mode in KDE
sim_thd 5 × 10-3 The threshold of similarity discrimination between samples
Show more

In different scenarios (bare, Al, or PE coated), 1,000 samples were acquired for each material. While in the specific training and prediction phases, a consistent train-test split was applied across different materials. The specific data partitioning ratios for the various phases are detailed in the corresponding parameter tables. In addition, the traditional random sampling method, which is directly sampled from the raw simulated scattering angle data (denoted as RS), was also applied in this study. The sample size generated by the RS method was the same as that of the inverse CDF sampling. The superiority of the inverse CDF sampling method can be demonstrated by comparing the training accuracies.

3

Transfer learning-based Z-class identification

There are some implicit correlation features between source domain tasks and target domain tasks, which constitute the practical feasibility basis for transfer learning [31-33]. In this study, we adopted two transfer learning paradigms: fine-tuning learning and adversarial transfer learning with DANN. Based on a pre-trained model trained in the source domain, fine-tuning performs limited parameter adaptation in the target domain and enables the efficient learning of feature-label relationships, even when the target domain data are scarce. Adversarial transfer learning, on the other hand, is applicable when target domain labels are completely unknown. By extracting shared discriminative features, the feature distributions between the source and target domains are aligned, enabling unsupervised classification.

3.1
Pre-training and Fine-tuned transfer

Fine-tuning is an essential technique for transferring neural network tasks and is widely applied in transfer learning because of its low computational cost and high training efficiency under limited target domain data conditions. In this study, we constructed a unified lightweight neural network with two hidden layers for both the pre-training and fine-tuning processes (P&F model). The scattering angle sample data were first received by the input layer, then processed through two hidden layers for feature extraction, and finally classified by the output layer. The detailed network structure is illustrated in Fig. 5.

Fig. 5
(Color online) Structure of pre-train & fine-tune model. The layers with a blue background indicate free/frozen layers. During pre-training, the layers are in a free state, with the source sample as the input. During fine-tuning, the layers are frozen, only the parameters between the last hidden layer and the output layer are updated using target domain samples
pic

Because the P&F model is designed for multi-classification tasks, we used cross-entropy as the loss function [44]:pic (7)where N is the batch size, and C is the number of classes (low, mid, and high). Given a sample i, the ground-truth class label yi,j is encoded in a One-Hot format and automatically converted by PyTorch. The corresponding logits represent the raw predictions of the neural network, which are normalized by the Softmax activation function. The model was trained on the training set, and its prediction accuracy on the test set was recorded to evaluate its generalization performance and robustness. The specific parameter settings are listed in Table 2.

Table 2
Parameter setting in pre-training & fine-tuning task. Unless the specified parameters*, certain parameters are shared between the pre-training and fine-tuning stages
Parameter Value Description
input_dim 500 The number of nodes in the P&F model input layer
hidden_dim1 128 The number of nodes in the P&F model first hidden layer
hidden_dim2 64 The number of nodes in the P&F model second hidden layer
output_dim 3 The number of nodes in the P&F model output layer
tt_ratiop* 7:3 Ratio of source samples in training set to test set during pre-training
tt_ratiof* 3:7 Ratio of target samples in training set to test set during fine-tuning
batch_size 128 The number of samples trained for each material in one iteration
epochp* 200 The number of epochs in the pre-training process
epochf* 100 The number of epochs in the fine-tuning process
lr 5×10-5 The learning rate of the P&F model in the training process
Show more

For the pre-training process, we trained the P&F model with feature-label pairs (xs, ys) samples obtained from the source domain using three different sampling methods. The training process is illustrated in Fig. 6. The goal was to learn the mapping between the scattering angle data of bare materials and their Z categories. After pre-training, the hidden layers, which serve as the key structures for feature extraction, have their parameters optimized to effectively extract high-order features from the original scattering-angle data. In the subsequent fine-tuning process, the parameters of the input and hidden layers are frozen, while only the parameters between the last hidden layer and the output layer are trained using a smaller number of target domain training samples.

Fig. 6
(Color online) Training process of pre-train model on source domain test dataset. Training and testing loss (left y-axis) and accuracy for different Z-classes (right y-axis) over epochs. a Training with RS samples. b Training with KDE samples. c Training with HE samples
pic

In the pre-training stage, we aimed at nine different materials from the high-, mid-, and low-Z categories and conducted supervised training on the training dataset. The training results in Table 3 indicate that the pre-trained model achieves high prediction accuracy on the test dataset, confirming the effectiveness of neural networks in learning the mapping between scattering angle data and Z categories. The accuracy metric is the ratio of correct predictions to the total sample number in their respective scenarios.

Table 3
Classification accuracies of pre-trained model on source dataset. Total colmun is the overall prediction accuracies across three categories
Sampling method Z categories Total
low-Z mid-Z high-Z
RS 0.972 0.958 0.997 0.976
KDE 0.996 0.999 1.000 0.998
HE 0.999 0.999 1.000 0.999
Show more

Before applying the fine-tuned transfer learning method, we first directly evaluated the pre-trained model on the two target domains, where Al and PE served as coating materials. The test results are shown in Table 4 (Pre-training). When trained with samples obtained using two inverse CDF sampling methods (KDE and HE), the classification accuracy in the Al-coated target domain decreased by approximately 12%, with the most significant drop occurring in the prediction accuracy of low-Z materials (approximately 30%). This phenomenon can be attributed to the fact that, as a low-Z material, the relative influence of the Al coating on the scattering angle distribution of the coated material is inversely proportional to the intrinsic Z value of the coated material. Meanwhile, in the PE-coated target domain, the prediction accuracy of the pre-trained model remained almost unchanged (a decrease of only approximately 1%). Because PE, as a hydrocarbon compound, can be considered an ultra-low-Z material, its coating has a minimal impact on the scattering angle distribution of metallic materials. In contrast, when the model was trained with RS data, the randomness of the sampling process hindered the prediction results from following the physically consistent patterns observed in the inverse CDF-based training.

Table 4
Prediction accuracies on target dataset before/after fine-tune transfer
Training stage Dataset Sampling method Z categories Total
low-Z mid-Z high-Z
Pre-train Al RS 0.980 0.784 0.816 0.860
KDE 0.697 0.933 1.000 0.877
HE 0.643 0.980 0.999 0.874
PE RS 0.996 0.794 0.938 0.909
KDE 0.943 0.997 1.000 0.980
HE 0.987 0.977 1.000 0.988
Fine-tune Al RS 0.914 0.923 0.985 0.941
KDE 0.981 0.977 0.998 0.985
HE 0.957 0.943 0.989 0.963
PE RS 0.949 0.957 0.996 0.968
KDE 0.995 0.993 1.000 0.996
HE 0.985 0.984 0.996 0.988
Show more

In our P&F model architecture, the first hidden layer was designed to extract fundamental features reflecting low-level scattering physics. These features are largely invariant across domains, given the shared nature of the input data structures between the source and target domains. Therefore, freezing the first hidden layer preserves these transferable and physically meaningful representations. Regarding the second hidden layer, although it captures more domain-specific cues, our empirical studies showed that fine-tuning this layer, while the first remains frozen, often leads to overfitting owing to the limited size of the target dataset. In contrast, freezing both hidden layers stabilizes performance by retaining shared representations and reducing the influence of domain-specific noise. Additionally, freezing both layers reduces the number of trainable parameters, which is especially beneficial in low-cost applications. For the fine-tuning process, we freeze the corresponding parameters and fine-tune the P&F network with fewer target domain training samples (xt, yt). This enables the pretrained model to be adapted efficiently to the target domain tasks. For the two different target domains of Al-coated and PE-coated materials, the classification accuracy of the fine-tuned model on the target test dataset is presented in Table 4 (fine-tuning). Benefiting from the well-optimized parameters obtained during pre-training, the fine-tuned P&F model demonstrated excellent predictive performance across both tasks. The detailed training process is illustrated in Fig. 7.

Fig. 7
(Color online) Training process of fine-tune model on target dataset. Training and testing loss (left y-axis) and accuracy for different Z-classes (right y-axis) over epochs. a-c Results of training with RS, KDE, and HS samples separately on the Al target domain. d-f Results of training with RS, KDE, and HS samples separately on the PE target domain
pic

It should be noted that, owing to the globally shared parameters of the neural network, the fine-tuning process aims to enhance the overall classification accuracy rather than optimize each class individually. As the model improves its discriminative ability for certain categories, the performance of others may deteriorate slightly, resulting in parameter competition and trade-offs. This phenomenon may cause a minor decrease in the prediction accuracy of specific classes. However, the overall classification performance of the target task improved. Moreover, the observation that the training loss exceeds the testing loss, with the training curve showing greater fluctuation while the test curve remains smooth, can be primarily attributed to the limited size of the training dataset. Because only 30% of the total data were used for training, the model became more sensitive to outliers and difficult samples, leading to a higher average loss and increased variance during optimization. In contrast, the larger testing set (70%) provides a more reliable and representative performance estimate, effectively averaging out the anomalies and resulting in a smoother and lower loss curve. Furthermore, because parameter updates occur solely on the training set, its loss is expected to fluctuate across batch iterations, whereas the test loss remains relatively stable.

3.2
Transfer learning with DANN model

The identification of the Z-class of an unknown coated material, as an unlabeled target domain problem, presents a more significant challenge. However, by identifying common scattering angle features between the coated material and its bare counterpart, we can train a neural network to achieve superior classification performance in an unknown domain. Traditional domain alignment methods typically compute specific mathematical relationships between the source and target domains and incorporate them into the training process as part of the loss function [45, 46]. Given that different transfer learning tasks exhibit distinct data characteristics, determining the optimal mathematical relationship as a training objective remains highly challenging.

The concept of adversaries in neural networks was first introduced in Ref. [47], where adversarial models generated adversarial samples to enhance model robustness. The DANN extends adversarial training to transfer learning by incorporating a domain discriminator that enforces feature distribution alignment between the source and target domains through adversarial training, thereby facilitating unsupervised learning in the target domain. This approach fully exploits the fitting capabilities of neural networks and enables effective feature alignment without requiring an explicit definition of the feature relationships between a specific source and target domains.

Our DANN model is illustrated in Fig. 8, consists of three main components: a feature extractor, a classifier, and a domain discriminator. During training, the labeled scattering angle data of the bare materials and unlabeled scattering angle data of the coated materials were both fed into the feature extractor. The total extracted features are then passed into the domain discriminator, and the extracted source domain features and corresponding labels serve as inputs to the classifier. First, the domain discriminator determines whether the input features originate from the source or target domain and simultaneously computes the loss function to optimize itself, aiming to improve the domain feature discrimination. Because the domain discriminator only classifies whether the received features belong to the source or target domain, we use binary cross-entropy as the loss function:pic (8)the ground-truth label indicates the source or target domain class of the sample. The model outputs logits zi represent the raw predictions before applying the Sigmoid activation function. Unlike the default definition of Softmax in cross-entropy, the binary cross-entropy loss requires an explicit definition of the Sigmoid function as the activation function in the output layer. Second, when receiving a sample F(xs), ys from the source domain, the classifier computes the loss function for the conventional multi-classification task, similar to the pretraining and fine-tuning approaches. Consequently, the loss function is also defined as the cross-entropy, with the same expression as in Eq. 7. Finally, the overall loss functionpic (9)is used to train the extractor, where is responsible for improving the prediction accuracy of the extractor and classifier, while the reversal discrimination loss is used to train the extractor to gradually extract the shared features between the source and target domains, thereby achieving domain alignment. Gradient reversal ensures that the extractor and discriminator form an adversarial relationship during training and eventually reach equilibrium after iterative optimization. The gradient reversal parameter λ is employed to balance the weight distribution between feature alignment and classification accuracy improvement in the network model. In this study, feature alignment was more challenging than classification. Moreover, owing to the minimal feature distribution discrepancy between the source and target domains, remains relatively low. Based on this analysis, we assigned a higher weight to λ in our training process to enhance the training performance. After this training stage, the extractor and classifier can extract common features from both the source and target domains and perform effective classification. The detailed neural network hyperparameter settings are presented in Table 5.

Fig. 8
(Color online) Structure of DANN model. The legend explains the activation function, the network connection mode, and the direction of information propagation
pic
Table 5
Parameter setting of DANN transfer. Considering DANN as an integrated model, the input layers of both the classifier and the discriminator correspond to the hidden layers of the entire network
Parameter Value Description
input_dimf 500 The number of nodes in the feature extractor input layer
hidden_dimf1 256 The number of nodes in the feature extractor first hidden layer
hidden_dimf2 256 The number of nodes in the feature extractor second hidden layer
hidden_dimc 256 The number of nodes in the classifier input layer
output_dimc 3 The number of nodes in the classifier output layer
hidden_dimd1 256 The number of nodes in the discriminator input layer
hidden_dimd2 256 The number of nodes in the discriminator hidden layer
output_dimd 1 The number of nodes in the discriminator output layer
tt_ratio 7:3 Ratio of samples in training set to test set
batch_size 64 The number of samples trained simultaneously in one iteration
epoch 200 The number of epochs in the training process
lr_f 5×10-5 The learning rate of the feature extractor in the training process
lr_c 5×10-5 The learning rate of the classifier in the training process
lr_d 1×10-4 The learning rate of the discriminator in the training process
grad_rev (λ) 5 Parameters for gradient reversal
Show more

The training process and final results of DANN are presented in Fig. 9 and Table 6. The training results indicate that when trained with inverse CDF sampled data, the DANN exhibits slightly lower prediction accuracy for low-Z materials than for mid-Z and high-Z materials. This phenomenon is consistent with the results obtained when the pretrained model performs inference directly in the target domain, which can be attributed to the significant change in the scattering angle distribution of low-Z materials after being coated with Al, making feature alignment more challenging than that for mid-Z and high-Z materials. Meanwhile, the introduction of a large gradient reversal coefficient causes the overall training loss to become negative because it includes the adversarial loss from the domain discriminator. However, this does not affect the evaluation of the test set, where the domain discriminator and gradient reversal are not involved. Therefore, the test loss, which was calculated solely based on the standard cross-entropy loss, remained positive. This behavior is expected and does not affect the assessment of the model performance on the target classification task.

Fig. 9
(Color online) Training process of DANN model on target dataset. Training and testing loss (left y-axis) and accuracy for different Z-classes (right y-axis) over epochs. a-c: Results of training with RS, KDE, and HS samples separately on the Al target domain. d-f: Results of training with RS, KDE, and HS samples separately on the PE target domain
pic
Table 6
Prediction accuracies on target dataset after DANN transfer
Dataset Sampling method Z categories Total
low-Z mid-Z high-Z
Al RS 0.941 0.941 0.980 0.954
KDE 0.861 0.991 0.998 0.950
HE 0.917 0.982 0.996 0.965
PE RS 0.962 0.961 0.981 0.968
KDE 0.974 0.999 1.000 0.991
HE 0.966 0.992 0.999 0.986
Show more
4

Results and Discussion

The overall prediction accuracies of the pre-trained, fine-tuned, and DANN models in the target domain are summarized in Table 7. The training results indicate that the introduction of the inverse CDF sampling method effectively improved the sample quality, thereby enhancing the prediction accuracy. Owing to the randomness of the RS method and the inherent black-box nature of neural networks, it is difficult to provide a clear physical explanation for the variation in the training results in the source and target domains using RS methods. However, because the inverse CDF sampling method effectively captures the scattering angle data distribution, it offers stronger interpretability to the result. Additionally, as stated in Ref. [48], 1,400 scattering instances are sufficient to construct a statistically reliable muon scattering angle probability distribution. Although we computed the CDF at selected data points, our global interpolation acted on 500,000 instances, which is far beyond this threshold. Therefore, in practical applications, as long as sample diversity is maintained, the total amount of training data required can be reduced.

Table 7
Prediction accuracies on total target dataset (all Z-categories) using different training methods. Pre-training is a direct prediction without transfer
Training method Dataset Sampling method
RS KDE HE
Pre-train Al 0.860 0.877 0.874
PE 0.909 0.980 0.988
Fine-tune Al 0.941 0.985 0.963
PE 0.968 0.996 0.988
DANN Al 0.954 0.950 0.965
PE 0.968 0.991 0.986
Show more

For the two target domain tasks considered, because the PE coating has a minimal impact on the muon scattering angle distribution, the prediction accuracy of the model in the PE task only slightly improved (close to 100%) after transfer learning. However, for the Al task, transfer learning improved the prediction accuracy by approximately 10%. When comparing the two transfer learning methods, fine-tuning and DANN, the training results showed that the fine-tuned model achieved slightly higher prediction accuracy than the DANN model. As seen in the results summarized in Sect. 3, fine-tuning benefits from the supervised learning process, leading to a more balanced prediction accuracy across different Z-class materials. In contrast, although the DANN improves the prediction accuracy of low-Z materials by more than 20% compared with the pre-trained model without transfer learning, its accuracy remains slightly lower than that of fine-tuning owing to the unsupervised training in the target domain. However, this also highlights one of the key advantages of DANN. It does not require any label from the target domain; however, it achieves a prediction accuracy comparable to that of fine-tuning. Moreover, because the DANN-based transfer learning approach focuses on extracting shared features between the source and target domains, whereas fine-tuning involves learning the entire feature space of the source domain before transferring it to the target domain, it may capture irrelevant features that do not contribute to the target domain task. The training process indicated that the DANN achieved greater stability and robustness than fine-tuning. This makes DANN particularly valuable for real-world applications in which fully unsupervised transfer learning is often required.

The parameters of the two models are in the 105~106 magnitude (the P&F model contains 72,579 parameters, and the DANN model contains 323,332 parameters). In our implementation, the two transfer learning methods require a running memory on the order of 102~103 MB, and run in a few minutes on a local Intel Core i9-14900 K (24-core, 32-thread, up to 6.0 GHz) computer. The model architectures, training process, and data loading were implemented using the PyTorch libraries. The above analysis proves that our model and algorithm have relatively low deployment and training costs.

5

Conclusion

We developed a novel transfer learning method for identifying the material Z-class using muon scattering angle data, which is an alternative to traditional identification methods based on complex physical model reconstruction. First, Monte Carlo simulations were conducted using Geant4 to obtain scattering angle data for specified materials in both the bare and coated states. A series of fitting techniques, including computation and interpolation, were employed to derive the probability distribution of the material-scattering angles. Based on this distribution, we generated a sampled dataset that better conforms to the overall distribution, resulting in an approximately 4% improvement in prediction accuracy in the target domain and enhanced physical interpretability of the training process.

In real-world application scenarios, the correspondence between the scattering angle data and the coated material is often unknown. To address this challenge, we introduced two novel lightweight neural networks trained using transfer learning. By employing either fine-tuned supervised learning or adversarial unsupervised learning on the coated material, these models transfer the source-domain knowledge learned from the bare material data to the target domain of the coated materials. In the PE target domain task, where the scattering angle distribution remained largely unchanged before and after coating, the prediction accuracy reached 99%. In contrast, for the more challenging Al-coated task, the prediction accuracy improved by approximately 10% compared to the pre-transfer learning model. The results demonstrate that our method achieves high prediction accuracy, even when the mapping between the coated material and scattering data is scarce or completely unknown. We analyzed the results for different tasks and scenarios, verifying that Z-class identification based on machine learning aligns with the physical principles of muon interactions, validating the feasibility of Z-class prediction for coated materials via transfer learning. Furthermore, this study revealed that features learned from data through machine learning exhibit transferability rather than merely relying on the repeated application of domain-specific expertise across different scenarios. This suggests that machine learning methods based on transfer learning can serve as a cost-effective training approach for conducting physics research in similar situations.

In future research, incorporating additional physical variables, such as muon momentum beyond the scattering angle into the training data, is expected to further improve the accuracy and robustness of the Z classification. Real-world detection challenges include detector noise and electronic fluctuations that bias scattering angle measurements, resolution limitations that reduce the model’s ability to distinguish materials with similar scattering properties, and system inefficiencies, such as dead time and low detection efficiency, which degrade the overall data quality. We may introduce noise-aware training to boost the robustness and generalization of the model in real environments. Furthermore, by introducing more statistics and enhancing the generalization ability of the model, transfer learning methods are expected to be extended to Z-value identification tasks in more complex scenarios in the future.

References
1.P. Shukla, S. Sankrith,

Energy and angular distributions of atmospheric muons at the Earth

(2016). arXiv:1606.06907
Baidu ScholarGoogle Scholar
2.S.H. Neddermeyer, C.D. Anderson,

Cosmic-ray particles of inter- mediate mass

. Phys. Rev. 54, 88-89 (1938). https://doi.org/10.1103/PhysRev.54.88.2
Baidu ScholarGoogle Scholar
3.M. Tanabashi, P.D. Grp, K. Hagiwara et al.,

Review of particle physics: particle data group

. Phys. Rev. D. 98, 030001 (2018). https://doi.org/10.1103/PhysRevD.98.030001
Baidu ScholarGoogle Scholar
4.N. Su, Y.Y. Liu, L. Wang et al.,

A Comparison of Muon Flux Models at Sea Level for Muon Imaging and Low Background Experiments

. Front. Energy. Res. 9, 750159 (2021). https://doi.org/10.3389/fenrg.2021.750159
Baidu ScholarGoogle Scholar
5.H. Miyadera, C.L. Morris,

Muon scattering tomography: review

. Appl. Opt. 61, C154-C161 (2022). https://doi.org/10.1364/AO.445806
Baidu ScholarGoogle Scholar
6.A. Hannah, A.F. Alrheli, D. Ancius et al., Muon Imaging. (International Atomic Energy Agency, Vienna, 2022), pp. 5-8
7.H.K.M. Tanaka, C. Bozza, A. Bross et al.,

Muography

. Nat. Rev. Methods Primers 3, 88 (2023). https://doi.org/10.1038/s43586-023-00270-7
Baidu ScholarGoogle Scholar
8.L.W. Alvarez, J.A. Anderson, F.E. Bedwei et al.,

Search for hidden chambers in the pyramids

. Science. 167, 3919 (1970). https://doi.org/10.1126/science.167.3919.832
Baidu ScholarGoogle Scholar
9.S. Chatzidakis, C.K. Choi, L.H. Tsoukalas,

Analysis of spent nuclear fuel imaging using multiple coulomb scattering of cosmic muons

. IEEE. T. Nucl. Sci. 63, 2866-2874 (2016). https://doi.org/10.1109/TNS.2016.2618009
Baidu ScholarGoogle Scholar
10.G. Leone, H.K.M. Tanaka, M. Holma et al.,

Muography as a new complementary tool in monitoring volcanic hazard: implications for early warning systems

. Proc. R. Soc. A. 477, 2255 (2021). https://doi.org/10.1098/rspa.2021.0320
Baidu ScholarGoogle Scholar
11.R. Han, Q. Yu, Z. Li et al.,

Cosmic muon flux measurement and tunnel overburden structure imaging

. JINST. 15, 06019 (2020). https://doi.org/10.1088/1748-0221/15/06/P06019
Baidu ScholarGoogle Scholar
12.Y.P. Cheng, R. Han, Z.W. Li et al.,

Imaging internal density structure of the Laoheishan volcanic cone with cosmic ray muon radiography

. Nucl. Sci. Tech. 33, 88 (2022). https://doi.org/10.1007/s41365-022-01072-4
Baidu ScholarGoogle Scholar
13.K.N. Borozdin, G.E. Hogan, C. Morris et al.,

Radiographic imaging with cosmic-ray muons

. Nature. 422, 277 (2003). https://doi.org/10.1038/422277a
Baidu ScholarGoogle Scholar
14.W.C. Priedhorsky, K.N. Borozdin, G.E. Hogan et al.,

Detection of high-Z objects using multiple scattering of cosmic ray muons

. Rev. Sci. Instrum. 74, 42944297 (2003). https://doi.org/10.1063/1.1606536
Baidu ScholarGoogle Scholar
15.L.J. Schultz, K.N. Borozdin, J.J. Gomez et al.,

Image reconstruction and material Z discrimination via cosmic ray muon radiography

. Nucl. Instrum. Meth. A. 519, 687-694 (2004). https://doi.org/10.1016/j.nima.2003.11.035
Baidu ScholarGoogle Scholar
16.P Lalor, A Danagoulian,

Fundamental limitations of dual energy X-ray scanners for cargo content atomic number discrimination

. Appl. Radiat Isotopes. 206, 111201 (2024). https://doi.org/10.1016/j.apradiso.2024.111201
Baidu ScholarGoogle Scholar
17.S. Xiao, W.B. He, M.C. Lan et al.,

A modified multi-group model of angular and momentum distribution of cosmic ray muons for thickness measurement and material discrimination of slabs

. Nucl. Sci. Tech. 29, 28 (2018). https://doi.org/10.1007/s41365-018-0363-7
Baidu ScholarGoogle Scholar
18.X.T. Ji, S.Y. Luo, Y.H. Huang et al.,

A novel 4D resolution imaging method for low and medium atomic number objects at the centimeter scale by coincidence detection technique of cosmic-ray muon and its secondary particles

. Nucl. Sci. Tech. 33, 2 (2022). https://doi.org/10.1007/s41365-022-00989-0
Baidu ScholarGoogle Scholar
19.P. Yu, Z.w. Pan, Z.Y. He et al.,

A new efficient imaging reconstruction method for muon scattering tomography

. Nucl. Instrum. Meth. A. 1069, 169932 (2024). https://doi.org/10.1016/j.nima.2024.169932
Baidu ScholarGoogle Scholar
20.X.C. Ming, H.F. Zhang, R.R. Xu et al.,

Nuclear mass based on the multi-task learning neural network method

. Nucl. Sci. Tech. 33, 48 (2022). https://doi.org/10.1007/s41365-022-01031-z
Baidu ScholarGoogle Scholar
21.G. L Wang, K.M. Chen, S.W. Wang et al.,

Beam based alignment using a neural network

. Nucl. Sci. Tech. 35, 75 (2024). https://doi.org/10.1007/s41365-024-01436-y
Baidu ScholarGoogle Scholar
22.Y. Xie, Q. Li,

A review of deep learning methods for compressed sensing image reconstruction and its medical applications

. Electronics. 11(4), 586 (2022). https://doi.org/10.3390/electronics11040586
Baidu ScholarGoogle Scholar
23.A. Bazzi, D.T.M. Slock, L. Meilhac et al.,

A comparative study of sparse recovery and compressed sensing algorithms with application to AoA estimation

. Paper presented at IEEE 17th International Workshop on Signal Processing Advances in Wireless Communications (SPAWC), Edinburgh, UK, July. 2016. https://doi.org/10.1109/SPAWC.2016.7536780
Baidu ScholarGoogle Scholar
24.A. Bazzi, D.T. Slock, and L. Meilhac,

A Newton-type Forward Backward Greedy method for multi-snapshot compressed sensing

. Paper presentede at 51st Asilomar Conference on Signals, Systems, and Computers, Pacific Grove, CA, USA, Oct. 2017. https://doi.org/10.1109/ACSSC.2017.8335537
Baidu ScholarGoogle Scholar
25.A. Radovic, M. Williams, D. Rousseau et al.,

Machine learning at the energy and intensity frontiers of particle physics

. Nature. 560, 41 (2018). https://doi.org/10.1038/s41586-018-0361-2
Baidu ScholarGoogle Scholar
26.G. Karagiorgi, G. Kasieczka, S. Kravitz et al.,

Machine learning in the search for new fundamental physics

. Nat. Rev. Phys. 4, 399412 (2022). https://doi.org/10.1038/s42254-022-00455-1
Baidu ScholarGoogle Scholar
27.A. Boehnlein, M. Diefenthaler, N. Sato et al.,

Colloquium: Machine learning in nuclear physics

. Rev. Mod. Phys. 94, 031003 (2022). https://doi.org/10.1103/RevModPhys.94.031003
Baidu ScholarGoogle Scholar
28.C.Y. Gao, X.Z. Tang, X.N. Chen et al.,

Convolutional neural network algorithm for material discrimination in muon scattering tomography

. Atom. Energy. Sci. Techno. 57, 353-361 (2023). https://doi.org/10.7538/yzk.2022.youxian.0055
Baidu ScholarGoogle Scholar
29.W.B. He, Dissertation, Nuclear Science and Technology University of Science and Technology of China, 2019 (in Chinese)
30.W.B. He, D.Y. Chang, R.G. Shi et al.,

Material discrimination using cosmic ray muon scattering tomography with an artificial neural network

. Radiat. Detect. Technol. Methods. 6, 254261 (2022). https://doi.org/10.1007/s41605-022-00319-3
Baidu ScholarGoogle Scholar
31.S.J. Pan, Q. Yang,

A Survey on Transfer Learning

. IEEE. T. Knoml. Data. En. 22, 1345 (2010). https://doi.org/10.1109/TKDE.2009.191
Baidu ScholarGoogle Scholar
32.F. Zhuang, Z.Y. Qi, K.Y. Duan et al.,

A Comprehensive Survey on Transfer Learning

. in Proceedings of the IEEE. 109, 43 (2021). https://doi.org/10.1109/JPROC.2020.3004555
Baidu ScholarGoogle Scholar
33.F.Z. Zhuang, P. Luo, Q. He et al.,

Survey on Transfer Learning Research

. J. Softw. 26, 26-39 (2015). https://doi.org/10.13328/j.cnki.jos.004631
Baidu ScholarGoogle Scholar
34.L.J. Schultz, G.S. Blanpied, K.N. Borozdin et al.,

Statistical Reconstruction for Cosmic Ray Muon Tomography

. IEEE. T. Image Process. 16, 1985-1993 (2007). https://doi.org/10.1109/TIP.2007.901239
Baidu ScholarGoogle Scholar
35.A Clarkson, D.G. Ireland, R.A. Jebali et al.,

Characterising encapsulated nuclear waste using cosmic-ray Muon Tomography (MT)

. Paper presented at the 4th International Conference on Advancements in Nuclear Instrumentation Measurement Methods and their Applications (ANIMMA), Lisbon, Portugal, Apr. 2015. https://doi.org/10.1109/ANIMMA.2015.7465529
Baidu ScholarGoogle Scholar
36.J.M. Durham,

Cosmic Ray Muon Radiography Applications in Safeguards and Arms Control

(2018). arXiv:1808.06681
Baidu ScholarGoogle Scholar
37.J. Yosinski, J. Clune, Y. Bengio et al., How transferable are features in deep neural networks? In: Advances in Neural Information Processing Systems 27 (NeurIPS 2014), (Montreal, Canada, December 2014) pp. 3320-3328. https://doi.org/10.48550/arXiv.1411.1792.
38.Y. Ganin, E. Ustinova, H. Ajakan et al., in Domain Adaptation in Computer Vision Applications, ed. by G. Csurka (Springer, Cham, 2017), pp. 189209. https://doi.org/10.1007/978-3-319-58347-1_10
39.S. Agostinelli, J. Allison, K. Amako et al.,

Geant4—a simulation toolkit

. Nucl. Instrum. Meth. A. 506, 250-303 (2003). https://doi.org/10.1016/S0168-9002(03)01368-8
Baidu ScholarGoogle Scholar
40.C. Hagmann, D. Lange, and D. Wright,

Cosmic-ray shower generator (CRY) for Monte Carlo transport codes

. Paper presented at the 2007 IEEE Nuclear Science Symposium Conference Record, Honolulu, HI, USA, Oct. 2007. https://doi.org/10.1109/NSSMIC.2007.443720
Baidu ScholarGoogle Scholar
41.A. Halevy, P. Norvig, F. Pereira,

The unreasonable effectiveness of data

. IEEE. INTELL. SYST. 24, 8-12 (2009). https://doi.org/10.1109/MIS.2009.36
Baidu ScholarGoogle Scholar
42.J. Deng, W. Dong, R. Socher et al.,

ImageNet: A large-scale hierarchical image database

. Paper presented at the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, June. 2009. https://doi.org/10.1109/CVPR.2009.5206848
Baidu ScholarGoogle Scholar
43.Y.C. Chen,

A tutorial on kernel density estimation and recent advances

. Biostatistics & Epidemiology, 1, 161187(2017). https://doi.org/10.1080/24709360.2017.1396742
Baidu ScholarGoogle Scholar
44.Goodfellow , Y. Bengio, A. Courville, Deep Learning. (MIT Press, Cambridge, 2016). pp. 131-134
45.B. Sun, K. Saenko. Deep CORAL: Correlation alignment for deep domain adaptation. In: G. Hua, H. Jégou, (eds) Computer Vision – ECCV 2016 Workshops. ECCV 2016. Lecture Notes in Computer Science, vol 9915. Springer, Cham. pp. 443450. https://doi.org/10.1007/978-3-319-49409-8_35
46.A. Gretton, K.M. Borgwardt, M.J. Rasch et al.,

A Kernel Two-Sample Test

. J. MACH. LEARN. RES. 13, 723-773 (2012). http://jmlr.org/papers/v13/gretton12a.html
Baidu ScholarGoogle Scholar
47.I.J. Goodfellow, J. Pouget-Abadie, M. Mirza et al.,

Generative adversarial networks

. arXiv:1406.2661 (2014) https://doi.org/10.48550/arXiv.1406.2661
Baidu ScholarGoogle Scholar
48.Y.P. Li, X.Z. Tang, X. N Chen et al.,

Experimental study on material discrimination based on muon discrete energy

. Acta Phys. Sin. 72, 026501 (2023) https://doi.org/10.7498/aps.72.20221645
Baidu ScholarGoogle Scholar
Footnote

The authors declare that they have no competing interests.