Deeply learning deep inelastic scattering kinematics

We study the use of deep learning techniques to reconstruct the kinematics of the neutral current deep inelastic scattering (DIS) process in electron–proton collisions. In particular, we use simulated data from the ZEUS experiment at the HERA accelerator facility, and train deep neural networks to reconstruct the kinematic variables Q2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Q^2$$\end{document} and x. Our approach is based on the information used in the classical construction methods, the measurements of the scattered lepton, and the hadronic final state in the detector, but is enhanced through correlations and patterns revealed with the simulated data sets. We show that, with the appropriate selection of a training set, the neural networks sufficiently surpass all classical reconstruction methods on most of the kinematic range considered. Rapid access to large samples of simulated data and the ability of neural networks to effectively extract information from large data sets, both suggest that deep learning techniques to reconstruct DIS kinematics can serve as a rigorous method to combine and outperform the classical reconstruction methods.


Introduction
Measurements of deep-inelastic scattering (DIS) by a multitude of experiments all-over the world [1][2][3][4][5] and the study of these measurements by the theoretical and experimental communities [5] have revealed information on the quark-gluon structure of nuclear matter and established quantum chromodynamics (QCD) as the theory of the strong interaction.The experiments at the HERA collider facility at the DESY research centre in Hamburg, Germany have played an important role in these studies.HERA has been the only electron-proton collider built so far [6].The data collected in the years 1992 -2007 have provided truly unique information on the internal structure of the proton and other hadrons [7].
The key component in these studies has been a precise reconstruction of the DIS kinematics, using information from the accelerator and the detectors.Multiple methods have been applied at the HERA experiments [8] to reach an optimal precision in each particular measurement.Each of the classical reconstruction methods uses only partial information from the DIS event and is subject to specific limitations, either arising from the detector or the assumptions used in the method.
With the DIS measurements at the upcoming Electron-Ion Collider in mind [9], we present in this work a novel method for the reconstruction of DIS kinematics based on supervised machine learning and study its performance using Monte Carlo simulated data from the ZEUS experiment [10] at HERA.For our approach, we develop deep neural network (DNN) models that are optimised for the problem and are allowed to take full information from the DIS event into account.We train the DNN models on simulated data from the ZEUS experiment and compare the results from our trained model with the results from the classical reconstruction methods.
We show that the reconstruction of the DIS kinematics using deep neural networks provides a rigorous, datadriven method to combine and outperform classical reconstruction methods over a wide kinematic range.In the past, neural networks had already been used in the context of DIS experiments [11] and we expect that our novel method and similar approaches will play an even more important role in ongoing and future DIS experiments [12,13].

Deep inelastic scattering
Deep inelastic scattering is a process in which a highenergy lepton (l) scatters off a nucleon or nucleus target (h) with large momentum transfer (the momentum of each entity is given in parenthesis): l(k) + h(P ) → l (k ) + H(P ) + remnant. ( The detectors in collider experiments are designed to measure the final state of the DIS process, consisting of the scattered lepton l and the hadronic final state (HFS) H.
The latter consists of hadrons with a relatively long lifetime as well as some photons and leptons but does not include the hadron remnant.The H1 [14] and ZEUS experiments were not able to register the remnant of the target due to its proximity to the proton beam pipe.

Deep inelastic scattering at Born level
In the leading order (Born) approximation, the leptons interact with quarks in the hadrons by the exchange of a single virtual γ or Z boson in the neutral current (NC) reaction, and the exchange of single W ± boson in the charged current (CC) reaction.The kinematics of the leading order DIS process in a Feynman diagram-like form is shown in Fig. 1.In this paper, we will only consider the neutral l(k) l (k ) Hadron remnant current electron scattering off a proton in a collider experiment.In this reaction, the final state lepton is a charged particle (electron or positron) that can be easily registered and identified in the detector.
With a fixed centre-of-mass energy, √ s = (k + P ) 2 , two independent, Lorentz-invariant, scalar quantities are sufficient to describe the deep inelastic scattering event kinematics in the Born approximation.Typically, the used quantities are: the negative squared four-momentum of the exchanged electroweak gauge boson: the Bjorken scaling variable, interpreted in the frame of a fast moving nucleon as the fraction of incoming nucleon longitudinal momentum carried by the struck parton: In addition to that, the inelasticity y is used to define the kinematic region of interest.It is defined as the fraction of incoming electron energy taken by the exchanged boson in the proton rest frame Therefore, for the DIS an equation holds.However, the Born-level picture of the DIS process is not sufficient for the description of the observed physics phenomena.A realistic description of DIS requires the inclusion of higher order QED and QCD processes [15].

Higher order corrections to deep-inelastic scattering process
The DIS process with leading order QED corrections can be written as so the kinematics is defined not only by the kinematic of the scattered electron and the struck parton, but also by the momentum of the radiated photon, P γ .The lowest order electroweak radiative corrections can be depicted in a form of Feynman diagrams as shown in Fig. 2 a)-d) and should be considered together with the virtual corrections e)-g).The Fig. 2  With the virtual corrections taken into account in the DIS process, Eq. 2 no longer holds, i.e.
The presence of higher order QCD processes, (e.g. the boson-gluon fusion in Fig. 2 h) and QCD Compton Fig. 2 i),j)) makes the kinematic description of the DIS process even more complicated.Therefore, the exact definitions of the kinematic observables used in the analysis of the DIS events and the corresponding simulations are essential for the correct physics interpretation.

