  The cosmic microwave background (CMB), carrying the inhomogeneous information
of the very early universe, is of great significance for understanding the
origin and evolution of our universe. However, observational CMB maps contain
serious foreground contaminations from several sources, such as galactic
synchrotron and thermal dust emissions. Here, we build a deep convolutional
neural network (CNN) to recover the tiny CMB signal from various huge
foreground contaminations. Focusing on the CMB temperature fluctuations, we
find that the CNN model can successfully recover the CMB temperature maps with
high accuracy, and that the deviation of the recovered power spectrum $C_\ell$
is smaller than the cosmic variance at $\ell>10$. We then apply this method to
the current Planck observation, and find that the recovered CMB is quite
consistent with that disclosed by the Planck collaboration, which indicates
that the CNN method can provide a promising approach to the component
separation of CMB observations. Furthermore, we test the CNN method with
simulated CMB polarization maps based on the CMB-S4 experiment. The result
shows that both the EE and BB power spectra can be recovered with high
accuracy. Therefore, this method will be helpful for the detection of
primordial gravitational waves in current and future CMB experiments. The CNN
is designed to analyze two-dimensional images, thus this method is not only
able to process full-sky maps, but also partial-sky maps. Therefore, it can
also be used for other similar experiments, such as radio surveys like the
Square Kilometer Array.
