## 1 Introduction  
Skin diseases represent a pervasive health concern across all age cohorts. Among the primary types of skin cancer, namely melanoma and non-melanoma, melanoma exhibits a higher mortality rate and is considered the most malignant form [1]. Timely detection of melanoma substantially elevates the 5-year survival rate to 95%, in stark contrast to a dismal 20% without intervention [2]. As incidence and mortality rates ascend, the imperative of early detection becomes increasingly conspicuous. Presently, machine learning and deep learning methodologies enable automated diagnosis of skin lesions via high-resolution dermoscopic images. To facilitate global research endeavors in skin cancer detection and analysis, the International Skin Imaging Collaboration (ISIC) orchestrates the annual ISIC Grand Challenge [3]. With continual advancements in medical technology, there is burgeoning recognition of artificial intelligence and machine learning's potential in skin lesion identification and diagnosis [4]. Particularly in the realm of skin cancer detection, the intricate and diverse nature of skin ailments poses challenges to traditional diagnostic modalities grounded in subjective clinical assessment, heightening the propensity for misdiagnosis. Hence,the development of automated and precise dermatological lesion identification systems assumes paramount importance [5]. Computer-aided diagnosis (CAD) systems have made substantial strides in identifying and assessing various malignancies [6], spanning lung cancer [7], breast cancer [8], thyroid cancer [9], brain cancer [10], and liver cancer [11], among others. In the domain of skin cancer detection, CAD system implementation becomes indispensable, enhancing efficiency, curtailing time and costs, and compensating for the scarcity of dermatologists. Recent years have witnessed rapid advancements in dermatological lesion recognition, attributed to significant strides in CAD systems, owing to the rapid evolution of machine learning techniques [12]. Traditional machine learning approaches, such as support vector machines (SVM) and random forest models, offer interpretability and small sample learning advantages [13]. These methods rely on features designed by domain experts and furnish explanatory lesion attributes, which facilitate medical practitioners' comprehension of the model's decision-making process. Conversely, classic deep learning methods, exemplified by ResNet, MobileNet, and VGGNet models [14], excel in discerning deep abstract features and in exploiting transfer learning for skin disease lesion identification. They adeptly capture intricate characteristics such as lesion texture, shape, and structure, leveraging pre-trained models on extensive image datasets to enhance model efficacy. Deep learning methodologies predicated on transformers, exemplified by Vision Transformer (ViT) and Swin Transformer (SwinViT) [15], offer automatic feature learning, context modeling, scalability, and resilience in skin disease lesion recognition. These methodologies effectively encompass contextual information within images, spanning local and global contexts via a self-attention mechanism, affording a deeper understanding of the lesion relationship. Nonetheless, a notable challenge stems from the substantial inter-class resemblance observed in numerous skin lesion images, rendering the identification of unique and discernible custom features arduous. Convolutional neural networks (CNNs) may conflate low-level features in such scenarios, resulting in crucial information loss. Moreover, CNNs exhibit constraints in capturing global contextual information, potentially omitting vital details. To surmount these challenges, this study proposes a deep learning framework employing a local-global hierarchical attention mechanism grounded in transformers for multi-category skin lesion classification diagnosis.