Incomplete sky analysis of cosmic microwave background (CMB) polarization spectra poses a major problem of leakage between E- and B-modes. We present a machine learning approach to remove this E-to-B leakage using a convolutional neural network (CNN) in presence of detector noise. The CNN predicts the full sky E- and B-modes spectra for multipoles (2 le ell le 384) from the partial sky spectra for (N_textrm{side} = 256). We use tensor-to-scalar ratio (r=0.001) to simulate the CMB polarization maps. We train our CNN using (10^5) full sky target spectra and an equal number of noise contaminated partial sky spectra obtained from the simulated maps. The CNN works well for two masks covering the sky area of (sim )80% and (sim )10%, respectively after training separately for each mask. For the assumed theoretical E- and B-modes spectra, predicted full sky E- and B-modes spectra agree well with the corresponding target spectra and their means agree with theoretical spectra. The CNN preserves the cosmic variances at each multipole, effectively removes correlations of the partial sky E- and B-modes spectra, and retains the entire statistical properties of the targets avoiding the problem of so-called E-to-B leakage for the chosen theoretical model.