Multiclass Skin Lesion Classification Algorithm using Attention-Based Vision Transformer with Metadata Fusion
Abstract
Early and accurate classification of skin lesions is essential for timely diagnosis and treatment of skin cancer. This study presents a novel multiclass classification framework that integrates dermoscopic images with clinical metadata using an attention-based Vision Transformer (ViT) architecture. The proposed model incorporates a mutual-attention fusion mechanism to jointly learn from visual and tabular inputs, augmented by a class-aware metadata encoder and imbalance-sensitive loss function. Training was conducted using the HAM10000 dataset over 30 epochs with a batch size of 32, utilizing the Adam optimizer and a learning rate of 0.0001. The model demonstrated superior performance compared to a ViT Baseline, achieving 93.4% accuracy, 92.2% F1-score, 0.95 AUC, and significant reductions in MAE and RMSE. Additionally, Grad-CAM visualizations confirmed the model’s ability to focus on diagnostically relevant regions, enhancing interpretability. These findings suggest that the integration of structured clinical information with transformer-based visual analysis can significantly improve classification robustness, particularly in underrepresented lesion types. However, the model’s current performance is evaluated only on the HAM10000 dataset, and its generalizability to other clinical or non-dermoscopic image sources remains to be validated. Future studies should therefore explore multi-institutional datasets and real-world deployment scenarios to assess robustness and scalability. The proposed framework offers a practical, interpretable solution for AI-assisted skin lesion diagnosis and demonstrates strong potential for clinical deployment.
Keywords
Full Text:
PDFReferences
G. Cai et al., ‘A multimodal transformer to fuse images and metadata for skin disease classification’, The Visual Computer, vol. 39, no. 7, pp. 2781–2793, Jul. 2023[Online]. Availablehttps://link.springer.com/10.1007/s00371-022-02492-4.
A. Ray et al., ‘Decoding skin cancer classification: perspectives, insights, and advances through researchers’ lens.’, Scientific reports, vol. 14, no. 1, p. 30542, Dec. 2024 [Online]. Available: 10.1038/s41598-024-81961-3.
D. Sengupta, ‘Artificial Intelligence in Diagnostic Dermatology: Challenges and the Way Forward.’, Indian dermatology online journal, vol. 14, no. 6, pp. 782–787, 2023 [Online]. Available: 10.4103/idoj.idoj_462_23.
D. Reifs Jiménez et al., ‘Artificial Intelligence Methods for Diagnostic and Decision-Making Assistance in Chronic Wounds: A Systematic Review’, Journal of Medical Systems, vol. 49, no. 1, p. 29, 2025[Online]. Availablehttps://doi.org/10.1007/s10916-025-02153-8.
M. A. A. Mahmud et al., ‘Explainable deep learning approaches for high precision early melanoma detection using dermoscopic images’, Scientific Reports, vol. 15, no. 1, p. 24533, 2025[Online]. Availablehttps://doi.org/10.1038/s41598-025-09938-4.
K. Lamba et al., ‘Synergizing advanced algorithm of explainable artificial intelligence with hybrid model for enhanced brain tumor detection in healthcare’, Scientific Reports, vol. 15, no. 1, p. 20489, 2025[Online]. Availablehttps://doi.org/10.1038/s41598-025-07524-2.
M. Haidarh et al., ‘Exploring traditional, deep learning and hybrid methods for hyperspectral image classification: A review’, Journal of Information and Intelligence, 2025[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S2949715925000149.
K. Kirti et al., ‘Fusion of non-iterative deep neural network feature extraction with kernel extreme learning machine for plant disease classification’, Discover Computing, vol. 28, no. 1, p. 154, 2025[Online]. Availablehttps://doi.org/10.1007/s10791-025-09679-y.
Y. Zhang et al., ‘TFormer: A throughout fusion transformer for multi-modal skin lesion diagnosis.’, Computers in biology and medicine, vol. 157, p. 106712, May 2023 [Online]. Available: 10.1016/j.compbiomed.2023.106712.
K. He et al., ‘Transformers in medical image analysis’, Intelligent Medicine, vol. 3, no. 1, pp. 59–78, 2023[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S2667102622000717.
K. Fujiwara, ‘Knowledge distillation with resampling for imbalanced data classification: Enhancing predictive performance and explainability stability’, Results in Engineering, vol. 24, p. 103406, 2024[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S259012302401658X.
J. Jiang et al., ‘A review of machine learning methods for imbalanced data challenges in chemistry’, Chemical Science, vol. 16, no. 18, pp. 7637–7658, 2025[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S2041652025004584.
W. Chen et al., ‘A survey on imbalanced learning: latest research, applications and future directions’, Artificial Intelligence Review, vol. 57, no. 6, p. 137, 2024[Online]. Availablehttps://doi.org/10.1007/s10462-024-10759-6.
J. Wu et al., ‘A multimodal attention fusion network with a dynamic vocabulary for TextVQA’, Pattern Recognition, vol. 122, p. 108214, 2022[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S0031320321003952.
J. Liu et al., ‘Attention-based multimodal fusion with contrast for robust clinical prediction in the face of missing modalities’, Journal of Biomedical Informatics, vol. 145, p. 104466, 2023[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S1532046423001879.
Y. Bi et al., ‘A multimodal vision transformer for interpretable fusion of functional and structural neuroimaging data.’, Human brain mapping, vol. 45, no. 17, p. e26783, Dec. 2024 [Online]. Available: 10.1002/hbm.26783.
M. Ozdemir and I. Pacal, ‘Enhancing skin lesion classification: A self-attention fusion approach for deep learning in medical imaging’, Scientific Reports, vol. 15, no. 1, p. 2312, 2025 [Online]. Available: 10.1038/s41598-025-89230-7.
X. Wang et al., ‘A Multimodal Data Fusion and Embedding Attention Mechanism-Based Method for Eggplant Disease Detection’, Plants, vol. 14, no. 5, 2025[Online]. Availablehttps://www.mdpi.com/2223-7747/14/5/786.
L. Li et al., ‘Application of an end-to-end model with self-attention mechanism in cardiac disease prediction.’, Frontiers in physiology, vol. 14, p. 1308774, 2023 [Online]. Available: 10.3389/fphys.2023.1308774.
A. Mumuni and F. Mumuni, ‘Data augmentation: A comprehensive survey of modern approaches’, Array, vol. 16, p. 100258, 2022[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S2590005622000911.
Y. Zhang et al., ‘TFormer: A hierarchical transformer model for multimodal skin lesion diagnosis’, Computers in Biology and Medicine, vol. 161, p. 106017, 2023 [Online]. Available: 10.1016/j.compbiomed.2023.106017.
C.-H. Ou et al., ‘A deep learning based multimodal fusion model for skin lesion diagnosis using smartphone collected clinical images and metadata’, Frontiers in Surgery, vol. 9, p. 1029991, 2022 [Online]. Available: 10.3389/fsurg.2022.1029991.
N.-Y. Tran-Van et al., ‘Multimodal skin lesion classification through cross-modal data fusion integrates images with patient metadata’, Biomedical Signal Processing and Control, vol. 87, p. 105849, 2025 [Online]. Available: 10.1016/j.bspc.2025.105849.
R. Panneerselvam et al., ‘Multimodal Skin Cancer Prediction: Integrating Clinical Metadata with Dermoscopic Visuals’, The Open Bioinformatics Journal, vol. 18, p. e18750362358444, 2025 [Online]. Available: 10.2174/18750362358444.
Y. Yu et al., ‘Deep multi-modal skin-imaging-based information fusion for diagnostic precision’, Diagnostics, vol. 15, no. 2, p. 345, 2025 [Online]. Available: 10.3390/diagnostics15020345.
A. Cheslerean-Boghiu et al., ‘Attention-based fusion of dermoscopic and clinical images with metadata for skin lesion diagnosis’, Sensors, vol. 23, no. 4, p. 1891, 2023 [Online]. Available: 10.3390/s23041891.
M. O. Oyedeji et al., ‘Interpretable Deep Learning for Classifying Skin Lesions’, International Journal of Imaging Systems and Technology, vol. 35, no. 1, pp. 45–58, 2025 [Online]. Available: 10.1002/ima.22847.
P. Tschandl et al., ‘The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions’, Scientific Data, vol. 5, p. 180161, 2018 [Online]. Available: 10.1038/sdata.2018.161.
G. M. S. Himel et al., ‘Skin cancer segmentation and classification using Vision Transformer for automatic analysis in dermatoscopy‑based non-invasive digital system’, Journal of Biomedical Imaging, vol. ?, p. 3022192, 2024 [Online]. Available: 10.1155/2024/3022192.
S. Li et al., ‘Multilayer Grad-CAM: An effective tool towards explainable deep neural networks for intelligent fault diagnosis’, Journal of Manufacturing Systems, vol. 69, pp. 20–30, 2023[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S0278612523001024.
A. S. Antonini et al., ‘Machine Learning model interpretability using SHAP values: Application to Igneous Rock Classification task’, Applied Computing and Geosciences, vol. 23, p. 100178, 2024[Online]. Availablehttps://www.sciencedirect.com/science/article/pii/S2590197424000259.
DOI: https://doi.org/10.47738/jads.v7i1.1017
Refbacks
- There are currently no refbacks.

Journal of Applied Data Sciences
| ISSN | : | 2723-6471 (Online) |
| Publisher | : | Bright Publisher |
| Website | : | http://bright-journal.org/JADS |
| : | taqwa@amikompurwokerto.ac.id (principal contact) | |
| support@bright-journal.org (technical issues) |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0




.png)