WorksPhysics and Astronomy
Reconstructing the depth of first interaction in extensive air showers from fluorescence detector profiles with a physics-motivated neural network
Abstract
We present a physics-motivated neural network that reconstructs, event by event, the depth of the first interaction of ultra-high-energy cosmic rays from longitudinal profiles measured by fluorescence detectors. The network couples a convolutional encoder to a decoder that implements the Gaisser-Hillas function and predicts quantiles of the target, providing a per-event uncertainty estimate. It is trained and evaluated on four million proton- and iron-induced showers between and eV, simulated with the hadronic interaction models EPOS LHC-R and Sibyll 2.3d and processed by an end-to-end simulation of the fluorescence detector response. Despite detector effects, the reconstruction retains useful information for protons, achieving a mean absolute error of about 21 gcm for primary energies around eV, whereas for iron most of the information is lost. The reconstructed distributions preserve the exponential shape of the true ones, so the proton-air interaction length can be recovered from their tail with a model-related systematic uncertainty of approximately 4%. This value is limited mainly by the choice of the hadronic interaction model and is nearly insensitive to iron contamination. These results show that the depth of the first interaction can be reconstructed under realistic detection conditions, offering a complementary route to measurements of the proton-air cross section and mass-composition studies.
Introduction
Among the properties of ultra-high-energy cosmic rays (UHECRs), charged particles with energies above eV, the characterization of their mass composition remains an open problem in astroparticle physics [1]. Fluorescence detectors measure the longitudinal development of extensive air showers (EAS) initiated by UHECRs in the atmosphere, from which the depth of shower maximum, , can be determined [2]. The distribution of is used to investigate the mass composition of UHECRs [3, 4] and to constrain the proton–air cross section [5, 6]. However, is intrinsically affected by fluctuations arising from both the depth of the first interaction of the primary particle, , and the subsequent shower development, characterized by . The latter has been modeled using simulations [7], but its fluctuations, driven by the stochastic nature of shower development, weaken the sensitivity of to the properties of the primary particle.
The depth of the first interaction is more directly related to the primary particle. For a primary of mass and energy , follows an exponential distribution with mean , where is the mean target mass of air [7]. This distribution provides access to nucleus–air cross sections at center-of-mass energies well beyond those achievable at particle accelerators [6]. Reconstructing can therefore provide an estimate of this distribution, offering a complementary approach to cross-section measurements and mass-composition studies.
Estimating for individual showers is, however, far from straightforward. The first interaction takes place high in the atmosphere, where the early shower development produces insufficient fluorescence light for detection, requiring to be inferred from the subsequent profile. Ref. [8] showed that the shape of the longitudinal profile is correlated with , enabling event-by-event estimates of . Previous studies have applied machine-learning techniques to estimate from features extracted from longitudinal profiles [9]. However, these studies relied on profiles obtained directly from shower simulations. The detector response was either neglected, applied a posteriori, or approximated through fixed truncations of the observed depth range. Consequently, the reconstruction of under realistic observation conditions remains to be investigated.
Beyond the reconstruction of , machine learning methods are increasingly used in cosmic-ray physics [10, 11, 12], yet conventional approaches often provide limited physical interpretability and point estimates without quantifying predictive uncertainty. Moreover, their learned representations are not necessarily associated with interpretable physical quantities. Physics-informed machine learning addresses these limitations by incorporating physical knowledge into network architectures or training procedures [13]. For example, autoencoder latent variables can be constrained to represent physical-model parameters [14], linking data-driven predictions to interpretable quantities. To our knowledge, this approach has not yet been applied to air-shower profile reconstruction.
In this work, we present a physics-motivated neural network that reconstructs event by event from the longitudinal profiles. To obtain realistic inputs, the detector response was simulated, accounting for the emission, propagation, and detection of fluorescence light, the event reconstruction, and quality cuts similar to those applied to real data. The network is an autoencoder whose decoder implements the Gaisser–Hillas function, so that part of its latent representation corresponds to physical parameters of the profile. In addition to estimating , the network provides event-level uncertainty estimates while preserving the exponential shape of the distribution. The method is applied to proton- and iron-induced showers between and eV simulated with two hadronic interaction models, without informing the network of the primary type. We quantify the information lost in the detection process by comparing detector-level with ideal profiles, and the dependence of the reconstruction on the hadronic interaction model by training and testing the network on different models.
This paper is organized as follows. Section 2 describes the generation of simulated extensive air-shower datasets. Section 3 presents the deep-learning methodology, focusing on the network architecture, loss function, and training procedure. Section 4 presents and discusses the model’s performance in event-by-event reconstruction, while Section 5 investigates its application to estimating the proton–air mean free path. Finally, Section 6 summarizes the main conclusions and outlines future directions.
Dataset simulation and pre-processing
The dataset used to train and evaluate the model comprises air showers simulated with CONEX [15, 16]. Four libraries of events each were produced, covering proton and iron primaries and the hadronic interaction models EPOS LHC-R [17] and Sibyll 2.3d [18]. Primary energies were sampled uniformly in between and eV, and all showers were simulated at a zenith angle of . This inclination provides a sufficiently large slant depth to simulate nearly the full longitudinal development of each shower.
The response of a fluorescence detector to these showers was simulated with the framework described in Ref. [19]. For each shower, a geometry was drawn, with a core position sampled uniformly within a radius of 50 km around the detector, a new zenith angle sampled in uniformly in , and an azimuth angle drawn uniformly in . The zenith angle used in the CONEX simulations was chosen to ensure sufficiently long longitudinal profiles and does not constrain the zenith angles of the detection geometries. The CONEX profiles, expressed as energy deposit per unit slant depth, were then mapped onto the shower axes defined by these new geometries. Specifically, the slant depths were converted into positions along each axis using the atmospheric model of the framework. The fluorescence photons produced along the resulting shower axes were then propagated to the detector, accounting for atmospheric scattering and attenuation. The simulation also includes the electronic noise of the detector, the trigger logic, and the event reconstruction, which yields the reconstructed longitudinal profile and primary energy. Only the portions of the profiles above ground and within the field of view contribute to the detector signal.
The detector configuration was modeled after the fluorescence telescopes of the Pierre Auger Observatory [20, 21]: an aperture area of 3.8 m, a field of view spanning elevations from 1.5° to 30°, a camera with 1.5° pixels, and an altitude of 1400 m above sea level. A total (optical and quantum) efficiency of 20% was assumed [22]. Atmospheric conditions and fluorescence emission were modeled with the default settings of Ref. [19], including its atmospheric density profile, aerosol model, and fluorescence yield.
The detected profiles were subjected to quality cuts similar to those of Ref. [23]. The observed track had to span at least 300 g cm and contain the reconstructed . To reproduce the geometric selection applied to real data, where it suppresses direct Cherenkov contamination, the angle between the shower axis and the viewing direction of every pixel with signal had to exceed 20°. In addition, at least 200 g cm had to be observed before , since the rising edge of the profile carries most of the information on [8].
For each shower, geometries were redrawn until the event triggered and passed all cuts. This procedure is not intended to reproduce the population of events selected in measured data. Instead, it ensures that all simulated showers contribute to the training and evaluation datasets, providing a controlled test of the reconstruction in which the original distribution is preserved. The dependence of the selection efficiency on and its implications for the proton–air interaction length measurement are discussed in § 5. Figure 1 shows the distributions of the observed track length and of the depth observed before .
Figure 1. Distributions of the observed track length (left) and of the depth observed before (right) for the events in each library of detector-level profiles, after all quality cuts. The dotted vertical lines indicate the minimum values required by the selection.
After the detector simulation, the following quantities were stored for each event: the observed longitudinal profile, i.e. the slant depths and the corresponding energy deposits , and the reconstructed primary energy . We also stored the parameters of the Gaisser–Hillas (GH) function [24],
fitted to the measured points, namely , , and , with fixed at . We note that is a shape parameter of the fit with no direct physical relation to the depth of the first interaction, and it may even take negative values. Finally, we stored the depth of the first interaction, , which is the target of the model. Figure 2 shows the distributions for each primary and hadronic interaction model in the energy range of .
Figure 2. Distributions of the depth of the first interaction for proton and iron primaries simulated with EPOS LHC-R and Sibyll 2.3d, shown for .
The detected events were grouped into three datasets according to the hadronic interaction model: one containing only EPOS LHC-R events, one containing only Sibyll 2.3d events, and one combining both, hereafter referred to as Mix. Each dataset contains equal numbers of proton- and iron-induced showers, so the network is not informed of the primary type.
To quantify the information lost in the detection process, we built a second set of libraries from the same showers and with the same partition, using the profiles produced directly by Conex instead of the detector-level ones. These libraries, hereafter referred to as ideal, contain the slant depths and energy-deposit profile in steps of , the true primary energy, the GH parameters, and . Since a Conex profile starts at the first interaction, its onset alone would reveal . To prevent this leakage, each profile is restricted to the range [8], where is the true shower maximum extracted from Conex.
Before training, the data were preprocessed as follows. The events of each dataset were split into training (70%), validation (15%), and test (15%) subsets, stratified by primary and by bins of simulated energy. Unlike the ideal profiles, detector-level profiles have variable length and nonuniform sampling. They were therefore zero-padded to 100 bins and accompanied by a binary mask that flags the measured points. The energy deposit was expressed as to compress its dynamic range, which spans several orders of magnitude. The target was transformed to , with in g cm, which reduces the skewness of its exponential distribution and avoids the logarithm of zero.
Because the input features differ by many orders of magnitude, they were rescaled to contribute comparably to the gradient updates: profile values, slant depths, GH parameters, and energies were min–max normalized to , and the transformed target was standardized to zero mean and unit variance. The normalization parameters were computed from the training subsets, separately for ideal and detector-level libraries, and applied unchanged to validation and test subsets. No information from the test data therefore enters the preprocessing. Figure 3 shows examples of profiles from both libraries.
Figure 3. Examples of detector-level and ideal longitudinal profiles for proton- and iron-induced showers generated with EPOS LHC-R, with primary energies of and eV, respectively. A Gaisser–Hillas fit to each profile is shown. Profiles are displayed in linear scale for clarity, although the network operates on .
Physics-motivated neural network
A central challenge in this work was to design a neural network that explicitly incorporates physical knowledge into the reconstruction of . Two features of the problem guided this design. First, the longitudinal shower profile has a well-known shape, accurately described by the Gaisser–Hillas function of Eq. (1). Second, follows an exponential distribution (Figure 2) and is only partially constrained by the profile. The architecture therefore embeds the GH function in the reconstruction pipeline, so that the network must describe each profile through physically meaningful parameters. In addition, it estimates the conditional distribution of instead of a single value per event. The spread of the predictions then reflects the fluctuations of the shower development, and combining the predicted distributions of all events recovers the exponential shape of the distribution, whose slope is related to the proton–air cross section. This section describes how these two elements were incorporated into the network.
Architecture
The architecture, shown in Figure 4, was inspired by the Autoencoder with Latent Physics (ALPS) [14]. In ALPS, an estimator infers the free parameters of a known physical model, and the model itself generates the reconstruction that is compared with the observations. We adapted this idea to our problem: a convolutional encoder maps the profile to a latent representation, which feeds two output branches. In the physics branch, the GH function takes the role of the physical model, while the quantile branch, which has no counterpart in ALPS, estimates the distribution of .

