Machine Learning model driven prediction of the initial geometry in Heavy-Ion Collision experiments

We demonstrate high prediction accuracy of three important properties that determine the initial geometry of the heavy-ion collision (HIC) experiments by using supervised Machine Learning (ML) methods. These properties are the impact parameter, the eccentricity and the participant eccentricity. Though ML techniques have been used previously to determine the impact parameter of these collisions, we study multiple ML algorithms, their error spectrum, and sampling methods using exhaustive parameter scans and ablation studies to determine a combination of efficient algorithm and tuned training set that gives multi-fold improvement in accuracy for all three different heavy-ion collision models. The three models chosen are a transport model, a hydrodynamic model and a hybrid model. The motivation of using three different heavy-ion collision models was to show that even if the model is trained using a transport model, it gives accurate results for a hydrodynamic model as well as a hybrid model. We show that the accuracy of the impact parameter prediction depends on the centrality of the collision. With the standard application of ML training methods, prediction accuracy is considerable low for central collisions. Our method increases this accuracy by multiple folds. We also show that the eccentricity prediction accuracy can be improved by inclusion of the impact parameter as a feature in all these algorithms. We discuss how the errors can be minimized and the accuracy can be improved to a great extent in all the ranges of impact parameter and eccentricity predictions.


I. INTRODUCTION
Ever since the first run of the heavy-ion collision experiments, a lot of studies have been carried out describing and analyzing the data that we get from these experiments [1][2][3]. The beam energy scan program of RHIC at BNL(Brookhaven National Laboratory) runs the collider experiments using Au-Au nuclei at collision energies from 7.7 GeV to 200 GeV [4][5][6][7]. One of their important aims is to search for the critical point in the QCD phase diagram [8]. The matter created in these experiments has a high baryon density. On the other hand, Pb-Pb collisions are conducted at LHC at collision energies 2.76 TeV [9], 5.02 TeV [10], the aim of these experiments is to examine the high-temperature region of the QCD phase diagram. The distribution of particles in the initial stage is different for different collision systems and this affects the final stage particle spectra and the anisotropic flows [11]. The primary data we get from these experiments are the transverse momentum(p T ) spectra, the rapidity(y) spectra, the pseudorapidity(η) spectra, the particle-antiparticle ratios and the multiplicity fluctuations. Some phenomena e.g., the anisotropic flows can be obtained directly from these data. But some parameters are difficult to calculate directly from the experimental data. These are the impact parameter, the initial state geometry parameters, (e.g., eccentricities) event plane angles, etc. The impact parameter is the distance between the centers of the colliding nuclei on the transverse plane of the collision. In experiments, the data is always studied with respect to the centrality of the collision as we get different spectra for different centrality collisions. The high centrality collisions are those where the impact parameter is close to zero i.e., the head-on collisions. The peripheral collisions refer to the higher values of the impact parameter. The collision centrality plays an important role in determining the final particle spectra. The multiplicity distribution of different species is observed to be dependent on the centrality of the collision. In ref. [6,12], the multiplicity fluctuations at different centralities are studied at RHIC energies and in ref. [9,10,13], the same has been studied at collision energies 2.76 TeV, 5.02 TeV, and 5.44 TeV respectively.
The centrality is not a property that can be attained directly from the experiments, but it can be calculated with the help of theoretical modeling by using the Glauber model [14] or some other similar model. The impact parameter as well as the initial geometry of the collision is difficult to determine experimentally. This is true especially for the more central collisions. That is why there are various proposals to determine the impact parameter.
Apart from different simulations and algorithms, neural networks have also been proposed to determine the impact parameter from the experimental data [15].
The determination of the impact parameter is related to the charged multiplicity produced during the heavy ion collision. The charged particle multiplicity has a contribution from hard and soft collision processes which in turn depend on the number of participants and also on the number of binary collisions. If x is the fraction of contribution from hard processes then the charged particle multiplicity per unit pseudorapidity can be expressed as, here n pp is the multiplicity per unit rapidity in pp collisions and N coll is the number of binary NN collision. The number of participant nuclei N part can be expressed as a function of the impact parameter [14,16]. If T A (s) is the thickness function of nucleus A i.e., the probability density function of finding nucleons in A, then the number of participants in A at the transverse position s can be found out by multiplying with the probability of binary nuclei-nuclei collision with the nucleons of the nucleus B at the same position (b − s) where b is the impact parameter. So, the total number of participants can be expressed as, Here the total number of participating nuclei is found out by summing over the contribution from nucleus A and nucleus B. Using Eq.1 and Eq.2, the impact parameter hence centrality can be estimated by fitting the multiplicity spectra. In this method, the multiplicity fitting must be done for every event to obtain its centrality. An easier way of getting the centrality is to use machine learning models. Machine learning has been invoked to determine the impact parameter from the experimental data in several papers [17][18][19]. Using machine learning, we can automate the whole process and the impact parameter can be calculated in an efficient way. The advantage of using machine learning (ML) is that it requires less computational power as well as computational time. So, this makes the process more agile. Most of the work in this field is related to the deep neural network algorithms. The convoluted neural network has also been used to make predictions about the impact parameter [20]. The first paper to demonstrate the importance of neural network analysis for improving the accuracy of the determination of the impact parameter is ref. [21]. Using an ANN (Artificial Neural Network) or CNN (Convolutional Neural Network) they have effectively determined the impact parameter, but these networks require the tuning of hundreds of parameters. This makes the process computaionally expensive. On the other hand, different non-neuronal ML models like SVM, RandomForest, kNN etc require lesser parameters to produce results with similar accuracy as the ANN or CNN models. Thereafter many papers have explored various Machine Learning algorithms to obtain more accurate results for the impact parameter.
In this study, we have analyzed various machine learning algorithms (ML) and provided a rigorous comparison on the accuracy and efficiency of these algorithms using well defined techniques of machine learning to show a critical gap in their prediction accuracy for central collisions. We have mainly focused on three properties, impact parameter, eccentricity, and participant eccentricity. We analyze the errors in the predictions and discuss the causes that lead to these errors. We find that the accuracy is less for the low impact parameters. This is an already known problem in the determination of the impact parameter. We provide a custom sampling method that shows significant improvement in accuracy over commonly used sampling methods in the ML community. We have also used a particular HIC model for training, while the data from two different HIC models have been used to make the predictions. This indicates that for a well-defined training data set, the predictions for the impact parameter using the ML model are model independent.
In this study, the transverse momentum(p T ) spectra are taken as features and the impact parameter, eccentricity, and participant eccentricity are taken as the target variable which the model must predict. We have used the AMPT (A Multi-Phase Transport) model to generate the transverse momentum spectra of Au-Au collision events at 200GeV collision energy [22]. The charged particle multiplicity has been studied previously using the AMPT model [23]. As the target variables are known for fitting, we use supervised machine learning algorithms. Also, the target is a continuous variable so it can have any real value, hence we use the regression algorithms.
The focus of our study would be predicting the impact parameter and the eccentricity.
Eccentricity is one of the parameters which gives us the initial geometrical shape of the collision region. This also affects the elliptic flow of produced particles which is one of the important observables used to study collective behavior in heavy-ion collisions. In ref.
[24], the effects of eccentricity fluctuation on the elliptic flow is studied at √ s = 200 GeV for Au-Au and Cu-Cu collisions. In a recent study [25], the flow-harmonics are studied as a function of different components of initial anisotropy using the AMPT model. In our study, the learnings and experiences gathered by the ML models from the impact parameter prediction, is passed onto predict the eccentricity of the initial stage of the heavy-ion collision system. We have also looked at how the inclusion of the impact parameter as a feature, affects the prediction accuracy. We have made predictions of the initial state anisotropy, using the impact parameter. The initial state anisotropy is given by [16], here r = x 2 + y 2 , ψ = tan −1 y x , n=2 gives the eccentricity and n=3 gives the triangularity. The above eccentricities are with respect to the reaction plane. We have also trained the model to predict participant plane eccentricity which is given by [24], here σ's are the variances of the positions of the particles, σ 2 x =< x 2 > − < x > 2 , σ 2 y =< y 2 > − < y > 2 and σ xy =< xy > − < x >< y >. Here < .. > is the average over the transverse plane.
The AMPT is a transport model which has been used extensively to model the different stages of the heavy ion collision from the initial collision dynamics to the final stage hadron dynamics. However, like all models, it has certain drawbacks. There are alternate simulations based on hydrodynamics which also give reliable outputs which match well with the data. In this study, we have taken the results from other models too. This is to test if the predictions of the ML algorithms depend crucially upon the nature of the model used.
Our results show that as long as the models reflect the experimental data accurately, the ML algorithms do not distinguish between the different models. An ML algorithm trained on a specific model gives pretty accurate results when tested with the data generated by a different model.
The two other heavy ion collision models used in this study are VISH2+1(Viscous Israel Stewart Hydrodynamics (2+1) dimension) [26] and a hybrid model made of a hydro evolution model and a hadronic cascade model [27]. These two models are different from the AMPT model which is used to train the ML algorithms. So, the ML models train from the p T spectra and the impact parameter data of AMPT events and predicts impact parameters using test data of p T spectra from the VISH2+1 and the hybrid model. We choose the initial conditions of different models such that they generate the p T spectra close to the one that is obtained in the actual experiments. In this way, we are examining the efficiency of the ML algorithms in a model-independent manner. However, the model-independency is limited only to those models which generate the p T spectra close to the experimental p T spectrum.
The p T spectra of the hydro and the hybrid model are fitted with the experimental p T spectra to measure the effectiveness of ML models on the experimental data.
In section II, we give a brief description of the heavy-ion collision models used in this study. In section III, we talk about the ML models used in this study. We also describe the parameters used to check the accuracy of different ML models. The learning process of various algorithms as well as the tuning of the hyperparameters are given in this section.
We have also used rebalancing techniques to improve the accuracy of the results. These rebalancing techniques are discussed in this section. Section IV discusses the results and the predictions made by the ML models of the eccentricity and the participant eccentricity. It also discusses the ranges of eccentricity where optimum accuracy has been observed. The efficiency of predicting the impact parameter using unknown data of different HIC models and experimental data is discussed in this section. In the end, we show how the accuracy can be improved by rebalancing the dataset. We then summarize the paper in section V.

