Comparative Evaluation of ViT and CNN-based Architectures for Dermatological Image Classification

Keywords: convolutional neural networks, deep learning, dermatological image, skin lesions, vision transformers

Abstract

The skin, as the largest organ in the human body, is susceptible to lesions that, in some cases, can be caused by factors such as excessive exposure to ultraviolet rays, which can lead to serious consequences such as skin cancer. Monitoring the characteristics and behavior of these lesions and accurately identifying them is essential for the treatment of skin lesions. Currently, this identification process can be supported by image-based and deep learning techniques, with models based on convolutional neural networks (CNN), Transformer-based models, or models that use a combination of both. Among the most popular architectures for image classification are ResNet and EfficientNet, in the case of CNN-based models, and ViT and Swin Transformer, in the case of Transformer-based architectures. However, the superiority of one architecture over another for a specific problem may depend on factors such as the size of the dataset, the available computing power, or the resolution of the image. In this context, the objective of this research was to conduct a comparative study of the performance of CNN-based and ViT-based models for the automated classification of seven skin lesions using the DermaMNIST dataset, which is characterized by class imbalance. The methodology employed consisted of conducting the comparison in a single experimental environment using a unified pipeline with preprocessing, stratified splitting, data augmentation, and training from scratch or through transfer learning. The results were evaluated in terms of accuracy, AUC, F1-score, and balanced accuracy, achieving values of 85.99%, 97.38%, 75.98% and 80.78%, respectively. Finally, it is concluded that, for the problem evaluated, EfficientNetV2-L achieved the highest accuracy, F1-score, and balanced accuracy (although at a higher computational cost for both training and inference), whereas DenseNet201 obtained the highest AUC, since it prioritizes the majority class. Besides, ViT-based models require pre-trained models to be competitive, due to the small number of samples.

Author Biographies

Andrés E. Villamarin-Olmos, Universidad Militar Nueva Granada
Diego Renza, Universidad Militar Nueva Granada

Bogotá-Colombia, diego.renza@unimilitar.edu.co

References

A. Shah et al., “A comprehensive study on skin cancer detection using artificial neural network (ANN) and convolutional neural network (CNN),” Clin. eHealth, vol. 6, pp. 76-84, Dec. 2023. https://doi.org/10.1016/j.ceh.2023.08.002

B. Ozdemir, and I. Pacal, “An innovative deep learning framework for skin cancer detection employing ConvNeXtV2 and focal self-attention mechanisms,” Results Eng., vol. 25, p. 103692, Mar. 2025. https://doi.org/10.1016/j.rineng.2024.103692

S. Shafeena et al., “Automated skin cancer diagnosis using deep learning: a systematic review of state-of-the-art architectures, techniques and performance evaluation,” Inf., Automat. Pomiary, vol. 16, no. 1, pp. 10-20, Mar. 2026. https://doi.org/10.35784/iapgos.7427

D. Dey et al., “CNNs, Transformers, Hybrid, and Vision Language Models for Skin Cancer Detection,” arXiv, 2026. [Online]. Available: https://arxiv.org/pdf/2605.26294

B. Durgabhavani et al., “Classification of Skin Disease using CNN,” in 2023 Int. Conf. Evolutionary Algorithms Soft Comput. Techniques, EASCT 2023, Bengaluru, India, 2023, pp. 1-6. https://doi.org/10.1109/EASCT59475.2023.10393477

S. Abbas et al., “Intelligent skin disease prediction system using transfer learning and explainable artificial intelligence,” Sci. Rep., vol. 15, no. 1, p. 1746, Dec. 2025. https://doi.org/10.1038/s41598-024-83966-4

Y. Hu et al., “Artificial intelligence in the task of segmentation and classification of brain metastases images: current challenges and future opportunities,” Front. Neurol., vol. 16, p. 1581422, Sep. 2025. https://doi.org/10.3389/fneur.2025.1581422

I. Aruk et al., “A novel hybrid ConvNeXt-based approach for enhanced skin lesion classification,” Expert Syst. Appl., vol. 283, p. 127721, Jul. 2025. https://doi.org/10.1016/j.eswa.2025.127721

V. Gabani et al., “Multimodal skin lesion classification for early cancer diagnosis using deep learning,” Front. Physiol., vol. 17, p. 1717517, Feb. 2026. https://doi.org/10.3389/fphys.2026.1717517

S. A. Amiri et al., “Skin Lesion Classification via ensemble method on deep learning,” Multimed. Tools Appl., vol. 84, no. 18, pp. 19379-19397, May. 2025. https://doi.org/10.1007/s11042-024-19837-x

A. Shaik et al., “An attention based hybrid approach using CNN and BiLSTM for improved skin lesion classification,” Sci. Rep., vol. 15, no. 1, p. 15680, May. 2025. https://doi.org/10.1038/s41598-025-00025-2

M. Shafiq et al., “A novel Skin lesion prediction and classification technique: ViT-GradCAM,” Skin Res. Technol., vol. 30, no. 9, p. e70040, Sep. 2024. https://doi.org/10.1111/srt.70040

L. Gamage et al., “Melanoma Skin Cancer Identification with Explainability Utilizing Mask Guided Technique,” Electronics, vol. 13, no. 4, p. 680, Feb. 2024. https://doi.org/10.3390/electronics13040680

Q. Abbas et al., “Assist-Dermo: A Lightweight Separable Vision Transformer Model for Multiclass Skin Lesion Classification,” Diagnostics, vol. 13, no. 15, p. 2531, Aug. 2023. https://doi.org/10.3390/diagnostics13152531