2.3
The simulation of the DIS events and the kinematic variables in the simulated events The simulation of the inclusive DIS events in the Monte Carlo event generators (MCEGs) starts from the simulation at the parton level, i.e. the simulation of the hard scattering process and the kinematics of the involved partons, e.g.given by parton distribution functions (PDFs) [16] for the given hadron and considering processes with all types of partons in the initial state.The modelling of the hard scattering process combines the calculations of the perturbative QED and/or QCD matrix elements for the 2 → n processes at parton level with the different QCD parton cascade algorithms designed to take into account at least some parts of the higher order perturbative QCD corrections not present in the calculations of matrix elements.The simulated collision events on the particle (hadron) level are obtained using the parton level simulations as input and applying phenomenological hadronisation and particle decay models to them.
e e q q Z 0 /γ * g (j) e e q q Z 0 /γ * g (k) Fig. 2: Feynman diagrams for Deep Inelastic Scattering process with some leading order electroweak corrections a)-g) and QCD corrections h)-k).The proton remnant is omitted.
As of 2022, multiple MCEG programs are capable of simulating the inclusive DIS process at the hadron level with different levels of theory precision and sophistication of modelling of hadronisation, beam remnant and parton cascades, e.g.Pythia6 [17], Pythia8 [18], SHERPA-MC [19], WHIZARD [20] and Herwig7 [21].In addition to that, the Lepto [22], Ariadne [23], Cascade [24] and Rapgap [25] programs can simulate the DIS process using parts of the Pythia6 framework for the simulation of hadronisation processes and decays of particles.
As it was discussed above, DIS beyond the Born approximation has a complicated structure which involves QCD and QED corrections [9].The most recent MCEG programs, e.g.Herwig7, Pythia8, SHERPA-MC, or WHIZARD, contain these corrections as a particular case of their own general-purpose frameworks or are able to use specialised packages like OpenLoops [26], blackhat [27] or MadGraph [28].In general, the modern MCEGs do not specify their definitions of the DIS kinematic observables, but in some cases they can be calculated from the kinematics of the initial and final state, both for the true and reconstructed kinematics.For instance, under some assumptions, the Q 2 in the event could be calculated according to Eq. 2. The total elimination of the ambiguities for such calculations is not possible, as the final state kinematics even at the parton level depend on the kinematics of all the emitted partons.The calculations of the kinematic observables from the momenta of particles at hadron level add an additional ambiguity related to the identification of the scattered lepton and the distinction of that lepton from the leptons produced in the hadronisation and decay processes.
Contrary to the approaches adopted in modern MCEG programs, the MCEGs used for the HERA experiments relied upon generator-by-generator implementations of the higher order QED and QCD corrections specific for DIS or alternatively applied HERACLES [15] for the corrections.
The way to get a simulation of the DIS collision even in a specific detector is the same as for any other type of particle collision event.It involves simulation of the particle transport through the detector material, simulation of detector response and is typically performed in Geant [29,30] or similar tools.The simulated detector response is passed to the experiment-specific reconstruction programs and should be indistinguishable from the real data recorded by the detector and processed in the same way.