II. EVENT GENERATION
A. The AMPT model The AMPT is a publicly available heavy-ion collision model which generates heavy-ion collision events. It is often used to understand the results obtained from experiments and it has successfully given the results which match well with the experimental observations [22].
There are two versions of AMPT. In both, the initial condition is generated by the HIJING model [28][29][30]. Here the initial configuration of nucleons is determined by the Glauber model with a Wood-Saxon nuclear distribution. Particle production from two colliding nuclei is given in terms of two processes. In hard processes, the momentum transfer is larger and they are described by pQCD and they produce minijets. The soft processes are those where the momentum transfer is lower and described by the non-perturbative process by the formation of strings. Of the two models, in the default version, the partons recombine with their parent strings after the end of interaction in the partonic state and forms hadrons using the Lund String fragmentation model [31]. In the string melting (SM) version of AMPT, the strings are converted to their valence quarks and antiquarks. The partonic stage interactions are described by Zhang's Parton Cascade (ZPC) where the interactions are described by the Boltzmann equations [32]. The scattering cross-section of the parton interactions is calculated using pQCD. The simplified relation between total parton elastic scattering cross-section and the medium induced screening mass is taken as, where α s , the strong coupling constant and µ, the screening mass, taken as 0.33 and 3f m −1 respectively for a total cross-section of 3 mb. When the partons stop interacting, they are hadronized by a quark coalescence model. Here the nearest quark-antiquark pair is converted into a meson and the three nearest quarks or antiquarks are converted into a baryon or an antibaryon. The hadronic dynamics are described by the ART (A Relativistic Transport) model [34]. We have used both the versions of the AMPT model. In all the collision setup, we use Au-Au collision at 200 GeV collision energy. Different centralities are considered for different purposes. The other settings are the same as the parameters taken in these references [23,33].
B. The VISH2+1 model VISH2+1 is a publicly available code where the evolution of the system created in heavyion collisions is described by relativistic causal viscous hydrodynamics [26,35,36]. The code has been tested extensively and it has successfully reproduced the results from experiments [37]. The initial distribution is taken from the Glauber model in terms of energy-momentum tensor T mn . Then it solves the local energy-momentum conservation equation d m T mn = 0 where, Here ∆ mn = g mn − u m u n , u m and u n are the velocity components, and p is the pressure.
π mn is the viscous shear pressure which follows the evolution equation, D = u m d m and the symmetric and traceless shear tensor is given by, The pressure p and the energy density e are related by the equation of state(EoS), which is used to solve the hydrodynamic equations. There are three different EoS used in this study, EoS-L, SM-EOS Q, and s95p-PCE. The EOS L is based on lattice QCD data where a smooth crossover transition connects the QGP state to the chemically equilibrated hadron resonance gas(HRG) state [37]. The SM-EOS Q is the smoothed version of the EOS Q where a first-order phase transition with a vacuum energy (bag constant) connects the non-interacting QGP state to the chemically equilibrated HRG state [38]. The s95p-PCE equation of state is obtained from fits to lattice QCD data for crossover transition at high temperatures and to a partial chemical equilibrium system of the hadrons at low temperatures [39].
In the Israel-Stewart [40,41] framework, the generalized hydrodynamic equation of an energy-momentum tensor T mn , together with viscous pressure contributions π mn is solved with a collision time scale τ π (relaxation time). The longitudinal boost-invariance is implemented and seven equations are solved, 3 for the T τ τ , T τ x and T τ y and 4 for the π mn 's.
Here a flux-corrected transport(FCT) algorithm called SHASTA (Sharp And Smooth Transport Algorithm) [42] is used to solve the hydrodynamic and kinetic equations. It has two stages. In the transport stage, the multidimensional calculations are simplified in terms of geometric interpretation which is followed by an anti-diffusive or corrective stage. This technique is also applied in codes like AZHYDRO [43]. The final spectra are obtained on a freeze-out hypersurface where the fluid stops interacting. The freeze-out is computed using the Cooper-Frye procedure [44] at a decoupling temperature T dec . Here iSpectra (iS) code is used, which is a fast Cooper-Frye particle momentum distribution technique that gives discrete momentum distribution of the desired hadron species [45]. We get events of emitted hadrons similar to the events generated in experiments which are then used for ML model predictions.

