Submitted:
15 July 2025
Posted:
16 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- TDS ≤ 4.75: Benign lesion
- TDS between 4.8 and 5.45: Suspicious lesion
- TDS ≥ 5.45: Malignant lesion
1.1. Contributions
- Definition of Three Anatomical Zones: We define three distinct zones in dermoscopy images, the background, the border, and the core of the lesion.
- Transformer-based Superpixel Embedding: We train a transformer autoencoder to generate embeddings for each superpixel, enabling the model to capture contextual relationships between spatially distant regions belonging to the same class.
- Context-Aware Region Adjacency Graph (RAG): We construct a Region Adjacency Graph using superpixels obtained via the SLIC algorithm to model spatial relationships.
- Input Definition Based on the Region Adjacency Graph: Each input vector consists of the embedding of a given superpixel along with the embeddings of its immediate neighbors, effectively capturing local spatial context.
- Semantic Representation of Dermoscopy Images: The system effectively captures the semantic content of dermoscopy images, supporting improved lesion characterization.
1.2. Related Work
2. Methods and Algorithm Design
2.1. Resizing Images
2.2. Superpixel Generation Strategy
2.3. Constructing the Region Adjacency Graph (RAG)

2.4. Creating Features
2.5. Transformer Autoencoders for Generating Embeddings
2.6. Algorithm
| Algorithm 1: Obtain Embeddings from Superpixels and Neighbors |
![]() |
3. Results
3.1. Experiments Phase One
3.2. Experiment Phase Two
4. Discussion
- Defining the border as a region instead of a well defined line.
- Generating embeddings for every superpixel using a transformer autoencoder
- Incorporating those embeddings as features for further training
- Taking into account the neighborhood to create the input vectors
5. Conclusion
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Bradford, P.T.; Goldstein, A.M.; McMaster, M.L.; Tucker, M.A. Acral Lentiginous Melanoma: Incidence and Survival Patterns in the United States, 1986-2005. Archives of Dermatology 2009, 145, 427–434. [Google Scholar] [CrossRef] [PubMed]
- Becker, F.F. Lentigo Maligna and Lentigo Maligna Melanoma: Recognition and Treatment. Archives of Otolaryngology 1978, 104, 352–356. [Google Scholar] [CrossRef] [PubMed]
- SEER. Types of melanoma, 2025.
- SEER. Melanoma of the Skin – Cancer Stat Facts, 2025. Online; accessed 2025-01-19.
- ACS. Melanoma Skin Cancer Statistics American Cancer Society, 2025. [Online; accessed 2025-01-19].
- Siegel, R.L.; D. , M.K.; Fuchs, H.E.; Jemal, A. Cancer statistics, 2022. CA: A Cancer Journal for Clinicians 2022, 72, 7–33, [https://acsjournals.onlinelibrary.wiley.com/doi/pdf/10.3322/caac.21708]. [Google Scholar] [CrossRef]
- Society, A.C. Cancer Facts and Figure 2022, 2025.
- Hassel, J.C.; Enk, A.H. Fitzpatrick’s Dermatology, 9e. In Fitzpatrick’s Dermatology, 9e; Kang, S., Amagai, M., Bruckner, A.L., Enk, A.H., Margolis, D.J., McMichael, A.J., Orringer, J.S., Eds.; McGraw-Hill Education: New York, NY, 2019; chapter 116. [Google Scholar]
- Boiko, P.E.; Koepsell, T.D.; Larson, E.B.; Wagner, E.H. Skin cancer diagnosis in a primary care setting. J. Am. Acad. of Dermato. 1996, 34, 608–611. [Google Scholar] [CrossRef]
- Soyer, H.P.; Smolle, J.; Kerl, H.; Stettner, H. Early diagnosis of malignant melanoma by surface microscopy. The Lancet 1987, 330, 803. [Google Scholar] [CrossRef]
- Binder, M.; Schwarz, M.; Winkler, A.; Steiner, A.; Kaider, A.; Wolff, K.; Pehamberger, H. Epiluminescence Microscopy: A Useful Tool for the Diagnosis of Pigmented Skin Lesions for Formally Trained Dermatologists. Archives of Dermatology 1995, 131, 286–291. [Google Scholar] [CrossRef]
- Kittler, H.; Pehamberger, H.; Wolff, K.; Binder, M. Diagnostic accuracy of dermoscopy. The Lancet Oncol. 2002, 3, 159–165. [Google Scholar] [CrossRef]
- Ahnlide, I.; Bjellerup, M.; Nilsson, F.; Nielsen, K. Validity of ABCD Rule of Dermoscopy in Clinical Practice. Acta Derm Venereol 2016, 96, 367–372. [Google Scholar] [CrossRef]
- Zahn, C.T.; Roskies, R.Z. Fourier descriptors for plane closed curves. IEEE Transactions on Computers 1972, C-21, 269–281. [Google Scholar] [CrossRef]
- Toureau, V.; Bibiloni, P.; Talavera-Martínez, L.; González-Hidalgo, M. Automatic Detection of Symmetry in Dermoscopic Images Based on Shape and Texture. In Proceedings of the Information Processing and Management of Uncertainty in Knowledge-Based Systems (IPMU 2020). Springer, 2020, pp. 591–603. [CrossRef]
- Ali, A.M.; Li, J.; Yang, G.; O’Shea, S. A Novel Fuzzy Multilayer Perceptron (F-MLP) for the Detection of Border Irregularity in Skin Lesions. Frontiers in Medicine 2020, 7, 1–14. [Google Scholar] [CrossRef]
- Ali. ; Abder-Rahman.; Jingpeng, L.; Jane, O.S. Towards the automatic detection of skin lesion shape asymmetry, color variegation and diameter in dermoscopic images. PLOS ONE 2020, 15, 1–21. [Google Scholar] [CrossRef]
- Samuel, N.E.; Anitha, J. Melanoma Detection and Classification based on Dermoscopic Images using Deep Learning Architectures-A Study. In Proceedings of the 2022 4th International Conference on Inventive Research in Computing Applications (ICIRCA); 2022; pp. 993–1000. [Google Scholar] [CrossRef]
- Alsahafi, Y.S.; Elshora, D.S.; Mohamed, E.R.; Hosny, K.M. Multilevel threshold segmentation of skin lesions in color images using Coronavirus Optimization Algorithm. Diagnostics (Basel) 2023, 13. [Google Scholar] [CrossRef] [PubMed]
- Codella, N.C.F.; Gutman, D.; Celebi, M.E.; Helba, B.; Marchetti, M.A.; Dusza, S.W.; Kalloo, A.; Liopyris, K.; Mishra, N.; Kittler, H.; et al. Skin Lesion Analysis Toward Melanoma Detection: A Challenge at the 2017 International Symposium on Biomedical Imaging (ISBI), Hosted by the International Skin Imaging Collaboration (ISIC), 2018. arXiv:cs.CV/1710.05006.
- Patel, R.H.; Foltz, E.A.; Witkowski, A.; Ludzik, J. Analysis of Artificial Intelligence-Based Approaches Applied to Non-Invasive Imaging for Early Detection of Melanoma: A Systematic Review. Cancers 2023, 15, 4694. [Google Scholar] [CrossRef] [PubMed]
- Rosas-Lara, M.; Mendoza-Tello, J.C.; Flores, A.; Zumba-Acosta, G. A Convolutional Neural Network-Based Web Prototype to Support Melanoma Skin Cancer Detection. In Proceedings of the 2022 Third International Conference on Information Systems and Software Technologies (ICI2ST); 2022; pp. 1–7. [Google Scholar] [CrossRef]
- Subramanian, B.; Muthusamy, S.; Thangaraj, K.; Panchal, H.; Kasirajan, E.; Marimuthu, A.; Ravi, A. A new method for detection and classification of melanoma skin cancer using deep learning based transfer learning architecture models. Research Square 2022. [Google Scholar] [CrossRef]
- Sagar, A.; Jacob, D. Convolutional Neural Networks for Classifying Melanoma Images 2020. [CrossRef]
- Gangwani, D.; Liang, Q.; Wang, S.; Zhu, X. An Empirical Study of Deep Learning Frameworks for Melanoma Cancer Detection using Transfer Learning and Data Augmentation. In Proceedings of the 2021 IEEE International Conference on Big Knowledge (ICBK); 2021; pp. 38–45. [Google Scholar] [CrossRef]
- Cirrincione, G.; Cannata, S.; Cicceri, G.; Prinzi, F.; Currieri, T.; Lovino, M.; Militello, C.; Pasero, E.; Vitabile, S. Transformer-Based Approach to Melanoma Detection. Sensors (14248220) 2023, 23, 5677. [Google Scholar] [CrossRef]
- Khan, S.; Khan, A. SkinViT: A transformer based method for Melanoma and Nonmelanoma classification. PLoS ONE 2023, 18, 1–19. [Google Scholar] [CrossRef]
- Xie, J.; Wu, Z.; Zhu, R.; Zhu, H. Melanoma Detection based on Swin Transformer and SimAM. In Proceedings of the 2021 IEEE 5th Information Technology,Networking,Electronic and Automation Control Conference (ITNEC), 2021, Vol. 5, pp. 1517–1521. [CrossRef]
- Tan, M.; Le, Q.V. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, 2020. arXiv:cs.LG/1905.11946.
- Hosny, K.M.; Elshoura, D.; Mohamed, E.R.; Vrochidou, E.; Papakostas, G.A. Deep Learning and Optimization-Based Methods for Skin Lesions Segmentation: A Review. IEEE Access 2023, 11, 85467–85488. [Google Scholar] [CrossRef]
- Zafar, M.; Amin, J.; Sharif, M.; Anjum, M.A.; Mallah, G.A.; Kadry, S. DeepLabv3+-Based Segmentation and Best Features Selection Using Slime Mould Algorithm for Multi-Class Skin Lesion Classification. Mathematics 2023, 11. [Google Scholar] [CrossRef]
- Chen, B.; Liu, Y.; Zhang, Z.; Lu, G.; Kong, A.W.K. TransAttUnet: Multi-Level Attention-Guided U-Net With Transformer for Medical Image Segmentation. IEEE Transactions on Emerging Topics in Computational Intelligence 2024, 8, 55–68. [Google Scholar] [CrossRef]
- Akyel, C.; Arıcı, N. LinkNet-B7: Noise Removal and Lesion Segmentation in Images of Skin Cancer. Mathematics 2022, 10. [Google Scholar] [CrossRef]
- Shreshth, S.; Divij, G.; Anil, K.T. Detector-SegMentor Network for Skin Lesion Localization and Segmentation, 2020. arXiv:eess.IV/2005.06550v1.
- Zhang, L. FITrans: Skin Lesion Segmentation Based on Feature Integration and Transformer. 2023 3rd International Conference on Neural Networks, Information and Communication Engineering (NNICE), Neural Networks, Information and Communication Engineering (NNICE), 2023 3rd International Conference on 2023, 324–329. [CrossRef]
- Dong, Y.; Wang, L.; Li, Y. TC-Net: Dual coding network of Transformer and CNN for skin lesion segmentation. PLOS ONE 2022, 17, 1–18. [Google Scholar] [CrossRef]
- Liu, S.; Zhuang, Z.; Zheng, Y.; Kolmaniè, S. A VAN-Based Multi-Scale Cross-Attention Mechanism for Skin Lesion Segmentation Network. IEEE Access 2023, 11, 81953–81964. [Google Scholar] [CrossRef]
- Wighton, P.; Lee, T.K.; Lui, H.; McLean, D.I.; Atkins, M.S. Generalizing Common Tasks in Automated Skin Lesion Diagnosis. Trans. Info. Tech. Biomed. 2011, 15, 622–629. [Google Scholar] [CrossRef] [PubMed]
- Chen, L.C.; Zhu, Y.; Papandreou, G.; Schroff, F.; Adam, H. Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation, 2018. arXiv:cs.CV/1802.02611.
- Jones, O.T.; Matin, R.N.; van der Schaar, M.; Prathivadi Bhayankaram, K.; Ranmuthu, C.K.I.; Islam, M.S.; Behiyat, D.; Boscott, R.; Calanzani, N.; Emery, J.; et al. Artificial intelligence and machine learning algorithms for early detection of skin cancer in community and primary care settings: a systematic review. The Lancet Digital Health 2022, 4, e466–e476. [Google Scholar] [CrossRef] [PubMed]
- Adegun, A.A.; Viriri, S.; Yousaf, M.H. A Probabilistic-Based Deep Learning Model for Skin Lesion Segmentation. Applied Sciences 2021, 11. [Google Scholar] [CrossRef]
- Ünver, H.M.; Ayan, E. Skin Lesion Segmentation in Dermoscopic Images with Combination of YOLO and GrabCut Algorithm. Diagnostics 2019, 9. [Google Scholar] [CrossRef]
- Mirikharaji, Z.; Abhishek, K.; Izadi, S.; Hamarneh, G. D-LEMA: Deep Learning Ensembles from Multiple Annotations – Application to Skin Lesion Segmentation, 2021. arXiv:eess.IV/2012.07206.
- Li, X.; Peng, B.; Hu, J.; Ma, C.; Yang, D.; Xie, Z. USL-Net: Uncertainty Self-Learning Network for Unsupervised Skin Lesion Segmentation, 2024. arXiv:cs.CV/2309.13289.
- Lu, W.; Gong, D.; Fu, K.; Sun, X.; Diao, W.; Liu, L. Boundarymix: Generating pseudo-training images for improving segmentation with scribble annotations. Pattern Recognition 2021, 117, 107924. [Google Scholar] [CrossRef]
- Avelar, P.H.C.; Tavares, A.R.; da Silveira, T.L.T.; Jung, C.R.; Lamb, L.C. Superpixel Image Classification with Graph Attention Networks. In Proceedings of the 2020 33rd SIBGRAPI Conference on Graphics, Patterns and Images (SIBGRAPI), Los Alamitos, CA, USA; 2020; pp. 203–209. [Google Scholar] [CrossRef]
- Nazir, U.; Wang, H.; Taj, M. Survey of Image Based Graph Neural Networks. CoRR 2021, abs/2106.06307, [2106.06307].
- Nowosad, J.; Stepinski, T.F. Extended SLIC superpixels algorithm for applications to non-imagery geospatial rasters. International Journal of Applied Earth Observation and Geoinformation 2022, 112, 102935. [Google Scholar] [CrossRef]
- Qin, W.; Wu, J.; Han, F.; Yuan, Y.; Zhao, W.; Ibragimov, B.; Gu, J.; Xing, L. Superpixel-based and boundary-sensitive convolutional neural network for automated liver segmentation. Physics in Medicine and Biology 2018, 63, 095017. [Google Scholar] [CrossRef]
- Achanta, R.; Shaji, A.; Smith, K.; Lucchi, A.; Fua, P.; Süsstrunk, S. SLIC Superpixels Compared to State-of-the-Art Superpixel Methods, 2010.
- Gaur, U.; Manjunath, B.S. Superpixel Embedding Network. IEEE Transactions on Image Processing 2020, 29, 3199–3212. [Google Scholar] [CrossRef]
- OpenCV team. OpenCV (Open Source Computer Vision Library). https://opencv.org/, 2023. Version 4.9.0.
- Jaworek-Korjakowska, J.; Kleczek, P. Region Adjacency Graph Approach for Acral Melanocytic Lesion Segmentation. Applied Sciences 2018, 8. [Google Scholar] [CrossRef]
- Tschandl, P.; Rosendahl, C.; Kittler, H. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Scientific Data 2018, 5, 180161, Included in ISIC 2019: https://challenge.isic-archive.com/data/. [Google Scholar] [CrossRef]
- Neo4j, Inc.. Neo4j: Graph Data Platform. https://neo4j.com/, 2023. [Online; accessed 2025-01-19].
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. CoRR 2020, abs/2010.11929, [2010.11929].








| Scoring System | Calculation |
|---|---|
| ABCD Rule | Total Dermoscopy Score (TDS):
|
| 7-Point Checklist | Weighted scoring:
|
| Class | Label | Superpixels | % |
|---|---|---|---|
| 0 | Background | 809,891 | 68.9 |
| 1 | Lesion | 284,116 | 24.1 |
| 2 | Border | 80,229 | 6.8 |
| Class 0 | Class 1 | Class 2 | |||||||||||
| F1 Score | Accuracy | Precision | Recall | F1 Score | Accuracy | Precision | Recall | F1 Score | Accuracy | Precision | Recall | ||
| Linear Neural Network | Single Superpixel (S) | 0.8333 | 0.794 | 0.944 | 0.7458 | 0.8077 | 0.9091 | 0.8246 | 0.7915 | 0.2937 | 0.794 | 0.1919 | 0.6251 |
| Neighbors Superpixels | 0.8446 | 0.8087 | 0.9596 | 0.7542 | 0.8279 | 0.9185 | 0.8495 | 0.8074 | 0.3257 | 0.8011 | 0.2114 | 0.7097 | |
| RNN many(S) to one(S) | GRU | 0.7985 | 0.7589 | 0.9383 | 0.695 | 0.7905 | 0.8941 | 0.763 | 0.8201 | 0.2397 | 0.7738 | 0.1559 | 0.5188 |
| Transformer Encoder Decoder | 0.9377 | 0.9126 | 0.9229 | 0.9529 | 0.8828 | 0.9432 | 0.8823 | 0.8833 | 0.3572 | 0.9271 | 0.4468 | 0.2976 | |
| RNN many(S) to many(S) | Transformer Encoder | 0.9816 | 0.9685 | 0.9753 | 0.988 | 0.9196 | 0.9812 | 0.9199 | 0.9193 | 0.4816 | 0.9718 | 0.6026 | 0.4011 |
| Transformer Encoder with Embeddings | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
