This repository implements a deep learning pipeline for skin lesion classification using the InceptionResNetV2 architecture on the HAM10000 dermoscopic image dataset, including data preprocessing, augmentation, class imbalance handling, and detailed performance evaluation. In this project, a deep learning–based skin lesion classification pipeline was implemented using transfer learning with InceptionResNetV2 on the HAM10000 dataset. The approach relies solely on dermoscopic RGB images, without incorporating any additional metadata or handcrafted features. Initially, image paths were mapped to diagnostic labels using the official HAM10000 metadata file. The dataset was then split into training and validation sets using stratified sampling to preserve class distributions. Due to the strong class imbalance inherent in the dataset, class weights were computed and applied during training to mitigate bias toward majority classes. Data augmentation techniques, including random flips, rotations, and zoom operations, were used to improve model generalization.
The core architecture is based on InceptionResNetV2 pre-trained on ImageNet, with the top classification layers removed. The base network was kept frozen to leverage pre-trained feature representations while reducing overfitting. On top of the backbone, a global average pooling layer, dropout regularization, and a fully connected softmax layer were added to perform 7-class classification. The model was trained using the Adam optimizer and sparse categorical cross-entropy loss, with early stopping applied to select the best-performing weights based on validation loss.
Evaluation on the validation set resulted in an overall accuracy of approximately 61%. The model demonstrated strong performance on the dominant class (nv, melanocytic nevi), achieving high recall and F1-score, while performance on rare classes such as df and vasc remained limited, primarily due to data imbalance. These results highlight both the robustness of the InceptionResNetV2 architecture and the challenges of multi-class skin lesion classification in imbalanced medical datasets.
When compared with previously implemented DenseNet121 and ConvNeXt-Small models, this approach did not yield a significant improvement in overall accuracy or class-wise performance, despite its deeper and more computationally expensive architecture. In some classes, performance was comparable or slightly inferior, suggesting that increased model complexity does not necessarily translate into better results in data-limited medical imaging tasks. The complete implementations of the DenseNet121 and ConvNeXt-Small models are available in separate GitHub repositories shared earlier.
The experiments in this repository are conducted using the HAM10000 (Human Against Machine with 10000 training images) dataset, which is publicly available on Kaggle: https://www.kaggle.com/datasets/kmader/skin-cancer-mnist-ham10000