Dark matter density extraction using Convolutional Neural Networks

Ever since its discovery back in 1964 Cosmic Microwave Background (CMB) has been of great interest to cosmologists and played a crucial role in understanding and studying the early universe .One of the most interesting topic of current interest is dark matter and its existence is by now well established. By analyzing the CMB data we can estimate the dark matter density of the universe.With vast amount of astronomical data already present and a more vast amount which is to come in future, Machine Learning techniques can provide a variety of benefits in astrophysical and cosomological research. Here I explore the use of deep learning to estimate dark matter density. I have used convolutional neural networks in this paper. I have used simulated CMB temprature maps as a dataset to train the neural networks and correlate the dark matter density from the power spectrum of the corrseponding simlutaed CMB temprature map.


INTRODUCTION
Cosmic microwave background (CMB) is an electromagnetic radiation that lies in the microwave region of the electromagnetic spectrum. When the universe was young it was dense, hot and consisted of opaque hydrogen plasma. When the universe was about 380,000 years old, its temprature dropped below 3000 K to form the first neutral atoms, this epoch is known as epoch of recombination. Shortly afterwards, photons were free to travel in space. These early photons have been propagating ever since and we receive them as the cosmic microwave background. The CMB maps show the temprature fluctuation of these early photons and these fluctuations follow an almost random Gaussian distribution (Bucher, M., 2017). Pixel intensities of these CMB maps also follow random gaussian distribution. Considering CMB maps as random gaussian fields and as there is no spacial coherence between CMB maps, it is an intruguing task to check how accurately a machine learning model will correlate Gaussian maps to cosmological parameters.
My task is to built a convolutional neural network (CNN) model to predict dark matter density of given CMB maps. (Amit Mishra et al 2020) demonstrated the ability of machine learning model to predict baryon density. I have taken dark matter density as a parameter to show CNN model's ability to extract useful information from CMB data.
CMB on a large scale is considered as isotropic, but is anisotrophic on small scale due to temprature fluctuations. CMB is on of the richest source of information and these variations in temprature of Cosmic Mircrowave Background(CMB) contain a lot of information about the universe. We look at scales at which these temprature fluctuations occur to gather information. The amount of fluctuation (in micro Kelvin) is plotted against multiple moment (l). This is called the Angular power spectrum of a CMB temprature map and is shown in figure 1. This power spectrums contain a number of peaks and these peaks provide us with variety of information. We exploit this peaks for our use. The first peak occurs at an angular scale of slightly less than 1˚ (l close to 200) and the primary information that comes from it is about the geometry of the universe, whether it is curved or flat (Hu W and White M 2004). The CMB photons come from all directions in the universe and are distorted by the curvature of the universe. The photons would diverge in a spatially open universe(positively curved) and the fluctuations would appear magnified. The photons would converge in a spatially closed universe(negatively curved) and the fluctuations would appear de-magnefied. If the universe is flat, the photons will travel straight and the fluctuations would appear undistorted.
The second peak appears lower than the first peak and contains information about the amount of baryonic matter in the universe. In the early universe due to fluctuations matter would tend to fall gravitationally together eventually forming dense regions. But as baryonic matter would clump up it would heat up beacause of its interaction with light and the resultant pressure would try to push it against the grouped matter. This implies that if we increase matter and fix other things, the odd peaks(compression peaks) would increase in height relative to the even peaks(rarefaction peaks). Thus the ratio of the second and the first peak gives us the baryon desnity of the universe.
The temprature fluctuations much beyond the first peak could not have been modulated solely by the gravity from the baryons. To keep the gravitational potential wells sufficiently deep we need an abundance of cold dark matter (Hu W and White M 2004). By measuring the height of first peak to next 4 four peaks we can determine the density of dark matter in the universe, whoch we use for each map to train our model. The dark matter density comes roughly 5 times the baryon density of the universe.
Machine learning and deep learning has been in increasingly in use to appraoch and solve cosmological problems. Convolutional neural networks (CNN) have been used to estimate cosmological parameters from simulated CMB maps (Ciuca, R. and Hernández, O.F., 2020). Partial convolutional neural networks (PCNN) have been to inpaint masked images of the cosmic microwave background(Gabriele Montefalcone et al 2021).
CNN and multilayer percepton (MLP) based regression models have been used to extract baryon density from CMB maps (Amit Mishra et al 2020). Continuing with this trend, in this paper I have used convolutional neural networks (CNN) for estimating dark matter density from CMB temprature maps.

Methodology
To generate the CMB temperature angular power spectra data we use Code for Anisotropies in Cosmic Microwave Background (CAMB). Code for Anisotropies in Cosmic Microwave Background or CAMB is a cosmology code for calculating CMB, lensing, galaxy count, dark age 21 cm power spectra, matter power spectra and transfer fucntion (Lewis and Challinor 2014) To generate FITS file contaning the angular power spectrum data, CAMB takes several parameters. The input physical parameters to CAMB include the temperature of CMB (2.7255 Kelvin), Hubble constant, baryon density (0.0226), cold dark matter density(0.112), helium fraction (0.24) and so on(LAMBDA-Tools, NASA 2015). We include the reionization and the curved correlation function is used as lensing method. By using the standard cosmological analysis python package Healpy (Gorski et al (2005) which is used to handle pixelated data on sphere we generetae random Gaussian CMB temprature maps. 1000 such maps are generated. Figure 2. Is one such temprature map. Also, the dark matter density extracted from the power spectrum of the each corresponding map is stored in a separate csv file.
While generating the temprature maps the anisotropy from dipole moment due to the galactic contaminants along the equator of the galactic plane and movement of earth relative to the CMB restframe is removed. The galactic center lies at the center of the mollweide projection in the ful sky temprature maps. We now using opencv snip 64 ×64 pixel size images from the full sky temprature maps. Figure 3 shows such sample cropped images. To treat these snipped images as flat, they are snipped along the equator. We have a total of 9000 cropped images which are used to train our CNN model.  Figure 4 shows a sample map before and after using the standard deviation method.

Analysis
I used a Convolutional Neural Network (CNN) model to estimate the dark matter density of the given CMB maps. CNNs are one of the most popular and widely used neural network architecture for classifying images. Mainly because of its lower computational cost and its ability to learn and detect features without human supervision. CNN works well with data that has spatial coherence and takes advantage of input data's local spatial coherence (Rippel O, Snoek J, and Adams R P 2015). The CMB map data pixel follow an almost Gaussian distribution and it is an intriguing project to see how CNN model works on data as CNN assumes that the training images are correlated and spatially close. Figure 5 shows the architecture of the CNN model.   The loss of convergence of the CNN model is shown in figure 6, and figure 7 shows the scatter plot of predicted values.
Results of the CNN model are tabulated in Table 1.

Conclusion
Using convolutional neural networks (CNN), I was able to estimate the dark matter density from the CMB maps with a satisfiable accuracy. Thus, by applying deep learning methods, I have verified a result related to the Cosmic Microwave Background (CMB). Extracting features from map was complex issue for the neural network model as CMB is Gaussian distribution. Limited computational power and higher resolution of the CMB maps can be attributed for the loss of accuracy. This demonstrates the application of deep learning in cosmological problems. My future plan is to apply CNN and other deep learning models on Plank's data and observe how neural network models work on Plank's data.

Data availability
To promote collaborative research, we have made the code used in this paper available at https://github.com/cosmicash/Dark-Matter-density-extraction-using-CNN