Skin Cancer Detection and Classification Through Medical Image Analysis Using EfficientNet
Abstract
1. Introduction
- To develop a lightweight and efficient multi-class skin lesion classification framework using EfficientNet-B0.
- To mitigate dataset imbalance by applying augmentation and downsampling techniques for achieving fair class representation.
- To enhance classification robustness and accuracy by integrating transfer learning, full-network fine-tuning, test-time augmentation (TTA), and Monte Carlo dropout (MC dropout).
- To benchmark the proposed model against state-of-the-art CNN architectures for comprehensive validation.
- To design and deploy a web-based skin cancer detection system capable of providing automated classification, confidence scores, and lesion visualization for practical dermatology applications.
- Development of an EfficientNet-B0-based classification model tailored for seven diagnostic categories of skin lesions, ensuring high accuracy and computational efficiency.
- Construction of a balanced dataset from HAM10000, consisting of 7512 dermoscopic images, achieved through augmentation of minority classes and downsampling of majority classes.
- Integration of test-time augmentation (TTA) and Monte Carlo dropout (MC dropout) for improved uncertainty quantification and reliable predictions.
- Achievement of a peak classification accuracy of 97.15%, outperforming several state-of-the-art CNN models, validated through confusion matrix, ROC–AUC, precision–recall, and F1-score analyses.
- Deployment of the proposed model on a web-based clinical decision support platform, demonstrating strong applicability in dermatology practice.
2. Materials and Methods
2.1. Proposed Architecture
2.2. Sequence Diagram for Proposed Work
Algorithm 1 Skin Lesion Image Classification using EfficientNet-B0 with Enhanced TTA and MC Dropout |
Input: Set of images X = {x1, x2, …, xn} Trained model weights W Augmentations A = {Original, HFlip, VFlip, ColorJitter, Rotation} Number of MC Dropout passes M (e.g., M = 10) Device device ∈ {cpu, cuda} Output: Predicted class labels = {, , …, } and confidence scores S = {s1, s2, …, sn} // xa = Augmented version of image x using a // pa,m = Softmax output for augmentation a at dropout pass m // P = List of all predictions across TTA and MC Dropout // pavg = Mean prediction vector 1: Model Setup 2: Load EfficientNet-B0 model 3: Replace classifier with final layer for number of classes 4: Load trained weights W into model 5: Move model to device 6: Set model to evaluation mode 7: for all layer m in model do 8: if m is Dropout then 9: Set m to train mode // Enable MC Dropout at inference 10: end if 11: end for 12: Initialize ← [], S ← [] 13: for all image x in X do 14: Preprocess x (resize 224 × 224, normalize, convert to tensor) 15: Initialize P ← [] 16: for all augmentation a in A do 17: Apply augmentation a to x, result is xa 18: for m = 1 to M do 19: pa,m ← softmax(model(xa)) 20: Append pa,m to P 21: end for 22: end for 23: pavg ← mean(P) 24: ← arg max(pavg) 25: s ← max(pavg) 26: Append to , s to S 27: end for 28: return , S |
2.3. Computational Details
2.4. Data Preparation and Initialization
2.5. Model Setup and Implementation
2.5.1. Model Architecture and Transfer Learning
2.5.2. Model Training
2.5.3. Fine-Tuning
2.6. Model Evaluation
3. Results and Discussion
3.1. Training and Validation Performance
3.2. Fine-Tuning Performance
3.3. Test Set Evaluation
3.4. Confusion Matrix
3.5. AUC and ROC Curves
3.6. Web-Based Skin Cancer Detection System Results
4. Conclusions
Author Contributions
Funding
Conflicts of Interest
Abbreviations
DL | Deep Learning |
ML | Machine Learning |
CNN | Convolutional Neural Network |
HAM | Human Against Machine |
TTA | Test-Time Augmentation |
AKIEC | Actinic Keratoses and Intraepithelial Carcinoma |
BCC | Basal Cell Carcinoma, |
DF | Dermatofibroma |
VASC | Vascular Lesion |
BCAT | Brain Computer Aptitude Test |
BKL | Benign Keratosis |
MEL | Melanoma |
References
- Ashfaq, N.; Suhail, Z.; Khalid, A.; Sarwar, N.; Irshad, A.; Yaman, O.; Alubaidi, A.; Ahmed, F.M.; Almalki, F.A. SkinSight: Advancing deep learning for skin cancer diagnosis and classification. Discov. Comput. 2025, 28, 63. [Google Scholar] [CrossRef]
- Kavitha, C.; Priyanka, S.; Kumar, M.P.; Kusuma, V. Skin Cancer Detection and Classification Using Deep Learning Techniques. Procedia Comput. Sci. 2024, 235, 2793–2802. [Google Scholar] [CrossRef]
- Naeem, A.; Farooq, M.S.; Khelifi, A.; Abid, A. Malignant Melanoma Classification Using Deep Learning: Datasets, Performance Measurements, Challenges and Opportunities. IEEE Access 2020, 8, 110575–110597. [Google Scholar] [CrossRef]
- Balaha, H.M.; Hassan, A.E.-S. Skin cancer diagnosis based on deep transfer learning and sparrow search algorithm. Neural Comput. Appl. 2023, 35, 815–853. [Google Scholar] [CrossRef]
- Alotaibi, A.; AlSaeed, D. Skin Cancer Detection Using Transfer Learning and Deep Attention Mechanisms. Diagnostics 2025, 15, 99. [Google Scholar] [CrossRef]
- Djaroudib, K.; Lorenz, P.; Bouzida, R.B.; Merzougui, H. Skin Cancer Diagnosis Using VGG16 and Transfer Learning: Analyzing the Effects of Data Quality over Quantity on Model Efficiency. Appl. Sci. 2024, 14, 7447. [Google Scholar] [CrossRef]
- Nazari, S.; Garcia, R. Automatic Skin Cancer Detection Using Clinical Images: A Comprehensive Review. Life 2023, 13, 2123. [Google Scholar] [CrossRef]
- Naqvi, M.; Gilani, S.Q.; Syed, T.; Marques, O.; Kim, H.-C. Skin Cancer Detection Using Deep Learning—A Review. Diagnostics 2023, 13, 1911. [Google Scholar] [CrossRef]
- Naseri, H.; Safaei, A.A. Diagnosis and prognosis of melanoma from dermoscopy images using machine learning and deep learning: A systematic literature review. BMC Cancer 2025, 25, 75. [Google Scholar] [CrossRef]
- Magalhaes, C.; Mendes, J.; Vardasca, R. Systematic Review of Deep Learning Techniques in Skin Cancer Detection. BioMedInformatics 2024, 4, 2251–2270. [Google Scholar] [CrossRef]
- Imran, A.; Nasir, A.; Bilal, M.; Sun, G.; Alzahrani, A.; Almuhaimeed, A. Skin Cancer Detection Using Combined Decision of Deep Learners. IEEE Access 2022, 10, 118198–118212. [Google Scholar] [CrossRef]
- Moturi, D.; Surapaneni, R.K.; Avanigadda, V.S.G. Developing an efficient method for melanoma detection using CNN techniques. J. Egypt. Natl. Cancer Inst. 2024, 36, 6. [Google Scholar] [CrossRef]
- Kreouzi, M.; Theodorakis, N.; Feretzakis, G.; Paxinou, E.; Sakagianni, A.; Kalles, D.; Anastasiou, A.; Verykios, V.S.; Nikolaou, M. Deep Learning for Melanoma Detection: A Deep Learning Approach to Differentiating Malignant Melanoma from Benign Melanocytic Nevi. Cancers 2025, 17, 28. [Google Scholar] [CrossRef]
- Tahir, M.; Naeem, A.; Malik, H.; Tanveer, J.; Naqvi, R.A.; Lee, S.-W. DSCC_Net: Multi-Classification Deep Learning Models for Diagnosing of Skin Cancer Using Dermoscopic Images. Cancers 2023, 15, 2179. [Google Scholar] [CrossRef]
- Naeem, A.; Anees, T.; Khalil, M.; Zahra, K.; Naqvi, R.A.; Lee, S.-W. SNC_Net: Skin Cancer Detection by Integrating Handcrafted and Deep Learning-Based Features Using Dermoscopy Images. Mathematics 2024, 12, 1030. [Google Scholar] [CrossRef]
- Zia Ur Rehman, M.; Ahmed, F.; Alsuhibany, S.A.; Jamal, S.S.; Zulfiqar Ali, M.; Ahmad, J. Classification of Skin Cancer Lesions Using Explainable Deep Learning. Sensors 2022, 22, 6915. [Google Scholar] [CrossRef]
- Karki, R.; G C, S.; Rezazadeh, J.; Khan, A. Deep Learning for Early Skin Cancer Detection: Combining Segmentation, Augmentation, and Transfer Learning. Big Data Cogn. Comput. 2025, 9, 97. [Google Scholar] [CrossRef]
- Gouda, W.; Sama, N.U.; Al-Waakid, G.; Humayun, M.; Jhanjhi, N.Z. Detection of Skin Cancer Based on Skin Lesion Images Using Deep Learning. Healthcare 2022, 10, 1183. [Google Scholar] [CrossRef]
- Natha, P.; Rajeswari, P.R. Skin Cancer Detection Using Machine Learning Classification Models. Int. J. Intell. Syst. Appl. Eng. 2023, 12, 139–145. [Google Scholar]
- Das, S.; Kumar, V.; Cicceri, G. Chatbot Enable Brain Cancer Prediction Using Convolutional Neural Network for Smart Healthcare. In Healthcare-Driven Intelligent Computing Paradigms to Secure Futuristic Smart Cities; Chapman and Hall/CRC: Boca Raton, FL, USA, 2024; pp. 268–279. [Google Scholar]
- Ashafuddula, N.I.M.; Islam, R. Melanoma skin cancer and nevus mole classification using intensity value estimation with convolutional neural network. Comput. Sci. 2023, 24, 277–296. [Google Scholar] [CrossRef]
- Rashad, N.M.; Abdelnapi, N.M.; Seddik, A.F.; Sayedelahl, M.A. Automating skin cancer screening: A deep learning. J. Eng. Appl. Sci. 2025, 72, 6. [Google Scholar] [CrossRef]
- De, A.; Mishra, N.; Chang, H.-T. An approach to the dermatological classification of histopathological skin images using a hybridized CNN-DenseNet model. PeerJ Comput. Sci. 2024, 10, e1884. [Google Scholar] [CrossRef]
- Abohashish, S.M.M.; Amin, H.H.; Elsedimy, E.I. Enhanced Melanoma and Non-Melanoma Skin Cancer Classification Using Hybrid Deep Learning Models. Sci. Rep. 2025, 15, 4598. [Google Scholar] [CrossRef]
- Mukadam, S.B.; Patil, H.Y. Skin Cancer Classification Framework Using Enhanced Super Resolution Generative Adversarial Network and Custom Convolutional Neural Network. Appl. Sci. 2023, 13, 1210. [Google Scholar] [CrossRef]
- Wang, S.; Xie, J.; Cui, Y.; Chen, Z. Colorectal Polyp Detection Model by Using Super-Resolution Reconstruction and YOLO. Electronics 2024, 13, 2298. [Google Scholar] [CrossRef]
- Emara, H.M.; Shoaib, M.R.; El-Shafai, W.; Elwekeil, M.; Hemdan, E.E.-D.; Fouda, M.M.; Taha, T.E.; El-Fishawy, A.S.; El-Rabaie, E.-S.M.; El-Samie, F.E.A. Simultaneous Super-Resolution and Classification of Lung Disease Scans. Diagnostics 2023, 13, 1319. [Google Scholar] [CrossRef] [PubMed]
Epoch | Training Loss | Training Accuracy | Validation Loss | Validation Accuracy | |||||
⋮ | 1 | ⋮ | 1.2301 | ⋮ | 57.74% | ⋮ | 1.0228 | ⋮ | 64.10% |
15 | 0.6689 | 75.53% | 0.7460 | 73.40% |
Train:Val:Test Ratio | EfficientNet-B0 | ResNet50 | DenseNet121 | MobileNet | InceptionV3 |
60:20:20 | 74.18% | 70.79% | 74.38% | 72.85% | 65.67% |
70:15:15 | 89.36% | 85.42% | 86.17% | 84.95% | 80.23% |
80:10:10 | 74.60% | 74.20% | 74.20% | 73.80% | 67.42% |
90:5:5 | 77.39% | 73.94% | 73.94% | 73.14% | 67.29% |
Epoch | Train Loss | Train Accuracy | Validation Loss | Validation Accuracy | |||||
⋮ | 1 | ⋮ | 1.0371 | ⋮ | 63.34% | ⋮ | 0.5411 | ⋮ | 80.59% |
15 | 0.0321 | 99.08% | 0.4260 | 89.36% |
Class | Precision | Recall | F1-Score | Support |
---|---|---|---|---|
akiec | 0.99 | 0.98 | 0.98 | 150 |
bcc | 0.98 | 0.97 | 0.98 | 160 |
bkl | 0.96 | 0.95 | 0.95 | 170 |
df | 1.00 | 1.00 | 1.00 | 120 |
mel | 0.96 | 0.95 | 0.95 | 180 |
nv | 0.97 | 0.97 | 0.97 | 220 |
vasc | 1.00 | 1.00 | 1.00 | 127 |
Accuracy | 0.9715 | 1127 | ||
Macro Avg. | 0.98 | 0.97 | 0.97 | 1127 |
Weighted Avg. | 0.97 | 0.97 | 0.97 | 1127 |
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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Das, S.; Addya, R.K. Skin Cancer Detection and Classification Through Medical Image Analysis Using EfficientNet. NDT 2025, 3, 23. https://doi.org/10.3390/ndt3040023
Das S, Addya RK. Skin Cancer Detection and Classification Through Medical Image Analysis Using EfficientNet. NDT. 2025; 3(4):23. https://doi.org/10.3390/ndt3040023
Chicago/Turabian StyleDas, Sima, and Rishabh Kumar Addya. 2025. "Skin Cancer Detection and Classification Through Medical Image Analysis Using EfficientNet" NDT 3, no. 4: 23. https://doi.org/10.3390/ndt3040023
APA StyleDas, S., & Addya, R. K. (2025). Skin Cancer Detection and Classification Through Medical Image Analysis Using EfficientNet. NDT, 3(4), 23. https://doi.org/10.3390/ndt3040023