In Search of Global 21-cm Signal using Artificial Neural Network in
  light of ARCADE 2
Understanding the astrophysical nature of the first stars still remains an
unsolved problem in cosmology. The redshifted global 21-cm signal
$(\text{T}_{21})$ acts as a treasure trove to probe the Cosmic Dawn era -- when
the intergalactic medium was mostly neutral. Many experiments, like SARAS 3,
EDGES, and DARE have been proposed to probe the cosmic dawn era. However,
extracting the faint cosmological signal buried inside a brighter foreground
$\mathcal{O}(10^4)$ remains challenging. Thus we use two artificial neural
networks, one for extraction of foreground, via parameter estimation with
R-square $(R^2)$ score $(0.8034 - 0.9984)$, from the total sky-averaged
spectrum. The other is for extraction of a global 21-cm signal in the presence
of noise with $R^2$ score $(0.6960 - 0.9978)$. Considering an excess radio
background scenario, we constructed all possible $\text{T}_{21}$ signals in the
EDGES limit, along with the foreground signal, to train the neural networks.
Here, we also explore the variation in parameter estimation due to the presence
of heating of intergalactic medium by background radio radiation mediated via
Ly$\alpha$ photons from first stars, and we found that the presence and absence
of this effect can change the global 21-cm signal estimation by $\sim 33$ mK in
the EDGES limit $(\sim -0.5\text{ K})$
Vivekanand Mohapatra, Johnny J, Pravin Kumar Natwariya, Jishnu Goswami, Alekha C. Nayak
# In Search of Global 21-cm Signal using Artificial Neural Network in light of EDGES and ARCADE 2

###### Abstract

Understanding the astrophysical nature of the first stars still remains an unsolved problem in cosmology. The redshifted global 21-cm signal and power spectrum act as a treasure trove to probe the Cosmic Dawn era-- when the intergalactic medium was mostly neutral. Many experiments, like SARAS 3, SKA, EDGES, DARE, etc., have been proposed to probe the cosmic dawn era. However, extracting the faint cosmological signal buried inside the brighter foregrounds \(\mathcal{O}(10^{4})\) remains challenging. Considering the excess radio background, we have constructed all possible \(T_{21}\) signals in the EDGES limit. We have used a single Artificial Neural Network for \(T_{21}\) parameter extraction in the presence of the foreground and noise with Root Mean Square Error (RMSE) and R-Squared (R2) score of \((0.2-0.08)\) and \((0.66-0.94)\), respectively. Here, we also explore the parameter estimation in the presence of heating of intergalactic medium due to background radio radiation mediated by Ly\(\alpha\) photons from first stars, and we found that the effect indeed has a significant impact on parameters correlation and their estimation.

keywords: cosmology: cosmic dawn, reionization, global 21-cm signal, EDGES, ARCADE 2, method: artificial neural network

## 1 Introduction

The evolution of the Intergalactic Medium (IGM) during the Cosmic Dawn (CD) era and the Epoch of Reionization (EoR) lacks a comprehensive understanding due to the uncertainty in the known physics of the formation and evolution of the first stars and galaxies in the Universe. The Global 21-cm signal (Pritchard & Loeb (2012); Furlanetto et al. (2006); Morales & Wyithe (2010)), 21-cm power spectrum (Bharadwaj & Sethi (2001); Bharadwaj & Ali (2004); Morales (2005); Zaldarriaga et al. (2004)), CMB anisotropy and polarization (Sehi & Subramanian (2005); Trivedi et al. (2012, 2014)) are some of the underlined methods to probe these epochs. Many experiments have been conducted, like, SARAS (Patra et al. (2013); Singh et al. (2017)), SARAS 3 (Bevins et al. (2022)), REACH (de Lera Acedo et al. (2022)), SCI-HI (Voytek et al. (2014)), HERA (DeBoer et al. (2017)), DARE (Burns et al. (2012, 2017)) etc., to measure these. Measuring the redshifted HI-21cm signal might act as a treasure trove to probe these epochs. Recently, EDGES collaboration has reported a 21-cm signal with the absorption of \(\sim 0.5^{-0.2}_{-0.5}\) K in the redshift range \(15-20\)-- which is twice the value predicted by the standard \(\Lambda\)CDM model of cosmology (Bowman et al. (2018)). Although SARAS 3 (Bevins et al. (2022)) have rejected the EDGES signal with 95.3% confidence level after conducting an independent check, yet the actual shape is unknown. If future experiments confirm a trough of amplitude greater than \(\sim 0.2\) K, which is the standard value, that could lead to a completely new insight into the physics of these epochs. Following the EDGES detection, several models have been proposed to construct all possible shapes and amplitudes of the global 21-cm signal. In the references (Barkana et al. (2018); Fraser et al. (2018); Slatyer & Wu (2018); Pospelov et al. (2018)), the authors have considered excess cooling of IGM gas by Dark Matter-Baryon scattering, (Bhatt et al. (2020); Natwariya & Bhatt (2020)) have considered Primordial Magnetic Fields (PMFs) and DM-Baryon Scattering in presence of PMFs, (Narwariya et al. (2021); Natwariya & Nayak (2022)) have considered energy injected due to Primordial Black Holes (PBHs) and decaying sterile neutrinos. In addition to that, (Fialkov et al. (2018); Fraser et al. (2018); Feng & Holder (2018)) have considered excess-radio background radiation, which could be due to several phenomena, like stimulated emission from Bose (axion) star (Levkov et al. (2020)), radio emission from Pop III black holes (Mebane et al. (2020)), conversion axion-photon in presence of magnetic field (Moroi et al. (2018)). Recently, ARCADE 2 (Feng & Holder (2018); Fixsen et al. (2011)) and LWA1 (Dowell & Taylor (2018)) have detected an excess-radio background in the frequency range of \(3-10\) GHz and \(40-80\) MHz, respectively. ARCADE 2 detection mimics the Cosmic Microwave Background Radiation (CMBR) for a frequency \(\nu>10\) GHz but deviated significantly otherwise. These detections have been modelled by a power law with a spectral index (\(\beta\)) of \(-2.62\pm 0.04\) and \(-2.58\pm 0.05\) for ARCADE 2 and LWA1, respectively.

