In the global fight against cancer, addressing the prevalence of skin cancer has become increasingly critical. It’s critical to diagnose skin cancer early, which calls for the creation of modern tools and technology. We carry out studies in the area of evaluation of medical images, specifically concentrating on the complicated nature of skin lesions and the automation of their classification. Recognizing the pressing need for early identification, we are actively addressing the challenges that arise from subtle distinctions between different classes of lesions and the inherent variations within these classes. At the forefront of this field, our study introduces a comprehensive approach to multi-class skin lesion classification. We have devised custom pre-trained models specifically designed to handle data imbalances through cost-sensitive learning, with a spotlight on the exceptional performance of Customized DenseNet201. Furthermore, we have expanded our methodology by incorporating ensemble techniques, resulting in a multi-layered approach that has yielded remarkable outcomes. Impressively, our ensemble model has reached an accuracy rate of 97.15%, alongside precision, recall, and F1-score rates of 97.63, 97.63, and 97.61%, respectively, when evaluated on the ISIC 2019 dataset. Our customized models and ensemble strategy have shown significant gains in skin lesion categorization when compared to current approaches. This paper represents a significant contribution to the field, as it unites the power of customized models and ensemble models to offer a robust and highly precise multi-class diagnosis of skin lesions. In an era where early cancer detection is of paramount importance, our research offers an effective approach that promises for improving patient healthcare.