Figure 4. Network architecture for reconstructing . Insets show a proton shower simulated with EPOS LHC-R at from the test subset, reconstructed by the Mix network (§ 3.3). They show the input profile, its GH reconstruction, and the predicted quantiles, with the predicted median highlighted and the true indicated by the dashed line. Gray numbers denote tensor dimensions, and loss terms are indicated beside their corresponding outputs.
The inputs are the slant depths and energy deposits of the profile, the mask that flags the measured points, and the reconstructed energy , all preprocessed as described in § 2. The two profile sequences are concatenated and processed by a temporal convolutional network (TCN) [25], composed of four residual blocks [26] with 64 filters, kernel size 3, and dilation rates of 1, 2, 4, and 8. Each block applies two dilated convolutions, each followed by layer normalization [27] and a LeakyReLU activation, with a dropout rate of 0.05 between them. The mask is applied to the input and to the output of every block, so that the padded bins never contribute to the result. Masked global average and maximum pooling then reduce the sequence to 128 features, independently of the number of measured points, and the energy is appended to this vector. Three fully connected layers of 64, 32, and 16 units with LeakyReLU activations map the result to a 16-dimensional latent representation, which is shared by the two output branches.
The physics branch predicts the GH parameters , , and through three units with sigmoid activation, whose outputs lie in the normalized range of each parameter. A decoder layer with no trainable weights maps these values back to physical units and evaluates Eq. (1), with , at the measured depths of the event. The result is a reconstructed profile in the same representation as the input. This branch forces the latent representation to encode a profile consistent with the GH parametrization and makes the bottleneck of the branch physically interpretable, since each of its outputs is a GH parameter. In addition, as discussed in § 3.2, the comparison between the reconstructed and input profiles provides a training signal that does not rely on simulated quantities.
Unlike the GH parameters, however, is not fully determined by the profile. The stochastic nature of air-shower development limits the reconstruction of from the longitudinal profile alone. Fluctuations in the first hadronic interactions make the distance between and vary considerably from shower to shower [7], and the shape of the profile only partially constrains it [8]. As a consequence, a given profile is compatible with a range of values of . A single estimate per event discards this spread and tends to concentrate the reconstructed values around the mean, distorting the exponential shape of the reconstructed distribution [9]. Our network therefore estimates, for each event, the conditional distribution of given the observed profile, through seven quantiles predicted by the quantile branch.
The quantile branch receives the latent vector concatenated with the predicted . This direct connection exploits the correlation between the two depths. A hidden layer of 16 units feeds two outputs: the lowest quantile and six increments . The quantiles are then obtained as
which makes them monotonic by construction and prevents the quantile crossing that affects independently estimated quantiles [28, 29]. We use levels, , defined in the space of the standardized target (§ 2). Since this transformation is monotonic, the predicted quantiles are converted back to without changing their levels. The median is taken as the point estimate of .
The network was implemented in TensorFlow [30] using the Keras API [31] and comprises 99514 trainable parameters, 89% of which belong to the TCN. Hyperparameter selection was performed using a combination of random search and grid search [32], exploring a wide range of configurations and selecting those that yielded the lowest validation loss. The same architecture was used for the ideal profiles, with the true primary energy provided as input.
Loss function
The network was trained by minimizing a weighted sum of one loss per output,
The weights were not fixed during training, and their schedule is described in § 3.3.
The first term, , is the mean squared error between the predicted GH parameters and those fitted to the profile (§ 2). The second is the pinball loss [33, 34], averaged over the quantile levels,
where is the standardized target and is the quantile predicted at level . The expected pinball loss is minimized by the conditional quantile of level , so the seven outputs approximate the conditional distribution of given the profile and the energy. The median is used as the point estimate, , and defines a per-event prediction interval with a nominal coverage of 90%. Figure 5 shows the predictions for three profiles with different values, using networks trained on the three detector-level datasets described in § 3.3.
Figure 5. Predicted quantiles of for three proton-induced longitudinal profiles from the EPOS LHC-R test dataset, using networks trained on the three detector-level datasets as described in § 3.3. The profiles correspond to the 10th (p10), 50th (p50), and 90th (p90) percentiles of the dataset’s distribution. The star marks the true , the large circle the predicted median, and the small circles the predicted quantiles. The outermost quantiles delimit the central 90% interval.
The third term compares the profile reconstructed by the physics branch with the input profile at measured points only, using the mean squared error. The two physics terms play complementary roles: anchors the predicted parameters to the fit, while requires them to reproduce the measured profile itself. Both terms depend only on the measured profile and on a fit to it. Of the three terms, only requires the simulated , so the physics terms do not rely on simulated quantities.
Training
We trained the network on an NVIDIA GeForce RTX 4060 Ti GPU with a batch size of 128 for up to 300 epochs, requiring less than one minute per epoch. This short training time allowed us to train separate networks for each dataset in § 2 (EPOS LHC-R, Sibyll 2.3d, and Mix), for both detector-level and ideal profiles. The training subsets contain events for Mix and events for each single-model dataset. We used the Adam optimizer [35], with a learning rate linearly increased during the first epoch to . The learning rate was subsequently reduced by a factor of 0.3 whenever the validation mean absolute error (MAE) of failed to improve for 10 epochs, down to a minimum of . Since the pinball loss at is proportional to the absolute error, the MAE is the natural metric for the median estimate.
The loss weights in Eq. (3) followed a schedule to improve convergence. During the first 30 epochs, . They were then changed to , shifting the emphasis toward while retaining the reconstruction term [36]. Training was stopped if the validation MAE, expressed in , failed to improve for 30 epochs after the transition, and the weights from the best epoch were retained.
Results: Event-by-event reconstruction
Information loss in the detection process
We first assess how detection affects the information on contained in the longitudinal profiles by comparing two networks with identical architectures, trained on ideal and detector-level profiles. Both networks were trained and evaluated on the Mix dataset, which includes both hadronic interaction models and both primaries, and their performance is shown separately for each primary. Figure 6 shows the true versus predicted in the representative energy bin of . The mean absolute error is reported in each plot alongside the Pearson correlation coefficient () and the coefficient of determination ().