Reconstruction of the kinematic variables at the detector level
The kinematics of the DIS events are reconstructed in collider experiments by identifying and measuring the momentum of the scattered lepton l and/or the measurements of the hadronic final state (H).The identification of the scattered lepton is ambiguous even at the particle level of the simulated DIS collision events.The same ambiguity is present in the reconstructed real and simulated data at the detector level.Therefore, the identification of the scattered electron candidate for the purposes of physics analyses is a complicated task on itself and was a subject of multiple studies in the past, some of which also involved neural network-related techniques [11].In our paper, we rely on the standard method of the electron identification at the ZEUS experiment [11] and discuss solely the reconstruction of the kinematic variables using the identified electron and other quantities measured in the detector.
The physics analyses performed in the experiments at HERA relied on the following quantities for the calculation of the kinematic observables x and Q 2 : -The energy (E l ) and polar angle (θ l ) of the scattered electron.Most of the DIS experiments are equipped to register the scattered electron using the tracking and calorimeter detector subsystems.While the tracking system is able to provide information on the momentum of the scattered electron, the calorimeter system can be used to estimate the energy of the electron and the total energy of the collinear radiation emitted by the electron.At the detector level, the estimation of these energies can be done by comparing the momentum of the electron reconstructed in the tracking system and the energy deposits registered in the calorimeter system around the extrapolated path of the electron in the calorimeter.-The energy of the HFS expressed in terms of the following convenient variables: and where the sums run over the registered objects i excluding the scattered electron.Depending on the analysis requirements, the used objects could be either registered tracks, energy deposits in the calorimeter system, or a combination of both.The measurements of the quantities listed above overconstrain the reconstruction of the DIS kinematics.Therefore, in the simplest case, any subset of two observables in E l , θ l , δ H , and P T,H , can be used for the reconstruction.
In our analysis, we consider three specific classical reconstruction methods based on these observables which were used by the ZEUS collaboration in the past: the electron, the Jacques-Blondel, and the double-angle methods.We briefly provide some details on the methods in this section, while a more detailed description can be found elsewhere [31].
The electron (EL) method uses only measurements of the scattered lepton, E l and θ l , to do the reconstruction of Q 2 and x.The kinematic variables calculated from these measurements are given by: and The electron method provides precise reconstruction of kinematics, but, since it uses only information from the scattered lepton, this method is affected by initial and final state QED radiation.Namely, the QED radiation registered in the detector separately from the scattered electron will not be taken into account in the calculations with this method.Practically, the reconstruction with this method gives reasonable results when E l and E l are significantly different from one another, but the resolution and stability becomes poor otherwise.
The Jacques-Blondel (JB) method uses only measurements of the final state hadronic system, δ H and P T,H , for the reconstruction.The kinematic variables are calculated from these by: The JB method is resistant to possible biases because of unaccounted QED FSR, but requires precise measurements of the particles momenta in the hadronic final state.
The factors that limit the precision of the measurements are the uncertainties in the particle identification, the finite resolution of the calorimeter and tracking detectors, the inefficiencies of these detectors, the impossibility of the particle detection around the beampipe, and the presence of objects that avoid detection (e.g.neutrinos from particle decays).
The double-angle (DA) method combines measurements from the scattered lepton and the final-state hadronic system, θ l and γ H , to perform the kinematic reconstruction as follows: where the angle γ H is defined as The angle γ H depends on the ratio of the measured quantities δ H and P T,H , and thus, uncertainties in the hadronic energy measurement tend to cancel, leading to good stability of the reconstructed kinematic variables.Similar to the electron method, when E l and E l are significantly different from one another, the double-angle method provides reliable results, but the resolution and stability are poor otherwise.

The methodology of measurements in the deep inelastic ep collisions
The methodology of measurements at lepton-hadron colliders in general is similar to the methodologies used at e + e − and hadron-hadron colliders.Briefly, in the most cases the quantity of interest is measured from the real data registered in the detector corrected for detector effects.The corrections are estimated by comparing the analysis at the detector level with the same analysis at particle level using detailed simulations of the collision events with the inclusion of higher order QED and QCD processes.
The main difference between the measurements at leptonhadron colliders and elsewhere, is in the way the measurements involve collision kinematics.At e + e − colliders, the initial kinematics of the interactions is given by the lepton energies that are known parameters of the accelerators.Therefore, it is straightforward for most of the measurements in the e + e − experiments to estimate the centreof-mass energy of the hard collision process.In hadronhadron collider experiments, there is no way to measure the kinematic properties of the partons initiating the collision process, as the involved partons cannot be observed in a free state and most measurements in the hadron-hadron collisions are inclusive in the kinematics of the initial state.
The DIS collisions at electron-proton colliders take a middle stance between these cases.The kinematic observables of the DIS process are measured on an event-by-event basis at the detector level using the methods described above.
In an experiment, the measurements of event kinematics is affected by various effects.For a proper comparison of the measurements of HFS, e.g.jet cross-sections or event shape observables to corresponding perturbative QCD (pQCD) predictions, the detector-level measurements are unfolded for detector effects while hadronisation correction factors are calculated using MCEGs or specialised programs and applied to the pQCD predictions [32][33][34][35].The prescription for calculation of those correction factors vary depending on the HFS quantities measured and the used definitions of the kinematic observables.Typically, at ZEUS and other experiments at HERA, after the unfolding of the detector effects, the measurements were also scaled by radiation correction factors to facilitate a comparison to theoretical calculations available at Born level in QED, see e.g.Ref. [36].The factors were obtained from separate high-statistics MC simulations.This is a well-understood Monte Carlo approach and our deep learning technique can be used with it in exactly the same way as the classical methods, both for the experimental and the MC data.For future DIS measurements, e.g. at the upcoming Electron-Ion Collider, it is expected that the effects of QED and QCD radiation can be treated in an unified formalism [35], with the QED effects taken into account into a factorised approach.Our DNN-based reconstruction of DIS kinematics is compatible with such a factorised approach as well.
Therefore, in this analysis, we keep the calculation of correction factors for QED and hadronisation effects out of scope and limit the discussion to detector-level measurements.At particle-level in the MC generated events, we use a single definition of "true" kinematic observables that is based on the kinematics of the exchanged boson extracted from the MC event information.
Namely, we use the definitions of the true-level observables Q 2 true and x true that follow the definitions implemented in ZEUS Common NTuples [37,38] and were used in many ZEUS analyses.With these definitions the Q 2 true is calculated directly from the squared four-momentum of the exchange boson q boson , The x true is calculated according to the formula with y after ISR = q boson • P proton beam (P lepton beam − P ISR radiation ) • P proton beam (19) and (20) where P proton beam , P lepton beam and P ISR radiation represent the four-momenta of the proton beam particles, lepton beam particles and the momenta lost by the lepton beam particles to ISR.Thus, y after ISR corresponds to the fraction of energy of the bare lepton (i.e.without the ISR) transferred to the HFS in the centre of mass of the proton and s after ISR to the centre-of-mass-energy squared of the proton and the incoming bare electron.

