# A Trustworthy Framework for Skin Cancer Detection Using a CNN with a Modified Attention Mechanism
## 1 Introduction  
Artificial intelligence (AI) has emerged as a transformative tool in healthcare, offering significant potential for improving outcomes in managing cancer including skin cancer by addressing unregulated cell growth [1]. Skin cancer, the most common cancer worldwide, accounts for over half of all cancer cases, with melanoma being the most dangerous form. In the United States, one in five individuals faces a skin cancer diagnosis by the age of 70, and the risk doubles for those with a history of frequent sunburns. Despite these alarming statistics, early detection significantly improves the survival rates, emphasizing the critical need for effective diagnostic systems [2]. Skin cancer primarily affects the skin, eyes, and nerve centers, leading to tumor formation, with its identification often requiring extensive clinicalexpertise [3; 4]. However, acquiring such expertise is costly and time-consuming, making the development of AI-driven approaches essential for more accessible diagnosis [5; 6]. Traditional diagnostic methods, such as clinical examination and advanced imaging techniques including CT, MRI, and ultrasound, are vital in identifying skin cancer, but require skilled professionals for accurate interpretation [7; 8]. Self-examinations, while useful, often result in overreactions due to a lack of knowledge. Similarly, the accuracy of clinical diagnoses without technological assistance ranges between 65% and 80%, while dermoscopic images can increase precision but still fall short of delivering the optimal results [9; 10; 11]. These limitations highlight the need for AI-driven solutions to support clinicians and enhance diagnostic accuracy, especially for diseases such as melanoma, where early detection directly impacts the treatment outcomes and survival rates. Recent advancements in deep learning and convolutional neural networks (CNNs) have revolutionized the medical field by providing automated, accurate, and cost-effective diagnostic solutions for skin cancer [12; 13]. Deep learning models, unlike traditional machine learning, do not require manual feature engineering, making them particularly suited for analyzing complex dermatoscopic images. However, several challenges remain such as the need for large, diverse datasets and the development of robust model architectures capable of addressing domain-specific requirements [14]. Hybrid approaches that combine deep learning with traditional methodologies have shown promise in improving diagnostic precision, particularly in differentiating between benign and malignant lesions [15; 16]. These innovations underscore the role of AI in addressing critical gaps in skin cancer detection and treatment. In this study, we propose the DCAN-Net framework, which integrates a ConvNeXt-based CNN architecture with a customized attention mechanism to enhance diagnostic accuracy. ConvNeXt, a scalable CNN architecture, excels in capturing long-range spatial representations, making it ideal for analyzing dermatoscopic images [17]. The framework leverages explainable AI techniques like Grad-CAM to provide visual justifications for model predictions, fostering transparency and clinician trust. By employing the HAM10000 dataset--a comprehensive collection of dermatoscopic images--we validated the proposed approach, demonstrating its ability to reduce false positives and negatives. This work contributes to the domain of medical image processing by addressing key challenges in early melanoma detection and advancing methodologies for skin cancer diagnosis. In the proposed DCAN-Net framework, there are several significant steps to enhance skin cancer detection using the HAM10000 dataset. 1. Incorporation of the ConvNeXt-based model: This provides high performance, confirming an effective cancer pattern followed by contextual understanding. 2. Modified attention mechanism: Fitted to the focal point on related image regions, improving diagnostic precision and reducing errors. 3.