Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 10;15(1):24994.
doi: 10.1038/s41598-025-08954-8.

Enhanced melanoma and non-melanoma skin cancer classification using a hybrid LSTM-CNN model

Affiliations

Enhanced melanoma and non-melanoma skin cancer classification using a hybrid LSTM-CNN model

Sara M M Abohashish et al. Sci Rep. .

Abstract

Melanoma is the most dangerous type of skin cancer. Although it accounts for only about 1% of all skin cancer cases, it is responsible for the majority of skin cancer-related deaths. Early detection and accurate diagnosis are crucial for improving the prognosis and survival rates of patients with melanoma. This paper presents a novel approach for the automatic identification of cutaneous lesions by integrating convolutional neural networks (CNNs) with long short-term memory (LSTM) networks. In the proposed approach, the image of each skin lesion is divided into a sequence of tags of a particular size, which is then treated by the LSTM network to capture temporal dependence and relevant relationships between different spatial regions. This patching sequence allows the modeling system to analyze the local pattern in the image. Time CNN layers are later used to extract spatial functions, such as texture, edges, and color variation, on each patch. A Softmax layer is then used for classification, providing a probability distribution over the possible classes. We use the HAM10000 dataset, which contains 10,015 skin lesion images. Experimental results demonstrate that the proposed method outperforms recent models in several metrics, including accuracy, recall, precision, F1 score, and ROC curve performance.

Keywords: Convolutional neural networks; HAM10000 dataset; Long short-term memory; Skin cancer.

PubMed Disclaimer

Conflict of interest statement

Declarations. Competing interests: The authors declare no competing interests.

Figures

Fig. 1
Fig. 1
The hybrid LSTM-CNN model for skin cancer detection.
Fig. 2
Fig. 2
LSTM memory cell.
Fig. 3
Fig. 3
Forget gate of LSTM.
Fig. 4
Fig. 4
Input gate of LSTM.
Fig. 5
Fig. 5
Output gate of LSTM.
Algorithm 1
Algorithm 1
LSTM algorithm.
Fig. 6
Fig. 6
Max pool operation.
Algorithm 2
Algorithm 2
CNN algorithm.
Algorithm 3
Algorithm 3
Hybrid LSTM + CNN model for skin cancer detection.
Fig. 7
Fig. 7
The original skin cancer image with seven classes namely actinic keratosis, basal cell carcinoma, pigmented benign keratosis, dermatofibroma, melanocytic nevi, vascular lesions, and melanoma.
Fig. 8
Fig. 8
Comparative analysis of the proposed model in terms of precision, recall, F1-score, and G-measure.
Fig. 9
Fig. 9
Result analysis of the proposed model.
Fig. 10
Fig. 10
Confusion matrix for the DT, SVM, RF, KNN, ANN and the proposed model against the HAM10000 dataset.
Fig. 11
Fig. 11
AUC analyses of ROC curves for (a) DT; (b) SVM; (c) RF; (d) KNN; (e) ANN; and (f) the proposed model against HAM10000 dataset.
Fig. 12
Fig. 12
Performance of the proposed model throughout 10, 20, 30, and 40 Epochs in terms of accuracy, F1 score and AUC against HAM10000 dataset.
Fig. 13
Fig. 13
Comparative accuracy of skin lesion classification models across classes.

Similar articles

References

    1. Miller, K. D. et al. Cancer treatment and survivorship statistics. CA Cancer J. Clin.69(5), 363–385 (2022). - PubMed
    1. Kim, I. & He, Y.-Y. Ultraviolet radiation-induced non-melanoma skin cancer: Regulation of DNA damage repair and inflammation. Genes Dis.1(2), 188–198 (2014). - PMC - PubMed
    1. Ferlay, J. et al. Cancer incidence and mortality patterns in Europe: Estimates for 40 countries and 25 major cancers in 2018. Eur. J. Cancer103, 356–387 (2018). - PubMed
    1. Cazzato, G. et al. Artificial intelligence in dermatopathology: New insights and perspectives. Dermatopathology8(3), 418–425 (2021). - PMC - PubMed
    1. Kasmi, R. & Mokrani, K. Classification of malignant melanoma and benign skin lesions: Implementation of automatic ABCD rule. IET Image Process.10(6), 448–455 (2016).

LinkOut - more resources