Machine learning methods
The reconstruction of DIS event kinematics is overconstrained by the previously mentioned measurements, E l , θ l , δ H , and P T,H .We trained an ensemble of deep neural networks (DNNs) to reconstruct x and Q 2 by correcting results from classical reconstruction methods using the information on the scattered lepton and the final-state hadronic system.
The ensemble DNN method presented here is a new approach designed specifically to address this reconstruction problem.The remainder of this section discusses in detail specifics of the DNN architectures, the specific optimisation methods used to find the optimal parameters defining the DNNs, and the specific structure of the ensemble models.Shown rigorously in what follows, the main motivation for using the unique model is: the universal approximation capabilities of the DNN models with our specific architectures the necessary reduction in the approximation error with the increase in the depth of our DNN models avoidance of a degradation problem [39] in training due to the residual structure of our DNN models.
Further details on the DNN-based reconstruction method will be provided in Ref. [40].

Neural networks architecture
The problem of reconstruction of DIS event kinematics can be posed as a task to construct a functional relationship between a set of input variables x and a set of response variables y.In many cases, such a relation is a continuous function, and can be approximated to arbitrary accuracy with a neural network.The corresponding neural network can have various architectures.The simplest architecture is a sequence of fully-connected, feedforward (hidden) layers.For an input x ∈ R m , the output of the first hidden layer is: where A 0 : R m → R d1 is an affine transformation, the composition of a translation and a linear mapping, and α : R → R is a nonlinear function, called an activation function.Define the application of α on a vector x := T .For A 1 : R d1 → R d2 , the output h 1 is passed into a second hidden layer: and so on, for a desired number of hidden layers.An affine transformation on the output of the final hidden layer is the output of the network.For i ∈ N, call d i the number of nodes in hidden layer i. Define Ψ D m,n (α) to be the set of neural networks with D hidden layers that map R m → R n with continuous, nonlinear activation function α.If ψ ∈ Ψ D m,n , then there exists a set of natural numbers Specific universality properties of Ψ D m,n (α) are proven in Refs.[41,42].In particular, there exists some element in the class of neural networks that is arbitrarily close to any continuous function.For this reason, we say that Ψ D m,n (α) is dense in the space of continuous functions.
We consider a particular subclass of neural networks that also maintain the universal approximation property.We call it Φ D m,n (α).If a function φ ∈ Φ D m,n (α), there exists a set of natural numbers Here the affine transformations A i , i = 0, 1, . . ., D − 1, have the form for matrices M i ∈ R di×di+1 and vectors b i ∈ R di+1 .The function φ defined by ( 24) is determined by matrices M i and W i , and vectors b i whose entries/components will be embraced in a single notation ω later.That is, φ = φ ω .When ω is chosen via an optimisation problem, φ(x) is a function of the input variable x ∈ R d0 .
Let Φ D m,n (α) be the function class in which we search for an optimal kinematic reconstruction method.In addition to the universality property, it can be shown that this class is good for searching for an appropriate reconstruction function because there the necessary reduction in the approximation error with the increase in the depth and the residual structure avoids a degradation problem in the weights during training [40].

