## 4 Experimental Results and Analysis
### Ablations  
The ablation analysis comprises several facets: (1) Pre-training Model Impact on SkinSwinViT; (2) training the model with different optimizers to determine the optimal value; (3) the impact of augmented and unaugmented data on the proposed method; (4) the effect of global attention mechanism on the proposed method.  
1. Pre-training Model Impact on SkinSwinViT: Table 6 illustrates the performance comparison across three distinct configurations of SkinSwinViT: SkinSwinViT_A, devoid of pre-training; SkinSwinViT_L, integrating ImageNet pre-training and training all layers; and SkinSwinViT, incorporating ImageNet pre-training with only the fully connected layer trained.  
The experimental findings reveal that SkinSwinViT_A achieves a mere 86.21% accuracy on the limited sample dataset, indicating subpar performance. Transformer-based models typically demand extensive data for effective training and exhibit diminished performance in small-scale tasks. To address this, and inspired by [PERSON]'s approaches, this study freezes the feature extraction layer and exclusively trains the fully connected layers [35]. Notably, both methods yield comparable accuracy, with training solely the fully connected layer being more resource-efficient.  
2. Optimizer Selection: The proposed model is trained with various optimizers to evaluate classification performance. Table 7 presents the classification performance of SkinSwinViT trained with various optimizers.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Measures** & **Accuracy** & **Recall** & **Precision** & **Specificity** & **F1 Score** \\ \hline SkinSwinViT\_A & 0.8621 & 0.8618 & 0.8601 & 0.8932 & 0.8609 \\ SkinSwinViT\_L & 0.9763 & 0.9751 & 0.9761 & 0.9908 & 0.9756 \\ SkinSwinViT & 0.9786 & 0.9773 & 0.9781 & 0.9928 & 0.9776 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Performance Evaluation of Pre-trained Models.  
Figure 8: ROC curve of SkinSwinViT and SwinViT in the training set. (a) ROC curve of SkinSwinViT, (b) ROC curve of SwinViT.  
Following 100 epochs of training, the Adam optimizer outperforms SGD. Adaptive optimizers such as Adam are more conducive to Transformer models, as advocated by the Swin Transformer authors. AdamW, integrating Weight Decay, facilitates more rapid decay of parameters with excessive values.  
3. Impact of Data Augmentation: Data augmentation is employed to rectify dataset imbalance. Table 8 showcases the performance of SkinSwinViT with and without augmentation.  
The results demonstrate that the accuracy of SkinSwinViT with augmentation on the dataset increases by 3.17% compared to SkinSwinViT without augmentation. Additionally, this study reveals that horizontal flipping minimally affects the accuracy of image classification, possibly due to the dataset being captured from various angles during sampling.  
4. The impact of global attention on the proposed SkinSwinViT: The study compares the performance of SkinSwinViT with and without the global attention module. Table 9 outlines the differences in performance metrics.  
The integration of the global attention module into the SkinSwinViT model yields superior metrics on the dataset. The experimental results indicate that the global attention mechanism enables better modeling of global context features, enhancing the model's deep representation capabilities and enabling more accurate feature identification and understanding in images.