  Primordial B-mode detection is one of the main goals of current and future
cosmic microwave background (CMB) experiments. However, the weak B-mode signal
is overshadowed by several Galactic polarized emissions, such as thermal dust
emission and synchrotron radiation. Subtracting foreground components from CMB
observations is one of the key challenges in searching for the primordial
B-mode signal. Here, we construct a deep convolutional neural network (CNN)
model, called \texttt{CMBFSCNN} (Cosmic Microwave Background Foreground
Subtraction with CNN), which can cleanly remove various foreground components
from simulated CMB observational maps at the sensitivity of the CMB-S4
experiment. Noisy CMB Q (or U) maps are recovered with a mean absolute
difference of $0.018 \pm 0.023\ \mu$K (or $0.021 \pm 0.028\ \mu$K). To remove
the residual instrumental noise from the foreground-cleaned map, inspired by
the needlet internal linear combination method, we divide the whole data set
into two ``half-split maps,'' which share the same sky signal, but have
uncorrelated noise, and perform a cross-correlation technique to reduce the
instrumental noise effects at the power spectrum level. We find that the CMB EE
and BB power spectra can be precisely recovered with significantly reduced
noise effects. Finally, we apply this pipeline to current Planck observations.
As expected, various foregrounds are cleanly removed from the Planck
observational maps, with the recovered EE and BB power spectra being in good
agreement with the official Planck results.