Detecting the 21-cm signal (mK) buried in a sea full of bright foreground radiation of the \(\mathcal{O}(10^{4})\) stronger is an observation challenge. In addition to that, the ionospheric effect, radio frequency interference (RFI), and instrument response make it a tougher job. These effects, especially ionospheric distortion and RFI, can be reduced significantly if one considers far-side Moon-based experiments like
DARE (Burns et al. (2012, 2017)). One of the most common techniques adapted to remove the foreground radiation is considering it well-characterized and spectrally smooth. After removing the foreground radiation, the residual contains the global 21-cm signal having the signature of the IGM evolution.

The Machine Learning (ML) technique has been used previously by many authors to study the CD and EoR. (Shimabukuro and Semelin (2017); Schmit and Pritchard (2018)) have used ANN for parameter extraction from the 21-cm power spectrum. In the references (Jennings et al. (2019); Hassan et al. (2019); Chardin et al. (2019); Gillet et al. (2019)), the convolutional neural network (CNN) has been used to study and extract parameters from the 21-cm maps. Here, the aforementioned authors have used 21-cm signal and reionization simulations for parameter extraction (Choudhury et al. (2020, 2021)). The authors have also included foreground contamination for parameter extraction from synthetic data. In the present work, we have used ANN to extract parameters associated with IGM properties via the global 21-cm signal. First, we generate the datasets for the 21-cm signal by varying the free parameters described in section (4). Here we have generated two types of 21-cm signal datasets: one consists of the IGM gas heating due to the radio background mediated by Ly\(\alpha\) radiation from first stars (Venumadhav et al. (2018)), and in the second type of dataset we do not include this effect. After the generation of the datasets, we add foreground radiation and noise for training and prediction purposes.

This work is organised as follows: In section (2) briefly introduces the global 21-cm signal and excess background radiation. In section (3), the evolution of the IGM temperature and the importance of IGM gas heating due to the radio background mediated by Ly\(\alpha\) radiation from first stars in excess background radiation. In section (4 - 5), construction of the global 21-cm signal and foreground along with the corresponding associated parameters. In section (6), we briefly introduce the ANN, construction of training and prediction data sets. In section (7), we estimate the parameter from noisy data and reconstruct the global 21-cm signal. Section (8) includes a summary, conclusion and outlook.

## 2 The global 21-cm signal

The hyperfine transition between 1S singlet (\(n_{0}\)) and triplet (\(n_{1}\)) states in a neutral hydrogen atom (HI) occur due to the interaction of proton and electron spin. The relative number density of neutral hydrogen in triplet and singlet states is characterized by spin temperature (\(T_{s}\))

\[\frac{n_{1}}{n_{0}}=\frac{\delta_{1}}{g_{0}}e^{-2\pi\nu_{21}/T_{s}}=3\times e ^{-T_{s}/T_{s}} \tag{1}\]

where, \(g_{1}=3\), \(g_{0}=1\) denotes statistical weight of the respective states, \(\nu_{21}=1420\) MHz is frequency of the photon and \(T_{s}=2\pi\nu_{21}\). The 21-cm differential brightness temperature (\(T_{21}\)), measured relative to the cosmic background radiation (Pritchard and Loeb (2012); Furlanetto and Pritchard (2006); Mesinger et al. (2011); Mesinger and Furlanetto (2007)) is given by:

\[T_{21}\approx 27_{\rm{HI}}\left(\frac{0.15}{\Omega_{m}h^{2}}\frac{1+z}{10} \right)^{1/2}\left(\frac{\Omega_{b}h^{2}}{0.023}\right)\left(1-\frac{T_{r}}{T _{s}}\right){\rm{mK}} \tag{2}\]

where, \(\Omega_{b}\) and \(\Omega_{m}\) represent baryon and total matter density parameter in the unit of critical density, \(x_{\rm{HI}}\) denotes the fraction of neutral hydrogen atom, \(h\) represents the Hubble parameter (Aghanim et al. (2020)), \(T_{r}\) denotes background radiation. After recombination, the baryon number density predominantly contained neutral hydrogen atoms, residual electrons (\(n_{e}\)) and residual protons (\(n_{p}\)) making the global 21-cm signal a useful probe to study CD and EoR. It can provide information about first-star formation, X-ray heating, radio background heating, and excessive background radiation. Throughout this work, we use Eq. (2) to construct the global 21-cm signal.

The most crucial quantities in Eq. (2) are \(x_{\rm{HI}},T_{s},\) and \(T_{r}\) which determines the intensity of \(T_{21}\). The spin temperature (\(T_{s}\)) given by

\[\begin{split} T_{s}^{-1}&=\frac{T_{r}^{-1}+x_{ \alpha}T_{\alpha}^{-1}+x_{c}T_{g}^{-1}}{1+x_{\alpha}+x_{c}}\\ x_{\alpha}&=\frac{T_{21}}{T_{r}}\frac{N_{i}k_{\rm{ HI}}^{4}}{A_{10}}\quad\mbox{and}\quad x_{c}=\frac{T_{21}}{T_{r}}\frac{4P_{ \alpha}}{27A_{10}}\end{split} \tag{3}\]

where, \(x_{\alpha}\), \(x_{c}\) denotes the Ly\(\alpha\) and collision coupling coefficient about the excess-radio background radiation, respectively, whereas \(N_{i}\), \(k_{\rm{HI}}^{4},P_{\alpha}\), \(A_{10}\) respectively represent number density of the species "\(i\)", the spin de-excitation rate coefficient due to collisions of species "\(i\)" with the hydrogen atom, scattering rate of Ly\(\alpha\) (Lyman Alpha) radiation, and the Einstein coefficient for spontaneous emission from triplet to the singlet state. \(T_{\alpha}\), \(T_{g}\) respectively denotes the colour and kinetic gas temperatures. The three dominant non-exotic processes that determine (\(T_{r}/T_{s}\)) are: (1) absorption and spontaneous emission of background radiation; (2) collision with the hydrogen atoms, residual electrons and protons; (3) the Wouthuysen-Field (WF) effect (Wouthuysen (1952); Field (1959)) which represents excitation and de-excitation of Ly\(\alpha\) photons in HI atom.

As discussed in section (1), the excess radio background radiation cannot be denied completely. ARCADE 2 and LWA1 measurements inspired uniform redshift-independent synchrotron-like radiation have been considered to represent such radiation, as shown in Fig. (1), whose phenomenological model is provided here (Fialkov and Barkana (2019); Mondal et al. (2020); Banet et al. (2021); Reis et al. (2020); Yang (2018))

