arXiv:2610.37314cs.CVOct 2026

Manuscript Offprint

arXiv:2610.37314

A Lightweight Attention-Based CNN with Saliency-Map Interpretability for Skin Cancer Detection

Sanjana Islam Kasfia, Md. Ismiel Hossen Abir, AKM Bahalul Haque, Abir Mahmud Shahariar

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Sanjana Islam Kasfia

Dept. of Computer Science and Engineering

International Standard University

Dhaka, Bangladesh

Email: sanjanaislamkasfia2648@gmail.com

AKM Bahalul Haque

Faculty of Science & Engineering

Abo Akademi University

Turku, Finland

Email: akmbahalul.haque@abo.fi

Md. Ismiel Hossen Abir

Dept. of Public Health and Life Sciences

Canadian University of Bangladesh

Dhaka, Bangladesh

Email: ismielabir286@gmail.com

Abir Mahmud Shahariar

Dept. of Computer Science and Engineering

International Standard University

Dhaka, Bangladesh

Email: abirmahmudshahariar@gmail.com

Abstract—Skin cancer is among the most prevalent and life-threatening forms of cancer worldwide. Early and accurate diagnosis significantly improves patient survival rates. However, manual dermoscopic assessment remains challenging due to visual similarity. This study proposes an Explainable AI-driven framework for automated binary classification of skin lesions using a lightweight attention-based convolutional neural network (CNN-Attention). The model integrates channel attention to focus on informative regions of dermoscopic images while maintaining low computational complexity. A publicly available dataset comprising 2,637 training and 660 test images was used, with balanced class weights. The proposed model achieved 87% accuracy with 1.95 million parameters and 7.45 MB storage, matching the best baseline (MobileNet) while using approximately half the parameters and storage. ROC-AUC and PR-AUC scores reached 0.9475 and 0.9430, respectively. Additionally, saliency maps were incorporated as an explainable AI technique to visualize regions influencing model decisions. Comparative analysis with VGG16, VGG19, ResNet101, and MobileNet demonstrates the proposed model's effectiveness in balancing classification results, computational efficiency, and interpretability.

Index Terms—Skin cancer, CNN, attention mechanism, explainable AI, saliency maps.

I. INTRODUCTION

Skin cancer is one of the most widespread cancer types globally [1]. It refers to various malignant tumors that develop from abnormal skin cell growth [2]. The uncontrolled growth of DNA structures within damaged skin cells leads to this condition [3]. The primary types are basal cell carcinoma, squamous cell carcinoma, and melanoma [4]. Melanoma is the most dangerous form [3]. Most cases result from exposure to ultraviolet radiation from sunlight [5]. It spreads quickly and causes high mortality rates [6]. Early identification of malignant skin lesions is critical [6]. Doctors must promptly distinguish harmful lesions from harmless ones [3]. This early recognition is essential for successful treatment. It directly improves patient survival and recovery prospects. Dermoscopic imaging serves as a valuable non-invasive tool [7]. It provides magnified and illuminated views of lesion structures [8]. These structures are often invisible to the bare eyes [1]. However, diagnosis remains challenging. Different lesion types appear visually similar [1]. Lesions vary in shape, color, texture, and borders [6]. This variation makes reliable diagnosis difficult.

Traditional assessment methods face significant limitations. This has increased focus on computer-aided diagnostic systems for automated skin lesion analysis [9]. These systems perform automated skin lesion analysis. Standard diagnostic methods involve visual examination, dermoscopy, biopsy, and clinical assessment procedures [3]. These methods present difficulties. These methods require significant time and expert personnel [10]. Earlier computer-aided systems relied on manual feature engineering [11]. These included color, texture, structure, and morphological characteristics [12]. Traditional machine-learning classifiers evaluated these features [12]. However, significant limitations existed. Results depended on the quality and relevance of feature selection. Dermoscopic images from actual patients posed many challenges [13]. These challenges included inadequate contrast, hair presence, reflections, shadows, and assorted artifacts [13]. As deep learning has advanced, convolutional neural networks (CNNs) have become powerful tools for analyzing skin lesions [12]. These networks automatically learn hierarchical features from image data without manual descriptor engineering [2]. Transfer learning with CNNs has proven beneficial for skin lesion classification [9]. Pretrained architectures can effectively classify skin lesions [4]. This is especially valuable when medical image datasets are small. Even with all this progress, there are still difficulties in achieving reliable and effective automated skin lesion classification. Skin lesion datasets often suffer from class imbalance [3]. Different lesion types share major similarities [7]. Lesions in the same category show significant variation [7]. As a result, Classification becomes inherently difficult. Additionally, image quality and acquisition conditions can introduce artifacts and variations [8]. These interfere with feature extraction and prediction [8]. Traditional deep CNN models use many parameters and demand high computational resources. Balancing accuracy with model size and efficiency becomes difficult. Recent studies have examined attention mechanisms and feature enhancement techniques. These help deep networks prioritize informative regions. They suppress less relevant information. Some researchers have looked into lightweight designs to reduce computational complexity without sacrificing important discriminative properties. These findings advocate the need for models that accurately classify skin lesions while focusing on salient features and reducing computational demands.

To address these issues, this study presents an attention-based CNN framework for the automated classification of skin lesions. We also used transfer learning models for comparative analysis. To improve model transparency, we integrated Explainable Artificial Intelligence (XAI) with saliency maps that display which image regions influenced the model's classification decisions. Additionally, we designed a lightweight CNN-Attention architecture that reduces computational demands while preserving adequate classification performance. We conducted a comparative analysis between our proposed model and the pretrained architecture. The contributions of this study are listed below: i. We developed an attention-based convolutional neural network framework that applies transfer learning for benign and malignant skin lesion categorization.

ii. We incorporated an attention mechanism to direct focus toward meaningful regions in dermoscopic images and created a resource-efficient architecture to lower computational requirements.

iii. We applied explainable AI, specifically saliency maps, which visualize the regions that influenced model predictions. iv. We did a comparative analysis of the proposed model with the pretrained architecture and measured their performance using standard evaluation metrics.

This research is structured across multiple sections, such as the literature review in section 2, methodology in section 3. Section 4 displays the experimental results. Section 5 includes discussion and comparative analysis. Section 6 concludes and then references.

References (24)