Optimisation methods
In any given problem to be solved with the DNN, the task is to choose an optimal function from the class F = Φ D m,n (α) to be a functional relationship between a set of input variables x and a set of response variables y.
Each function φ ∈ F is completely determined by the elements of the matrices and vectors that determine the values of the hidden layers.Let ω ∈ R p be the collection of all these elements, where p is the total number of them.We can then write for any x ∈ R m : φ(x) = φ ω (x).
Choosing an optimal function from this class entails finding the collection of parameters ω in R p that minimises L D , the expected discrepancy or generalisation error between y and φ ω (x), over the joint probability distribution of x and y, D, defined by: (ω, x, y) = (ω, x, y)dD(x, y), (25) where is some loss function measuring the discrepancy between y and φ ω (x).With a randomly sampled data set {x i , y i } N i=1 , if N is sufficiently large, then the generalisation error can be approximated by an empirical error: This summation is sometimes called the fidelity term, as it measures the discrepancy between the data and model predictions.A commonly used fidelity term is the mean square error, with: The fidelity term used in this study is a modification of this, the mean square logarithmic error: Due to the universality of neural networks, there is a model that can achieve zero empirical error.However, in the presence of noise this means the model can overfit to the data sample and loose its generalisability.This problem can be addressed by adding a regularisation term to the optimisation problem as a penalty for certain irregular behaviour.Common regularisation terms include the 2norm, used to limit the size of the parameters, and the 1norm, which can induce sparse solutions.For out analysis, we choose the 1 -regularisation.The Theorem 1.3 in [43] and Proposition 27 of [44] provide an evidence that minimising the 1 norm provides sparse optimal solutions with a minimal number of nonzero elements.Well-constructed models should be able to generalise the information from one given sample to any possible event.Thus, regularisation with the 1 norm produces a model determined by a minimal number of parameters so that the optimal solution does not fit completely to the training set and loose its generalisability.
Therefore, the determination of the optimal neural network model consists of minimising this final loss function, the sum of the sample fidelity term and a weighted regularisation term: where is defined in Eq. 28 and R is a hyperparameter to determine the magnitude of the regularisation.Expression 29 can be minimised using stochastic gradient methods on batches of the data sample [45].The training is accelerated using classical momentum methods [46].In particular, randomly select an initial set of parameters ω 0 .Select a sequence of step sizes, or learning rates, L k that diminish to zero.Randomly selecting a batch of data with indices I ⊂ {1, ..., N }.Choosing a momentum parameter µ.By defining: Then the sequence ω k converges to a set of parameters defining the optimal neural network with the minimal generalisation error, in the sense described here.

The model
We construct a model to rigorously weight classically derived reconstructions of x and Q 2 with corrections based on measurements from the final state lepton and hadronic system.The final reconstruction of these observables with the neural network approach are labelled below as Q 2 N N and x N N respectively.The constructed model is an ensemble of networks from the previously defined function class Φ D m,1 (α), where α is the rectified linear unit (ReLU).The values of D and m vary with each network in the ensemble.
The NC DIS events studied in this analysis are by definition the events containing the scattered electron in the final state, therefore we aim to reconstruct the Q 2 N N primarily from the related observables, i.e. using the properties of the electron directly measured in the experiment.In particular, we use as inputs three set of variables: the classically reconstructed kinematic observables Q 2 EL , Q 2 DA , Q 2 JB , measurements on the scattered lepton (E l , θ l ), and measurements on the final-state hadronic system (δ H , P T,H ).We reconstruct the Q 2 in the form: in which A Q 2 could be understood as a rigorous average of classically derived reconstructions, L Q 2 is a correction term computed from the scattered lepton, and H Q 2 is another correction term computed from the final-state hadronic system.In our analysis 3,1 (α), with each hidden layer of the networks containing 2000 nodes.
The x observable for the NC DIS events is actually calculated from the electron-related observables as well.Therefore, we reconstruct x N N , with Q 2 N N also as an input, for a total of eight inputs (x EL , x DA , x JB , E l , θ l , δ H , P T,H , Q 2 N N ), in the form: where A x , L x , and H x are defined similarly to α) with each hidden layer containing 1000 nodes, and L x , H x are networks in Φ 10  4,1 (α), with each hidden layer containing 500 nodes.
The number of hidden layers and the number of nodes in each hidden layer were each progressively increased until sufficiently desirable results were achieved.Smaller networks provided good results on average, but larger networks were needed to find best results in small, specific regions of the kinematic space.A further increasing of the numbers of hidden layers and nodes per layer beyond the chosen values was found to not significantly alter the performance of the kinematic reconstruction, due to the convergence results of deep neural networks.The convergence theorems of deep neural networks with the ReLU activation function as the number of layers increases were recently established in [47,48].
In the ensemble neural network model, we used the ReLU α(x) := max(x, 0), x ∈ R as the nonlinear activation function It has been shown [49] that with a gradient descent algorithm, using the ReLU function as the activation function provides a smaller training time compared to that with the use of functions with saturating nonlinearities, such as a sigmoid or hyperbolic tangent function.The reduced training time enabled us to experiment with more sophisticated networks.In addition to this, the ReLU functions do not need input normalisation to prevent them from saturating, which is a desirable property for the present analysis.Moreover, it was shown in [47] that the selection of the ReLU activation function produces a neural network as a piecewise linear function over a nonuniform partition, of the domain, determined by parameters involved in the affine transformations A i .Such a structure ensures a good representability of the neural network and can overcome the problem of underfitting.
To accommodate for the large range of the Q 2 and x variables in the analysis, we select the loss function defined in Eq. 28 for the training of the DNN models.