\[T_{r}=T_{\rm{cmb,0}}(1+z)\left[1+A_{r}\left(\frac{\nu_{\rm{obs}}}{78\;{\rm MHz }}\right)^{\beta}\right] \tag{4}\]

where, \(T_{\rm{cmb,0}}=2.723\) K is the present-day CMB temperature and \(\beta=-2.6\) is the spectral index. For 21-cm signal \(\nu_{\rm{obs}}=1420\) MHz\((1+z)\) and \(A_{r}\) is the amplitude defined in the reference of CMB at frequency 78 MHz. Considering uniform radiation excess from the dark age, cosmic dawn, and reionization, author (Fialkov and Barkana (2019)) have limited the excess background amplitude to be \(1.9<A_{r}<418\) at the reference frequency of 78 MHz. As discussed here (Dowell and Taylor (2018)), LWA1 sets the limit on \(A_{r}\sim 418\). The Low Frequency Array (LOFAR) imposes a strict limit on excess radiation of \(A_{r}<182\) (95% CL) and \(A_{r}<259\) (99% CL).

In the review (Pritchard and Loeb (2012)), the evolution of the global 21-cm signal in CMB bath has been described in detail; here, we will briefly explain the same. At the end of recombination, which occurred at a redshift (\(z\approx 1100\)) neutral hydrogen atoms were formed, and the photons were free to travel known as CMB. This period is often called the last scattering surface. Due to the Compton scattering, the CMB and gas were in thermal equilibrium, (\(T_{cmb}\approx T_{g}\)), till \(z\sim 200\) causing the absence of the 21-cm signal. This era is called the Dark Ages. Due to cosmic expansion, \(T_{g}\) and \(T_{cmb}\) cooled down \(\propto(1+z)^{2}\) and \(\propto(1+z)\) respectively, over the time. For redshifts \(40\lesssim z\lesssim 200\), \(x_{c}\ll 1\), which causes an absorption signal. Nevertheless, this absorption signal has not been observed yet due to radio antennas'
poor sensitivity, which falls dramatically for frequencies below 50 MHz. At \(z<40\)  till the formation of first star the \(x_{e}\approx 0\)  causing no 21-cm signal (Barkana et al. (2018); Pritchard and Loeb (2012)). Ly\(\alpha\) radiation coupled the gas via WF effect after the first star formation at redshift \(z\sim 30-25\)  making \(x_{\alpha}\gg 1\). During this time, an absorption signal can be observed, and this phase is called the Cosmic Dawn (CD). Around \(z\sim 15\), X-ray radiation from AGN could have heated the gas, causing an emission signal. After a certain period, at \(z\sim 7-5;x_{e}\to 1\)  resulting in no signal. This era is called the Epoch of Reionization (EoR). Instead of considering a wide range of redshifts in this work, we have considered EDGES reference \(z\sim 27-14\)(Bowman et al. (2018)).

## 3 Evolution of gas temperature

The standard evolution of gas temperature (\(T_{g}\)) and ionization fraction (\(x_{i}\approx(1-x_{e})\)) with redshift without any exotic energy injection can be written as

\[\begin{split}\frac{dx_{e}}{dz}&=\frac{\mathcal{P}}{ (1+z)H}\left[n_{H}x_{e}^{2}\alpha_{B}-(1-x_{e})\beta_{B}e^{-E_{\alpha}/T_{ \rm cmb}}\right]\\ \frac{dT_{B}}{dz}&=2\frac{Tg}{1+z}+\frac{\Gamma_{c} }{(1+z)H}\left(T_{g}-T_{\rm cmb}\right)\\ \Gamma_{c}&=\frac{8N_{e}\sigma_{T}\alpha_{T}T_{\rm cmb }^{4}}{3m_{e}N_{\rm tot}}\\ \mathcal{P}&=\frac{1+\mathcal{K}H\Lambda_{H}n_{H}(1 -x_{e})}{1+\mathcal{K}H\left(\Lambda_{H}+\beta_{H}\right)n_{H}(1-x_{e})}\end{split} \tag{5}\]

