This project focuses on the classification of skin lesions into seven categories using deep learning techniques. Leveraging the HAM10000 dataset (~10,000 dermatoscopic images), I developed a custom Convolutional Neural Network (CNN) and enhanced it further using transfer learning with ResNet50. Model explainability was incorporated through Grad-CAM to provide visual insights into predictions.
HAM10000 - Human Against Machine with 10000 training images
A curated collection of multi-source dermatoscopic images of common pigmented skin lesions:
- ~10,000 images
- 7 classes:
- Melanocytic nevi (nv)
- Melanoma (mel)
- Benign keratosis-like lesions (bkl)
- Basal cell carcinoma (bcc)
- Actinic keratoses (akiec)
- Vascular lesions (vasc)
- Dermatofibroma (df)
- 3 Convolutional blocks with ReLU activation & MaxPooling
- Fully connected dense layers
- Batch Normalization & Dropout for regularization
- Softmax output layer for 7-class classification
- Pretrained on ImageNet
- Fine-tuned on HAM10000 data
- Custom top layers for adaptation to skin lesion classification
- Image augmentation: rotation, flipping, zoom, brightness
- Image normalization
- Dimensionality reduction for improved efficiency
- Early stopping & learning rate scheduler
- Grad-CAM for model explainability
| Model | Accuracy | Loss | Notes |
|---|---|---|---|
| Custom CNN | ~74% | ~0.76 | From scratch, no pretraining |
| ResNet50 (TL) | ~85% | ~0.45 | Fine-tuned on skin images |
Grad-CAM was used to generate class activation maps that highlight regions of the image contributing most to the model's prediction.
- Python
- TensorFlow / Keras
- Scikit-learn
- OpenCV
- Matplotlib & Seaborn
- Pandas & NumPy
βββ skin_cancer_prediction.ipynb # Main Jupyter Notebook (Kaggle)
βββ data/ # Contains HAM10000 images & metadata
βββ models/ # Saved model checkpoints
βββ outputs/ # Grad-CAM visualizations
βββ README.md # Project overview