Skin cancer poses a significant global health threat, where timely and accurate diagnosis is crucial for improving patient outcomes. Although deep learning methods have demonstrated considerable success in dermatological image analysis, their black-box nature limits clinical adoption due to a lack of transparency and interpretability. To overcome this difficulty, it is suggested that an explainable artificial intelligence (XAI) framework can be applied using an optimal encoder-decoder architecture, which enhances the accuracy of dermatology-specific skin cancer diagnostics and offers better assistance to dermatologists. The specified model is tested on the benchmark dermoscopic image datasets, such as the ISIC archive and the HAM10000. To extract rich and hierarchical features of skin lesion images, the encoder uses pre-trained backbones, which are ResNet-50 and EfficientNet-B4. It uses a tailored decoder, based on U-Net and SegNet design, to recover lesion segmentation maps and give multi-class lesions classification. Nature-based novel bioluminescent oceanic optimization (BOO) algorithm is proposed to be used in feature selection, which determines the most significant features. A squeeze attention network (SAttNet) emphasizes features around the edges of lesions, thus narrowing the scope of the model and enhancing the accuracy of the diagnosis. Explainability is achieved through a multi-level post-hoc strategy: Gradient-weighted Class Activation Mapping (Grad-CAM) highlights critical regions within the encoder’s feature maps; SHapley Additive explanations (SHAP) quantifies the contribution of individual features to the prediction; and local interpretable model-agnostic explanations (LIME) generates localized, human-understandable explanations for diagnostic output. The results show outstanding performance, achieved classification accuracies of 99.956% and 99.644% on the ISIC and HAM10000 datasets, respectively.
Khan et al. (Thu,) studied this question.