M. A. Farooq et al., “Derm-T2IM: Harnessing Synthetic Skin Lesion Data via Stable Diffusion Models for Enhanced Skin Disease Classification using ViT and CNN,” in 2024 46th Annual Int. Conf. IEEE Eng. Med. Biol. Soc. (EMBC), Orlando, FL, USA, 2024, pp. 1-5. https://doi.org/10.1109/EMBC53108.2024.10781852

X. Zhang et al., “DermViT: Diagnosis-Guided Vision Transformer for Robust and Efficient Skin Lesion Classification,” Bioengineering, vol. 12, no. 4, p. 421, Apr. 2025. https://doi.org/10.3390/bioengineering12040421

Z. Yu et al., “Hierarchical skin lesion image classification with prototypical decision tree,” NPJ Digit. Med., vol. 8, no. 1, p. 26, Dec. 2025. https://doi.org/10.1038/s41746-024-01395-z

Y. Fu, and C. Guo, “SkinFormer: a hybrid vision transformer and ConvNeXtV2 approach for skin cancer detection and segmentation,” Sci. Rep., vol. 16, p. 19283, Jun. 2026. https://doi.org/10.1038/s41598-026-48633-w

W. Fendzi Mbasso et al., “Scalable HMO-CNN-SVM Framework for Skin Lesion Classification: A Metaheuristic-Driven Approach with Parallelizable Optimization for Cluster Deployment,” Biomed. Eng. Comput. Biol., vol. 17, Jun. 2026. https://doi.org/10.1177/11795972261453621

H. Ghazouani, “Multi-residual attention network for skin lesion classification,” Biomed. Signal Process. Control, vol. 103, p. 107449, May. 2025. https://doi.org/10.1016/j.bspc.2024.107449

F. He et al., “Skin lesion classification network based on improved MobileViT,” Eng. Appl. Artif. Intell., vol. 159, no. Part C, p. 111726, 2025. https://doi.org/10.1016/j.engappai.2025.111726

N. Yousaf et al., “Advanced hybrid transformer CNN framework for improved skin lesion classification and segmentation,” Sci. Rep., vol. 16, p. 13592, Mar. 2026. https://doi.org/10.1038/s41598-026-43376-0

X. Wang et al., “Non-Local Neural Networks,” in Proc. IEEE Conf. Comput. Vision Pattern Recogn. (CVPR), Salt Lake City, UT, USA, 2018, pp. 7794-7803. https://doi.org/10.1109/CVPR.2018.00813

S. Aladhadh et al., “An Effective Skin Cancer Classification Mechanism via Medical Vision Transformer,” Sensors, vol. 22, no. 11, p. 4008, May. 2022. https://doi.org/10.3390/s22114008

A. Dosovitskiy et al., “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” arXiv, Jun. 2021. [Online]. Available: http://arxiv.org/abs/2010.11929

M. A. Arshed et al., “Multi-Class Skin Cancer Classification Using Vision Transformer Networks and Convolutional Neural Network-Based Pre-Trained Models,” Inform., vol. 14, no. 7, p. 415, Jul. 2023. https://doi.org/10.3390/info14070415

A. Vaswani et al., “Attention Is All You Need,” arXiv, Aug. 2023. [Online]. Available: http://arxiv.org/abs/1706.03762

G. H. Dagnaw et al., “Skin cancer classification using vision transformers and explainable artificial intelligence,” J. Med. Artif. Intell., vol. 7, Jun. 2024. https://doi.org/10.21037/jmai-24-6

J. Yang et al., “MedMNIST v2 - A large-scale lightweight benchmark for 2D and 3D biomedical image classification,” Sci. Data, vol. 10, no. 1, p. 41, Jan. 2023. https://doi.org/10.1038/s41597-022-01721-8

P. Tschandl et al., “Data descriptor: The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions,” Sci. Data, vol. 5, p. 180161, Aug. 2018. https://doi.org/10.1038/sdata.2018.161

K. He et al., “Deep Residual Learning for Image Recognition,” in Proc. IEEE Conf. Comput. Vision Pattern Recogn. (CVPR), Las Vegas, NV, USA, 2016, pp. 770-778. https://doi.org/10.1109/CVPR.2016.90

G. Huang et al., “Densely Connected Convolutional Networks,” GitHub, 2023. [Online]. Available: https://github.com/liuzhuang13/DenseNet

M. Tan, and Q. Le, “EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks,” in Int. Conf. Mach. Learn. (ICML), PMLR, Long Beach, CAL, USA, 2019, pp. 6105-6114. https://doi.org/10.48550/arXiv.1905.11946

A. E. Villamarín Olmos, “Comparative-eval-of-ViT-and-CNN-for-derma-image-classification,” GitHub, 2026. [Online]. Available: https://github.com/realV1LL4/Comparative-eval-of-ViT-and-CNN-for-derma-image-classification

How to Cite
[1]
A. E. Villamarin-Olmos and D. Renza, “Comparative Evaluation of ViT and CNN-based Architectures for Dermatological Image Classification”, TecnoL., vol. 30, no. 68, p. e3704, Dec. 2026.

Downloads

Download data is not yet available.
Published
2026-12-02
Section
Research Papers

Funding data

Crossref Cited-by logo
Article metrics
Abstract views 14
Galley views 11
PDF Views 11
HTML views 0
Other views 0