Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RichHene/skin-cancer-prediction_pub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Skin Cancer Prediction using CNN & Transfer Learning

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. alt text

πŸ“Š Dataset

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)

🧠 Model Architecture & Training Strategy

πŸ”¨ Custom CNN

  • 3 Convolutional blocks with ReLU activation & MaxPooling
  • Fully connected dense layers
  • Batch Normalization & Dropout for regularization
  • Softmax output layer for 7-class classification

πŸ“ˆ Transfer Learning with ResNet50

  • Pretrained on ImageNet
  • Fine-tuned on HAM10000 data
  • Custom top layers for adaptation to skin lesion classification

πŸ§ͺ Techniques Used

  • Image augmentation: rotation, flipping, zoom, brightness
  • Image normalization
  • Dimensionality reduction for improved efficiency
  • Early stopping & learning rate scheduler
  • Grad-CAM for model explainability

🧾 Results

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 Visualization

Grad-CAM was used to generate class activation maps that highlight regions of the image contributing most to the model's prediction.

Example: Grad-CAM Example

πŸ’» Tools & Libraries

  • Python
  • TensorFlow / Keras
  • Scikit-learn
  • OpenCV
  • Matplotlib & Seaborn
  • Pandas & NumPy

πŸ“ Project Structure

β”œβ”€β”€ 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published