Skin segmentation participates significantly in various biomedical applications, such as skin cancer identification and skin lesion detection. This paper presents a novel framework for segmenting the skin. The framework contains two main stages: The first stage is for removing different types of noises from the dermoscopic images, such as hair, speckle, and impulse noise, and the second stage is for segmentation of the dermoscopic images using an attention residual U-shaped Network (U-Net). The framework uses variational Autoencoders (VAEs) for removing the hair noises, the Generative Adversarial Denoising Network (DGAN-Net), the Denoising U-shaped U-Net (DU-NET), and Batch Renormalization U-Net (Br-U-NET) for removing the speckle noise, and the Laplacian Vector Median Filter (MLVMF) for removing the impulse noise. In the second main stage, the residual attention unet was used for segmentation. The framework achieves (35.11, 31.26, 27.01,