Skin cancer is deemed to be the most dangerous type of cancer. It occurs due to the damage caused to the DNA and if left untreated can lead to death. Various methods have been devised over the last few years for skin cancer detection. However, their performance was affected by various challenges in image analysis, like color illumination variations, differences in shape, size, etc. Therefore, to tackle these issues the novel framework, deep learning (DL) technique for accurate skin cancer detection and lesion segmentation is developed. Primarily, the skin image is pre-processed by employing a weighted median filtering to eradicate the noises contained. Then, the segmentation of skin lesions is carried out by employing the efficient neural network (ENet). After that, augmentation is accomplished to avoid overfitting, and later, feature extraction is carried out. At last, skin cancer detection is effectuated with the help of hybrid GoogleNet-LeNet (HGLeNet), which is obtained by merging GoogleNet and LeNet, here layers are modified using the regression concept. Furthermore, the introduced framework is examined for its effectiveness through accuracy, sensitivity and specificity. Moreover, HGLeNet attained the highest accuracy of 0.922, sensitivity of 0.928, as well as specificity of 0.924.