In our previous study, we introduced a machine learning technique, namely Cosmic Microwave Background Foreground Subtraction with Convolutional Neural Networks (CMBFSCNN), for the removal of foreground contamination in cosmic microwave background (CMB) polarization data. This method was successfully employed on actual observational data from the Planck mission. In this study, we extend our investigation by considering the CMB lensing effect in simulated data and utilizing the CMBFSCNN approach to recover the CMB lensing B-mode power spectrum from multifrequency observational maps. Our method is first applied to simulated data with the performance of the CMB-S4 experiment. We achieve reliable recovery of the noisy CMB Q (or U) maps with a mean absolute difference of 0.016 ± 0.008 μK (or 0.021 ± 0.002 μK) for the CMB-S4 experiment. To address the residual instrumental noise in the foreground-cleaned map, we employ a “half-split maps” approach, where the entire data set is divided into two segments sharing the same sky signal but having uncorrelated noise. Using cross-correlation techniques between two recovered half-split maps, we effectively reduce instrumental noise effects at the power spectrum level. As a result, we achieve precise recovery of the CMB EE and lensing B-mode power spectra. Furthermore, we also extend our pipeline to full-sky simulated data with the performance of the LiteBIRD experiment. As expected, various foregrounds are cleanly removed from the foregrounds contamination observational maps, and recovered EE and lensing B-mode power spectra exhibit excellent agreement with the true results. Finally, we discuss the dependency of our method on the foreground models.