Experimental setup
The Monte Carlo simulated events used to train our deep neural networks were specifically generated using the conditions of e ± p scattering in the ZEUS detector at HERA.A detailed description of the ZEUS detector can be found elsewhere [10].
In our analysis, we have used two samples of Monte Carlo simulated e + p DIS events that are provided by the ZEUS collaboration.These samples were generated with an inclusion of QED and higher order QCD radiative effects using the HERACLES 4.6.6 [15] package with DJANGOH 1.6 [50] interface and the ARIADNE 4.12 and LEPTO 6.5.1 packages for the simulation of the parton cascade.For both samples the same set of kinematic cuts was applied during the generation, the same set of PDFs were used, CTEQ5D [51] and the same hadronisation settings were used to model the hadronisation with the Pythia6 program.Therefore, the essential difference between the two samples is the way the higher order corrections are partially modelled with the corresponding algorithms (QCD cascades).Namely, the LEPTO MCEG utilises the parton shower approach [52], while ARIADNE implements a colordipole model [53].Accordingly, we label the data-sets produced by the LEPTO generator as "CDM" data sets and those with ARIADNE as "MEPS" data sets.
The generated particle-level events were passed through the ZEUS detector and trigger simulation programs based on Geant 3.21 [29], assuming the running conditions of the ZEUS experiment in the year 2007 with a proton beam energy of 920 GeV.The simulated detector response was processed and reconstructed using exactly the same software chain and the same procedures as being used for real data.The results of the processing were saved in ROOT [54] files in a form of ZEUS Common NTuples [37,38], a format that can be easily used for physics analysis without any ZEUS-specific software.

Event selection
The selection of events for the neural network training is motivated by the selection procedure applied in the previous ZEUS analyses [55][56][57][58][59][60].Even though the presented analysis performed on the Monte Carlo simulated events, the selection cuts are choosen and applied as if the analysis is performed on real data for the purpose of being as close as possible to the measurements.The general motivation for these cuts is the same as in many analyses performed by the ZEUS collaboration: to define unambiguously the phase space of the measurement, ensure low fraction of background events, and a reasonable description of the detector acceptance by Monte Carlo simulations.

Phase space selection
The phase space for the training of the neural networks in this analysis is selected as 100 GeV 2 < Q 2 < 20480 GeV 2 , being close to the phase space of the physics analysis in Ref. [59].
In the phase-space region at low x and very low inelasticity y, the QED predictions from the Monte Carlo simulations are not reliable because of a limit of higher orders in the calculations [61].To avoid these phase-space regions, the events are required to have y JB • (1 − x DA ) 2 > 0.004 and y JB > 0.04 [61].To ensure optimal electron identification and electron energy resolution, similar to the previous physics analyses, a kinematic cut 0.2 < y EL < 0.7 is used.

Event selection
The deep inelastic scattering events of interest are those characterised by the presence of a scattered electron in the final state and a significant deposit of energy in the calorimeter from the hadronic final state.The scattered electrons are registered in the detector as localised energy depositions primarily in the electromagnetic part of the calorimeter, with little energy flow into the hadronic part of the calorimeter.On the other hand, hadronic showers propagate in the detector much more extensively, both transversely and longitudinally.
In addition to the DIS process, there are also background processes which leave similar signatures in the detector as those described above.Therefore, the correct and efficient identification of the scattered lepton is crucial for the selection of the NC DIS events.For this analysis, the SINISTRA algorithm is used to identify lepton candidates [11].Based on the information from the detector and the results of the SINISTRA algorithm, the following selection criteria are applied to select the events for the further analysis: -Detector status: It is required that for all the events the detector was fully functional.-Electron energy: At least one electron candidate with energy greater than 10 GeV [59] is identified in the event.
-Electron identification probability: The SINISTRA [11] probability of a lepton candidate being the DIS lepton was required to be greater than 90%.If several lepton candidates satisfy this condition, the candidate with the highest probability is used.In addition to this, there must be no problems reported by the SINISTRA algorithm.-Electron isolation: To assist in removing events where the energy deposits from the hadron system overlap with those of the scattered lepton, the fraction of the energy not associated to the lepton is required to be less than 10% over the total energy deposited within a cone around the lepton candidate.The cone is defined with a radius of 0.7 units in the pseudorapidityazimuth plane around the lepton momentum direction [59].-Electron track matching: The tracking system covers the region of polar angles restricted to 0.3 < θ < 2.85 rad.Electromagnetic clusters within that region that have no matching track are most likely photons.If the lepton candidate is within this region, the presence of a matched track is required.This track must have a distance of closest approach between the track extrapolation point at the front surface of the CAL and the cluster centre-of-gravity-position of less than 10 cm.The track energy must be greater than 3 GeV [59].-Electron position: To minimise the impact of imperfect simulation of some detector regions, additional requirements on the position of the electromagnetic shower are imposed.The events in which the lepton is found in the following regions (x,y and z being the cartesian coordinates in the ZEUS detector) are rejected [62]: x 2 + y 2 < 18 cm, regions close the beam pipe z < −148 cm and y > 90 cm and −14 < x < 12 cm, a part of the RCAL where the depth was reduced due to the cooling pipe for the solenoid (chimney), -−104 < z < −98.5 cm or 164 < z < 174 cm, regions in-between calorimeter sections (super-crack).-Primary vertex position: It was required that the reconstructed primary vertex position is close to the central region of the detector, applying the selection −28.5 < Z vtx < 26.7 cm [59].-Energy-longitudinal momentum balance: To suppress photoproduction and beam-gas interaction background events and imperfect Monte Carlo simulations of those, restrictions are put on the energy-longitudinal momentum balance.This quantity is defined as: where the final summation index runs over all energy deposits in the detector.In this analysis, we apply a condition of 38 < δ < 65 GeV [59].
-Missing transverse energy: To remove beam-related background and cosmic-ray events, a cut on the missing energy is imposed.
, where E T is the total transverse energy in the CAL and P T,miss is the missing transverse momentum, the transverse component of the vector sum of the hadronic final state and scattered electron momenta.