Here, \(\mathcal{P}\) is Rebless coefficient (D'Amico et al. (2018); Peebles (1968)), \(\mathcal{K}H\equiv 7^{2}/(E_{\alpha}^{3}H)\) and \(\Lambda_{H}=8.22\)/sec represents redshifting of Ly\(\alpha\) photons and 2S-1S level two-photon decay rate in hydrogen atom (Tung et al. (1984)). \(\alpha_{B}\)  and \(\beta_{B}\) are the case-B recombination and photo-ionization rate respectively (Mitridate and Podo (2018); Seager et al. (1999, 2000)). \(N_{\rm tot}=N_{H}(1+f_{He}+xe)\), \(f_{He}=0.08,T_{\rm cmb}=T_{\rm cmb,0}(1+z)\cdot a_{r}=7.57\times 10^{-16}\) Jm\({}^{-3}\)K\({}^{-4}\) is the radiation density constant, \(\sigma_{T}\) is the Thomson scattering cross-section, and \(m_{e}\) is the mass of electron. During the early stages (\(z\gtrsim 200\)), \(T_{g}\) was in equilibrium with the cosmic microwave background temperature (CMB) due to Compton scattering. However, the influence of non-thermal excess radio radiation on the gas temperature is insignificant in the second term and can be ignored (Feng and Holder (2018)). After the formation of the first stars (at \(z\sim 30\)), their radiation begins to heat the IGM. In addition to X-ray heating, the gas temperature may increase by \(\sim 10\%\) due to CMB only, even in the absence of X-ray heating or excess radio background-- from now on we write this heating effect as "VDKZ18" (Venumadhav et al. (2018)). We analyse our final results in both scenarios: with and without the VDKZ18 heating effect due to excess radio background. In presence of X-ray heating and VDKZ18, the \(T_{g}\) in equation (5) will be modified as:

\[\begin{split}\frac{dT_{g}}{dz}&=2\frac{Tg}{1+z}+ \frac{\Gamma_{c}}{(1+z)H}\left(T_{g}-T_{\rm cmb}\right)+\frac{dT_{g}}{dz} \bigg{|}_{\rm X-ray}+\frac{N_{H}\Gamma_{r}}{(1+z)N_{\rm tot}}\\ \Gamma_{r}&=\left(1-\frac{T_{r}}{T_{s}}\right)\frac{A _{10}T_{10}}{2H}x_{\rm HI}x_{r}\end{split} \tag{6}\]

here, \(x_{r}=1/\tau_{21}\times[1-\exp(-\tau_{21})]\), and the 21-cm optical depth \(\tau_{21}=8.1\times 10^{-2}x_{\rm HI}[(1+z)/20]^{1.5}(10\rm K/T_{S})\). Motivated by references (Kovetz et al. (2018); Mirocha et al. (2015); Harker et al. (2016)), to account for the impact of X-ray heating and ionization of the IGM we adopt tanh parameterization. For the evolution of ionization fraction due to X-ray heating, we use \(x_{e}=x_{e}^{\prime}(1+\tanh[(x_{e0}^{\prime}-z)/\delta z)]\) with \((x_{e}^{\prime},x_{e0}^{\prime},\delta z)=(1,9,3)\) as the corresponding values. The chosen model is based on the one proposed in Ref. (Kovetz et al. (2018)), and the same fiducial model is considered for the present case. In Fig. (2), we examined the impact of VDKZ18 and X-ray heating on IGM. Focusing on the red solid line of Fig. (2a), which represents VDKZ18 heating without excess background radiation (\(A_{r}=0\)), i.e. only CMB as background radiation. As we increase the value of \(A_{r}\) from \(0\to 418\), the gas temperature increases substantially. However, it can be seen that for \(A_{r}\) in the range \((300-418)\) the curves clumped signifying no significant change in \(T_{g}\). This is because \(\Gamma_{r}\propto(T_{r}/T_{s}-1)\sim T_{r}/T_{s}\) in Eq. (6), and as we increase \(A_{r}\), \(T_{r}/T_{s}\) increases slowly-- as also shown by the reference (Natwariya (2021)). We have also investigated the role of X-ray heating after the inclusion of the VDKZ18-- shown by Fig. (2b). The gas temperature changes significantly when we increase \(A_{r}\) from 0 to 200 depicted by the red and blue solid lines. However, as soon as we increase the \(A_{r}\) value further, \(T_{g}\) almost remains constant as shown by the yellow and cyan solid line. Thus along with X-ray heating, it is important to incorporate VDKZ18 heating when there is excess background radiation, especially in LOFAR limit, as it can lead to a substantial increase in \(T_{g}\) in the redshift range of \(z<15\), which is of particular interest for reionization models.

## 4 Generating the global 21-cm signal

Many theoretical models propose that the shape and amplitude of the cosmic global 21-cm signal may change. (Fialkov et al. (2014, 2015)) and (Cohen et al. (2017)) employed a semi-numerical technique to predict possible 21-cm global signals between the redshift range of \(z\sim 6-40\). The cosmic signal is parameterized by using physical characteristics-- intimately connected to the IGM features, allowing us to deduce the physics of the earliest source. (Bernardi et al. (2015, 2016)) represent the absorption characteristic as Gaussian. Similarly, (Pritchard and Loeb (2010)) proposed a turning point model, which

Figure 1: The excess background radiation \(T_{r}\) as a function of redshift (\(z\)) for different values of the amplitude \(A_{r}\) given in Eq. (4). Here, \(A_{r}=0\) represents the standard CMB radiation \(T_{cmb}(z)\). On increasing \(A_{r}\) from \(0-140\), \(T_{r}\) changes significantly. However, as soon as it crosses \(A_{r}=200\) the curves become closely spaced.
indicates positions in redshift, and amplitude and shape of brightness temperature. The section of the global signal between the turning points is represented as a cubic spline, which allows great flexibility and may describe a variety of 21-cm signals. Nevertheless, additional interpretation is required to link the turning point positions to the physics of the initial luminous sources. Mirocha et al. (2013, 2015); Harker (2015) proposed the tanh parameterization, which uses a succession of tanh functions to simulate the global signal.

Although it is possible to use a fixed value for \(x_{\sigma}\sim 10^{-4}\) here (Bharadwaj & Ali, 2004; Choudhury et al., 2021)), we instead consider solving all coupled equations. We solve the IGM temperature evolution Eq. (6) and evolution of ionization fraction in Eq. (5) to construct a simulated global 21-cm signal in this work. The initial conditions for \(T_{g}\) and \(x_{\sigma}\) are taken from RECFAST++ (Seger et al., 1999). Ly\(\alpha\) background influences the amplitude of \(T_{21}(z)\) via WF coupling (\(x_{\alpha}\)) and \(T_{21}\) as described in Eq. (3), thus we adopt a tanh parameterization inspired from Ref. (Kovetz et al., 2018; Natwariya, 2021; Harker et al., 2016)). Other than \(A_{r}\) in Eq. (4) which act as a free parameter (Feng & Holder (2018); Singal et al. (2018); Fixsen et al. (2011)), the two quantities (\(x_{\alpha}\) and \(T_{\rm Xiny}\)) are allowed to evolve as a tanh function given by,

\[{\rm C}={\rm C}_{\rm ref}\left(1+\tanh\left\{\frac{C_{z0}-z}{C_{dz}}\right\}\right) \tag{7}\]

where, \({\rm C}\) represents the cosmological parameters \(x_{\alpha}\) and \(T_{\rm Xray}\). \(C_{dz}\), \({\rm C}_{\rm ref}\) and \(C_{z0}\) represent the duration, step height and pivot redshift, respectively. Because these characteristics are directly related to IGM characteristics rather than luminous source features, they bridge the physical and phenomenological models such as spline or Gaussian models. In this work, We used one non-tanh function (\(A_{r}\)) and two tanh functions (\(T_{\rm Xray}\) and \(x_{\alpha}\)). The tanh parameterized parameters, as a function of three independent parameters, are mentioned below.

\[\begin{split}\mathrm{x}_{\alpha}&={\rm x}_{\rm ref} \left(1+\tanh\left\{\left(x_{z0}-z\right)/x_{dz}\right\}\right)\\ {\rm T}_{\rm Xray}&={\rm T}_{\rm ref}\left(1+\tanh \left\{\left(T_{z0}-z\right)/T_{dz}\right\}\right)\end{split} \tag{8}\]

Here, we focus on CD and EoR, therefore, the standard global 21-cm signal is generated using the hyperbolic tangent (tanh) function in the redshift range \(z\sim 22-14\), as presented in Figure (3a). As