Figure 6. True versus predicted for (a) protons and (b) iron nuclei in the energy bin . Results are shown for networks trained on detector-level (top) and ideal (bottom) profiles. Both networks were trained and evaluated on the Mix dataset, containing events simulated with EPOS LHC-R and Sibyll 2.3d for both primary types.
For protons, the ideal profiles yield and MAE . With the detected profiles, the correlation decreases to and the absolute error increases to MAE . Despite this degradation, the results indicate that event-by-event reconstruction of remains feasible under realistic detection conditions.
For iron, reconstruction is already more challenging at the ideal-profile level, with a correlation of , which drops to with the detected profiles. The mean absolute errors are comparable to the iron interaction mean free path, , highlighting the difficulty of resolving fluctuations in the depth of the first interaction. The degradation due to detector effects is consistent with Figure 1 (right): because iron showers develop earlier, many selected events only marginally satisfy the requirement that at least of the profile be observed before . Consequently, much of the rising edge, which contains important information about , remains unobserved.
The performance of our method improves with increasing primary-particle energy. The degradation observed when using detector-level profiles, compared with ideal profiles, is consistent across all trained networks, regardless of the hadronic interaction model used for evaluation. In all cases, the reconstruction errors and correlation coefficients show only minor variations between hadronic interaction models. Figure 7 illustrates this behavior for the network trained on the Mix dataset. In the following, we focus on the performance of models trained and evaluated using detector-level profiles.
Figure 7. Mean absolute error as a function of primary-particle energy for neural networks trained and evaluated on (a) detector-level longitudinal profiles and (b) ideal profiles. Both networks were trained on the Mix dataset, containing events simulated with EPOS LHC-R and Sibyll 2.3d for both primary types.
Model performance on detector-level profiles
In addition to the MAE, we also evaluate the mean () and standard deviation () of the residuals, , which quantify the bias and resolution, respectively. Since the point estimate is the conditional median, is not expected to vanish exactly even for an ideal estimator when the conditional distribution is asymmetric. Figure 8 shows these metrics as functions of primary energy for different combinations of hadronic interaction models used in training and evaluation.
Figure 8. Energy-dependent bias (left) and resolution (right) of the predictions of each neural network for protons and iron across the different hadronic models used in the training and evaluation of the networks.
The resolution remains below 40 g cm for protons and is approximately 10 g cm for iron. For protons, the resolution improves with increasing energy and depends on the hadronic model used to generate the profiles: Sibyll-generated profiles yield consistently smaller values than EPOS-generated profiles, regardless of the training model. For iron, the resolution is nearly constant with energy and shows little dependence on the hadronic model.
The most prominent differences appear in the bias, which depends on the combination of models used for training and evaluation. Training on the combined Mix dataset generally reduces the model-dependent bias compared with training on either hadronic model alone. Nevertheless, for networks trained on one model and evaluated on the other, the absolute bias generally remains below approximately 10 g cm at energies above eV.
To assess the calibration of the predicted uncertainties, we examined the empirical coverage of the interval , i.e. the fraction of events whose true falls inside it (Table 1). When the network is trained and tested with the same hadronic interaction model, the coverage lies between 89.4% and 90.0% for both primaries, in agreement with the nominal 90%, and is stable with energy. In the cross-model tests, the misses become asymmetric. The network trained on EPOS LHC-R undercovers the Sibyll 2.3d events (86.7% for protons and 85.2% for iron), with the true above in about 10% of the cases. In the opposite direction, the coverage remains close to nominal, but the misses concentrate below . The network trained on the Mix dataset reaches 88.7–91.2% in both test datasets. The direction of these deviations agrees with the model-dependent bias of the interaction length discussed in § 5.
| Train | Test | Proton | Iron | ||||
| Cov. | Below | Above | Cov. | Below | Above | ||
| EPOS LHC-R | EPOS LHC-R | 89.4 | 4.8 | 5.8 | 89.7 | 5.6 | 4.7 |
| Sibyll 2.3d | Sibyll 2.3d | 90.0 | 4.8 | 5.2 | 89.8 | 5.4 | 4.9 |
| Mix | EPOS LHC-R | 90.5 | 5.5 | 4.0 | 91.2 | 6.0 | 2.8 |
| Mix | Sibyll 2.3d | 88.9 | 4.1 | 7.0 | 88.7 | 4.7 | 6.6 |
| EPOS LHC-R | Sibyll 2.3d | 86.7 | 3.6 | 9.7 | 85.2 | 4.2 | 10.6 |
| Sibyll 2.3d | EPOS LHC-R | 90.7 | 6.6 | 2.8 | 91.2 | 7.0 | 1.9 |
Table 1. Empirical coverage (%) of the interval , whose nominal coverage is 90%, for each combination of training and test datasets, integrated over energy, together with the fractions of events with the true below and above (nominal 5% each). The statistical uncertainties are about 0.1%.
We also assess whether the method reproduces the full distributions, beyond their first moments. Figure 9 compares reference and reconstructed distributions for protons and iron in the energy bin of , using different combinations of hadronic interaction models for training and evaluation. Each predicted distribution was built by sampling, for every event, the conditional distribution defined by the seven quantiles predicted by each neural network, while the true distributions were built from the true values of each dataset. Each panel reports the mean interaction depths, and , obtained from exponential fits to each distribution in dataset and network predictions, respectively.
Figure 9. True distributions from the datasets (MC) and from the predictions of each neural network (DNN) for protons and iron across different hadronic models used in the training and evaluation of the networks. The energy bin is .
The results show a clear dependence on the hadronic interaction model. Distributions from networks trained on one model and evaluated on profiles generated with the other can overestimate or underestimate the mean interaction depth. This is particularly pronounced for networks trained on Sibyll 2.3d and evaluated on EPOS LHC-R profiles, where the reconstructed mean interaction depths exceed the reference values for both protons and iron. These discrepancies indicate that, although the network reproduces important features of the distributions, differences between hadronic models can introduce systematic shifts in the reconstructed distributions.
Results: Proton–air interaction length reconstruction
Figure 9 showed the distributions of each primary in a single energy bin, from which the interaction lengths follow directly as . In this section, we extend this analysis to proton showers over the full energy range of this study. Similarly to the analyses of the distribution [5, 6], the proton–air interaction length was estimated from an exponential fit to the tail of the reconstructed distribution, defined by the 20% most deeply penetrating events, in energy bins of . Since the fit is applied to itself, no conversion factor between the fitted slope and is required. The results are shown in Figure 10.
Figure 10. Proton–air interaction length as a function of energy. The gray lines show of Sibyll 2.3d (dashed) and EPOS LHC-R (dash-dotted) from Conex, and the black circles the mean true of the protons in the Mix test set. Colored markers show the interaction lengths reconstructed by the Mix network on the Mix (circles), EPOS LHC-R (squares), and Sibyll 2.3d (triangles) test sets. The lines show the cross-model tests, Sibyll 2.3d EPOS LHC-R (solid) and EPOS LHC-R Sibyll 2.3d (dotted), and the diamonds their average. The reconstructed values were obtained from an exponential fit to the 20% most deeply penetrating events of the reconstructed distribution, in bins of .
Applied to the true values, the same procedure reproduces the interaction length of Conex within the statistical uncertainties, with average deviations below (), so the estimator itself introduces no measurable bias. When training and test share the same hadronic interaction model (not shown in Figure 10 for clarity), the reconstructed interaction length agrees with the true value within for Sibyll 2.3d and () for EPOS LHC-R, the latter mainly at the lowest energies. In the cross-model tests, the bias reaches () for the network trained on Sibyll 2.3d and applied to EPOS LHC-R, and () in the opposite case. Since the tail slope is insensitive to a global shift of the predictions, these deviations reflect a different scale of the reconstructed distributions.
The network trained on the Mix dataset lies between these cases, with nearly energy-independent biases of (+4.7%) on EPOS LHC-R and (−3.1%) on Sibyll 2.3d. Accordingly, the average of the two cross-model results agrees with that of the Mix network, which therefore behaves as an effective model between the two. Training on both models reduces but does not remove the model dependence, and half the difference between the two tests, about 4% on , can be taken as a systematic uncertainty.
The result is robust against the presence of heavier primaries. Since protons penetrate deeper on average, the tail of the distribution is dominated by them: increasing the iron fraction of the test sample up to 60% changes the reconstructed by less than 1%, although the network was trained with equal numbers of proton and iron showers. Intermediate primaries, in particular helium, are expected to have a stronger impact, since their distribution overlaps more with the proton tail. The fraction of 20% follows the choice of Ref. [5], where it was shown to keep the bias from helium fractions up to 25% below the statistical uncertainty of the analysis. Helium was not included in our simulations, and its effect on the tail remains to be quantified.
The datasets used in this work were constructed so that the event selection does not distort the distributions (§ 2). In measured data, however, each shower is observed with a single geometry, and showers with deeper first interactions are more likely to fail the trigger or have their outside the field of view. To assess this effect, we weighted the test events by the selection efficiency obtained from simulations without redrawing geometries for each shower, thereby reproducing the distribution of the selected events. The interaction length inferred by the Mix network above decreases by about 12% under this reweighting, while the model dependence remains unchanged. Fiducial cuts on the shower geometry, as used in the hybrid analyses of the Pierre Auger Observatory [5, 20], largely suppress this effect. Requiring the field of view to cover slant depths beyond and the impact parameter to be below 15 km reduces the bias to about 1% without increasing the model-related systematic uncertainty, while reducing the available event sample by a factor of 2–4. At lower energies, energy-dependent cuts, including a requirement on the upper edge of the field of view, would be necessary. Such fiducial cuts must therefore be included in an application to data.
Conclusions
We have presented a physics-motivated neural network that reconstructs the depth of the first interaction, , of individual air showers from their longitudinal profiles measured by a fluorescence detector. The network combines a temporal convolutional encoder with two branches: a decoder that implements the Gaisser–Hillas function, which ties part of the latent representation to physical parameters of the profile, and a quantile branch that estimates the conditional distribution of for each event. The method was trained and evaluated on proton- and iron-induced showers between and , simulated with EPOS LHC-R and Sibyll 2.3d and processed by an end-to-end simulation of the detector response with quality cuts similar to those applied to real data.
Comparing networks trained on ideal and detector-level profiles quantifies the information lost in the detection process. For protons, the correlation between reconstructed and true decreases from 0.87 to 0.75 in the energy bin , and the mean absolute error of the detector-level reconstruction decreases from about 25 to 18 over the full energy range, whereas it is nearly constant for ideal profiles. For iron, the information on is limited already at the ideal level and is largely lost after detection, since iron showers develop early and the rising edge of their profiles is mostly unobserved. The resolution depends only weakly on the hadronic interaction model, while the bias depends on the combination of models used for training and evaluation and remains below about above in the cross-model tests.
The predicted distributions reproduce the exponential shape of the true distributions. This allows the proton–air interaction length to be estimated from an exponential fit to their tail, without the simulation-based conversion required in analyses of the distribution. When training and test share the same hadronic model, the interaction length is recovered within 2%. The network trained on both models yields biases of +4.7% and −3.1% on EPOS LHC-R and Sibyll 2.3d, respectively, and behaves as an effective model between the two. Half of this difference, about 4%, provides an estimate of the model-related systematic uncertainty. The result changes by less than 1% for iron fractions of up to 60% in the test sample.
These results show that the event-by-event reconstruction of is feasible for protons under realistic detection conditions and that the reconstructed distributions offer a complementary route to measurements of the proton–air cross section. Several aspects must be addressed before an application to data. The selection efficiency depends on and must be controlled, for example with fiducial cuts on the geometry, which we have shown to reduce its effect on the reconstructed interaction length. The model dependence was assessed with only two hadronic interaction models and should be extended to others. Intermediate primaries, in particular helium, were not simulated, and their effect on the tail of the distribution remains to be quantified. Despite these limitations, since the physics terms of the loss do not rely on simulated quantities, they could be used to adapt the network to measured profiles, reducing its dependence on simulations.
Acknowledgments
This study was financed, in part, by the São Paulo Research Foundation (FAPESP), Brazil. Process Numbers 2021/01089-1 and 2024/08946-5. We thank the National Laboratory for Scientific Computing (LNCC/MCTI, Brazil) for providing HPC resources on the SDumont supercomputer (http://sdumont.lncc.br).
Data availability
Data supporting this study are available from the corresponding author upon reasonable request.
References
- [1]K.-H. Kampert and M. Unger, Measurements of the cosmic ray composition with air shower experiments, Astropart. Phys. 35 (2012) 660 [1201.0018].DOI
- [2]V. de Souza, Measurements of the depth of maximum of air-shower profiles at the Pierre Auger Observatory and their composition implications, 1701.06812.arxiv.org/abs/1701.06812
- [3]J. Bellido, Depth of maximum of air-shower profiles at the Pierre Auger Observatory: measurements above 10¹⁷.² eV and composition implications, in 35th International Cosmic Ray Conference (ICRC2017), vol. ICRC2017, p. 506, 2017, https://pos.sissa.it/301/506.
- [4]R. Alves Batista, J. Biteau, M. Bustamante, K. Dolag, R. Engel, K. Fang et al., Open questions in cosmic-ray research at ultrahigh energies, Front. Astron. Space Sci. 6 (2019) 23 [1903.06714].
- [5]PIERRE AUGER collaboration, Measurement of the proton-air cross section at √s = 57 TeV with the Pierre Auger Observatory, Phys. Rev. Lett. 109 (2012) 062002 [1208.1520].pubmed.ncbi.nlm.nih.gov/23006259
- [6]TELESCOPE ARRAY collaboration, Measurement of the proton-air cross section with Telescope Array’s Middle Drum detector and surface array in hybrid mode, Phys. Rev. D 92 (2015) 032007 [1505.01860].
- [7]R. Ulrich, J. Blümer, R. Engel, F. Schüssler and M. Unger, On the measurement of the proton-air cross section using air shower data, New J. Phys. 11 (2009) 065018 [0903.0404].DOI
- [8]S. Andringa, R. Conceição and M. Pimenta, Mass composition and cross-section from the shape of cosmic ray shower longitudinal profiles, Astropart. Phys. 34 (2011) 360.DOI
- [9]T. Yapici, A method for determining the mass composition of ultra-high energy cosmic rays by predicting the depth of first interaction of individual extensive air showers, Ph.D. thesis, Michigan Technological University, Houghton, Michigan, 2015. https://digitalcommons.mtu.edu/etds/1019/.DOI
- [10]PIERRE AUGER collaboration, Inference of the mass composition of cosmic rays with energies from 10¹⁸·⁵ to 10²⁰ eV using the Pierre Auger Observatory and deep learning, Phys. Rev. Lett. 134 (2025) 021001 [2406.06315].
- [11]PIERRE AUGER collaboration, Deep-learning based reconstruction of the shower maximum Xₘₐₓ using the water-Cherenkov detectors of the Pierre Auger Observatory, JINST 16 (2021) P07019 [2101.02946].
- [12]Z. Wang, E. Mayotte, S. Mayotte, N. Woo, J. Burton-Heibges, N. San Martin et al., Prospects for deep-learning-based mass reconstruction of ultra-high-energy cosmic rays using simulated air-shower profiles, JCAP 06 (2026) 069 [2508.13933].arxiv.org/abs/2508.13933
- [13]K. Kashinath, M. Mustafa, A. Albert, J.-L. Wu, C. Jiang, S. Esmaeilzadeh et al., Physics-informed machine learning: case studies for weather and climate modelling, Phil. Trans. Roy. Soc. A 379 (2021) 20200093.DOI
- [14]T.-Y. Yang, J. Rosca, K. Narasimhan and P.J. Ramadge, Learning physics constrained dynamics using autoencoders, in Advances in Neural Information Processing Systems 35 (NeurIPS 2022), pp. 17157–17172, 2022, https://doi.org/10.52202/068431-1248.
- [15]T. Pierog, M.K. Alekseeva, T. Bergmann, V. Chernatkin, R. Engel, D. Heck et al., First results of fast one-dimensional hybrid simulation of EAS using CONEX, Nucl. Phys. B Proc. Suppl. 151 (2006) 159 [astro-ph/0411260].
- [16]T. Bergmann, R. Engel, D. Heck, N.N. Kalmykov, S. Ostapchenko, T. Pierog et al., One-dimensional hybrid approach to extensive air shower simulation, Astropart. Phys. 26 (2007) 420 [astro-ph/0606564].DOI
- [17]T. Pierog and K. Werner, EPOS.LHC-R: a global approach to solve the muon puzzle, in 39th International Cosmic Ray Conference (ICRC2025), vol. ICRC2025, p. 358, 2025, https://pos.sissa.it/501/358 [2508.07105].
- [18]F. Riehn, R. Engel, A. Fedynitch, T.K. Gaisser and T. Stanev, Hadronic interaction model Sibyll 2.3d and extensive air showers, Phys. Rev. D 102 (2020) 063002 [1912.03300].DOI
- [19]M. Olegario and V. de Souza, “ARAPy v1.0.0 [software].” Zenodo, doi:10.5281/zenodo.23705631, Oct., 2026.
- [20]PIERRE AUGER collaboration, The exposure of the hybrid detector of the Pierre Auger Observatory, Astropart. Phys. 34 (2011) 368 [1010.6162].DOI
- [21]Pierre Auger collaboration, The fluorescence detector of the Pierre Auger Observatory, Nucl. Instrum. Meth. A 620 (2010) 227 [0907.4282].
- [22]W. Carvalho, I.F.M. Albuquerque and V. de Souza, Effects of the energy error distribution of fluorescence telescopes on the UHECR energy spectrum, Astropart. Phys. 28 (2007) 89.
- [23]Pierre Auger collaboration, Measurement of the average shape of longitudinal profiles of cosmic-ray air showers at the Pierre Auger Observatory, JCAP 03 (2019) 018 [1811.04660].
- [24]T.K. Gaisser and A.M. Hillas, Reliability of the method of constant intensity cuts for reconstructing the average development of vertical showers, in Proceedings of the 15th International Cosmic Ray Conference, vol. 8, (Plovdiv, Bulgaria), p. 353, 1977, https://articles.adsabs.harvard.edu/pdf/1977ICRC...15h.353G.
- [25]S. Bai, J.Z. Kolter and V. Koltun, An empirical evaluation of generic convolutional and recurrent networks for sequence modeling, 1803.01271.arxiv.org/abs/1803.01271
- [26]K. He, X. Zhang, S. Ren and J. Sun, Deep residual learning for image recognition, in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016, https://doi.org/10.1109/CVPR.2016.90 [1512.03385].
- [27]J.L. Ba, J.R. Kiros and G.E. Hinton, Layer normalization, 1607.06450.arxiv.org/abs/1607.06450
- [28]V. Chernozhukov, I. Fernández-Val and A. Galichon, Quantile and probability curves without crossing, Econometrica 78 (2010) 1093 [0704.3649].
- [29]A.J. Cannon, Non-crossing nonlinear regression quantiles by monotone composite quantile regression neural network, with application to rainfall extremes, Stoch. Environ. Res. Risk Assess. 32 (2018) 3207.DOI
- [30]M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro et al., “TensorFlow: large-scale machine learning on heterogeneous systems.” https://www.tensorflow.org/, 2015.arxiv.org/abs/1603.04467
- [31]F. Chollet et al., “Keras.” https://keras.io, 2015.
- [32]J. Bergstra and Y. Bengio, Random search for hyper-parameter optimization, J. Mach. Learn. Res. 13 (2012) 281.
- [33]R. Koenker and G. Bassett, Regression quantiles, Econometrica 46 (1978) 33.DOI
- [34]R. Koenker, Quantile Regression, Cambridge University Press, Cambridge (2005), 10.1017/CBO9780511754098.
- [35]D.P. Kingma and J. Ba, Adam: a method for stochastic optimization, in 3rd International Conference on Learning Representations (ICLR 2015), (San Diego, CA, USA), 2015 [1412.6980].arxiv.org/abs/1412.6980
- [36]Y. Bengio, J. Louradour, R. Collobert and J. Weston, Curriculum learning, in Proceedings of the 26th Annual International Conference on Machine Learning, (Montreal, Canada), pp. 41–48, ACM, 2009, https://doi.org/10.1145/1553374.1553380.