Training the DNN models
We use the neural network models defined in Sec. 3

Simulated events
Fig. 3: Distribution of events from the training set in (x true , Q 2 true ) plane and the boundaries of the analysis bins from Tab. 3.
Eq. 29, i.e., we minimise the loss function across the selected training set and satisfy sparse regularity conditions.Every neural network making the ensemble model for x and Q 2 are trained simultaneously.The optimal regularity condition depends on the selection of the training set, the events batch size, the initial learning rate, and the regularisation parameter.We aim to select these in a way that minimises overfitting in particular regions of the kinematic space while still maximising the mean accuracy of the model.
We select a set of events from the "MEPS" data sets for training, as described in Sec. 5, and define the true values of the x and Q 2 as described in Sec.2.3.Fig. 3 shows a distribution of selected events in the (x true , Q 2 true ) plane and the boundaries of the chosen analysis bins.
First, we train the network to reconstruct Q 2 by optimising Eq. 29 with an initial learning rate of L = 1.0 × 10 −5 and a regularisation parameter of R = 1.0 × 10 −5 .We select a batch size of 10000.
The reconstruction of x is more complex.We fix the regularisation parameter to R = 1.0 × 10 −5 and select optimal parameters for the learning rate L and batch size B experimentally by varying the learning rate against the batch size.The appropriate selection of these parameters ensures fast convergence of the stochastic gradient method by balancing noise in the gradients with the stability of the algorithm.For each set of parameters, ten attempts are made and the best result in terms of the mean square error of the x reconstruction model over the training set is chosen.The results are listed in Tab. 1.The smaller learning rate assures a higher stability of the results than a larger learning rate.It prolongs the training process but avoids  a poor convergence of the learning process as observed for larger learning rates.The larger batch size does not offer any advantages in our analysis as shown in Tab. 1. We, therefore, select an initial learning rate of 10 −5 with a minimal batch size.To choose the regularisation parameter close to the optimal one, we vary its value with constant batch size of 10000 and initial learning rate of 10 −5 and again observe the mean square error of the x reconstruction model over the training set.For each set of parameters, ten attempts are made and the best result is chosen.The results are presented in Tab. 2. Accordingly, we choose a regularisation parameter of 10 −6 .Using this regularisation, the neural network models for both x and Q 2 are defined by weight parameters, of which 50% are effectively zero, or less than 10 −8 Following the suggestions in Ref. [63], we start with a small batch size, and increase it in initial training epochs.We test this approach by comparing the mean square error of the x reconstruction model over the training set over the first 200 epochs of training over three different training regimes.The results are summarised in Fig. 4 and imply to use a gradually increasing batch size up to a maximum batch size of 1000.