Figure 3: The parameterized global 21-cm signal in the presence of excess-radio background radiation. Fig. (3a) shows the construction of global 21-cm signal using tanh parameterization in the absence of excess-radio background radiation. Fig. (3b) shows a shift and increment in the amplitude of Fig. (3a) while considering \((0,0.1,1,10,100)\) % of the excess term in eq (4) for a constant \(A_{r}=1.9\) value, where the solid and dashed curves depict presence and absence of the VDKZ18 respectively. Fig. (3c) shows the global 21-cm signal for different \(A_{r}\) values. While the dashed horizontal line for all three figure sets \(T_{21}=0\).

Figure 2: Thermal evolution of gas temperature in the presence of X-ray and VDKZ18. Fig. (2a) shows that \(T_{\rm g}\left(z\right)\) starts to vary due to VDKZ18 from \(z\sim 20\) after the first star formation. The inclusion of excess-background radiation does change \(T_{\rm g}\) with \(A_{r}\). Fig. (2b) shows that X-ray heating changes \(T_{\rm g}\) significantly, but it can be clearly seen that the existence of excess radiation shifts the \(T_{\rm g}\) curve. In both plot, the shaded region shows \(15<z<20\) region.
explained in section (2), the 21-cm signal \(T_{21}\neq 0\) for \(14\lesssim z\lesssim 30\). At these redshift ranges, both X-ray and VDKZ18 heating dominate significantly. Therefore, we consider both IGM heating mechanisms in Eq. (6) for the evolution of the gas temperature along with the standard gas evolution equation. The inclusion of the VDKZ18 can change the amplitude and position of \(T_{21}(z)\) even in the presence of a strong heating effect like X-ray heating (Fig. (a)a). In Fig. (b)b, we considered a value of \(A_{r}=1.9\) indicating that such excess radiation would increase its amplitude significantly, reaching EDGES limit (\(-500\) mK). But as soon as \(A_{r}\) approaches a value above \(200\), the troughs become closely spaced, as plotted in Fig. (c)c. Therefore, to generate the training data set, we have to consider the range \(A_{r}\sim 0-200\).

We have considered \(T_{\text{ref}}=10^{3}\) K and \(x_{e}^{\prime}\) to be fixed as its value saturates at lower redshifts. All other parameters, along with \(A_{r}\) have been considered as free parameters, i.e., \(x_{\text{ref}}\), \(x_{20}\), \(x_{d\text{z}}\), \(x_{\text{z}^{\prime}0}^{\prime}\), \(\delta z\), \(T_{20}\), and \(T_{d\text{z}}\), which we varied to generate global 21-cm signals of different shapes and amplitudes. The inferred value of the aforementioned free parameters for generating the standard curve (Fig. (a)a) is taken to be \((100,\ 17,\ 2,\ 9,\ 3,\ 12.75,\ 1)\) respectively (Kovetz et al. (2018); Naturiya (2021)). We varied \(\left(x_{\text{ref}},x_{\text{z}00}.x_{\text{z}0}^{\prime},T_{20}\right)\) and \(\left(x_{d\text{z}},\delta z,T_{d\text{z}}\right)\) by (\(\pm 30\%\) and \(\pm 10\%\)) respectively, to generate the training signal keeping the range \(-200\) mK \(<T_{21}<-1000\) mK; in reference to EDGES limit. For \(A_{r}\), we considered the minimum and maximum values to be \(0\) and \(200\). We have considered the minimum value to be \(0\), as it depicts CMBR as the background radiation.

The parameter range examined in this study adequately depicts a wide variety of global signal shapes, as shown in section (6.2). The choice of the \(\tanh\) model was motivated by its ability to link it to the physical characteristics of the IGM. The \(\tanh\) parameters are connected to the IGM properties but cannot provide direct information about the early source properties. Therefore, it may be regarded as an intermediate between purely physical models and entirely phenomenological models, such as the 'turning point' model as argued here (Choudhury et al. (2020)). Rather than solely parametrizing the \(T_{21}(z)\) using a \(\tanh\) function, we opted to use parameterization for the source (first star) related quantities, i.e., X-ray and Ly\(\alpha\)  while maintaining the conventional cosmological intergalactic medium evolution. In future work, we aim to include parameters that directly link to the astrophysical nature of first-star.

## 5 Foreground modelling

Detecting the weak global 21-cm signal during CD and EoR is challenging due to the strong foreground radiation and various instrumental and atmospheric distortions. The radio emissions from the Milky Way and other extragalactic sources are significantly brighter than the cosmological signal. The expected strength of the global 21-cm signal is approximately \(10^{-4}\) times weaker than the foreground emissions. Experiments face significant challenges in extracting the global 21-cm signal due to bright foregrounds, Radio Frequency Interference (RFI), and instrumental calibration errors. These challenges require sophisticated simulations to determine the impact of these factors on the extraction of the desired signal. Therefore, having a precise model for foregrounds at radio frequencies is crucial to ensure accurate prediction. According to (Pritchard & Loeb (2010), Bernardi et al. (2016), Bernardi et al. (2015)), the foreground spectrum can be represented as a polynomial in the \(\ln(\text{T})-\ln(\nu)\). In Ref. (Harker et al. (2016)), it is demonstrated using a \(3^{\text{rd}}\) or \(4^{\text{th}}\)-order polynomial is sufficient enough to model the sky spectrum. Still, it has been found that a \(7^{\text{th}}\)-order polynomial is necessary when incorporating the chromatic primary beam of the antenna. SARAS 3 (Singh et al. (2022)) have used a \(6^{\text{th}}\)-order \(\ln(\text{T})-\ln(\nu)\) to model Galactic and extragalactic foreground passing though ionosphere added with systematic calibration error in a band of frequency \(55-85\) MHz with a resolution of \(61\) kHz.

In our work, following the Ref. (Bowman et al. (2018)), we used \(\ln(\text{T})-\ln(\nu)\) model of \(5^{\text{th}}\) order polynomial to represent the Galactic synchronous radiation of spectral index \(-2.5\) along with Earth's ionosphere distortion

\[T_{\text{FG}}(\nu)=b_{0}\left(\frac{\nu}{\nu_{0}}\right)^{-2.5+b_{1}+b_{2}\ln( \nu/\nu_{0})}e^{-b_{2}(\nu/\nu_{0})^{-2}}+b_{4}\left(\frac{\nu}{\nu_{0}}\right) ^{-2} \tag{9}\]