C. Hybrid model
We have used the iEBE-VISHNU code package [27] which is a hybrid model made by combining a (2+1)-dimensional viscous hydrodynamic model and a hadronic cascade model.
Instead of using the whole package, we have used the modules separately for better handling of inputs and outputs. The output of the iS particle sampler obtained at the end of hydro evolution, is used for hadronic re-scatterings. Here, the UrQMD after-burner package is used to serve this purpose. After the particalization, the hadrons are produced on the hypersurface with individual production time and location. The position and momenta along with the ids are then written in a standard OSCAR1997A format which is suitable for hadronic re-scattering[46]. This is done using the Oscar to UrQMD converter routine. This also propagates all the hadrons backward in time so that all of them have a fixed initial time and the Boltzmann collision integral can be performed in the UrQMD model.
Ultra-Relativistic Quantum Molecular Dynamics (UrQMD) is a transport model where the dynamics of the hadrons are modeled [47,48]. UrQMD can generate a whole collision system starting from the nuclear collision to the hadronic spectra but here we have only

A. ML Algorithms and Tuning of Hyperparameters
As mentioned in the introduction, there are various ML algorithms that we have tested for this study e.g. k-NearestNeighbors, Gradient Boosting Regression, Decision Trees etc. . Details of these ML algorithms are available in ref. [49]. The accuracy of these models has been tested using standard measures such as R-square, the Root Mean Square Error (RMSE), the Mean Squared Error (MSE), and the Mean Absolute Error (MAE). After running various ML algorithms, we find that although all the algorithms give very good predictions for the impact parameter, only three of them perform well for the eccentricity prediction. Hence, we concentrate only on these three algorithms. They are the k-NearestNeighbors(kNN), ExtraTrees Regressor(ET) , and the Random Forest Regressor(RF) model. In kNN model, the target is predicted by doing an local interpolation of the target associated with the k nearest neighbors of the training dataset [50]. ET and RF are the kinds of ensemble method. In RF, the decision trees are made during the training and a mean of the ensemble is calculated [51]. In ET, randomized decision trees are considered that are made of subsamples of the training dataset [52]. We have used a 10-fold cross-validation (CV) to obtain a robust estimate of the parameters [53]. This also gives a bias-variance trade off.
Since we have used these ML algorithms for studying the data from three different HIC models, we have standardized the data before processing them. In this study, we are using the p T spectra of charged particles as features in the dataset. The p T spectra is obtained for the mid-rapidity region with a rapidity window of −0.5 to 0.5. All the p T bins have a different range of values. The difference is more significant when we compare a lower p T bin with a higher p T bin. Thus, it is important to make them standardized. This makes the model compatible with a new dataset coming from a different HIC model. Two types of scaling are used in this study, i) the Standard Scaler or Z-score normalization and ii) the Min-Max Scaler [54]. To use both these scaling techniques, we have used python sklearn.preprocessing library [55]. In most of the cases discussed in this study, we observe that the Z-score method provides us an accuracy greater than the min-max scaling by 4 − 6%. So, in all the cases, we have used the Z-score standardization.
After standardization, the p T spectra serve as the features in the dataset and the target variables are the impact parameter, the eccentricity, and the participant eccentricity. When the impact parameter is used as the target variable, only the p T spectra is used as feature variables. For the other targets, the predicted impact parameter is included in the dataset as a feature variable as all the other targets have a dependency on the impact parameter.
In this way, all the dependent variables can be measured just by giving the p T spectra as inputs. A standard training and test set separation was done for model evaluation.
It is important to have enough events to achieve the best accuracy without consuming too much computing resources. The learning curve of a machine learning model tells us how effectively a model is learning throughout its running time. We present the learning experience as a function of events. In Fig.1, the learning curves of a kNN (green circles), ET In Fig.2, the accuracy plots for impact parameter predictions using kNN(a), ET(b), RF(c), and Linear Regression(LR)(d) models are shown. The ML models are trained using the charged particle p T spectra data of AMPT-SM model. Linear Regression algorithm finds a linear relationship between a dependent and one or more independent variable [56]. The prediction is performed using a test dataset containing p T spectra of more than 4000 events of minimum bias Au+Au collision at 200 GeV. The red line drawn here is the optimum accuracy line and the blue points are the predictions made by the model. The accuracies achieved are 97.11%, 97.03%, 97.05% and 96.53% for kNN, ET, RF, and LR model respectively. All of these accuracies are observed for a random train-test dataset split. The 10-fold crossvalidation scores of these models are 97.04%, 97%, 97.01%, and 96.56% respectively. We get accuracy of more than 95% for the kNN, ET and RF models when the ML models are trained using the default AMPT model data, . In the case of impact parameter predictions, most of the machine learning algorithms give a fair level of accuracy without tuning any of the hyperparameters except in certain critical impact parameter regimes.
It is known that the choice of parameters can affect the accuracy of a model. Hyperparameter tuning was done to fix the parameters with minimum error validation set. In The errors in ML can be reduced by determining the highly correlated features in the data. The Principal Component Analysis (PCA) is the most popular technique used for feature reduction of a large dataset [57]. In this work, we have tried the 'SelectFromFeature' function from the sklearn library and PCA method to reduce the colinearity and compared the outcomes to the already achieved accuracy using all the features. We have only shown the result of PCA method. In Fig. 5(a), the accuracy score of a kNN model, and in Fig.5(b), the accuracy score of an ET model is shown as a function of the number of principal components is used. Here the accuracy is observed for the impact parameter predictions using p T distribution dataset of 12000 minimum bias Au-Au collision events at 200 GeV collision energy. The saturation in the accuracy score is achieved for the use of 7 or more principal components in both cases. Also, using 7 components, a variance coverage of 95% can be achieved in the case of impact parameter predictions. So, it is safe to use 7 − 8 principal components to get a good amount of accuracy without losing any major information. We used 7-8 components for the impact parameter determination. We also found that at least 10 features or 10 principal components are needed to obtain an accurate result for the eccentricity and the participant eccentricity. This is expected as the data that we are using is the transverse momentum data. Since the impact parameter is known to be correlated with the transverse momentum data hence, we need a smaller number of features to obtain a high accuracy of prediction [58] for the impact parameter as compared to the eccentricity. In all the eccentricity predictions we will use PCA function to transform the features.

