Intelligence-Based Medicine
An efficient Swin Transformer architecture for cutaneous melanoma detection
By Mohammad Reza Esmkhani, Milad Soleymani, Soroush Ziaee and 3 others.
Abstract
Melanoma is the most aggressive and unpredictable type of skin cancer. The purpose of the paper is to create an effective image classification algorithm for detecting melanoma in its early stage. This paper presents a novel development of parameter-efficient Swin Transformer adapters for melanoma classification. In particular, we employ bottleneck adapters, which include down-projection, a non-linearity, and up-projection operations. Our adapters train between 1.02% and 7.54% of the model parameters, a reduction of up to 98.9% relative to full fine-tuning. Against a fully fine-tuned Swin-T baseline trained under an identical protocol, adapters restricted to the MLP sub-layer reached a macro F1 of 0.815 with a standard deviation of 0.027, compared with 0.813 and 0.013 for full fine-tuning, a difference that was not significant (p = 0.776). Low-rank adaptation at rank 4 reached 0.773 and was significantly lower than full fine-tuning (p = 0.010). Measured on an NVIDIA RTX 5070 Ti, the parallel adapters added 17.6% to single-image inference latency for MLP-only injection and 45.9% for dual injection, falling to approximately 9% and 18% at batch size 32. Our framework is meant to be deployed on resource-constrained devices without sacrificing classification performance. The evaluation was performed using stratified 5-fold cross-validation on the HAM10000 dataset. Accuracy, sensitivity, specificity, geometric mean and macro F1 were estimated, along with inference latency, floating-point operations and memory consumption. Dual injection of adapters into both the attention and the MLP sub-layers gave a small accuracy advantage over MLP-only injection, 0.4 percentage points averaged over 18 matched pairs of configurations, but this advantage did not extend to macro F1 or macro sensitivity and it did not persist across random seeds, which indicates that it derives from the majority class rather than from the rare malignant classes. The objective of our study is to determine whether parameter-efficient adaptation could offer a clinically useful framework for medical image classification.



