An EfficientNetB4-Based CNN Model for Skin Lesion Classification
Received: 9 October 2025 | Revised: 9 November 2025 and 28 November 2025 | Accepted: 29 November 2025 | Online: 4 April 2026
Corresponding author: Muhammad Amir Khan
Abstract
Skin cancer, with over three million new cases per year worldwide, is a significant public health issue, with the most lethal form being melanoma. Early detection of skin cancer is crucial for higher survival rates, but the visual similarity of lesions and class imbalance in image datasets such as HAM10000 complicate diagnosis. This study presents a cutting-edge deep learning model based on EfficientNetB4, reinforced by a Soft Attention block to improve the classification of skin lesions. Using the HAM10000 dataset, class imbalance is addressed through data augmentation, such as random rotation, flip, and MixUp, to obtain an equal representation of the diagnostic classes. The proposed architecture yields enhanced performance with a global accuracy of 93.09%, macro F1-score of 0.8352, and ROC-AUC of 0.9901. Particularly noteworthy, precision in melanoma was as high as 0.5874 with a recall of 0.7706, demonstrating strong identification of high-impact cases despite underrepresentation in areas. Discriminability is amplified by the Soft Attention module, indicating diagnostically important image regions and reducing misclassification errors. Compared to state-of-the-art models, the proposed approach has higher stability and generalizability, particularly on imbalanced datasets, offering a rich resource for dermatological clinical practice. This work contributes to AI-based medical imaging by offering an interpretable and rational paradigm for early skin cancer detection that holds promise for supporting high-risk area dermatologists.
Keywords:
machine learning, convolutional neural network, skin lesion classification, soft attention mechanism, HAM10000 datasetDownloads
References
R. L. Siegel, K. D. Miller, N. S. Wagle, and A. Jemal, "Cancer statistics, 2023," CA: a cancer journal for clinicians, vol. 73, no. 1, pp. 17–48, Jan. 2023. DOI: https://doi.org/10.3322/caac.21763
M. A. Khan et al., "An Advanced Deep Learning Framework for Skin Cancer Classification," The Review of Socionetwork Strategies, vol. 19, no. 1, pp. 111–130, Apr. 2025. DOI: https://doi.org/10.1007/s12626-025-00181-x
A. Esteva et al., "Dermatologist-level classification of skin cancer with deep neural networks," Nature, vol. 542, no. 7639, pp. 115–118, Feb. 2017. DOI: https://doi.org/10.1038/nature21056
T. J. Brinker et al., "Deep learning outperformed 136 of 157 dermatologists in a head-to-head dermoscopic melanoma image classification task," European Journal of Cancer, vol. 113, pp. 47–54, May 2019.
A. Mahbod, G. Schaefer, C. Wang, R. Ecker, and I. Ellinge, "Skin Lesion Classification Using Hybrid Deep Neural Networks," in ICASSP 2019 - 2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), May 2019, pp. 1229–1233. DOI: https://doi.org/10.1109/ICASSP.2019.8683352
N. Gessert et al., "Skin Lesion Classification Using CNNs With Patch-Based Attention and Diagnosis-Guided Loss Weighting," IEEE Transactions on Biomedical Engineering, vol. 67, no. 2, pp. 495–503, Oct. 2020. DOI: https://doi.org/10.1109/TBME.2019.2915839
E. Tjoa and C. Guan, "A Survey on Explainable Artificial Intelligence (XAI): Toward Medical XAI," IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 11, pp. 4793–4813, Aug. 2021. DOI: https://doi.org/10.1109/TNNLS.2020.3027314
A. G. C. Pacheco and R. A. Krohling, "Recent advances in deep learning applied to skin cancer detection." arXiv, Dec. 06, 2019.
S. H. Kassani, P. H. Kassasni, M. J. Wesolowski, K. A. Schneider, and R. Deters, "Automatic Detection of Coronavirus Disease (COVID-19) in X-ray and CT Images: A Machine Learning-Based Approach." arXiv, 2020. DOI: https://doi.org/10.1016/j.bbe.2021.05.013
B. Harangi, "Skin lesion classification with ensembles of deep convolutional neural networks," Journal of Biomedical Informatics, vol. 86, pp. 25–32, Oct. 2018. DOI: https://doi.org/10.1016/j.jbi.2018.08.006
T. Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár, "Focal Loss for Dense Object Detection," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 42, no. 2, pp. 318–327, Oct. 2020. DOI: https://doi.org/10.1109/TPAMI.2018.2858826
K. Sethanan et al., "Double AMIS-ensemble deep learning for skin cancer classification," Expert Systems with Applications, vol. 234, Dec. 2023, Art. no. 121047. DOI: https://doi.org/10.1016/j.eswa.2023.121047
C. Venkatachalam, S. Venkatachalam, and A. Balakrishnan, "Enhanced skin cancer classification using modified efficientNetV2L with adaptive early stopping mechanism," Scientific Reports, vol. 15, no. 1, Nov. 2025, Art. no. 38304. DOI: https://doi.org/10.1038/s41598-025-22228-3
B. Ozdemir and I. Pacal, "A robust deep learning framework for multiclass skin cancer classification," Scientific Reports, vol. 15, no. 1, Feb. 2025, Art. no. 4938. DOI: https://doi.org/10.1038/s41598-025-89230-7
A. Alrabai, A. Echtioui, and F. Kallel, "Exploring Pre-Trained Models for Skin Cancer Classification," Applied System Innovation, vol. 8, no. 2, Mar. 2025. DOI: https://doi.org/10.3390/asi8020035
V. A. Rajendran and S. Shanmugam, "Automated Skin Cancer Detection and Classification using Cat Swarm Optimization with a Deep Learning Model," Engineering, Technology & Applied Science Research, vol. 14, no. 1, pp. 12734–12739, Feb. 2024. DOI: https://doi.org/10.48084/etasr.6681
M. S. Al Huda, T. E. Shrestha, A. Hossain, N. B. Sharif, M. A. Ali, and T. I. Erdei, "DeepMelaNet: Advancing Melanoma Stage Classification in Skin Cancer Diagnosis," Engineering, Technology & Applied Science Research, vol. 15, no. 1, pp. 19627–19635, Feb. 2025. DOI: https://doi.org/10.48084/etasr.8336
I. Aruk, I. Pacal, and A. N. Toprak, "A comprehensive comparison of convolutional neural network and visual transformer models on skin cancer classification," Computational Biology and Chemistry, vol. 120, Feb. 2026, Art. no. 108713. DOI: https://doi.org/10.1016/j.compbiolchem.2025.108713
I. Aruk, I. Pacal, and A. N. Toprak, "A novel hybrid ConvNeXt-based approach for enhanced skin lesion classification," Expert Systems with Applications, vol. 283, July 2025, Art. no. 127721. DOI: https://doi.org/10.1016/j.eswa.2025.127721
M. A. Khan et al., "Automatic melanoma and non-melanoma skin cancer diagnosis using advanced adaptive fine-tuned convolution neural networks," Discover Oncology, vol. 16, no. 1, Apr. 2025, Art. no. 645. DOI: https://doi.org/10.1007/s12672-025-02279-8
M. D. Ali et al., "Breast Cancer Classification through Meta-Learning Ensemble Technique Using Convolution Neural Networks," Diagnostics, vol. 13, no. 13, June 2023, Art. no. 2242. DOI: https://doi.org/10.3390/diagnostics13132242
P. Tschandl, C. Rosendahl, and H. Kittler, "The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions," Scientific Data, vol. 5, no. 1, Aug. 2018, Art. no. 180161. DOI: https://doi.org/10.1038/sdata.2018.161
M. Tan and Q. Le, "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks," in Proceedings of the 36th International Conference on Machine Learning, May 2019, pp. 6105–6114.
R. Yamashita, M. Nishio, R. K. G. Do, and K. Togashi, "Convolutional neural networks: an overview and application in radiology," Insights into Imaging, vol. 9, no. 4, pp. 611–629, Aug. 2018. DOI: https://doi.org/10.1007/s13244-018-0639-9
H. C. Shin et al., "Deep Convolutional Neural Networks for Computer-Aided Detection: CNN Architectures, Dataset Characteristics and Transfer Learning," IEEE Transactions on Medical Imaging, vol. 35, no. 5, pp. 1285–1298, Feb. 2016. DOI: https://doi.org/10.1109/TMI.2016.2528162
Downloads
How to Cite
License
Copyright (c) 2026 Ali Khalid, Razia Manan, Mohammad Shahid, Umar Farooq Khattak, Muhammad Amir Khan

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain the copyright and grant the journal the right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) after its publication in ETASR with an acknowledgement of its initial publication in this journal.