where, \(b_{0}\) represents an overall foreground scale factor, \(b_{1}\) considers correction to the foreground with specified spectral index, \(b_{2}\) considers the higher-order spectral terms, \(b_{3}\) for ionospheric absorption effect, and \(b_{4}\) for emission from the hot electron in the ionosphere. Here, we have used the linearized form of Eq. (9),

\[T_{\text{FG}}(\nu)\approx\left(\frac{\nu}{\nu_{0}}\right)^{-2.5} \left[b_{0}+b_{1}\ln(\nu/\nu_{0})+b_{2}(\ln(\nu/\nu_{0}))^{2}\right. \tag{10}\] \[+b_{3}(\nu/\nu_{0})^{-2}+b_{4}(\nu/\nu_{0})^{0.5}\right]\]

Using the publicly available data by EDGES1, we estimated2 Eq. (10) coefficients to be \(\left[b_{0},b_{1},b_{2},b_{3},b_{4}\right]=\left[711.8636,17.5110,-183.0153,171.6 506,699.3283\right]\) for \(\nu_{0}=78\) MHz in the band of \(51-100\) MHz, shown in Fig. (5). To generate the training set, shown in Fig. (6), we varied the free parameters by \(\pm 20\%\). This training data includes an even distribution of \(T_{FG}\) around the fitted data (Fig. (5)). The foreground is smoother than the cosmological signal, and we use this feature to extract the \(T_{21}\) signal, as described in section (7).

