Context. Component separation is the process with which emission sources in astrophysical maps are generally extracted by taking multi-frequency information into account. It is crucial to develop more reliable methods for component separation for future cosmic microwave background (CMB) experiments such as the Simons Observatory, the CMB-S4, or the LiteBIRD satellite. Aims. We aim to develop a machine learning method based on fully convolutional neural networks called the cosmic microwave background extraction neural network (CENN) in order to extract the CMB signal in total intensity by training the network with realistic simulations. The frequencies we used are the Planck channels 143, 217, and 353 GHz, and we validated the neural network throughout the sky and at three latitude intervals: 0and 30 • < |b| < 90 • . Moreover, we used neither Galactic nor point-source (PS) masks. Methods. To train the neural network, we produced multi-frequency realistic simulations in the form of patches of 256 × 256 pixels that contained the CMB signal, the Galactic thermal dust, cosmic infrared background, and PS emissions, the thermal Sunyaev-Zel'dovich effect from galaxy clusters, and instrumental noise. After validating the network, we compared the power spectra from input and output maps. We analysed the power spectrum from the residuals at each latitude interval and throughout the sky, and we studied how our model handled high contamination at small scales. Results. We obtained a CMB power spectrum with a mean difference between input and output of 13 ± 113 µK 2 for multipoles up to above 4 000. We computed the residuals, obtaining 700 ± 60 µK 2 for 0 • < |b| < 5 • , 80 ± 30 µK 2 for 5 • < |b| < 30 • , and 30 ± 20 µK 2 for 30 • < |b| < 90 • for multipoles up to above 4 000. For the entire sky, we obtained 30 ± 10 µK 2 for l ≤ 1000 and 20 ± 10 µK 2 for l ≤ 4000. We validated the neural network in a single patch with strong contamination at small scales, obtaining a difference between input and output of 50 ± 120 µK 2 and residuals of 40 ± 10 µK 2 up to l ∼ 2 500. In all cases, the uncertainty of each measure was taken as the standard deviation. Conclusions. The results show that fully convolutional neural networks are promising methods for performing component separation in future CMB experiments. Moreover, we show that CENN is reliable against different levels of contamination from Galactic and PS foregrounds at both large and small scales.