B. Custom resampling for unbalanced training set
The p T spectra we used as a feature are comprised of imbalanced datasets. As we have There are a few sampling techniques in machine learning for rebalancing datasets e.g., SmoteR, ADASYN [60,61]. These are python packages that increase(over-sampling) or This technique has helped us to reduce the errors further and the results are discussed in detail in the next section (subsection C).

IV. RESULTS AND DISCUSSIONS
A. Impact parameter and eccentricity prediction As discussed earlier, the eccentricity is one of the key parameters in heavy-ion collisions.
It gives information about initial state geometry and also affects the final state particle flows. But like the impact parameter, it is difficult to measure eccentricity directly from the experiment. Here in this study, the models which are used to get impact parameter prediction, are also used in eccentricity prediction. In fact, ET, kNN, RF are the three best-performing algorithms in the case of eccentricity prediction. The 10-fold CV score of RF model is 91.95%. We get accuracy between 87% to 93% when the ML models are trained using the default AMPT model data.  LGBM(Light Gradient Boosting Machine) model also has an accuracy of over 88% after a 10-fold cross validation. This is a tree based machine learning model where the tree grows vertically(leaf-wise) [62].
In the eccentricity prediction figures (ref Fig. 7), prediction accuracy is obtained for all the models. One of the reasons behind this is that the distribution of eccentricity over the events is not isotropic. In Fig. 8(a) occurring fall in a particular range. Hence the model fits well in this range of eccentricity because of a larger number of fitting points. From the graph, we see that the range of eccentricity can be increased further from 0.1 to 0.5. In Fig. 8(b), a prediction plot of participant eccentricity using the kNN model is given for a larger range. Here the events are considered which have eccentricities in the range from 0.1 to 0.5. So, the range has now become three times wider than the previous cases. We observe that the points are wider  Fig. 7(a). We also see some points which are away and isolated from the bulk distribution. The accuracy is lowered to 78.98% from its previous value of 98.16%. The 10-fold cross-validation score is 76% in this case which is a fair amount of accuracy though it is much lower compared to the maximum accuracy. This means that the range of accuracy can be fixed according to the requirement of the problem. To accommodate a wider eccentricity range, we have to compensate with accuracy. We have also applied different ML algorithms to obtain the accuracy at different collision energies from 20 GeV to 200 GeV for the impact parameter, eccentricity, and the participant eccentricity predictions. For lower collision energies, the number of events required to train an ML model is higher compared to the number of events required for higher collision energies. This is because high multiplicity events are generated at higher collision energies. Thus, the event-by-event averages become stable.
In Fig. 9, we plot the error in the impact parameter prediction as a function of the impact parameter and the eccentricity distribution. The error here is the relative error(RE) which is , where b pred and b org are the predicted and original value of impact parameter. We observe that for all eccentricity and impact parameter ranges, the error is low except for the region where the impact parameter is less than 2fm. In the majority of the distribution, the difference in the prediction and the original impact parameter is less than 0.5 (shown by the red points) and in some cases, it is less than 1. But for the lower range of impact parameters(b < 2f m) and eccentricities, we find the difference becomes significantly larger. This is also because of imbalance in the data as discussed. There are  [63]. This is adequately reflected in Fig.9, where a large amount of error is found in the very central region.