Footnote 1: [https://loco.lab.asu.edu/edges/edges-data-release/](https://loco.lab.asu.edu/edges/edges-data-release/)

Footnote 2: We estimated the coefficients using a simple gradient descent method of Mean Square Error (MSE) cost function. The Python code can be found in [https://github.com/DarkMatter#03/Neural-Network-and-21-cm-Cosmology](https://github.com/DarkMatter#03/Neural-Network-and-21-cm-Cosmology)

## 6 Artificial neural network

### Overview

This section briefly introduces the fundamental concepts of artificial neural networks (ANNs). A basic neural network comprises three principal layers: an input layer, one or more hidden layers, and an output layer. In a feed-forward and fully connected neural network, every neuron in a given layer is connected to every neuron in the subsequent layer, and the transmission of information is unidirectional. The neuron serves as the fundamental unit of an ANN. Each of these connections is associated with a weight and a bias. A cost or error function is computed following each forward pass in the output layer. During training, this cost function is optimized iteratively by back-propagating the errors. A thorough explanation of the fundamental algorithm employed in artificial neural networks can be found in (Choudhury et al. (2020, 2021); Olvera et al. (2022)). Our
feed-forward network utilizes an ANN with two Dense layers, implemented using the Sequential Model from the PyTorch in Python. In the input layer, we have incorporated 1024 neurons to correspond with the 1024 frequency channels ranging from \(53-98\) MHz. We have utilized standard scikitlearn(Pospelov et al. (2018)) and PyTorch modules to construct our network, determining the number and size of hidden layers to maximize network performance. The number of neurons in the output layer aligns with the number of output parameters we aim to predict. The following sections comprehensively describe the neural network's structure used in our study.

### Construction of Training data set

We have generated the training data set as described in section (4 - 5) by varying the IGM and foreground parameters in the aforementioned range. The effect of VDKZ18 in the presence of excess background radiation can be seen in Fig. (3); hence two different training sets were built \(\mathrm{T}_{21c}\) and \(\mathrm{T}_{21wc}\) with represents 21-cm signal with and without VDKZ18 respectively. In both cases, we have kept the absorption amplitude's lower and upper limits to be \(-200\) and \(-1000\) mK. We kept our \(\mathrm{\mathcal{T}}_{21}\) training set lower limit as \(-200\) mK such it will include the possibility of extracting signal if found in future experiments. Taking into account a redshift range of \(53-98\) MHz, we built both foreground and 21-cm signal training sets across 1024 channels and of the same order (mK) to avoid a biased prediction. The mock-training data set consists of four signals:

\[\mathrm{T}_{\mathrm{tot}}^{1} =\mathrm{T}_{21c}(\nu) \tag{11}\] \[\mathrm{T}_{\mathrm{tot}}^{2} =\mathrm{T}_{21cw}(\nu)\] \[\mathrm{T}_{\mathrm{tot}}^{3} =\mathrm{T}_{21c}(\nu)+\mathrm{TF}_{\mathrm{G}}(\nu)\]

The Pearson correlation3 between all cosmological (\(\mathrm{\mathcal{T}}_{21}\)) param

Figure 4: Construction of the global 21-cm signal (a) in the absence of the VDKZ18 and (b) in the presence of the VDKZ18. In both cases, we have kept the absorption amplitude to be in the range of \(-200\)mK \(<\mathrm{\mathcal{T}}_{21}<-1000\)mK following the EDGES limit.

Figure 5: Total sky averaged spectrum considered to represent the foreground radiation.

Figure 6: The foreground modelling training data set used in the neural network. We have generated this dataset using Eq. (10). As expected, it can be seen that the foreground is \(\sim 10^{4}\) brighter than the 21-cm cosmological signal.
eters can be analyzed from Fig. (8), which has been used during the training process. It can be seen that \(x_{x0}\) and \(T_{x0}\) are negatively correlated to each other. At the same time, they are negatively and positively correlated to \(A_{r}\), respectively, in the case of the absence of the VDKZ18(Fig. (8a)). In the presence of the VDKZ18(Fig. (8b)), \(x_{x0}\) and \(T_{x0}\) are positively correlated to each other while being uncorrelated to \(A_{r}\). In section (6.3), we added noise to the above training set for parameter prediction.

### Predicting Dataset

In this work, we have constructed two sets of predicting data sets, as mentioned above, by adding noise. We added the noise (\(\sigma_{t}(\nu)\)) (Bowman et al. (2018)) to every \(\mathbf{T}_{\text{tot}}^{l}\) in Eq. (11) i.e.,

\[\mathbf{T}_{\text{pred}}^{l}=\mathbf{T}_{\text{tot}}^{l}+\sigma_{t}(\nu) \tag{12}\]

where, \(\sigma_{t}(\nu)\) is the thermal noise which can be re-written from the standard radiometer equation as a function of bandwidth \(\Delta\nu\) and observational time \(\tau=10^{6}\times 3600\times\mathbf{N}_{t}\); \(\mathbf{N}_{t}\) being the hours of observation.

\[\sigma_{t}(\nu)=\frac{\mathbf{T}_{sys}(\nu)}{\sqrt{\delta\nu\cdot\tau}} \tag{13}\]

The \(\mathbf{T}_{sys}(\nu)\) can be replaced with \(T_{\text{FG}}(\nu)\) for our work. It can be seen that \(\sigma_{t}(\nu)\propto 1/\sqrt{\mathbf{N}_{t}}\), thus for this work we considered \(\mathbf{N}_{t}=1000\) hr of observational time. While the training set in Eq. (11) monitors the neural network's performance, the prediction data set in Eq. (12) has been used for evaluating the accuracy of parameter estimation. The Root mean square error (RMSE) and R2 score have been given to each parameter estimation as metrics for all prediction datasets to depict the accuracy. The RMSE and R2 score can be expressed as

\[\text{R2}=1-\frac{\sum\left(X_{\text{pred}}-X_{\text{orig}}\right)^{2}}{\sum \left(X_{\text{orig}}-\bar{X}_{\text{orig}}\right)^{2}} \tag{14}\]

\[\text{RMSE}=\sqrt{\frac{1}{\text{Npred}}\sum_{j=1}^{\text{Npred}}\left(\frac {X_{\text{orig},j}-X_{\text{pred},j}}{X_{\text{orig},j}}\right)^{2}} \tag{15}\]

where \(\bar{X}_{\text{orig}}\) is the average of original parameters which has been summed over all training data. The R2 value lies in the interval \((0,1]\) where R2 = 1 represents perfect inference.

## 7 Result

### Only 21-cm Signal

We build two neural networks of \((1024,6)\) neuron input and output layer corresponding to the frequency channel used in generating the global 21-cm signal shown in Fig. (4). We added three hidden layers of 64, 32, and 16 neurons with activation function ReLU(Shang et al. (2016)) to make the network deep. We used nn module of PyTorch(Paszke et al. (2019)), which contains Sequential API for the feed-forward process. We considered 2000 sample data as input which was split into training and testing dataset (\(8:2\)) using sklearn(Pedregosa et al. (2011)). Before feeding the training data to the neural network, we preprocessed it using 'MinMaxScaler' from sklearn. To adjust the weight of the hidden layers optimally over the training process, we used Mean Square Error (MSE) as the error function and 'Adam'(Kingma & Ba (2014)) as the optimizer. After tuning all the hyperparameters, the model was trained and saved for prediction. As shown in Fig. (9), the model loss approached a constant value after 500 epochs. To check the performance of the neural network after training, we predicted 6 parameters \(\left(A_{r},x_{\text{ref}},x_{\text{20}},T_{\text{20}},x_{\text{-}},T_{\text{ 2dz}}\right)\) by assigning Root Mean Square Error (RMSE) and R-Squared (R2) score to it, as shown in the Fig. (10, 11). The use of a single ANN limits us from extracting a few parameters efficiently, thus \(x_{e}\) parameters are not considered. We find that the RMSE and R2 scores around \((0.054-0.011)\) and \((0.99-0.92)\), respectively, in the presence of VDKZ18; while in the absence of VDKZ18, the values are around \((0.012-0.068)\) and \((0.99-0.87)\) respectively.

### 21-cm Signal and Noise

In section (7.1), we predicted the parameters after training the neural network with \(T_{21}\) signal. In this section, to check the robustness of the network, we included noise \(\sigma_{t}(\nu)\), as defined in section (6.3), to the prediction dataset.

\[\mathbf{T}_{\text{pred}}^{1}=\mathbf{T}_{\text{tot}}^{1}+\sigma_{t}(\nu) \tag{16}\]

We constructed another neural network using the technique mentioned in section (7.1). To optimize the training and performance, we kept the number of hidden layers as two, with 64 and 32 neurons to train the NN in the case when VDKZ18 is present. But, in the absence of the VDKZ18 effect case, we chose the number of hidden layers to be three with 128, 64, and 32 neurons. Two different NNs have been considered as the correlation between the parameter changes in the presence and absence of the VDKZ18. The activation function was changed from ReLU to Sigmoid in both cases. We took 2000 training samples and 1000 prediction samples to train and evaluate the network's performance. The variation of the model loss value for both cases during the training has been shown in Fig. (12); it can be seen that the loss approaches a constant value of 0.001 after 140 epochs

Figure 7: The correlation between the foreground and \(\mathbf{T}_{21}\) parameters. It can be seen that, \(b_{0}\) representing the overall foreground scale factor is highly correlated to \(A_{r}\), while is significantly responsible for the \(\mathbf{T}_{21}\) amplitude.
in both cases. It was found that the RMSE and R2 score varied in the range (a) in the presence of VDKZ18 (Fig. (13)) to be \((0.007-0.08)\) and \((0.69-0.99)\) respectively, and (b) in the absence of VDKZ18 (Fig. (14)) to be \((0.06-0.006)\) and \((0.99-0.93)\) respectively.

### 21-cm Signal, Foreground, and Noise

Extraction of the faint cosmological signals buried inside a sea full of bright foreground signals is one of the challenging tasks. It can be seen in Fig. (6) that the foreground is \(\approx 10^{3}-10^{4}\) brighter than the \(T_{21}\) signal. In this section, we added foreground (Fig. (6)) to the global 21-cm signal (Fig. (4)) for the neural network training. As our cosmological parameters were already in the same scale, we prepossessed the training data with 'StandardScaler' and the foreground parameters with 'MinMaxScaler' from sklearn prior training. Using PyTorch, we build a neural network denser than before by adding more layers and neurons. We used 'Adam'(Kingma & Ba (2014)) and 'MSE' as the optimizer and error function. After tuning the hyperparameters by keeping the hidden layer density to 512, 256, 128, 64, and 32, the network was trained and saved for prediction. We added noise to the prediction dataset for parameter estimation to check whether the network has been trained for generalized data instead of memorizing the input data. Our training dataset consisted of 2000 samples and a 1000-sampled predicted data set with added noise, completed unknown to the trained network.

\begin{table}
\begin{tabular}{|c|c|c|} \hline Foreground & \(T_{21c}(\nu)+T_{\mathrm{GC}}(\nu)\) + \(\sigma_{\mathrm{r}}(\nu)\) \\ \cline{2-3} Parameters & RMSE & R2 Score \\ \hline \(b_{0}\) & 0.1948 & 0.9638 \\ \(b_{1}\) & 0.6310 & 0.5839 \\ \(b_{2}\) & 0.2213 & 0.9467 \\ \(b_{3}\) & 0.1534 & 0.9763 \\ \(b_{4}\) & 0.1342 & 0.9805 \\ \hline \end{tabular}
\end{table}
Table 1: Foreground parameter estimation in the presence of VDKZ18. The reason for \(b_{1}\) being poorly predicted is it’s strong correlation with \(b_{0}\)

Figure 8: The correlation between the parameters of the 21-cm global signal (a) in the absence and (b) in the presence of the VDKZ18 used for generating the training dataset. It can be seen that the correlation between the parameter is different in both cases. While in the case of Fig. (8a) the three parameters are correlated, but in Fig. (8b), only two are correlated.

Figure 9: Variation of the loss function during the training process, where (a) in the presence of the VDKZ18 and (b) in the absence of the VDKZ18
Figure 11: Each plot above shows the prediction of the aforementioned parameters with RMSE and R2 score assigned in the absence of the VDKZ18.

Figure 10: Each plot above shows the prediction of the aforementioned parameters with RMSE and R2 score assigned in the presence of the VDKZ18.
\[\mathrm{T}_{\mathrm{pred}}^{3}=\mathrm{T}_{\mathrm{tot}}^{3}+\sigma_{t}(\nu) \tag{17}\]

As only one NN is being used for prediction, therefore instead of extracting all 11 parameters (6 cosmological and 5 foregrounds) we chose to extract only foreground parameters from \(\mathrm{T}_{\mathrm{pred}}^{3}\) such that, once foreground signal is extracted the residual signal can be fed to the NN constructed in section (7.2) for estimation of the cosmological signal parameters. It can be seen from Fig. (7), that the foreground (\(b_{0}\)) and cosmological (\(A_{r}\)) parameters are highly correlated. To check the performance and accuracy after the training, we estimated all the foreground parameters (Fig. 15) and assigned RMSE and R2 scores to each parameter shown in Table (1).

## 8 Summary and Discussion

In our research, we generated synthetic data by resolving the typical cosmological equations, as presented in sections (4-6). The data was utilized for training neural networks. We added noise into the training data to verify the networks' reliability to prediction datasets. The accuracy of one of our estimations is evaluated by examining the RMSE and R2 scores for each case as listed in Table (1). As far as

Figure 12: Variation of the loss function during the training process, where (a) in the presence of the VDKZ18 and (b) in the absence of the VDKZ18

Figure 13: Each plot above shows the prediction of the aforementioned parameters with RMSE and R2 score assigned in the presence of the VDKZ18 after the inclusion of noise in the prediction data.
Figure 14: Each plot above shows the prediction of the aforementioned parameters with RMSE and R2 score assigned in the absence of the VDKZ18 after the inclusion of noise in the prediction data.

Figure 15: Model loss and the prediction of the aforementioned parameters with RMSE and R2 score assigned in the presence of the foreground and VDKZ18 after the inclusion of noise in the prediction data.
our understanding goes, most authors have employed Markov Chain Monte Carlo (MCMC), nested sampling, or similar methods for parameter space sampling. As ANN (Artificial Neural Network) and MCMC have different methodologies, we cannot directly compare their speed. However, ANN offers the advantage of bypassing the requirement of computing the likelihood function multiple times to derive inferred parameter values. Thus, when dealing with a higher dimensional parameter space, ANN is computationally more efficient and faster. In the context of neural networks, we can consider training sets a more realistic substitute for the prior in MCMC.

As a single neural network has been used for parameter estimation, it becomes difficult to train it optimally to estimate each parameter accurately. While in training, it was observed that if the hyperparameters and the architecture of the NN were unset optimally, then either the estimation accuracy deteriorated or it was too high, depicting underfitting and overfitting conditions. Due to a huge difference in the order of the foreground compared to \(T_{21}\) signal, the efficiency of the network was reduced significantly. The considered parameters for the construction of \(T_{21}\) don't links directly to the astrophysical properties of the first star during the CD; rather, they are properties of IGM. (Choudhury et al. (2021)) have shown that during the reconstruction of the \(T_{21}\) signal from EDGES data, "\(f_{R}\)" contributed significantly to the trough's amplitude which represents the presence of excess-background radiation.

This work shows that VDKZ18 can change the parameter estimation if one includes the excess background radiation scenario. It can be seen in Fig. (8, 13, 14) that the correlation of \(A_{r}\) is different in both scenarios and the same has been reflected in parameter prediction. The accuracy deteriorated with the inclusion of VDKZ18, implying the heating of gas and a decrease in \(T_{21}\) trough's amplitude which has been proposed in Venumadhav et al. (2018).

In future work, we intend to apply this concept and algorithm to more realistic data, like EDGES, SARAS 3, SKA. Experiments, like DARE, DAPPER (Burns et al. (2019)), FARSIDE (Burns et al. (2019)) etc., being space-based experiments could provide less contaminated data compared to Earth-based experiments. The contamination due to RFI and ionosphere can be neglected for these experiments, making this work ideal for testing. In future works, we wish to include energy injection terms linking directly to the first star's astrophysical properties, instrument response and contamination model to make the NN more robust.

## Acknowledgement

P. K. N. would like to acknowledge the National Centre for Radio Astrophysics-Tata Institute of Fundamental Research for providing accommodation support during the initial phase of this work. A. C. N. acknowledges financial support from SERB-DST (SRG/2021/002291), India.

## Code and Data Availability

We have used the publicly available EDGES data release([http://loco.lab.asu.edu/edges/edges-data-release/](http://loco.lab.asu.edu/edges/edges-data-release/)). The analyses are accomplished in Python, broadly using publicly available modules in NumPy (Harris et al. (2020)), Matplotlib (Hunter (2007)), Astropy (Price-Whelan et al. (2018)), Odeint Solver (Ahnert & Mulansky (2011)) from Scipy (Virtanen et al. (2020)), Natpy (Howson & Scaffidi (2021)), Pandas for data visualization (McKinney et al. (2010)), Heatmap of Seaborn (Waskom (2021)).
