Research Article

Skin Cancer Segmentation and Classification Using Vision Transformer for Automatic Analysis in Dermatoscopy-Based Noninvasive Digital System

Algorithm 1

Step by step skin cancer segmentation and classification using ViT.
1. Input: IDERMATOSCOPY, SegNetSAM
IDERMATOSCOPY= the 20X Dermatoscopy images
SegNetSAM= the SAM segmentation
2. Initialization:
 i. I = Resize IDERMATOSCOPYinto 224 × 224-pixel
 ii. ISEG = Apply SegNetSAM on I
 iii. ISEG = Apply Binary Mask on ISEG
3. ViT:
 i. Input: ISEG
 ii. IPATCH = Convert ISEG into 14×14 patches
 iii. While m: = IPATCH ≤ IPATCH Count
  i. ILP[m] = IPATCHUNROLLED[m] × E [][]
  ii. D = Concatenate(EPOS[m], ILP[m])
 iv. End While
 v. While n <= L do
  i. D'n = MSA (LN(Dn-1)) + Dn-1
  ii. Dn = MLP (LN (D'n)) + D'n
 vi. End While
 vii. IFINAL = LN(DL)
4. If IFINALThreshold Value Then
   Result: = “Benign
Else
   Result: = “Malignant
End If
5. Return Result