Skin cancer is a leading cause of cancer-related mortality, posing a significant global health challenge. Early detection and treatment are crucial for survival rates. While dermoscopy is a valuable non-invasive imaging tool for diagnosing skin lesions, its reliance on the expertise of dermatologists introduces variability, affecting diagnostic reliability. Existing deep learning models for skin lesion analysis often prioritize accuracy over computational efficiency, limiting their practical application in clinical settings where both rapidity and precision are crucial. To address these limitations, this study proposes a novel model called the Compact Fortified Weight-Prioritized Convolutional Network (CWCN), optimized using the Harbor Seal Whiskers Optimization (HOA) algorithm (CWCN-HOA-SLD-DI). The CWCN is designed to offer a balance between high performance and computational efficiency. Initially, dermoscopic images from the ISIC Archive dataset are collected and subjected to a series of preprocessing steps, including image augmentation to enhance robustness, normalization using log-sinh with Adaptive Box-Cox transformation, and noise removal employing Guided Box Filtering (GBF) and Guided Image Filtering (GIF). The CWCN-HOA framework is then utilized to classify skin lesions into categories such as Malignant, Melanocytic Nevus, Basal Cell Carcinoma, Actinic Keratosis, Benign Keratosis, Dermatofibroma, and Vascular Lesion. The proposed CWCN-HOA-SLD-DI model is implemented in Python, and its performance is evaluated against current methods. The results indicate that the CWCN-HOA approach achieves significant improvements in both classification accuracy as 99.98% and computational efficiency as 92ms. By offering a combination of high performance and computational efficiency, the CWCN-HOA model represents a promising solution for accurate and efficient skin cancer detection. Its potential to improve the diagnostic capabilities of dermatologists and enhance patient outcomes underscores its significance in addressing this critical global health issue.