Results
We evaluate the performance of our approach for the reconstruction of DIS kinematics by applying it to detailed Monte Carlo simulations from the ZEUS experiment and by comparing our results to the results from the electron, double-angle, and Jacques-Blondel reconstruction methods.For the comparison, we use various combinations of Table 3: Kinematic bins in x and Q 2 , see also Fig. 3.
statistically independent data sets, one for the training, and another for the evaluation.In our systematic studies, we have found no signs of overtraining and also no indication that the results depend on the selected Monte Carlo simulations.For the results presented in this section, we use the "MEPS" data set for the training and the "CDM" data set for evaluation.The main quantities of the comparison are the resolutions of the reconstructed variables log Q 2 /1 GeV 2 and log x as measured in selected x − Q 2 regions (bins).The resolutions are defined as , where N stands for the number events in the corresponding bin.The boundaries of the bins are given in Tab. 3 and are chosen to be close to the bins used in ZEUS DIS analyses, e.g. in Ref. [57].
The distributions of the log Q 2 /1 GeV 2 −log Q 2 true /1 GeV 2 and log x − log x true quantities are given in the Fig. 5 and Fig. 6, respectively.The numerical values for the resolution are summarised for all the bins and methods in Tab. 4. The DNN optimisation procedure minimises the generalisation error described in Eq. 25 plus the regularisation penalty, so distributions in Figs. 5 and  Fig. 5: Distributions of log Q 2 /1 GeV 2 log Q 2 true /1 GeV 2 for various reconstruction methods in individual analysis bins.For better visibility, the data points for each reconstruction method are connected with straight lines.necessarily peak at zero.In addition to that, Fig. 7 and Fig. 8 show the two dimensional distributions of events in log Q 2 /1 GeV 2 vs. log Q 2 true /1 GeV 2 and log x vs. log x true planes.
The comparison of the DNN-based approach with the classical methods demonstrates that the DNN-based approach is well suited for the reconstruction of DIS kinematics.Specifically, for most of the bins, our approach provides the best resolution as measured by the standard deviation of the logarithmic differences of true and reconstructed variables.The better performance of the DNNbased approach in most of the bins is a consequence of using additional available information about the final state.In this respect, the DNN-based approach is similar to averaging of the values provided by the classical methods with some weights or to alternative approaches for the same task, e.g.see kinematic fitting in Ref. [64].However, in addition to a better resolution, the reconstruction with the DNN has an important advantage over the classical methods or any simple combination of them.It allows to combine the methods without the intrinsic biases of each method and enables an extension of the model with additional physics observables in a robust way.The resolution is improved by the DNN-based approach in two ways.For the first couple of bins, the main improvement is caused by the more precise estimation of the reconstructed observables.This is clearly seen in Figs. 5 and 6.For the bins with higher Q2 and x the main improvement is due to the rejection of outliers, which can be seen in Figs.7 and 8.The bins with higher Q 2 and x also demonstrate another, very specific advantage on the DNN approach.Due to the low number of training events in the high Q 2 and x region, it would not be possible to train a DNN model or combine the Q 2 and x observables with other methods using information from this region only.However, the DNN training process benefits from the constraints from the higher number of events available elsewhere in the kinematical space and delivers models that perform well even in the bins with highest Q 2 and x.

Conclusions
We have presented the use of DNN to reconstruct the kinematic observables Q 2 and x in the study of neutral current DIS events at the ZEUS experiment at HERA.The DNN models are specially designed to be effective in their universal approximation capability, robust in the sense that increasing the depth of the networks will necessarily reduce empirical error, and computationally efficient with a structure that avoids "vanishing" gradients arising in the backpropagation algorithm.
Compared to the classical reconstruction methods, the DNN-based approach enables significant improvements in the resolution of Q 2 and x.At the same time, it is evident that the usage of the DNN approach allows to match easily any definition of Q 2 and x at the true level that is preferred for a given physics analysis.
The large samples of simulated data required for the training of the DNN can be generated rapidly at modern data centres.Also, DNN allow to effectively extract information from large data sets.This suggests that our new approach for the reconstruction of DIS kinematics can serve as a rigorous method to combine and outperform the classical reconstruction methods at ongoing or upcoming DIS experiments.We will extend the approach beyond inclusive DIS measurements and will study next the use of DNN for the reconstruction of event kinematics in semi-inclusive and exclusive DIS measurements.

A Software used in the analysis
The ROOT package [54] of version 6.22 was used to read the ZEUS data, provided by the data preservation at Max-Planck for Physics [65], analyze it and prepare plain text (or ROOT files) with selected information to be used with the ML tools.The selected information from the plain text (or ROOT) files was piped using the pandas package [66] into Keras [67] interface to tensorflow [68] 2.3.0 library to train the ML models.The packages Eigen [69], frugally-deep [70], JSON for Modern C++ [71] and FunctionalPlus [72] were used for execution of the trained models after these were converted into frugally-deep model format [70] to be used with C++ application.The dependencies for the tensorflow were supplied from the PyPi repository.The training was performed using libraries for computing on GPUs from the CUDA [73] framework of version 10.1.We are grateful to MPCDF1 for the ability to compile and execute the codes on the HPC cluster "Cobra" in [74].The operation system used was Linux on x86 64 architecture using gcc [75] of version 7.3 and python [76] of version 3.6.8.
The figures with the final results were produced with the PGFPlots [77] package.

Fig. 1 :
Fig. 1: Schematic representation of Deep Inelastic Scattering process at Born level.
a),d) correspond to the initial state radiation (ISR) and the Fig. 2 b),c) to the final state radiation (FSR).

Fig. 6 :
Fig.6: Distributions of log x − log x true for various reconstruction methods in individual analysis bins.For better visibility, the data points for each reconstruction method are connected with straight lines.

Table 1 :
Resolution of log x reconstruction after 200 epochs of training with different values of initial learning rate L and batch size B.

Table 2 :
Resolution of log x reconstruction after 200 epochs of training with different values of regularisation parameter R.

Table 4 :
Resolution of the reconstructed kinematic variables in bins of x and Q 2 .The resolution for x and Q 2 is defined as the RMS of the distributions log(x) − log(x true ) and log(Q 2 ) − log(Q 2 true ) respectively.