Abstract & Overview
Background . When applying computer vision programs in artificial intelligence (AI) models to diagnose skin tumors, melanoma in particular, even minimal classification errors are critical. Vision transformers (ViT), a new model architecture, have shown promising results in computer vision; however, their efficiency in classifying skin lesions has received insufficient research attention. This study is one of the first to directly compare convolutional neural networks (CNNs) and ViT on clinically relevant metrics, which is especially important for the implementation of AI in dermatological and oncological practice. Objective : To compare the performance of CNNs and ViT in the tasks of binary classification of skin lesions: “melanoma/not melanoma” and “benign/malignant”. Material and methods . The study used CNN (MobileNetV2, Xception) and ViT architectures. Testing was carried out on independent datasets (3000 and 4800 images, respectively) with assessment by the metrics of accuracy, sensitivity, specificity. Augmentation, class balancing, hyperparameter optimization, and data cleaning from artifacts were used. Results . ViT showed superiority over CNNs. Thus, in the “melanoma/non-melanoma” task, the accuracy was 92.93% versus 88% for Xception, and in the “benign/malignant” task – 91.35% versus 85%. Transformer model demonstrated better specificity (up to 95%). Conclusion . ViT provides higher accuracy due to the analysis of global patterns, although requiring careful tuning and high-quality data. CNNs remain a stable solution with limited data. For clinical use, a combination of both architectures is recommended to improve the reliability of diagnostics.