Abstract
Skin cancer is among the most prevalent malignancies worldwide, and early accurate classification of dermoscopic lesions is critical for improving patient outcomes. While convolutional neural networks have long dominated automated dermatology, Transformer-based architectures have emerged as competitive alternatives owing to their capacity to model long-range spatial dependencies. However, systematic comparisons among Transformer families under identical protocols remain scarce. We benchmark four representative architectures Vision Transformer (ViT-B/16), Swin Transformer (Swin-T), a hybrid EfficientNet-B4 with Transformer encoder, and self-supervised DINOv2-Small for seven-class dermoscopic lesion classification on HAM10000 using five-fold stratified cross-validation. The Swin Transformer achieved the highest performance (accuracy 0.8520 ± 0.0151, macro-F1 0.8582 ± 0.0084, AUC-ROC 0.9861 ± 0.0012), outperforming ViT-B/16 by 9.5 percentage points in F1. DINOv2, despite a competitive AUC-ROC (0.9243 ± 0.0039), underperformed in F1 (0.5656 ± 0.0178) under this fixed fine-tuning budget, suggesting that self-supervised features require extended adaptation for imbalanced dermoscopic data. Our results provide actionable guidance for architecture selection under realistic constraints.