  The upcoming Square Kilometre Array Observatory (SKAO) will produce images of
neutral hydrogen distribution during the epoch of reionization by observing the
corresponding 21-cm signal. However, the 21-cm signal will be subject to
instrumental limitations such as noise and galactic foreground contamination
which pose a challenge for accurate detection. In this study, we present the
SegU-Net v2 framework, an enhanced version of our convolutional neural network,
built to identify neutral and ionized regions in the 21-cm signal contaminated
with foreground emission. We trained our neural network on 21-cm image data
processed by a foreground removal method based on Principal Component Analysis
achieving an average classification accuracy of 71 per cent between redshift
$z=7$ to $11$. We tested SegU-Net v2 against various foreground removal
methods, including Gaussian Process Regression, Polynomial Fitting, and
Foreground-Wedge Removal. Results show comparable performance, highlighting
SegU-Net v2's independence on these pre-processing methods. Statistical
analysis shows that a perfect classification score with $AUC=95\%$ is possible
for $8<z<10$. While the network prediction lacks the ability to correctly
identify ionized regions at higher redshift and differentiate well the few
remaining neutral regions at lower redshift due to low contrast between 21-cm
signal, noise and foreground residual in images. Moreover, as the photon
sources driving reionization are expected to be located inside ionised regions,
we show that SegU-Net v2 can be used to correctly identify and measure the
volume of isolated bubbles with $V_{\rm ion}>(10\, {\rm cMpc})^3$ at $z>9$, for
follow-up studies with infrared/optical telescopes to detect these sources.
