Skin Cancer Classification Based on Convolutional Neural Networks and Vision Transformers

Skin cancer is one of the most prevalent illnesses in the globe, and early diagnosis is the most effective method for preventing the disease and reducing mortality. Nowadays, the most prevalent way of detecting skin cancer is a visual diagnosis by specialists using dermoscopy images. Nevertheless, the similarity of the appearance between skin cancer lesions and the complexity of dermoscopic images pose a great challenge for the detection and classification of skin cancer. To solve these problems, this paper compares the current start-of-the-art deep learning methods, Convolutional Neural Networks (CNN), and transformers, to verify which method is more suitable for automatic skin cancer lesion classification. First, we assign different weights to individual lesions to address the problem of imbalance of the dataset. Secondly, we crop the images in the dataset and utilize the method of data augmentation to enhance the sample size. Thirdly, we select and construct the corresponding methods of CNN and transformers. The methods selected for CNN are VGGNet and ResNet. The methods selected for transformers are Vision Transformers (ViT) and DeepViT. Finally, we analyze these methods in terms of the loss, accuracy, and confusion matrix on the related HAM10000 dataset. The experimental results demonstrate that both CNN methods and transformers methods can achieve good performance on the skin cancer lesion classification task, but the CNN methods perform better than the transformers methods.