B. Results from the different HIC models
To check the model dependency, we have used the data from other HIC models and obtained the prediction of the impact parameter. The training of an ML model has been done using the AMPT model data, but the predictions are made for other heavy-ion collision models. The other HIC models used in this study are the VISH2+1 model [26] which is a hydrodynamic evolution code and a hybrid model made of VISH2+1 and UrQMD model [27].
In the hybrid model, the UrQMD code is used for later-stage hadronic re-scatterings. The reason for using multiple models is because we want the test set and the training set to come from different models giving the same p T spectra. This would mean that as long as the p T spectra is the same, the ML algorithms will not know which model simulated the test data.
As done in the previous cases, here also we have used the transverse momentum spectra of the AMPT model as the features and impact parameters of the corresponding AMPT events as targets for the ML model training. The AMPT events considered here are the minimum bias Au-Au events of 200 GeV collision energy. The p T spectra of VISH2+1 and hybrid model are obtained at the same collision energy and at specific centralities with impact parameters ranging from 0.1 fm to 14 fm. The parameter settings of the VISH2+1 model in this study is similar to the parameters considered in ref. [37], with the Glauber initial condition, shear viscosity to entropy density ratio η/s = 0.16 and decoupling temperature T dec = 160M eV .
The box plot is obtained for s95p-PCE equation of state. For the hybrid model, we set the η/s to 0.08, the equation of state used is s95p-PCE and T dec = 165M eV . We have got 5000 events each from both of these models at all the impact parameter ranges separately and fitted the average p T spectra with the experimentally obtained p T spectra [66,67]. We have considered the 0.15 to 1.4 GeV/c p T range to fit with the experimental spectra and also for ML model training. In this range, VISH2+1 data fits well with the experimental data. By doing this we are ensuring that the data is similar to the experiments. In an approximate manner, we are also examining the performance of ML models in case of the use of experimental data as test data for prediction. As we do not have event-by-event experimental data at specific centralities, we have used different HIC models to generate the p T spectra. In this way, we are able to obtain the error distribution of the predictions given by the ML model for a large number of events at specific centralities.
All the ML models considered in this study, e.g., kNN, RF, ET, and LR, perform reasonably well for impact parameter prediction for an unknown HIC model test data. In  Fig. 10(a), we see that for 0.1 and 0.5 fm impact parameter events, the relative prediction errors are more than three times and in Fig. 10(b), it is more than five times compared to the real impact parameters. We have considered Au-Au collision events where most central collisions of 0 − 5% centrality are comprised of events of impact parameter range 0 to 3.31 fm [16]. As has been discussed, in the case of experiments, the centrality is found out using the Glauber model. Thus, it is difficult to assign a specific impact parameter value especially in the case of the most central events.
We have seen the same nature in error prediction in Fig. 9 Fig. 9, 10] is observed in the prediction in the lower impact parameter range due to the imbalance in the impact parameter distribution in the training set. We overcome this through a custom sample weighing method as mentioned in Section III (B).
As mentioned previously in Section III B, initially, we have used standard packages to rebalance the data. The results are shown in Fig.11(a) for one of the methods. The others also give similar results. Although the error comes down in the lower impact parameter region compared to the errors obtained in Fig.9, still we get enough errors that would give a wrong estimate for the low impact parameter events. Finally, we give the results of our custom rebalancing method which has been described previously in detail in Section III B in Fig. 11(b). With our custom method we were able to minimize the error to less than 1 as shown in Fig. 11(b). This error is acceptable in this impact parameter range as the It is also interesting to see how the AMPT trained models predict eccentricities when they are introduced to other HIC model data. In Fig. 12(a), we show the distribution of eccentricity with the centrality of 200 GeV AMPT collision events. Although the color plot suggests that there is a linear relationship between the average eccentricity and impact parameter of collision events. We see that the range of eccentricity is lower for lower impact parameter values. As we go for higher impact parameter events, the range of eccentricity becomes larger. A similar observation has been shown previously in ref. [68]. In Fig. 12(b), we show the distribution of eccentricity predictions of VISH2+1 events for two centrality be interesting to see how the model would perform in that case. We plan to look at these in a later work.
We have shown an imbalance in the eccentricity distribution in Fig. 8(a). Due to this imbalance in the distribution, we get an accuracy of more than 95% in eccentricity prediction only when we consider a small range. For bigger range, the CV accuracy dropped down to 76%. A good amount of accuracy can also be achieved for a higher range of eccentricity distribution if the data is rebalanced in a suitable format. We have tried a similar rebalancing technique as is done for the impact parameter prediction. We took the same number of events from each of the distribution bins and trained the model. The prediction plot is shown in Fig. 13. We observe that the event points are much more closer to the optimum accuracy line (red line) compared to Fig. 8(b) which also have the same range of eccentricity. The accuracy obtained in this case is 89.49% with a cross-validation score of 91%. So, using these data rebalancing techniques, one can improve the performance of these ML models for the prediction of the impact parameter as well as the eccentricities.

V. CONCLUSIONS
We have trained different machine learning models to predict various initial stage parameters of a heavy-ion collision system using the AMPT model. We have used the p T spectra for training and testing of the ML models. We have chosen these spectra as it is one of the direct observables in heavy-ion collision experiments. We have observed their learning Out of the various models tested, we have chosen four models kNN, RF, ET and LR for the prediction of the impact parameter. All the models performed well in the impact parameter prediction. Most of the algorithms have shown an accuracy of more than 90% in the prediction of the impact parameter. In the case of the eccentricity, and the participant eccentricity prediction, three models i.e., the kNN, ET, and RF have performed exceptionally well and has given an accuracy of more than 90% after a 10-fold cross-validation. These three models along with the Decision tree and the Light gradient boosting machine have a 10-fold cross-validation score of more than 75% in almost all the cases. There is a range of eccentricity (0.2 − 0.32) where the optimum accuracy is obtained for the eccentricity predictions. A greater range of eccentricity (0.1 − 0.5) has also been taken into consideration.
We find that the choice of the range in eccentricity affects the prediction accuracy of the eccentricity due to the imbalance in the training data distribution.
We have also performed an analysis of how the model would possibly perform in predicting the centrality class using experimental data as test data. We have considered two heavy-ion collision models, a viscous hydrodynamic model (VISH2+1) and a hybrid model (Hydro+UrQMD) which are different from the AMPT model that is used for training the machine learning models. The ML model predictions of impact parameters are obtained for the events of the VISH2+1 model and the hybrid model. The hydro and hybrid model events considered for testing are taken at specific impact parameter ranges from 0.5 fm to 14 fm. The ML models (kNN results shown specifically) predicted the centrality classes of these events meticulously well. Although in both cases, we have obtained higher errors for the 0.5 fm events, the errors are very small at other impact parameters. The reason behind this is the lack of balance in the data set. When the data set is normalized, it is found that the peak of the distribution is not at the center. This indicates that the distribution of impact parameter and eccentricity over events are not isotropic.
To minimize these errors, we have used various sampling methods. Though there are several standard packages that help to rebalance the data, we finally see that the accuracy is improved in the lower impact parameter region if we assign different weights to the data at different impact parameters. For the Extratrees model, rarer events are given four times the weightage as the weightage given to impact parameters with a large number of events. This has helped improving the accuracy in the lower impact parameter range. Our rebalancing technique resulted in a cross-validation accuracy of more than 90% for a higher range of eccentricity distribution. This meant an overall improvement from 75% accuracy before the rebalancing to an accuracy of 90% after the rebalancing. Our study therefore shows a rebalanced data set will be useful in making accurate prediction close to the head on collisions.
Finally in conclusion, we have shown that it is possible to use the p T spectra only to make accurate predictions of the initial parameters such as the impact parameter, the eccentricity and the participant eccentricity using the ML algorithms. Even though the algorithm is trained by a single model, it can make accurate predictions from the data generated by other models as long as all the models are able to generate the experimental data accurately.
This means that any of the models may be used to train the data set. We have also found that the inaccuracies in the prediction are due to the imbalance in the data set. Proper rebalancing techniques can be used to rebalance the data set and this can be used to predict more accurate results in the low impact parameter regime.